Commit 90ba661f authored by Tristan Van Berkom's avatar Tristan Van Berkom

o integrate ui into one main window. o A GtkNotebook is used to display


	* src/glade-project-window.c:
	  o integrate ui into one main window.
	  o A GtkNotebook is used to display GladeDesignView's.

	* src/glade-project-view.[ch]: add "item-activated" signal.

	* src/glade-design-layout.[ch], src/glade-design-view.[ch]:
	  new files.

	* src/glade-widget.[ch]:
	  o Added functions for embedding toplevel GladeWidgets
	  o glade_widget_show() modified to manage embedding of
	    toplevels.
parent 3a66616b
2006-10-25 Vincent Geddes <vincent.geddes@gmail.com>
* src/glade-project-window.c:
o integrate ui into one main window.
o A GtkNotebook is used to display GladeDesignView's.
* src/glade-project-view.[ch]: add "item-activated" signal.
* src/glade-design-layout.[ch], src/glade-design-view.[ch]:
new files.
* src/glade-widget.[ch]:
o Added functions for embedding toplevel GladeWidgets
o glade_widget_show() modified to manage embedding of
toplevels.
2006-10-20 Tristan Van Berkom <tvb@gnome.org>
* configure.in: Removed the python check
......
......@@ -102,16 +102,16 @@ for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PREFIX'.
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PREFIX', the package will
use PREFIX as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
......@@ -159,7 +159,7 @@ where SYSTEM can have one of these forms:
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
......
......@@ -64,6 +64,8 @@ libgladeui_1_la_SOURCES = \
glade-palette-item.c \
glade-palette-box.c \
glade-palette-expander.c \
glade-design-layout.c \
glade-design-view.c \
glade-cursor.c \
glade-property.c \
glade-property-class.c \
......@@ -114,6 +116,8 @@ libgladeuiinclude_HEADERS = \
glade-palette-item.h \
glade-palette-box.h \
glade-palette-expander.h \
glade-design-layout.h \
glade-design-view.h \
glade-cursor.h \
glade-widget.h \
glade-widget-adaptor.h \
......
This diff is collapsed.
/*
* glade-design-layout.h
*
* Copyright (C) 2006 Vincent Geddes
*
* Authors:
* Vincent Geddes <vgeddes@metroweb.co.za>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef __GLADE_DESIGN_LAYOUT_H__
#define __GLADE_DESIGN_LAYOUT_H__
#include <gtk/gtkbin.h>
G_BEGIN_DECLS
#define GLADE_TYPE_DESIGN_LAYOUT (glade_design_layout_get_type ())
#define GLADE_DESIGN_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_DESIGN_LAYOUT, GladeDesignLayout))
#define GLADE_DESIGN_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_DESIGN_LAYOUT, GladeDesignLayoutClass))
#define GLADE_IS_DESIGN_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_DESIGN_LAYOUT))
#define GLADE_IS_DESIGN_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_DESIGN_LAYOUT))
#define GLADE_DESIGN_LAYOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GLADE_TYPE_DESIGN_LAYOUT, GladeDesignLayoutClass))
typedef struct _GladeDesignLayout GladeDesignLayout;
typedef struct _GladeDesignLayoutPrivate GladeDesignLayoutPrivate;
typedef struct _GladeDesignLayoutClass GladeDesignLayoutClass;
struct _GladeDesignLayout
{
GtkBin bin; /* The parent is an event box */
GladeDesignLayoutPrivate *priv;
};
struct _GladeDesignLayoutClass
{
GtkBinClass parent_class;
};
GType glade_design_layout_get_type (void) G_GNUC_CONST;
GtkWidget *glade_design_layout_new (void);
G_END_DECLS
#endif /* __GLADE_DESIGN_LAYOUT_H__ */
/*
* glade-design-view.c
*
* Copyright (C) 2006 Vincent Geddes
*
* Authors:
* Vincent Geddes <vincent.geddes@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANDESIGN_VIEWILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "glade.h"
#include "glade-utils.h"
#include "glade-design-view.h"
#include "glade-design-layout.h"
#include <glib.h>
#include <glib/gi18n.h>
#define GLADE_DESIGN_VIEW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GLADE_TYPE_DESIGN_VIEW, GladeDesignViewPrivate))
#define GLADE_DESIGN_VIEW_KEY "GLADE_DESIGN_VIEW_KEY"
enum
{
PROP_0,
PROP_PROJECT,
};
struct _GladeDesignViewPrivate
{
GtkWidget *layout;
GladeProject *project;
};
static GtkVBoxClass *parent_class = NULL;
G_DEFINE_TYPE(GladeDesignView, glade_design_view, GTK_TYPE_VBOX)
static void
glade_design_view_set_project (GladeDesignView *view, GladeProject *project)
{
g_return_if_fail (GLADE_IS_PROJECT (project));
view->priv->project = project;
g_object_set_data (G_OBJECT (view->priv->project), GLADE_DESIGN_VIEW_KEY, view);
}
static void
glade_design_view_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
switch (prop_id)
{
case PROP_PROJECT:
glade_design_view_set_project (GLADE_DESIGN_VIEW (object), g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
glade_design_view_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
switch (prop_id)
{
case PROP_PROJECT:
g_value_set_object (value, GLADE_DESIGN_VIEW (object)->priv->project);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
glade_design_view_init (GladeDesignView *view)
{
GtkWidget *sw;
GtkWidget *viewport;
view->priv = GLADE_DESIGN_VIEW_GET_PRIVATE (view);
view->priv->project = NULL;
view->priv->layout = glade_design_layout_new ();
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
viewport = gtk_viewport_new (NULL, NULL);
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
gtk_container_add (GTK_CONTAINER (viewport), view->priv->layout);
gtk_container_add (GTK_CONTAINER (sw), viewport);
gtk_widget_show (sw);
gtk_widget_show (viewport);
gtk_widget_show (view->priv->layout);
gtk_box_pack_start (GTK_BOX (view), sw, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (view), 0);
}
static void
glade_design_view_class_init (GladeDesignViewClass *class)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
parent_class = g_type_class_peek_parent (class);
object_class = G_OBJECT_CLASS (class);
widget_class = GTK_WIDGET_CLASS (class);
object_class->get_property = glade_design_view_get_property;
object_class->set_property = glade_design_view_set_property;
g_object_class_install_property (object_class,
PROP_PROJECT,
g_param_spec_object ("project",
"Project",
"The project for this view",
GLADE_TYPE_PROJECT,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_type_class_add_private (object_class, sizeof (GladeDesignViewPrivate));
}
GladeProject*
glade_design_view_get_project (GladeDesignView *view)
{
g_return_val_if_fail (GLADE_IS_DESIGN_VIEW (view), NULL);
return view->priv->project;
}
GtkWidget *
glade_design_view_new (GladeProject *project)
{
GladeDesignView *view;
g_return_val_if_fail (GLADE_IS_PROJECT (project), NULL);
view = g_object_new (GLADE_TYPE_DESIGN_VIEW,
"project", project,
NULL);
return GTK_WIDGET (view);
}
GladeDesignView *
glade_design_view_get_from_project (GladeProject *project)
{
gpointer p;
g_return_val_if_fail (GLADE_IS_PROJECT (project), NULL);
p = g_object_get_data (G_OBJECT (project), GLADE_DESIGN_VIEW_KEY);
return (p != NULL) ? GLADE_DESIGN_VIEW (p) : NULL;
}
GladeDesignLayout *
glade_design_view_get_layout (GladeDesignView *view)
{
return GLADE_DESIGN_LAYOUT (view->priv->layout);
}
/*
* glade-design-view.h
*
* Copyright (C) 2006 Vincent Geddes
*
* Authors:
* Vincent Geddes <vincent.geddes@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANDESIGN_VIEWILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef __GLADE_DESIGN_VIEW_H__
#define __GLADE_DESIGN_VIEW_H__
#include "glade.h"
#include "glade-project.h"
#include "glade-design-layout.h"
#include <gtk/gtkvbox.h>
G_BEGIN_DECLS
#define GLADE_TYPE_DESIGN_VIEW (glade_design_view_get_type ())
#define GLADE_DESIGN_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_DESIGN_VIEW, GladeDesignView))
#define GLADE_DESIGN_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_DESIGN_VIEW, GladeDesignViewClass))
#define GLADE_IS_DESIGN_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_DESIGN_VIEW))
#define GLADE_IS_DESIGN_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_DESIGN_VIEW))
#define GLADE_DESIGN_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GLADE_TYPE_DESIGN_VIEW, GladeDesignViewClass))
typedef struct _GladeDesignView GladeDesignView;
typedef struct _GladeDesignViewPrivate GladeDesignViewPrivate;
typedef struct _GladeDesignViewClass GladeDesignViewClass;
struct _GladeDesignView
{
GtkVBox vbox; /* The parent is a box */
GladeDesignViewPrivate *priv;
};
struct _GladeDesignViewClass
{
GtkVBoxClass parent_class;
};
GType glade_design_view_get_type (void) G_GNUC_CONST;
GtkWidget *glade_design_view_new (GladeProject *project);
GladeProject *glade_design_view_get_project (GladeDesignView *view);
GladeDesignView *glade_design_view_get_from_project (GladeProject *project);
GladeDesignLayout *glade_design_view_get_layout (GladeDesignView *view);
G_END_DECLS
#endif /* __GLADE_DESIGN_VIEW_H__ */
......@@ -37,6 +37,12 @@
#define GLADE_PROJECT_VIEW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object),\
GLADE_TYPE_PROJECT_VIEW, \
GladeProjectViewPrivate))
enum
{
ITEM_ACTIVATED,
LAST_SIGNAL
};
enum
{
......@@ -100,6 +106,7 @@ typedef struct
GList *list;
} GPVAccumPair;
static guint glade_project_view_signals[LAST_SIGNAL] = {0};
static GtkScrolledWindow *parent_class = NULL;
static void gpv_project_data_free (GPVProjectData *pdata);
......@@ -664,6 +671,24 @@ glade_project_view_class_init (GladeProjectViewClass *class)
class->remove_item = glade_project_view_remove_item;
class->widget_name_changed = glade_project_view_widget_name_changed;
class->selection_update = glade_project_view_selection_update;
/**
* GladeProjectView::item-activated:
* @view the #GladeProjectView which received the signal.
* @widget: the #GladeWidget that was activated.
*
* Emitted when a item is activated in the GtkTreeView of a GladeProjectView.
*/
glade_project_view_signals[ITEM_ACTIVATED] =
g_signal_new ("item_activated",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GladeProjectViewClass, item_activated),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE,
1,
GLADE_TYPE_WIDGET);
g_type_class_add_private (object_class, sizeof (GladeProjectViewPrivate));
}
......@@ -761,7 +786,7 @@ glade_project_view_init (GladeProjectView *view)
#endif
priv->tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (priv->model));
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->tree_view), TRUE);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (priv->tree_view), FALSE);
/* the view now holds a reference, we can get rid of our own */
g_object_unref (G_OBJECT (priv->model));
......
......@@ -32,6 +32,8 @@ struct _GladeProjectViewClass
void (*remove_item) (GladeProjectView *view,
GladeWidget *widget);
void (*widget_name_changed) (GladeProjectView *view,
GladeWidget *widget);
void (*item_activated) (GladeProjectView *view,
GladeWidget *widget);
/* Selection update is when the project changes the selection
......
This diff is collapsed.
......@@ -15,7 +15,7 @@ G_BEGIN_DECLS
typedef struct _GladeProjectWindow GladeProjectWindow;
typedef struct _GladeProjectWindowClass GladeProjectWindowClass;
typedef struct _GladeProjectWindowPriv GladeProjectWindowPriv;
typedef struct _GladeProjectWindowPrivate GladeProjectWindowPrivate;
/* A GladeProjectWindow specifies a loaded glade application.
* it contains pointers to all the components that make up
......@@ -25,7 +25,8 @@ typedef struct _GladeProjectWindowPriv GladeProjectWindowPriv;
struct _GladeProjectWindow
{
GladeApp parent;
GladeProjectWindowPriv *priv;
GladeProjectWindowPrivate *priv;
};
struct _GladeProjectWindowClass
......
......@@ -44,6 +44,8 @@
#include "glade-popup.h"
#include "glade-editor.h"
#include "glade-app.h"
#include "glade-design-view.h"
static void glade_widget_set_adaptor (GladeWidget *widget,
......@@ -61,6 +63,10 @@ static GladeWidget *glade_widget_new_from_widget_info (GladeWidgetInfo *i
GladeProject *project,
GladeWidget *parent);
static gboolean glade_window_is_embedded (GtkWindow *window);
static void glade_widget_embed (GladeWidget *widget);
static void glade_widget_embed_using_signals (GladeWidget *widget);
enum
{
ADD_SIGNAL_HANDLER,
......@@ -2173,40 +2179,36 @@ glade_widget_debug (GladeWidget *widget)
glade_widget_debug_real (widget, 0);
}
static void
glade_widget_save_coords (GladeWidget *widget)
{
if (GTK_IS_WINDOW (widget->object))
{
gtk_window_get_position (GTK_WINDOW (widget->object),
&(widget->save_x), &(widget->save_y));
widget->pos_saved = TRUE;
}
}
/**
* glade_widget_show:
* @widget: A #GladeWidget
*
* Display @widget
* Display @widget in it's project's GladeDesignView
*/
void
glade_widget_show (GladeWidget *widget)
{
GladeDesignView *view;
GtkWidget *layout;
g_return_if_fail (GLADE_IS_WIDGET (widget));
/* Position window at saved coordinates or in the center */
if (GTK_IS_WINDOW (widget->object))
{
if (widget->pos_saved)
gtk_window_move (GTK_WINDOW (widget->object),
widget->save_x, widget->save_y);
else
gtk_window_set_position (GTK_WINDOW (widget->object),
GTK_WIN_POS_CENTER);
if (!glade_window_is_embedded (GTK_WINDOW (widget->object)))
glade_widget_embed_using_signals (widget);
view = glade_design_view_get_from_project (glade_widget_get_project (widget));
layout = GTK_WIDGET (glade_design_view_get_layout (view));
if (gtk_bin_get_child (GTK_BIN (layout)) != NULL)
gtk_container_remove (GTK_CONTAINER (layout), gtk_bin_get_child (GTK_BIN (layout)));
gtk_container_add (GTK_CONTAINER (layout), GTK_WIDGET (widget->object));
gtk_widget_show_all (GTK_WIDGET (widget->object));
gtk_window_present (GTK_WINDOW (widget->object));
} else if (GTK_IS_WIDGET (widget->object)) {
gtk_widget_show_all (GTK_WIDGET (widget->object));
}
......@@ -2226,7 +2228,6 @@ glade_widget_hide (GladeWidget *widget)
if (GTK_IS_WINDOW (widget->object))
{
/* Save coordinates */
glade_widget_save_coords (widget);
gtk_widget_hide (GTK_WIDGET (widget->object));
}
widget->visible = FALSE;
......@@ -2418,9 +2419,6 @@ glade_widget_rebuild (GladeWidget *glade_widget)
g_return_if_fail (GLADE_IS_WIDGET (glade_widget));
adaptor = glade_widget->adaptor;
/* Save coordinates incase its a toplevel */
glade_widget_save_coords (glade_widget);
/* Extract and keep the child hierarchies aside... */
children = glade_widget_extract_children (glade_widget);
......@@ -3673,3 +3671,496 @@ glade_widget_pop_superuser (void)
}
glade_property_pop_superuser ();
}
/*******************************************************************************
Toplevel GladeWidget Embedding
*******************************************************************************
*
* This code has two implemententations, one that stores original class handlers in
* a hashtable, and another that uses signal connection to emulate vfuncs.
*
* Signal Connection: glade_widget_embed_using_signals ()
*
* Hashtable: glade_widget_embed ()
*
*/
typedef struct
{
/* pointers to the original class handlers */
void (* realize) (GtkWidget *widget);
void (* map) (GtkWidget *widget);
void (* unmap) (GtkWidget *widget);
void (* show) (GtkWidget *widget);
void (* hide) (GtkWidget *widget);
void (* size_allocate) (GtkWidget *widget, GtkAllocation *allocation);
} GladeOriginalHandlers;
static GHashTable *original_handlers_table = NULL;
static GQuark glade_embedded_window_quark = 0;
static gboolean
glade_window_is_embedded (GtkWindow *window)
{
return GPOINTER_TO_INT (g_object_get_qdata ((GObject *) window, glade_embedded_window_quark));
}
static GtkBinClass*
get_bin_class_ancestor (gpointer descendant_class)
{
gpointer parent_class;
gpointer class;
class = descendant_class;
if (!GTK_IS_BIN_CLASS (class))
return NULL;
while (GTK_IS_BIN_CLASS (parent_class = g_type_class_peek_parent (class)))
{
class = parent_class;
parent_class = g_type_class_peek_parent (class);
}
return GTK_BIN_CLASS (class);
}
static GladeOriginalHandlers*
obtain_handlers (GType instance_type)
{
GladeOriginalHandlers *handlers = NULL;
GType type = instance_type;
while (!handlers && type != 0)
{
handlers = (GladeOriginalHandlers *) g_hash_table_lookup (original_handlers_table, &type);
type = g_type_parent (type);
}
return handlers;
}
static void
embedded_window_map (GtkWidget *widget)
{
GtkBinClass *bin_class;
bin_class = get_bin_class_ancestor (GTK_WIDGET_GET_CLASS (widget));
GTK_WIDGET_CLASS (bin_class)->map (widget);
}
static void
embedded_window_unmap (GtkWidget *widget)
{
GtkBinClass *bin_class;
bin_class = get_bin_class_ancestor (GTK_WIDGET_GET_CLASS (widget));
GTK_WIDGET_CLASS (bin_class)->unmap (widget);
}
static void
embedded_window_show (GtkWidget *widget)
{
GtkBinClass *bin_class;
bin_class = get_bin_class_ancestor (GTK_WIDGET_GET_CLASS (widget));
GTK_WIDGET_CLASS (bin_class)->show (widget);
}
static void
embedded_window_hide (GtkWidget *widget)
{
GtkBinClass *bin_class;
bin_class = get_bin_class_ancestor (GTK_WIDGET_GET_CLASS (widget));
GTK_WIDGET_CLASS (bin_class)->hide (widget);
}
static void
embedded_window_realize (GtkWidget *widget)
{
GtkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
window = GTK_WINDOW (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.width = widget->allocation.width;
attributes.height = widget->allocation.height;
attributes.event_mask = gtk_widget_get_events (widget) |
GDK_EXPOSURE_MASK |
GDK_FOCUS_CHANGE_MASK |
GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_STRUCTURE_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gdk_window_enable_synchronized_configure (widget->window);
gdk_window_set_user_data (widget->window, widget);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
}
static void
embedded_window_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
GtkWindow *window;
GtkAllocation child_allocation;