1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
//
// Copyright (C) 2002 Brad Wasson <bard@systemtoolbox.com>
//
// This file is part of 3ddesktop.
//
// 3ddesktop is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// 3ddesktop is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with 3ddesktop; see the file COPYING. If not, write to
// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
//
#ifndef _XUTIL_HPP
#define _XUTIL_HPP
#include "3ddesk.h"
#ifdef HAVE_KDE
#include <kapp.h>
#include <kwin.h>
#endif
#include <GL/glx.h>
#include <X11/extensions/xf86vmode.h>
#include "config.hpp"
struct gnome_area_info {
long harea; // current
long varea; // current
long harea_count;
long varea_count;
};
struct gnome_workspace_info {
long workspace; // current
long workspace_count;
};
// for encapsulation we put the window management stuff in a class
class VDesktops {
private:
//int ignore_all_errors_ehandler (Display *dpy, XErrorEvent *error);
int Get_Window_Property(Display *dpy,
Window target_win,
Atom atom,
long *length,
Atom *type,
int *size,
char **data);
int send_client_message_32 (Display *dpy,
Window recipient,
Window event_window,
Atom message_type,
long event_mask,
int n_longs,
...);
Display *display;
int screen;
int root_win;
// FIXME: add destructor to delete
#ifdef HAVE_KDE
KApplication *ka;
#endif
Config *cfg;
//int use_kde;
//int use_workspaces;
//int sawfish_only;
//int pwm;
//int blackbox;
public:
int init(Config *_cfg);
//(int _use_workspaces, int _use_sawfish, int _pwm, int _blackbox);
//void get_vdesktop_info (int *current, int *count);
void get_vdesktop_info (int *column, int *row,
int *n_columns, int *n_rows);
void set_vdesktop (int col, int row);
int get_row_col_info (int *n_columns, int *n_rows);
int get_current_desktop (int *column, int *row);
int get_row_col_inf (int *n_columns, int *n_rows);
//int get_current_desktop (void);
//int get_number_of_desktops (void);
void pwm_set_current_workspace (int workspace);
int pwm_get_current_workspace (void);
int pwm_get_workspace_count (void);
void gnome_set_current_area (int harea, int varea);
void gnome_get_area_info(struct gnome_area_info *info);
void gnome_set_current_workspace (int workspace);
void gnome_get_workspace_info(struct gnome_workspace_info *info);
void ewmh_set_current_desktop (int workspace);
void ewmh_get_desktop_info(struct gnome_workspace_info *info);
int sawfish_get_current_workspace(void);
int sawfish_get_workspace_count(void);
void sawfish_set_current_workspace(int workspace);
};
#endif // END _XUTIL_HPP
|