#include <config.h>
-#if defined(USE_GTK)
+#ifdef USE_GTK
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include "coding.h"
#ifndef PGTK_TRACE
#define PGTK_TRACE(fmt, ...) ((void) 0)
-#define PGTK_BACKTRACE() ((void) 0)
#endif
#include <gdk/gdkkeysyms.h>
static GdkPixbuf *
xg_get_pixbuf_from_pix_and_mask (struct frame *f,
- Emacs_Pixmap pix,
- Emacs_Pixmap mask)
+ Pixmap pix,
+ Pixmap mask)
{
GdkPixbuf *icon_buf = 0;
int iunused;
Window wunused;
unsigned int width, height, depth, uunused;
-#ifndef HAVE_PGTK
if (FRAME_DISPLAY_INFO (f)->red_bits != 8)
return 0;
-
XGetGeometry (FRAME_X_DISPLAY (f), pix, &wunused, &iunused, &iunused,
&width, &height, &uunused, &depth);
if (depth != 24)
XDestroyImage (xmm);
XDestroyImage (xim);
}
-#else
- width = pix->width;
- height = pix->height;
- depth = pix->bits_per_pixel;
-
- icon_buf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height);
-
-
-#endif
return icon_buf;
}
-
-
#if defined USE_CAIRO && !defined HAVE_GTK3
static GdkPixbuf *
xg_get_pixbuf_from_surface (cairo_surface_t *surface)
bool
xg_hide_tooltip (struct frame *f)
{
- bool ret = 0;
if (f->output_data.xp->ttip_window)
{
GtkWindow *win = f->output_data.xp->ttip_window;
}
else
adjust_frame_size (f, width, height, 5, 0, Qxg_frame_set_char_size);
+
}
-#ifndef HAVE_PGTK
/* Handle height/width changes (i.e. add/remove/move menu/toolbar).
The policy is to keep the number of editable lines. */
+#if 0
static void
xg_height_or_width_changed (struct frame *f)
{
else
wtop = gtk_window_new (type);
#else
- if (!NILP(f->parent_frame)){
+ if (!NILP(f->parent_frame)) {
type = GTK_WINDOW_POPUP;
}
wtop = gtk_window_new (type);
#endif
| GDK_VISIBILITY_NOTIFY_MASK);
+#ifndef HAVE_PGTK
/* Must realize the windows so the X window gets created. It is used
by callers of this function. */
-#ifndef HAVE_PGTK
gtk_widget_realize (wfixed);
-#else
- // gtk_widget_show_all(wtop);
-#endif
-#ifndef HAVE_PGTK
FRAME_X_WINDOW (f) = GTK_WIDGET_TO_X_WIN (wfixed);
-#endif
-#ifndef HAVE_PGTK
initial_set_up_x_back_buffer (f);
#endif
gtk_widget_modify_style (wfixed, style);
#else
gtk_widget_set_can_focus (wfixed, TRUE);
+#ifdef HAVE_PGTK
gtk_widget_grab_focus(wfixed);
+#endif
gtk_window_set_resizable (GTK_WINDOW (wtop), TRUE);
#endif
{
block_input ();
gtk_window_set_geometry_hints (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
- NULL, &size_hints, hint_flags);
+ NULL, &size_hints, hint_flags);
f->output_data.xp->size_hints = size_hints;
f->output_data.xp->hint_flags = hint_flags;
unblock_input ();
#ifndef HAVE_PGTK
bool
-xg_event_is_for_menubar (struct frame *f, const EVENT *event)
+xg_event_is_for_menubar (struct frame *f, const XEvent *event)
{
- xp_output *x = f->output_data.xp;
+ struct x_output *x = f->output_data.x;
GList *iter;
GdkRectangle rec;
GList *list;
}
-#ifndef HAVE_GTK3
/* This callback is called when a tool bar item shall be redrawn.
It modifies the expose event so that the GtkImage widget redraws the
whole image. This to overcome a bug that makes GtkImage draw the image
Returns FALSE to tell GTK to keep processing this event. */
+#ifndef HAVE_GTK3
static gboolean
xg_tool_bar_item_expose_callback (GtkWidget *w,
GdkEventExpose *event,
update_frame_tool_bar (struct frame *f)
{
int i, j;
-#ifndef HAVE_PGTK
- struct x_output *x = f->output_data.xp;
-#else
- struct pgtk_output *x = f->output_data.pgtk;
-#endif
+ xp_output *x = f->output_data.xp;
int hmargin = 0, vmargin = 0;
GtkToolbar *wtoolbar;
GtkToolItem *ti;
#define PGTK_BACKTRACE() ((void) 0)
#endif
-/* The GtkTooltip API came in 2.12, but gtk-enable-tooltips in 2.14. */
-#if GTK_CHECK_VERSION (2, 14, 0)
-#define USE_GTK_TOOLTIP
-#endif
-
/* could use list to store these, but rest of emacs has a big infrastructure
for managing a table of bitmap "records" */
struct pgtk_bitmap_record
bool_bf toolbar_in_hbox : 1;
bool_bf toolbar_is_packed : 1;
-#ifdef USE_GTK_TOOLTIP
GtkTooltip *ttip_widget;
GtkWidget *ttip_lbl;
GtkWindow *ttip_window;
-#endif /* USE_GTK_TOOLTIP */
/* Height of menu bar widget, in pixels. This value
is not meaningful if the menubar is turned off. */