00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _FL_WM_H_
00023 #define _FL_WM_H_
00024
00025 #include "Fl_Widget.h"
00026 #include "x.h"
00027
00034 class Fl_WM
00035 {
00036 public:
00040 enum WindowTypes {
00041 NORMAL=1,
00042 DIALOG,
00043 UTIL,
00044 TOOLBAR,
00045 DOCK,
00046 SPLASH,
00047 MENU,
00048 DESKTOP
00049 };
00050
00056 static bool set_window_type(Window xid, int type);
00057
00062 static bool set_window_icon(Window xid, Fl_Image *icon);
00063
00068 static bool set_window_title(Window xid, const char *title, int title_len);
00069
00074 static bool set_window_icontitle(Window xid, const char *title, int title_len);
00075
00081 static bool set_workspace_count(int count);
00082
00089 static bool set_workspace_names(const char **names, int count);
00090
00095 static bool set_current_workspace(int number);
00096
00101 static bool set_active_window(Window xid);
00102
00107 static bool close_window(Window xid);
00108
00114 static bool set_window_strut(Window xid, int left, int right, int top, int bottom);
00115
00122 static bool get_window_icon(Window xid, Fl_Image *&icon, int w=-1, int h=-1);
00123
00128 static bool get_window_title(Window xid, char *&title);
00129
00134 static bool get_window_icontitle(Window xid, char *&title);
00135
00140 static int get_window_desktop(Window xid);
00141
00146 static bool get_geometry(int &width, int &height);
00147
00152 static bool get_workarea(int &x, int &y, int &width, int &height);
00153
00159 static int get_windows_stacking(Window *&windows);
00160
00166 static int get_windows_mapping(Window *&windows);
00167
00171 static int get_workspace_count();
00172
00177 static int get_workspace_names(char **&names);
00178
00182 static int get_current_workspace();
00183
00187 static Window get_active_window();
00188
00193 enum ActionTypes {
00194 NONE = 0,
00195 DESKTOP_COUNT = 1<<0,
00196 DESKTOP_NAMES = 1<<1,
00197 DESKTOP_CHANGED = 1<<2,
00198 DESKTOP_WORKAREA = 1<<3,
00199
00200 WINDOW_LIST = 1<<10,
00201 WINDOW_LIST_STACKING = 1<<11,
00202 WINDOW_ACTIVE = 1<<12,
00203 WINDOW_NAME = 1<<13,
00204 WINDOW_NAME_VIS = 1<<14,
00205 WINDOW_ICONNAME = 1<<15,
00206 WINDOW_ICONNAME_VIS = 1<<16,
00207 WINDOW_DESKTOP = 1<<17
00208 };
00209
00213 static void clear_handled();
00214
00218 static bool is_handled(Window w);
00219
00223 static void handle_window(Window w);
00224
00228 static void unhandle_window(Window w);
00229
00230
00231
00232
00233
00234
00235 static void add_callback(Fl_Callback *cb, void *user_data, int action_mask);
00236
00240 static void remove_callback(Fl_Callback *cb, void *user_data);
00241
00245 static int action();
00246
00250 static Window window();
00251
00256 static void callback(Fl_Callback *cb, void *user_data, int action_mask) {
00257 add_callback(cb, user_data, action_mask);
00258 }
00259 };
00260
00261 #endif