Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

/src/client.hh

Go to the documentation of this file.
00001 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
00002 #ifndef   __client_hh
00003 #define   __client_hh
00004 
00005 /*! @file client.hh
00006   @brief The Client class maintains the state of a client window by handling
00007   property changes on the window and some client messages
00008 */
00009 
00010 #include "screen.hh"
00011 #include "widgetbase.hh"
00012 #include "otk/point.hh"
00013 #include "otk/strut.hh"
00014 #include "otk/rect.hh"
00015 #include "otk/eventhandler.hh"
00016 #include "otk/ustring.hh"
00017 
00018 extern "C" {
00019 #include <X11/Xlib.h>
00020 
00021 #ifdef    SHAPE
00022 #include <X11/extensions/shape.h>
00023 #endif // SHAPE
00024 }
00025 
00026 #include <string>
00027 #include <list>
00028 
00029 namespace ob {
00030 
00031 class Frame;
00032 class Screen;
00033 
00034 //! The MWM Hints as retrieved from the window property
00035 /*!
00036   This structure only contains 3 elements, even though the Motif 2.0
00037   structure contains 5. We only use the first 3, so that is all gets defined.
00038 */
00039 struct MwmHints {
00040   unsigned long flags;      //!< A bitmask of Client::MwmFlags values
00041   unsigned long functions;  //!< A bitmask of Client::MwmFunctions values
00042   unsigned long decorations;//!< A bitmask of Client::MwmDecorations values
00043   //! The number of elements in the Client::MwmHints struct
00044   static const unsigned int elements = 3;
00045 };
00046 
00047 //! Maintains the state of a client window.
00048 /*!
00049   Client maintains the state of a client window. The state consists of the
00050   hints that the application sets on the window, such as the title, or window
00051   gravity.
00052   <p>
00053   Client also manages client messages for the client window. When the
00054   application (or any application) requests something to be changed for the
00055   client, it will call the ActionHandler (for client messages) or update the
00056   class' member variables and call whatever is nessary to complete the
00057   change (such as causing a redraw of the titlebar after the title is changed).
00058 */
00059 class Client : public otk::EventHandler, public WidgetBase {
00060 public:
00061 
00062   //! The frame window which decorates around the client window
00063   /*!
00064     NOTE: This should NEVER be used inside the client class's constructor!
00065   */
00066   Frame *frame;
00067 
00068   //! Holds a list of Clients
00069   typedef std::list<Client*> List;
00070 
00071   //! The possible stacking layers a client window can be a part of
00072   enum StackLayer {
00073     Layer_Icon,       //!< 0 - iconified windows, in any order at all
00074     Layer_Desktop,    //!< 1 - desktop windows
00075     Layer_Below,      //!< 2 - normal windows w/ below
00076     Layer_Normal,     //!< 3 - normal windows
00077     Layer_Above,      //!< 4 - normal windows w/ above
00078     Layer_Top,        //!< 5 - always-on-top-windows (docks?)
00079     Layer_Fullscreen, //!< 6 - fullscreeen windows
00080     Layer_Internal,   //!< 7 - openbox windows/menus
00081     NUM_LAYERS
00082   };
00083 
00084   //! Corners of the client window, used for anchor positions
00085   enum Corner { TopLeft,
00086                 TopRight,
00087                 BottomLeft,
00088                 BottomRight };
00089 
00090   //! Possible window types
00091   enum WindowType { Type_Desktop, //!< A desktop (bottom-most window)
00092                     Type_Dock,    //!< A dock bar/panel window
00093                     Type_Toolbar, //!< A toolbar window, pulled off an app
00094                     Type_Menu,    //!< An unpinned menu from an app
00095                     Type_Utility, //!< A small utility window such as a palette
00096                     Type_Splash,  //!< A splash screen window
00097                     Type_Dialog,  //!< A dialog window
00098                     Type_Normal   //!< A normal application window
00099   };
00100 
00101   //! Possible flags for MWM Hints (defined by Motif 2.0)
00102   enum MwmFlags { MwmFlag_Functions   = 1 << 0, //!< The MMW Hints define funcs
00103                   MwmFlag_Decorations = 1 << 1  //!< The MWM Hints define decor
00104   };
00105 
00106   //! Possible functions for MWM Hints (defined by Motif 2.0)
00107   enum MwmFunctions { MwmFunc_All      = 1 << 0, //!< All functions
00108                       MwmFunc_Resize   = 1 << 1, //!< Allow resizing
00109                       MwmFunc_Move     = 1 << 2, //!< Allow moving
00110                       MwmFunc_Iconify  = 1 << 3, //!< Allow to be iconfied
00111                       MwmFunc_Maximize = 1 << 4  //!< Allow to be maximized
00112                       //MwmFunc_Close    = 1 << 5 //!< Allow to be closed
00113   };
00114 
00115   //! Possible decorations for MWM Hints (defined by Motif 2.0)
00116   enum MemDecorations { MwmDecor_All      = 1 << 0, //!< All decorations
00117                         MwmDecor_Border   = 1 << 1, //!< Show a border
00118                         MwmDecor_Handle   = 1 << 2, //!< Show a handle (bottom)
00119                         MwmDecor_Title    = 1 << 3, //!< Show a titlebar
00120                         //MwmDecor_Menu     = 1 << 4, //!< Show a menu
00121                         MwmDecor_Iconify  = 1 << 5, //!< Show an iconify button
00122                         MwmDecor_Maximize = 1 << 6  //!< Show a maximize button
00123   };
00124 
00125   //! The things the user can do to the client window
00126   enum Function { Func_Resize     = 1 << 0, //!< Allow resizing
00127                   Func_Move       = 1 << 1, //!< Allow moving
00128                   Func_Iconify    = 1 << 2, //!< Allow to be iconified
00129                   Func_Maximize   = 1 << 3, //!< Allow to be maximized
00130                   Func_Shade      = 1 << 4, //!< Allow to be shaded
00131                   Func_Fullscreen = 1 << 5, //!< Allow to be made fullscreen
00132                   Func_Close      = 1 << 6  //!< Allow to be closed
00133   };
00134   //! Holds a bitmask of Client::Function values
00135   typedef unsigned char FunctionFlags;
00136 
00137   //! The decorations the client window wants to be displayed on it
00138   enum Decoration { Decor_Titlebar    = 1 << 0, //!< Display a titlebar
00139                     Decor_Handle      = 1 << 1, //!< Display a handle (bottom)
00140                     Decor_Border      = 1 << 2, //!< Display a border
00141                     Decor_Iconify     = 1 << 3, //!< Display an iconify button
00142                     Decor_Maximize    = 1 << 4, //!< Display a maximize button
00143                     //! Display a button to toggle the window's placement on
00144                     //! all desktops
00145                     Decor_AllDesktops = 1 << 5,
00146                     Decor_Close       = 1 << 6  //!< Display a close button
00147   };
00148   //! Holds a bitmask of Client::Decoration values
00149   typedef unsigned char DecorationFlags;
00150 
00151   //! Possible actions that can be made with the _NET_WM_STATE client message
00152   enum StateAction { State_Remove = 0, //!< _NET_WM_STATE_REMOVE
00153                      State_Add,        //!< _NET_WM_STATE_ADD
00154                      State_Toggle      //!< _NET_WM_STATE_TOGGLE
00155   };
00156 
00157   //! The event mask to grab on client windows
00158   static const long event_mask = PropertyChangeMask | FocusChangeMask |
00159                                  StructureNotifyMask;
00160 
00161   //! The mask of events to not let propogate past the client
00162   /*!
00163     This makes things like xprop work on the client window, but means we have
00164     to explicitly grab clicks that we want.
00165   */
00166   static const long no_propagate_mask = ButtonPressMask | ButtonReleaseMask |
00167                                         ButtonMotionMask;
00168 
00169   //! The desktop value which indicated the window is iconified and not on any
00170   //! desktop
00171   static const long ICONIC_DESKTOP = 0xfffffffe;
00172 
00173   //! The number of unmap events to ignore on the window
00174   int ignore_unmaps;
00175   
00176 private:
00177   //! The screen number on which the client resides
00178   int      _screen;
00179   
00180   //! The actual window that this class is wrapping up
00181   Window   _window;
00182 
00183   //! The id of the group the window belongs to
00184   Window   _group;
00185 
00186   //! The client which this client is a transient (child) for
00187   Client *_transient_for;
00188 
00189   //! The clients which are transients (children) of this client
00190   Client::List _transients;
00191 
00192   //! The desktop on which the window resides (0xffffffff for all desktops)
00193   long _desktop;
00194 
00195   //! Normal window title
00196   otk::ustring  _title;
00197   //! Window title when iconifiged
00198   otk::ustring  _icon_title;
00199 
00200   //! The application that created the window
00201   std::string  _app_name;
00202   //! The class of the window, can used for grouping
00203   std::string  _app_class;
00204   //! The specified role of the window, used for identification
00205   std::string  _role;
00206 
00207   //! The type of window (what its function is)
00208   WindowType   _type;
00209 
00210   //! Position and size of the window
00211   /*!
00212     This will not always be the actual position of the window on screen, it is
00213     rather, the position requested by the client, to which the window's gravity
00214     is applied.
00215   */
00216   otk::Rect    _area;
00217 
00218   //! The window's strut
00219   /*!
00220     The strut defines areas of the screen that are marked off-bounds for window
00221     placement. In theory, where this window exists.
00222   */
00223   otk::Strut   _strut;
00224 
00225   //! The logical size of the window
00226   /*!
00227     The "logical" size of the window is refers to the user's perception of the
00228     size of the window, and is the value that should be displayed to the user.
00229     For example, with xterms, this value it the number of characters being
00230     displayed in the terminal, instead of the number of pixels.
00231   */
00232   otk::Point   _logical_size;
00233 
00234   //! Width of the border on the window.
00235   /*!
00236     The window manager will set this to 0 while the window is being managed,
00237     but needs to restore it afterwards, so it is saved here.
00238   */
00239   int _border_width;
00240 
00241   //! The minimum aspect ratio the client window can be sized to.
00242   /*!
00243     A value of 0 means this is ignored.
00244   */
00245   float _min_ratio;
00246   //! The maximum aspect ratio the client window can be sized to.
00247   /*!
00248     A value of 0 means this is ignored.
00249   */
00250   float _max_ratio;
00251   
00252   //! The minimum size of the client window
00253   /*!
00254     If the min is > the max, then the window is not resizable
00255   */
00256   otk::Point _min_size;
00257   //! The maximum size of the client window
00258   /*!
00259     If the min is > the max, then the window is not resizable
00260   */
00261   otk::Point _max_size;
00262   //! The size of increments to resize the client window by
00263   otk::Point _size_inc;
00264   //! The base size of the client window
00265   /*!
00266     This value should be subtracted from the window's actual size when
00267     displaying its size to the user, or working with its min/max size
00268   */
00269   otk::Point _base_size;
00270 
00271   //! Window decoration and functionality hints
00272   MwmHints _mwmhints;
00273   
00274   //! Where to place the decorated window in relation to the undecorated window
00275   int _gravity;
00276 
00277   //! The state of the window, one of WithdrawnState, IconicState, or
00278   //! NormalState
00279   long _wmstate;
00280 
00281   //! True if the client supports the delete_window protocol
00282   bool _delete_window;
00283   
00284   //! Was the window's position requested by the application? if not, we should
00285   //! place the window ourselves when it first appears
00286   bool _positioned;
00287   
00288   //! Can the window receive input focus?
00289   bool _can_focus;
00290   //! Urgency flag
00291   bool _urgent;
00292   //! Notify the window when it receives focus?
00293   bool _focus_notify;
00294   //! Does the client window have the input focus?
00295   bool _focused;
00296 
00297   //! The window uses shape extension to be non-rectangular?
00298   bool _shaped;
00299 
00300   //! If the window has a modal child window, then this will point to it
00301   Client *_modal_child;
00302 
00303   //! The window is modal, so it must be processed before any windows it is
00304   //! related to can be focused
00305   bool _modal;
00306   //! Only the window's titlebar is displayed
00307   bool _shaded;
00308   //! The window is iconified
00309   bool _iconic;
00310   //! The window is maximized to fill the screen vertically
00311   bool _max_vert;
00312   //! The window is maximized to fill the screen horizontally
00313   bool _max_horz;
00314   //! The window should not be displayed by pagers
00315   bool _skip_pager;
00316   //! The window should not be displayed by taskbars
00317   bool _skip_taskbar;
00318   //! The window is a 'fullscreen' window, and should be on top of all others
00319   bool _fullscreen;
00320   //! The window should be on top of other windows of the same type
00321   bool _above;
00322   //! The window should be underneath other windows of the same type
00323   bool _below;
00324 
00325   StackLayer _layer;
00326 
00327   //! A bitmask of values in the Client::Decoration enum
00328   /*!
00329     The values in the variable are the decorations that the client wants to be
00330     displayed around it.
00331   */
00332   DecorationFlags _decorations;
00333 
00334   //! A bitmask of values in the Client::Decoration enum.
00335   /*!
00336     Specifies the decorations that should NOT be displayed on the client.
00337   */
00338   DecorationFlags _disabled_decorations;
00339 
00340   //! A bitmask of values in the Client::Function enum
00341   /*!
00342     The values in the variable specify the ways in which the user is allowed to
00343     modify this window.
00344   */
00345   FunctionFlags _functions;
00346 
00347   //! Retrieves the window's initial gravity
00348   void getGravity();
00349   //! Retrieves the desktop hint's value and sets Client::_desktop
00350   void getDesktop();
00351   //! Retrieves the window's type and sets Client::_type
00352   void getType();
00353   //! Gets the MWM Hints and adjusts Client::_functions and
00354   //! Client::_decorations
00355   void getMwmHints();
00356   //! Gets the position and size of the window and sets Client::_area
00357   void getArea();
00358   //! Gets the net_state hint and sets the boolean flags for any states set in
00359   //! the hint
00360   void getState();
00361   //! Determines if the window uses the Shape extension and sets
00362   //! Client::_shaped
00363   void getShaped();
00364 
00365   //! Set up what decor should be shown on the window and what functions should
00366   //! be allowed (Client::_decorations and Client::_functions).
00367   /*!
00368     This also updates the NET_WM_ALLOWED_ACTIONS hint.
00369   */
00370   void setupDecorAndFunctions();
00371   
00372   //! Sets the wm_state to the specified value
00373   void setWMState(long state);
00374   //! Adjusts the window's net_state
00375   /*!
00376     This should not be called as part of the window mapping process! It is for
00377     use when updating the state post-mapping.<br>
00378     Client::applyStartupState is used to do the same things during the mapping
00379     process.
00380   */
00381   void setState(StateAction action, long data1, long data2);
00382 
00383   //! Sends the window to the specified desktop
00384   /*!
00385     A window is iconified by sending it to the ICONIC_DESKTOP, and restored
00386     by sending it to any other valid desktop.
00387   */
00388   void setDesktop(long desktop);
00389   //! Set whether the window is modal or not
00390   /*!
00391     This adjusts references in parents etc to match.
00392   */
00393   void setModal(bool modal);
00394   
00395   //! Calculates the stacking layer for the client window
00396   void calcLayer();
00397 
00398   //! Update the protocols that the window supports and adjusts things if they
00399   //! change
00400   void updateProtocols();
00401   //! Updates the WMNormalHints and adjusts things if they change
00402   void updateNormalHints();
00403   //! Updates the WMHints and adjusts things if they change
00404   /*!
00405     @param initstate Whether to read the initial_state property from the
00406                      WMHints. This should only be used during the mapping
00407                      process.
00408   */
00409   void updateWMHints(bool initstate = false);
00410   //! Updates the window's title
00411   void updateTitle();
00412   //! Updates the window's icon title
00413   void updateIconTitle();
00414   //! Updates the window's application name and class
00415   void updateClass();
00416   //! Updates the strut for the client
00417   void updateStrut();
00418   //! Updates the window's transient status, and any parents of it
00419   void updateTransientFor();
00420 
00421   //! Change the client's state hints to match the class' data
00422   void changeState();
00423   //! Change the allowed actions set on the client
00424   void changeAllowedActions();
00425 
00426   //! Request the client to close its window.
00427   void close();
00428 
00429   //! Shades or unshades the client window
00430   /*!
00431     @param shade true if the window should be shaded; false if it should be
00432                  unshaded.
00433   */
00434   void shade(bool shade);
00435 
00436   //! Fires the urgent callbacks which lets the user do what they want with
00437   //! urgent windows
00438   void fireUrgent();
00439   
00440   //! Fullscreen's or unfullscreen's the client window
00441   /*!
00442     @param fs true if the window should be made fullscreen; false if it should
00443               be returned to normal state.
00444     @param savearea true to have the client's current size and position saved;
00445                     otherwise, they are not. You should not save when mapping a
00446                     new window that is set to fullscreen.
00447   */
00448   void fullscreen(bool fs, bool savearea);
00449 
00450   //! Maximize or unmaximize the client window
00451   /*!
00452     @param max true if the window should be maximized; false if it should be
00453                returned to normal size.
00454     @param dir 0 to set both horz and vert, 1 to set horz, 2 to set vert.
00455     @param savearea true to have the client's current size and position saved;
00456                     otherwise, they are not. You should not save when mapping a
00457                     new window that is set to fullscreen.
00458   */
00459   void maximize(bool max, int dir, bool savearea);
00460 
00461   //! Internal version of the Client::move function
00462   /*!
00463     @param x The X coordinate to move to.
00464     @param y The Y coordinate to move to.
00465   */
00466   void internal_move(int x, int y);
00467   //! Internal version of the Client::resize function
00468   /*!
00469     This also maintains things like the client's minsize, and size increments.
00470     @param anchor The corner to keep in the same position when resizing.
00471     @param w The width component of the new size for the client.
00472     @param h The height component of the new size for the client.
00473     @param user Specifies whether this is a user-requested change or a
00474                 program requested change.
00475     @param x An optional X coordinate to which the window will be moved
00476              after resizing.
00477     @param y An optional Y coordinate to which the window will be moved
00478              after resizing.
00479     The x and y coordinates must both be sepcified together, or they will have
00480     no effect. When they are specified, the anchor is ignored.
00481   */
00482   void internal_resize(Corner anchor, int w, int h, bool user = true,
00483                        int x = INT_MIN, int y = INT_MIN);
00484 
00485   //! Attempts to find and return a modal child of this window, recursively.
00486   Client *findModalChild(Client *skip = 0) const;
00487 
00488   //! Removes or reapplies the client's border to its window
00489   /*!
00490     Used when managing and unmanaging a window.
00491     @param addborder true if adding the border to the client; false if removing
00492                      from the client
00493   */
00494   void toggleClientBorder(bool addborder);
00495 
00496   //! Applies the states requested when the window mapped
00497   /*!
00498     This should be called only once, during the window mapping process. It
00499     applies things like maximized, and fullscreen.
00500   */
00501   void applyStartupState();
00502   
00503 public:
00504 #ifndef SWIG
00505   //! Constructs a new Client object around a specified window id
00506   /*!
00507 BB    @param window The window id that the Client class should handle
00508     @param screen The screen on which the window resides
00509   */
00510   Client(int screen, Window window);
00511   //! Destroys the Client object
00512   virtual ~Client();
00513 #endif
00514 
00515   //! Returns the screen on which the clien resides
00516   inline int screen() const { return _screen; }
00517   
00518   //! Returns the window id that the Client object is handling
00519   inline Window window() const { return _window; }
00520 
00521   //! Returns the type of the window, one of the Client::WindowType values
00522   inline WindowType type() const { return _type; }
00523   //! Returns if the window should be treated as a normal window.
00524   /*!
00525     Some windows (desktops, docks, splash screens) have special rules applied
00526     to them in a number of places regarding focus or user interaction.
00527   */
00528   inline bool normal() const {
00529     return ! (_type == Type_Desktop || _type == Type_Dock ||
00530               _type == Type_Splash);
00531   }
00532   
00533   //! Returns the desktop on which the window resides
00534   /*!
00535     This value is a 0-based index.<br>
00536     A value of 0xffffffff indicates that the window exists on all desktops.
00537   */
00538   inline long desktop() const { return _desktop; }
00539   //! Returns the window's title
00540   inline const otk::ustring &title() const { return _title; }
00541   //! Returns the window's title when it is iconified
00542   inline const otk::ustring &iconTitle() const { return _title; }
00543   //! Returns the application's name to whom the window belongs
00544   inline const std::string &appName() const { return _app_name; }
00545   //! Returns the class of the window
00546   inline const std::string &appClass() const { return _app_class; }
00547   //! Returns the program-specified role of the window
00548   inline const std::string &role() const { return _role; }
00549   //! Returns if the window can be focused
00550   /*!
00551     @return true if the window can receive focus; otherwise, false
00552   */
00553   inline bool canFocus() const { return _can_focus; }
00554   //! Returns if the window has indicated that it needs urgent attention
00555   inline bool urgent() const { return _urgent; }
00556   //! Returns if the window wants to be notified when it receives focus
00557   inline bool focusNotify() const { return _focus_notify; }
00558   //! Returns if the window is the focused window
00559   inline bool focused() const { return _focused; }
00560   //! Returns if the window uses the Shape extension
00561   inline bool shaped() const { return _shaped; }
00562   //! Returns the window's gravity
00563   /*!
00564     This value determines where to place the decorated window in relation to
00565     its position without decorations.<br>
00566     One of: NorthWestGravity, SouthWestGravity, EastGravity, ...,
00567     SouthGravity, StaticGravity, ForgetGravity
00568   */
00569   inline int gravity() const { return _gravity; }
00570   //! Returns if the application requested the initial position for the window
00571   /*!
00572     If the application did not request a position (this function returns false)
00573     then the window should be placed intelligently by the window manager
00574     initially
00575   */
00576   inline bool positionRequested() const { return _positioned; }
00577   //! Returns the decorations that the client window wishes to be displayed on
00578   //! it
00579   inline DecorationFlags decorations() const { return _decorations; }
00580   //! Returns the decorations that the user has requested to be disabled on the
00581   //! client
00582   inline DecorationFlags disabledDecorations() const
00583     { return _disabled_decorations; }
00584   //! Returns the functions that the user can perform on the window
00585   inline FunctionFlags funtions() const { return _functions; }
00586 
00587   //! Return the client this window is transient for
00588   inline Client *transientFor() const { return _transient_for; }
00589 
00590   //! Returns the window which is a modal child of this window
00591   inline Client *modalChild() const { return _modal_child; }
00592   
00593   //! Returns if the window is modal
00594   /*!
00595     If the window is modal, then no other windows that it is related to can get
00596     focus while it exists/remains modal.
00597   */
00598   inline bool modal() const { return _modal; }
00599   //! The window should not be displayed by pagers
00600   inline bool skipPager() const { return _skip_pager; }
00601   //! The window should not be displayed by taskbars
00602   inline bool skipTaskbar() const { return _skip_taskbar; } 
00603  //! Returns if the window is shaded
00604   /*!
00605     When the window is shaded, only its titlebar is visible.
00606   */
00607   inline bool shaded() const { return _shaded; }
00608   //! Returns if the window is in fullscreen mode
00609   inline bool fullscreen() const { return _fullscreen; }
00610   //! Returns if the window is iconified
00611   /*!
00612     When the window is iconified, it is not visible at all (except in iconbars/
00613     panels/etc that want to show lists of iconified windows
00614   */
00615   inline bool iconic() const { return _iconic; }
00616   //! Returns if the window is maximized vertically
00617   inline bool maxVert() const { return _max_vert; }
00618   //! Returns if the window is maximized horizontally
00619   inline bool maxHorz() const { return _max_horz; }
00620   //! Returns the window's stacking layer
00621   inline StackLayer layer() const { return _layer; }
00622 
00623   //! Returns the logical size of the window
00624   /*!
00625     The "logical" size of the window is refers to the user's perception of the
00626     size of the window, and is the value that should be displayed to the user.
00627     For example, with xterms, this value it the number of characters being
00628     displayed in the terminal, instead of the number of pixels.
00629   */
00630   const otk::Point &logicalSize() const { return _logical_size; }
00631 
00632   //! Returns the position and size of the client relative to the root window
00633   inline const otk::Rect &area() const { return _area; }
00634 
00635   //! Returns the client's strut definition
00636   inline const otk::Strut &strut() const { return _strut; }
00637 
00638   //! Move the window (actually, its frame) to a position.
00639   /*!
00640     This moves the window so that the top-left corner of its frame will be at
00641     the position specified.
00642     @param x The X coordinate to move to.
00643     @param y The Y coordinate to move to.
00644   */
00645   void move(int x, int y);
00646   
00647   //! Resizes the client window, anchoring it in a given corner
00648   /*!
00649     This also maintains things like the client's minsize, and size increments.
00650     @param anchor The corner to keep in the same position when resizing.
00651     @param w The width component of the new size for the client.
00652     @param h The height component of the new size for the client.
00653   */
00654   void resize(Corner anchor, int w, int h);
00655 
00656   //! Reapplies the maximized state to the window
00657   /*!
00658     Use this to make the window readjust its maximized size to new
00659     surroundings (struts, etc).
00660   */
00661   void remaximize();
00662   
00663   //! Choose a mask of decorations to not display on the client
00664   /*!
00665     Pass a value of 0 to the function to turn all decorations back on. Note
00666     that you cannot add decorations to a window with this, you can only remove
00667     decorations that would otherwise have been displayed.
00668     @param flags The mask of values from Client::Decoration to specify which
00669                  decorations should not be displayed.
00670   */
00671   void disableDecorations(DecorationFlags flags);
00672   
00673   //! Attempt to focus the client window
00674   bool focus();
00675 
00676   //! Remove focus from the client window
00677   void unfocus() const;
00678 
00679   //! Validate client, by making sure no Destroy or Unmap events exist in
00680   //! the event queue for the window.
00681   /*!
00682     @return true if the client is valid; false if the client has already
00683             been unmapped/destroyed, and so is invalid.
00684   */
00685   bool validate() const;
00686 
00687   void installColormap(bool install) const;
00688   
00689   virtual void focusHandler(const XFocusChangeEvent &e);
00690   virtual void unfocusHandler(const XFocusChangeEvent &e);
00691   virtual void propertyHandler(const XPropertyEvent &e);
00692   virtual void clientMessageHandler(const XClientMessageEvent &e);
00693   virtual void configureRequestHandler(const XConfigureRequestEvent &e);
00694   virtual void unmapHandler(const XUnmapEvent &e);
00695   virtual void destroyHandler(const XDestroyWindowEvent &e);
00696   virtual void reparentHandler(const XReparentEvent &e);
00697   virtual void mapRequestHandler(const XMapRequestEvent &e);
00698 #if defined(SHAPE)
00699   virtual void shapeHandler(const XShapeEvent &e);
00700 #endif // SHAPE
00701 
00702   friend void Screen::manageWindow(Window);
00703   friend void Screen::unmanageWindow(Client *);
00704 };
00705 
00706 }
00707 
00708 #endif // __client_hh

Generated on Tue Feb 4 22:58:58 2003 for Openbox by doxygen1.3-rc2