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))

View File

@@ -0,0 +1,88 @@
##############################################################################
# Microwindows template Makefile
# Copyright (c) 2000 Martin Jolicoeur, Greg Haerr
##############################################################################
TOP=/home/julians/microwindows/microwin/src
CONFIG = $(TOP)/config
WXDIR = ../..
OBJSUFF = o
SRCSUFF = cpp
WXLIB=$(WXDIR)/lib/libwx.a
AROPTIONS = ruv
RANLIB = ranlib
RM = rm -f
ZLIBLIB = $(WXDIR)/lib/libzlib.a
PNGLIB = $(WXDIR)/lib/libpng.a
JPEGLIB = $(WXDIR)/lib/libjpeg.a
TIFFLIB = $(WXDIR)/lib/libtiff.a
include $(CONFIG)
######################## Additional Flags section ############################
# Directories list for header files
INCLUDEDIRS += -I$(WXDIR)/include
# Defines for preprocessor
DEFINES += -DMWIN -D__WXMICROWIN__ -D__WIN32__ -D__WIN95__ -DHAVE_BOOL -DMICROWIN_TODO=1 -D__UNIX__ -DHAVE_NANOSLEEP -DMICROWIN_NOCONTROLS -D__WXDEBUG__
# Compilation flags for C files OTHER than include directories
CFLAGS +=
# Preprocessor flags OTHER than defines
CPPFLAGS +=
# Linking flags
#LDFLAGS += -lwx -L$(WXDIR)/lib
LDFLAGS += $(WXLIB)
############################# targets section ################################
# If you want to create a library with the objects files, define the name here
LIBNAME =
# If we put it below OBJS=, Makefile.rules includes .depend
# and it continually looks for .c files to satisfy .o.cpp
# dependency. What's going on there?
include $(TOP)/Makefile.rules
# List of objects to compile
OBJS = minimal.o
MTESTOBJS = mtest.o
all: minimal
######################### Makefile.rules section #############################
######################## Tools targets section ###############################
minimal: $(OBJS) $(MWINLIBS) $(WXLIB) $(TOP)/config
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(WXLIB) $(MWINLIBS) -lm
mtest: $(MTESTOBJS) $(MWINLIBS) $(TOP)/config
$(CC) $(CFLAGS) $(LDFLAGS) $(MTESTOBJS) -o $@ $(MWINLIBS)
#.SUFFIXES: .cpp .cxx .c
#.c.o:
# $(CC) -c $(CFLAGS) $(CFLAGS) -o $@ $*.c
.cxx.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.cxx
.cpp.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.cpp
#$(COMMDIR)/appcmn.o: $(COMMDIR)/appcmn.cpp
# $(CC) -c $(CPPFLAGS) -o $@ $*.cpp
#appcmn.o: $(COMMDIR)/appcmn.cpp
# $(CC) $(CPPFLAGS) -c -o $@ $<
cleanwx:
-$(RM) *.o
-$(RM) minimal
wx:
@pushd $(WXDIR)/src/microwin; make all; popd

View File

@@ -1002,7 +1002,7 @@ wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& fil
bool
wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
{
#if defined(__WIN32__)
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
// CopyFile() copies file attributes and modification time too, so use it
// instead of our code if available
//
@@ -1197,7 +1197,7 @@ bool wxPathExists(const wxChar *pszPathName)
// Get a temporary filename, opening and closing the file.
wxChar *wxGetTempFileName(const wxString& prefix, wxChar *buf)
{
#ifdef __WINDOWS__
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
#ifndef __WIN32__
wxChar tmp[144];
@@ -1816,7 +1816,7 @@ bool wxSetWorkingDirectory(const wxString& d)
// On non-Windows platform, probably just return the empty string.
wxString wxGetOSDirectory()
{
#ifdef __WINDOWS__
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
wxChar buf[256];
GetWindowsDirectory(buf, 256);
return wxString(buf);

View File

@@ -1180,7 +1180,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxLocaleModule, wxModule)
// This table is generated by misc/languages/genlang.py
// When making changes, please put them into misc/languages/langtabl.txt
#ifndef __WIN32__
#if !defined(__WIN32__) || defined(__WXMICROWIN__)
#define SETWINLANG(info,lang,sublang)

View File

@@ -402,7 +402,7 @@ WXDLLEXPORT_DATA(wxCSConv) wxConvLocal((const wxChar *)NULL);
// - perhaps common encodings to objects ("UTF8" -> wxConvUTF8)
// - move wxEncodingConverter meat in here
#ifdef __WIN32__
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
#include "wx/msw/registry.h"
// this should work if M$ Internet Exploiter is installed
static long CharsetToCodepage(const wxChar *name)
@@ -616,7 +616,7 @@ public:
};
#endif
#ifdef __WIN32__
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
class CP_CharSet : public wxCharacterSet
{
public:
@@ -722,7 +722,7 @@ static wxCharacterSet *wxGetCharacterSet(const wxChar *name)
cset = NULL;
}
#ifdef __WIN32__
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
cset = new CP_CharSet(name); // may take NULL
if (cset->usable())
return cset;

View File

@@ -180,7 +180,7 @@ int strncasecmp(const char *str_1, const char *str_2, size_t maxchar)
}
#endif // __VMS__
#ifdef __WINDOWS__
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
#ifndef __GNUWIN32__
#ifndef __MWERKS__

View File

@@ -99,7 +99,14 @@ wxTipWindow::wxTipWindow(wxWindow *parent,
{
// set colours
SetForegroundColour(*wxBLACK);
SetBackgroundColour(wxColour(255, 255, 231));
#ifdef __WXMSW__
wxColour bkCol(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_INFOBK));
#else
wxColour bkCol(wxColour(255, 255, 225));
#endif
SetBackgroundColour(bkCol);
// set position and size
int x, y;
wxGetMousePosition(&x, &y);
@@ -154,7 +161,12 @@ wxTipWindowView::wxTipWindowView(wxWindow *parent)
{
// set colours
SetForegroundColour(*wxBLACK);
SetBackgroundColour(wxColour(255, 255, 231));
#ifdef __WXMSW__
wxColour bkCol(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_INFOBK));
#else
wxColour bkCol(wxColour(255, 255, 225));
#endif
SetBackgroundColour(bkCol);
m_creationTime = wxGetLocalTime();
}

View File

@@ -86,11 +86,13 @@
#include <string.h>
#include <ctype.h>
#if defined(__WIN95__) && !((defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) && !defined(__CYGWIN10__))
#if defined(__WIN95__) && !((defined(__GNUWIN32_OLD__) || defined(__TWIN32__) || defined(__WXMICROWIN__)) && !defined(__CYGWIN10__))
#include <commctrl.h>
#endif
#ifndef __WXMICROWIN__
#include "wx/msw/msvcrt.h"
#endif
// ----------------------------------------------------------------------------
// conditional compilation
@@ -124,7 +126,9 @@
extern wxChar *wxBuffer;
extern wxList *wxWinHandleList;
extern wxList WXDLLEXPORT wxPendingDelete;
#ifndef __WXMICROWIN__
extern void wxSetKeyboardHook(bool doIt);
#endif
MSG s_currentMsg;
wxApp *wxTheApp = NULL;
@@ -234,9 +238,8 @@ bool wxApp::Initialize()
wxBitmap::InitStandardHandlers();
#if defined(__WIN95__)
#if defined(__WIN95__) && !defined(__WXMICROWIN__)
InitCommonControls();
#endif // __WIN95__
#if wxUSE_OLE || wxUSE_DRAG_AND_DROP || wxUSE_DATAOBJ
@@ -273,6 +276,7 @@ bool wxApp::Initialize()
RegisterWindowClasses();
#ifndef __WXMICROWIN__
// Create the brush for disabling bitmap buttons
LOGBRUSH lb;
@@ -284,6 +288,7 @@ bool wxApp::Initialize()
::DeleteObject( (HGDIOBJ)lb.lbHatch );
}
//else: wxWindows resources are probably not linked in
#endif
#if wxUSE_PENWINDOWS
wxRegisterPenWin();
@@ -298,7 +303,9 @@ bool wxApp::Initialize()
if (wxDummyChar) wxDummyChar++;
#endif
#ifndef __WXMICROWIN__
wxSetKeyboardHook(TRUE);
#endif
wxModule::RegisterModules();
if (!wxModule::InitializeModules())
@@ -562,7 +569,9 @@ void wxApp::CleanUp()
//// WINDOWS-SPECIFIC CLEANUP
#ifndef __WXMICROWIN__
wxSetKeyboardHook(FALSE);
#endif
#if wxUSE_PENWINDOWS
wxCleanUpPenWin();
@@ -673,7 +682,10 @@ int wxEntry(WXHINSTANCE hInstance,
// do check for memory leaks on program exit
// (another useful flag is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free
// deallocated memory which may be used to simulate low-memory condition)
#ifndef __WXMICROWIN__
wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
#endif
#ifdef __MWERKS__
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// This seems to be necessary since there are 'rogue'
@@ -1188,6 +1200,9 @@ void wxApp::OnQueryEndSession(wxCloseEvent& event)
/* static */
int wxApp::GetComCtl32Version()
{
#ifdef __WXMICROWIN__
return 0;
#else
// cache the result
static int s_verComCtl32 = -1;
@@ -1270,6 +1285,7 @@ int wxApp::GetComCtl32Version()
}
return s_verComCtl32;
#endif
}
void wxExit()

View File

@@ -43,7 +43,10 @@
#include "wx/msw/private.h"
#include "wx/log.h"
#if !defined(__WXMICROWIN__)
#include "wx/msw/dib.h"
#endif
#include "wx/image.h"
#include "wx/xpmdecod.h"
@@ -112,6 +115,7 @@ void wxBitmap::Init()
bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon)
{
#ifndef __WXMICROWIN__
// it may be either HICON or HCURSOR
HICON hicon = (HICON)icon.GetHandle();
@@ -145,6 +149,9 @@ bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon)
#endif // WXWIN_COMPATIBILITY_2
return TRUE;
#else
return FALSE;
#endif
}
#endif // Win32
@@ -219,6 +226,7 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
{
Init();
#ifndef __WXMICROWIN__
wxBitmapRefData *refData = new wxBitmapRefData;
m_refData = refData;
@@ -279,6 +287,7 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
}
SetHBITMAP((WXHBITMAP)hbmp);
#endif
}
// Create from XPM data
@@ -323,6 +332,7 @@ wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type)
bool wxBitmap::Create(int w, int h, int d)
{
#ifndef __WXMICROWIN__
UnRef();
m_refData = new wxBitmapRefData;
@@ -358,8 +368,10 @@ bool wxBitmap::Create(int w, int h, int d)
#if WXWIN_COMPATIBILITY_2
GetBitmapData()->m_ok = hbmp != 0;
#endif // WXWIN_COMPATIBILITY_2
return Ok();
#else
return FALSE;
#endif
}
// ----------------------------------------------------------------------------
@@ -799,6 +811,7 @@ bool wxBitmap::SaveFile(const wxString& filename, int type, const wxPalette *pal
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
{
#ifndef __WXMICROWIN__
wxCHECK_MSG( Ok() &&
(rect.x >= 0) && (rect.y >= 0) &&
(rect.x+rect.width <= GetWidth()) &&
@@ -834,6 +847,9 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
DeleteDC(dcSrc);
return ret;
#else
return wxBitmap();
#endif
}
// ----------------------------------------------------------------------------
@@ -876,6 +892,9 @@ void wxBitmap::SetMask(wxMask *mask)
// Contributed by Frederic Villeneuve <frederic.villeneuve@natinst.com>
wxBitmap wxBitmap::GetBitmapForDC(wxDC& dc) const
{
#ifdef __WXMICROWIN__
return wxBitmap();
#else
wxMemoryDC memDC;
wxBitmap tmpBitmap(GetWidth(), GetHeight(), dc.GetDepth());
HPALETTE hPal = (HPALETTE) NULL;
@@ -920,6 +939,7 @@ wxBitmap wxBitmap::GetBitmapForDC(wxDC& dc) const
wxFreeDIB(lpDib);
return tmpBitmap;
#endif
}
// ----------------------------------------------------------------------------
@@ -963,6 +983,7 @@ wxMask::~wxMask()
// Create a mask from a mono bitmap (copies the bitmap).
bool wxMask::Create(const wxBitmap& bitmap)
{
#ifndef __WXMICROWIN__
wxCHECK_MSG( bitmap.Ok() && bitmap.GetDepth() == 1, FALSE,
_T("can't create mask from invalid or not monochrome bitmap") );
@@ -987,6 +1008,9 @@ bool wxMask::Create(const wxBitmap& bitmap)
SelectObject(destDC, 0);
DeleteDC(destDC);
return TRUE;
#else
return FALSE;
#endif
}
// Create a mask from a bitmap and a palette index indicating
@@ -1014,6 +1038,7 @@ bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex)
// the transparent area
bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
{
#ifndef __WXMICROWIN__
wxCHECK_MSG( bitmap.Ok(), FALSE, _T("invalid bitmap in wxMask::Create") );
if ( m_maskBitmap )
@@ -1093,6 +1118,9 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
::DeleteDC(destDC);
return ok;
#else
return FALSE;
#endif
}
// ----------------------------------------------------------------------------
@@ -1159,6 +1187,7 @@ bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap),
// DIB functions
// ----------------------------------------------------------------------------
#ifndef __WXMICROWIN__
bool wxCreateDIB(long xSize, long ySize, long bitsPerPixel,
HPALETTE hPal, LPBITMAPINFO* lpDIBHeader)
{
@@ -1206,6 +1235,7 @@ void wxFreeDIB(LPBITMAPINFO lpDIBHeader)
{
free(lpDIBHeader);
}
#endif
// ----------------------------------------------------------------------------
// other helper functions
@@ -1213,6 +1243,7 @@ void wxFreeDIB(LPBITMAPINFO lpDIBHeader)
extern HBITMAP wxInvertMask(HBITMAP hbmpMask, int w, int h)
{
#ifndef __WXMICROWIN__
wxCHECK_MSG( hbmpMask, 0, _T("invalid bitmap in wxInvertMask") );
// get width/height from the bitmap if not given
@@ -1250,4 +1281,7 @@ extern HBITMAP wxInvertMask(HBITMAP hbmpMask, int w, int h)
::DeleteDC(hdcDst);
return hbmpInvMask;
#else
return 0;
#endif
}

View File

@@ -127,6 +127,7 @@ bool wxBrush::RealizeResource(void)
// - could choose white always for a quick solution
break;
***/
#ifndef __WXMICROWIN__
case wxBDIAGONAL_HATCH:
M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateHatchBrush(HS_BDIAGONAL,ms_colour) ;
break ;
@@ -157,6 +158,7 @@ bool wxBrush::RealizeResource(void)
else
M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateSolidBrush(ms_colour) ;
break ;
#endif
case wxSOLID:
default:
M_BRUSHDATA->m_hBrush = (WXHBRUSH) CreateSolidBrush(ms_colour) ;

View File

@@ -39,7 +39,9 @@
#include "wx/module.h"
#include "wx/msw/private.h"
#ifndef __WXMICROWIN__
#include "wx/msw/dib.h"
#endif
#if wxUSE_RESOURCE_LOADING_IN_MSW
#include "wx/msw/curico.h"
@@ -101,8 +103,10 @@ void wxCursorRefData::Free()
{
if ( m_hCursor )
{
#ifndef __WXMICROWIN__
if ( m_destroyCursor )
::DestroyCursor((HCURSOR)m_hCursor);
#endif
m_hCursor = 0;
}
@@ -128,6 +132,9 @@ wxCursor::wxCursor(const wxString& cursor_file,
long flags,
int hotSpotX, int hotSpotY)
{
#ifdef __WXMICROWIN__
m_refData = NULL;
#else
wxCursorRefData *refData = new wxCursorRefData;
m_refData = refData;
@@ -181,11 +188,16 @@ wxCursor::wxCursor(const wxString& cursor_file,
#if WXWIN_COMPATIBILITY_2
refData->SetOk();
#endif // WXWIN_COMPATIBILITY_2
#endif
}
// Cursors by stock number
wxCursor::wxCursor(int cursor_type)
{
#ifdef __WXMICROWIN__
m_refData = NULL;
#else
wxCursorRefData *refData = new wxCursorRefData;
m_refData = refData;
@@ -308,6 +320,7 @@ wxCursor::wxCursor(int cursor_type)
refData->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break;
}
#endif
}
wxCursor::~wxCursor()
@@ -327,7 +340,9 @@ void wxSetCursor(const wxCursor& cursor)
{
if ( cursor.Ok() )
{
#ifndef __WXMICROWIN__
::SetCursor(GetHcursorOf(cursor));
#endif
if ( gs_globalCursor )
*gs_globalCursor = cursor;

View File

@@ -343,10 +343,15 @@ bool wxDC::CanDrawBitmap() const
bool wxDC::CanGetTextExtent() const
{
#ifdef __WXMICROWIN__
// TODO Extend MicroWindows' GetDeviceCaps function
return TRUE;
#else
// What sort of display is it?
int technology = ::GetDeviceCaps(GetHdc(), TECHNOLOGY);
return (technology == DT_RASDISPLAY) || (technology == DT_RASPRINTER);
#endif
}
int wxDC::GetDepth() const
@@ -516,7 +521,7 @@ void wxDC::DoDrawCheckMark(wxCoord x1, wxCoord y1,
wxCoord x2 = x1 + width,
y2 = y1 + height;
#if defined(__WIN32__) && !defined(__SC__)
#if defined(__WIN32__) && !defined(__SC__) && !defined(__WXMICROWIN__)
RECT rect;
rect.left = x1;
rect.top = y1;
@@ -901,6 +906,7 @@ void wxDC::DoDrawRotatedText(const wxString& text,
{
DoDrawText(text, x, y);
}
#ifndef __WXMICROWIN__
else
{
// NB: don't take DEFAULT_GUI_FONT because it's not TrueType and so
@@ -951,6 +957,7 @@ void wxDC::DoDrawRotatedText(const wxString& text,
CalcBoundingBox(x, y);
CalcBoundingBox(x + h*sin(rad), y + h*cos(rad));
}
#endif
}
// ---------------------------------------------------------------------------

View File

@@ -624,6 +624,7 @@ long wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
processed = !Close();
break;
#ifndef __WXMICROWIN__
case WM_SETCURSOR:
// we want to override the busy cursor for modal dialogs:
// typically, wxBeginBusyCursor() is called and then a modal dialog
@@ -649,6 +650,7 @@ long wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
rc = FALSE;
}
break;
#endif
}
if ( !processed )

View File

@@ -86,9 +86,9 @@ public:
Init(size, family, style, weight, underlined, faceName, encoding);
}
wxFontRefData(const wxNativeFontInfo& info)
wxFontRefData(const wxNativeFontInfo& info, WXHFONT hFont = 0)
{
Init(info);
Init(info, hFont);
}
virtual ~wxFontRefData();
@@ -103,7 +103,7 @@ protected:
const wxString& faceName,
wxFontEncoding encoding);
void Init(const wxNativeFontInfo& info);
void Init(const wxNativeFontInfo& info, WXHFONT hFont = 0);
// If TRUE, the pointer to the actual font is temporary and SHOULD NOT BE
// DELETED by destructor
@@ -161,7 +161,7 @@ void wxFontRefData::Init(int pointSize,
m_nativeFontInfoOk = FALSE;
}
void wxFontRefData::Init(const wxNativeFontInfo& info)
void wxFontRefData::Init(const wxNativeFontInfo& info, WXHFONT hFont)
{
// extract family from pitch-and-family
int lfFamily = info.lf.lfPitchAndFamily;
@@ -230,7 +230,11 @@ void wxFontRefData::Init(const wxNativeFontInfo& info)
m_fontId = 0;
m_temporary = FALSE;
m_hFont = 0;
// hFont may be zero, or it be passed in case we really want to
// use the exact font created in the underlying system
// (for example where we can't guarantee conversion from HFONT
// to LOGFONT back to HFONT)
m_hFont = hFont;
m_nativeFontInfoOk = TRUE;
m_nativeFontInfo = info;
@@ -370,11 +374,11 @@ void wxFont::Init()
wxTheFontList->Append(this);
}
bool wxFont::Create(const wxNativeFontInfo& info)
bool wxFont::Create(const wxNativeFontInfo& info, WXHFONT hFont)
{
UnRef();
m_refData = new wxFontRefData(info);
m_refData = new wxFontRefData(info, hFont);
RealizeResource();

View File

@@ -93,8 +93,10 @@ private:
// private functions
// ----------------------------------------------------------------------------
#ifndef __WXMICROWIN__
int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm,
DWORD dwStyle, LONG lParam);
#endif
// ============================================================================
// implementation
@@ -147,6 +149,7 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding)
void wxFontEnumeratorHelper::DoEnumerate()
{
#ifndef __WXMICROWIN__
HDC hDC = ::GetDC(NULL);
#ifdef __WIN32__
@@ -167,6 +170,7 @@ void wxFontEnumeratorHelper::DoEnumerate()
#endif // Win32/16
::ReleaseDC(NULL, hDC);
#endif
}
bool wxFontEnumeratorHelper::OnFont(const LPLOGFONT lf,
@@ -246,6 +250,7 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family)
// Windows callbacks
// ----------------------------------------------------------------------------
#ifndef __WXMICROWIN__
int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm,
DWORD dwStyle, LONG lParam)
{
@@ -260,5 +265,6 @@ int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm,
return fontEnum->OnFont(lplf, lptm);
}
#endif
#endif // wxUSE_FONTMAP

View File

@@ -123,7 +123,7 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding,
info->charset = ANSI_CHARSET;
break;
#if !defined(__WIN16__)
#if !defined(__WIN16__) && !defined(__WXMICROWIN__)
case wxFONTENCODING_CP1250:
info->charset = EASTEUROPE_CHARSET;
break;
@@ -213,7 +213,7 @@ wxFontEncoding wxGetFontEncFromCharSet(int cs)
fontEncoding = wxFONTENCODING_CP1252;
break;
#ifdef __WIN32__
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
case EASTEUROPE_CHARSET:
fontEncoding = wxFONTENCODING_CP1250;
break;

View File

@@ -380,21 +380,31 @@ void wxFrameMSW::Restore()
bool wxFrameMSW::IsIconized() const
{
#ifdef __WXMICROWIN__
// TODO
return FALSE;
#else
((wxFrameMSW *)this)->m_iconized = (::IsIconic(GetHwnd()) != 0);
return m_iconized;
#endif
}
// Is it maximized?
bool wxFrameMSW::IsMaximized() const
{
#ifdef __WXMICROWIN__
// TODO
return FALSE;
#else
return (::IsZoomed(GetHwnd()) != 0);
#endif
}
void wxFrameMSW::SetIcon(const wxIcon& icon)
{
wxFrameBase::SetIcon(icon);
#if defined(__WIN95__)
#if defined(__WIN95__) && !defined(__WXMICROWIN__)
if ( m_icon.Ok() )
{
SendMessage(GetHwnd(), WM_SETICON,
@@ -533,10 +543,12 @@ void wxFrameMSW::SetMenuBar(wxMenuBar *menubar)
void wxFrameMSW::InternalSetMenuBar()
{
#ifndef __WXMICROWIN__
if ( !::SetMenu(GetHwnd(), (HMENU)m_hMenu) )
{
wxLogLastError(wxT("SetMenu"));
}
#endif
}
#endif // wxUSE_MENUS_NATIVE
@@ -585,8 +597,10 @@ bool wxFrameMSW::ShowFullScreen(bool show, long style)
}
#endif // wxUSE_TOOLBAR
#ifndef __WXMICROWIN__
if (style & wxFULLSCREEN_NOMENUBAR)
SetMenu((HWND)GetHWND(), (HMENU) NULL);
#endif
#if wxUSE_STATUSBAR
wxStatusBar *theStatusBar = GetStatusBar();
@@ -676,8 +690,10 @@ bool wxFrameMSW::ShowFullScreen(bool show, long style)
}
#endif // wxUSE_STATUSBAR
#ifndef __WXMICROWIN__
if ((m_fsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0))
SetMenu((HWND)GetHWND(), (HMENU)m_hMenu);
#endif
Maximize(m_fsIsMaximized);
SetWindowLong((HWND)GetHWND(),GWL_STYLE, m_fsOldWindowStyle);
@@ -956,6 +972,7 @@ bool wxFrameMSW::HandlePaint()
RECT rect;
if ( GetUpdateRect(GetHwnd(), &rect, FALSE) )
{
#ifndef __WXMICROWIN__
if ( m_iconized )
{
HICON hIcon = m_icon.Ok() ? GetHiconOf(m_icon)
@@ -989,6 +1006,7 @@ bool wxFrameMSW::HandlePaint()
return TRUE;
}
else
#endif
{
return wxWindow::HandlePaint();
}
@@ -1003,6 +1021,7 @@ bool wxFrameMSW::HandlePaint()
bool wxFrameMSW::HandleSize(int x, int y, WXUINT id)
{
bool processed = FALSE;
#ifndef __WXMICROWIN__
switch ( id )
{
@@ -1033,6 +1052,7 @@ bool wxFrameMSW::HandleSize(int x, int y, WXUINT id)
m_iconized = TRUE;
break;
}
#endif
if ( !m_iconized )
{
@@ -1092,10 +1112,12 @@ bool wxFrameMSW::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu)
// menu was removed from screen
item = -1;
}
#ifndef __WXMICROWIN__
else if ( !(flags & MF_POPUP) && !(flags & MF_SEPARATOR) )
{
item = nItem;
}
#endif
else
{
#if wxUSE_STATUSBAR
@@ -1147,6 +1169,7 @@ long wxFrameMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
}
break;
#ifndef __WXMICROWIN__
case WM_MENUSELECT:
{
WXWORD item, flags;
@@ -1156,11 +1179,13 @@ long wxFrameMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
processed = HandleMenuSelect(item, flags, hmenu);
}
break;
#endif
case WM_PAINT:
processed = HandlePaint();
break;
#ifndef __WXMICROWIN__
case WM_QUERYDRAGICON:
{
HICON hIcon = m_icon.Ok() ? GetHiconOf(m_icon)
@@ -1169,6 +1194,7 @@ long wxFrameMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
processed = rc != 0;
}
break;
#endif
case WM_SIZE:
processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);

View File

@@ -37,7 +37,10 @@
#include "wx/app.h"
#ifndef __WXMICROWIN__
#include "wx/msw/dib.h"
#endif
#include "wx/msw/bitmap.h"
#include "wx/msw/gdiimage.h"
#include "wx/bitmap.h"
@@ -50,6 +53,8 @@
// private classes
// ----------------------------------------------------------------------------
#ifndef __WXMICROWIN__
// all image handlers are declared/defined in this file because the outside
// world doesn't have to know about them (but only about wxBITMAP_TYPE_XXX ids)
@@ -180,6 +185,8 @@ private:
// ----------------------------------------------------------------------------
static wxSize GetHiconSize(HICON hicon);
#endif
// __MICROWIN__
// ============================================================================
// implementation
@@ -295,12 +302,16 @@ void wxGDIImage::CleanUpHandlers()
void wxGDIImage::InitStandardHandlers()
{
#ifndef __WXMICROWIN__
AddHandler(new wxBMPResourceHandler);
AddHandler(new wxBMPFileHandler);
AddHandler(new wxICOResourceHandler);
AddHandler(new wxICOFileHandler);
#endif
}
#ifndef __WXMICROWIN__
// ----------------------------------------------------------------------------
// wxBitmap handlers
// ----------------------------------------------------------------------------
@@ -533,3 +544,5 @@ static wxSize GetHiconSize(HICON hicon)
return size;
}
#endif
// __WXMICROWIN__

View File

@@ -63,7 +63,9 @@ void wxIconRefData::Free()
{
if ( m_hIcon )
{
#ifndef __WXMICROWIN__
::DestroyIcon((HICON) m_hIcon);
#endif
m_hIcon = 0;
}
@@ -94,6 +96,7 @@ wxIcon::~wxIcon()
void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
{
#ifndef __WXMICROWIN__
#ifdef __WIN32__
wxMask *mask = bmp.GetMask();
if ( !mask )
@@ -154,6 +157,7 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
// wxFAIL_MSG("Bitmap to icon conversion (including use of XPMs for icons) not implemented");
#endif // Win32/16
#endif
}
void wxIcon::CreateIconFromXpm(const char **data)

View File

@@ -66,7 +66,7 @@ HINSTANCE wxhInstance = 0;
#if !defined(_WINDLL)
#if defined(__TWIN32__) || defined(__WXWINE__)
#if defined(__TWIN32__) || defined(__WXWINE__) || defined(__WXMICROWIN__)
#define HINSTANCE HANDLE
extern "C"

337
src/msw/makefile.mic Normal file
View File

@@ -0,0 +1,337 @@
##############################################################################
# Microwindows template Makefile
# Copyright (c) 2000 Martin Jolicoeur, Greg Haerr
##############################################################################
TOP=/home/julians/microwindows/microwin/src
CONFIG = $(TOP)/config
WXDIR = ../..
OBJSUFF = o
SRCSUFF = cpp
WXLIB=$(WXDIR)/lib/libwx.a
AROPTIONS = ruv
RANLIB = ranlib
RM = rm -f
GENDIR = $(WXDIR)/src/generic
COMMDIR = $(WXDIR)/src/common
HTMLDIR = $(WXDIR)/src/html
ZLIBDIR = $(WXDIR)/src/zlib
PNGDIR = $(WXDIR)/src/png
JPEGDIR = $(WXDIR)/src/jpeg
TIFFDIR = $(WXDIR)/src/tiff
OLEDIR = $(WXDIR)/src/msw/ole
MICROWINDIR = $(WXDIR)/src/msw
UNIXDIR = $(WXDIR)/src/unix
UNIVDIR = $(WXDIR)/src/univ
ZLIBLIB = $(WXDIR)/lib/libzlib.a
PNGLIB = $(WXDIR)/lib/libpng.a
JPEGLIB = $(WXDIR)/lib/libjpeg.a
TIFFLIB = $(WXDIR)/lib/libtiff.a
GENERICOBJS_ORIG = \
$(GENDIR)/busyinfo.$(OBJSUFF) \
$(GENDIR)/calctrl.$(OBJSUFF) \
$(GENDIR)/choicdgg.$(OBJSUFF) \
$(GENDIR)/dirctrlg.$(OBJSUFF) \
$(GENDIR)/dragimgg.$(OBJSUFF) \
$(GENDIR)/grid.$(OBJSUFF) \
$(GENDIR)/gridsel.$(OBJSUFF) \
$(GENDIR)/laywin.$(OBJSUFF) \
$(GENDIR)/logg.$(OBJSUFF) \
$(GENDIR)/numdlgg.$(OBJSUFF) \
$(GENDIR)/panelg.$(OBJSUFF) \
$(GENDIR)/progdlgg.$(OBJSUFF) \
$(GENDIR)/prop.$(OBJSUFF) \
$(GENDIR)/propform.$(OBJSUFF) \
$(GENDIR)/proplist.$(OBJSUFF) \
$(GENDIR)/sashwin.$(OBJSUFF) \
$(GENDIR)/scrolwin.$(OBJSUFF) \
$(GENDIR)/splash.$(OBJSUFF) \
$(GENDIR)/splitter.$(OBJSUFF) \
$(GENDIR)/statusbr.$(OBJSUFF) \
$(GENDIR)/tbarsmpl.$(OBJSUFF) \
$(GENDIR)/textdlgg.$(OBJSUFF) \
$(GENDIR)/tipdlg.$(OBJSUFF) \
$(GENDIR)/tipwin.$(OBJSUFF) \
$(GENDIR)/treectlg.$(OBJSUFF) \
$(GENDIR)/treelay.$(OBJSUFF) \
$(GENDIR)/wizard.$(OBJSUFF)
GENERICOBJS = \
$(GENDIR)/laywin.$(OBJSUFF) \
$(GENDIR)/logg.$(OBJSUFF) \
$(GENDIR)/panelg.$(OBJSUFF) \
$(GENDIR)/sashwin.$(OBJSUFF) \
$(GENDIR)/scrolwin.$(OBJSUFF) \
$(GENDIR)/splash.$(OBJSUFF) \
$(GENDIR)/splitter.$(OBJSUFF) \
$(GENDIR)/statusbr.$(OBJSUFF) \
$(GENDIR)/tbarsmpl.$(OBJSUFF) \
$(GENDIR)/tipwin.$(OBJSUFF)
COMMONOBJS_OTHER=\
$(COMMDIR)/choiccmn.$(OBJSUFF) \
$(COMMDIR)/ctrlsub.$(OBJSUFF) \
$(COMMDIR)/dobjcmn.$(OBJSUFF) \
$(COMMDIR)/lboxcmn.$(OBJSUFF) \
$(COMMDIR)/textcmn.$(OBJSUFF) \
COMMONOBJS = \
$(COMMDIR)/appcmn.$(OBJSUFF) \
$(COMMDIR)/clipcmn.$(OBJSUFF) \
$(COMMDIR)/cmdline.$(OBJSUFF) \
$(COMMDIR)/cmndata.$(OBJSUFF) \
$(COMMDIR)/config.$(OBJSUFF) \
$(COMMDIR)/cshelp.$(OBJSUFF) \
$(COMMDIR)/ctrlcmn.$(OBJSUFF) \
$(COMMDIR)/datetime.$(OBJSUFF) \
$(COMMDIR)/datstrm.$(OBJSUFF) \
$(COMMDIR)/dcbase.$(OBJSUFF) \
$(COMMDIR)/dlgcmn.$(OBJSUFF) \
$(COMMDIR)/dynarray.$(OBJSUFF) \
$(COMMDIR)/dynlib.$(OBJSUFF) \
$(COMMDIR)/effects.$(OBJSUFF) \
$(COMMDIR)/encconv.$(OBJSUFF) \
$(COMMDIR)/event.$(OBJSUFF) \
$(COMMDIR)/extended.$(OBJSUFF) \
$(COMMDIR)/ffile.$(OBJSUFF) \
$(COMMDIR)/file.$(OBJSUFF) \
$(COMMDIR)/fileconf.$(OBJSUFF) \
$(COMMDIR)/filefn.$(OBJSUFF) \
$(COMMDIR)/filename.$(OBJSUFF) \
$(COMMDIR)/filesys.$(OBJSUFF) \
$(COMMDIR)/fontcmn.$(OBJSUFF) \
$(COMMDIR)/fontmap.$(OBJSUFF) \
$(COMMDIR)/framecmn.$(OBJSUFF) \
$(COMMDIR)/gdicmn.$(OBJSUFF) \
$(COMMDIR)/geometry.$(OBJSUFF) \
$(COMMDIR)/gifdecod.$(OBJSUFF) \
$(COMMDIR)/hash.$(OBJSUFF) \
$(COMMDIR)/helpbase.$(OBJSUFF) \
$(COMMDIR)/imagall.$(OBJSUFF) \
$(COMMDIR)/imagbmp.$(OBJSUFF) \
$(COMMDIR)/image.$(OBJSUFF) \
$(COMMDIR)/imaggif.$(OBJSUFF) \
$(COMMDIR)/imagjpeg.$(OBJSUFF) \
$(COMMDIR)/imagpcx.$(OBJSUFF) \
$(COMMDIR)/imagpng.$(OBJSUFF) \
$(COMMDIR)/imagpnm.$(OBJSUFF) \
$(COMMDIR)/imagtiff.$(OBJSUFF) \
$(COMMDIR)/imagxpm.$(OBJSUFF) \
$(COMMDIR)/intl.$(OBJSUFF) \
$(COMMDIR)/layout.$(OBJSUFF) \
$(COMMDIR)/list.$(OBJSUFF) \
$(COMMDIR)/log.$(OBJSUFF) \
$(COMMDIR)/longlong.$(OBJSUFF) \
$(COMMDIR)/matrix.$(OBJSUFF) \
$(COMMDIR)/memory.$(OBJSUFF) \
$(COMMDIR)/menucmn.$(OBJSUFF) \
$(COMMDIR)/module.$(OBJSUFF) \
$(COMMDIR)/mstream.$(OBJSUFF) \
$(COMMDIR)/object.$(OBJSUFF) \
$(COMMDIR)/objstrm.$(OBJSUFF) \
$(COMMDIR)/paper.$(OBJSUFF) \
$(COMMDIR)/prntbase.$(OBJSUFF) \
$(COMMDIR)/process.$(OBJSUFF) \
$(COMMDIR)/quantize.$(OBJSUFF) \
$(COMMDIR)/resource.$(OBJSUFF) \
$(COMMDIR)/sizer.$(OBJSUFF) \
$(COMMDIR)/strconv.$(OBJSUFF) \
$(COMMDIR)/stream.$(OBJSUFF) \
$(COMMDIR)/string.$(OBJSUFF) \
$(COMMDIR)/tbarbase.$(OBJSUFF) \
$(COMMDIR)/textfile.$(OBJSUFF) \
$(COMMDIR)/timercmn.$(OBJSUFF) \
$(COMMDIR)/tokenzr.$(OBJSUFF) \
$(COMMDIR)/treebase.$(OBJSUFF) \
$(COMMDIR)/txtstrm.$(OBJSUFF) \
$(COMMDIR)/utilscmn.$(OBJSUFF) \
$(UNIXDIR)/utilsunx.$(OBJSUFF) \
$(COMMDIR)/valgen.$(OBJSUFF) \
$(COMMDIR)/validate.$(OBJSUFF) \
$(COMMDIR)/valtext.$(OBJSUFF) \
$(COMMDIR)/variant.$(OBJSUFF) \
$(COMMDIR)/wfstream.$(OBJSUFF) \
$(COMMDIR)/wincmn.$(OBJSUFF) \
$(COMMDIR)/wxchar.$(OBJSUFF) \
$(COMMDIR)/xpmdecod.$(OBJSUFF)
HTMLOBJS = \
$(HTMLDIR)/helpctrl.$(OBJSUFF) \
$(HTMLDIR)/helpdata.$(OBJSUFF) \
$(HTMLDIR)/helpfrm.$(OBJSUFF) \
$(HTMLDIR)/htmlcell.$(OBJSUFF) \
$(HTMLDIR)/htmlfilt.$(OBJSUFF) \
$(HTMLDIR)/htmlpars.$(OBJSUFF) \
$(HTMLDIR)/htmltag.$(OBJSUFF) \
$(HTMLDIR)/htmlwin.$(OBJSUFF) \
$(HTMLDIR)/htmprint.$(OBJSUFF) \
$(HTMLDIR)/m_dflist.$(OBJSUFF) \
$(HTMLDIR)/m_fonts.$(OBJSUFF) \
$(HTMLDIR)/m_hline.$(OBJSUFF) \
$(HTMLDIR)/m_image.$(OBJSUFF) \
$(HTMLDIR)/m_layout.$(OBJSUFF) \
$(HTMLDIR)/m_links.$(OBJSUFF) \
$(HTMLDIR)/m_list.$(OBJSUFF) \
$(HTMLDIR)/m_meta.$(OBJSUFF) \
$(HTMLDIR)/m_pre.$(OBJSUFF) \
$(HTMLDIR)/m_tables.$(OBJSUFF) \
$(HTMLDIR)/winpars.$(OBJSUFF)
MSWOBJS = \
$(MICROWINDIR)/accel.$(OBJSUFF) \
$(MICROWINDIR)/app.$(OBJSUFF) \
$(MICROWINDIR)/bitmap.$(OBJSUFF) \
$(MICROWINDIR)/brush.$(OBJSUFF) \
$(MICROWINDIR)/caret.$(OBJSUFF) \
$(MICROWINDIR)/clipbrd.$(OBJSUFF) \
$(MICROWINDIR)/colour.$(OBJSUFF) \
$(MICROWINDIR)/cursor.$(OBJSUFF) \
$(MICROWINDIR)/data.$(OBJSUFF) \
$(MICROWINDIR)/dc.$(OBJSUFF) \
$(MICROWINDIR)/dcclient.$(OBJSUFF) \
$(MICROWINDIR)/dcmemory.$(OBJSUFF) \
$(MICROWINDIR)/dcprint.$(OBJSUFF) \
$(MICROWINDIR)/dcscreen.$(OBJSUFF) \
$(MICROWINDIR)/dde.$(OBJSUFF) \
$(MICROWINDIR)/dialog.$(OBJSUFF) \
$(MICROWINDIR)/dialup.$(OBJSUFF) \
$(UNIXDIR)/dir.$(OBJSUFF) \
$(MICROWINDIR)/font.$(OBJSUFF) \
$(MICROWINDIR)/fontenum.$(OBJSUFF) \
$(MICROWINDIR)/fontutil.$(OBJSUFF) \
$(MICROWINDIR)/frame.$(OBJSUFF) \
$(MICROWINDIR)/gdiimage.$(OBJSUFF) \
$(MICROWINDIR)/gdiobj.$(OBJSUFF) \
$(MICROWINDIR)/icon.$(OBJSUFF) \
$(MICROWINDIR)/main.$(OBJSUFF) \
$(MICROWINDIR)/menu.$(OBJSUFF) \
$(MICROWINDIR)/menuitem.$(OBJSUFF) \
$(MICROWINDIR)/microwin.$(OBJSUFF) \
$(MICROWINDIR)/msgdlg.$(OBJSUFF) \
$(MICROWINDIR)/palette.$(OBJSUFF) \
$(MICROWINDIR)/pen.$(OBJSUFF) \
$(MICROWINDIR)/regconf.$(OBJSUFF) \
$(MICROWINDIR)/region.$(OBJSUFF) \
$(MICROWINDIR)/settings.$(OBJSUFF) \
$(MICROWINDIR)/thread.$(OBJSUFF) \
$(MICROWINDIR)/timer.$(OBJSUFF) \
$(MICROWINDIR)/utils.$(OBJSUFF) \
$(MICROWINDIR)/window.$(OBJSUFF)
UNIVOBJS = \
$(UNIVDIR)/bmpbuttn.$(OBJSUFF) \
$(UNIVDIR)/button.$(OBJSUFF) \
$(UNIVDIR)/checkbox.$(OBJSUFF) \
$(UNIVDIR)/checklst.$(OBJSUFF) \
$(UNIVDIR)/choice.$(OBJSUFF) \
$(UNIVDIR)/colordlg.$(OBJSUFF) \
$(UNIVDIR)/colschem.$(OBJSUFF) \
$(UNIVDIR)/control.$(OBJSUFF) \
$(UNIVDIR)/frameuniv.$(OBJSUFF) \
$(UNIVDIR)/gauge.$(OBJSUFF) \
$(UNIVDIR)/inphand.$(OBJSUFF) \
$(UNIVDIR)/listbox.$(OBJSUFF) \
$(UNIVDIR)/menu.$(OBJSUFF) \
$(UNIVDIR)/notebook.$(OBJSUFF) \
$(UNIVDIR)/radiobox.$(OBJSUFF) \
$(UNIVDIR)/radiobut.$(OBJSUFF) \
$(UNIVDIR)/renderer.$(OBJSUFF) \
$(UNIVDIR)/scrarrow.$(OBJSUFF) \
$(UNIVDIR)/scrolbar.$(OBJSUFF) \
$(UNIVDIR)/scrthumb.$(OBJSUFF) \
$(UNIVDIR)/slider.$(OBJSUFF) \
$(UNIVDIR)/spinbutt.$(OBJSUFF) \
$(UNIVDIR)/spinctrl.$(OBJSUFF) \
$(UNIVDIR)/statbmp.$(OBJSUFF) \
$(UNIVDIR)/statbox.$(OBJSUFF) \
$(UNIVDIR)/statline.$(OBJSUFF) \
$(UNIVDIR)/stattext.$(OBJSUFF) \
$(UNIVDIR)/textctrl.$(OBJSUFF) \
$(UNIVDIR)/theme.$(OBJSUFF) \
$(UNIVDIR)/winuniv.$(OBJSUFF) \
$(UNIVDIR)/themes/gtk.$(OBJSUFF) \
$(UNIVDIR)/themes/win32.$(OBJSUFF)
include $(CONFIG)
######################## Additional Flags section ############################
# Directories list for header files
INCLUDEDIRS += -I$(WXDIR)/include
# Defines for preprocessor
DEFINES += -DMWIN -D__WXMSW__ -D__WXMICROWIN__ -D__WXUNIVERSAL__ -D__WIN32__ -D__WIN95__ -DHAVE_BOOL -DMICROWIN_TODO=1 -D__UNIX__ -DHAVE_NANOSLEEP -DMICROWIN_NOCONTROLS -D__WXDEBUG__
# Compilation flags for C files OTHER than include directories
CFLAGS +=
# Preprocessor flags OTHER than defines
CPPFLAGS +=
# Linking flags
LDFLAGS +=
############################# targets section ################################
# If you want to create a library with the objects files, define the name here
LIBNAME =
# If we put it below OBJS=, Makefile.rules includes .depend
# and it continually looks for .c files to satisfy .o.cpp
# dependency. What's going on there?
include $(TOP)/Makefile.rules
# List of objects to compile
OBJS = $(COMMONOBJS) $(MSWOBJS) $(GENERICOBJS)
all: $(WXLIB)
######################### Makefile.rules section #############################
######################## Tools targets section ###############################
#ntest: $(OBJS) $(NANOXCLIENTLIBS) $(TOP)/config
# $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(NANOXCLIENTLIBS)
$(WXLIB): $(OBJS)
ar $(AROPTIONS) $@ $(OBJS)
$(RANLIB) $@
#.SUFFIXES: .cpp .cxx .c
#.c.o:
# $(CC) -c $(CFLAGS) $(CFLAGS) -o $@ $*.c
.cxx.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.cxx
.cpp.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.cpp
#$(COMMDIR)/appcmn.o: $(COMMDIR)/appcmn.cpp
# $(CC) -c $(CPPFLAGS) -o $@ $*.cpp
#appcmn.o: $(COMMDIR)/appcmn.cpp
# $(CC) $(CPPFLAGS) -c -o $@ $<
cleanwx:
-$(RM) *.o
-$(RM) *.bak
-$(RM) core
-$(RM) ../common/y_tab.c
-$(RM) ../common/lex_yy.c
-$(RM) ../common/*.o
-$(RM) ../common/*.bak
-$(RM) ../generic/*.o
-$(RM) ../generic/*.bak
-$(RM) ../html/*.o
-$(RM) ../zlib/*.o
-$(RM) ../zlib/*.bak
-$(RM) ../png/*.o
-$(RM) ../png/*.bak
-$(RM) ../jpeg/*.o
-$(RM) ../jpeg/*.bak
-$(RM) ../tiff/*.o
-$(RM) ../tiff/*.bak

View File

@@ -75,7 +75,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
{
UnRef();
#ifdef __WXWINE__
#if defined(__WXWINE__) || defined(__WXMICROWIN__)
return (FALSE);
@@ -108,14 +108,21 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
{
#ifdef __WXMICROWIN__
return FALSE;
#else
if ( !m_refData )
return FALSE;
return ::GetNearestPaletteIndex((HPALETTE) M_PALETTEDATA->m_hPalette, PALETTERGB(red, green, blue));
#endif
}
bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const
{
#ifdef __WXMICROWIN__
return FALSE;
#else
if ( !m_refData )
return FALSE;
@@ -131,6 +138,7 @@ bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsi
return TRUE;
} else
return FALSE;
#endif
}
void wxPalette::SetHPALETTE(WXHPALETTE pal)

View File

@@ -157,7 +157,7 @@ bool wxPen::RealizeResource()
// Join style, Cap style, Pen Stippling only on Win32.
// Currently no time to find equivalent on Win3.1, sorry
// [if such equiv exist!!]
#ifdef __WIN32__
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
if (M_PENDATA->m_join==wxJOIN_ROUND &&
M_PENDATA->m_cap==wxCAP_ROUND &&
M_PENDATA->m_style!=wxUSER_DASH &&
@@ -405,6 +405,7 @@ int wx2msPenStyle(int wx_style)
int cstyle;
switch (wx_style)
{
#if !defined(__WXMICROWIN__)
case wxDOT:
cstyle = PS_DOT;
break;
@@ -421,8 +422,10 @@ int wx2msPenStyle(int wx_style)
case wxTRANSPARENT:
cstyle = PS_NULL;
break;
#endif
case wxUSER_DASH:
#if !defined(__WXMICROWIN__)
#ifdef __WIN32__
// Win32s doesn't have PS_USERSTYLE
if (wxGetOsVersion()==wxWINDOWS_NT || wxGetOsVersion()==wxWIN95)
@@ -431,6 +434,7 @@ int wx2msPenStyle(int wx_style)
cstyle = PS_DOT; // We must make a choice... This is mine!
#else
cstyle = PS_DASH;
#endif
#endif
break;
case wxSOLID:

View File

@@ -43,7 +43,7 @@ public:
wxRegionRefData(const wxRegionRefData& data)
{
#if defined(__WIN32__)
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
DWORD noBytes = ::GetRegionData(data.m_region, 0, NULL);
RGNDATA *rgnData = (RGNDATA*) new char[noBytes];
::GetRegionData(data.m_region, noBytes, rgnData);

View File

@@ -40,6 +40,7 @@
#include "wx/window.h"
#include "wx/msw/private.h"
#include "wx/module.h"
#include "wx/fontutil.h"
// ----------------------------------------------------------------------------
// private classes
@@ -117,16 +118,8 @@ wxColour wxSystemSettings::GetSystemColour(int index)
}
}
wxFont wxSystemSettings::GetSystemFont(int index)
wxFont wxCreateFontFromStockObject(int index)
{
// wxWindow ctor calls GetSystemFont(wxSYS_DEFAULT_GUI_FONT) so we're
// called fairly often - this is why we cache this particular font
bool isDefaultRequested = index == wxSYS_DEFAULT_GUI_FONT;
if ( isDefaultRequested && gs_fontDefault )
{
return *gs_fontDefault;
}
wxFont font;
HFONT hFont = (HFONT) ::GetStockObject(index);
@@ -135,7 +128,16 @@ wxFont wxSystemSettings::GetSystemFont(int index)
LOGFONT lf;
if ( ::GetObject(hFont, sizeof(LOGFONT), &lf) != 0 )
{
font = wxCreateFontFromLogFont(&lf);
wxNativeFontInfo info;
info.lf = lf;
// Under MicroWindows we pass the HFONT as well
// because it's hard to convert HFONT -> LOGFONT -> HFONT
// It's OK to delete stock objects, the delete will be ignored.
#ifdef __WXMICROWIN__
font.Create(info, (WXHFONT) hFont);
#else
font.Create(info);
#endif
}
else
{
@@ -146,6 +148,20 @@ wxFont wxSystemSettings::GetSystemFont(int index)
{
wxFAIL_MSG( _T("stock font not found") );
}
return font;
}
wxFont wxSystemSettings::GetSystemFont(int index)
{
// wxWindow ctor calls GetSystemFont(wxSYS_DEFAULT_GUI_FONT) so we're
// called fairly often - this is why we cache this particular font
bool isDefaultRequested = index == wxSYS_DEFAULT_GUI_FONT;
if ( isDefaultRequested && gs_fontDefault )
{
return *gs_fontDefault;
}
wxFont font = wxCreateFontFromStockObject(index);
if ( isDefaultRequested )
{
@@ -159,6 +175,10 @@ wxFont wxSystemSettings::GetSystemFont(int index)
// Get a system metric, e.g. scrollbar size
int wxSystemSettings::GetSystemMetric(int index)
{
#ifdef __WXMICROWIN__
// TODO: probably use wxUniv themes functionality
return 0;
#else
switch ( index)
{
#ifdef __WIN32__
@@ -250,6 +270,8 @@ int wxSystemSettings::GetSystemMetric(int index)
default:
return 0;
}
#endif
// __WXMICROWIN__
}
// Option functions (arbitrary name/value mapping)

View File

@@ -82,11 +82,18 @@ bool wxTimer::Start(int milliseconds, bool oneShot)
wxCHECK_MSG( m_milli > 0, FALSE, wxT("invalid value for timer timeour") );
wxTimerList.DeleteObject(this);
#ifdef __WXMICROWIN__
m_id = SetTimer(NULL, (UINT)(m_id ? m_id : 1),
(UINT)milliseconds, (TIMERPROC) wxTimerProc);
#else
TIMERPROC wxTimerProcInst = (TIMERPROC)
MakeProcInstance((FARPROC)wxTimerProc, wxGetInstance());
m_id = SetTimer(NULL, (UINT)(m_id ? m_id : 1),
(UINT)milliseconds, wxTimerProcInst);
#endif
if ( m_id > 0 )
{
wxTimerList.Append(m_id, this);

View File

@@ -41,7 +41,7 @@
// #include "wx/msw/private.h" which itself includes <windows.h>, as this
// one in turn includes <winsock.h> unless we define WIN32_LEAN_AND_MEAN.
//
#if defined(__WIN32__) && !defined(__TWIN32__) && ! (defined(__GNUWIN32__) && !defined(__MINGW32__))
#if defined(__WIN32__) && !defined(__TWIN32__) && !defined(__WXMICROWIN__) && ! (defined(__GNUWIN32__) && !defined(__MINGW32__))
extern "C" {
#include <winsock.h> // we use socket functions in wxGetFullHostName()
}
@@ -51,7 +51,7 @@ extern "C" {
#include "wx/timer.h"
#if !defined(__GNUWIN32__) && !defined(__WXWINE__) && !defined(__SALFORDC__)
#if !defined(__GNUWIN32__) && !defined(__WXWINE__) && !defined(__SALFORDC__) && !defined(__WXMICROWIN__)
#include <direct.h>
#ifndef __MWERKS__
@@ -80,7 +80,7 @@ extern "C" {
#include <lm.h>
#endif // USE_NET_API
#if defined(__WIN32__) && !defined(__WXWINE__)
#if defined(__WIN32__) && !defined(__WXWINE__) && !defined(__WXMICROWIN__)
#include <io.h>
#ifndef __GNUWIN32__
@@ -131,11 +131,13 @@ static const wxChar WX_SECTION[] = wxT("wxWindows");
static const wxChar eUSERNAME[] = wxT("UserName");
// these are only used under Win16
#ifndef __WIN32__
#if !defined(__WIN32__) && !defined(__WXMICROWIN__)
static const wxChar eHOSTNAME[] = wxT("HostName");
static const wxChar eUSERID[] = wxT("UserId");
#endif // !Win32
#ifndef __WXMICROWIN__
// ============================================================================
// implementation
// ============================================================================
@@ -147,7 +149,7 @@ static const wxChar eUSERID[] = wxT("UserId");
// Get hostname only (without domain name)
bool wxGetHostName(wxChar *buf, int maxSize)
{
#if defined(__WIN32__) && !defined(__TWIN32__)
#if defined(__WIN32__) && !defined(__TWIN32__) && !defined(__WXMICROWIN__)
DWORD nSize = maxSize;
if ( !::GetComputerName(buf, &nSize) )
{
@@ -173,7 +175,7 @@ bool wxGetHostName(wxChar *buf, int maxSize)
// get full hostname (with domain name if possible)
bool wxGetFullHostName(wxChar *buf, int maxSize)
{
#if defined(__WIN32__) && !defined(__TWIN32__) && ! (defined(__GNUWIN32__) && !defined(__MINGW32__))
#if defined(__WIN32__) && !defined(__TWIN32__) && !defined(__WXMICROWIN__) && ! (defined(__GNUWIN32__) && !defined(__MINGW32__))
// TODO should use GetComputerNameEx() when available
WSADATA wsa;
if ( WSAStartup(MAKEWORD(1, 1), &wsa) == 0 )
@@ -218,7 +220,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize)
// Get user ID e.g. jacs
bool wxGetUserId(wxChar *buf, int maxSize)
{
#if defined(__WIN32__) && !defined(__win32s__) && !defined(__TWIN32__)
#if defined(__WIN32__) && !defined(__win32s__) && !defined(__TWIN32__) && !defined(__WXMICROWIN__)
DWORD nSize = maxSize;
if ( ::GetUserName(buf, &nSize) == 0 )
{
@@ -423,7 +425,9 @@ wxChar *wxGetUserHome(const wxString& WXUNUSED(user))
bool wxDirExists(const wxString& dir)
{
#if defined(__WIN32__)
#ifdef __WXMICROWIN__
return wxPathExist(dir);
#elif defined(__WIN32__)
DWORD attribs = GetFileAttributes(dir);
return ((attribs != (DWORD)-1) && (attribs & FILE_ATTRIBUTE_DIRECTORY));
#else // Win16
@@ -926,6 +930,8 @@ void wxSleep(int nSecs)
}
#endif // wxUSE_GUI/!wxUSE_GUI
#endif
// __WXMICROWIN__
// ----------------------------------------------------------------------------
// deprecated (in favour of wxLog) log functions
@@ -934,6 +940,7 @@ void wxSleep(int nSecs)
#if wxUSE_GUI
// Output a debug mess., in a system dependent fashion.
#ifndef __WXMICROWIN__
void wxDebugMsg(const wxChar *fmt ...)
{
va_list ap;
@@ -965,6 +972,7 @@ void wxFatalError(const wxString& msg, const wxString& title)
wxSprintf(wxBuffer, wxT("%s: %s"), WXSTRINGCAST title, WXSTRINGCAST msg);
FatalAppExit(0, (LPCTSTR)wxBuffer);
}
#endif // __WXMICROWIN__
// ----------------------------------------------------------------------------
// functions to work with .INI files
@@ -1091,7 +1099,9 @@ void wxBeginBusyCursor(wxCursor *cursor)
if ( gs_wxBusyCursorCount++ == 0 )
{
gs_wxBusyCursor = (HCURSOR)cursor->GetHCURSOR();
#ifndef __WXMICROWIN__
gs_wxBusyCursorOld = ::SetCursor(gs_wxBusyCursor);
#endif
}
//else: nothing to do, already set
}
@@ -1104,8 +1114,9 @@ void wxEndBusyCursor()
if ( --gs_wxBusyCursorCount == 0 )
{
#ifndef __WXMICROWIN__
::SetCursor(gs_wxBusyCursorOld);
#endif
gs_wxBusyCursorOld = 0;
}
}
@@ -1135,6 +1146,7 @@ bool wxCheckForInterrupt(wxWindow *wnd)
// MSW only: get user-defined resource from the .res file.
// Returns NULL or newly-allocated memory, so use delete[] to clean up.
#ifndef __WXMICROWIN__
wxChar *wxLoadUserResource(const wxString& resourceName, const wxString& resourceType)
{
HRSRC hResource = ::FindResource(wxGetInstance(), resourceName, resourceType);
@@ -1168,6 +1180,7 @@ wxChar *wxLoadUserResource(const wxString& resourceName, const wxString& resourc
return s;
}
#endif
// ----------------------------------------------------------------------------
// get display info
@@ -1186,6 +1199,10 @@ void wxGetMousePosition( int* x, int* y )
// Return TRUE if we have a colour display
bool wxColourDisplay()
{
#ifdef __WXMICROWIN__
// MICROWIN_TODO
return TRUE;
#else
// this function is called from wxDC ctor so it is called a *lot* of times
// hence we optimize it a bit but doign the check only once
//
@@ -1202,6 +1219,7 @@ bool wxColourDisplay()
}
return s_isColour != 0;
#endif
}
// Returns depth of screen
@@ -1214,23 +1232,33 @@ int wxDisplayDepth()
// Get size of display
void wxDisplaySize(int *width, int *height)
{
#ifdef __WXMICROWIN__
// MICROWIN_TODO
*width = 0; * height = 0;
#else
ScreenHDC dc;
if ( width ) *width = GetDeviceCaps(dc, HORZRES);
if ( height ) *height = GetDeviceCaps(dc, VERTRES);
#endif
}
void wxDisplaySizeMM(int *width, int *height)
{
#ifdef __WXMICROWIN__
// MICROWIN_TODO
*width = 0; * height = 0;
#else
ScreenHDC dc;
if ( width ) *width = GetDeviceCaps(dc, HORZSIZE);
if ( height ) *height = GetDeviceCaps(dc, VERTSIZE);
#endif
}
void wxClientDisplayRect(int *x, int *y, int *width, int *height)
{
#ifdef __WIN16__
#if defined(__WIN16__) || defined(__WXMICROWIN__)
*x = 0; *y = 0;
wxDisplaySize(width, height);
#else
@@ -1263,6 +1291,10 @@ wxString WXDLLEXPORT wxGetWindowText(WXHWND hWnd)
wxString WXDLLEXPORT wxGetWindowClass(WXHWND hWnd)
{
#ifdef __WXMICROWIN__
// MICROWIN_TODO
return wxEmptyString;
#else
wxString str;
int len = 256; // some starting value
@@ -1302,6 +1334,7 @@ wxString WXDLLEXPORT wxGetWindowClass(WXHWND hWnd)
}
return str;
#endif
}
WXWORD WXDLLEXPORT wxGetWindowId(WXHWND hWnd)
@@ -1576,4 +1609,13 @@ void wxRedirectIOToConsole()
}
#endif
#ifdef __WXMICROWIN__
int wxGetOsVersion(int *majorVsn, int *minorVsn)
{
// MICROWIN_TODO
if (majorVsn) *majorVsn = 0;
if (minorVsn) *minorVsn = 0;
return wxUNIX;
}
#endif

View File

@@ -45,7 +45,7 @@
#include <ctype.h>
#if !defined(__GNUWIN32__) && !defined(__WXWINE__) && !defined(__SALFORDC__)
#if !defined(__GNUWIN32__) && !defined(__WXWINE__) && !defined(__SALFORDC__) && !defined(__WXMICROWIN__)
#include <direct.h>
#ifndef __MWERKS__
#include <dos.h>
@@ -57,7 +57,7 @@
#include <sys/stat.h>
#endif
#if defined(__WIN32__) && !defined(__WXWINE__)
#if defined(__WIN32__) && !defined(__WXWINE__) && !defined(__WXMICROWIN__)
#include <io.h>
#ifndef __GNUWIN32__

View File

@@ -84,7 +84,7 @@
#include <string.h>
#if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__)
#if (!defined(__GNUWIN32_OLD__) && !defined(__WXMICROWIN__)) || defined(__CYGWIN10__)
#include <shellapi.h>
#include <mmsystem.h>
#endif
@@ -93,11 +93,11 @@
#include <windowsx.h>
#endif
#if (!defined(__GNUWIN32_OLD__) && !defined(__TWIN32__)) || defined(__CYGWIN10__)
#if (!defined(__GNUWIN32_OLD__) && !defined(__TWIN32__) && !defined(__WXMICROWIN__)) || defined(__CYGWIN10__)
#ifdef __WIN95__
#include <commctrl.h>
#endif
#else // broken compiler
#elif !defined(__WXMICROWIN__) // broken compiler
#ifndef __TWIN32__
#include "wx/msw/gnuwin32/extra.h"
#endif
@@ -740,7 +740,11 @@ int wxWindowMSW::GetScrollPos(int orient) const
HWND hWnd = GetHwnd();
if ( hWnd )
{
#ifdef __WXMICROWIN__
return ::GetScrollPosWX(hWnd, wOrient);
#else
return ::GetScrollPos(hWnd, wOrient);
#endif
}
else
return 0;
@@ -1883,9 +1887,11 @@ void wxWindowMSW::UnpackScroll(WXWPARAM wParam, WXLPARAM lParam,
void wxWindowMSW::UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *nCtlColor, WXHDC *hdc, WXHWND *hwnd)
{
#ifndef __WXMICROWIN__
*nCtlColor = CTLCOLOR_BTN;
*hwnd = (WXHWND)lParam;
*hdc = (WXHDC)wParam;
#endif
}
void wxWindowMSW::UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam,
@@ -2145,6 +2151,7 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
wParam);
break;
#ifdef MM_JOY1MOVE // __WXMICROWIN__
case MM_JOY1MOVE:
case MM_JOY2MOVE:
case MM_JOY1ZMOVE:
@@ -2158,6 +2165,7 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
GET_Y_LPARAM(lParam),
wParam);
break;
#endif
case WM_SYSCOMMAND:
processed = HandleSysCommand(wParam, lParam);
@@ -2180,6 +2188,7 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
#endif // Win95
// for these messages we must return TRUE if process the message
#ifdef WM_DRAWITEM // __WXMICROWIN__
case WM_DRAWITEM:
case WM_MEASUREITEM:
{
@@ -2199,7 +2208,7 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
rc.result = TRUE;
}
break;
#endif
case WM_GETDLGCODE:
if ( m_lDlgCode )
{
@@ -2307,7 +2316,8 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
break;
// CTLCOLOR messages are sent by children to query the parent for their
// colors
// colors#ifndef __WXMICROWIN__
#ifndef __WXMICROWIN__
#ifdef __WIN32__
case WM_CTLCOLORMSGBOX:
case WM_CTLCOLOREDIT:
@@ -2334,6 +2344,7 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
lParam);
}
break;
#endif
// the return value for this message is ignored
case WM_SYSCOLORCHANGE:
@@ -2397,7 +2408,7 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
}
break;
#ifdef __WIN32__
#if defined(__WIN32__) && defined(WM_HELP)
case WM_HELP:
{
HELPINFO* info = (HELPINFO*) lParam;
@@ -2636,6 +2647,7 @@ bool wxWindowMSW::MSWCreate(int id,
if ( dialog_template )
{
#ifndef __WXMICROWIN__
// for the dialogs without wxDIALOG_NO_PARENT style, use the top level
// app window as parent - this avoids creating modal dialogs without
// parent
@@ -2707,6 +2719,9 @@ bool wxWindowMSW::MSWCreate(int id,
{
wxLogLastError(wxT("MoveWindow"));
}
#endif
// __WXMICROWIN__
}
else // creating a normal window, not a dialog
{
@@ -2779,6 +2794,7 @@ bool wxWindowMSW::MSWCreate(int id,
// FIXME: VZ: I'm not sure at all that the order of processing is correct
bool wxWindowMSW::HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
{
#ifndef __WXMICROWIN__
LPNMHDR hdr = (LPNMHDR)lParam;
HWND hWnd = hdr->hwndFrom;
wxWindow *win = wxFindWinFromHandle((WXHWND)hWnd);
@@ -2804,6 +2820,9 @@ bool wxWindowMSW::HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
// finally try this window too (catches toolbar case)
return MSWOnNotify(idCtrl, lParam, result);
#else
return FALSE;
#endif
}
bool wxWindowMSW::MSWOnNotify(int WXUNUSED(idCtrl),
@@ -3004,6 +3023,7 @@ bool wxWindowMSW::HandleInitDialog(WXHWND WXUNUSED(hWndFocus))
bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam)
{
#ifndef __WXMICROWIN__
HDROP hFilesInfo = (HDROP) wParam;
POINT dropPoint;
DragQueryPoint(hFilesInfo, (LPPOINT) &dropPoint);
@@ -3035,12 +3055,16 @@ bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam)
delete[] files;
return rc;
#else
return FALSE;
#endif
}
bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd),
short nHitTest,
int WXUNUSED(mouseMsg))
{
#ifndef __WXMICROWIN__
// the logic is as follows:
// -1. don't set cursor for non client area, including but not limited to
// the title bar, scrollbars, &c
@@ -3117,7 +3141,7 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd),
// cursor set, stop here
return TRUE;
}
#endif
// pass up the window chain
return FALSE;
}
@@ -3213,6 +3237,7 @@ bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush,
WXWPARAM wParam,
WXLPARAM lParam)
{
#ifndef __WXMICROWIN__
WXHBRUSH hBrush = 0;
if ( nCtlColor == CTLCOLOR_DLG )
@@ -3232,6 +3257,9 @@ bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush,
*brush = hBrush;
return hBrush != 0;
#else
return FALSE;
#endif
}
// Define for each class of dialog and control
@@ -4222,6 +4250,8 @@ extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
return win;
}
#ifndef __WXMICROWIN__
// Windows keyboard hook. Allows interception of e.g. F1, ESCAPE
// in active frames and dialogs, regardless of where the focus is.
static HHOOK wxTheKeyboardHook = 0;
@@ -4298,6 +4328,7 @@ wxKeyboardHook(int nCode, WORD wParam, DWORD lParam)
return (int)CallNextHookEx(wxTheKeyboardHook, nCode, wParam, lParam);
}
#endif
#ifdef __WXDEBUG__
const char *wxGetMessageName(int message)