00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
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
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
00083 Atom m_net_close_window, m_net_wm_moveresize;
00084
00085
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
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 };