]> code.delx.au - gnu-emacs/blobdiff - src/macterm.h
2005-09-11 Chris Prince <cprince@gmail.com> (tiny change)
[gnu-emacs] / src / macterm.h
index 17b8a0fb298777c8d55e61d57264c4520c24d2ee..b3855f142c698506ed428c6713254ce8e57212b0 100644 (file)
@@ -1,5 +1,6 @@
 /* Display module for Mac OS.
-   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004,
+                 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -15,8 +16,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 /* Contributed by Andrew Choi (akochoi@mac.com).  */
 
@@ -38,11 +39,6 @@ Boston, MA 02111-1307, USA.  */
 #define BLACK_PIX_DEFAULT(f) RGB_TO_ULONG(0,0,0)
 #define WHITE_PIX_DEFAULT(f) RGB_TO_ULONG(255,255,255)
 
-/* A black pixel in a mask bitmap/pixmap means ``draw a source
-   pixel''.  A white pixel means ``retain the current pixel''. */
-#define PIX_MASK_DRAW(f) BLACK_PIX_DEFAULT(f)
-#define PIX_MASK_RETAIN(f) WHITE_PIX_DEFAULT(f)
-
 #define FONT_WIDTH(f)   ((f)->max_bounds.width)
 #define FONT_HEIGHT(f)  ((f)->ascent + (f)->descent)
 #define FONT_BASE(f)    ((f)->ascent)
@@ -56,6 +52,7 @@ Boston, MA 02111-1307, USA.  */
 struct mac_bitmap_record
 {
   char *bitmap_data;
+  char *file;
   int refcount;
   int height, width;
 };
@@ -148,7 +145,7 @@ struct mac_display_info
   int smallest_font_height;
 
   /* Reusable Graphics Context for drawing a cursor in a non-default face. */
-  XGCValues *scratch_cursor_gc;
+  GC scratch_cursor_gc;
 
   /* These variables describe the range of text currently shown in its
      mouse-face, together with the window they apply to. As long as
@@ -194,14 +191,14 @@ struct mac_display_info
   int bitmaps_last;
 
   /* The frame (if any) which has the window that has keyboard focus.
-     Zero if none.  This is examined by Ffocus_frame in w32fns.c.  Note
+     Zero if none.  This is examined by Ffocus_frame in macfns.c.  Note
      that a mere EnterNotify event can set this; if you need to know the
      last frame specified in a FocusIn or FocusOut event, use
-     w32_focus_event_frame.  */
+     x_focus_event_frame.  */
   struct frame *x_focus_frame;
 
   /* The last frame mentioned in a FocusIn or FocusOut event.  This is
-     separate from w32_focus_frame, because whether or not LeaveNotify
+     separate from x_focus_frame, because whether or not LeaveNotify
      events cause us to lose focus depends on whether or not we have
      received a FocusIn event for it.  */
   struct frame *x_focus_event_frame;
@@ -209,7 +206,7 @@ struct mac_display_info
   /* The frame which currently has the visual highlight, and should get
      keyboard input (other sorts of input have the frame encoded in the
      event).  It points to the focus frame's selected window's
-     frame.  It differs from w32_focus_frame when we're using a global
+     frame.  It differs from x_focus_frame when we're using a global
      minibuffer.  */
   struct frame *x_highlight_frame;
 
@@ -217,6 +214,9 @@ struct mac_display_info
   struct image_cache *image_cache;
 };
 
+/* This checks to make sure we have a display.  */
+extern void check_mac P_ ((void));
+
 #define x_display_info mac_display_info
 
 /* This is a chain of structures for all the X displays currently in use.  */
@@ -239,6 +239,12 @@ extern struct x_display_info *x_display_info_for_name P_ ((Lisp_Object));
 
 extern struct mac_display_info *mac_term_init ();
 
+extern Lisp_Object x_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
+extern struct font_info *x_get_font_info P_ ((struct frame *f, int));
+extern struct font_info *x_load_font P_ ((struct frame *, char *, int));
+extern struct font_info *x_query_font P_ ((struct frame *, char *));
+extern void x_find_ccl_program P_ ((struct font_info *));
+\f
 /* When Emacs uses a tty window, tty_display in frame.c points to an
    x_output struct .  */
 struct x_output
@@ -345,6 +351,12 @@ struct mac_output {
 
 #endif
 
+#if TARGET_API_MAC_CARBON
+  /* The Mac control reference for the hourglass (progress indicator)
+     shown at the upper-right corner of the window.  */
+  ControlRef hourglass_control;
+#endif
+
 #if 0
   DWORD dwStyle;
 #endif
@@ -372,7 +384,7 @@ struct mac_output {
   /* Relief GCs, colors etc.  */
   struct relief
   {
-    XGCValues *gc;
+    GC gc;
     unsigned long pixel;
     int allocated_p;
   }
@@ -381,6 +393,9 @@ struct mac_output {
   /* The background for which the above relief GCs were set up.
      They are changed only when a different background is involved.  */
   unsigned long relief_background;
+
+  /* Hints for the size and the position of a window.  */
+  XSizeHints *size_hints;
 };
 
 typedef struct mac_output mac_output;
@@ -400,7 +415,9 @@ typedef struct mac_output mac_output;
 
 #define FRAME_BASELINE_OFFSET(f) ((f)->output_data.mac->baseline_offset)
 
-/* This gives the w32_display_info structure for the display F is on.  */
+#define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints)
+
+/* This gives the mac_display_info structure for the display F is on.  */
 #define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info)
 #define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info)
 
@@ -474,6 +491,12 @@ struct scroll_bar {
      place where the user grabbed it.  If the handle isn't currently
      being dragged, this is Qnil.  */
   Lisp_Object dragging;
+
+#ifdef USE_TOOLKIT_SCROLL_BARS
+  /* The position and size of the scroll bar handle track area in
+     pixels, relative to the frame.  */
+  Lisp_Object track_top, track_height;
+#endif
 };
 
 /* The number of elements a vector holding a struct scroll_bar needs.  */
@@ -558,14 +581,73 @@ struct scroll_bar {
    text from glomming up against the scroll bar */
 #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0)
 
-
-struct frame * check_x_frame (Lisp_Object);
-
-void activate_scroll_bars (FRAME_PTR);
-void deactivate_scroll_bars (FRAME_PTR);
+/* Size of hourglass controls */
+#define HOURGLASS_WIDTH 16
+#define HOURGLASS_HEIGHT 16
+
+struct frame;
+struct face;
+struct image;
+
+Lisp_Object display_x_get_resource P_ ((struct x_display_info *,
+                                       Lisp_Object, Lisp_Object,
+                                       Lisp_Object, Lisp_Object));
+struct frame *check_x_frame P_ ((Lisp_Object));
+EXFUN (Fx_display_color_p, 1);
+EXFUN (Fx_display_grayscale_p, 1);
+EXFUN (Fx_display_planes, 1);
+extern void x_free_gcs P_ ((struct frame *));
+extern int XParseGeometry P_ ((char *, int *, int *, unsigned int *,
+                              unsigned int *));
+
+/* Defined in macterm.c.  */
+
+extern void x_set_window_size P_ ((struct frame *, int, int, int));
+extern void x_make_frame_visible P_ ((struct frame *));
+extern void mac_initialize P_ ((void));
+extern Pixmap XCreatePixmap P_ ((Display *, WindowPtr, unsigned int,
+                                unsigned int, unsigned int));
+extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowPtr, char *,
+                                              unsigned int, unsigned int,
+                                              unsigned long, unsigned long,
+                                              unsigned int));
+extern void XFreePixmap P_ ((Display *, Pixmap));
+extern GC XCreateGC P_ ((Display *, Window, unsigned long, XGCValues *));
+extern void XSetForeground P_ ((Display *, GC, unsigned long));
+extern void XSetBackground P_ ((Display *, GC, unsigned long));
+extern void XSetWindowBackground P_ ((Display *, WindowPtr, unsigned long));
+extern void mac_draw_line_to_pixmap P_ ((Display *, Pixmap, GC, int, int,
+                                        int, int));
+extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *));
+extern OSErr install_window_handler P_ ((WindowPtr));
+extern void remove_window_handler P_ ((WindowPtr));
 
 #define FONT_TYPE_FOR_UNIBYTE(font, ch) 0
 #define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0
 
+/* Defined in macselect.c */
+
+extern void x_clear_frame_selections P_ ((struct frame *));
+
+/* Defined in mac.c.  */
+
+extern OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *));
+extern OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int));
+extern void mac_clear_font_name_table P_ ((void));
+#if TARGET_API_MAC_CARBON
+extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
+extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
+extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
+extern Lisp_Object cfstring_to_lisp P_ ((CFStringRef));
+extern Lisp_Object cfnumber_to_lisp P_ ((CFNumberRef));
+extern Lisp_Object cfdate_to_lisp P_ ((CFDateRef));
+extern Lisp_Object cfboolean_to_lisp P_ ((CFBooleanRef));
+extern Lisp_Object cfobject_desc_to_lisp P_ ((CFTypeRef));
+extern Lisp_Object cfproperty_list_to_lisp P_ ((CFPropertyListRef, int, int));
+#endif
+extern void xrm_merge_string_database P_ ((XrmDatabase, char *));
+extern Lisp_Object xrm_get_resource P_ ((XrmDatabase, char *, char *));
+extern XrmDatabase xrm_get_preference_database P_ ((char *));
+
 /* arch-tag: 6b4ca125-5bef-476d-8ee8-31ed808b7e79
    (do not change this comment) */