Source cleaning. wxMotif/OS2 adjustements.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-10-03 16:39:45 +00:00
parent 24d88d6d46
commit 550343399a
32 changed files with 343 additions and 306 deletions

View File

@@ -1,5 +1,5 @@
/**
* Name: defs.h
* Name: wx/defs.h
* Purpose: Declarations/definitions common to all wx source files
* Author: Julian Smart and others
* Modified by: Ryan Norton (Converted to C)
@@ -2583,6 +2583,11 @@ typedef int (__stdcall *WXFARPROC)();
#endif /* __WIN32__ */
#if defined(__OS2__)
typedef unsigned long DWORD;
typedef unsigned short WORD;
#endif
#if defined(__WXPM__) || defined(__EMX__)
#ifdef __WXPM__
/* Stand-ins for OS/2 types, to avoid #including all of os2.h */
@@ -2643,8 +2648,6 @@ typedef unsigned long HCURSOR;
typedef unsigned long HINSTANCE;
typedef unsigned long HIMAGELIST;
typedef unsigned long HGLOBAL;
typedef unsigned long DWORD;
typedef unsigned short WORD;
#endif /* WXPM || EMX */
#if defined (__WXPM__)

View File

@@ -19,7 +19,7 @@
#include "wx/string.h"
#include "wx/dynarray.h"
#if defined(__WXPM__) || defined(__EMX__)
#if defined(__OS2__) || defined(__EMX__)
#include "wx/os2/private.h"
#endif
@@ -37,9 +37,9 @@ class WXDLLIMPEXP_BASE wxDynamicLibraryDetailsCreator;
// conditional compilation
// ----------------------------------------------------------------------------
// Note: WXPM/EMX has to be tested first, since we want to use
// Note: __OS2__/EMX has to be tested first, since we want to use
// native version, even if configure detected presence of DLOPEN.
#if defined(__WXPM__) || defined(__EMX__) || defined(__WINDOWS__)
#if defined(__OS2__) || defined(__EMX__) || defined(__WINDOWS__)
typedef HMODULE wxDllType;
#elif defined(HAVE_DLOPEN)
#include <dlfcn.h>
@@ -250,7 +250,7 @@ public:
return RawGetSymbol
(
handle,
name +
name +
#if wxUSE_UNICODE
L'W'
#else

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: filefn.h
// Name: wx/filefn.h
// Purpose: File- and directory-related functions
// Author: Julian Smart
// Modified by:

View File

@@ -82,7 +82,7 @@ public:
WXGC GetGC() const { return m_gc; }
WXGC GetBackingGC() const { return m_gcBacking; }
WXDisplay* GetDisplay() const { return m_display; }
bool GetAutoSetting() const { return m_autoSetting; }
bool GetAutoSetting() const { return (m_autoSetting != 0); } // See comment in dcclient.cpp
void SetAutoSetting(bool flag) { m_autoSetting = flag; }
protected:

View File

@@ -96,7 +96,7 @@ public:
WXWidget GetTopWidget() const;
#if wxUSE_CHECKLISTBOX
virtual void DoToggleItem(int item, int x) {};
virtual void DoToggleItem(int WXUNUSED(item), int WXUNUSED(x)) {};
#endif
protected:
virtual wxSize DoGetBestSize() const;

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: private.h
// Name: wx/os2/private.h
// Purpose: Private declarations: as this header is only included by
// wxWidgets itself, it may contain identifiers which don't start
// with "wx".
@@ -22,6 +22,19 @@
#define INCL_DOS
#include <os2.h>
#if defined(__WATCOMC__) && defined(__WXMOTIF__)
#include <os2def.h>
#define I_NEED_OS2_H
#include <X11/Xmd.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <Xm/VendorSP.h>
#ifdef __cplusplus
}
#endif
#endif
#if defined (__EMX__) && !defined(USE_OS2_TOOLKIT_HEADERS) && !defined(HAVE_SPBCDATA)
typedef struct _SPBCDATA {
@@ -37,6 +50,7 @@
#endif
#include "wx/dlimpexp.h"
#include "wx/fontenc.h"
class WXDLLEXPORT wxFont;
@@ -260,21 +274,25 @@ extern HBITMAP wxInvertMask(HBITMAP hbmpMask, int w = 0, int h = 0);
// global data
// ---------------------------------------------------------------------------
#ifdef __WXOS2__
// The MakeProcInstance version of the function wxSubclassedGenericControlProc
WXDLLEXPORT_DATA(extern int) wxGenericControlSubClassProc;
WXDLLEXPORT_DATA(extern wxChar*) wxBuffer;
WXDLLEXPORT_DATA(extern HINSTANCE) wxhInstance;
#endif
// ---------------------------------------------------------------------------
// global functions
// ---------------------------------------------------------------------------
#ifdef __WXOS2__
extern "C"
{
WXDLLEXPORT HINSTANCE wxGetInstance();
}
WXDLLEXPORT void wxSetInstance(HINSTANCE hInst);
#endif
#include "wx/thread.h"
static inline MRESULT MySendMsg(HWND hwnd, ULONG ulMsgid,

View File

@@ -398,14 +398,19 @@
__DARWIN__ for Darwin related corrections (wxMac, wxMotif)
*/
#elif defined(__OS2__)
/* wxOS2 vs. non wxOS2 ports on OS2 platform */
# ifndef __WXMOTIF__
# ifndef __WXOS2__
# define __WXOS2__
# endif
# ifndef __WXPM__
# define __WXPM__
# endif
# endif
# if defined(__IBMCPP__)
# define __VISAGEAVER__ __IBMCPP__
# endif
# ifndef __WXOS2__
# define __WXOS2__
# endif
# ifndef __WXPM__
# define __WXPM__
# endif
/* Place other OS/2 compiler environment defines here */

View File

@@ -733,7 +733,7 @@ public:
#if wxUSE_THREADS
#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXPM__) || defined(__EMX__)
#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__OS2__) || defined(__EMX__)
// unlock GUI if there are threads waiting for and lock it back when
// there are no more of them - should be called periodically by the main
// thread
@@ -742,10 +742,8 @@ public:
// returns true if the main thread has GUI lock
extern bool WXDLLIMPEXP_BASE wxGuiOwnedByMainThread();
#ifndef __WXPM__
// wakes up the main thread if it's sleeping inside ::GetMessage()
extern void WXDLLIMPEXP_BASE wxWakeUpMainThread();
#endif // !OS/2
// return true if the main thread is waiting for some other to terminate:
// wxApp then should block all "dangerous" messages
@@ -755,4 +753,3 @@ public:
#endif // wxUSE_THREADS
#endif // _WX_THREAD_H_

View File

@@ -64,12 +64,12 @@ wxMutexError wxMutex::Unlock()
// wxConditionInternal
// --------------------------------------------------------------------------
#if defined(__WXMSW__) || defined(__WXPM__) || defined(__EMX__)
#if defined(__WXMSW__) || defined(__OS2__) || defined(__EMX__)
// Win32 and OS/2 don't have explicit support for the POSIX condition
// variables and their events/event semaphores have quite different semantics,
// so we reimplement the conditions from scratch using the mutexes and
// semaphores
#if defined(__WXPM__) || defined(__EMX__)
#if defined(__OS2__) || defined(__EMX__)
void InterlockedIncrement(LONG *num)
{
::DosEnterCritSec();

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: utils.h
// Name: wx/utils.h
// Purpose: Miscellaneous utilities
// Author: Julian Smart
// Modified by:
@@ -26,7 +26,9 @@ class WXDLLIMPEXP_BASE wxArrayString;
// wxLongLong
#include "wx/longlong.h"
#ifdef __X__
#ifdef __WATCOMC__
#include <direct.h>
#elif defined(__X__)
#include <dirent.h>
#include <unistd.h>
#endif