]> code.delx.au - gnu-emacs/blobdiff - src/macgui.h
(set-display-table-and-terminal-coding-system):
[gnu-emacs] / src / macgui.h
index a6ad18fddcffe1eccf5c881dc7308163fadfabe1..e04cf448b4a2e3cb93bf3bc22cb547d7dd638bde 100644 (file)
@@ -28,6 +28,8 @@ typedef int Bitmap;
 
 typedef int Display;  /* fix later */
 
+typedef char * XrmDatabase;  /* fix later */
+
 typedef unsigned long Time;
 
 #if MAC_OSX
@@ -97,6 +99,22 @@ struct MacFontStruct {
 typedef struct MacFontStruct MacFontStruct;
 typedef struct MacFontStruct XFontStruct;
 
+/* Structure borrowed from Xlib.h to represent two-byte characters.  */
+
+typedef struct {
+  unsigned char byte1;
+  unsigned char byte2;
+} XChar2b;
+
+#define STORE_XCHAR2B(chp, b1, b2) \
+  ((chp)->byte1 = (b1), (chp)->byte2 = (b2))
+
+#define XCHAR2B_BYTE1(chp) \
+  ((chp)->byte1)
+
+#define XCHAR2B_BYTE2(chp) \
+  ((chp)->byte2)
+
 
 /* Emulate X GC's by keeping color and font info in a structure.  */
 typedef struct _XGCValues
@@ -153,5 +171,30 @@ XCreateGC (void *, Window, unsigned long, XGCValues *);
 
 extern int XParseGeometry ();
 
+typedef struct {
+    int x, y;
+    unsigned width, height;
+} XRectangle;
+
+#define NativeRectangle Rect
+
+#define CONVERT_TO_XRECT(xr,nr)                        \
+  ((xr).x = (nr).left,                         \
+   (xr).y = (nr).top,                          \
+   (xr).width = ((nr).right - (nr).left),      \
+   (xr).height = ((nr).bottom - (nr).top))
+
+#define CONVERT_FROM_XRECT(xr,nr)              \
+  ((nr).left = (xr).x,                         \
+   (nr).top = (xr).y,                          \
+   (nr).right = ((xr).x + (xr).width),         \
+   (nr).bottom = ((xr).y + (xr).height))
+
+#define STORE_NATIVE_RECT(nr,x,y,width,height) \
+  ((nr).left = (x),                            \
+   (nr).top = (y),                             \
+   (nr).right = ((nr).left + (width)),         \
+   (nr).bottom = ((nr).top + (height)))
+
 #endif /* EMACS_MACGUI_H */