Added Marco's first WinCE files

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-12-05 21:18:30 +00:00
parent 42280e48f2
commit 1a4fe894fe
13 changed files with 11126 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
==========================================================
wxWindows porting for Windows CE (TM)
==========================================================
Author : Marco Cavallini
==========================================================
What I've done:
1. This porting will use much files from MSW
2. Large use of #ifdef __WXWINCE__ into common and msw include files
3. As first
- create wxwindows\src\wince
- create wxwindows\include\wx\wince
for files not shared with MSW
4. Then create two eVC projects
- wxBaseCE
- wxWinCE
5. Search #ifdef __WXMSW__ and add the #ifdef __WXWINCE__ case in include files.
6. Start including CPP and H file into these projects and compile
- See errors and solve.
7. To be continued...
==========================================================
New Macro Definitions
---------------------
This identifies WinCE environment and should not be used
#if !defined(_WIN32_WCE)
#ifdef(_WIN32_WCE)
This identifies wxWinCE environment and can be used
#if !defined (__WXWINCE__)
#ifdef (__WXWINCE__)
New Paths
---------
\wxWindows\include\wince
\wxWindows\src\wince
Compiler options
----------------
Add
1. Tools-Option-Directories-Include = ...yourpath...\wx\wxWindows\include
2. Tools-Option-Directories-Libraries = ...yourpath...\wx\wxWindows\lib
Incompatibility stuff & Missing headers
---------------------------------------
<time.h>
<sys\types.h>
<assert.h>
<signal.h>
strdup becomes _strdup
Always-open Items
-----------------
1. Sometimes chech all __WXMSW__ to see if __WXWINCE__ is propery managed in the #if/else
2. Do not use TABS, use spaces, verify each file modified.
3. Find in files this string "!!!!!" and look if there is some code not completed
NOTES
-----
#. /wince/dummy.cpp is needed for build the precompiled header
#.
==========================================================
Koan s.a.s. - Industrial Automation and Embedded Software
Via Pascoli, 3 / Int.1 - 24121 Bergamo - ITALIA
Tel./Fax (++39) +35 - 255.235 - www.koansoftware.com
==========================================================

80
docs/msw/wince/readme.txt Normal file
View File

@@ -0,0 +1,80 @@
=================================================
Welcome to wxWindows/CE 2.3.4 (is becoming 2.5.0)
=================================================
You have downloaded version 2.3.4 of the WinCE 3.0 port of
the wxWindows GUI library. This runs on WindowsCE 3.0.
More information about the wxWindows project as a whole
can be found at:
http://www.wxwindows.org
Supported platforms
===================
These are the supported platform at the moment
- x86 emulator
- PocketPC (StrongARM)
You can test the library and applications using PocketPC emulator
and/or Compaq iPAQ or other PDAs using PocketPC
WindowsCE.NET is not supported.
Compiler installation
=====================
Get the Visual C++ embedded (FREE) from Microsoft website
http://msdn.microsoft.com/vstudio/device/embedded/download.asp
You must use Visual Tools 3.0 for CE 3.0<EFBFBD>
(this is the same we are currently using for wxWinCE)
Install selecting only the two target platforms used:
- WCE x86em (PocketPC emulation)
- WCE ARM (PocketPC StrongARM)
General installation notes
==========================
Alter your WXWIN environment variable to point to the root directory of the
wxWindows installation.
Add wxWindows include and library paths into Tools-Options-Directories
wxWindows/CE Compilation
================================
The following sections explain how to compile wxWindows/CE with the
Visual C++ embedded compiler.
Status
======
Currently develompment
Disclaimer
==========
All product names are used for identification purposes and are trademarks
or registered trademarks owned by their respective companies.
Marco Cavallini
www.koansoftware.com
.eof.

View File

@@ -0,0 +1,63 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/gdiobj.h
// Purpose: wxGDIObject class: base class for other GDI classes
// Author: Marco Cavallini
// Modified by:
// Created: 11/11/2002
// RCS-ID:
// Copyright: (c) KOAN SAS ( www.koansoftware.com )
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GDIOBJ_H_
#define _WX_GDIOBJ_H_
#include "wx/object.h" // base class
// ----------------------------------------------------------------------------
// wxGDIRefData is the base class for wxXXXData structures which contain the
// real data for the GDI object and are shared among all wxWin objects sharing
// the same native GDI object
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxGDIRefData : public wxObjectRefData
{
// this class is intentionally left blank
};
// ----------------------------------------------------------------------------
// wxGDIObject
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxGDIObject : public wxObject
{
public:
wxGDIObject() { m_visible = FALSE; };
// Creates the resource
virtual bool RealizeResource() { return FALSE; };
// Frees the resource
virtual bool FreeResource(bool WXUNUSED(force) = FALSE) { return FALSE; }
virtual bool IsFree() const { return FALSE; }
bool IsNull() const { return (m_refData == 0); }
// Returns handle.
// virtual WXHANDLE GetResourceHandle() { return 0; }
WXHANDLE GetResourceHandle() { return 0; }
virtual bool GetVisible() { return m_visible; }
virtual void SetVisible(bool v) { m_visible = v; }
protected:
bool m_visible; // TRUE only if we should delete this object ourselves
private:
DECLARE_DYNAMIC_CLASS(wxGDIObject)
};
#endif
// _WX_GDIOBJ_H_

View File

@@ -0,0 +1,139 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wince/missing.h
// Purpose: Missing things in WinCE 3.0
// Author: Marco Cavallini
// Modified by:
// Created: 16/11/2002
// RCS-ID:
// Copyright: (c) KOAN SAS ( www.koansoftware.com )
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CE_MISSING_H_
#define _WX_CE_MISSING_H_
#include "wx/msw/private.h"
/*
Most of these are in MSVC++6.0 <wx\wince\winuser.h>
see also <wx\msw\gnuwin32\winresrc.h>
*/
////////////////////////////////////////////////////////
/*
* Extended Window Styles
*/
#define WS_EX_DLGMODALFRAME 0x00000001L
#define WS_EX_NOPARENTNOTIFY 0x00000004L
#define WS_EX_TOPMOST 0x00000008L
#define WS_EX_ACCEPTFILES 0x00000010L
#define WS_EX_TRANSPARENT 0x00000020L
#define WS_EX_MDICHILD 0x00000040L
#define WS_EX_TOOLWINDOW 0x00000080L
#define WS_EX_WINDOWEDGE 0x00000100L
#define WS_EX_CLIENTEDGE 0x00000200L
#define WS_EX_CONTEXTHELP 0x00000400L
#define WS_EX_RIGHT 0x00001000L
#define WS_EX_LEFT 0x00000000L
#define WS_EX_RTLREADING 0x00002000L
#define WS_EX_LTRREADING 0x00000000L
#define WS_EX_LEFTSCROLLBAR 0x00004000L
#define WS_EX_RIGHTSCROLLBAR 0x00000000L
#define WS_EX_CONTROLPARENT 0x00010000L
#define WS_EX_STATICEDGE 0x00020000L
#define WS_EX_APPWINDOW 0x00040000L
#define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)
#define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST)
/*
* Flags for TrackPopupMenu
*/
#define TPM_LEFTBUTTON 0x0000L
#define TPM_RIGHTBUTTON 0x0002L
#define TPM_LEFTALIGN 0x0000L
#define TPM_CENTERALIGN 0x0004L
#define TPM_RIGHTALIGN 0x0008L
#define TPM_TOPALIGN 0x0000L
#define TPM_VCENTERALIGN 0x0010L
#define TPM_BOTTOMALIGN 0x0020L
#define TPM_HORIZONTAL 0x0000L /* Horz alignment matters more */
#define TPM_VERTICAL 0x0040L /* Vert alignment matters more */
#define TPM_NONOTIFY 0x0080L /* Don't send any notification msgs */
#define TPM_RETURNCMD 0x0100L
#define TPM_RECURSE 0x0001L
////////////////////////////////////////////////////////
// Missing declarations into WinCE include files (MCK)
////////////////////////////////////////////////////////
HCURSOR WINAPI
DestroyCursor(HCURSOR hCursor);
HCURSOR WINAPI
CreateCursor(HINSTANCE hInst,
int xHotSpot,
int yHotSpot,
int nWidth,
int nHeight,
CONST VOID *pvANDPlane,
CONST VOID *pvXORPlane );
////////////////////////////////////////////////////////
int WINAPI
GetScrollPos(
HWND hWnd,
int nBar);
bool WINAPI
GetScrollRange(
HWND hWnd,
int nBar,
LPINT lpMinPos,
LPINT lpMaxPos);
bool WINAPI
ScrollWindow(
HWND hWnd,
int XAmount,
int YAmount,
CONST RECT *lpRect,
CONST RECT *lpClipRect);
LRESULT WINAPI
CallWindowProcA(
WNDPROC lpPrevWndFunc,
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam);
LRESULT WINAPI
CallWindowProcW(
WNDPROC lpPrevWndFunc,
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam);
#ifdef UNICODE
#define CallWindowProc CallWindowProcW
#else
#define CallWindowProc CallWindowProcA
#endif // !UNICODE
////////////////////////////////////////////////////////
#endif // _WX_CE_MISSING_H_

1224
include/wx/msw/wince/setup.h Normal file

File diff suppressed because it is too large Load Diff

28
src/msw/wince/dummy.cpp Normal file
View File

@@ -0,0 +1,28 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wince/dummy.cpp
// Purpose: Main/DllMain
// Author: Marco Cavallini
// Modified by:
// Created: 08/11/2002
// RCS-ID:
// Copyright: (c) KOAN SAS ( www.koansoftware.com )
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
/* A dummy file to include wx.h. If precompiling wx.h, I
* always start by compiling this and producing the PCH file.
* Then subsequent source files use the PCH file.
*
* This will produce a big PCH file.
*/
#include "wx/wxprec.h"
// Foils optimizations in Visual C++ (see also app.cpp). Without it,
// dummy.obj isn't linked and we get a linker error.
char wxDummyChar = 0;

52
src/msw/wince/main.cpp Normal file
View File

@@ -0,0 +1,52 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wince/main.cpp
// Purpose: Main/DllMain
// Author: Marco Cavallini
// Modified by:
// Created: 08/11/2002
// RCS-ID:
// Copyright: (c) KOAN SAS ( www.koansoftware.com )
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
//#include "wx/event.h"
//#include "wx/app.h"
//#include "wx/msw/private.h"
// from src/msw/app.cpp
//extern void WXDLLEXPORT wxEntryCleanup();
// ----------------------------------------------------------------------------
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
// ----------------------------------------------------------------------------
// global
// ----------------------------------------------------------------------------
HINSTANCE wxhInstance = 0;
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------
HINSTANCE wxGetInstance()
{
return wxhInstance;
}
void wxSetInstance(HINSTANCE hInst)
{
wxhInstance = hInst;
}

3033
src/msw/wince/wxBase.vcp Normal file

File diff suppressed because it is too large Load Diff

34
src/msw/wince/wxBase.vcw Normal file
View File

@@ -0,0 +1,34 @@
Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00
###############################################################################
# Author: Marco Cavallini
# Created: 05/12/2002
# Copyright: (c) KOAN SAS ( www.koansoftware.com )
###############################################################################
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "wxBase"=".\wxBase.vcp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

6177
src/msw/wince/wxWinCE.vcp Normal file

File diff suppressed because it is too large Load Diff

34
src/msw/wince/wxWinCE.vcw Normal file
View File

@@ -0,0 +1,34 @@
Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00
###############################################################################
# Author: Marco Cavallini
# Created: 05/12/2002
# Copyright: (c) KOAN SAS ( www.koansoftware.com )
###############################################################################
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "wxWinCE"=.\wxWinCE.vcp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

89
src/msw/wince/wxbase.cpp Normal file
View File

@@ -0,0 +1,89 @@
/////////////////////////////////////////////////////////////////////////////
// Name: msw/wince/wxbase.cpp
// Purpose: wxBase
// Author: Marco Cavallini
// Modified by:
// Created: 05/12/2002
// RCS-ID:
// Copyright: (c) KOAN SAS ( www.koansoftware.com )
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
/* I don't remember why This does not work under emulation
#ifdef _WIN32_WCE_EMULATION
#error 'This does not work under emulation'
#endif
*/
/////////////////////////////////
#if 0
The hardware is identified by platform specific defines; usually of the form
WCE_PLATFORM_XXXX where XXXX is the name of the platform. Pocket PCs use the
older Palm Size PC define WIN32_PLATFORM_PSPC which has a value for the
version number of the platform. A Pocket PC 2002 device build can be
detected as follows:
#if defined(WIN32_PLATFORM_PSPC) && WIN32_PLATFORM_PSPC == 310
// Put Pocket PC 2002 specific code here...
#endif
// WINCE
#if defined(_WIN32_WCE)
#pragma message("\t wxWindows Target: WINDOWS CE")
// #include <windows.h>
#endif
#endif
#if defined (_WIN32_WCE)
#if _WIN32_WCE == 300
#pragma message("\t WINDOWS-CE 3.00")
#elif _WIN32_WCE == 310
#pragma message("\t WINDOWS-CE 3.10")
#endif
#endif
// WINCE
#if defined(_WIN32_WCE)
#pragma message("\t wxWindows Target: WINDOWS CE")
#endif
// WIN32
#if !defined(_WIN32_WCE) && defined(_WIN32)
#pragma message("\t wxWindows Target: WINDOWS 32")
#endif
// LINUX
#if defined(__GNUG__)
#pragma message("\t wxWindows Target: LINUX GNU")
#endif
/////////////////////////////////
// Peform some macro test
/////////////////////////////////
#if wxUSE_GUI
#if defined(__WXMSW__)
#pragma message("\t CE : __WXMSW__")
#elif defined(__WXWINCE__)
#pragma message("\t CE : __WXWINCE__")
#elif defined(__WXMOTIF__)
#pragma message("\t CE : __WXMOTIF__")
#elif defined(__WXMGL__)
#pragma message("\t CE : __WXMGL__")
#elif defined(__WXGTK__)
#pragma message("\t CE : __WXGTK__")
#elif defined(__WXX11__)
#pragma message("\t CE : __WXX11__")
#elif defined(__WXMAC__)
#pragma message("\t CE : __WXMAC__")
#elif defined(__WXPM__)
#pragma message("\t CE : __WXPM__")
#elif defined(__WXSTUBS__)
#pragma message("\t CE : __WXSTUBS__")
#endif
#endif // !GUI

89
src/msw/wince/wxwince.cpp Normal file
View File

@@ -0,0 +1,89 @@
/////////////////////////////////////////////////////////////////////////////
// Name: msw/wince/wince.cpp
// Purpose: Main/DllMain
// Author: Marco Cavallini
// Modified by:
// Created: 08/11/2002
// RCS-ID:
// Copyright: (c) KOAN SAS ( www.koansoftware.com )
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
/* I don't remember why This does not work under emulation
#ifdef _WIN32_WCE_EMULATION
#error 'This does not work under emulation'
#endif
*/
/////////////////////////////////
#if 0
The hardware is identified by platform specific defines; usually of the form
WCE_PLATFORM_XXXX where XXXX is the name of the platform. Pocket PCs use the
older Palm Size PC define WIN32_PLATFORM_PSPC which has a value for the
version number of the platform. A Pocket PC 2002 device build can be
detected as follows:
#if defined(WIN32_PLATFORM_PSPC) && WIN32_PLATFORM_PSPC == 310
// Put Pocket PC 2002 specific code here...
#endif
// WINCE
#if defined(_WIN32_WCE)
#pragma message("\t wxWindows Target: WINDOWS CE")
// #include <windows.h>
#endif
#endif
#if defined (_WIN32_WCE)
#if _WIN32_WCE == 300
#pragma message("\t WINDOWS-CE 3.00")
#elif _WIN32_WCE == 310
#pragma message("\t WINDOWS-CE 3.10")
#endif
#endif
// WINCE
#if defined(_WIN32_WCE)
#pragma message("\t wxWindows Target: WINDOWS CE")
#endif
// WIN32
#if !defined(_WIN32_WCE) && defined(_WIN32)
#pragma message("\t wxWindows Target: WINDOWS 32")
#endif
// LINUX
#if defined(__GNUG__)
#pragma message("\t wxWindows Target: LINUX GNU")
#endif
/////////////////////////////////
// Peform some macro test
/////////////////////////////////
#if wxUSE_GUI
#if defined(__WXMSW__)
#pragma message("\t CE : __WXMSW__")
#elif defined(__WXWINCE__)
#pragma message("\t CE : __WXWINCE__")
#elif defined(__WXMOTIF__)
#pragma message("\t CE : __WXMOTIF__")
#elif defined(__WXMGL__)
#pragma message("\t CE : __WXMGL__")
#elif defined(__WXGTK__)
#pragma message("\t CE : __WXGTK__")
#elif defined(__WXX11__)
#pragma message("\t CE : __WXX11__")
#elif defined(__WXMAC__)
#pragma message("\t CE : __WXMAC__")
#elif defined(__WXPM__)
#pragma message("\t CE : __WXPM__")
#elif defined(__WXSTUBS__)
#pragma message("\t CE : __WXSTUBS__")
#endif
#endif // !GUI