home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xwplascr.zip / XWPL0208.ZIP / include / hook / xwpdaemn.h < prev    next >
Text File  |  2002-08-10  |  9KB  |  285 lines

  1.  
  2. /*
  3.  * xwpdaemn.h:
  4.  *      XPager and daemon declarations.
  5.  *      These are not visible to the hook nor
  6.  *      to XFLDR.DLL.
  7.  *
  8.  *      Requires xwphook.h to be included first.
  9.  *
  10.  *@@include #define INCL_DOSSEMAPHORES
  11.  *@@include #include <os2.h>
  12.  *@@include #include "hook\xwphook.h"
  13.  *@@include #include "hook\xwpdaemn.h"
  14.  */
  15.  
  16. /*
  17.  *      Copyright (C) 1995-1999 Carlos Ugarte.
  18.  *      Copyright (C) 2000 Ulrich Möller.
  19.  *
  20.  *      This program is free software; you can redistribute it and/or modify
  21.  *      it under the terms of the GNU General Public License as published by
  22.  *      the Free Software Foundation, in version 2 as it comes in the COPYING
  23.  *      file of the XWorkplace main distribution.
  24.  *      This program is distributed in the hope that it will be useful,
  25.  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  26.  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  27.  *      GNU General Public License for more details.
  28.  */
  29.  
  30. #ifndef PAGER_HEADER_INCLUDED
  31.     #define PAGER_HEADER_INCLUDED
  32.  
  33. #ifndef __NOPAGER__
  34.  
  35.     /* ******************************************************************
  36.      *
  37.      *   Pager interface
  38.      *
  39.      ********************************************************************/
  40.  
  41.     VOID dmnKillXPager(BOOL fNotifyKernel);
  42.  
  43.     BOOL dmnLoadPagerSettings(ULONG flConfig);
  44.  
  45.     /* ******************************************************************
  46.      *
  47.      *   Pager definitions
  48.      *
  49.      ********************************************************************/
  50.  
  51.     #define TIMEOUT_HMTX_WINLIST    20*1000
  52.                 // raised V0.9.12 (2001-05-31) [umoeller]
  53.  
  54.     // move hotkey flags
  55.     #define MOVE_LEFT           1
  56.     #define MOVE_RIGHT          2
  57.     #define MOVE_UP             4
  58.     #define MOVE_DOWN           8
  59.  
  60.     // font ID to use for the XPager window titles;
  61.     // we always use the same one, because there's only one
  62.     // in the daemon process
  63.     #define LCID_PAGER_FONT  ((ULONG)1)
  64.  
  65.     #ifdef DEBUG_WINDOWLIST
  66.         typedef struct WINLISTRECORD
  67.         {
  68.             RECORDCORE      recc;
  69.  
  70.             PSZ             pszHWND;
  71.             CHAR            szHWND[20];
  72.  
  73.             PSZ             pszHWNDParent;
  74.             CHAR            szHWNDParent[20];
  75.  
  76.             PSZ             pszFlags;
  77.             CHAR            szFlags[100];
  78.  
  79.             PSZ             pszPos;
  80.             CHAR            szPos[30];
  81.  
  82.             PSZ             pszSwtitle;
  83.  
  84.             PSZ             pszWindowType;
  85.  
  86.             PSZ             pszClass;
  87.             CHAR            szClass[50];
  88.  
  89.             PSZ             pszPID;
  90.             CHAR            szPID[20];
  91.  
  92.             PSZ             pszStyle;
  93.             CHAR            szStyle[300];
  94.  
  95.             PVOID           pWinInfo;       // reverse linkage
  96.  
  97.         } WINLISTRECORD, *PWINLISTRECORD;
  98.     #endif
  99.  
  100.     /*
  101.      *@@ XWINDATA:
  102.      *      variable data collected by pgrGetWinData.
  103.      *      This struct is also part of XWININFO.
  104.      *
  105.      *@@added V0.9.19 (2002-06-18) [umoeller]
  106.      */
  107.  
  108.     typedef struct _XWINDATA
  109.     {
  110.         HSWITCH     hsw;                // switch entry or NULLHANDLE
  111.  
  112.         SWCNTRL     swctl;              // switch list entry
  113.                         // HWND hwnd
  114.                         // HWND hwndIcon
  115.                         // HPROGRAM hprog
  116.                         // PID idProcess
  117.                         // ULONG idSession
  118.                         // ULONG uchVisibility
  119.                         // ULONG fbJump
  120.                         // CHAR szSwTitle[MAXNAMEL+4]
  121.                         // ULONG bProgType
  122.  
  123.  
  124.         CHAR        szClassName[30];
  125.         ULONG       tid;
  126.  
  127.         SWP         swp;                // last known window pos
  128.  
  129.         BYTE        bWindowType;
  130.             #define WINDOW_NIL          1   // "not in list" == not in switch list;
  131.                                             // may still be minimized, maximized,
  132.                                             // or hidden, we don't care then
  133.  
  134.             // the following styles are treated as special
  135.             // and are left alone by the pager (always sticky)
  136.             #define WINDOW_XWPDAEMON    2   // probably XPager or scroll window,
  137.                                             // ignore (sticky)
  138.             #define WINDOW_WPSDESKTOP   3   // WPS desktop, always sticky
  139.  
  140.             #define WINDOW_STICKY       4   // window is on sticky list
  141.             #define WINDOW_MINIMIZE     5   // window is minimized, treat as sticky
  142.             #define WINDOW_HIDDEN       6
  143.  
  144.             // the following types are treated as "normal"
  145.             // windows and moved around by the pager
  146.             #define WINDOW_MAXIMIZE     7   // window is maximized
  147.             #define WINDOW_NORMAL       8
  148.  
  149.     } XWINDATA, *PXWINDATA;
  150.  
  151.     /*
  152.      *@@ XWININFO:
  153.      *      one of these exists for every window
  154.      *      that is currently on the daemon window
  155.      *      list. See pg_winlist.c.
  156.      *
  157.      *@@added V0.9.7 (2001-01-21) [umoeller]
  158.      *@@changed V0.9.19 (2002-06-18) [umoeller]: largely reworked for new winlist
  159.      */
  160.  
  161.     typedef struct _XWININFO
  162.     {
  163.         XWINDATA    data;
  164.  
  165.         HPOINTER    hptrFrame;          // frame icon (WM_QUERYICON)
  166.         ULONG       flFlags;            // persistent flags for this entry
  167.             #define WLF_ICONCRASHED     0x0001
  168.                         // sometimes we get inexplicable crashes in the
  169.                         // daemon in bitblt... if the exception handler
  170.                         // there catches one of those, it sets this
  171.                         // bit to make sure we won't try again
  172.         #ifdef DEBUG_WINDOWLIST
  173.             PWINLISTRECORD prec;
  174.         #endif
  175.  
  176.     } XWININFO, *PXWININFO;
  177.  
  178.     /* ******************************************************************
  179.      *
  180.      *   Pager window list
  181.      *
  182.      ********************************************************************/
  183.  
  184.     APIRET pgrInit(VOID);
  185.  
  186.     BOOL pgrLockWinlist(VOID);
  187.  
  188.     VOID pgrUnlockWinlist(VOID);
  189.  
  190.     PXWININFO pgrFindWinInfo(HWND hwndThis,
  191.                              PVOID *ppListNode);
  192.  
  193.     BOOL pgrGetWinData(PXWINDATA pWinData);
  194.  
  195.     BOOL pgrCreateWinInfo(HWND hwnd);
  196.  
  197.     VOID pgrBuildWinlist(VOID);
  198.  
  199.     VOID pgrFreeWinInfo(HWND hwnd);
  200.  
  201.     BOOL pgrRefresh(HWND hwnd);
  202.  
  203.     BOOL pgrIsSticky(HWND hwnd,
  204.                      PCSZ pcszSwtitle);
  205.  
  206.     BOOL pgrIconChange(HWND hwnd,
  207.                        HPOINTER hptr);
  208.  
  209.     #ifdef INCL_WINSWITCHLIST
  210.     PSWBLOCK pgrQueryWinList(ULONG pid);
  211.     #endif
  212.  
  213.     #ifdef THREADS_HEADER_INCLUDED
  214.         VOID _Optlink fntWinlistThread(PTHREADINFO pti);
  215.     #endif
  216.  
  217.     /* ******************************************************************
  218.      *
  219.      *   Pager control window
  220.      *
  221.      ********************************************************************/
  222.  
  223.     BOOL pgrLockHook(PCSZ pcszFile, ULONG ulLine, PCSZ pcszFunction);
  224.  
  225.     VOID pgrUnlockHook(VOID);
  226.  
  227.     LONG pgrCalcClientCY(LONG cx);
  228.  
  229.     BOOL pgrIsShowing(PSWP pswp);
  230.  
  231.     VOID pgrRecoverWindows(HAB hab,
  232.                            BOOL fWPSOnly);
  233.  
  234.     BOOL pgrCreatePager(VOID);
  235.  
  236.     /* ******************************************************************
  237.      *
  238.      *   Pager window movement
  239.      *
  240.      ********************************************************************/
  241.  
  242.     #ifdef THREADS_HEADER_INCLUDED
  243.         VOID _Optlink fntMoveThread(PTHREADINFO pti);
  244.     #endif
  245.  
  246. #endif
  247.  
  248.     /* ******************************************************************
  249.      *
  250.      *   Drive monitors
  251.      *
  252.      ********************************************************************/
  253.  
  254.     BOOL dmnAddDiskfreeMonitor(ULONG ulLogicalDrive,
  255.                                HWND hwndNotify,
  256.                                ULONG ulMessage);
  257.  
  258.     #ifdef THREADS_HEADER_INCLUDED
  259.         void _Optlink fntDiskWatch(PTHREADINFO ptiMyself);
  260.     #endif
  261.  
  262.     BOOL dmnQueryDisks(ULONG ulLogicalDrive,
  263.                        MPARAM mpDiskInfos);
  264.  
  265.     /* ******************************************************************
  266.      *
  267.      *   Global variables in xwpdaemn.c
  268.      *
  269.      ********************************************************************/
  270.  
  271.     #ifdef HOOK_PRIVATE_HEADER_INCLUDED
  272.         extern PHOOKDATA    G_pHookData;
  273.     #endif
  274.  
  275.     extern PXWPGLOBALSHARED G_pXwpGlobalShared;
  276.  
  277.     extern HPOINTER     G_hptrDaemon;
  278.  
  279.     #ifdef LINKLIST_HEADER_INCLUDED
  280.         extern LINKLIST     G_llWinInfos;
  281.     #endif
  282.  
  283. #endif
  284.  
  285.