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

« back to all changes in this revision

Viewing changes to src/FbAtoms.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
 
// FbAtom.hh
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: FbAtoms.hh 3865 2005-01-24 18:34:57Z mathias $
23
 
#ifndef FBATOMS_HH
24
 
#define FBATOMS_HH
25
 
 
26
 
#include <X11/Xlib.h>
27
 
#include <X11/Xatom.h>
28
 
 
29
 
/// atom handler for basic X atoms
30
 
class FbAtoms {
31
 
public:
32
 
    FbAtoms();
33
 
    ~FbAtoms();
34
 
 
35
 
    static FbAtoms *instance();
36
 
 
37
 
    inline Atom getWMChangeStateAtom() const { return xa_wm_change_state; }
38
 
    inline Atom getWMStateAtom() const { return xa_wm_state; }
39
 
    inline Atom getWMDeleteAtom() const { return xa_wm_delete_window; }
40
 
    inline Atom getWMProtocolsAtom() const { return xa_wm_protocols; }
41
 
    inline Atom getWMTakeFocusAtom() const { return xa_wm_take_focus; }
42
 
 
43
 
    // this atom is for normal app->WM hints about decorations, stacking,
44
 
    // starting workspace etc...
45
 
    inline Atom getFluxboxHintsAtom() const { return blackbox_hints;}
46
 
    inline Atom getMWMHintsAtom() const { return motif_wm_hints; }
47
 
 
48
 
    // these atoms are for normal app->WM interaction beyond the scope of the
49
 
    // ICCCM...
50
 
    inline Atom getFluxboxAttributesAtom() const { return blackbox_attributes; }
51
 
    inline Atom getFluxboxChangeAttributesAtom() const { return blackbox_change_attributes; }
52
 
 
53
 
    // these atoms are for window->WM interaction, with more control and
54
 
    // information on window "structure"... common examples are
55
 
    // notifying apps when windows are raised/lowered... when the user changes
56
 
    // workspaces... i.e. "pager talk"
57
 
    inline Atom getFluxboxStructureMessagesAtom() const{ return blackbox_structure_messages; }
58
 
 
59
 
    // *Notify* portions of the NETStructureMessages protocol
60
 
    inline Atom getFluxboxNotifyStartupAtom() const { return blackbox_notify_startup; }
61
 
    inline Atom getFluxboxNotifyWindowAddAtom() const { return blackbox_notify_window_add; }
62
 
    inline Atom getFluxboxNotifyWindowDelAtom() const { return blackbox_notify_window_del; }
63
 
    inline Atom getFluxboxNotifyWindowFocusAtom() const { return blackbox_notify_window_focus; }
64
 
    inline Atom getFluxboxNotifyCurrentWorkspaceAtom() const { return blackbox_notify_current_workspace; }
65
 
    inline Atom getFluxboxNotifyWorkspaceCountAtom() const { return blackbox_notify_workspace_count; }
66
 
    inline Atom getFluxboxNotifyWindowRaiseAtom() const { return blackbox_notify_window_raise; }
67
 
    inline Atom getFluxboxNotifyWindowLowerAtom() const { return blackbox_notify_window_lower; }
68
 
 
69
 
    // atoms to change that request changes to the desktop environment during
70
 
    // runtime... these messages can be sent by any client... as the sending
71
 
    // client window id is not included in the ClientMessage event...
72
 
    inline Atom getFluxboxChangeWorkspaceAtom() const { return blackbox_change_workspace; }
73
 
    inline Atom getFluxboxChangeWindowFocusAtom() const { return blackbox_change_window_focus; }
74
 
    inline Atom getFluxboxCycleWindowFocusAtom() const { return blackbox_cycle_window_focus; }
75
 
 
76
 
private:
77
 
    void initAtoms();
78
 
// NETAttributes
79
 
    Atom blackbox_attributes, blackbox_change_attributes, blackbox_hints;
80
 
 
81
 
    Atom motif_wm_hints;
82
 
 
83
 
    // NETStructureMessages
84
 
    Atom blackbox_structure_messages, blackbox_notify_startup,
85
 
        blackbox_notify_window_add, blackbox_notify_window_del,
86
 
        blackbox_notify_window_focus, blackbox_notify_current_workspace,
87
 
        blackbox_notify_workspace_count, blackbox_notify_window_raise,
88
 
        blackbox_notify_window_lower;
89
 
 
90
 
    // message_types for client -> wm messages
91
 
    Atom blackbox_change_workspace, blackbox_change_window_focus,
92
 
        blackbox_cycle_window_focus;
93
 
 
94
 
    Atom xa_wm_protocols, xa_wm_state,
95
 
        xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state;
96
 
       
97
 
    bool m_init;
98
 
    static FbAtoms *s_singleton;
99
 
};
100
 
 
101
 
#endif //FBATOMS_HH