* lisp.h (struct Lisp_Symbol): Replace field "name" with a lisp
[bpt/emacs.git] / src / macgui.h
CommitLineData
1a578e9b 1/* Definitions and headers for communication on the Mac OS.
e0f712ba 2 Copyright (C) 2000, 2001 Free Software Foundation, Inc.
1a578e9b
AC
3
4This file is part of GNU Emacs.
5
6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Emacs; see the file COPYING. If not, write to
18the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
20
e0f712ba 21/* Contributed by Andrew Choi (akochoi@mac.com). */
1a578e9b
AC
22
23#ifndef EMACS_MACGUI_H
24#define EMACS_MACGUI_H
25
1a578e9b
AC
26typedef int Pixmap;
27typedef int Bitmap;
28
29typedef int Display; /* fix later */
30
31typedef unsigned long Time;
e0f712ba
AC
32
33#if MAC_OSX
34typedef struct OpaqueWindowPtr* Window;
35#else
36#include <QuickDraw.h>
1a578e9b 37typedef WindowPtr Window;
e0f712ba 38#endif
1a578e9b
AC
39
40#define FACE_DEFAULT (~0)
41
42
43/* Emulate XCharStruct. */
44typedef struct _XCharStruct
45{
46 int rbearing;
47 int lbearing;
48 int width;
49 int ascent;
50 int descent;
51} XCharStruct;
52
53struct MacFontStruct {
54 char *fontname;
55
e0f712ba 56 short mac_fontnum; /* font number of font used in this window */
1a578e9b 57 int mac_fontsize; /* size of font */
e0f712ba 58 short mac_fontface; /* plain, bold, italics, etc. */
1a578e9b
AC
59 short mac_scriptcode; /* Mac OS script code for font used */
60
61#if 0
62 SInt16 mFontNum; /* font number of font used in this window */
63 short mScriptCode; /* Mac OS script code for font used */
64 int mFontSize; /* size of font */
65 Style mFontFace; /* plain, bold, italics, etc. */
66 int mHeight; /* height of one line of text in pixels */
67 int mWidth; /* width of one character in pixels */
68 int mAscent;
69 int mDescent;
70 int mLeading;
71 char mTwoByte; /* true for two-byte font */
e0f712ba 72#endif /* 0 */
1a578e9b
AC
73
74/* from Xlib.h */
75#if 0
76 XExtData *ext_data; /* hook for extension to hang data */
77 Font fid; /* Font id for this font */
78 unsigned direction; /* hint about the direction font is painted */
e0f712ba 79#endif /* 0 */
1a578e9b
AC
80 unsigned min_char_or_byte2;/* first character */
81 unsigned max_char_or_byte2;/* last character */
82 unsigned min_byte1; /* first row that exists */
83 unsigned max_byte1; /* last row that exists */
84#if 0
85 Bool all_chars_exist; /* flag if all characters have nonzero size */
86 unsigned default_char; /* char to print for undefined character */
87 int n_properties; /* how many properties there are */
88 XFontProp *properties; /* pointer to array of additional properties */
e0f712ba 89#endif /* 0 */
1a578e9b
AC
90 XCharStruct min_bounds; /* minimum bounds over all existing char */
91 XCharStruct max_bounds; /* maximum bounds over all existing char */
92 XCharStruct *per_char; /* first_char to last_char information */
93 int ascent; /* logical extent above baseline for spacing */
94 int descent; /* logical decent below baseline for spacing */
95};
96
97typedef struct MacFontStruct MacFontStruct;
98typedef struct MacFontStruct XFontStruct;
99
100
101/* Emulate X GC's by keeping color and font info in a structure. */
102typedef struct _XGCValues
103{
104 unsigned long foreground;
105 unsigned long background;
106 XFontStruct *font;
107} XGCValues;
108
109typedef XGCValues *GC;
110
111extern XGCValues *
112XCreateGC (void *, Window, unsigned long, XGCValues *);
113
114#define GCForeground 0x01
115#define GCBackground 0x02
116#define GCFont 0x03
117#define GCGraphicsExposures 0
118
119/* Bit Gravity */
120
121#define ForgetGravity 0
122#define NorthWestGravity 1
123#define NorthGravity 2
124#define NorthEastGravity 3
125#define WestGravity 4
126#define CenterGravity 5
127#define EastGravity 6
128#define SouthWestGravity 7
129#define SouthGravity 8
130#define SouthEastGravity 9
131#define StaticGravity 10
132
133#define NoValue 0x0000
134#define XValue 0x0001
135#define YValue 0x0002
136#define WidthValue 0x0004
137#define HeightValue 0x0008
138#define AllValues 0x000F
139#define XNegative 0x0010
140#define YNegative 0x0020
141
142#define USPosition (1L << 0) /* user specified x, y */
143#define USSize (1L << 1) /* user specified width, height */
144
145#define PPosition (1L << 2) /* program specified position */
146#define PSize (1L << 3) /* program specified size */
147#define PMinSize (1L << 4) /* program specified minimum size */
148#define PMaxSize (1L << 5) /* program specified maximum size */
149#define PResizeInc (1L << 6) /* program specified resize increments */
150#define PAspect (1L << 7) /* program specified min and max aspect ratios */
151#define PBaseSize (1L << 8) /* program specified base for incrementing */
152#define PWinGravity (1L << 9) /* program specified window gravity */
153
154extern int XParseGeometry ();
155
156#endif /* EMACS_MACGUI_H */
157