X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/5009803bda518652cc6f4b9fba02c0aed185c2a3..713bfeaab314f4ae943a19205d7db71cb3e70745:/src/emacsgtkfixed.c diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index 0b57e2cdf3..6a8c751e30 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c @@ -1,7 +1,7 @@ -/* A Gtk Widget that inherits GtkFixed, but can be shrinked. +/* A Gtk Widget that inherits GtkFixed, but can be shrunk. This file is only use when compiling with Gtk+ 3. -Copyright (C) 2011 Free Software Foundation, Inc. +Copyright (C) 2011-2013 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -21,13 +21,39 @@ along with GNU Emacs. If not, see . */ #include #include "emacsgtkfixed.h" -#include #include -#include + #include "lisp.h" #include "frame.h" #include "xterm.h" +/* Silence a bogus diagnostic; see GNOME bug 683906. */ +#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#endif + +#define EMACS_TYPE_FIXED emacs_fixed_get_type () +#define EMACS_FIXED(obj) \ + G_TYPE_CHECK_INSTANCE_CAST (obj, EMACS_TYPE_FIXED, EmacsFixed) + +typedef struct _EmacsFixed EmacsFixed; +typedef struct _EmacsFixedPrivate EmacsFixedPrivate; +typedef struct _EmacsFixedClass EmacsFixedClass; + +struct _EmacsFixed +{ + GtkFixed container; + + /*< private >*/ + EmacsFixedPrivate *priv; +}; + +struct _EmacsFixedClass +{ + GtkFixedClass parent_class; +}; + struct _EmacsFixedPrivate { struct frame *f; @@ -40,28 +66,21 @@ static void emacs_fixed_get_preferred_width (GtkWidget *widget, static void emacs_fixed_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural); +static GType emacs_fixed_get_type (void); G_DEFINE_TYPE (EmacsFixed, emacs_fixed, GTK_TYPE_FIXED) static void emacs_fixed_class_init (EmacsFixedClass *klass) { GtkWidgetClass *widget_class; - GtkFixedClass *fixed_class; widget_class = (GtkWidgetClass*) klass; - fixed_class = (GtkFixedClass*) klass; widget_class->get_preferred_width = emacs_fixed_get_preferred_width; widget_class->get_preferred_height = emacs_fixed_get_preferred_height; g_type_class_add_private (klass, sizeof (EmacsFixedPrivate)); } -static GType -emacs_fixed_child_type (GtkFixed *container) -{ - return GTK_TYPE_WIDGET; -} - static void emacs_fixed_init (EmacsFixed *fixed) { @@ -116,10 +135,10 @@ emacs_fixed_get_preferred_height (GtkWidget *widget, (Bug#8919), and so users can resize our frames as they wish. */ void -XSetWMSizeHints(Display* d, - Window w, - XSizeHints* hints, - Atom prop) +XSetWMSizeHints (Display* d, + Window w, + XSizeHints* hints, + Atom prop) { struct x_display_info *dpyinfo = x_display_info_for_display (d); struct frame *f = x_top_window_to_frame (dpyinfo, w); @@ -158,7 +177,7 @@ XSetWMSizeHints(Display* d, /* Override this X11 function. This function is in the same X11 file as the one above. So we must provide it also. */ - + void XSetWMNormalHints (Display *d, Window w, XSizeHints *hints) {