home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / src / cdoble.cpp next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.1 KB  |  95 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /* 
  19.  * cdoble.cpp (CDoneObservable.cpp)
  20.  *
  21.  * Implements a link between the (cdoble) CDoneObservable Interface and
  22.  * its C++ implementation viz (doble) DoneObservableObject.
  23.  *
  24.  * dp Suresh <dp@netscape.com>
  25.  */
  26.  
  27.  
  28. // The C implementation definition of the interface.
  29. // This links it to the C++ implementation
  30. #include "cdoble.h"
  31.  
  32. #include "doble.h"        // The actual C++ object implementation
  33.  
  34. /****************************************************************************
  35.  *                 Implementation of common interface methods                    *
  36.  ****************************************************************************/
  37.  
  38.  
  39. /****************************************************************************
  40.  *                 Implementation of Object specific methods                    *
  41.  ****************************************************************************/
  42.  
  43. extern "C" JMC_PUBLIC_API(void)
  44. /*ARGSUSED*/
  45. _cdoble_addObserver(cdoble* o, jint op,
  46.                     struct nfdoer *observer,
  47.                     struct JMCException * *exceptionThrown)
  48. {
  49.     cdobleImpl *oimpl = cdoble2cdobleImpl(o);
  50.     DoneObservableObject* dob = (DoneObservableObject *)oimpl->object;
  51.     dob->addObserver(observer);
  52. }
  53.  
  54. extern "C" JMC_PUBLIC_API(jint)
  55. /*ARGSUSED*/
  56. _cdoble_countObservers(cdoble* o, jint op,
  57.                        struct JMCException * *exceptionThrown)
  58. {
  59.     cdobleImpl *oimpl = cdoble2cdobleImpl(o);
  60.     DoneObservableObject* dob = (DoneObservableObject *)oimpl->object;
  61.     return(dob->countObservers());
  62. }
  63.  
  64. extern "C" JMC_PUBLIC_API(void)
  65. /*ARGSUSED*/
  66. _cdoble_deleteObserver(cdoble* o, jint op,
  67.                        struct nfdoer *observer,
  68.                        struct JMCException * *exceptionThrown)
  69. {
  70.     cdobleImpl *oimpl = cdoble2cdobleImpl(o);
  71.     DoneObservableObject* dob = (DoneObservableObject *)oimpl->object;
  72.     dob->deleteObserver(observer);
  73. }
  74.  
  75. extern "C" JMC_PUBLIC_API(void)
  76. /*ARGSUSED*/
  77. _cdoble_deleteObservers(cdoble* o, jint op,
  78.                         struct JMCException * *exceptionThrown)
  79. {
  80.     cdobleImpl *oimpl = cdoble2cdobleImpl(o);
  81.     DoneObservableObject* dob = (DoneObservableObject *)oimpl->object;
  82.     dob->deleteObservers();
  83. }
  84.  
  85. extern "C" JMC_PUBLIC_API(void)
  86. /*ARGSUSED*/
  87. _cdoble_notifyObservers(cdoble* o, jint op, void *arg,
  88.                         struct JMCException * *exceptionThrown)
  89. {
  90.     cdobleImpl *oimpl = cdoble2cdobleImpl(o);
  91.     DoneObservableObject* dob = (DoneObservableObject *)oimpl->object;
  92.     dob->notifyObservers(o, arg);
  93. }
  94.  
  95.