aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-03-04 11:13:42 (GMT)
committerfluxgen <fluxgen>2003-03-04 11:13:42 (GMT)
commit65567d31ef53c92496398fec30b0c8f88cf61ced (patch)
treed119c6131501a76c9e6471a70059eefd68f04af5 /src
parent3df50325deddeefd3ddb70675bd47cf7986fd33f (diff)
downloadfluxbox-65567d31ef53c92496398fec30b0c8f88cf61ced.zip
fluxbox-65567d31ef53c92496398fec30b0c8f88cf61ced.tar.bz2
fixing some old BaseDisplay to FbTk App
Diffstat (limited to 'src')
-rw-r--r--src/Gnome.cc29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/Gnome.cc b/src/Gnome.cc
index c8d4a70..44a593b 100644
--- a/src/Gnome.cc
+++ b/src/Gnome.cc
@@ -1,5 +1,5 @@
1// Gnome.cc for fluxbox 1// Gnome.cc for fluxbox
2// Copyright (c) 2002 Henrik Kinnunen (fluxgen@fluxbox.org) 2// Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
3// 3//
4// Permission is hereby granted, free of charge, to any person obtaining a 4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"), 5// copy of this software and associated documentation files (the "Software"),
@@ -13,13 +13,13 @@
13// 13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 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, 15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 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 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 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 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Gnome.cc,v 1.12 2003/03/03 21:51:01 rathnor Exp $ 22// $Id: Gnome.cc,v 1.13 2003/03/04 11:13:42 fluxgen Exp $
23 23
24#include "Gnome.hh" 24#include "Gnome.hh"
25 25
@@ -38,13 +38,14 @@ Gnome::Gnome() {
38Gnome::~Gnome() { 38Gnome::~Gnome() {
39 // destroy gnome windows 39 // destroy gnome windows
40 while (!m_gnomewindows.empty()) { 40 while (!m_gnomewindows.empty()) {
41 XDestroyWindow(BaseDisplay::getXDisplay(), m_gnomewindows.back()); 41 XDestroyWindow(FbTk::App::instance()->display(), m_gnomewindows.back());
42 m_gnomewindows.pop_back(); 42 m_gnomewindows.pop_back();
43 } 43 }
44} 44}
45 45
46
46void Gnome::initForScreen(BScreen &screen) { 47void Gnome::initForScreen(BScreen &screen) {
47 Display *disp = BaseDisplay::getXDisplay(); 48 Display *disp = FbTk::App::instance()->display();
48 // create the GNOME window 49 // create the GNOME window
49 Window gnome_win = XCreateSimpleWindow(disp, 50 Window gnome_win = XCreateSimpleWindow(disp,
50 screen.getRootWindow(), 0, 0, 5, 5, 0, 0, 0); 51 screen.getRootWindow(), 0, 0, 5, 5, 0, 0, 0);
@@ -82,7 +83,7 @@ void Gnome::initForScreen(BScreen &screen) {
82 83
83void Gnome::setupWindow(FluxboxWindow &win) { 84void Gnome::setupWindow(FluxboxWindow &win) {
84 // load gnome state atom 85 // load gnome state atom
85 Display *disp = BaseDisplay::getXDisplay(); 86 Display *disp = FbTk::App::instance()->display();
86 Atom ret_type; 87 Atom ret_type;
87 int fmt; 88 int fmt;
88 unsigned long nitems, bytes_after; 89 unsigned long nitems, bytes_after;
@@ -153,7 +154,7 @@ void Gnome::updateClientList(BScreen &screen) {
153 } 154 }
154 //number of windows to show in client list 155 //number of windows to show in client list
155 num = win; 156 num = win;
156 XChangeProperty(BaseDisplay::getXDisplay(), 157 XChangeProperty(FbTk::App::instance()->display(),
157 screen.getRootWindow(), 158 screen.getRootWindow(),
158 m_gnome_wm_win_client_list, 159 m_gnome_wm_win_client_list,
159 XA_CARDINAL, 32, 160 XA_CARDINAL, 32,
@@ -176,7 +177,7 @@ void Gnome::updateWorkspaceNames(BScreen &screen) {
176 } 177 }
177 178
178 if (XStringListToTextProperty(names, number_of_desks, &text)) { 179 if (XStringListToTextProperty(names, number_of_desks, &text)) {
179 XSetTextProperty(BaseDisplay::getXDisplay(), screen.getRootWindow(), 180 XSetTextProperty(FbTk::App::instance()->display(), screen.getRootWindow(),
180 &text, m_gnome_wm_win_workspace_names); 181 &text, m_gnome_wm_win_workspace_names);
181 XFree(text.value); 182 XFree(text.value);
182 } 183 }
@@ -187,7 +188,7 @@ void Gnome::updateWorkspaceNames(BScreen &screen) {
187 188
188void Gnome::updateCurrentWorkspace(BScreen &screen) { 189void Gnome::updateCurrentWorkspace(BScreen &screen) {
189 int workspace = screen.getCurrentWorkspaceID(); 190 int workspace = screen.getCurrentWorkspaceID();
190 XChangeProperty(BaseDisplay::getXDisplay(), 191 XChangeProperty(FbTk::App::instance()->display(),
191 screen.getRootWindow(), 192 screen.getRootWindow(),
192 m_gnome_wm_win_workspace, XA_CARDINAL, 32, PropModeReplace, 193 m_gnome_wm_win_workspace, XA_CARDINAL, 32, PropModeReplace,
193 (unsigned char *)&workspace, 1); 194 (unsigned char *)&workspace, 1);
@@ -197,7 +198,7 @@ void Gnome::updateCurrentWorkspace(BScreen &screen) {
197 198
198void Gnome::updateWorkspaceCount(BScreen &screen) { 199void Gnome::updateWorkspaceCount(BScreen &screen) {
199 int numworkspaces = screen.getCount(); 200 int numworkspaces = screen.getCount();
200 XChangeProperty(BaseDisplay::getXDisplay(), screen.getRootWindow(), 201 XChangeProperty(FbTk::App::instance()->display(), screen.getRootWindow(),
201 m_gnome_wm_win_workspace_count, XA_CARDINAL, 32, PropModeReplace, 202 m_gnome_wm_win_workspace_count, XA_CARDINAL, 32, PropModeReplace,
202 (unsigned char *)&numworkspaces, 1); 203 (unsigned char *)&numworkspaces, 1);
203} 204}
@@ -208,7 +209,7 @@ void Gnome::updateWorkspace(FluxboxWindow &win) {
208 cerr<<__FILE__<<"("<<__LINE__<<"): setting workspace("<<val<< 209 cerr<<__FILE__<<"("<<__LINE__<<"): setting workspace("<<val<<
209 ") for window("<<&win<<")"<<endl; 210 ") for window("<<&win<<")"<<endl;
210#endif // DEBUG 211#endif // DEBUG
211 XChangeProperty(BaseDisplay::getXDisplay(), win.getClientWindow(), 212 XChangeProperty(FbTk::App::instance()->display(), win.getClientWindow(),
212 m_gnome_wm_win_workspace, 213 m_gnome_wm_win_workspace,
213 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); 214 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1);
214} 215}
@@ -223,7 +224,7 @@ void Gnome::updateState(FluxboxWindow &win) {
223 if (win.isShaded()) 224 if (win.isShaded())
224 state |= WIN_STATE_SHADED; 225 state |= WIN_STATE_SHADED;
225 226
226 XChangeProperty(BaseDisplay::getXDisplay(), win.getClientWindow(), 227 XChangeProperty(FbTk::App::instance()->display(), win.getClientWindow(),
227 m_gnome_wm_win_state, 228 m_gnome_wm_win_state,
228 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1); 229 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1);
229} 230}
@@ -231,7 +232,7 @@ void Gnome::updateState(FluxboxWindow &win) {
231void Gnome::updateLayer(FluxboxWindow &win) { 232void Gnome::updateLayer(FluxboxWindow &win) {
232 //TODO - map from flux layers to gnome ones 233 //TODO - map from flux layers to gnome ones
233 int layernum = win.getLayerNum(); 234 int layernum = win.getLayerNum();
234 XChangeProperty(BaseDisplay::getXDisplay(), win.getClientWindow(), 235 XChangeProperty(FbTk::App::instance()->display(), win.getClientWindow(),
235 m_gnome_wm_win_layer, 236 m_gnome_wm_win_layer,
236 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&layernum, 1); 237 XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&layernum, 1);
237 238
@@ -384,7 +385,7 @@ void Gnome::setLayer(FluxboxWindow *win, int layer) {
384} 385}
385 386
386void Gnome::createAtoms() { 387void Gnome::createAtoms() {
387 Display *disp = BaseDisplay::getXDisplay(); 388 Display *disp = FbTk::App::instance()->display();
388 m_gnome_wm_win_layer = XInternAtom(disp, "_WIN_LAYER", False); 389 m_gnome_wm_win_layer = XInternAtom(disp, "_WIN_LAYER", False);
389 m_gnome_wm_win_state = XInternAtom(disp, "_WIN_STATE", False); 390 m_gnome_wm_win_state = XInternAtom(disp, "_WIN_STATE", False);
390 m_gnome_wm_win_hints = XInternAtom(disp, "_WIN_HINTS", False); 391 m_gnome_wm_win_hints = XInternAtom(disp, "_WIN_HINTS", False);