summaryrefslogtreecommitdiff
path: root/src/emacsgtkfixed.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-02-01 11:39:36 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-02-01 11:45:15 -0800
commit241260cc2819e5df254ad85953588b06388ade61 (patch)
tree3b0099a54471738d76567ff650466a14cd3de954 /src/emacsgtkfixed.c
parent1d1162479caf1fdf48564f1486fa84e3cdacaa9b (diff)
downloademacs-241260cc2819e5df254ad85953588b06388ade61.tar.gz
Revert changes installed by xwidgets merge
Diffstat (limited to 'src/emacsgtkfixed.c')
-rw-r--r--src/emacsgtkfixed.c119
1 files changed, 14 insertions, 105 deletions
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index d52a1399bac..abec78fb073 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -23,9 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "lisp.h"
#include "frame.h"
#include "xterm.h"
-#ifdef HAVE_XWIDGETS
-#include "xwidget.h"
-#endif
#include "emacsgtkfixed.h"
/* Silence a bogus diagnostic; see GNOME bug 683906. */
@@ -34,26 +31,26 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
# 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) */
+#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; */
+struct _EmacsFixed
+{
+ GtkFixed container;
-/* /\*< private >*\/ */
-/* EmacsFixedPrivate *priv; */
-/* }; */
+ /*< private >*/
+ EmacsFixedPrivate *priv;
+};
-/* struct _EmacsFixedClass */
-/* { */
-/* GtkFixedClass parent_class; */
-/* }; */
+struct _EmacsFixedClass
+{
+ GtkFixedClass parent_class;
+};
struct _EmacsFixedPrivate
{
@@ -67,109 +64,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)
-#ifdef HAVE_XWIDGETS
-
-struct GtkFixedPrivateL
-{
- GList *children;
-};
-
-static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation){
- //for xwidgets
-
- //TODO 1st call base class method
- EmacsFixedClass *klass;
- GtkWidgetClass *parent_class;
- struct GtkFixedPrivateL* priv;
- GtkFixedChild *child;
- GtkAllocation child_allocation;
- GtkRequisition child_requisition;
- GList *children;
- struct xwidget_view* xv;
-
- klass = EMACS_FIXED_GET_CLASS (widget);
- parent_class = g_type_class_peek_parent (klass);
- parent_class->size_allocate (widget, allocation);
-
- priv = G_TYPE_INSTANCE_GET_PRIVATE (widget,
- GTK_TYPE_FIXED,
- struct GtkFixedPrivateL);
-
- gtk_widget_set_allocation (widget, allocation);
-
- if (gtk_widget_get_has_window (widget))
- {
- if (gtk_widget_get_realized (widget))
- gdk_window_move_resize (gtk_widget_get_window (widget),
- allocation->x,
- allocation->y,
- allocation->width,
- allocation->height);
- }
-
- for (children = priv->children;
- children;
- children = children->next)
- {
- child = children->data;
-
- if (!gtk_widget_get_visible (child->widget))
- continue;
-
- gtk_widget_get_preferred_size (child->widget, &child_requisition, NULL);
- child_allocation.x = child->x;
- child_allocation.y = child->y;
-
- if (!gtk_widget_get_has_window (widget))
- {
- child_allocation.x += allocation->x;
- child_allocation.y += allocation->y;
- }
-
- child_allocation.width = child_requisition.width;
- child_allocation.height = child_requisition.height;
-
-
-
- xv = (struct xwidget_view*) g_object_get_data (G_OBJECT (child->widget), XG_XWIDGET_VIEW);
- if(xv){
- child_allocation.width = xv->clip_right;
- child_allocation.height = xv->clip_bottom - xv->clip_top;
- }
- gtk_widget_size_allocate (child->widget, &child_allocation);
-
- }
-
-}
-
-#endif /* HAVE_XWIDGETS */
-
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;
-#ifdef HAVE_XWIDGETS
- widget_class->size_allocate = emacs_fixed_gtk_widget_size_allocate;
-#endif
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)
{