
Class documentation.

$Ident: This file is part of the 'Gt-library' 1.0.0 $
$Copyright: (C) 1997 by Gran Gustafsson $

-------------------------------------------------------------------------

** GtWindow **
--------------

Name:       GtWindow
Superclass: GtDrawable
Include:    gtwindow.h


  This class encapsulates a X window and provide som methods that involve
windows. Mouse pointer grabs handling are some of those methods.

  There is a lot more operation that can be performed involving windows but
those provided by this class has proved to be sufficient for the simple
manipulations required in widgets.


Tags for GtWindow:
------------------
  
   -- GtDrawable tags --

  Name                   ISGR  Type            Defaults
  -----------------------------------------------------   
  GT_Display            (I.G.) (GtDisplay *)   NULL
  GT_XDrawable          (..G.) (Drawable)      0
  
   -- GtWindow tags --

  Name                   ISGR  Type            Defaults
  -----------------------------------------------------
  GT_Parent             (I.G.) (GtWindow *)    DefaultRootWindow()
  GT_XPos               (ISG.) (word)          0
  GT_YPos               (ISG.) (word)          0
  GT_XSize              (ISG.) (word)          1
  GT_YSize              (ISG.) (word)          1
  GT_BWidth             (ISG.) (long)          0
  GT_Depth              (I.G.) (long)          CopyFromParent
  GT_Class              (I.G.) (long)          CopyFromParent
  GT_Visual             (I.G.) (Visual *)      CopyFromParent
  GT_BackPixmap         (ISG.) (GtPixmap *)    NULL
  GT_BackPixel          (ISG.) (ulong)         Undefined
  GT_BorderPixmap       (ISG.) (GtPixmap *)    NULL
  GT_BorderPixel        (ISG.) (ulong)         Undefined
  GT_BitGravity         (ISG.) (long)          ForgetGravity
  GT_WinGravity         (ISG.) (long)          NorthWestGravity
  GT_BackingStore       (ISG.) (long)          NotUseful
  GT_BackingPlanes      (ISG.) (long)          All planes
  GT_BackingPixel       (ISG.) (ulong)         0
  GT_Override           (ISG.) (sbool)         FALSE
  GT_SaveUnder          (ISG.) (sbool)         FALSE
  GT_EventMask          (ISG.) (ulong)         0
  GT_DontPropagate      (ISG.) (ulong)         0
  GT_Colormap           (ISG.) (GtColormap *)  CopyFromParent
  GT_Cursor             (ISG.) (GtCursor *)    NULL
  GT_Raised             (ISG.) (sbool)         FALSE
  GT_DontFreeX          (I.G.) (sbool)         FALSE
  GT_XWindow            (I.G.) (Window)        0

  All tags not described below are values used in a XSetWindowAttributes or
in the "XCreateWindow()" function. Some names have been shortened and others
take an encapsulating Gt object as value instead of a X resource.

  
  * GT_Parent
    All windows need a parent when created and this tag provide one.


  * GT_Raised
    If the value of this tag i "TRUE" then the window will be mapped on top
    of it's siblings. Otherwise the order is not changed when the window is
    mapped.
    

  * GT_DontFreeX
    If this tag is true the encapsulated window is not destroy when the
    GtWindow object is destroyed.


  * GT_XWindow
    This tag provide a X window to encapsulate. The "GT_DontFreeX" tag is
    by default true if this tag is used in initializing the GtWindow.

    NOTE: All features of the encapsulation may not work correctly for
    objects using the "GT_XWindow" tag in initialization.


Callbacks for GtWindow:
-----------------------

  ** NONE DEFINED **
  

Methods for GtWindow:
---------------------

   -- User methods --
   
  void Map(sbool map)
  void Move(int xp,int yp)
  void Resize(int xs,int ys)
  void MoveResize(int xp,int yp,int xs,int ys)
  void Raise(void)
  void Lower(void)
  Window XWin(void)
  void Clear(void)
  void Clear(int xp,int yp,int xs,int ys)
  sbool GrabPointer(Time tm,GtTag *tgs)
  sbool GrabPointerV(Time tm,ulong tag,...)
  void UnGrabPointer(Time tm)
  
   -- GtDrawable methods --
   
  XDr

   -- GtBase methods --
   
  Init, Set, Get, GetClass, IsSubClassOf, InitV, SetV, GetV, GetA,
  PrtErrHeader

 ----------------------------------------------------------------------------

  void Map(sbool map)
  
    - map : true if the window is to be mapped and false if it is to be
            unmapped.
    
    This method will map or unmap the window.

 ----------------------------------------------------------------------------

  void Move(int xp,int yp)
  
    - xp : x position.
    - yp : y position.
     
    This method moves a window to a new position.
  
 ----------------------------------------------------------------------------

  void Resize(int xs,int ys)
  
    - xs : x size.
    - ys : y size.
    
    This method resizes a window to a new size.
  
 ----------------------------------------------------------------------------

  void MoveResize(int xp,int yp,int xs,int ys)

    - xp : x position.
    - yp : y position.
    - xs : x size.
    - ys : y size.

    This method moves and resizes a window simultaneously.
  
 ----------------------------------------------------------------------------

  void Raise(void)
  
    This method raises a window to the top of it's siblings.
  
 ----------------------------------------------------------------------------

  void Lower(void)
  
    This methods lowers a window to the bottom of it's siblings.

 ----------------------------------------------------------------------------

  Window XWin(void)
  
    - <result> : X window encapsulated by the object.
    
    This method returns the encapsulated X window of the object.

 ----------------------------------------------------------------------------

  void Clear(void)
  
    This method clears a window with it's current background pixmap or pixel
    value.

 ----------------------------------------------------------------------------

  void Clear(int xp,int yp,int xs,int ys)

    This method clears part of a window as the "Clear()" method above.

 ----------------------------------------------------------------------------

  sbool GrabPointer(Time tm,GtTag *tgs)
  
    - tm  : time stamp of the grab.
    - tgs : tag list to set attributes of the grab.
    
    - <result> : true if the grab was successful else false.
    
    This method will try to perform a pointer grab in a window. Possible
    tags to set attributes of the grab are:
    
     Name		Type		Defaults
     ----------------------------------------------
     GT_OwnerEvents	(sbool)		TRUE
     GT_EventMask	(ulong)		All mouse events
     GT_PointerMode	(long)		GrabModeAsync
     GT_KeyboardMode	(long)		GrabModeAsync
     GT_ConfineWindow	(GtWindow *)	NULL
     GT_Cursor		(GtCursor *)	NULL
    
    These tags correspond to the arguments to the "XGrabPointer()" function
    but with some types changed to Gt objects encapsulating X resources. 

 ----------------------------------------------------------------------------

  sbool GrabPointerV(Time tm,ulong tag,...)
  
    This method works as "GrabPointer()" above but uses varargs to handle a
    tag list as a argument list.

 ----------------------------------------------------------------------------

  void UnGrabPointer(Time tm)
  
    - tm : time stamp for the ungrab.
    
    This method ungrabs a previous pointer grab.
