home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / iv_pm.zip / iv / src / InterViews / worldview.h < prev   
C/C++ Source or Header  |  1990-12-20  |  3KB  |  101 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. /****
  24.  
  25.  Copyright (C) 1990 Texas Instruments Incorporated.
  26.  
  27.  Permission is granted to any individual or institution to use, copy, modify,
  28.  and distribute this software, provided that this complete copyright and
  29.  permission notice is maintained, intact, in all copies and supporting
  30.  documentation.
  31.  
  32.  Texas Instruments Incorporated provides this software "as is" without express
  33.  or implied warranty.
  34.  
  35. ****/
  36.  
  37. /*
  38.  * Useful for writing window managers.
  39.  */
  40.  
  41. #ifndef worldview_h
  42. #define worldview_h
  43.  
  44. #include <InterViews/interactor.h>
  45.  
  46. class World;
  47.  
  48. typedef void* RemoteInteractor;
  49.  
  50. class WorldView : public Interactor {
  51. public:
  52.     WorldView(World*);
  53.     ~WorldView();
  54.  
  55.     RemoteInteractor Find(Coord x, Coord y);
  56.     RemoteInteractor Choose(Cursor*, boolean waitforup = true);
  57.     virtual void InsertRemote(RemoteInteractor);
  58.     virtual void ChangeRemote(
  59.     RemoteInteractor, Coord left, Coord top, unsigned long w, unsigned long h
  60.     );
  61.     void Move(RemoteInteractor, Coord left, Coord top);
  62.     void Change(
  63.     RemoteInteractor, Coord left, Coord top, unsigned long w, unsigned long h
  64.     );
  65.     void Raise(RemoteInteractor);
  66.     void Lower(RemoteInteractor);
  67.     void Focus(RemoteInteractor);
  68.     RemoteInteractor GetFocus () { return curfocus; }
  69.     void GetList(RemoteInteractor*&, unsigned long&);
  70.     void FreeList(RemoteInteractor*);
  71.     void GetInfo(RemoteInteractor, Coord& x1, Coord& y1, Coord& x2, Coord& y2);
  72.     boolean GetHints(RemoteInteractor, Coord& x, Coord& y, Shape&);
  73.     void SetHints(RemoteInteractor, Coord x, Coord y, Shape&);
  74.     RemoteInteractor GetIcon(RemoteInteractor);
  75.     void AssignIcon(RemoteInteractor i, RemoteInteractor icon);
  76.     void UnassignIcon(RemoteInteractor i);
  77.     char* GetName(RemoteInteractor);
  78.     RemoteInteractor TransientOwner(RemoteInteractor);
  79.     void RedrawAll();
  80. protected:
  81.     class World* world;
  82.  
  83.     void GrabMouse(Cursor*);
  84.     void UngrabMouse();
  85.     boolean GrabButton(unsigned button, unsigned modifiers, Cursor*);
  86.     void UngrabButton(unsigned button, unsigned modifiers);
  87.     void Lock();
  88.     void Unlock();
  89.     void ClearInput();
  90.     void MoveMouse(Coord x, Coord y);
  91.     void Map(RemoteInteractor);
  92.     void MapRaised(RemoteInteractor);
  93.     void Unmap(RemoteInteractor);
  94. private:
  95.     RemoteInteractor curfocus;
  96.  
  97.     void Init(World*);
  98. };
  99.  
  100. #endif
  101.