Laxkit  0.0.7.1
laxdefs.h
1 //
2 //
3 // The Laxkit, a windowing toolkit
4 // Please consult http://laxkit.sourceforge.net about where to send any
5 // correspondence about this software.
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Library General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Library General Public License for more details.
16 //
17 // You should have received a copy of the GNU Library General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 //
21 // Copyright (C) 2004-2013 by Tom Lechner
22 //
23 #ifndef _LAX_LAXDEFS_H
24 #define _LAX_LAXDEFS_H
25 
26 
27 namespace Laxkit {
28 
29 
30 //------------------------------------ Utility defines --------------------------------------
31 #ifndef MIN
32 #define MIN( a, b ) ((a) < (b) ? (a) : (b))
33 #endif
34 
35 #ifndef MAX
36 #define MAX( a, b ) ((a) > (b) ? (a) : (b))
37 #endif
38 
39 
40 //------------------------------ Laxkit capabilities ----------------------------------
41  //these can be queried in anXApp::has()
42 #define LAX_HAS_IMLIB2 0
43 #define LAX_HAS_CAIRO 1
44 #define LAX_HAS_GL 2
45 #define LAX_HAS_XINPUT2 3
46 
47 
48 //-------------------- Misc stuff that needs a better category name -----------------------
49 #define LAX_ISNOTLOCAL 0
50 #define LAX_ISLOCAL 1
51 #define LAX_ISLOCAL_ARRAY 2
52 #define LAX_IS_REF_COUNTED 3
53 
54  // various flags to possibly be passed to dump_out()
55  // LAX_DUMP_NORMAL will always be 0
56 #define LAX_DUMP_NORMAL 0
57 #define LAX_DUMP_SVG 1
58 #define LAX_DUMP_PS 2
59 #define LAX_DUMP_EPS 3
60 #define LAX_DUMP_PDF 4
61 
62  // note to developer that these 2 should Never be different values
63 #define LAX_ACCEPT 0
64 #define LAX_REJECT 1
65 
66 
67 //------------------------------------ Alignment -------------------------------------------
68 #define LAX_LEFT (1<<0)
69 #define LAX_HCENTER (1<<1)
70 #define LAX_RIGHT (1<<2)
71 #define LAX_CHAR (1<<3)
72 #define LAX_NUMERIC (1<<4)
73 #define LAX_TOP (1<<5)
74 #define LAX_VCENTER (1<<6)
75 #define LAX_BOTTOM (1<<7)
76 #define LAX_BASELINE (1<<8)
77 #define LAX_CENTER (1<<1|1<<6)
78 
79 typedef enum {
80  LAX_TOP_LEFT=1,
81  LAX_TOP_MIDDLE,
82  LAX_TOP_RIGHT,
83  LAX_MIDDLE_LEFT,
84  LAX_MIDDLE,
85  LAX_MIDDLE_RIGHT,
86  LAX_BOTTOM_LEFT,
87  LAX_BOTTOM_MIDDLE,
88  LAX_BOTTOM_RIGHT
89 } BBoxReferencePoint;
90 
91 
92 //----------------------------- Arrangement flow direction -----------------------------------
93 //***whats with this? should be enum-like?
94 #define LAX_LRTB (0)
95 #define LAX_LRBT (1)
96 #define LAX_RLTB (2)
97 #define LAX_RLBT (3)
98 #define LAX_TBLR (4)
99 #define LAX_TBRL (5)
100 #define LAX_BTLR (6)
101 #define LAX_BTRL (7)
102 #define LAX_FLOW_MASK (0x7)
103 
104 
105 //----------------------------- Menu item state --------------------------------------------
106  // Usually, a menu item state can be only one of these, these are for convenience
107  // a state variable can usually hold any state in range [0,255]
108  // and mousein/open/etc flags are bits >255
109  // Defining like this ensures that HIDDEN==0, OFF=1, ON==2, all else >2 and <=255
110 #define LAX_HIDDEN (0)
111 #define LAX_OFF (1<<0)
112 #define LAX_ON (1<<1)
113 #define LAX_GRAY (1<<2)
114 #define LAX_SEPARATOR (1<<3)
115 #define LAX_MSTATE_MASK (0xff)
116 
117  // note to programmer: make sure this can be combined with above state
118  // note to programmer: *** why are these here? need better way to organize this sort of state
119 #define LAX_OPEN (1<<8)
120 #define LAX_CCUR (1<<9)
121 #define LAX_MOUSEIN (1<<10)
122 #define LAX_ISLEAF (1<<11)
123 #define LAX_HAS_SUBMENU (1<<12)
124 #define LAX_ISTOGGLE (1<<13)
125 #define LAX_CHECKED (1<<14)
126 
127 
128 //----------------------------- Modifier State ----------------------------------
129 //common mouse button assignments
130 #define LEFTBUTTON 1
131 #define MIDDLEBUTTON 2
132 #define RIGHTBUTTON 4
133 #define WHEELUPBUTTON 8
134 #define WHEELDOWNBUTTON 16
135 #define WHEELLEFTBUTTON 32
136 #define WHEELRIGHTBUTTON 64
137 #define MOUSEBACK 128
138 #define MOUSEFORWARD 256
139 
141 
156 #define LAX_STATE_MASK ((1<<0)|(1<<2)|(1<<3)|(1<<6))
157 
158 // Lax Xlib
159 // --------------- ------
160 // AltMask == Mod1Mask
161 // NumLockMask == Mod2Mask
162 // CapsLockMask == LockMask
163 // MetaMask == Mod4Mask
164 // LeftButtonMask == Button1Mask
165 // MiddleButtonMask == Button2Mask
166 // RightButtonMask == Button3Mask
167 // WheelUpMask == Button4Mask
168 // WheelDownMask == Button5Mask
169 // KeypadMask == (none)
170 //
171 // same as Xlib:
172 //#define ShiftMask == ShiftMask
173 //#define ControlMask == ControlMask
174 //#define Mod3Mask == Mod3Mask
175 //#define Mod5Mask == Mod5Mask
176 
177 #ifndef _LAX_PLATFORM_XLIB
178 # define ShiftMask (1<<0)
179 # define ControlMask (1<<2)
180 # define Mod3Mask (1<<5)
181 # define Mod5Mask (1<<7)
182 #endif
183 
184 #define CapsLockMask (1<<1)
185 #define AltMask (1<<3)
186 #define NumLockMask (1<<4)
187 #define MetaMask (1<<6)
188 
189 #define LeftButtonMask (1<<8)
190 #define MiddleButtonMask (1<<9)
191 #define RightButtonMask (1<<10)
192 #define WheelUpMask (1<<11)
193 #define WheelDownMask (1<<12)
194 
195 #define KeypadMask (1<<15)
196 
197 
198 //----------------------------- Special Keys ----------------------------------
199 //---these are currently mostly the same as Xlib keysyms
200 // except that tab and enter map to \t and \r.
201 // Otherwise, using keysym for now.
202 // Maybe someday will use unicode values, and these control keys may be something
203 // like 0x02000000+whatever
204 
205 #define LAX_NULL 0
206 #define LAX_Shift 0xffe1
207 #define LAX_Control 0xffe3
208 #define LAX_Esc 0xff1b
209 #define LAX_Menu 0xff67
210 #define LAX_Pause 0xff13
211 #define LAX_Alt 0xffe9
212 #define LAX_Meta 0xffe7
213 #define LAX_Del 0xffff
214 #define LAX_Bksp 0xff08
215 #define LAX_Tab 9
216 #define LAX_Ins 0xff63
217 #define LAX_Home 0xff50
218 #define LAX_End 0xff57
219 #define LAX_Enter 13
220 #define LAX_Pgup 0xff55
221 #define LAX_Pgdown 0xff56
222 #define LAX_F1 0xffbe
223 #define LAX_F2 0xffbf
224 #define LAX_F3 0xffc0
225 #define LAX_F4 0xffc1
226 #define LAX_F5 0xffc2
227 #define LAX_F6 0xffc3
228 #define LAX_F7 0xffc4
229 #define LAX_F8 0xffc5
230 #define LAX_F9 0xffc6
231 #define LAX_F10 0xffc7
232 #define LAX_F11 0xffc8
233 #define LAX_F12 0xffc9
234 #define LAX_Left 0xff51
235 #define LAX_Up 0xff52
236 #define LAX_Down 0xff54
237 #define LAX_Right 0xff53
238 #define LAX_Numlock 0xff7f
239 #define LAX_Capslock 0xffe5
240 
241 
242 //The following are basically one for one with XF86XK_* from /usr/include/X11/XF86keysym.h
243 //They map various special keys found on different keyboards.
244 
245 /* Backlight controls. */
246 #define LAX_MonBrightnessUp 0x1008FF02 /* Monitor/panel brightness */
247 #define LAX_MonBrightnessDown 0x1008FF03 /* Monitor/panel brightness */
248 #define LAX_KbdLightOnOff 0x1008FF04 /* Keyboards may be lit */
249 #define LAX_KbdBrightnessUp 0x1008FF05 /* Keyboards may be lit */
250 #define LAX_KbdBrightnessDown 0x1008FF06 /* Keyboards may be lit */
251 
252 /*
253  * Keys found on some "Internet" keyboards.
254  */
255 #define LAX_Standby 0x1008FF10 /* System into standby mode */
256 #define LAX_AudioLowerVolume 0x1008FF11 /* Volume control down */
257 #define LAX_AudioMute 0x1008FF12 /* Mute sound from the system */
258 #define LAX_AudioRaiseVolume 0x1008FF13 /* Volume control up */
259 #define LAX_AudioPlay 0x1008FF14 /* Start playing of audio > */
260 #define LAX_AudioStop 0x1008FF15 /* Stop playing audio */
261 #define LAX_AudioPrev 0x1008FF16 /* Previous track */
262 #define LAX_AudioNext 0x1008FF17 /* Next track */
263 #define LAX_HomePage 0x1008FF18 /* Display user's home page */
264 #define LAX_Mail 0x1008FF19 /* Invoke user's mail program */
265 #define LAX_Start 0x1008FF1A /* Start application */
266 #define LAX_Search 0x1008FF1B /* Search */
267 #define LAX_AudioRecord 0x1008FF1C /* Record audio application */
268 
269 /* These are sometimes found on PDA's (e.g. Palm, PocketPC or elsewhere) */
270 #define LAX_Calculator 0x1008FF1D /* Invoke calculator program */
271 #define LAX_Memo 0x1008FF1E /* Invoke Memo taking program */
272 #define LAX_ToDoList 0x1008FF1F /* Invoke To Do List program */
273 #define LAX_Calendar 0x1008FF20 /* Invoke Calendar program */
274 #define LAX_PowerDown 0x1008FF21 /* Deep sleep the system */
275 #define LAX_ContrastAdjust 0x1008FF22 /* Adjust screen contrast */
276 #define LAX_RockerUp 0x1008FF23 /* Rocker switches exist up */
277 #define LAX_RockerDown 0x1008FF24 /* and down */
278 #define LAX_RockerEnter 0x1008FF25 /* and let you press them */
279 
280 /* Some more "Internet" keyboard symbols */
281 #define LAX_Back 0x1008FF26 /* Like back on a browser */
282 #define LAX_Forward 0x1008FF27 /* Like forward on a browser */
283 #define LAX_Stop 0x1008FF28 /* Stop current operation */
284 #define LAX_Refresh 0x1008FF29 /* Refresh the page */
285 #define LAX_PowerOff 0x1008FF2A /* Power off system entirely */
286 #define LAX_WakeUp 0x1008FF2B /* Wake up system from sleep */
287 #define LAX_Eject 0x1008FF2C /* Eject device (e.g. DVD) */
288 #define LAX_ScreenSaver 0x1008FF2D /* Invoke screensaver */
289 #define LAX_WWW 0x1008FF2E /* Invoke web browser */
290 #define LAX_Sleep 0x1008FF2F /* Put system to sleep */
291 #define LAX_Favorites 0x1008FF30 /* Show favorite locations */
292 #define LAX_AudioPause 0x1008FF31 /* Pause audio playing */
293 #define LAX_AudioMedia 0x1008FF32 /* Launch media collection app */
294 #define LAX_MyComputer 0x1008FF33 /* Display "My Computer" window */
295 #define LAX_VendorHome 0x1008FF34 /* Display vendor home web site */
296 #define LAX_LightBulb 0x1008FF35 /* Light bulb keys exist */
297 #define LAX_Shop 0x1008FF36 /* Display shopping web site */
298 #define LAX_History 0x1008FF37 /* Show history of web surfing */
299 #define LAX_OpenURL 0x1008FF38 /* Open selected URL */
300 #define LAX_AddFavorite 0x1008FF39 /* Add URL to favorites list */
301 #define LAX_HotLinks 0x1008FF3A /* Show "hot" links */
302 #define LAX_BrightnessAdjust 0x1008FF3B /* Invoke brightness adj. UI */
303 #define LAX_Finance 0x1008FF3C /* Display financial site */
304 #define LAX_Community 0x1008FF3D /* Display user's community */
305 #define LAX_AudioRewind 0x1008FF3E /* "rewind" audio track */
306 #define LAX_BackForward 0x1008FF3F /* ??? */
307 #define LAX_Launch0 0x1008FF40 /* Launch Application */
308 #define LAX_Launch1 0x1008FF41 /* Launch Application */
309 #define LAX_Launch2 0x1008FF42 /* Launch Application */
310 #define LAX_Launch3 0x1008FF43 /* Launch Application */
311 #define LAX_Launch4 0x1008FF44 /* Launch Application */
312 #define LAX_Launch5 0x1008FF45 /* Launch Application */
313 #define LAX_Launch6 0x1008FF46 /* Launch Application */
314 #define LAX_Launch7 0x1008FF47 /* Launch Application */
315 #define LAX_Launch8 0x1008FF48 /* Launch Application */
316 #define LAX_Launch9 0x1008FF49 /* Launch Application */
317 #define LAX_LaunchA 0x1008FF4A /* Launch Application */
318 #define LAX_LaunchB 0x1008FF4B /* Launch Application */
319 #define LAX_LaunchC 0x1008FF4C /* Launch Application */
320 #define LAX_LaunchD 0x1008FF4D /* Launch Application */
321 #define LAX_LaunchE 0x1008FF4E /* Launch Application */
322 #define LAX_LaunchF 0x1008FF4F /* Launch Application */
323 
324 #define LAX_ApplicationLeft 0x1008FF50 /* switch to application, left */
325 #define LAX_ApplicationRight 0x1008FF51 /* switch to application, right*/
326 #define LAX_Book 0x1008FF52 /* Launch bookreader */
327 #define LAX_CD 0x1008FF53 /* Launch CD/DVD player */
328 #define LAX_Calculater 0x1008FF54 /* Launch Calculater */
329 #define LAX_Clear 0x1008FF55 /* Clear window, screen */
330 #define LAX_Close 0x1008FF56 /* Close window */
331 #define LAX_Copy 0x1008FF57 /* Copy selection */
332 #define LAX_Cut 0x1008FF58 /* Cut selection */
333 #define LAX_Display 0x1008FF59 /* Output switch key */
334 #define LAX_DOS 0x1008FF5A /* Launch DOS (emulation) */
335 #define LAX_Documents 0x1008FF5B /* Open documents window */
336 #define LAX_Excel 0x1008FF5C /* Launch spread sheet */
337 #define LAX_Explorer 0x1008FF5D /* Launch file explorer */
338 #define LAX_Game 0x1008FF5E /* Launch game */
339 #define LAX_Go 0x1008FF5F /* Go to URL */
340 #define LAX_iTouch 0x1008FF60 /* Logitch iTouch- don't use */
341 #define LAX_LogOff 0x1008FF61 /* Log off system */
342 #define LAX_Market 0x1008FF62 /* ?? */
343 #define LAX_Meeting 0x1008FF63 /* enter meeting in calendar */
344 #define LAX_MenuKB 0x1008FF65 /* distingush keyboard from PB */
345 #define LAX_MenuPB 0x1008FF66 /* distinuish PB from keyboard */
346 #define LAX_MySites 0x1008FF67 /* Favourites */
347 #define LAX_New 0x1008FF68 /* New (folder, document... */
348 #define LAX_News 0x1008FF69 /* News */
349 #define LAX_OfficeHome 0x1008FF6A /* Office home (old Staroffice)*/
350 #define LAX_Open 0x1008FF6B /* Open */
351 #define LAX_Option 0x1008FF6C /* ?? */
352 #define LAX_Paste 0x1008FF6D /* Paste */
353 #define LAX_Phone 0x1008FF6E /* Launch phone; dial number */
354 #define LAX_Q 0x1008FF70 /* Compaq's Q - don't use */
355 #define LAX_Reply 0x1008FF72 /* Reply e.g., mail */
356 #define LAX_Reload 0x1008FF73 /* Reload web page, file, etc. */
357 #define LAX_RotateWindows 0x1008FF74 /* Rotate windows e.g. xrandr */
358 #define LAX_RotationPB 0x1008FF75 /* don't use */
359 #define LAX_RotationKB 0x1008FF76 /* don't use */
360 #define LAX_Save 0x1008FF77 /* Save (file, document, state */
361 #define LAX_ScrollUp 0x1008FF78 /* Scroll window/contents up */
362 #define LAX_ScrollDown 0x1008FF79 /* Scrool window/contentd down */
363 #define LAX_ScrollClick 0x1008FF7A /* Use XKB mousekeys instead */
364 #define LAX_Send 0x1008FF7B /* Send mail, file, object */
365 #define LAX_Spell 0x1008FF7C /* Spell checker */
366 #define LAX_SplitScreen 0x1008FF7D /* Split window or screen */
367 #define LAX_Support 0x1008FF7E /* Get support (??) */
368 #define LAX_TaskPane 0x1008FF7F /* Show tasks */
369 #define LAX_Terminal 0x1008FF80 /* Launch terminal emulator */
370 #define LAX_Tools 0x1008FF81 /* toolbox of desktop/app. */
371 #define LAX_Travel 0x1008FF82 /* ?? */
372 #define LAX_UserPB 0x1008FF84 /* ?? */
373 #define LAX_User1KB 0x1008FF85 /* ?? */
374 #define LAX_User2KB 0x1008FF86 /* ?? */
375 #define LAX_Video 0x1008FF87 /* Launch video player */
376 #define LAX_WheelButton 0x1008FF88 /* button from a mouse wheel */
377 #define LAX_Word 0x1008FF89 /* Launch word processor */
378 #define LAX_Xfer 0x1008FF8A
379 #define LAX_ZoomIn 0x1008FF8B /* zoom in view, map, etc. */
380 #define LAX_ZoomOut 0x1008FF8C /* zoom out view, map, etc. */
381 
382 #define LAX_Away 0x1008FF8D /* mark yourself as away */
383 #define LAX_Messenger 0x1008FF8E /* as in instant messaging */
384 #define LAX_WebCam 0x1008FF8F /* Launch web camera app. */
385 #define LAX_MailForward 0x1008FF90 /* Forward in mail */
386 #define LAX_Pictures 0x1008FF91 /* Show pictures */
387 #define LAX_Music 0x1008FF92 /* Launch music application */
388 
389 #define LAX_Battery 0x1008FF93 /* Display battery information */
390 #define LAX_Bluetooth 0x1008FF94 /* Enable/disable Bluetooth */
391 #define LAX_WLAN 0x1008FF95 /* Enable/disable WLAN */
392 #define LAX_UWB 0x1008FF96 /* Enable/disable UWB */
393 
394 #define LAX_AudioForward 0x1008FF97 /* fast-forward audio track */
395 #define LAX_AudioRepeat 0x1008FF98 /* toggle repeat mode */
396 #define LAX_AudioRandomPlay 0x1008FF99 /* toggle shuffle mode */
397 #define LAX_Subtitle 0x1008FF9A /* cycle through subtitle */
398 #define LAX_AudioCycleTrack 0x1008FF9B /* cycle through audio tracks */
399 #define LAX_CycleAngle 0x1008FF9C /* cycle through angles */
400 #define LAX_FrameBack 0x1008FF9D /* video: go one frame back */
401 #define LAX_FrameForward 0x1008FF9E /* video: go one frame forward */
402 #define LAX_Time 0x1008FF9F /* display, or shows an entry for time seeking */
403 #define LAX_Select 0x1008FFA0 /* Select button on joypads and remotes */
404 #define LAX_View 0x1008FFA1 /* Show a view options/properties */
405 #define LAX_TopMenu 0x1008FFA2 /* Go to a top-level menu in a video */
406 
407 #define LAX_Red 0x1008FFA3 /* Red button */
408 #define LAX_Green 0x1008FFA4 /* Green button */
409 #define LAX_Yellow 0x1008FFA5 /* Yellow button */
410 #define LAX_Blue 0x1008FFA6 /* Blue button */
411 
412 #define LAX_Suspend 0x1008FFA7 /* Sleep to RAM */
413 #define LAX_Hibernate 0x1008FFA8 /* Sleep to disk */
414 #define LAX_TouchpadToggle 0x1008FFA9 /* Toggle between touchpad/trackstick */
415 #define LAX_TouchpadOn 0x1008FFB0 /* The touchpad got switched on */
416 #define LAX_TouchpadOff 0x1008FFB1 /* The touchpad got switched off */
417 
418 /* Keys for special action keys (hot keys) */
419 /* Virtual terminals on some operating systems */
420 #define LAX_Switch_VT_1 0x1008FE01
421 #define LAX_Switch_VT_2 0x1008FE02
422 #define LAX_Switch_VT_3 0x1008FE03
423 #define LAX_Switch_VT_4 0x1008FE04
424 #define LAX_Switch_VT_5 0x1008FE05
425 #define LAX_Switch_VT_6 0x1008FE06
426 #define LAX_Switch_VT_7 0x1008FE07
427 #define LAX_Switch_VT_8 0x1008FE08
428 #define LAX_Switch_VT_9 0x1008FE09
429 #define LAX_Switch_VT_10 0x1008FE0A
430 #define LAX_Switch_VT_11 0x1008FE0B
431 #define LAX_Switch_VT_12 0x1008FE0C
432 
433 #define LAX_Ungrab 0x1008FE20 /* force ungrab */
434 #define LAX_ClearGrab 0x1008FE21 /* kill application with grab */
435 #define LAX_Next_VMode 0x1008FE22 /* next video mode available */
436 #define LAX_Prev_VMode 0x1008FE23 /* prev. video mode available */
437 #define LAX_LogWindowTree 0x1008FE24 /* print window tree to log */
438 #define LAX_LogGrabInfo 0x1008FE25 /* print all active grabs to log */
439 
440 
441 } // namespace Laxkit
442 
443 #endif
444 

Mon Feb 17 2014 11:52:56, Laxkit