~ubuntu-branches/ubuntu/trusty/fluxbox/trusty-proposed

« back to all changes in this revision

Viewing changes to src/Ewmh.hh

  • Committer: Bazaar Package Importer
  • Author(s): Dmitry E. Oboukhov
  • Date: 2008-07-01 10:38:14 UTC
  • mfrom: (2.1.12 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080701103814-khx2b6il152x9p93
Tags: 1.0.0+deb1-8
* x-dev has been removed from build-depends (out-of-date package).
* Standards-Version bumped to 3.8.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Ewmh.hh for fluxbox
2
 
// Copyright (c) 2002 - 2005 Henrik Kinnunen (fluxgen at fluxbox dot org)
3
 
//
4
 
// Permission is hereby granted, free of charge, to any person obtaining a
5
 
// copy of this software and associated documentation files (the "Software"),
6
 
// to deal in the Software without restriction, including without limitation
7
 
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
 
// and/or sell copies of the Software, and to permit persons to whom the
9
 
// Software is furnished to do so, subject to the following conditions:
10
 
//
11
 
// The above copyright notice and this permission notice shall be included in
12
 
// all copies or substantial portions of the Software.
13
 
//
14
 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
 
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
 
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17
 
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
 
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
 
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
 
// DEALINGS IN THE SOFTWARE.
21
 
 
22
 
// $Id: Ewmh.hh 4038 2005-06-02 01:36:28Z mathias $
23
 
 
24
 
#include "AtomHandler.hh"
25
 
 
26
 
#include <X11/Xatom.h>
27
 
#include <vector>
28
 
#include <map>
29
 
 
30
 
/// Implementes Extended Window Manager Hints ( http://www.freedesktop.org/Standards/wm-spec )
31
 
class Ewmh:public AtomHandler {
32
 
public:
33
 
 
34
 
    Ewmh();
35
 
    ~Ewmh();
36
 
    void initForScreen(BScreen &screen);
37
 
    void setupFrame(FluxboxWindow &win);
38
 
    void setupClient(WinClient &winclient);
39
 
 
40
 
    void updateFocusedWindow(BScreen &screen, Window win);
41
 
    void updateClientList(BScreen &screen);
42
 
    void updateWorkspaceNames(BScreen &screen);
43
 
    void updateCurrentWorkspace(BScreen &screen);
44
 
    void updateWorkspaceCount(BScreen &screen);
45
 
    void updateViewPort(BScreen &screen);
46
 
    void updateGeometry(BScreen &screen);
47
 
    void updateWorkarea(BScreen &screen);
48
 
 
49
 
    void updateState(FluxboxWindow &win);
50
 
    void updateLayer(FluxboxWindow &win);
51
 
    void updateHints(FluxboxWindow &win);
52
 
    void updateWorkspace(FluxboxWindow &win);
53
 
 
54
 
    bool checkClientMessage(const XClientMessageEvent &ce,
55
 
                            BScreen * screen, WinClient * const winclient);
56
 
 
57
 
    bool propertyNotify(WinClient &winclient, Atom the_property);
58
 
    void updateFrameClose(FluxboxWindow &win);
59
 
 
60
 
    void updateClientClose(WinClient &winclient);
61
 
    
62
 
 
63
 
    void setFullscreen(FluxboxWindow &win, bool value);
64
 
 
65
 
private:
66
 
 
67
 
    typedef struct WindowState {
68
 
        WindowState(int x, int y, unsigned int width, unsigned int height,
69
 
                    int layer, unsigned int decor);
70
 
        int x, y, layer;
71
 
        unsigned int width, height, decor;
72
 
    } WindowState;
73
 
 
74
 
    enum { STATE_REMOVE = 0, STATE_ADD = 1, STATE_TOGGLE = 2};
75
 
 
76
 
    void setState(FluxboxWindow &win, Atom state, bool value);
77
 
    void toggleState(FluxboxWindow &win, Atom state);
78
 
    void createAtoms();
79
 
    void updateStrut(WinClient &winclient);
80
 
    void setupState(FluxboxWindow &win);
81
 
 
82
 
    // root window properties
83
 
    Atom m_net_supported, m_net_client_list, m_net_client_list_stacking,
84
 
        m_net_number_of_desktops, m_net_desktop_geometry, m_net_desktop_viewport,
85
 
        m_net_current_desktop, m_net_desktop_names, m_net_active_window, m_net_workarea,
86
 
        m_net_supporting_wm_check, m_net_virtual_roots, m_net_moveresize_window;
87
 
 
88
 
    // root window messages
89
 
    Atom m_net_close_window, m_net_wm_moveresize;
90
 
 
91
 
    // application window properties
92
 
    Atom m_net_properties, m_net_wm_name, m_net_wm_desktop,
93
 
        // types
94
 
        m_net_wm_window_type,
95
 
        m_net_wm_window_type_dock,
96
 
        m_net_wm_window_type_desktop,
97
 
 
98
 
        // states
99
 
        m_net_wm_state, m_net_wm_state_sticky, m_net_wm_state_shaded,
100
 
        m_net_wm_state_maximized_horz, m_net_wm_state_maximized_vert,
101
 
        m_net_wm_state_fullscreen,
102
 
        m_net_wm_state_hidden,
103
 
        m_net_wm_state_skip_taskbar,
104
 
        m_net_wm_state_skip_pager,
105
 
        m_net_wm_state_below,
106
 
        m_net_wm_state_above,
107
 
 
108
 
        // allowed actions
109
 
        m_net_wm_allowed_actions,
110
 
        m_net_wm_action_move, 
111
 
        m_net_wm_action_resize,
112
 
        m_net_wm_action_minimize, 
113
 
        m_net_wm_action_shade,
114
 
        m_net_wm_action_stick, 
115
 
        m_net_wm_action_maximize_horz, m_net_wm_action_maximize_vert,
116
 
        m_net_wm_action_fullscreen, 
117
 
        m_net_wm_action_change_desktop,
118
 
        m_net_wm_action_close,
119
 
 
120
 
        m_net_wm_strut, m_net_wm_icon_geometry, m_net_wm_icon, m_net_wm_pid,
121
 
        m_net_wm_handled_icons;
122
 
 
123
 
    // application protocols
124
 
    Atom m_net_wm_ping;
125
 
 
126
 
    Atom utf8_string;
127
 
 
128
 
    std::vector<Window> m_windows;
129
 
    typedef std::map<FluxboxWindow *, WindowState *> SavedState;
130
 
    SavedState m_savedstate;
131
 
 
132
 
    WindowState *getState(FluxboxWindow &win);
133
 
    void clearState(FluxboxWindow &win);
134
 
    void saveState(FluxboxWindow &win, WindowState *state);
135
 
 
136
 
};