Ignore:
Timestamp:
Jul 18, 1999, 3:57:48 PM (26 years ago)
Author:
cbratschi
Message:

API Open32 -> PM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/win32wnd.h

    r325 r327  
    1 /* $Id: win32wnd.h,v 1.8 1999-07-18 10:39:52 sandervl Exp $ */
     1/* $Id: win32wnd.h,v 1.9 1999-07-18 13:57:48 cbratschi Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    2121class Win32Window;
    2222
    23 #define OFFSET_WIN32WNDPTR      0
    24 #define OFFSET_WIN32PM_MAGIC    4
    25 
    26 #define WIN32PM_MAGIC           0x12345678
    27 #define CheckMagicDword(a)      (a==WIN32PM_MAGIC)
     23#define OFFSET_WIN32WNDPTR      0
     24#define OFFSET_WIN32PM_MAGIC    4
     25
     26#define WIN32PM_MAGIC           0x12345678
     27#define CheckMagicDword(a)      (a==WIN32PM_MAGIC)
    2828
    2929typedef struct {
    30         USHORT          cb;
    31         Win32Window    *win32wnd;
    32         ULONG           win32CreateStruct;      //or dialog create dword
     30        USHORT          cb;
     31        Win32Window    *win32wnd;
     32        ULONG           win32CreateStruct;      //or dialog create dword
    3333} CUSTOMWNDDATA;
    3434
    3535typedef struct
    3636{
    37         ULONG           Msg;
    38         ULONG           wParam;
    39         ULONG           lParam;
     37        ULONG           Msg;
     38        ULONG           wParam;
     39        ULONG           lParam;
    4040} POSTMSG_PACKET;
    4141
    42 #define WM_WIN32_POSTMESSAGEA   0x4000
    43 #define WM_WIN32_POSTMESSAGEW   0x4001
     42#define WM_WIN32_POSTMESSAGEA   0x4000
     43#define WM_WIN32_POSTMESSAGEW   0x4001
    4444
    4545class Win32Window : private GenericObject, private ChildWindow
    4646{
    4747public:
    48         DWORD   magic;
    49 
    50                 Win32Window(DWORD objType);
    51                 Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode);
     48        DWORD   magic;
     49
     50                Win32Window(DWORD objType);
     51                Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode);
    5252virtual        ~Win32Window();
    5353
    5454virtual  ULONG  MsgCreate(HWND hwndOS2, ULONG initParam);
    55         ULONG  MsgQuit();
    56         ULONG  MsgClose();
     55        ULONG  MsgQuit();
     56        ULONG  MsgClose();
    5757         ULONG  MsgDestroy();
    58         ULONG  MsgEnable(BOOL fEnable);
    59         ULONG  MsgShow(BOOL fShow);
    60         ULONG  MsgMove(ULONG xParent, ULONG yParent);
    61         ULONG  MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize);
     58        ULONG  MsgEnable(BOOL fEnable);
     59        ULONG  MsgShow(BOOL fShow);
     60        ULONG  MsgMove(ULONG xParent, ULONG yParent);
     61        ULONG  MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize);
    6262         ULONG  MsgActivate(BOOL fActivate, HWND hwnd);
    63          ULONG  MsgSetFocus(HWND hwnd);
    64          ULONG  MsgKillFocus(HWND hwnd);
    65          ULONG  MsgButton(ULONG msg, ULONG x, ULONG y);
    66          ULONG  MsgPaint(ULONG tmp1, ULONG tmp2);
    67          ULONG  MsgEraseBackGround(ULONG hps);
    68          ULONG  MsgSetText(LPSTR lpsz, LONG cch);
    69 
    70 virtual  LONG   SetWindowLongA(int index, ULONG value);
    71 virtual  ULONG  GetWindowLongA(int index);
    72 virtual  WORD   SetWindowWord(int index, WORD value);
    73 virtual  WORD   GetWindowWord(int index);
    74 
    75          DWORD  getStyle()                      { return dwStyle; };
    76          DWORD  getExStyle()                    { return dwExStyle; };
    77          HWND   getWindowHandle()               { return Win32Hwnd; };
    78          HWND   getOS2WindowHandle()            { return OS2Hwnd; };
    79    Win32Window *getParent()                     { return (Win32Window *)ChildWindow::GetParent(); };
    80          void   setParent(Win32Window *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); };
     63         ULONG  MsgSetFocus(HWND hwnd);
     64         ULONG  MsgKillFocus(HWND hwnd);
     65         ULONG  MsgButton(ULONG msg, ULONG x, ULONG y);
     66         ULONG  MsgPaint(ULONG tmp1, ULONG tmp2);
     67         ULONG  MsgEraseBackGround(ULONG hps);
     68         ULONG  MsgSetText(LPSTR lpsz, LONG cch);
     69
     70virtual  LONG   SetWindowLongA(int index, ULONG value);
     71virtual  ULONG  GetWindowLongA(int index);
     72virtual  WORD   SetWindowWord(int index, WORD value);
     73virtual  WORD   GetWindowWord(int index);
     74
     75         DWORD  getStyle()                      { return dwStyle; };
     76         DWORD  getExStyle()                    { return dwExStyle; };
     77         HWND   getWindowHandle()               { return Win32Hwnd; };
     78         HWND   getOS2WindowHandle()            { return OS2Hwnd; };
     79   Win32Window *getParent()                     { return (Win32Window *)ChildWindow::GetParent(); };
     80         void   setParent(Win32Window *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); };
     81
    8182       WNDPROC  getWindowProc()                 { return win32wndproc; };
    8283         void   setWindowProc(WNDPROC newproc)  { win32wndproc = newproc; };
     
    8485         void   setWindowId(DWORD id)           { windowId = id; };
    8586
    86          DWORD  getFlags()                      { return flags; };
    87          void   setFlags(DWORD newflags)        { flags = newflags; };
    88 
    89         BOOL   SetMenu(ULONG hMenu);
    90         BOOL   ShowWindow(ULONG nCmdShow);
    91         BOOL   SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags);
    92         BOOL   DestroyWindow();
    93         HWND   SetActiveWindow();
    94         HWND   GetParent();
    95         HWND   SetParent(HWND hwndNewParent);
    96         BOOL   IsChild(HWND hwndParent);
    97         HWND   GetTopWindow();
    98         BOOL   UpdateWindow();
    99         BOOL   IsIconic();
     87         DWORD  getFlags()                      { return flags; };
     88         void   setFlags(DWORD newflags)        { flags = newflags; };
     89
     90        BOOL   SetMenu(ULONG hMenu);
     91        BOOL   ShowWindow(ULONG nCmdShow);
     92        BOOL   SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags);
     93        BOOL   DestroyWindow();
     94        HWND   SetActiveWindow();
     95        HWND   GetParent();
     96        HWND   SetParent(HWND hwndNewParent);
     97        BOOL   IsChild(HWND hwndParent);
     98        HWND   GetTopWindow();
     99        BOOL   UpdateWindow();
     100        BOOL   IsIconic();
    100101         HWND   GetWindow(UINT uCmd);
    101         BOOL   EnableWindow(BOOL fEnable);
    102          BOOL   BringWindowToTop();
     102        BOOL   EnableWindow(BOOL fEnable);
     103         BOOL   BringWindowToTop();
    103104  static HWND   GetActiveWindow();
    104          BOOL   IsWindow();
    105          BOOL   IsWindowEnabled();
    106          BOOL   IsWindowVisible();
    107 
    108          BOOL   GetWindowRect(PRECT pRect);
    109          int    GetWindowTextLengthA();
    110          int    GetWindowTextA(LPSTR lpsz, int cch);
    111          BOOL   SetWindowTextA(LPCSTR lpsz);
     105
     106         BOOL   IsWindow();
     107         BOOL   IsWindowEnabled();
     108         BOOL   IsWindowVisible();
     109
     110         BOOL   GetWindowRect(PRECT pRect);
     111         int    GetWindowTextLengthA();
     112         int    GetWindowTextA(LPSTR lpsz, int cch);
     113         BOOL   SetWindowTextA(LPCSTR lpsz);
    112114
    113115       LRESULT  SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
     
    123125
    124126static Win32Window *GetWindowFromHandle(HWND hwnd);
     127static Win32Window *GetWindowFromOS2Handle(HWND hwnd);
    125128
    126129protected:
    127130       LRESULT  SendInternalMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
    128131       LRESULT  SendInternalMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
    129         void    Init();
    130 
    131         HWND    OS2Hwnd;
    132         HWND    OS2HwndFrame;
    133         HWND    OS2HwndMenu;
    134         HWND    Win32Hwnd;
    135         BOOL    isUnicode;
    136 
    137         int     posx, posy, width, height;
    138 
    139         // values normally contained in the standard window words
    140         ULONG   dwExStyle;              //GWL_EXSTYLE
    141         ULONG   dwStyle;                //GWL_STYLE
    142       WNDPROC   win32wndproc;           //GWL_WNDPROC
    143         ULONG   hInstance;              //GWL_HINSTANCE
     132        void    Init();
     133
     134        HWND    OS2Hwnd;
     135        HWND    OS2HwndFrame;
     136        HWND    OS2HwndMenu;
     137        HWND    Win32Hwnd;
     138        BOOL    isUnicode;
     139
     140        int     posx, posy, width, height;
     141
     142        // values normally contained in the standard window words
     143        ULONG   dwExStyle;              //GWL_EXSTYLE
     144        ULONG   dwStyle;                //GWL_STYLE
     145      WNDPROC   win32wndproc;           //GWL_WNDPROC
     146        ULONG   hInstance;              //GWL_HINSTANCE
    144147//Moved in ChildWindow class
    145 /////   Win32Window *parent;                    //GWL_HWNDPARENT
    146         ULONG   windowId;               //GWL_ID
    147         ULONG   userData;               //GWL_USERDATA
     148/////   Win32Window *parent;                    //GWL_HWNDPARENT
     149        ULONG   windowId;               //GWL_ID
     150        ULONG   userData;               //GWL_USERDATA
    148151
    149152         HWND   hwndLinkAfter;
    150153        DWORD   flags;
    151154
    152         BOOL    isIcon;
    153 
    154    Win32Window *owner;                 
    155 
    156         char   *windowName;
    157         ULONG   wndNameLength;
    158 
    159         char   *windowText;
    160         ULONG   wndTextLength;
    161        
    162         ULONG  *userWindowLong;
    163         ULONG   nrUserWindowLong;
    164 
    165         RECT    rectWindow;
    166         RECT    rectClient;
     155        BOOL    isIcon;
     156
     157   Win32Window *owner;
     158
     159        char   *windowName;
     160        ULONG   wndNameLength;
     161
     162        char   *windowText;
     163        ULONG   wndTextLength;
     164
     165        ULONG  *userWindowLong;
     166        ULONG   nrUserWindowLong;
     167
     168        RECT    rectWindow;
     169        RECT    rectClient;
    167170
    168171Win32WndClass  *windowClass;
     
    172175private:
    173176#ifndef OS2_INCLUDED
    174         BOOL  CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom);
    175 
    176         void  GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack );
    177 
    178         LONG  SendNCCalcSize(BOOL calcValidRect,
     177        BOOL  CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom);
     178
     179        void  GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack );
     180
     181        LONG  SendNCCalcSize(BOOL calcValidRect,
    179182                             RECT *newWindowRect, RECT *oldWindowRect,
    180183                             RECT *oldClientRect, WINDOWPOS *winpos,
     
    183186     LRESULT  SendInternalMessage(ULONG msg, WPARAM wParam, LPARAM lParam)
    184187     {
    185         if(isUnicode)
    186                 return SendInternalMessageW(msg, wParam, lParam);
    187         else    return SendInternalMessageA(msg, wParam, lParam);
     188        if(isUnicode)
     189                return SendInternalMessageW(msg, wParam, lParam);
     190        else    return SendInternalMessageA(msg, wParam, lParam);
    188191     }
    189192#endif
     
    191194
    192195
    193 #define BUTTON_LEFTDOWN         0
    194 #define BUTTON_LEFTUP           1
    195 #define BUTTON_LEFTDBLCLICK     2
    196 #define BUTTON_RIGHTUP          3
    197 #define BUTTON_RIGHTDOWN        4
    198 #define BUTTON_RIGHTDBLCLICK    5
     196#define BUTTON_LEFTDOWN         0
     197#define BUTTON_LEFTUP           1
     198#define BUTTON_LEFTDBLCLICK     2
     199#define BUTTON_RIGHTUP          3
     200#define BUTTON_RIGHTDOWN        4
     201#define BUTTON_RIGHTDBLCLICK    5
    199202
    200203#endif //__cplusplus
Note: See TracChangeset for help on using the changeset viewer.