]> git.saurik.com Git - wxWidgets.git/commitdiff
Various updates
authorRobin Dunn <robin@alldunn.com>
Sun, 20 Aug 2006 04:20:58 +0000 (04:20 +0000)
committerRobin Dunn <robin@alldunn.com>
Sun, 20 Aug 2006 04:20:58 +0000 (04:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/_defs.i
wxPython/src/_functions.i
wxPython/src/_misc.i

index b9b3c361c9fcf77266adfdbc60264ba5f3c7cf57..c417cc6e9fbe15c46532106e4d87bb2f8c2799ce 100644 (file)
@@ -593,6 +593,7 @@ enum {
     wxID_HELP,
     wxID_PRINT,
     wxID_PRINT_SETUP,
+    wxID_PAGE_SETUP,
     wxID_PREVIEW,
     wxID_ABOUT,
     wxID_HELP_CONTENTS,
index 44f8c045d7450d9a70805033fa65e6fe56e11e98..70ec6dd4b13063e0108aa538e1128e6398f50a6a 100644 (file)
@@ -60,52 +60,20 @@ bool wxShell(const wxString& command = wxPyEmptyString);
 void wxStartTimer();
 
 
-
-enum
-{
-    wxUNKNOWN_PLATFORM,
-    wxCURSES,                 /*  Text-only CURSES */
-    wxXVIEW_X,                /*  Sun's XView OpenLOOK toolkit */
-    wxMOTIF_X,                /*  OSF Motif 1.x.x */
-    wxCOSE_X,                 /*  OSF Common Desktop Environment */
-    wxNEXTSTEP,               /*  NeXTStep */
-    wxMAC,                    /*  Apple Mac OS 8/9/X with Mac paths */
-    wxMAC_DARWIN,             /*  Apple Mac OS X with Unix paths */
-    wxBEOS,                   /*  BeOS */
-    wxGTK,                    /*  GTK on X */
-    wxGTK_WIN32,              /*  GTK on Win32 */
-    wxGTK_OS2,                /*  GTK on OS/2 */
-    wxGTK_BEOS,               /*  GTK on BeOS */
-    wxGEOS,                   /*  GEOS */
-    wxOS2_PM,                 /*  OS/2 Workplace */
-    wxWINDOWS,                /*  Windows or WfW */
-    wxMICROWINDOWS,           /*  MicroWindows */
-    wxPENWINDOWS,             /*  Windows for Pen Computing */
-    wxWINDOWS_NT,             /*  Windows NT */
-    wxWIN32S,                 /*  Windows 32S API */
-    wxWIN95,                  /*  Windows 95 */
-    wxWIN386,                 /*  Watcom 32-bit supervisor modus */
-    wxWINDOWS_CE,             /*  Windows CE (generic) */
-    wxWINDOWS_POCKETPC,       /*  Windows CE PocketPC */
-    wxWINDOWS_SMARTPHONE,     /*  Windows CE Smartphone */
-    wxMGL_UNIX,               /*  MGL with direct hardware access */
-    wxMGL_X,                  /*  MGL on X */
-    wxMGL_WIN32,              /*  MGL on Win32 */
-    wxMGL_OS2,                /*  MGL on OS/2 */
-    wxMGL_DOS,                /*  MGL on MS-DOS */
-    wxWINDOWS_OS2,            /*  Native OS/2 PM */
-    wxUNIX,                   /*  wxBase under Unix */
-    wxX11,                    /*  Plain X11 and Universal widgets */
-    wxPALMOS,                 /*  PalmOS */
-    wxDOS                     /*  wxBase under MS-DOS */
-};
-
 DocDeclA(
     int, wxGetOsVersion(int *OUTPUT, int *OUTPUT),
     "GetOsVersion() -> (platform, major, minor)");
 
 wxString wxGetOsDescription();
 
+
+// Get platform endianness
+bool wxIsPlatformLittleEndian();
+
+// Get platform architecture
+bool wxIsPlatform64Bit();
+
+
 // TODO:
 // // Parses the wildCard, returning the number of filters.
 // // Returns 0 if none or if there's a problem,
index 0f7c62c3ea772f4af6a2be54764819f7f31b45d7..fdf10bbbef38a5793beee008c278d03dbc259fef 100644 (file)
@@ -214,6 +214,184 @@ public:
     bool IsAnotherRunning() const;
 };
 
+//---------------------------------------------------------------------------
+%newgroup
+
+// families & sub-families of operating systems
+enum wxOperatingSystemId
+{
+    wxOS_UNKNOWN = 0,                 // returned on error
+
+    wxOS_MAC_OS         = 1 << 0,     // Apple Mac OS 8/9/X with Mac paths
+    wxOS_MAC_OSX_DARWIN = 1 << 1,     // Apple Mac OS X with Unix paths
+    wxOS_MAC = wxOS_MAC_OS|wxOS_MAC_OSX_DARWIN,
+
+    wxOS_WINDOWS_9X     = 1 << 2,     // Windows 9x family (95/98/ME)
+    wxOS_WINDOWS_NT     = 1 << 3,     // Windows NT family (NT/2000/XP)
+    wxOS_WINDOWS_MICRO  = 1 << 4,     // MicroWindows
+    wxOS_WINDOWS_CE     = 1 << 5,     // Windows CE (Window Mobile)
+    wxOS_WINDOWS = wxOS_WINDOWS_9X      |
+                   wxOS_WINDOWS_NT      |
+                   wxOS_WINDOWS_MICRO   |
+                   wxOS_WINDOWS_CE,
+
+    wxOS_UNIX_LINUX     = 1 << 6,       // Linux
+    wxOS_UNIX_FREEBSD   = 1 << 7,       // FreeBSD
+    wxOS_UNIX_OPENBSD   = 1 << 8,       // OpenBSD
+    wxOS_UNIX_NETBSD    = 1 << 9,       // NetBSD
+    wxOS_UNIX_SOLARIS   = 1 << 10,      // SunOS
+    wxOS_UNIX_AIX       = 1 << 11,      // AIX
+    wxOS_UNIX_HPUX      = 1 << 12,      // HP/UX
+    wxOS_UNIX = wxOS_UNIX_LINUX     |
+                wxOS_UNIX_FREEBSD   |
+                wxOS_UNIX_OPENBSD   |
+                wxOS_UNIX_NETBSD    |
+                wxOS_UNIX_SOLARIS   |
+                wxOS_UNIX_AIX       |
+                wxOS_UNIX_HPUX,
+
+    // 1<<13 and 1<<14 available for other Unix flavours
+
+    wxOS_DOS            = 1 << 15,      // Microsoft DOS
+    wxOS_OS2            = 1 << 16       // OS/2
+};
+
+// list of wxWidgets ports - some of them can be used with more than
+// a single toolkit.
+enum wxPortId
+{
+    wxPORT_UNKNOWN  = 0,            // returned on error
+
+    wxPORT_BASE     = 1 << 0,       // wxBase, no native toolkit used
+
+    wxPORT_MSW      = 1 << 1,       // wxMSW, native toolkit is Windows API
+    wxPORT_MOTIF    = 1 << 2,       // wxMotif, using [Open]Motif or Lesstif
+    wxPORT_GTK      = 1 << 3,       // wxGTK, using GTK+ 1.x, 2.x, GPE or Maemo
+    wxPORT_MGL      = 1 << 4,       // wxMGL, using wxUniversal
+    wxPORT_X11      = 1 << 5,       // wxX11, using wxUniversal
+    wxPORT_OS2      = 1 << 6,       // wxOS2, using OS/2 Presentation Manager
+    wxPORT_MAC      = 1 << 7,       // wxMac, using Carbon or Classic Mac API
+    wxPORT_COCOA    = 1 << 8,       // wxCocoa, using Cocoa NextStep/Mac API
+    wxPORT_WINCE    = 1 << 9,       // wxWinCE, toolkit is WinCE SDK API
+    wxPORT_PALMOS   = 1 << 10       // wxPalmOS, toolkit is PalmOS API
+};
+
+// architecture of the operating system
+// (regardless of the build environment of wxWidgets library - see
+// wxIsPlatform64bit documentation for more info)
+enum wxArchitecture
+{
+    wxARCH_INVALID = -1,        // returned on error
+
+    wxARCH_32,                  // 32 bit
+    wxARCH_64,
+
+    wxARCH_MAX
+};
+
+
+// endian-ness of the machine
+enum wxEndianness
+{
+    wxENDIAN_INVALID = -1,      // returned on error
+
+    wxENDIAN_BIG,               // 4321
+    wxENDIAN_LITTLE,            // 1234
+    wxENDIAN_PDP,               // 3412
+
+    wxENDIAN_MAX
+};
+
+// Information about the toolkit that the app is running under and some basic
+// platform and architecture info
+
+%rename(PlatformInformation) wxPlatformInfo; // wxPython already has a wx.PlatformInfo
+
+class  wxPlatformInfo
+{
+public:
+    wxPlatformInfo();
+//     wxPlatformInfo(wxPortId pid,
+//                    int tkMajor = -1, int tkMinor = -1,
+//                    wxOperatingSystemId id = wxOS_UNKNOWN,
+//                    int osMajor = -1, int osMinor = -1,
+//                    wxArchitecture arch = wxARCH_INVALID,
+//                    wxEndianness endian = wxENDIAN_INVALID,
+//                    bool usingUniversal = false);
+
+    // default copy ctor, assignment operator and dtor are ok
+
+    bool operator==(const wxPlatformInfo &t) const;
+
+    bool operator!=(const wxPlatformInfo &t) const;
+
+
+//     // string -> enum conversions
+//     // ---------------------------------
+
+//     static wxOperatingSystemId GetOperatingSystemId(const wxString &name);
+//     static wxPortId GetPortId(const wxString &portname);
+
+//     static wxArchitecture GetArch(const wxString &arch);
+//     static wxEndianness GetEndianness(const wxString &end);
+
+//     // enum -> string conversions
+//     // ---------------------------------
+
+//     static wxString GetOperatingSystemFamilyName(wxOperatingSystemId os);
+//     static wxString GetOperatingSystemIdName(wxOperatingSystemId os);
+//     static wxString GetPortIdName(wxPortId port, bool usingUniversal);
+//     static wxString GetPortIdShortName(wxPortId port, bool usingUniversal);
+
+//     static wxString GetArchName(wxArchitecture arch);
+//     static wxString GetEndiannessName(wxEndianness end);
+
+    // getters
+    // -----------------
+
+    int GetOSMajorVersion() const;
+    int GetOSMinorVersion() const;
+
+    int GetToolkitMajorVersion() const;
+    int GetToolkitMinorVersion() const;
+
+    bool IsUsingUniversalWidgets() const;
+
+    wxOperatingSystemId GetOperatingSystemId() const;
+    wxPortId GetPortId() const;
+    wxArchitecture GetArchitecture() const;
+    wxEndianness GetEndianness() const;
+
+
+    // string getters
+    // -----------------
+
+    wxString GetOperatingSystemFamilyName() const;
+    wxString GetOperatingSystemIdName() const;
+    wxString GetPortIdName() const;
+    wxString GetPortIdShortName() const;
+    wxString GetArchName() const;
+    wxString GetEndiannessName() const;
+
+    // setters
+    // -----------------
+
+    void SetOSVersion(int major, int minor);
+    void SetToolkitVersion(int major, int minor);
+
+    void SetOperatingSystemId(wxOperatingSystemId n);
+    void SetPortId(wxPortId n);
+    void SetArchitecture(wxArchitecture n);
+    void SetEndianness(wxEndianness n);
+
+    // miscellaneous
+    // -----------------
+
+    bool IsOk() const;
+};
+
+
+//---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 // Experimental...