summaryrefslogtreecommitdiff
path: root/gtk/gtkobject.c
diff options
context:
space:
mode:
authorTim Janik <timj@gtk.org>1998-06-24 12:22:23 +0000
committerTim Janik <timj@src.gnome.org>1998-06-24 12:22:23 +0000
commit9860caa53955e4522d34aa158d649a5f880f758d (patch)
treea3f58e48771a24f6182e2ec3b8122ed049dcc338 /gtk/gtkobject.c
parent14bd8cf9e5c52629be585d47ce775811f00b3e6a (diff)
downloadgtk+-9860caa53955e4522d34aa158d649a5f880f758d.tar.gz
new function gtk_container_child_arg_set, similar to
Wed Jun 24 14:14:32 1998 Tim Janik <timj@gtk.org> * gtk/gtkcontainer.c: new function gtk_container_child_arg_set, similar to gtk_container_child_arg_setv, but takes a variable argument list. new function gtk_container_get_child_arg_type, which is needed by gtk_object_collect_args. * gtk/gtkobject.c: changed prototype for gtk_object_collect_args, to take a function pointer to figure the argument type. adapted callers to pass gtk_object_get_arg_type. * gtk/gtkwidget.c: adapted gtk_object_collect_args callers to pass gtk_object_get_arg_type.. * gtk/gtkpacker.h: * gtk/gtkpacker.c: (gtk_packer_reorder_child): new function to change the packing order of a child. (gtk_packer_size_request): (gtk_packer_size_allocate): take container->border_width into acount. * gtk/gtkpacker.c: implemented widget arguments: "GtkPacker::spacing", "GtkPacker::border_width", "GtkPacker::pad_x", "GtkPacker::pad_y", "GtkPacker::ipad_x", "GtkPacker::ipad_y". implemented child arguments: "GtkPacker::side", "GtkPacker::anchor", "GtkPacker::expand", "GtkPacker::fill_x", "GtkPacker::fill_y", "GtkPacker::use_default", "GtkPacker::border_width", "GtkPacker::pad_x", "GtkPacker::pad_y", "GtkPacker::ipad_x", "GtkPacker::ipad_y", "GtkPacker::position". * gtk/gtkmisc.c (gtk_misc_set_arg): for padding args, set the padding, not the alignment. * gtk/gtkeventbox.h: * gtk/gtkeventbox.c: GtkType and macro fixups. * gtk/testgtk.c (entry_toggle_sensitive): new function to toggle sensitivity of an entry. * gtk/gtkstyle.c (gtk_style_new): support normal grey as default color for insensitive base. * gtk/gtkentry.c (gtk_entry_realize): set the window backgrounds widget state dependent. (gtk_entry_style_set): likewise. (gtk_entry_state_changed): set background color on state changes. (gtk_entry_draw_text): for non selected text, use state dependent colors. * gtk/gtktogglebutton.c: support for widget arguments "GtkToggleButton::active" and "GtkToggleButton::draw_indicator".
Diffstat (limited to 'gtk/gtkobject.c')
-rw-r--r--gtk/gtkobject.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gtk/gtkobject.c b/gtk/gtkobject.c
index 159487ac30..827d8186cc 100644
--- a/gtk/gtkobject.c
+++ b/gtk/gtkobject.c
@@ -76,6 +76,7 @@ static void gtk_object_finalize (GtkObject *object);
static void gtk_object_notify_weaks (GtkObject *object);
GtkArg* gtk_object_collect_args (guint *nargs,
+ GtkType (*) (const gchar*),
va_list args1,
va_list args2);
@@ -619,7 +620,7 @@ gtk_object_new (GtkType type,
va_start (args1, type);
va_start (args2, type);
- args = gtk_object_collect_args (&nargs, args1, args2);
+ args = gtk_object_collect_args (&nargs, gtk_object_get_arg_type, args1, args2);
gtk_object_setv (obj, nargs, args);
g_free (args);
@@ -846,7 +847,7 @@ gtk_object_set (GtkObject *object,
va_start (args1, object);
va_start (args2, object);
- args = gtk_object_collect_args (&nargs, args1, args2);
+ args = gtk_object_collect_args (&nargs, gtk_object_get_arg_type, args1, args2);
gtk_object_setv (object, nargs, args);
g_free (args);
@@ -1001,7 +1002,7 @@ GtkType
gtk_object_get_arg_type (const gchar *arg_name)
{
GtkArgInfo *info;
- gchar buffer[1024];
+ gchar buffer[128];
gchar *t;
g_return_val_if_fail (arg_name != NULL, 0);
@@ -1009,18 +1010,18 @@ gtk_object_get_arg_type (const gchar *arg_name)
if (!arg_info_ht)
return GTK_TYPE_INVALID;
- if (!arg_name || strlen (arg_name) > 1000)
+ if (!arg_name || strlen (arg_name) > 120)
{
/* security audit
*/
g_warning ("gtk_object_get_arg_type(): argument `arg_name' exceeds maximum size.");
- return 0;
+ return GTK_TYPE_INVALID;
}
t = strchr (arg_name, ':');
if (!t || (t[0] != ':') || (t[1] != ':'))
{
- g_warning ("invalid arg name: \"%s\"\n", arg_name);
+ g_warning ("gtk_object_get_arg_type(): invalid arg name: \"%s\"\n", arg_name);
return GTK_TYPE_INVALID;
}
@@ -1032,7 +1033,7 @@ gtk_object_get_arg_type (const gchar *arg_name)
arg_name = buffer;
}
- info = g_hash_table_lookup (arg_info_ht, (gpointer) arg_name);
+ info = g_hash_table_lookup (arg_info_ht, arg_name);
if (info)
return info->type;
@@ -1360,6 +1361,7 @@ gtk_object_check_class_cast (GtkObjectClass *klass,
GtkArg*
gtk_object_collect_args (guint *nargs,
+ GtkType (*get_arg_type) (const gchar*),
va_list args1,
va_list args2)
{
@@ -1381,7 +1383,7 @@ gtk_object_collect_args (guint *nargs,
continue;
}
- type = gtk_object_get_arg_type (name);
+ type = get_arg_type (name);
switch (GTK_FUNDAMENTAL_TYPE (type))
{
@@ -1458,7 +1460,7 @@ gtk_object_collect_args (guint *nargs,
for (i = 0; i < n; i++)
{
args[i].name = va_arg (args2, char *);
- args[i].type = gtk_object_get_arg_type (args[i].name);
+ args[i].type = get_arg_type (args[i].name);
switch (GTK_FUNDAMENTAL_TYPE (args[i].type))
{