MSW fixes; added wxUSE_XPM to wxUniv's setup.h so now widgets sample works

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2001-07-03 10:03:13 +00:00
parent 748fbf95a8
commit bd52bee106
8 changed files with 138 additions and 87 deletions

View File

@@ -3,36 +3,46 @@ wxMicroWindows port
Julian Smart 2001-07-02 Julian Smart 2001-07-02
This is a snapshot of my experimental port of wxWindows to This is a port of wxWindows to MicroWindows, under Linux.
MicroWindows. Widgets are supplied by the wxUniversal project, Widgets are supplied by the wxUniversal project, while the
while the underlying port uses the Windows ports with small underlying port uses the Windows ports with small modifications
modifications for the MicroWindows API. for the MicroWindows API.
There are many things missing from MicroWindows that will There are many things missing from MicroWindows that will
make the port quite limited for the time being. I haven't make the port quite limited for the time being. I haven't
worked out how to create bitmaps, though there is a BMP to C worked out how to create bitmaps, though there is a BMP to C
converter. There are no menus, no common dialogs, and only converter. There are no common dialogs (we will use generic ones),
one WIN32 app may be run at a time. and only one WIN32 app may be run at a time.
Some things can no doubt be worked around, and/or MicroWindows Note that you can gain confidence in the WIN32/wxUniversal
itself tweaked. Lots of wxWin functionality is just switched off or combination by compiling wxUniversal under Windows using VC++,
commented out. using src/wxvc_universal.dsp. You can compile the minimal
and widgets samples in wxUniversal mode using the
UnivDebug and UnivRelease targets. Most of the code is shared
between this combination, and the wxMicroWindows port.
Installation Installation
============ ============
First install MicroWindows - untar it, change config to MicroWindows:
use X11 and any other options you feel fit, apply
microwindows.patches to fix PeekMessage, and compile
(type 'make' from within the src directory).
Untar the wxMicroWindows port, and change the TOP variable at the - unarchive MicroWindows 0.89pre7
top of src/microwin/Makefile to reflect where MicroWindows is installed. - change 'config' to use X11 and any other options you feel fit,
Type 'make all' from src/microwin. To clean, use cleanwx and NOT clean such as verbose compilation
since that will clean MicroWindows itself. - cd to src/mwin and apply microwindows.patches (from wxWindows:
docs/microwin/microwindows.patches) to fix PeekMessage
- compile by typing 'make' from within the MicroWindows src directory
wxMicroWindows:
- untar the wxMicroWindows port/download from CVS
- and change the TOP variable at the top of src/msw/makefile.mic
to reflect where MicroWindows is installed
- type 'make all' from src/msw. To clean, use cleanwx and NOT clean
since that will clean MicroWindows itself
- to make the sample, cd into samples/minimal, edit the TOP variable,
and type 'make all'
To make the sample, cd into samples/minimal, edit the TOP variable,
and type 'make all'.
Running 'minimal' runs the virtual MicroWindows desktop Running 'minimal' runs the virtual MicroWindows desktop
and the minimal sample, since in a MicroWindows WIN32 application and the minimal sample, since in a MicroWindows WIN32 application
they are one and the same binary. they are one and the same binary.
@@ -40,15 +50,38 @@ they are one and the same binary.
Status Status
====== ======
A frame comes up :-) A frame comes up :-) The menus don't work properly just yet.
Notes Implementation Notes
===== ====================
No ::GetKeyState (see microwin/private.h). Should probably use GdOpenKeyboard/GdCloseKeyboard/GdReadKeyboard. Could perhaps emulate GetKeyState this way. wxMicroWindows is essentially the wxMSW port + wxUniversal
widgets. Lots of things in include/wx/univ/setup.h are switched
off to allow the port to compile. There are also #ifdefs
switching off further functionality, such as most wxBitmap
functions, pending proper implementation.
There are some WIN32 API functions not implemented by MicroWindows
that are instead stubbed out in include/wx/msw/microwin.c,
and 'implemented' in src/msw/microwin.c. Some of these functions
are important, some less so. They will need to be implemented
in due course. But implementing missing functionality in this way
is preferably to proliferating many #ifdefs in the
wxMSW/wxMicroWindows port itself.
Things missing from MicroWindows that need to be worked around
==============================================================
No ::GetKeyState (see include/wx/msw/private.h). Should probably use
GdOpenKeyboard/GdCloseKeyboard/GdReadKeyboard. Could perhaps emulate
GetKeyState this way.
No ::CreateBitmap or BITMAPINFO. But BMPs can be converted No ::CreateBitmap or BITMAPINFO. But BMPs can be converted
to C using convbmp, then need to use Gr... functions. to C using convbmp, then need to use Gr... functions.
We MUST implement creation from XPMs, since wxUniversal
makes use of XPMs, or else create our own bitmaps for
drawing radioboxes, checkboxes etc.: see renderers
in src/univ.
No ::DestroyIcon, ::DestroyCursor - use ::DestroyObject instead? No ::DestroyIcon, ::DestroyCursor - use ::DestroyObject instead?
Also no LoadCursor, LoadImage. So how do we make cursors? No ::SetCursor. Also no LoadCursor, LoadImage. So how do we make cursors? No ::SetCursor.
@@ -56,10 +89,13 @@ Also no LoadCursor, LoadImage. So how do we make cursors? No ::SetCursor.
wxDC: no ::GetTextColor, ::GetBkColor, ::IntersectClipRect, wxDC: no ::GetTextColor, ::GetBkColor, ::IntersectClipRect,
::GetClipBox ::GetClipBox
No ::SetMenu, so no menus or menubars. No ::SetMenu, so no menus or menubars (now implemented by
wxUniversal).
No ::GetObject so we can't get LOGFONT from an HFONT No ::GetObject so we can't get LOGFONT from an HFONT
in wxSystemSettings. in wxSystemSettings (worked around by passing HFONT to
the wxFont constructor).
No ::CreateDialog so how do we create dialogs? Simulate No ::CreateDialog so how do we create dialogs? Simulate
one with a frame I guess. one with a frame...

View File

@@ -140,6 +140,7 @@
#define wxUSE_SPLINES 0 #define wxUSE_SPLINES 0
#define wxUSE_DRAG_AND_DROP 0 #define wxUSE_DRAG_AND_DROP 0
#define wxUSE_XPM_IN_MSW 1 #define wxUSE_XPM_IN_MSW 1
#define wxUSE_XPM 1
#define wxUSE_IMAGE_LOADING_IN_MSW 1 #define wxUSE_IMAGE_LOADING_IN_MSW 1
#define wxUSE_RESOURCE_LOADING_IN_MSW 0 #define wxUSE_RESOURCE_LOADING_IN_MSW 0
#define wxUSE_WX_RESOURCES 0 #define wxUSE_WX_RESOURCES 0

View File

@@ -588,8 +588,12 @@ int wxGIFDecoder::ReadGIF()
/* fill in the data */ /* fill in the data */
m_f->Read(buf, 9); m_f->Read(buf, 9);
pimg->left = buf[0] + 256 * buf[1];
pimg->top = buf[2] + 256 * buf[3];
/*
pimg->left = buf[4] + 256 * buf[5]; pimg->left = buf[4] + 256 * buf[5];
pimg->top = buf[4] + 256 * buf[5]; pimg->top = buf[4] + 256 * buf[5];
*/
pimg->w = buf[4] + 256 * buf[5]; pimg->w = buf[4] + 256 * buf[5];
pimg->h = buf[6] + 256 * buf[7]; pimg->h = buf[6] + 256 * buf[7];
interl = ((buf[8] & 0x40)? 1 : 0); interl = ((buf[8] & 0x40)? 1 : 0);

View File

@@ -31,10 +31,11 @@
#if wxUSE_NOTEBOOK #if wxUSE_NOTEBOOK
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/notebook.h"
#include "wx/imaglist.h"
#endif //WX_PRECOMP #endif //WX_PRECOMP
#include "wx/imaglist.h"
#include "wx/notebook.h"
// ============================================================================ // ============================================================================
// implementation // implementation
// ============================================================================ // ============================================================================

View File

@@ -66,12 +66,11 @@
#if wxUSE_DATAOBJ #if wxUSE_DATAOBJ
#include "wx/dataobj.h" #include "wx/dataobj.h"
#endif
// No: don't necessarily use OLE clipboard with data object #if wxUSE_OLE
#if 0
// use OLE clipboard // use OLE clipboard
#define wxUSE_OLE_CLIPBOARD 1 #define wxUSE_OLE_CLIPBOARD 1
#endif
#else // !wxUSE_DATAOBJ #else // !wxUSE_DATAOBJ
// use Win clipboard API // use Win clipboard API
#define wxUSE_OLE_CLIPBOARD 0 #define wxUSE_OLE_CLIPBOARD 0

View File

@@ -1203,10 +1203,12 @@ void wxDataObject::SetAutoDelete()
{ {
} }
#ifdef __WXDEBUG__
const wxChar *wxDataObject::GetFormatName(wxDataFormat format) const wxChar *wxDataObject::GetFormatName(wxDataFormat format)
{ {
return NULL; return NULL;
} }
#endif
#endif #endif

View File

@@ -104,11 +104,11 @@ SOURCE=.\common\clipcmn.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\common\cmdproc.cpp SOURCE=.\common\cmdline.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\common\cmdline.cpp SOURCE=.\common\cmdproc.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -379,6 +379,10 @@ SOURCE=.\common\mstream.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\common\nbkbase.cpp
# End Source File
# Begin Source File
SOURCE=.\common\object.cpp SOURCE=.\common\object.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@@ -376,6 +376,10 @@ SOURCE=.\common\mstream.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\common\nbkbase.cpp
# End Source File
# Begin Source File
SOURCE=.\common\object.cpp SOURCE=.\common\object.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -889,7 +893,7 @@ SOURCE=.\msw\dragimag.cpp
# Begin Source File # Begin Source File
SOURCE=.\msw\dummy.cpp SOURCE=.\msw\dummy.cpp
# ADD CPP /D "__WXUNIVERSAL__" /Yc"wx/wxprec.h" # ADD CPP /Yc"wx/wxprec.h"
# End Source File # End Source File
# Begin Source File # Begin Source File