Ignore:
Timestamp:
Jul 14, 1999, 10:35:38 AM (26 years ago)
Author:
sandervl
Message:

Very preliminary code for Open32 replacement

File:
1 edited

Legend:

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

    r4 r300  
    1 /* $Id: win32wnd.h,v 1.1 1999-05-24 20:20:05 ktk Exp $ */
    2 
     1/* $Id: win32wnd.h,v 1.2 1999-07-14 08:35:37 sandervl Exp $ */
     2/*
     3 * Win32 Window Code for OS/2
     4 *
     5 *
     6 * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl)
     7 *
     8 *
     9 * Project Odin Software License can be found in LICENSE.TXT
     10 *
     11 */
    312#ifndef __WIN32WND_H__
    413#define __WIN32WND_H__
     
    615#ifdef __cplusplus
    716
    8 #include "win32class.h"
     17#include <win32class.h>
     18#include <gen_object.h>
    919
    10 #define WIN2OS2HWND(a)  (a^a)
     20class Win32Window;
     21
     22#define WIN2OS2HWND(a)  (Win32Window*)(a^a)
    1123#define OS22WINHWND(a)  (a^a)
    1224
    13 //Win32 window message handler
    14 typedef LRESULT  (* WIN32API WINWNDPROC) ( HWND, UINT, WPARAM, LPARAM );
     25#define OFFSET_WIN32WNDPTR      0
     26#define OFFSET_WIN32PM_MAGIC    4
    1527
    16 class Win32Window
     28#define WIN32PM_MAGIC   0x12345678
     29
     30typedef struct {
     31        USHORT          cb;
     32        Win32Window    *win32wnd;
     33        ULONG           win32CreateStruct;      //or dialog create dword
     34} CUSTOMWNDDATA;
     35
     36class Win32Window : public GenericObject
    1737{
    1838public:
    19                 Win32Window(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
     39        DWORD   magic;
     40
     41                Win32Window(DWORD objType);
     42                Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode);
    2043virtual        ~Win32Window();
    2144
    22      MRESULT    ProcessMessage(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
     45virtual  ULONG  MsgCreate(HWND hwndOS2, ULONG initParam);
     46         ULONG  MsgQuit();
     47         ULONG  MsgClose();
     48         ULONG  MsgDestroy();
     49         ULONG  MsgEnable(BOOL fEnable);
     50         ULONG  MsgShow(BOOL fShow);
     51         ULONG  MsgMove(ULONG xScreen, ULONG yScreen, ULONG xParent, ULONG yParent);
     52         ULONG  MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize);
     53         ULONG  MsgActivate(BOOL fActivate, HWND hwnd);
     54         ULONG  MsgSetFocus(HWND hwnd);
     55         ULONG  MsgKillFocus(HWND hwnd);
     56         ULONG  MsgButton(ULONG msg, ULONG x, ULONG y);
     57         ULONG  MsgPaint(ULONG tmp1, ULONG tmp2);
     58         ULONG  MsgEraseBackGround(ULONG hps);
    2359
    24 virtual  BOOL   SetWindowLong(int index, ULONG value);
    25 virtual  ULONG  GetWindowLong(int index);
     60virtual  LONG   SetWindowLongA(int index, ULONG value);
     61virtual  ULONG  GetWindowLongA(int index);
     62virtual  WORD   SetWindowWord(int index, WORD value);
     63virtual  WORD   GetWindowWord(int index);
    2664
    27          BOOL   PostMessageA(HWND hwnd, ULONG msg, WPARAM wParam, LPARAM lParam);
    28          BOOL   PostMessageW(HWND hwnd, ULONG msg, WPARAM wParam, LPARAM lParam);
     65         DWORD  getStyle()                      { return dwStyle; };
     66         DWORD  getExStyle()                    { return dwExStyle; };
     67         HWND   getWindowHandle()               { return Win32Hwnd; };
     68         HWND   getOS2WindowHandle()            { return OS2Hwnd; };
     69   Win32Window *getParent()                     { return parent; };
     70         void   setParent(Win32Window *pwindow) { parent = pwindow; };
     71       WNDPROC  getWindowProc()                 { return win32wndproc; };
     72         void   setWindowProc(WNDPROC newproc)  { win32wndproc = newproc; };
     73        DWORD   getWindowId()                   { return windowId; };
     74         void   setWindowId(DWORD id)           { windowId = id; };
     75
     76       LRESULT  SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
     77       LRESULT  SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
     78       LRESULT  DefWindowProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
     79       LRESULT  DefWindowProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
     80
     81         void   NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam);
    2982
    3083Win32WndClass  *getClass()  { return windowClass; };
    3184
    3285protected:
     86        void    Init();
     87
     88
    3389        HWND    OS2Hwnd;
    3490        HWND    Win32Hwnd;
     
    3894
    3995        // values normally contained in the standard window words
    40         ULONG   ExtendedWindowStyle;    //GWL_EXSTYLE
    41         ULONG   WindowStyle;            //GWL_STYLE
    42    //ptr to WINWNDPROC in windowClass
    43    WINWNDPROC  *win32wndproc;           //GWL_WNDPROC
     96        ULONG   dwExStyle;              //GWL_EXSTYLE
     97        ULONG   dwStyle;                //GWL_STYLE
     98      WNDPROC   win32wndproc;           //GWL_WNDPROC
    4499        ULONG   hInstance;              //GWL_HINSTANCE
    45         HWND    hwndParent;             //GWL_HWNDPARENT
     100   Win32Window *parent;                 //GWL_HWNDPARENT
    46101        ULONG   windowId;               //GWL_ID
    47102        ULONG   userData;               //GWL_USERDATA
     103
     104         HWND   hwndLinkAfter;
     105        DWORD   flags;
     106
     107   Win32Window *owner;                 
     108
     109        char   *windowName;
     110        ULONG   wndNameLength;
    48111
    49112        char   *windowText;
    50113        ULONG   wndTextLength;
    51114       
    52         ULONG  *UserWindowLong;
     115        ULONG  *userWindowLong;
    53116        ULONG   nrUserWindowLong;
    54117
    55118Win32WndClass  *windowClass;
    56119
    57   Win32Window  *parent;
    58   Win32Window  *child;
    59   Win32Window  *nextchild;
     120static GenericObject *windows;
    60121
    61122private:
     123        BOOL  CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom);
     124
     125        void  GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack );
     126};
    62127
    63128
    64 };
    65 
     129#define BUTTON_LEFTDOWN         0
     130#define BUTTON_LEFTUP           1
     131#define BUTTON_LEFTDBLCLICK     2
     132#define BUTTON_RIGHTUP          3
     133#define BUTTON_RIGHTDOWN        4
     134#define BUTTON_RIGHTDBLCLICK    5
    66135
    67136#endif //__cplusplus
Note: See TracChangeset for help on using the changeset viewer.