InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
WSysType.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: ?
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __WSYSTYPE__
25 #define __WSYSTYPE__
26 
27 
28 //======================================================================
29 // Isolate windowing system (QuickDraw vs. Windows)
30 //======================================================================
31 
32 #ifndef __MWERKS__
33  #include "BaseType.h"
34 #endif
35 
36 #define ON_WIN_USE_GDIPLUS_COORDS 1
37 
38  //======================================================================
39  // Isolate windowing system Mac OS (QuickDraw or Core Graphics) vs. Windows (GDI or GDI+)
40  //======================================================================
41 
42 #ifdef ON_WIN_USE_GDIPLUS_COORDS
43 #else
44 #endif
45 
46  // typedef FIXED SysFixed;
47  typedef RECT GDIRect;
48  typedef POINT GDIPoint;
49  typedef SIZE GDISize;
50 
51  typedef GDIRect SysRect;
52  typedef GDIRect GSysRect; // SysRect in "Global" screen or device coordinates
53  typedef GDIRect WSysRect; // SysRect in "Window" coordinates
54  typedef GDIRect Int32Rect; // Use in cases where coords must be integral. Bitmap bounds, image internal (pixel) bounds, etc.
55  typedef GDIPoint SysPoint;
56  typedef GDIPoint GSysPoint; // "Global" SysPoint
57  typedef GDIPoint WSysPoint; // "Window" SysPoint (result of GlobalToLocal)
58  typedef int32 SysCoord;
59  typedef SysCoord GSysCoord; // "Global" coordinate
60  typedef SysCoord WSysCoord; // "Window" coordinate
61 #ifdef _UNICODE
62  //typedef textchar SysChar; // character code used by platform (UNICODE)
63  typedef TCHAR SysChar; // character code used by platform (UNICODE)
64 #else
65  typedef unsigned char SysChar; // character code used by platform (ASCII+)
66 #endif
67  typedef uint16 SysKeyCode; // code for key on keyboard
68  typedef HWND SysWindow;
69  typedef HWND SysControl;
70  typedef HWND SysDialog;
71  typedef HRGN SysRgn;
72  typedef HRGN SysWireframe;
73  typedef HDC SysPort;
74  typedef MSG* SysEvent;
75  typedef HANDLE SysHandle;
76  typedef int16 MenuID;
77  typedef uint32 UserError;
78  typedef int32 CursorID;
79  typedef struct RGBColor{ //copied from MAC
80  unsigned short red;
81  unsigned short green;
82  unsigned short blue;
83  }RGBColor;
84 
85  typedef int32 Fixed;
86 
87  typedef HANDLE ThreadID;
88 
89  typedef uint32 OSType;
90 
91  typedef uint32 RsrcType;
92  typedef uint32 RsrcID;
93 
94  struct FileInfo {
95  OSType creator;
96  OSType type;
97  };
98 
99  typedef DWORD PlatformError;
100 
101 typedef struct FileInfo SysFileInfo;
102 
103 typedef HDC SysBitmap;
104 typedef SysBitmap SysBitmap_NEW;
105 typedef SysPort SysPort_NEW;
106 
107 
108 typedef int32 SysSocket;
109 
110 typedef HINSTANCE SysConnection;
111  // Connection information for loading & unloading DLLs
112 
113 struct SysSize : GDISize {
114  SysSize(SysCoord h, SysCoord w ) {cx = h; cy = w;}
115  SysSize(const GDIPoint& pt) {cx = pt.x; cy = pt.y;}
116  SysSize(const GDISize& sz) {cx = sz.cx; cy = sz.cy;}
117  SysSize() {cx = 0; cy = 0;}
118  SysSize& operator=(const SysPoint& pt) {cx = pt.x; cy = pt.y; return *this;}
119  SysSize& operator=(const GDISize& sz) {cx = sz.cx; cy = sz.cy; return *this;}
120 
121  operator const GDISize & () const { return *this; }
122 };
123 
124 
125 #define kDefaultFPUExceptions _CW_DEFAULT
126  // Default exceptions are Windows default for now. In the future we
127  // may want to turn off exception handling for certain floating point
128  // errors so we know when they happen. If so, change _CW_DEFAULT to
129  // something else (see Windows documention for _controlfp)
130 
131 #endif // __WSYSTYPE__