news download themes documentation links










Ewmh.hh

00001 // Ewmh.hh for fluxbox
00002 // Copyright (c) 2002 Henrik Kinnunen (fluxgen@fluxbox.org)
00003 //
00004 // Permission is hereby granted, free of charge, to any person obtaining a
00005 // copy of this software and associated documentation files (the "Software"),
00006 // to deal in the Software without restriction, including without limitation
00007 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008 // and/or sell copies of the Software, and to permit persons to whom the
00009 // Software is furnished to do so, subject to the following conditions:
00010 //
00011 // The above copyright notice and this permission notice shall be included in
00012 // all copies or substantial portions of the Software.
00013 //
00014 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.    IN NO EVENT SHALL
00017 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00018 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00019 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00020 // DEALINGS IN THE SOFTWARE.
00021 
00022 // $Id: Ewmh.hh,v 1.12 2003/09/23 13:52:05 rathnor Exp $
00023 
00024 #include "AtomHandler.hh"
00025 
00026 #include <X11/Xatom.h>
00027 #include <vector>
00028 #include <map>
00029 
00030 class Ewmh:public AtomHandler {
00031 public:
00032 
00033     Ewmh();
00034     ~Ewmh();
00035     void initForScreen(BScreen &screen);
00036     void setupFrame(FluxboxWindow &win);
00037     void setupClient(WinClient &winclient);
00038 
00039     void updateClientList(BScreen &screen);
00040     void updateWorkspaceNames(BScreen &screen);
00041     void updateCurrentWorkspace(BScreen &screen);
00042     void updateWorkspaceCount(BScreen &screen);
00043 
00044     void updateState(FluxboxWindow &win);
00045     void updateLayer(FluxboxWindow &win);
00046     void updateHints(FluxboxWindow &win);
00047     void updateWorkspace(FluxboxWindow &win);
00048 
00049 
00050     bool checkClientMessage(const XClientMessageEvent &ce, 
00051                             BScreen * screen, WinClient * const winclient);
00052 
00053     bool propertyNotify(WinClient &winclient, Atom the_property);
00054     void updateFrameClose(FluxboxWindow &win);
00055 
00056     //ignore this one
00057     void updateClientClose(WinClient &winclient) {}
00058 
00059     void setFullscreen(FluxboxWindow &win, bool value);
00060 
00061 private:
00062     
00063     typedef struct WindowState {
00064         WindowState(int x, int y, unsigned int width, unsigned int height, int layer, unsigned int decor);
00065         int x, y, layer;
00066         unsigned int width, height, decor;
00067     } WindowState;
00068 
00069     enum { STATE_REMOVE = 0, STATE_ADD = 1, STATE_TOGGLE = 2};
00070 
00071     void setState(FluxboxWindow &win, Atom state, bool value);
00072     void toggleState(FluxboxWindow &win, Atom state);
00073     void createAtoms();
00074     void updateStrut(WinClient &winclient);
00075 
00076     // root window properties
00077     Atom m_net_supported, m_net_client_list, m_net_client_list_stacking,
00078         m_net_number_of_desktops, m_net_desktop_geometry, m_net_desktop_viewport,
00079         m_net_current_desktop, m_net_desktop_names, m_net_active_window, m_net_workarea,
00080         m_net_supporting_wm_check, m_net_virtual_roots, m_net_moveresize_window;
00081 
00082     // root window messages
00083     Atom m_net_close_window, m_net_wm_moveresize;
00084 
00085     // application window properties
00086     Atom m_net_properties, m_net_wm_name, m_net_wm_desktop, m_net_wm_window_type,
00087         m_net_wm_state, m_net_wm_state_sticky, m_net_wm_state_shaded,
00088     m_net_wm_state_maximized_horz, m_net_wm_state_maximized_vert,
00089         m_net_wm_state_fullscreen,
00090         m_net_wm_strut, m_net_wm_icon_geometry, m_net_wm_icon, m_net_wm_pid,
00091         m_net_wm_handled_icons;
00092             
00093     // application protocols
00094     Atom m_net_wm_ping;
00095 
00096     std::vector<Window> m_windows;
00097     typedef std::map<FluxboxWindow *, WindowState *> SavedState;
00098     SavedState m_savedstate;
00099 
00100     WindowState *getState(FluxboxWindow &win);
00101     void clearState(FluxboxWindow &win);
00102     void saveState(FluxboxWindow &win, WindowState *state);
00103 
00104 };

Fluxbox CVS-Jan-2003




      



Got comments about the page? Send them to webmaster.
If you have general Fluxbox related questions ask them on our irc channel or mailing lists.

Show Source








Designed by aLEczapKA