summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-01-04 14:51:19 -0500
committerMatthias Clasen <mclasen@redhat.com>2011-01-04 14:51:19 -0500
commit98440ad03190396bd2bef02557f8d41e12dd5795 (patch)
treeaae5ba3fb370a66f1c1db629644e4f527c0568f3
parent1283368b1bc93f6190d9aca92c433def60e73c55 (diff)
downloadgtk+-98440ad03190396bd2bef02557f8d41e12dd5795.tar.gz
Remove gtktypeutils altogether
Based on patches by Javier Jardón. https://bugzilla.gnome.org/show_bug.cgi?id=629955
-rw-r--r--gtk/Makefile.am2
-rw-r--r--gtk/gtk.h2
-rw-r--r--gtk/gtkaboutdialog.c1
-rw-r--r--gtk/gtkactiongroup.h2
-rw-r--r--gtk/gtkassistant.c2
-rw-r--r--gtk/gtkbindings.c655
-rw-r--r--gtk/gtkbutton.c1
-rw-r--r--gtk/gtkcellrendereraccel.c1
-rw-r--r--gtk/gtkcombobox.c1
-rw-r--r--gtk/gtkcontainer.c6
-rw-r--r--gtk/gtkentry.c1
-rw-r--r--gtk/gtkfilechooserbutton.c1
-rw-r--r--gtk/gtkframe.c1
-rw-r--r--gtk/gtkhandlebox.c3
-rw-r--r--gtk/gtkiconfactory.c4
-rw-r--r--gtk/gtkiconview.c1
-rw-r--r--gtk/gtkimage.c2
-rw-r--r--gtk/gtkinfobar.c1
-rw-r--r--gtk/gtklabel.c1
-rw-r--r--gtk/gtkmain.h1
-rw-r--r--gtk/gtkmenu.c1
-rw-r--r--gtk/gtkmenubar.c2
-rw-r--r--gtk/gtkmenuitem.c2
-rw-r--r--gtk/gtkmenushell.c1
-rw-r--r--gtk/gtkmessagedialog.c2
-rw-r--r--gtk/gtknotebook.c1
-rw-r--r--gtk/gtkpaned.c2
-rw-r--r--gtk/gtkprintoperation.c8
-rw-r--r--gtk/gtkprintsettings.c6
-rw-r--r--gtk/gtkprintunixdialog.c21
-rw-r--r--gtk/gtkrange.c1
-rw-r--r--gtk/gtkscalebutton.c2
-rw-r--r--gtk/gtkscrolledwindow.c1
-rw-r--r--gtk/gtkspinbutton.c1
-rw-r--r--gtk/gtkstatusbar.c2
-rw-r--r--gtk/gtkstatusicon.c16
-rw-r--r--gtk/gtkstock.h15
-rw-r--r--gtk/gtktexttag.c8
-rw-r--r--gtk/gtktextview.c1
-rw-r--r--gtk/gtktoolbar.c1
-rw-r--r--gtk/gtktoolitemgroup.c6
-rw-r--r--gtk/gtktoolpalette.c2
-rw-r--r--gtk/gtktrayicon-x11.c10
-rw-r--r--gtk/gtktreeview.c1
-rw-r--r--gtk/gtktreeviewcolumn.c1
-rw-r--r--gtk/gtktypeutils.c47
-rw-r--r--gtk/gtktypeutils.h50
-rw-r--r--gtk/gtkwidget.c1
-rw-r--r--gtk/gtkwindow.c5
-rw-r--r--po-properties/POTFILES.in1
-rw-r--r--po/POTFILES.in1
51 files changed, 438 insertions, 470 deletions
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 6dd2e01b20..79aeb455c2 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -333,7 +333,6 @@ gtk_public_h_sources = \
gtktreestore.h \
gtktreeview.h \
gtktreeviewcolumn.h \
- gtktypeutils.h \
gtkuimanager.h \
gtkvbbox.h \
gtkvbox.h \
@@ -662,7 +661,6 @@ gtk_base_c_sources = \
gtktreeview.c \
gtktreeviewcolumn.c \
gtktypebuiltins.c \
- gtktypeutils.c \
gtkuimanager.c \
gtkvbbox.c \
gtkvbox.c \
diff --git a/gtk/gtk.h b/gtk/gtk.h
index 0d85793a3c..29b41f29be 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -217,7 +217,7 @@
#include <gtk/gtktreestore.h>
#include <gtk/gtktreeview.h>
#include <gtk/gtktreeviewcolumn.h>
-#include <gtk/gtktypeutils.h>
+#include <gtk/gtktypebuiltins.h>
#include <gtk/gtkuimanager.h>
#include <gtk/gtkvbbox.h>
#include <gtk/gtkvbox.h>
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index ea4d9304ac..d63054f13e 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -54,6 +54,7 @@
#include "gtkmain.h"
#include "gtkmessagedialog.h"
#include "gtktogglebutton.h"
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkintl.h"
diff --git a/gtk/gtkactiongroup.h b/gtk/gtkactiongroup.h
index c77987c127..33fa000dfa 100644
--- a/gtk/gtkactiongroup.h
+++ b/gtk/gtkactiongroup.h
@@ -36,7 +36,7 @@
#define __GTK_ACTION_GROUP_H__
#include <gtk/gtkaction.h>
-#include <gtk/gtktypeutils.h> /* for GtkTranslateFunc */
+#include <gtk/gtkstock.h>
G_BEGIN_DECLS
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index e3a5af7f2f..fa740bd18a 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -71,7 +71,7 @@
#include "gtksizegroup.h"
#include "gtksizerequest.h"
#include "gtkstock.h"
-
+#include "gtktypebuiltins.h"
#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtkbuildable.h"
diff --git a/gtk/gtkbindings.c b/gtk/gtkbindings.c
index e8b0b632e4..733c9b1060 100644
--- a/gtk/gtkbindings.c
+++ b/gtk/gtkbindings.c
@@ -11,7 +11,7 @@
*
* This library 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
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
@@ -32,14 +32,17 @@
#include <stdarg.h>
#include "gtkbindings.h"
-#include "gtktypeutils.h"
#include "gtkkeyhash.h"
#include "gtkwidget.h"
#include "gtkrc.h"
-
+#include "gtkintl.h"
/* --- defines --- */
-#define BINDING_MOD_MASK() (gtk_accelerator_get_default_mod_mask () | GDK_RELEASE_MASK)
+#define BINDING_MOD_MASK() (gtk_accelerator_get_default_mod_mask () | GDK_RELEASE_MASK)
+
+
+#define GTK_TYPE_IDENTIFIER (gtk_identifier_get_type ())
+GType gtk_identifier_get_type (void) G_GNUC_CONST;
/* --- structures --- */
@@ -52,14 +55,28 @@ typedef struct {
/* --- variables --- */
-static GHashTable *binding_entry_hash_table = NULL;
+static GHashTable *binding_entry_hash_table = NULL;
static GSList *binding_key_hashes = NULL;
-static GSList *binding_set_list = NULL;
-static const gchar key_class_binding_set[] = "gtk-class-binding-set";
-static GQuark key_id_class_binding_set = 0;
+static GSList *binding_set_list = NULL;
+static const gchar key_class_binding_set[] = "gtk-class-binding-set";
+static GQuark key_id_class_binding_set = 0;
/* --- functions --- */
+GType
+gtk_identifier_get_type (void)
+{
+ static GType our_type = 0;
+
+ if (our_type == 0)
+ {
+ GTypeInfo tinfo = { 0, };
+ our_type = g_type_register_static (G_TYPE_STRING, I_("GtkIdentifier"), &tinfo, 0);
+ }
+
+ return our_type;
+}
+
static void
pattern_spec_free (PatternSpec *pspec)
{
@@ -70,7 +87,7 @@ pattern_spec_free (PatternSpec *pspec)
static GtkBindingSignal*
binding_signal_new (const gchar *signal_name,
- guint n_args)
+ guint n_args)
{
GtkBindingSignal *signal;
@@ -91,7 +108,7 @@ binding_signal_free (GtkBindingSignal *sig)
for (i = 0; i < sig->n_args; i++)
{
if (G_TYPE_FUNDAMENTAL (sig->args[i].arg_type) == G_TYPE_STRING)
- g_free (sig->args[i].d.string_data);
+ g_free (sig->args[i].d.string_data);
}
g_slice_free1 (sizeof (GtkBindingSignal) + sig->n_args * sizeof (GtkBindingArg), sig);
}
@@ -110,7 +127,7 @@ binding_entry_hash (gconstpointer key)
static gint
binding_entries_compare (gconstpointer a,
- gconstpointer b)
+ gconstpointer b)
{
register const GtkBindingEntry *ea = a;
register const GtkBindingEntry *eb = b;
@@ -120,7 +137,7 @@ binding_entries_compare (gconstpointer a,
static void
binding_key_hash_insert_entry (GtkKeyHash *key_hash,
- GtkBindingEntry *entry)
+ GtkBindingEntry *entry)
{
guint keyval = entry->keyval;
@@ -130,9 +147,9 @@ binding_key_hash_insert_entry (GtkKeyHash *key_hash,
if (entry->modifiers & GDK_SHIFT_MASK)
{
if (keyval == GDK_KEY_Tab)
- keyval = GDK_KEY_ISO_Left_Tab;
+ keyval = GDK_KEY_ISO_Left_Tab;
else
- keyval = gdk_keyval_to_upper (keyval);
+ keyval = gdk_keyval_to_upper (keyval);
}
_gtk_key_hash_add_entry (key_hash, keyval, entry->modifiers & ~GDK_RELEASE_MASK, entry);
@@ -149,8 +166,8 @@ binding_key_hash_destroy (gpointer data)
static void
insert_entries_into_key_hash (gpointer key,
- gpointer value,
- gpointer data)
+ gpointer value,
+ gpointer data)
{
GtkKeyHash *key_hash = data;
GtkBindingEntry *entry = value;
@@ -176,9 +193,9 @@ binding_key_hash_for_keymap (GdkKeymap *keymap)
g_object_set_qdata_full (G_OBJECT (keymap), key_hash_quark, key_hash, binding_key_hash_destroy);
if (binding_entry_hash_table)
- g_hash_table_foreach (binding_entry_hash_table,
- insert_entries_into_key_hash,
- key_hash);
+ g_hash_table_foreach (binding_entry_hash_table,
+ insert_entries_into_key_hash,
+ key_hash);
binding_key_hashes = g_slist_prepend (binding_key_hashes, key_hash);
}
@@ -189,8 +206,8 @@ binding_key_hash_for_keymap (GdkKeymap *keymap)
static GtkBindingEntry*
binding_entry_new (GtkBindingSet *binding_set,
- guint keyval,
- GdkModifierType modifiers)
+ guint keyval,
+ GdkModifierType modifiers)
{
GSList *tmp_list;
GtkBindingEntry *entry;
@@ -230,9 +247,9 @@ binding_entry_free (GtkBindingEntry *entry)
GtkBindingSignal *sig;
g_assert (entry->set_next == NULL &&
- entry->hash_next == NULL &&
- entry->in_emission == FALSE &&
- entry->destroyed == TRUE);
+ entry->hash_next == NULL &&
+ entry->in_emission == FALSE &&
+ entry->destroyed == TRUE);
entry->destroyed = FALSE;
@@ -264,13 +281,13 @@ binding_entry_destroy (GtkBindingEntry *entry)
while (tmp)
{
if (tmp == entry)
- {
- if (last)
- last->set_next = entry->set_next;
- else
- entry->binding_set->entries = entry->set_next;
- break;
- }
+ {
+ if (last)
+ last->set_next = entry->set_next;
+ else
+ entry->binding_set->entries = entry->set_next;
+ break;
+ }
last = tmp;
tmp = last->set_next;
}
@@ -283,13 +300,13 @@ binding_entry_destroy (GtkBindingEntry *entry)
while (tmp)
{
if (tmp == entry)
- {
- if (last)
- last->hash_next = entry->hash_next;
- else
- begin = entry->hash_next;
- break;
- }
+ {
+ if (last)
+ last->hash_next = entry->hash_next;
+ else
+ begin = entry->hash_next;
+ break;
+ }
last = tmp;
tmp = last->hash_next;
}
@@ -317,8 +334,8 @@ binding_entry_destroy (GtkBindingEntry *entry)
static GtkBindingEntry*
binding_ht_lookup_entry (GtkBindingSet *set,
- guint keyval,
- GdkModifierType modifiers)
+ guint keyval,
+ GdkModifierType modifiers)
{
GtkBindingEntry lookup_entry = { 0 };
GtkBindingEntry *entry;
@@ -339,9 +356,9 @@ binding_ht_lookup_entry (GtkBindingSet *set,
static gboolean
binding_compose_params (GObject *object,
- GtkBindingArg *args,
- GSignalQuery *query,
- GValue **params_p)
+ GtkBindingArg *args,
+ GSignalQuery *query,
+ GValue **params_p)
{
GValue *params;
const GType *types;
@@ -366,85 +383,85 @@ binding_compose_params (GObject *object,
g_value_init (params, *types);
switch (G_TYPE_FUNDAMENTAL (args->arg_type))
- {
- case G_TYPE_DOUBLE:
- g_value_init (&tmp_value, G_TYPE_DOUBLE);
- g_value_set_double (&tmp_value, args->d.double_data);
- break;
- case G_TYPE_LONG:
- g_value_init (&tmp_value, G_TYPE_LONG);
- g_value_set_long (&tmp_value, args->d.long_data);
- break;
- case G_TYPE_STRING:
- /* gtk_rc_parse_flags/enum() has fancier parsing for this; we can't call
- * that since we don't have a GParamSpec, so just do something simple
- */
- if (G_TYPE_FUNDAMENTAL (*types) == G_TYPE_ENUM)
- {
- GEnumClass *class = G_ENUM_CLASS (g_type_class_ref (*types));
-
- valid = FALSE;
-
- if (args->arg_type == GTK_TYPE_IDENTIFIER)
- {
- GEnumValue *enum_value = NULL;
- enum_value = g_enum_get_value_by_name (class, args->d.string_data);
- if (!enum_value)
- enum_value = g_enum_get_value_by_nick (class, args->d.string_data);
- if (enum_value)
- {
- g_value_init (&tmp_value, *types);
- g_value_set_enum (&tmp_value, enum_value->value);
- valid = TRUE;
- }
- }
-
- g_type_class_unref (class);
- }
- /* This is just a hack for compatibility with GTK+-1.2 where a string
- * could be used for a single flag value / without the support for multiple
- * values in gtk_rc_parse_flags(), this isn't very useful.
- */
- else if (G_TYPE_FUNDAMENTAL (*types) == G_TYPE_FLAGS)
- {
- GFlagsClass *class = G_FLAGS_CLASS (g_type_class_ref (*types));
-
- valid = FALSE;
-
- if (args->arg_type == GTK_TYPE_IDENTIFIER)
- {
- GFlagsValue *flags_value = NULL;
- flags_value = g_flags_get_value_by_name (class, args->d.string_data);
- if (!flags_value)
- flags_value = g_flags_get_value_by_nick (class, args->d.string_data);
- if (flags_value)
- {
- g_value_init (&tmp_value, *types);
- g_value_set_flags (&tmp_value, flags_value->value);
- valid = TRUE;
- }
- }
-
- g_type_class_unref (class);
- }
- else
- {
- g_value_init (&tmp_value, G_TYPE_STRING);
- g_value_set_static_string (&tmp_value, args->d.string_data);
- }
- break;
- default:
- valid = FALSE;
- break;
- }
+ {
+ case G_TYPE_DOUBLE:
+ g_value_init (&tmp_value, G_TYPE_DOUBLE);
+ g_value_set_double (&tmp_value, args->d.double_data);
+ break;
+ case G_TYPE_LONG:
+ g_value_init (&tmp_value, G_TYPE_LONG);
+ g_value_set_long (&tmp_value, args->d.long_data);
+ break;
+ case G_TYPE_STRING:
+ /* gtk_rc_parse_flags/enum() has fancier parsing for this; we can't call
+ * that since we don't have a GParamSpec, so just do something simple
+ */
+ if (G_TYPE_FUNDAMENTAL (*types) == G_TYPE_ENUM)
+ {
+ GEnumClass *class = G_ENUM_CLASS (g_type_class_ref (*types));
+
+ valid = FALSE;
+
+ if (args->arg_type == GTK_TYPE_IDENTIFIER)
+ {
+ GEnumValue *enum_value = NULL;
+ enum_value = g_enum_get_value_by_name (class, args->d.string_data);
+ if (!enum_value)
+ enum_value = g_enum_get_value_by_nick (class, args->d.string_data);
+ if (enum_value)
+ {
+ g_value_init (&tmp_value, *types);
+ g_value_set_enum (&tmp_value, enum_value->value);
+ valid = TRUE;
+ }
+ }
+
+ g_type_class_unref (class);
+ }
+ /* This is just a hack for compatibility with GTK+-1.2 where a string
+ * could be used for a single flag value / without the support for multiple
+ * values in gtk_rc_parse_flags(), this isn't very useful.
+ */
+ else if (G_TYPE_FUNDAMENTAL (*types) == G_TYPE_FLAGS)
+ {
+ GFlagsClass *class = G_FLAGS_CLASS (g_type_class_ref (*types));
+
+ valid = FALSE;
+
+ if (args->arg_type == GTK_TYPE_IDENTIFIER)
+ {
+ GFlagsValue *flags_value = NULL;
+ flags_value = g_flags_get_value_by_name (class, args->d.string_data);
+ if (!flags_value)
+ flags_value = g_flags_get_value_by_nick (class, args->d.string_data);
+ if (flags_value)
+ {
+ g_value_init (&tmp_value, *types);
+ g_value_set_flags (&tmp_value, flags_value->value);
+ valid = TRUE;
+ }
+ }
+
+ g_type_class_unref (class);
+ }
+ else
+ {
+ g_value_init (&tmp_value, G_TYPE_STRING);
+ g_value_set_static_string (&tmp_value, args->d.string_data);
+ }
+ break;
+ default:
+ valid = FALSE;
+ break;
+ }
if (valid)
- {
- if (!g_value_transform (&tmp_value, params))
- valid = FALSE;
+ {
+ if (!g_value_transform (&tmp_value, params))
+ valid = FALSE;
- g_value_unset (&tmp_value);
- }
+ g_value_unset (&tmp_value);
+ }
types++;
params++;
@@ -456,7 +473,7 @@ binding_compose_params (GObject *object,
guint j;
for (j = 0; j < i; j++)
- g_value_unset (&(*params_p)[j]);
+ g_value_unset (&(*params_p)[j]);
g_free (*params_p);
*params_p = NULL;
@@ -467,7 +484,7 @@ binding_compose_params (GObject *object,
static gboolean
gtk_binding_entry_activate (GtkBindingEntry *entry,
- GObject *object)
+ GObject *object)
{
GtkBindingSignal *sig;
gboolean old_emission;
@@ -489,65 +506,65 @@ gtk_binding_entry_activate (GtkBindingEntry *entry,
signal_id = g_signal_lookup (sig->signal_name, G_OBJECT_TYPE (object));
if (!signal_id)
- {
- accelerator = gtk_accelerator_name (entry->keyval, entry->modifiers);
- g_warning ("gtk_binding_entry_activate(): binding \"%s::%s\": "
- "could not find signal \"%s\" in the `%s' class ancestry",
- entry->binding_set->set_name,
- accelerator,
- sig->signal_name,
- g_type_name (G_OBJECT_TYPE (object)));
- g_free (accelerator);
- continue;
- }
-
+ {
+ accelerator = gtk_accelerator_name (entry->keyval, entry->modifiers);
+ g_warning ("gtk_binding_entry_activate(): binding \"%s::%s\": "
+ "could not find signal \"%s\" in the `%s' class ancestry",
+ entry->binding_set->set_name,
+ accelerator,
+ sig->signal_name,
+ g_type_name (G_OBJECT_TYPE (object)));
+ g_free (accelerator);
+ continue;
+ }
+
g_signal_query (signal_id, &query);
if (query.n_params != sig->n_args ||
- (query.return_type != G_TYPE_NONE && query.return_type != G_TYPE_BOOLEAN) ||
- !binding_compose_params (object, sig->args, &query, &params))
- {
- accelerator = gtk_accelerator_name (entry->keyval, entry->modifiers);
- g_warning ("gtk_binding_entry_activate(): binding \"%s::%s\": "
- "signature mismatch for signal \"%s\" in the `%s' class ancestry",
- entry->binding_set->set_name,
- accelerator,
- sig->signal_name,
- g_type_name (G_OBJECT_TYPE (object)));
- }
+ (query.return_type != G_TYPE_NONE && query.return_type != G_TYPE_BOOLEAN) ||
+ !binding_compose_params (object, sig->args, &query, &params))
+ {
+ accelerator = gtk_accelerator_name (entry->keyval, entry->modifiers);
+ g_warning ("gtk_binding_entry_activate(): binding \"%s::%s\": "
+ "signature mismatch for signal \"%s\" in the `%s' class ancestry",
+ entry->binding_set->set_name,
+ accelerator,
+ sig->signal_name,
+ g_type_name (G_OBJECT_TYPE (object)));
+ }
else if (!(query.signal_flags & G_SIGNAL_ACTION))
- {
- accelerator = gtk_accelerator_name (entry->keyval, entry->modifiers);
- g_warning ("gtk_binding_entry_activate(): binding \"%s::%s\": "
- "signal \"%s\" in the `%s' class ancestry cannot be used for action emissions",
- entry->binding_set->set_name,
- accelerator,
- sig->signal_name,
- g_type_name (G_OBJECT_TYPE (object)));
- }
+ {
+ accelerator = gtk_accelerator_name (entry->keyval, entry->modifiers);
+ g_warning ("gtk_binding_entry_activate(): binding \"%s::%s\": "
+ "signal \"%s\" in the `%s' class ancestry cannot be used for action emissions",
+ entry->binding_set->set_name,
+ accelerator,
+ sig->signal_name,
+ g_type_name (G_OBJECT_TYPE (object)));
+ }
g_free (accelerator);
if (accelerator)
- continue;
+ continue;
if (query.return_type == G_TYPE_BOOLEAN)
- g_value_init (&return_val, G_TYPE_BOOLEAN);
+ g_value_init (&return_val, G_TYPE_BOOLEAN);
g_signal_emitv (params, signal_id, 0, &return_val);
if (query.return_type == G_TYPE_BOOLEAN)
- {
- if (g_value_get_boolean (&return_val))
- handled = TRUE;
- g_value_unset (&return_val);
- }
+ {
+ if (g_value_get_boolean (&return_val))
+ handled = TRUE;
+ g_value_unset (&return_val);
+ }
else
- handled = TRUE;
+ handled = TRUE;
for (i = 0; i < query.n_params + 1; i++)
- g_value_unset (&params[i]);
+ g_value_unset (&params[i]);
g_free (params);
if (entry->destroyed)
- break;
+ break;
}
g_object_unref (object);
@@ -617,9 +634,9 @@ gtk_binding_set_by_class (gpointer object_class)
binding_set = gtk_binding_set_new (g_type_name (G_OBJECT_CLASS_TYPE (class)));
gtk_binding_set_add_path (binding_set,
- GTK_PATH_CLASS,
- g_type_name (G_OBJECT_CLASS_TYPE (class)),
- GTK_PATH_PRIO_GTK);
+ GTK_PATH_CLASS,
+ g_type_name (G_OBJECT_CLASS_TYPE (class)),
+ GTK_PATH_PRIO_GTK);
g_dataset_id_set_data (class, key_id_class_binding_set, binding_set);
return binding_set;
@@ -648,7 +665,7 @@ gtk_binding_set_find (const gchar *set_name)
binding_set = slist->data;
if (g_str_equal (binding_set->set_name, (gpointer) set_name))
- return binding_set;
+ return binding_set;
}
return NULL;
}
@@ -666,10 +683,10 @@ gtk_binding_set_find (const gchar *set_name)
* Return value: %TRUE if a binding was found and activated
*/
gboolean
-gtk_binding_set_activate (GtkBindingSet *binding_set,
- guint keyval,
- GdkModifierType modifiers,
- GObject *object)
+gtk_binding_set_activate (GtkBindingSet *binding_set,
+ guint keyval,
+ GdkModifierType modifiers,
+ GObject *object)
{
GtkBindingEntry *entry;
@@ -745,9 +762,9 @@ gtk_binding_entry_skip (GtkBindingSet *binding_set,
* gtk_binding_entry_add_signal() on @binding_set.
*/
void
-gtk_binding_entry_remove (GtkBindingSet *binding_set,
- guint keyval,
- GdkModifierType modifiers)
+gtk_binding_entry_remove (GtkBindingSet *binding_set,
+ guint keyval,
+ GdkModifierType modifiers)
{
GtkBindingEntry *entry;
@@ -775,10 +792,10 @@ gtk_binding_entry_remove (GtkBindingSet *binding_set,
*/
void
gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
- guint keyval,
+ guint keyval,
GdkModifierType modifiers,
const gchar *signal_name,
- GSList *binding_args)
+ GSList *binding_args)
{
_gtk_binding_entry_add_signall (binding_set,
keyval, modifiers,
@@ -787,10 +804,10 @@ gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
void
_gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
- guint keyval,
+ guint keyval,
GdkModifierType modifiers,
const gchar *signal_name,
- GSList *binding_args)
+ GSList *binding_args)
{
GtkBindingEntry *entry;
GtkBindingSignal *signal, **signal_p;
@@ -813,40 +830,40 @@ _gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
tmp_arg = slist->data;
if (!tmp_arg)
- {
- g_warning ("gtk_binding_entry_add_signall(): arg[%u] is `NULL'", n);
- binding_signal_free (signal);
- return;
- }
+ {
+ g_warning ("gtk_binding_entry_add_signall(): arg[%u] is `NULL'", n);
+ binding_signal_free (signal);
+ return;
+ }
switch (G_TYPE_FUNDAMENTAL (tmp_arg->arg_type))
- {
- case G_TYPE_LONG:
- arg->arg_type = G_TYPE_LONG;
- arg->d.long_data = tmp_arg->d.long_data;
- break;
- case G_TYPE_DOUBLE:
- arg->arg_type = G_TYPE_DOUBLE;
- arg->d.double_data = tmp_arg->d.double_data;
- break;
- case G_TYPE_STRING:
+ {
+ case G_TYPE_LONG:
+ arg->arg_type = G_TYPE_LONG;
+ arg->d.long_data = tmp_arg->d.long_data;
+ break;
+ case G_TYPE_DOUBLE:
+ arg->arg_type = G_TYPE_DOUBLE;
+ arg->d.double_data = tmp_arg->d.double_data;
+ break;
+ case G_TYPE_STRING:
if (tmp_arg->arg_type != GTK_TYPE_IDENTIFIER)
- arg->arg_type = G_TYPE_STRING;
- else
- arg->arg_type = GTK_TYPE_IDENTIFIER;
- arg->d.string_data = g_strdup (tmp_arg->d.string_data);
- if (!arg->d.string_data)
- {
- g_warning ("gtk_binding_entry_add_signall(): value of `string' arg[%u] is `NULL'", n);
- binding_signal_free (signal);
- return;
- }
- break;
- default:
- g_warning ("gtk_binding_entry_add_signall(): unsupported type `%s' for arg[%u]",
- g_type_name (arg->arg_type), n);
- binding_signal_free (signal);
- return;
- }
+ arg->arg_type = G_TYPE_STRING;
+ else
+ arg->arg_type = GTK_TYPE_IDENTIFIER;
+ arg->d.string_data = g_strdup (tmp_arg->d.string_data);
+ if (!arg->d.string_data)
+ {
+ g_warning ("gtk_binding_entry_add_signall(): value of `string' arg[%u] is `NULL'", n);
+ binding_signal_free (signal);
+ return;
+ }
+ break;
+ default:
+ g_warning ("gtk_binding_entry_add_signall(): unsupported type `%s' for arg[%u]",
+ g_type_name (arg->arg_type), n);
+ binding_signal_free (signal);
+ return;
+ }
arg++;
n++;
}
@@ -879,11 +896,11 @@ _gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
*/
void
gtk_binding_entry_add_signal (GtkBindingSet *binding_set,
- guint keyval,
- GdkModifierType modifiers,
- const gchar *signal_name,
- guint n_args,
- ...)
+ guint keyval,
+ GdkModifierType modifiers,
+ const gchar *signal_name,
+ guint n_args,
+ ...)
{
GSList *slist, *free_slist;
va_list args;
@@ -903,45 +920,45 @@ gtk_binding_entry_add_signal (GtkBindingSet *binding_set,
arg->arg_type = va_arg (args, GType);
switch (G_TYPE_FUNDAMENTAL (arg->arg_type))
- {
- case G_TYPE_CHAR:
- case G_TYPE_UCHAR:
- case G_TYPE_INT:
- case G_TYPE_UINT:
- case G_TYPE_BOOLEAN:
- case G_TYPE_ENUM:
- case G_TYPE_FLAGS:
- arg->arg_type = G_TYPE_LONG;
- arg->d.long_data = va_arg (args, gint);
- break;
- case G_TYPE_LONG:
- case G_TYPE_ULONG:
- arg->arg_type = G_TYPE_LONG;
- arg->d.long_data = va_arg (args, glong);
- break;
- case G_TYPE_FLOAT:
- case G_TYPE_DOUBLE:
- arg->arg_type = G_TYPE_DOUBLE;
- arg->d.double_data = va_arg (args, gdouble);
- break;
- case G_TYPE_STRING:
- if (arg->arg_type != GTK_TYPE_IDENTIFIER)
- arg->arg_type = G_TYPE_STRING;
- arg->d.string_data = va_arg (args, gchar*);
- if (!arg->d.string_data)
- {
- g_warning ("gtk_binding_entry_add_signal(): type `%s' arg[%u] is `NULL'",
- g_type_name (arg->arg_type),
- i);
- i += n_args + 1;
- }
- break;
- default:
- g_warning ("gtk_binding_entry_add_signal(): unsupported type `%s' for arg[%u]",
- g_type_name (arg->arg_type), i);
- i += n_args + 1;
- break;
- }
+ {
+ case G_TYPE_CHAR:
+ case G_TYPE_UCHAR:
+ case G_TYPE_INT:
+ case G_TYPE_UINT:
+ case G_TYPE_BOOLEAN:
+ case G_TYPE_ENUM:
+ case G_TYPE_FLAGS:
+ arg->arg_type = G_TYPE_LONG;
+ arg->d.long_data = va_arg (args, gint);
+ break;
+ case G_TYPE_LONG:
+ case G_TYPE_ULONG:
+ arg->arg_type = G_TYPE_LONG;
+ arg->d.long_data = va_arg (args, glong);
+ break;
+ case G_TYPE_FLOAT:
+ case G_TYPE_DOUBLE:
+ arg->arg_type = G_TYPE_DOUBLE;
+ arg->d.double_data = va_arg (args, gdouble);
+ break;
+ case G_TYPE_STRING:
+ if (arg->arg_type != GTK_TYPE_IDENTIFIER)
+ arg->arg_type = G_TYPE_STRING;
+ arg->d.string_data = va_arg (args, gchar*);
+ if (!arg->d.string_data)
+ {
+ g_warning ("gtk_binding_entry_add_signal(): type `%s' arg[%u] is `NULL'",
+ g_type_name (arg->arg_type),
+ i);
+ i += n_args + 1;
+ }
+ break;
+ default:
+ g_warning ("gtk_binding_entry_add_signal(): unsupported type `%s' for arg[%u]",
+ g_type_name (arg->arg_type), i);
+ i += n_args + 1;
+ break;
+ }
}
va_end (args);
@@ -973,10 +990,10 @@ gtk_binding_entry_add_signal (GtkBindingSet *binding_set,
* Deprecated: 3.0
*/
void
-gtk_binding_set_add_path (GtkBindingSet *binding_set,
- GtkPathType path_type,
- const gchar *path_pattern,
- GtkPathPriorityType priority)
+gtk_binding_set_add_path (GtkBindingSet *binding_set,
+ GtkPathType path_type,
+ const gchar *path_pattern,
+ GtkPathPriorityType priority)
{
PatternSpec *pspec;
GSList **slist_p, *slist;
@@ -1024,18 +1041,18 @@ gtk_binding_set_add_path (GtkBindingSet *binding_set,
slist = slist->next;
if (g_pattern_spec_equal (tmp_pspec->pspec, pspec->pspec))
- {
- GtkPathPriorityType lprio = tmp_pspec->seq_id >> 28;
-
- pattern_spec_free (pspec);
- pspec = NULL;
- if (lprio < priority)
- {
- tmp_pspec->seq_id &= 0x0fffffff;
- tmp_pspec->seq_id |= priority << 28;
- }
- break;
- }
+ {
+ GtkPathPriorityType lprio = tmp_pspec->seq_id >> 28;
+
+ pattern_spec_free (pspec);
+ pspec = NULL;
+ if (lprio < priority)
+ {
+ tmp_pspec->seq_id &= 0x0fffffff;
+ tmp_pspec->seq_id |= priority << 28;
+ }
+ break;
+ }
}
if (pspec)
{
@@ -1046,10 +1063,10 @@ gtk_binding_set_add_path (GtkBindingSet *binding_set,
static gboolean
binding_match_activate (GSList *pspec_list,
- GObject *object,
- guint path_length,
- gchar *path,
- gchar *path_reversed,
+ GObject *object,
+ guint path_length,
+ gchar *path,
+ gchar *path_reversed,
gboolean *unbound)
{
GSList *slist;
@@ -1067,7 +1084,7 @@ binding_match_activate (GSList *pspec_list,
if (pspec->type != GTK_PATH_WIDGET_CLASS)
{
if (g_pattern_match (pspec->pspec, path_length, path, path_reversed))
- binding_set = pspec->user_data;
+ binding_set = pspec->user_data;
}
if (binding_set)
@@ -1088,7 +1105,7 @@ binding_match_activate (GSList *pspec_list,
static gint
gtk_binding_pattern_compare (gconstpointer new_pattern,
- gconstpointer existing_pattern)
+ gconstpointer existing_pattern)
{
register const PatternSpec *np = new_pattern;
register const PatternSpec *ep = existing_pattern;
@@ -1102,8 +1119,8 @@ gtk_binding_pattern_compare (gconstpointer new_pattern,
static GSList*
gtk_binding_entries_sort_patterns (GSList *entries,
- GtkPathType path_id,
- gboolean is_release)
+ GtkPathType path_id,
+ gboolean is_release)
{
GSList *patterns;
GSList *tmp_list;
@@ -1125,34 +1142,34 @@ gtk_binding_entries_sort_patterns (GSList *entries,
GSList *slist = NULL;
if (is_release != ((entry->modifiers & GDK_RELEASE_MASK) != 0))
- continue;
+ continue;
binding_set = entry->binding_set;
if (binding_set->current)
- continue;
+ continue;
binding_set->current = entry;
switch (path_id)
- {
- case GTK_PATH_WIDGET:
- slist = binding_set->widget_path_pspecs;
- break;
- case GTK_PATH_WIDGET_CLASS:
- slist = binding_set->widget_class_pspecs;
- break;
- case GTK_PATH_CLASS:
- slist = binding_set->class_branch_pspecs;
- break;
- }
+ {
+ case GTK_PATH_WIDGET:
+ slist = binding_set->widget_path_pspecs;
+ break;
+ case GTK_PATH_WIDGET_CLASS:
+ slist = binding_set->widget_class_pspecs;
+ break;
+ case GTK_PATH_CLASS:
+ slist = binding_set->class_branch_pspecs;
+ break;
+ }
for (; slist; slist = slist->next)
- {
- PatternSpec *pspec;
+ {
+ PatternSpec *pspec;
- pspec = slist->data;
- patterns = g_slist_insert_sorted (patterns, pspec, gtk_binding_pattern_compare);
- }
+ pspec = slist->data;
+ patterns = g_slist_insert_sorted (patterns, pspec, gtk_binding_pattern_compare);
+ }
}
return patterns;
@@ -1160,8 +1177,8 @@ gtk_binding_entries_sort_patterns (GSList *entries,
static gboolean
gtk_bindings_activate_list (GObject *object,
- GSList *entries,
- gboolean is_release)
+ GSList *entries,
+ gboolean is_release)
{
gboolean handled = FALSE;
@@ -1179,24 +1196,24 @@ gtk_bindings_activate_list (GObject *object,
patterns = gtk_binding_entries_sort_patterns (entries, GTK_PATH_CLASS, is_release);
class_type = G_TYPE_FROM_INSTANCE (object);
while (class_type && !handled)
- {
- guint path_length;
- gchar *path;
- gchar *path_reversed;
-
- path = g_strdup (g_type_name (class_type));
- path_reversed = g_strdup (path);
- g_strreverse (path_reversed);
- path_length = strlen (path);
- handled = binding_match_activate (patterns, object, path_length, path, path_reversed, &unbound);
- g_free (path);
- g_free (path_reversed);
+ {
+ guint path_length;
+ gchar *path;
+ gchar *path_reversed;
+
+ path = g_strdup (g_type_name (class_type));
+ path_reversed = g_strdup (path);
+ g_strreverse (path_reversed);
+ path_length = strlen (path);
+ handled = binding_match_activate (patterns, object, path_length, path, path_reversed, &unbound);
+ g_free (path);
+ g_free (path_reversed);
if (unbound)
break;
- class_type = g_type_parent (class_type);
- }
+ class_type = g_type_parent (class_type);
+ }
g_slist_free (patterns);
if (unbound)
@@ -1219,8 +1236,8 @@ gtk_bindings_activate_list (GObject *object,
*/
gboolean
gtk_bindings_activate (GObject *object,
- guint keyval,
- GdkModifierType modifiers)
+ guint keyval,
+ GdkModifierType modifiers)
{
GSList *entries = NULL;
GdkDisplay *display;
@@ -1274,13 +1291,13 @@ gtk_bindings_activate_event (GObject *object,
key_hash = binding_key_hash_for_keymap (gdk_keymap_get_for_display (display));
entries = _gtk_key_hash_lookup (key_hash,
- event->hardware_keycode,
- event->state,
- BINDING_MOD_MASK () & ~GDK_RELEASE_MASK,
- event->group);
+ event->hardware_keycode,
+ event->state,
+ BINDING_MOD_MASK () & ~GDK_RELEASE_MASK,
+ event->group);
handled = gtk_bindings_activate_list (object, entries,
- event->type == GDK_KEY_RELEASE);
+ event->type == GDK_KEY_RELEASE);
g_slist_free (entries);
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 40b93c1b04..374d7df935 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -55,6 +55,7 @@
#include "gtkiconfactory.h"
#include "gtkactivatable.h"
#include "gtksizerequest.h"
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkintl.h"
diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c
index e1ad0f8b0d..cbd4b3573c 100644
--- a/gtk/gtkcellrendereraccel.c
+++ b/gtk/gtkcellrendereraccel.c
@@ -28,6 +28,7 @@
#include "gtkeventbox.h"
#include "gtkmain.h"
#include "gtksizerequest.h"
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 4fdcfe5b0d..c1ca3bc7d9 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -40,6 +40,7 @@
#include "gtktreeselection.h"
#include "gtkvseparator.h"
#include "gtkwindow.h"
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include <gobject/gvaluecollector.h>
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 0ae08277f7..d5135209cd 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -32,8 +32,12 @@
#include <string.h>
#include <stdlib.h>
+#include <gobject/gobjectnotifyqueue.c>
+#include <gobject/gvaluecollector.h>
+
#include "gtkbuildable.h"
#include "gtkbuilderprivate.h"
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
@@ -42,8 +46,6 @@
#include "gtkwindow.h"
#include "gtkintl.h"
#include "gtktoolbar.h"
-#include <gobject/gobjectnotifyqueue.c>
-#include <gobject/gvaluecollector.h>
/**
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 67c28d8cfb..0920037d2b 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -58,6 +58,7 @@
#include "gtkwindow.h"
#include "gtktreeview.h"
#include "gtktreeselection.h"
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkentryprivate.h"
#include "gtkcelllayout.h"
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c
index c68bb5b266..670ca89f0a 100644
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@ -52,6 +52,7 @@
#include "gtkfilechooserbutton.h"
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
/* **************** *
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index 5a8843f712..04950f6fea 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -29,6 +29,7 @@
#include "gtkframe.h"
#include "gtklabel.h"
#include "gtkprivate.h"
+#include "gtktypebuiltins.h"
#include "gtkintl.h"
#include "gtkbuildable.h"
diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c
index c96f66579d..a57d81b992 100644
--- a/gtk/gtkhandlebox.c
+++ b/gtk/gtkhandlebox.c
@@ -26,12 +26,15 @@
*/
#include "config.h"
+
#include <stdlib.h>
+
#include "gtkhandlebox.h"
#include "gtkinvisible.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
#include "gtkwindow.h"
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkintl.h"
diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c
index 2c2f95e0fc..46744499c8 100644
--- a/gtk/gtkiconfactory.c
+++ b/gtk/gtkiconfactory.c
@@ -25,9 +25,11 @@
*/
#include "config.h"
+
#include <stdlib.h>
#include <errno.h>
#include <string.h>
+
#include "gtkiconfactory.h"
#include "gtkiconcache.h"
#include "gtkdebug.h"
@@ -38,7 +40,7 @@
#include "gtkintl.h"
#include "gtkbuildable.h"
#include "gtkbuilderprivate.h"
-
+#include "gtktypebuiltins.h"
static GSList *all_icon_factories = NULL;
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 69d0564ee2..73b8b25655 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -41,6 +41,7 @@
#include "gtkscrollable.h"
#include "gtksizerequest.h"
#include "gtktreednd.h"
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
/**
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 340b71cb7a..2d8e130f95 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -25,6 +25,7 @@
*/
#include "config.h"
+
#include <math.h>
#include <string.h>
@@ -36,6 +37,7 @@
#include "gtksizerequest.h"
#include "gtkintl.h"
#include "gtkprivate.h"
+#include "gtktypebuiltins.h"
/**
* SECTION:gtkimage
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index 9905e9830d..e82095e01c 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -46,6 +46,7 @@
#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtkstock.h"
+#include "gtktypebuiltins.h"
/**
* SECTION:gtkinfobar
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 1d664632e2..1ae459627c 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -50,6 +50,7 @@
#include "gtkshow.h"
#include "gtktooltip.h"
#include "gtkprivate.h"
+#include "gtktypebuiltins.h"
/*rint() is only available in GCC and/or C99*/
#if (__STDC_VERSION__ < 199901L && !defined __GNUC__)
diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h
index 82a7392e54..6fe41c4df8 100644
--- a/gtk/gtkmain.h
+++ b/gtk/gtkmain.h
@@ -33,7 +33,6 @@
#include <gdk/gdk.h>
-#include <gtk/gtktypeutils.h>
#include <gtk/gtkwidget.h>
#ifdef G_PLATFORM_WIN32
#include <gtk/gtkbox.h>
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 200b7fd465..adb6646134 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -46,6 +46,7 @@
#include "gtksettings.h"
#include "gtkprivate.h"
#include "gtkintl.h"
+#include "gtktypebuiltins.h"
#define NAVIGATION_REGION_OVERSHOOT 50 /* How much the navigation region
* extends below the submenu
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index 66669fa9e9..42f2f25819 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -37,9 +37,9 @@
#include "gtksettings.h"
#include "gtksizerequest.h"
#include "gtkwindow.h"
-
#include "gtkintl.h"
#include "gtkprivate.h"
+#include "gtktypebuiltins.h"
#define BORDER_SPACING 0
#define DEFAULT_IPADDING 1
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index ec60a85028..6cfc53e8df 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -25,6 +25,7 @@
*/
#include "config.h"
+
#include <string.h>
#include "gtkaccellabel.h"
@@ -40,6 +41,7 @@
#include "gtkbuildable.h"
#include "gtkactivatable.h"
#include "gtkintl.h"
+#include "gtktypebuiltins.h"
enum {
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index 1dfecc2a7b..92b58e75e8 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -40,6 +40,7 @@
#include "gtkwindow.h"
#include "gtkprivate.h"
#include "gtkintl.h"
+#include "gtktypebuiltins.h"
#define MENU_SHELL_TIMEOUT 500
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index 38d39a1da2..dfa3131496 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -26,6 +26,7 @@
*/
#include "config.h"
+
#include <string.h>
#include "gtkmessagedialog.h"
@@ -39,6 +40,7 @@
#include "gtkiconfactory.h"
#include "gtkintl.h"
#include "gtkprivate.h"
+#include "gtktypebuiltins.h"
/**
* SECTION:gtkmessagedialog
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 6034851e7c..0d9d9fad46 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -42,6 +42,7 @@
#include "gtkprivate.h"
#include "gtkdnd.h"
#include "gtkbuildable.h"
+#include "gtktypebuiltins.h"
/**
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index e3cfc98bab..1a7e51e359 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -33,7 +33,7 @@
#include "gtkmarshalers.h"
#include "gtkorientable.h"
#include "gtkwindow.h"
-
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkintl.h"
diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c
index a8101746d1..139041a329 100644
--- a/gtk/gtkprintoperation.c
+++ b/gtk/gtkprintoperation.c
@@ -21,16 +21,18 @@
#include "config.h"
#include <errno.h>
-#include <stdlib.h>
+#include <stdlib.h>
#include <math.h>
-
#include <string.h>
+
+#include <cairo-pdf.h>
+
#include "gtkprintoperation-private.h"
#include "gtkmarshalers.h"
-#include <cairo-pdf.h>
#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtkmessagedialog.h"
+#include "gtktypebuiltins.h"
#define SHOW_PROGRESS_TIME 1200
diff --git a/gtk/gtkprintsettings.c b/gtk/gtkprintsettings.c
index 2235864869..7507bd71e9 100644
--- a/gtk/gtkprintsettings.c
+++ b/gtk/gtkprintsettings.c
@@ -19,12 +19,16 @@
*/
#include "config.h"
+
#include <string.h>
#include <stdlib.h>
+
#include <glib/gprintf.h>
-#include <gtk/gtk.h>
+
#include "gtkprintsettings.h"
#include "gtkprintutils.h"
+#include "gtktypebuiltins.h"
+#include "gtkwidget.h"
typedef struct _GtkPrintSettingsClass GtkPrintSettingsClass;
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index 7cb734c276..2d61cdac31 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -20,14 +20,20 @@
*/
#include "config.h"
+
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <math.h>
-#include "gtkintl.h"
-#include "gtkprivate.h"
+#include "gtkprintunixdialog.h"
+
+#include "gtkcustompaperunixdialog.h"
+#include "gtkprintbackend.h"
+#include "gtkprinter-private.h"
+#include "gtkprinteroptionwidget.h"
+#include "gtkprintutils.h"
#include "gtkspinbutton.h"
#include "gtkcellrendererpixbuf.h"
@@ -49,16 +55,11 @@
#include "gtklabel.h"
#include "gtkeventbox.h"
#include "gtkbuildable.h"
-
-#include "gtkcustompaperunixdialog.h"
-#include "gtkprintbackend.h"
-#include "gtkprinter-private.h"
-#include "gtkprintunixdialog.h"
-#include "gtkprinteroptionwidget.h"
-#include "gtkprintutils.h"
-
#include "gtkmessagedialog.h"
#include "gtkbutton.h"
+#include "gtkintl.h"
+#include "gtkprivate.h"
+#include "gtktypebuiltins.h"
#define EXAMPLE_PAGE_AREA_SIZE 110
#define RULER_DISTANCE 7.5
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 7a7bebf2e4..3d3e8563ec 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -39,6 +39,7 @@
#include "gtkwindow.h"
#include "gtkprivate.h"
#include "gtkintl.h"
+#include "gtktypebuiltins.h"
/**
* SECTION:gtkrange
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c
index 689425f0fd..78d01ac362 100644
--- a/gtk/gtkscalebutton.c
+++ b/gtk/gtkscalebutton.c
@@ -53,7 +53,7 @@
#include "gtkstock.h"
#include "gtkvbox.h"
#include "gtkwindow.h"
-
+#include "gtktypebuiltins.h"
#include "gtkintl.h"
/**
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 81726cde66..828dd8a74a 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -34,6 +34,7 @@
#include "gtkscrolledwindow.h"
#include "gtkwindow.h"
#include "gtkprivate.h"
+#include "gtktypebuiltins.h"
#include "gtkintl.h"
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index c3f87d5296..5148f0e108 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -43,6 +43,7 @@
#include "gtksettings.h"
#include "gtkprivate.h"
#include "gtkintl.h"
+#include "gtktypebuiltins.h"
#define MIN_SPIN_BUTTON_WIDTH 30
#define MAX_TIMER_CALLS 5
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index e38b448e25..334c9a4873 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -26,6 +26,7 @@
*/
#include "config.h"
+
#include "gtkframe.h"
#include "gtklabel.h"
#include "gtkmarshalers.h"
@@ -34,6 +35,7 @@
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkbuildable.h"
+#include "gtktypebuiltins.h"
/**
* SECTION:gtkstatusbar
diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c
index 27f85d9257..6e0751edb5 100644
--- a/gtk/gtkstatusicon.c
+++ b/gtk/gtkstatusicon.c
@@ -42,27 +42,19 @@
#include "gtkprivate.h"
#include "gtkwidget.h"
#include "gtktooltip.h"
+#include "gtkicontheme.h"
+#include "gtklabel.h"
+#include "gtktypebuiltins.h"
#ifdef GDK_WINDOWING_X11
#include "gdk/x11/gdkx.h"
#endif
-#ifdef GDK_WINDOWING_WIN32
-#include "gdk/win32/gdkwin32.h"
-#endif
#ifdef GDK_WINDOWING_WIN32
-#include "gtkicontheme.h"
-#include "gtklabel.h"
-
-#include "win32/gdkwin32.h"
+#include "gdk/win32/gdkwin32.h"
#define WM_GTK_TRAY_NOTIFICATION (WM_USER+1)
#endif
-#ifdef GDK_WINDOWING_QUARTZ
-#include "gtkicontheme.h"
-#include "gtklabel.h"
-#endif
-
#define BLINK_TIMEOUT 500
enum
diff --git a/gtk/gtkstock.h b/gtk/gtkstock.h
index 57e4b8f227..b32d4b162f 100644
--- a/gtk/gtkstock.h
+++ b/gtk/gtkstock.h
@@ -33,10 +33,23 @@
#include <gdk/gdk.h>
-#include <gtk/gtktypeutils.h> /* for GtkTranslateFunc */
G_BEGIN_DECLS
+/*
+ * GtkTranslateFunc:
+ * @path: The id of the message. In #GtkActionGroup this will be a label
+ * or tooltip from a #GtkActionEntry.
+ * @func_data: user data passed in when registering the function
+ *
+ * The function used to translate messages in e.g. #GtkIconFactory
+ * and #GtkActionGroup.
+ *
+ * Returns: the translated message
+ */
+typedef gchar * (*GtkTranslateFunc) (const gchar *path,
+ gpointer func_data);
+
typedef struct _GtkStockItem GtkStockItem;
struct _GtkStockItem
diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c
index cb62ebfa5c..b54cad7472 100644
--- a/gtk/gtktexttag.c
+++ b/gtk/gtktexttag.c
@@ -48,6 +48,10 @@
*/
#include "config.h"
+
+#include <stdlib.h>
+#include <string.h>
+
#include "gtkmain.h"
#include "gtktexttag.h"
#include "gtktexttypes.h"
@@ -55,9 +59,7 @@
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
-
-#include <stdlib.h>
-#include <string.h>
+#include "gtktypebuiltins.h"
enum {
EVENT,
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 1b07b59108..b57db0f1e7 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -50,6 +50,7 @@
#include "gtkwidgetprivate.h"
#include "gtkwindow.h"
#include "gtkscrollable.h"
+#include "gtktypebuiltins.h"
/**
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index c2161a7b04..23ebab621c 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -55,6 +55,7 @@
#include "gtkvbox.h"
#include "gtkprivate.h"
#include "gtkintl.h"
+#include "gtktypebuiltins.h"
/**
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index abcc64014b..20cc10b797 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -22,11 +22,11 @@
#include "config.h"
-#include "gtktoolpaletteprivate.h"
-
-#include <gtk/gtk.h>
#include <math.h>
#include <string.h>
+
+#include "gtktoolpaletteprivate.h"
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkintl.h"
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
index 5429039990..195a43adfb 100644
--- a/gtk/gtktoolpalette.c
+++ b/gtk/gtktoolpalette.c
@@ -26,7 +26,7 @@
#include "gtktoolpaletteprivate.h"
#include "gtkmarshalers.h"
-
+#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkscrollable.h"
#include "gtkintl.h"
diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c
index 2bdd421f94..a8f6a11913 100644
--- a/gtk/gtktrayicon-x11.c
+++ b/gtk/gtktrayicon-x11.c
@@ -23,18 +23,20 @@
*/
#include "config.h"
+
#include <math.h>
#include <string.h>
+#include "x11/gdkx.h"
+#include <X11/Xatom.h>
+#include <cairo-xlib.h>
+
#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtktrayicon.h"
#include "gtktestutils.h"
#include "gtkdebug.h"
-
-#include "x11/gdkx.h"
-#include <X11/Xatom.h>
-#include <cairo-xlib.h>
+#include "gtktypebuiltins.h"
#define SYSTEM_TRAY_REQUEST_DOCK 0
#define SYSTEM_TRAY_BEGIN_MESSAGE 1
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index d8613066c3..0032ae51e6 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -49,6 +49,7 @@
#include "gtkprivate.h"
#include "gtkwidgetprivate.h"
#include "gtkentryprivate.h"
+#include "gtktypebuiltins.h"
/**
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 43f592183f..00a2ea7499 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -36,6 +36,7 @@
#include "gtkcellareabox.h"
#include "gtkprivate.h"
#include "gtkintl.h"
+#include "gtktypebuiltins.h"
/**
diff --git a/gtk/gtktypeutils.c b/gtk/gtktypeutils.c
deleted file mode 100644
index d1e74d91af..0000000000
--- a/gtk/gtktypeutils.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#include "config.h"
-#include <string.h> /* strcmp */
-
-#include "gtktypeutils.h"
-#include "gtkintl.h"
-
-
-
-GType
-gtk_identifier_get_type (void)
-{
- static GType our_type = 0;
-
- if (our_type == 0)
- {
- GTypeInfo tinfo = { 0, };
- our_type = g_type_register_static (G_TYPE_STRING, I_("GtkIdentifier"), &tinfo, 0);
- }
-
- return our_type;
-}
diff --git a/gtk/gtktypeutils.h b/gtk/gtktypeutils.h
deleted file mode 100644
index 91ef2178c9..0000000000
--- a/gtk/gtktypeutils.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only <gtk/gtk.h> can be included directly."
-#endif
-
-#ifndef __GTK_TYPE_UTILS_H__
-#define __GTK_TYPE_UTILS_H__
-
-/* enum types generated by glib-mkenums
- */
-#include <gtk/gtktypebuiltins.h>
-
-G_BEGIN_DECLS
-
-/* urg */
-#define GTK_TYPE_IDENTIFIER (gtk_identifier_get_type ())
-GType gtk_identifier_get_type (void) G_GNUC_CONST;
-
-typedef gchar * (*GtkTranslateFunc) (const gchar *path,
- gpointer func_data);
-
-
-G_END_DECLS
-
-#endif /* __GTK_TYPE_UTILS_H__ */
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 4836a35686..66811ffb6a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -63,6 +63,7 @@
#include "gtkmodifierstyle.h"
#include "gtkversion.h"
#include "gtkdebug.h"
+#include "gtktypebuiltins.h"
/**
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index f514206931..19501f2a9d 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -26,7 +26,7 @@
#include "config.h"
-#include "gtkintl.h"
+#include "gtkwindow.h"
#include <string.h>
#include <stdlib.h>
@@ -35,7 +35,6 @@
#include "gtkprivate.h"
#include "gtkrc.h"
-#include "gtkwindow.h"
#include "gtkwindowprivate.h"
#include "gtkaccelgroupprivate.h"
#include "gtkbindings.h"
@@ -49,6 +48,8 @@
#include "gtkplug.h"
#include "gtkbuildable.h"
#include "gtkwidgetprivate.h"
+#include "gtkintl.h"
+#include "gtktypebuiltins.h"
#ifdef GDK_WINDOWING_X11
#include "x11/gdkx.h"
diff --git a/po-properties/POTFILES.in b/po-properties/POTFILES.in
index da8ed2bd9b..5af45482a0 100644
--- a/po-properties/POTFILES.in
+++ b/po-properties/POTFILES.in
@@ -197,7 +197,6 @@ gtk/gtktreesortable.c
gtk/gtktreestore.c
gtk/gtktreeview.c
gtk/gtktreeviewcolumn.c
-gtk/gtktypeutils.c
gtk/gtkuimanager.c
gtk/gtkvbbox.c
gtk/gtkvbox.c
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 3bb4266da7..55dee16a08 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -198,7 +198,6 @@ gtk/gtktreesortable.c
gtk/gtktreestore.c
gtk/gtktreeview.c
gtk/gtktreeviewcolumn.c
-gtk/gtktypeutils.c
gtk/gtkuimanager.c
gtk/gtkvbbox.c
gtk/gtkvbox.c