return best;
}
-/* Portability macros */
-
-#ifdef HAVE_NTGUI
-
-#define Free_Pixmap(display, pixmap) \
- DeleteObject (pixmap)
-
-#elif defined (HAVE_NS)
-
-#define Free_Pixmap(display, pixmap) \
- ns_release_object (pixmap)
-
-#else
-
-#define Free_Pixmap(display, pixmap) \
- XFreePixmap (display, pixmap)
-
-#endif /* !HAVE_NTGUI && !HAVE_NS */
-
-
/* Return the `background' field of IMG. If IMG doesn't have one yet,
it is guessed heuristically. If non-zero, XIMG is an existing
XImage object (or device context with the image selected on W32) to
{
if (img->pixmap)
{
- Free_Pixmap (FRAME_X_DISPLAY (f), img->pixmap);
+ FRAME_TERMINAL (f)->free_pixmap (f, img->pixmap);
img->pixmap = NO_PIXMAP;
/* NOTE (HAVE_NS): background color is NOT an indexed color! */
img->background_valid = 0;
{
if (img->mask)
{
- Free_Pixmap (FRAME_X_DISPLAY (f), img->mask);
+ FRAME_TERMINAL (f)->free_pixmap (f, img->mask);
img->mask = NO_PIXMAP;
img->background_transparent_valid = 0;
}
extern struct tty_display_info the_only_display_info;
extern struct tty_output the_only_tty_output;
-#define FRAME_X_DISPLAY(f) ((Display *) 0)
#define FRAME_FONT(f) ((f)->output_data.tty->font)
#define FRAME_DISPLAY_INFO(f) (&the_only_display_info)
typedef void * Color;
#endif
typedef int Window;
-typedef int Display;
/* Some sort of attempt to normalize rectangle handling. Seems a bit
#define FRAME_NS_WINDOW(f) ((f)->output_data.ns->window_desc)
#define FRAME_NATIVE_WINDOW(f) FRAME_NS_WINDOW (f)
-/* This is the `Display *' which frame F is on. */
-#define FRAME_NS_DISPLAY(f) (0)
-#define FRAME_X_DISPLAY(f) (0)
-#define FRAME_X_SCREEN(f) (0)
-#define FRAME_X_VISUAL(f) FRAME_DISPLAY_INFO(f)->visual
-
#define FRAME_FOREGROUND_COLOR(f) ((f)->output_data.ns->foreground_color)
#define FRAME_BACKGROUND_COLOR(f) ((f)->output_data.ns->background_color)
/* Clear the mouse-moved flag for every frame on this display. */
FOR_EACH_FRAME (tail, frame)
- if (FRAME_NS_P (XFRAME (frame))
- && FRAME_NS_DISPLAY (XFRAME (frame)) == FRAME_NS_DISPLAY (*fp))
+ if (FRAME_NS_P (XFRAME (frame)))
XFRAME (frame)->mouse_moved = 0;
dpyinfo->last_mouse_scroll_bar = nil;
[eview updateFrameSize: NO];
}
+/* ==========================================================================
+
+ Image Hooks
+
+ ========================================================================== */
+
+static void
+ns_free_pixmap (struct frame *_f, Pixmap pixmap)
+{
+ ns_release_object (pixmap);
+}
+
/* ==========================================================================
Initialization
terminal->redeem_scroll_bar_hook = ns_redeem_scroll_bar;
terminal->judge_scroll_bars_hook = ns_judge_scroll_bars;
terminal->get_string_resource_hook = ns_get_string_resource;
+ terminal->free_pixmap = ns_free_pixmap;
terminal->delete_frame_hook = ns_destroy_window;
terminal->delete_terminal_hook = ns_delete_terminal;
/* Other hooks are NULL by default. */
const char *name,
const char *class);
\f
+ /* Image hooks */
+#ifdef HAVE_WINDOW_SYSTEM
+ /* Free the pixmap PIXMAP on F. */
+ void (*free_pixmap) (struct frame *f, Pixmap pixmap);
+
+#endif
+\f
+ /* Deletion hooks */
+
/* Called to delete the device-specific portions of a frame that is
on this terminal device. */
void (*delete_frame_hook) (struct frame *);
leave_crit ();
}
+\f
/***********************************************************************
Fonts
***********************************************************************/
unblock_input ();
}
+\f
+/***********************************************************************
+ Image Hooks
+ ***********************************************************************/
+
+static void
+w32_free_pixmap (struct frame *_f, Pixmap pixmap)
+{
+ DeleteObject (pixmap);
+}
+
+\f
/***********************************************************************
Initialization
***********************************************************************/
terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar;
terminal->judge_scroll_bars_hook = w32_judge_scroll_bars;
terminal->get_string_resource_hook = w32_get_string_resource;
+ terminal->free_pixmap = w32_free_pixmap;
terminal->delete_frame_hook = w32_destroy_window;
terminal->delete_terminal_hook = w32_delete_terminal;
/* Other hooks are NULL by default. */
/* This gives the w32_display_info structure for the display F is on. */
#define FRAME_DISPLAY_INFO(f) ((void) (f), (&one_w32_display_info))
-/* This is the `Display *' which frame F is on. */
-#define FRAME_X_DISPLAY(f) (0)
-
#define FRAME_NORMAL_PLACEMENT(F) ((F)->output_data.w32->normal_placement)
#define FRAME_PREV_FSMODE(F) ((F)->output_data.w32->prev_fsmode)
#endif /* GLYPH_DEBUG */
+\f
+/***********************************************************************
+ Image Hooks
+ ***********************************************************************/
+
+static void
+x_free_pixmap (struct frame *f, Pixmap pixmap)
+{
+ XFreePixmap (FRAME_X_DISPLAY (f), pixmap);
+}
+
\f
/***********************************************************************
Initialization
terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar;
terminal->judge_scroll_bars_hook = XTjudge_scroll_bars;
terminal->get_string_resource_hook = x_get_string_resource;
+ terminal->free_pixmap = x_free_pixmap;
terminal->delete_frame_hook = x_destroy_window;
terminal->delete_terminal_hook = x_delete_terminal;
/* Other hooks are NULL by default. */