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

« back to all changes in this revision

Viewing changes to src/FbCommands.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
 
// FbCommands.hh for Fluxbox
2
 
// Copyright (c) 2003 - 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: FbCommands.hh 3977 2005-04-30 10:29:06Z fluxgen $
23
 
 
24
 
// \file contains basic commands to restart, reconfigure, execute command and exit fluxbox
25
 
 
26
 
#ifndef FBCOMMANDS_HH
27
 
#define FBCOMMANDS_HH
28
 
 
29
 
#include "Command.hh"
30
 
 
31
 
#include <string>
32
 
 
33
 
namespace FbCommands {
34
 
 
35
 
/// executes a system command
36
 
class ExecuteCmd: public FbTk::Command {
37
 
public:
38
 
    ExecuteCmd(const std::string &cmd, int screen_num = -1);
39
 
    void execute();
40
 
private:
41
 
    std::string m_cmd;
42
 
    const int m_screen_num;
43
 
};
44
 
 
45
 
/// sets environment
46
 
class ExportCmd : public FbTk::Command {
47
 
public:
48
 
    ExportCmd(const std::string& name, const std::string& value);
49
 
    void execute();
50
 
private:
51
 
    std::string m_name;
52
 
    std::string m_value;
53
 
};
54
 
 
55
 
/// exit fluxbox
56
 
class ExitFluxboxCmd: public FbTk::Command {
57
 
public:
58
 
    void execute();
59
 
};
60
 
 
61
 
/// saves resources
62
 
class SaveResources: public FbTk::Command {
63
 
public:
64
 
    void execute();
65
 
};
66
 
 
67
 
/// restarts fluxbox
68
 
class RestartFluxboxCmd: public FbTk::Command {
69
 
public:
70
 
    RestartFluxboxCmd(const std::string &cmd);
71
 
    void execute();
72
 
private:
73
 
    std::string m_cmd;
74
 
};
75
 
 
76
 
/// reconfigures fluxbox
77
 
class ReconfigureFluxboxCmd: public FbTk::Command {
78
 
public:
79
 
    void execute();
80
 
};
81
 
 
82
 
class ReloadStyleCmd: public FbTk::Command {
83
 
public:
84
 
    void execute();
85
 
};
86
 
 
87
 
class SetStyleCmd: public FbTk::Command {
88
 
public:
89
 
    explicit SetStyleCmd(const std::string &filename);
90
 
    void execute();
91
 
private:
92
 
    std::string m_filename;
93
 
};
94
 
 
95
 
class ShowRootMenuCmd: public FbTk::Command {
96
 
public:
97
 
    void execute();
98
 
};
99
 
 
100
 
class ShowWorkspaceMenuCmd: public FbTk::Command {
101
 
public:
102
 
    void execute();
103
 
};
104
 
 
105
 
class SetWorkspaceNameCmd: public FbTk::Command {
106
 
public:
107
 
    SetWorkspaceNameCmd(const std::string &name, int spaceid = -1);
108
 
    void execute();
109
 
private:
110
 
    std::string m_name;
111
 
    int m_workspace;
112
 
};
113
 
 
114
 
class WorkspaceNameDialogCmd: public FbTk::Command {
115
 
public:
116
 
    void execute();
117
 
};
118
 
 
119
 
class CommandDialogCmd: public FbTk::Command {
120
 
public:
121
 
    void execute();
122
 
};
123
 
 
124
 
 
125
 
class SetResourceValueCmd: public FbTk::Command {
126
 
public:
127
 
    SetResourceValueCmd(const std::string &resourcename, const std::string &value);
128
 
    void execute();
129
 
private:
130
 
    const std::string m_resname;
131
 
    const std::string m_value;
132
 
};
133
 
 
134
 
class SetResourceValueDialogCmd: public FbTk::Command {
135
 
public:
136
 
    void execute();
137
 
};
138
 
 
139
 
class BindKeyCmd: public FbTk::Command {
140
 
public:
141
 
    BindKeyCmd(const std::string &keybind);
142
 
    void execute();
143
 
private:
144
 
    const std::string m_keybind;
145
 
};
146
 
 
147
 
/// deiconifies iconified windows
148
 
class DeiconifyCmd: public FbTk::Command {
149
 
public:
150
 
    enum Mode { 
151
 
        LAST,
152
 
        LASTWORKSPACE,
153
 
        ALL,
154
 
        ALLWORKSPACE
155
 
    };
156
 
 
157
 
    enum Destination {
158
 
        CURRENT, /// deiconification on current workspace
159
 
        ORIGIN,  /// deiconification on origin workspace, change to that ws
160
 
        ORIGINQUIET /// deiconification on origin workspace, dont change ws
161
 
    };
162
 
    
163
 
    DeiconifyCmd(Mode mode= LASTWORKSPACE,
164
 
                 Destination dest= CURRENT);
165
 
    void execute();
166
 
private:
167
 
    Mode m_mode;
168
 
    Destination m_dest;
169
 
};
170
 
 
171
 
} // end namespace FbCommands
172
 
 
173
 
#endif // FBCOMMANDS_HH