First pass at adding MicroWindows support

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2001-06-29 10:58:59 +00:00
parent 7ed4fab7be
commit 04ef50df3a
33 changed files with 985 additions and 65 deletions

View File

@@ -21,7 +21,7 @@
// typedefs
// ----------------------------------------------------------------------------
#if defined(__WXMSW__) || defined (__WXPM__)
#if (defined(__WXMSW__) && !defined(__WXMICROWIN__)) || defined (__WXPM__)
class WXDLLEXPORT wxApp;
typedef wxApp* (*wxAppInitializerFunction)();
#else

View File

@@ -409,7 +409,7 @@ typedef int wxWindowID;
// wxCALLBACK should be used for the functions which are called back by
// Windows (such as compare function for wxListCtrl)
#if defined(__WIN32__)
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
#define wxCALLBACK wxSTDCALL
#else
// no stdcall under Unix nor Win16
@@ -2010,7 +2010,7 @@ typedef struct tagLOGPALETTE
} LOGPALETTE;
#endif //__WXPM__
#if defined(__GNUWIN32__) || defined(__WXWINE__)
#if defined(__GNUWIN32__) || defined(__WXWINE__) || defined(__WXMICROWIN__)
typedef int (*WXFARPROC)();
#elif defined(__WIN32__)
typedef int (__stdcall *WXFARPROC)();

View File

@@ -40,11 +40,11 @@ public:
(void)Create(size, family, style, weight, underlined, face, encoding);
}
wxFont(const wxNativeFontInfo& info)
wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0)
{
Init();
Create(info);
Create(info, hFont);
}
wxFont(const wxString& fontDesc);
@@ -57,7 +57,7 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
bool Create(const wxNativeFontInfo& info);
bool Create(const wxNativeFontInfo& info, WXHFONT hFont = 0);
virtual ~wxFont();

235
include/wx/msw/microwin.h Normal file
View File

@@ -0,0 +1,235 @@
/*
/////////////////////////////////////////////////////////////////////////////
// Name: microwin.h
// Purpose: Extra implementation for MicroWindows
// Author: Julian Smart
// Created: 2001-05-31
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
*/
#ifndef _WX_MICROWIN_H_
#define _WX_MICROWIN_H_
#ifdef __GNUG__
#pragma interface "microwin.h"
#endif
/* Implemented by microwin.cpp */
#ifdef __cplusplus
extern "C" {
#endif
BOOL SetCursorPos(int x, int y);
HCURSOR SetCursor(HCURSOR hCursor);
/* Implemented with wrong number of args by MicroWindows */
/* so we need to use a different name */
int GetScrollPosWX (HWND hWnd, int iSBar);
BOOL ScrollWindow(HWND, int xAmount, int yAmount,
CONST RECT* lpRect, CONST RECT* lpClipRect);
HWND WindowFromPoint(POINT pt);
SHORT GetKeyState(int nVirtKey);
HWND SetParent(HWND hWndChild, HWND hWndNewParent);
VOID DragAcceptFiles(HWND, BOOL);
BOOL IsDialogMessage(HWND hWnd, MSG* msg);
DWORD GetMessagePos(VOID);
BOOL IsIconic(HWND hWnd);
int SetMapMode(HDC hDC, int mode);
int GetMapMode(HDC hDC);
HCURSOR LoadCursor(HINSTANCE hInst, int cursor);
DWORD GetModuleFileName(HINSTANCE hInst, LPSTR name, DWORD sz);
VOID DestroyIcon(HICON hIcon);
COLORREF GetTextColor(HDC hdc);
COLORREF GetBkColor(HDC hdc);
HPALETTE SelectPalette(HDC hdc, HPALETTE hPalette, BOOL b);
BOOL IntersectClipRect(HDC hdc, int x, int y,
int w, int h);
BOOL GetClipBox(HDC hdc, RECT* rect);
BOOL DrawIconEx(HDC hdc, int x, int y, HICON hIcon, int w, int h, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
BOOL SetViewportExtEx(HDC hdc, int x, int y, LPSIZE lpSize);
BOOL SetViewportOrgEx(HDC hdc, int x, int y, LPPOINT lpPoint);
BOOL SetWindowExtEx(HDC hdc, int x, int y, LPSIZE lpSize);
BOOL SetWindowOrgEx(HDC hdc, int x, int y, LPPOINT lpSize);
BOOL ExtFloodFill(HDC hdc, int x, int y, COLORREF col, UINT flags);
int SetPolyFillMode(HDC hdc, int mode);
BOOL RoundRect(HDC hdc, int left, int top, int right, int bottom, int r1, int r2);
BOOL MaskBlt(HDC hdc, int x, int y, int w, int h,
HDC hDCSource, int xSrc, int ySrc, HBITMAP hBitmapMask, int xMask, int yMask, DWORD rop);
UINT RealizePalette(HDC hDC);
BOOL SetBrushOrgEx(HDC hdc, int xOrigin, int yOrigin, LPPOINT lpPoint);
int GetObject(HGDIOBJ hObj, int sz, LPVOID logObj);
/* For some reason these aren't defined in the headers */
BOOL EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable) ;
BOOL GetScrollPos (HWND hWnd, int iSBar, int* pPos);
BOOL GetScrollRange (HWND hWnd, int iSBar, int* pMinPos, int* pMaxPos);
BOOL SetScrollPos (HWND hWnd, int iSBar, int iNewPos);
BOOL SetScrollRange (HWND hWnd, int iSBar, int iMinPos, int iMaxPos);
BOOL SetScrollInfo (HWND hWnd, int iSBar,
LPCSCROLLINFO lpsi, BOOL fRedraw);
BOOL GetScrollInfo(HWND hWnd, int iSBar, LPSCROLLINFO lpsi);
BOOL ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow);
#ifdef __cplusplus
}
#endif
/*
* Key State Masks for Mouse Messages
*/
#ifndef MK_LBUTTON
#define MK_LBUTTON 0x0001
#define MK_RBUTTON 0x0002
#define MK_SHIFT 0x0004
#define MK_CONTROL 0x0008
#define MK_MBUTTON 0x0010
#endif
/*
* DrawIcon flags
*/
#ifndef DI_MASK
#define DI_MASK 0x0001
#define DI_IMAGE 0x0002
#define DI_NORMAL 0x0003
#define DI_COMPAT 0x0004
#define DI_DEFAULTSIZE 0x0008
#endif
/* TODO: May have to fake these message */
#ifndef WM_INITDIALOG
#define WM_INITDIALOG 0x0110
#endif
#ifndef WM_QUERYENDSESSION
#define WM_QUERYENDSESSION 0x0011
#endif
#ifndef WM_ENDSESSION
#define WM_ENDSESSION 0x0016
#endif
#ifndef WM_SETCURSOR
#define WM_SETCURSOR 0x0020
#endif
#ifndef WM_GETMINMAXINFO
#define WM_GETMINMAXINFO 0x0024
typedef struct tagMINMAXINFO {
POINT ptReserved;
POINT ptMaxSize;
POINT ptMaxPosition;
POINT ptMinTrackSize;
POINT ptMaxTrackSize;
} MINMAXINFO, *PMINMAXINFO, *LPMINMAXINFO;
#endif
#ifndef WM_SYSCOMMAND
#define WM_SYSCOMMAND 0x0112
#endif
#ifndef WM_SYSCOLORCHANGE
#define WM_SYSCOLORCHANGE 0x0015
#endif
#ifndef WM_QUERYNEWPALETTE
#define WM_QUERYNEWPALETTE 0x030F
#endif
#ifndef WM_PALETTEISCHANGING
#define WM_PALETTEISCHANGING 0x0310
#endif
#ifndef WM_PALETTECHANGED
#define WM_PALETTECHANGED 0x0311
#endif
#ifndef WM_NOTIFY
#define WM_NOTIFY 0x004E
#endif
#ifndef WM_DROPFILES
#define WM_DROPFILES 0x0233
#endif
#ifndef PALETTERGB
#define PALETTERGB RGB
#endif
#ifndef MM_TEXT
#define MM_TEXT 1
#define MM_LOMETRIC 2
#define MM_HIMETRIC 3
#define MM_LOENGLISH 4
#define MM_HIENGLISH 5
#define MM_TWIPS 6
#define MM_ISOTROPIC 7
#define MM_ANISOTROPIC 8
#endif
#ifndef SC_MAXIMIZE
#define SC_MINIMIZE 0xF020
#define SC_MAXIMIZE 0xF030
#endif
// TODO: all of them
#ifndef IDC_ARROW
#define IDC_ARROW 1
#endif
/*
* Standard Cursor IDs
*/
#ifndef MAKEINTRESOURCE
#define MAKEINTRESOURCE(r) r
#endif
#ifndef IDC_ARROW
#define IDC_ARROW MAKEINTRESOURCE(32512)
#define IDC_IBEAM MAKEINTRESOURCE(32513)
#define IDC_WAIT MAKEINTRESOURCE(32514)
#define IDC_CROSS MAKEINTRESOURCE(32515)
#define IDC_UPARROW MAKEINTRESOURCE(32516)
#define IDC_SIZE MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */
#define IDC_ICON MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */
#define IDC_SIZENWSE MAKEINTRESOURCE(32642)
#define IDC_SIZENESW MAKEINTRESOURCE(32643)
#define IDC_SIZEWE MAKEINTRESOURCE(32644)
#define IDC_SIZENS MAKEINTRESOURCE(32645)
#define IDC_SIZEALL MAKEINTRESOURCE(32646)
#define IDC_NO MAKEINTRESOURCE(32648) /* not in win3.1 */
#if(WINVER >= 0x0500)
#define IDC_HAND MAKEINTRESOURCE(32649)
#endif /* WINVER >= 0x0500 */
#define IDC_APPSTARTING MAKEINTRESOURCE(32650) /* not in win3.1 */
#if(WINVER >= 0x0400)
#define IDC_HELP MAKEINTRESOURCE(32651)
#endif /* WINVER >= 0x0400 */
#endif
/* ExtFloodFill style flags */
#define FLOODFILLBORDER 0
#define FLOODFILLSURFACE 1
/* PolyFill() Modes */
#define ALTERNATE 1
#define WINDING 2
#define POLYFILL_LAST 2
/* Quaternary raster codes */
#define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore))
/* Device Parameters for GetDeviceCaps() */
#define DRIVERVERSION 0 /* Device driver version */
#define TECHNOLOGY 2 /* Device classification */
#define HORZSIZE 4 /* Horizontal size in millimeters */
#define VERTSIZE 6 /* Vertical size in millimeters */
/* Ternary raster operations */
#define DSTINVERT (DWORD)0x00550009 /* dest = (NOT dest) */
#define WHITENESS (DWORD)0x00FF0062 /* dest = WHITE */
#define SRCERASE (DWORD)0x00440328 /* dest = source AND (NOT dest ) */
#define MERGEPAINT (DWORD)0x00BB0226 /* dest = (NOT source) OR dest */
#define SRCPAINT (DWORD)0x00EE0086 /* dest = source OR dest */
#define NOTSRCCOPY (DWORD)0x00330008 /* dest = (NOT source) */
#endif /* _WX_MICROWIN_H_ */

View File

@@ -16,6 +16,11 @@
#include <windows.h>
#ifdef __WXMICROWIN__
/* Extra prototypes and symbols not defined by MicroWindows */
#include "wx/msw/microwin.h"
#endif
// undefine conflicting symbols which were defined in windows.h
#include "wx/msw/winundef.h"
@@ -184,7 +189,7 @@ extern LONG APIENTRY _EXPORT
// ---------------------------------------------------------------------------
// a wrapper macro for ZeroMemory()
#ifdef __WIN32__
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
#define wxZeroMemory(obj) ::ZeroMemory(&obj, sizeof(obj))
#else
#define wxZeroMemory(obj) memset((void*) & obj, 0, sizeof(obj))