File: screen.h

package info (click to toggle)
afterstep 2.2.12-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 33,168 kB
  • sloc: ansic: 201,695; sh: 5,894; xml: 3,721; makefile: 2,095; perl: 1,558; cpp: 811
file content (210 lines) | stat: -rw-r--r-- 5,932 bytes parent folder | download | duplicates (5)
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/***********************************************************************
 *
 * afterstep per-screen data include file
 *
 ***********************************************************************/

#ifndef SCREEN_H_HEADER_INCLUDED
#define SCREEN_H_HEADER_INCLUDED

#include "afterstep.h"
#include "clientprops.h"
#include "hints.h"
#include "asdatabase.h"
#include "font.h"
#include "mylook.h"
#include "asfeel.h"

#ifdef __cplusplus
extern "C" {
#endif

#define SIZE_HINDENT 5
#define SIZE_VINDENT 3
#define MAX_WINDOW_WIDTH 32767
#define MAX_WINDOW_HEIGHT 32767

/* Maximum number of icon boxes that are allowed */
#define MAX_BOXES 4

/* button styles */
#define NO_BUTTON_STYLE		-1	/* button is undefined */
#define XPM_BUTTON_STYLE	2	/* button is a pixmap */

#ifndef NO_VIRTUAL
typedef struct
{
	Window win;
	int isMapped;
}ASPanFrame;

#endif

/* look file flags */
struct MenuRoot;
struct MouseButton;
struct FuncKey;
struct MyStyle;
struct ASSupportedHints;
struct MyFrame;
struct ASHashTable;
struct ComplexFunction;
struct ASFontManager;
struct ASImageManager;
struct ASCanvas;
struct ASMoveResizeData;

typedef struct ASDesktop
{
	int 	Desk ;
	unsigned short vx, vy ;
}ASDesktop;

typedef struct ASIconBox
{
	int desktop ;
	ASGeometry *areas ;
	unsigned short areas_num ;
	ASBiDirList *icons ;
}ASIconBox;

typedef struct ASBackgroundHandler
{
	Pixmap  pmap;
	unsigned int pmap_width, pmap_height ;
	int     cmd_pid;
	ASImage *im;
}ASBackgroundHandler;

typedef struct ScreenInfo
  {
	unsigned long screen;
	int d_depth;            /* copy of DefaultDepth(dpy, screen) */
	int NumberOfScreens;	/* number of screens on display */
	int MyDisplayWidth;		/* my copy of DisplayWidth(dpy, screen) */
	int MyDisplayHeight;	/* my copy of DisplayHeight(dpy, screen) */

	Bool localhost ;
	char *rdisplay_string, *display_string;
	
	struct ASWMProps    *wmprops;              /* window management properties */

	struct ASVisual *asv ;  /* ASVisual for libAfterImage */
	Window Root;        /* the root window */
	struct ASImage  *RootImage;
	struct ASCanvas *RootCanvas;
	/* this is used to limit area of the root window from which to get root image : */
	XRectangle RootClipArea;                /* used only by modules */
	ASBackgroundHandler *RootBackground;    /* used only by those who change root background */

	Window SizeWindow;      /* the resize dimensions window */
	Window ServiceWin;      /* Auxilary window that we use for :
							 *    1) hiding focus - it will own focus when no other windows have it
							 *    2) desktop switching - off-desktop windows will be reparented there
							 */

	struct ASWindowList *Windows ;
/*    ASWindow ASRoot;        the head of the afterstep window list */
/*    struct ASHashTable *aswindow_xref;        xreference of window/resource IDs to ASWindow structures */

	struct ASIconBox   *default_icon_box ; /* if we have icons following desktops - then we only need one icon box */
	struct ASHashTable *icon_boxes ; /* hashed by desk no - one icon box per desktop ! */

#define PAN_FRAME_SIDES 4

#define AS_PANFRAME_EVENT_MASK (EnterWindowMask|LeaveWindowMask|VisibilityChangeMask)

#ifndef NO_VIRTUAL
	ASPanFrame PanFrame[PAN_FRAME_SIDES];
	int usePanFrames;		/* toggle to disable them */
#endif

	/* interactive move resize data : */
	struct ASMoveResizeData *moveresize_in_progress;

	int randomx;        /* values used for randomPlacement */
	int randomy;
	unsigned VScale;		/* Panner scale factor */
	int VxMax;			/* Max location for top left of virt desk */
	int VyMax;
	int Vx;			/* Current loc for top left of virt desk */
	int Vy;

	int CurrentDesk;        /* The current desktop number */
	int LastValidDesk;      /* Last nonspecial desktop's number  (<> 10000) */

	Time   last_Timestamp;                      /* last event timestamp */
	Time   menu_grab_Timestamp;                 /* pointer grab time used in menus */

	ASFeel  Feel;
	MyLook  Look;

	Cursor  standard_cursors[MAX_CURSORS];

	GC DrawGC;          /* GC to draw lines for move and resize */
	GC RootGC;      /* GC to draw on the root window - 
						   separate as it may have different color depth */

	int xinerama_screens_num ;
	XRectangle *xinerama_screens;

	struct ASFontManager  *font_manager ;
	struct ASImageManager *image_manager ;

	Bool (*on_dead_window)( Window w );
	
	/* supported X extensions : */
	int XineEventBase, XineErrorBase;
	int	ShmCompletionEventType ;
	int	ShapeEventBase ;
	int	ShapeErrorBase ;

}ScreenInfo;

void init_ScreenInfo(ScreenInfo *scr);
void init_screen_gcs(ScreenInfo *scr);
void destroy_screen_gcs(ScreenInfo *scr);

void make_screen_envvars( ScreenInfo *scr );

void init_screen_panframes(ScreenInfo *scr);
void check_screen_panframes(ScreenInfo *scr);
void raise_scren_panframes (ScreenInfo *scr);
Window get_lowest_panframe(ScreenInfo *scr);

void reload_screen_image_manager( ScreenInfo *scr, struct ASImageManager **old_imageman );
ScreenInfo *get_current_screen();
int get_screen_width(ScreenInfo *scr);
int get_screen_height(ScreenInfo *scr);
int get_screen_current_desk(ScreenInfo *scr);
struct MyLook *get_screen_look(ScreenInfo *scr);
struct ASImageManager *get_screen_image_manager(ScreenInfo *scr);
struct ASFontManager *get_screen_font_manager(ScreenInfo *scr);
struct ASVisual *get_screen_visual(ScreenInfo *scr);



#ifdef HAVE_XINERAMA
void get_Xinerama_rectangles (ScreenInfo * scr);
#endif
Bool set_synchronous_mode (Bool enable);

int ConnectXDisplay (Display *display, ScreenInfo * scr, Bool as_manager);
/* this is a shortcut to above : */
int ConnectX (ScreenInfo * scr, unsigned long event_mask);

void setup_modifiers ();

#define  create_screen_window(scr,p,x,y,w,h,bw,c,mask,attr) \
	create_visual_window((scr)->asv,((p)==None)?((scr)->Root):(p),x,y,w,h,bw,c,mask,attr)

void merge_geometry( ASGeometry *from, ASGeometry *to );
void check_desksize_sanity( ScreenInfo *scr );

#ifdef __cplusplus
}
#endif



#endif /* _SCREEN_ */