4 * header for both xwphook.c and xwpdaemon.c. This is also
5 * included from a number of sources for XFLDR.DLL which need
6 * to interface (configure) the daemon.
10 * Copyright (C) 1999-2002 Ulrich M”ller.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, in version 2 as it comes in the COPYING
14 * file of the XWorkplace main distribution.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef XWPHOOK_HEADER_INCLUDED
22 #define XWPHOOK_HEADER_INCLUDED
24 /* ******************************************************************
26 * OS2.INI applications and keys
28 ********************************************************************/
30 #define INIAPP_XWPHOOK "XWorkplace:Hook" // added V0.9.0
31 #define INIKEY_HOOK_HOTKEYS "Hotkeys" // added V0.9.0
32 #define INIKEY_HOOK_CONFIG "Config" // added V0.9.0
33 #define INIKEY_HOOK_PAGERCONFIG "PagerConfig" // V0.9.2 (2000-02-25) [umoeller]
34 // changed V0.9.19 (2002-05-07) [umoeller]
35 #define INIKEY_HOOK_PAGERWINPOS "PagerWinPos"
36 // changed V0.9.19 (2002-05-07) [umoeller]
37 #define INIKEY_HOOK_FUNCTIONKEYS "FuncKeys" // added V0.9.3 (2000-04-19) [umoeller]
38 #define INIKEY_HOOK_MOUSEMAPPINGS "MouseMappings" // added V0.9.19 (2002-04-20) [lafaix]
40 /* ******************************************************************
44 ********************************************************************/
46 // do not change the following, or this will break
47 // binary compatibility of the XPager OS2.INI data
48 #define MAX_STICKIES 64
53 // flags for PAGERCONFIG.aulStickyFlags
54 #define SF_CONTAINS 0x00000000L // default
55 #define SF_BEGINSWITH 0x00000001L
56 #define SF_ENDSWITH 0x00000002L
57 #define SF_EQUALS 0x00000004L
58 #define SF_MATCHES 0x00000008L // V0.9.19 (2002-04-17) [umoeller]
59 #define SF_OPERATOR_MASK 0x0000FFFFL
61 #define SF_INCLUDE 0x00000000L // default
62 #define SF_EXCLUDE 0x00010000L
63 #define SF_CRITERIA_MASK 0x00010000L
65 #define SF_TITLE 0x00000000L // default
66 #define SF_ATTRIBUTE_MASK 0xFFFE0000L
72 * XPager configuration data.
73 * This is stored within the HOOKDATA structure
74 * (statically in the hook DLL) so that both
75 * the daemon and the hook have access to this.
77 *@@added V0.9.2 (2000-02-25) [umoeller]
80 typedef struct _PAGERCONFIG
84 // no. of virtual Desktops (x and y)
87 // initial desktop at startup
90 // flags for "XPager" settings page 1
91 #define PGRFL_WRAPAROUND 0x0001
92 #define PGRFL_HOTKEYS 0x0002
93 #define PGRFL_NOFOLLOWFOCUS 0x0004
95 #define PGRMASK_PAGE1 (PGRFL_WRAPAROUND | PGRFL_HOTKEYS)
96 #define PGRFL_PAGE1_DEFAULTS 0
98 // flags for "XPager" settings page 2
99 #define PGRFL_PRESERVEPROPS 0x0010
100 // preserve proportions of XPager win when resizing?
101 #define PGRFL_STAYONTOP 0x0020
103 #define PGRFL_FLASHTOTOP 0x0040
104 #define PGRFL_MINIWINDOWS 0x0080
105 // show mini windows in XPager?
106 #define PGRFL_MINIWIN_TITLES 0x0100
107 // show mini window titles?
108 #define PGRFL_MINIWIN_MOUSE 0x0200
109 // allow activate/lower by mouse clicks?
110 #define PGRFL_INCLUDESECONDARY 0x0400
111 #define PGRFL_INCLUDESTICKY 0x0800
112 #define PGRFL_MINIWIN_ICONS 0x1000
113 // show mini window icons?
114 // V0.9.19 (2002-06-13) [umoeller]
116 #define PGRMASK_PAGE2 ( PGRFL_PRESERVEPROPS \
119 | PGRFL_MINIWINDOWS \
120 | PGRFL_MINIWIN_TITLES \
121 | PGRFL_MINIWIN_MOUSE \
122 | PGRFL_INCLUDESECONDARY \
123 | PGRFL_INCLUDESTICKY \
124 | PGRFL_MINIWIN_ICONS )
125 #define PGRFL_PAGE2_DEFAULTS ( PGRFL_PRESERVEPROPS \
126 | PGRFL_MINIWINDOWS \
127 | PGRFL_MINIWIN_TITLES \
128 | PGRFL_MINIWIN_MOUSE)
130 // flags for "XPager" settings page 3
131 #define PGRFL_ADDSTICKYTOGGLE 0x2000
132 // add "sticky" option to system menu?
133 // V1.0.0 (2002-09-14) [lafaix]
135 #define PGRMASK_PAGE3 ( PGRFL_ADDSTICKYTOGGLE )
136 #define PGRFL_PAGE3_DEFAULTS 0
137 #define PGRFL_WINDOWS_KEYS 0x00010000
138 // V1.0.3 (2004-10-14) [bird]: Use windows keys for left / right
141 // "flash" delay in milliseconds, if PGRFL_FLASHTOTOP
142 ULONG flKeyShift
; // KC_* values
145 ULONG flPaintMode
; // as in BKGNDINFO (gpih.h)
146 LONG lcolDesktop1
, // as in BKGNDINFO (gpih.h)
147 lcolDesktop2
; // as in BKGNDINFO (gpih.h)
149 LONG lcolActiveDesktop
; // color of hatching for active desktop
151 LONG lcolGrid
; // grid color (separators between desktops)
153 LONG lcolInactiveWindow
,
161 ULONG aulStickyFlags
[MAX_STICKIES
]; // SF_* flags per sticky
162 CHAR aszStickies
[MAX_STICKIES
][STICKYLEN
];
164 } PAGERCONFIG
, *PPAGERCONFIG
;
170 // flags for HOOKCONFIG.usScrollMode
171 #define SM_LINEWISE 0
172 #define SM_AMPLIFIED 1
174 // flags for HOOKCONFIG.ulAutoHideFlags
175 #define AHF_IGNOREMENUS 0x00000001L
176 #define AHF_IGNOREBUTTONS 0x00000002L
178 // flags for HOOKCONFIG.ulAutoMoveFlags
179 #define AMF_ALWAYSMOVE 0x00000001L
180 #define AMF_IGNORENOBUTTON 0x00000002L
181 #define AMF_ANIMATE 0x00000004L
185 * configuration data for the hook and the daemon.
187 * This is stored within the HOOKDATA structure
188 * (statically in the hook DLL) so that both
189 * the daemon and the hook have access to this.
191 * A mirror of this structure is put into OS2.INI
192 * which gets loaded by the XWorkplace settings
193 * objects in XFLDR.DLL to configure the hook.
194 * This gets (re)loaded by the daemon when XFLDR.DLL
195 * posts XDM_HOOKCONFIG to fnwpDaemonObject.
197 * So this is seen by the hook and the daemon;
198 * XFLDR.DLL only writes this back to OS2.INI and
199 * notifies the daemon to reload this.
201 * For every item, the safe default value is null
202 * so the structure can be zeroed to disable
205 * If settings are added to this structure, they
206 * must be added to the bottom in order not to
207 * break binary compatibility between XWP versions.
209 * Note that the object hotkey _definitions_ are
210 * not part of this structure. Those are set using
211 * XDM_HOTKEYSCHANGED instead. However, object
212 * hotkeys are globally enabled in here (fGlobalHotkeys).
215 typedef struct _HOOKCONFIG
219 PM_BOOL __fSlidingFocus
;
221 ULONG __ulSlidingFocusDelay
;
222 // delay in ms; 0 = off
224 PM_BOOL __fSlidingBring2Top
;
225 // bring windows to top or preserve Z-order
226 PM_BOOL __fSlidingIgnoreDesktop
;
227 // ignore Desktop windows
228 PM_BOOL __fSlidingIgnoreSeamless
;
229 // TRUE: ignore seamless Win-OS/2 windows
230 // FALSE: always bring them to top
232 // Screen corner objects:
233 HOBJECT ahobjDummy
[4]; // was four screen corner objects;
234 // we extended the array to 8 items
235 // so the array had to be moved to the
236 // bottom in order not to break binary
239 BYTE bMonitorDrives
[30]; // array of 1-byte BOOLs; if any of these
240 // is "1", the corresponding drive letter
241 // will be monitored for media change
242 // (index 1 = A, index 2 = B, index 3 = C, ...).
243 // Index 0 is unused to match logical drive numbers.
245 // More mouse mappings: V0.9.1 (99-12-03)
247 PM_BOOL fChordWinList
; // deprecated V0.9.19 (2002-04-20) [lafaix]
248 // show window list on mb1+2 chord
249 PM_BOOL fSysMenuMB2TitleBar
; // deprecated V0.9.19 (2002-04-20) [lafaix]
250 // show system menu on mb2 title-bar click
252 // Mouse-button-3 scrolling: V0.9.1 (99-12-03)
254 PM_BOOL fMB3Scroll
; // deprecated V0.9.19 (2002-04-20) [lafaix]
255 // scroll window contents on MB3Drag
256 PM_BOOL fMB3ScrollReverse
; // deprecated V0.9.19 (2002-04-20) [lafaix]
258 USHORT usScrollMode
; // deprecated V0.9.19 (2002-04-20) [lafaix]
259 // one of the following:
260 // -- SM_LINEWISE (0): scroll fixed, line-wise
261 // -- SM_AMPLIFIED (1): scroll amplified, relative to window size
262 USHORT usMB3ScrollMin
;
263 // minimum pixels that mouse must be moved;
264 // 0 means 1, 1 means 2, ...
265 SHORT sAmplification
;
266 // amplification (-9 thru +10)
267 // the amplification in percent is calculated like this:
268 // percent = 100 + (sAmplification * 10)
276 // Auto-hide mouse pointer: V0.9.1 (99-12-03)
277 PM_BOOL __fAutoHideMouse
;
278 ULONG __ulAutoHideDelay
;
279 // delay in seconds; 0 means 1 second, 2 means 3, ...
281 // Global object hotkeys enabled:
282 // this can be disabled even if any hotkeys are defined
283 // because the hotkeys themselves are stored separately
285 PM_BOOL __fGlobalHotkeys
;
287 // XPager configuration
288 PM_BOOL fRemoved1
, // _fXPagerStayOnTop,
289 fRemoved2
; //__fSlidingIgnoreXPager;
290 // removed V0.9.19 (2002-05-07) [umoeller]
293 PM_BOOL fSlidingMenus
;
295 ULONG ulSubmenuDelay
;
296 // delay in ms; 0 = off
297 PM_BOOL fMenuImmediateHilite
;
299 // Mouse-button-3 single-clicks to MB1 double-clicks
300 // V0.9.4 (2000-06-12) [umoeller]
301 PM_BOOL fMB3Click2MB1DblClk
; // deprecated V0.9.19 (2002-04-20) [lafaix]
303 // Screen corner objects:
304 // moved the array down here (there's a dummy above)
305 // V0.9.4 (2000-06-12) [umoeller]
306 HOBJECT ahobjHotCornerObjects
[8];
308 // 0 = lower left corner,
309 // 1 = top left corner,
310 // 2 = lower right corner,
311 // 3 = top right corner;
312 // borders added V0.9.4 (2000-06-12) [umoeller]:
316 // 7 = bottom border.
317 // V0.9.18 (2002-02-12) [pr]
318 #define SCREENCORNER_MIN 0
319 #define SCREENCORNER_BOTTOMLEFT 0
320 #define SCREENCORNER_TOPLEFT 1
321 #define SCREENCORNER_BOTTOMRIGHT 2
322 #define SCREENCORNER_TOPRIGHT 3
323 #define SCREENCORNER_TOP 4
324 #define SCREENCORNER_LEFT 5
325 #define SCREENCORNER_RIGHT 6
326 #define SCREENCORNER_BOTTOM 7
327 #define SCREENCORNER_MAX 7
328 // If any item is NULLHANDLE, it means the
329 // corner is inactive (no function defined).
330 // If the hiword of the item is 0xFFFF, this
331 // means a special function has been defined:
332 // (#define's added V0.9.19 (2002-04-17) [umoeller]):
333 #define SPECIALOBJ_FIRST 0xFFFF0000
334 #define SPECIALOBJ_SHOWWINDOWLIST 0xFFFF0000
335 #define SPECIALOBJ_DESKTOPCONTEXTMENU 0xFFFF0001
336 #define SPECIALOBJ_PAGER_SHOW 0xFFFF0002
337 // the following added (2001-01-26) [lafaix]
338 #define SPECIALOBJ_PAGER_UP 0xFFFF0003
339 #define SPECIALOBJ_PAGER_RIGHT 0xFFFF0004
340 #define SPECIALOBJ_PAGER_DOWN 0xFFFF0005
341 #define SPECIALOBJ_PAGER_LEFT 0xFFFF0006
342 // the following added V0.9.18 [pr]
343 #define SPECIALOBJ_SCREENWRAP 0xFFFF0007
344 // Otherwise (> 0 and < 0xFFFF0000), we have
345 // a "real" object handle, and a regular WPS
346 // object is to be opened.
348 // special treatment for conditional-cascade submenus when
349 // using sliding menus (V0.9.6 (2000-10-27) [umoeller])
350 PM_BOOL fConditionalCascadeSensitive
;
352 // more XPager configuration V0.9.7 (2000-12-08) [umoeller]
353 PM_BOOL fRemoved3
; // __fSlidingIgnoreXCenter;
354 // removed V0.9.19 (2002-05-07) [umoeller]
356 // screen corner objects sensitivity; in percent of the
357 // adjacents borders. 0 = off, 50 = borders objects disabled
358 // V0.9.9 (2001-03-15) [lafaix]
359 ULONG ulCornerSensitivity
;
361 // Mouse-button-3 autoscroll and push to bottom features
362 PM_BOOL fMB3AutoScroll
; // deprecated V0.9.19 (2002-04-20) [lafaix]
363 PM_BOOL fMB3Push2Bottom
; // deprecated V0.9.19 (2002-04-20) [lafaix]
365 // Auto hide and automatic pointer movement options
366 // V0.9.14 (2001-08-02) [lafaix]
367 ULONG __ulAutoHideFlags
;
368 PM_BOOL __fAutoMoveMouse
;
369 ULONG __ulAutoMoveFlags
;
370 ULONG __ulAutoMoveDelay
; // V0.9.14 (2001-08-21) [umoeller]
371 ULONG __ulMouseMappingsCount
; // V0.9.19 (2002-04-20) [lafaix]
372 } HOOKCONFIG
, *PHOOKCONFIG
;
377 * single XWorkplace object hotkey definition.
378 * Arrays of this are allocated in shared memory and
379 * used by xwphook.c, xwpdaemn.c, and also XFldObject
380 * for hotkey manipulation and detection.
383 typedef struct _GLOBALHOTKEY
386 // Keyboard control codes:
387 // SHORT1FROMMP(mp1) of WM_CHAR, filtered.
388 // Only the following flags will be set:
393 // -- KC_INVALIDCOMP: special flag used if the
394 // scan code represents one of the user-defined
395 // function keys in the XWPKeyboard object.
396 // KC_CTRL, KC_ALT, KC_SHIFT work always,
397 // no matter if we're in a PM or VIO session.
398 // However, for some reason, KC_VIRTUALKEY is
399 // never set in VIO sessions. We still store it
400 // in this structure though to be able to display
401 // the hotkey in the configuration pages.
402 // The hook will filter that out since the scan
403 // code is good enough to identify the key.
405 // Hardware scan code:
406 // CHAR4FROMMP(mp1) of WM_CHAR.
407 // As opposed to what we do with folder hotkeys,
408 // this must be stored also, because we must use
409 // the scan code for WM_CHAR processing in the hook
410 // to identify hotkeys. We cannot use usKeyCode
411 // because that's different in VIO sessions, while
412 // this one is always the same.
413 // Even if any of Ctrl, Alt, Shift are pressed, this
414 // has the scan code of the additional key which was
418 // if KC_VIRTUALKEY is set in usFlags, this has usvk,
419 // otherwise usch from WM_CHAR.
420 // This is only used to be able to display the hotkey
421 // in the hotkey configuration dialogs; we do _not_ use
422 // this to check WM_CHAR messages in the hook, because
423 // this is different between PM and VIO sessions.
425 // handle to post to thread-1 object window (kernel.c);
426 // this is normally the HOBJECT of the object to be
428 } GLOBALHOTKEY
, *PGLOBALHOTKEY
;
432 * single XWorkplace mouse mapping definition.
433 * Arrays of this are allocated in shared memory and
434 * used by xwphook.c, xwpdaemn.c, and also XWPMouse
435 * for mouse mappings manipulation and detection.
437 *@@added V0.9.19 (2002-04-20) [lafaix]
440 typedef struct _MOUSEMAPPING
443 // One of the MME_* values (or MME_XBUTTON_FIRST+n
444 // to denote extra button n, 0 <= n < 32).
445 // standard mouse events
446 #define MME_BUTTON1CLICK 0x0001
447 #define MME_BUTTON2CLICK 0x0002
448 #define MME_BUTTON3CLICK 0x0003
449 #define MME_BUTTON1DRAG 0x0004
450 #define MME_BUTTON2DRAG 0x0005
451 #define MME_BUTTON3DRAG 0x0006
452 #define MME_CHORD 0x0007
453 // wheel/stick events
454 #define MME_UP 0x1001
455 #define MME_DOWN 0x1002
456 #define MME_LEFT 0x1003
457 #define MME_RIGHT 0x1004
458 // the 2X and 3X variants are handy when mapping an action
459 // to a wheel/stick movement. They map at least 2 (or 3)
460 // consecutive events, and hence disambiguate an unexpected
461 // wheel/stick event.
462 #define MME_UP2X 0x2001
463 #define MME_DOWN2X 0x2002
464 #define MME_LEFT2X 0x2003
465 #define MME_RIGHT2X 0x2004
466 #define MME_UP3X 0x3001
467 #define MME_DOWN3X 0x3002
468 #define MME_LEFT3X 0x3003
469 #define MME_RIGHT3X 0x3004
471 #define MME_XBUTTON_FIRST 0x4000
473 #define MME_TYPE_MASK 0xF000
474 #define MME_TYPE_STANDARD 0x0000
475 #define MME_TYPE_WHEEL 0x1000
476 #define MME_TYPE_WHEEL2X 0x2000
477 #define MME_TYPE_WHEEL3X 0x3000
478 #define MME_TYPE_XBUTTON 0x4000
479 #define MME_TYPE_DISABLED 0x8000
482 // A possibly empty combination of KC_SHIFT, KC_CTRL,
484 CHAR achLocation
[32];
485 // The class name upon which this mapping applies.
486 // An empty location (i.e., achLocation[0] = 0) means
488 CHAR achPluginName
[8];
489 // The plugin library providing the action defined for
490 // this mapping. An empty location (i.e.,
491 // achPluginName[0] = 0) means a buildin action.
493 // The action (relative to the plugin) defined for
496 // A private area possibly refining the action.
497 } MOUSEMAPPING
, *PMOUSEMAPPING
;
501 * XWorkplace function key description.
502 * An array of these is returned by
503 * hifQueryFunctionKeys().
505 *@@added V0.9.3 (2000-04-19) [umoeller]
508 typedef struct _FUNCTIONKEY
510 UCHAR ucScanCode
; // hardware scan code;
511 // CHAR4FROMMP(mp1) of WM_CHAR
512 CHAR szDescription
[30]; // key description (e.g. "Win left")
513 PM_BOOL fModifier
; // TRUE if the scan code represents
514 // a modifier key which can be pressed
515 // together with another key, similar
516 // to Ctrl or Alt or Del; this will
517 // allow us to do things like "WinLeft + C"
518 } FUNCTIONKEY
, *PFUNCTIONKEY
;
520 /* ******************************************************************
524 ********************************************************************/
526 #define XDM_HOOKINSTALL (WM_USER + 400)
528 #define XDM_DESKTOPREADY (WM_USER + 401)
530 #define XDM_HOOKCONFIG (WM_USER + 402)
533 #define XDM_STARTSTOPPAGER (WM_USER + 403)
535 #define XDM_PAGERCONFIG (WM_USER + 404)
536 // flags for XDM_PAGERCONFIG:
537 #define PGRCFG_REPAINT 0x0001 // invalidates mini windows
538 #define PGRCFG_REFORMAT 0x0004 // causes PGRM_POSITIONFRAME,
539 // repaints background too
540 #define PGRCFG_STICKIES 0x0008 // sticky windows have changed
543 #define XDM_HOTKEYPRESSED (WM_USER + 405)
545 #define XDM_HOTKEYSCHANGED (WM_USER + 406)
547 #define XDM_FUNCTIONKEYSCHANGED (WM_USER + 407)
549 #ifndef __NOSLIDINGFOCUS__
550 #define XDM_SLIDINGFOCUS (WM_USER + 408)
553 #define XDM_SLIDINGMENU (WM_USER + 409)
555 #define XDM_HOTCORNER (WM_USER + 410)
557 #define XDM_WMCHORDWINLIST (WM_USER + 411)
559 // added V0.9.9 (2001-03-18) [lafaix]
560 #define XDM_BEGINSCROLL (WM_USER + 413)
561 #define XDM_SETPOINTER (WM_USER + 414)
562 #define XDM_ENDSCROLL (WM_USER + 415)
564 // added V0.9.12 (2001-05-12) [umoeller]
565 #define XDM_RECOVERWINDOWS (WM_USER + 416)
567 #define XDM_ADDDISKWATCH (WM_USER + 417)
571 * struct used with XDM_ADDDISKWATCH.
573 *@@added V0.9.14 (2001-08-01) [umoeller]
576 typedef struct _ADDDISKWATCH
578 ULONG ulLogicalDrive
; // disk to be monitored
579 HWND hwndNotify
; // window to be notified on change
580 ULONG ulMessage
; // message to be posted to window
581 } ADDDISKWATCH
, *PADDDISKWATCH
;
583 #define XDM_REMOVEDISKWATCH (WM_USER + 418)
585 #define XDM_QUERYDISKS (WM_USER + 419)
587 #define XDM_ADDCLICKWATCH (WM_USER + 420)
589 #define XDM_MOUSECLICKED (WM_USER + 421)
591 #ifndef __NOMOVEMENT2FEATURES__
592 #define XDM_MOVEPTRTOBUTTON (WM_USER + 422)
595 #define XDM_DISABLEHOTKEYSTEMP (WM_USER + 423)
597 #define XDM_STARTAPP (WM_USER + 424)
599 #define XDM_ADDWINLISTWATCH (WM_USER + 425)
601 #define XDM_WINDOWCHANGE (WM_USER + 426)
603 #define XDM_ICONCHANGE (WM_USER + 427)
605 #define XDM_QUERYWINLIST (WM_USER + 428)
607 #define XDM_REMOVEWINLISTWATCH (WM_USER + 429) // V0.9.19 (2002-06-14) [lafaix]
609 #define XDM_REMOVECLICKWATCH (WM_USER + 430) // V0.9.19 (2002-06-14) [lafaix]
612 #define XDM_TOGGLETRANSIENTSTICKY (WM_USER + 431) // V1.0.0 (2002-07-26) [lafaix]
613 #define XDM_ISTRANSIENTSTICKY (WM_USER + 432)
616 #define XDM_NLSCHANGED (WM_USER + 433) // V1.0.0 (2002-09-15) [lafaix]