2008-10-02 18:47:02 +00:00
|
|
|
/**************************************************************************
|
2009-01-29 22:43:31 +00:00
|
|
|
* server :
|
|
|
|
* -
|
2008-10-02 18:47:02 +00:00
|
|
|
*
|
|
|
|
* Check COPYING file for Copyright
|
|
|
|
*
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
#ifndef SERVER_H
|
|
|
|
#define SERVER_H
|
|
|
|
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xatom.h>
|
|
|
|
#include <X11/extensions/Xinerama.h>
|
|
|
|
|
2012-07-02 16:50:30 +00:00
|
|
|
#ifdef HAVE_SN
|
|
|
|
#include <libsn/sn.h>
|
|
|
|
#include <glib.h>
|
|
|
|
#endif
|
|
|
|
|
2010-04-18 12:07:36 +00:00
|
|
|
|
2008-10-02 18:47:02 +00:00
|
|
|
typedef struct Global_atom
|
|
|
|
{
|
2009-02-03 20:40:46 +00:00
|
|
|
Atom _XROOTPMAP_ID;
|
2010-12-11 09:15:14 +00:00
|
|
|
Atom _XROOTMAP_ID;
|
2009-02-03 20:40:46 +00:00
|
|
|
Atom _NET_CURRENT_DESKTOP;
|
|
|
|
Atom _NET_NUMBER_OF_DESKTOPS;
|
2010-09-23 20:28:30 +00:00
|
|
|
Atom _NET_DESKTOP_NAMES;
|
2009-02-03 20:40:46 +00:00
|
|
|
Atom _NET_DESKTOP_GEOMETRY;
|
|
|
|
Atom _NET_DESKTOP_VIEWPORT;
|
|
|
|
Atom _NET_ACTIVE_WINDOW;
|
|
|
|
Atom _NET_WM_WINDOW_TYPE;
|
|
|
|
Atom _NET_WM_STATE_SKIP_PAGER;
|
|
|
|
Atom _NET_WM_STATE_SKIP_TASKBAR;
|
|
|
|
Atom _NET_WM_STATE_STICKY;
|
2009-02-25 20:04:43 +00:00
|
|
|
Atom _NET_WM_STATE_DEMANDS_ATTENTION;
|
2009-02-03 20:40:46 +00:00
|
|
|
Atom _NET_WM_WINDOW_TYPE_DOCK;
|
|
|
|
Atom _NET_WM_WINDOW_TYPE_DESKTOP;
|
|
|
|
Atom _NET_WM_WINDOW_TYPE_TOOLBAR;
|
|
|
|
Atom _NET_WM_WINDOW_TYPE_MENU;
|
|
|
|
Atom _NET_WM_WINDOW_TYPE_SPLASH;
|
|
|
|
Atom _NET_WM_WINDOW_TYPE_DIALOG;
|
|
|
|
Atom _NET_WM_WINDOW_TYPE_NORMAL;
|
|
|
|
Atom _NET_WM_DESKTOP;
|
|
|
|
Atom WM_STATE;
|
|
|
|
Atom _NET_WM_STATE;
|
2009-08-09 15:57:18 +00:00
|
|
|
Atom _NET_WM_STATE_MAXIMIZED_VERT;
|
|
|
|
Atom _NET_WM_STATE_MAXIMIZED_HORZ;
|
2009-02-03 20:40:46 +00:00
|
|
|
Atom _NET_WM_STATE_SHADED;
|
2010-01-26 23:00:27 +00:00
|
|
|
Atom _NET_WM_STATE_HIDDEN;
|
2009-02-03 20:40:46 +00:00
|
|
|
Atom _NET_WM_STATE_BELOW;
|
2009-12-30 23:27:31 +00:00
|
|
|
Atom _NET_WM_STATE_ABOVE;
|
2009-02-03 20:40:46 +00:00
|
|
|
Atom _NET_WM_STATE_MODAL;
|
|
|
|
Atom _NET_CLIENT_LIST;
|
|
|
|
Atom _NET_WM_NAME;
|
|
|
|
Atom _NET_WM_VISIBLE_NAME;
|
|
|
|
Atom _NET_WM_STRUT;
|
|
|
|
Atom _NET_WM_ICON;
|
2010-11-07 08:44:27 +00:00
|
|
|
Atom _NET_WM_ICON_GEOMETRY;
|
2015-02-08 12:13:32 +00:00
|
|
|
Atom _NET_WM_ICON_NAME;
|
2009-02-03 20:40:46 +00:00
|
|
|
Atom _NET_CLOSE_WINDOW;
|
|
|
|
Atom UTF8_STRING;
|
|
|
|
Atom _NET_SUPPORTING_WM_CHECK;
|
2010-01-15 22:23:00 +00:00
|
|
|
Atom _NET_WM_CM_S0;
|
2009-02-03 20:40:46 +00:00
|
|
|
Atom _NET_WM_STRUT_PARTIAL;
|
|
|
|
Atom WM_NAME;
|
|
|
|
Atom __SWM_VROOT;
|
|
|
|
Atom _MOTIF_WM_HINTS;
|
2009-09-15 20:11:13 +00:00
|
|
|
Atom WM_HINTS;
|
2009-02-15 17:22:48 +00:00
|
|
|
Atom _NET_SYSTEM_TRAY_SCREEN;
|
2009-02-10 23:16:10 +00:00
|
|
|
Atom _NET_SYSTEM_TRAY_OPCODE;
|
|
|
|
Atom MANAGER;
|
|
|
|
Atom _NET_SYSTEM_TRAY_MESSAGE_DATA;
|
2009-02-25 20:04:43 +00:00
|
|
|
Atom _NET_SYSTEM_TRAY_ORIENTATION;
|
2009-06-29 18:39:44 +00:00
|
|
|
Atom _XEMBED;
|
|
|
|
Atom _XEMBED_INFO;
|
2010-11-07 08:44:27 +00:00
|
|
|
Atom _XSETTINGS_SCREEN;
|
|
|
|
Atom _XSETTINGS_SETTINGS;
|
2009-09-08 21:29:32 +00:00
|
|
|
Atom XdndAware;
|
2012-03-14 05:15:23 +00:00
|
|
|
Atom XdndEnter;
|
2009-09-08 21:29:32 +00:00
|
|
|
Atom XdndPosition;
|
|
|
|
Atom XdndStatus;
|
2012-03-14 05:15:23 +00:00
|
|
|
Atom XdndDrop;
|
2010-06-26 12:35:35 +00:00
|
|
|
Atom XdndLeave;
|
2012-03-14 05:15:23 +00:00
|
|
|
Atom XdndSelection;
|
|
|
|
Atom XdndTypeList;
|
|
|
|
Atom XdndActionCopy;
|
|
|
|
Atom XdndFinished;
|
|
|
|
Atom TARGETS;
|
2008-10-02 18:47:02 +00:00
|
|
|
} Global_atom;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct Monitor
|
|
|
|
{
|
2009-02-03 20:40:46 +00:00
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int width;
|
|
|
|
int height;
|
2015-04-11 09:51:10 +00:00
|
|
|
gchar** names;
|
2008-10-02 18:47:02 +00:00
|
|
|
} Monitor;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2009-02-03 20:40:46 +00:00
|
|
|
Display *dsp;
|
|
|
|
Window root_win;
|
2010-01-17 13:43:44 +00:00
|
|
|
Window composite_manager;
|
2010-04-18 12:07:36 +00:00
|
|
|
int real_transparency;
|
2015-01-30 10:01:39 +00:00
|
|
|
int disable_transparency;
|
2009-02-07 23:28:13 +00:00
|
|
|
// current desktop
|
2009-02-03 20:40:46 +00:00
|
|
|
int desktop;
|
|
|
|
int screen;
|
|
|
|
int depth;
|
|
|
|
int nb_desktop;
|
|
|
|
// number of monitor (without monitor included into another one)
|
|
|
|
int nb_monitor;
|
|
|
|
Monitor *monitor;
|
|
|
|
int got_root_win;
|
|
|
|
Visual *visual;
|
2010-02-28 07:58:50 +00:00
|
|
|
Visual *visual32;
|
2009-02-03 20:40:46 +00:00
|
|
|
// root background
|
|
|
|
Pixmap root_pmap;
|
|
|
|
GC gc;
|
2009-12-30 11:27:29 +00:00
|
|
|
Colormap colormap;
|
2010-02-28 07:58:50 +00:00
|
|
|
Colormap colormap32;
|
2009-02-03 20:40:46 +00:00
|
|
|
Global_atom atom;
|
2012-07-02 16:50:30 +00:00
|
|
|
#ifdef HAVE_SN
|
|
|
|
SnDisplay *sn_dsp;
|
|
|
|
GTree *pids;
|
|
|
|
#endif // HAVE_SN
|
2008-10-02 18:47:02 +00:00
|
|
|
} Server_global;
|
|
|
|
|
|
|
|
|
2015-01-28 15:13:56 +00:00
|
|
|
extern Server_global server;
|
2008-10-02 18:47:02 +00:00
|
|
|
|
|
|
|
|
2010-04-18 12:07:36 +00:00
|
|
|
// freed memory
|
|
|
|
void cleanup_server();
|
|
|
|
|
2009-06-30 19:55:12 +00:00
|
|
|
void send_event32 (Window win, Atom at, long data1, long data2, long data3);
|
2008-10-02 18:47:02 +00:00
|
|
|
int get_property32 (Window win, Atom at, Atom type);
|
|
|
|
void *server_get_property (Window win, Atom at, Atom type, int *num_results);
|
|
|
|
Atom server_get_atom (char *atom_name);
|
|
|
|
void server_catch_error (Display *d, XErrorEvent *ev);
|
|
|
|
void server_init_atoms ();
|
2009-12-30 11:27:29 +00:00
|
|
|
void server_init_visual();
|
2009-02-03 20:40:46 +00:00
|
|
|
|
2009-02-07 23:28:13 +00:00
|
|
|
// detect root background
|
|
|
|
void get_root_pixmap();
|
|
|
|
|
|
|
|
// detect monitors and desktops
|
2009-09-27 16:57:19 +00:00
|
|
|
void get_monitors();
|
|
|
|
void get_desktops();
|
2015-01-30 09:54:16 +00:00
|
|
|
int server_get_number_of_desktops();
|
2008-10-02 18:47:02 +00:00
|
|
|
|
|
|
|
#endif
|