home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / mac / UserInterface / CMouseDispatcher.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.4 KB  |  90 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. #pragma once
  20.  
  21. #include <LAttachment.h>
  22.  
  23. const MessageT    msg_MouseEntered        =    'MsEd';
  24. const MessageT    msg_MouseWithin            =    'MsWn';
  25. const MessageT    msg_MouseLeft            =    'MsLt';
  26.  
  27. typedef struct SMouseTrackParms {
  28.     Point            portMouse;
  29.     EventRecord        macEvent;
  30. } SMouseTrackParms;
  31.  
  32.  
  33. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  34. //    CMouseDispatcher
  35. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  36.  
  37. class CMouseDispatcher : public LAttachment
  38. {
  39.     public:
  40.                             CMouseDispatcher();
  41.     protected:
  42.  
  43.         virtual void        ExecuteSelf(
  44.                                     MessageT            inMessage,
  45.                                     void*                ioParam);
  46. };
  47.  
  48.  
  49. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  50. //    CMouseTrackAttachment
  51. //
  52. //     Abstract base class for attachments that want to get mouse tracking
  53. //    messages.
  54. //
  55. //     In order to use these class of attachments, a CMouseDispatcher must be
  56. //    present.
  57. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  58.  
  59. class CMouseTrackAttachment : public LAttachment
  60. {
  61.     public:
  62.                             CMouseTrackAttachment();
  63.                             CMouseTrackAttachment(LStream* inStream);
  64.         
  65.     protected:
  66.  
  67.         virtual void        ExecuteSelf(
  68.                                     MessageT            inMessage,
  69.                                     void*                ioParam);
  70.  
  71.         virtual void        MouseEnter(
  72.                                     Point                inPortPt,
  73.                                     const EventRecord&    inMacEvent) = 0;
  74.  
  75.         virtual void        MouseWithin(
  76.                                     Point                inPortPt,
  77.                                     const EventRecord&    inMacEvent) = 0;
  78.  
  79.         virtual void        MouseLeave(void) = 0;
  80.  
  81.         Boolean                EnsureOwningPane();
  82.  
  83.         LPane*                mOwningPane;
  84.         Boolean                mMustBeActive;
  85.         Boolean                mMustBeEnabled;
  86. };
  87.  
  88.  
  89.  
  90.