temporary implementation of action signal "debug_msg"

Wed Jul  1 20:58:46 1998  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.h:
        * gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"

        * gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
        error that prevented signal to entry addition for signals with
        parameters.
This commit is contained in:
Tim Janik 1998-07-01 19:36:53 +00:00 committed by Tim Janik
parent 09de6fb1d4
commit 2e8e686cae
13 changed files with 110 additions and 18 deletions

View File

@ -1,3 +1,12 @@
Wed Jul 1 20:58:46 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
* gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
error that prevented signal to entry addition for signals with
parameters.
Wed Jul 1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
* ltconfig: fix for properly detecting shared lib support on

View File

@ -1,3 +1,12 @@
Wed Jul 1 20:58:46 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
* gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
error that prevented signal to entry addition for signals with
parameters.
Wed Jul 1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
* ltconfig: fix for properly detecting shared lib support on

View File

@ -1,3 +1,12 @@
Wed Jul 1 20:58:46 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
* gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
error that prevented signal to entry addition for signals with
parameters.
Wed Jul 1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
* ltconfig: fix for properly detecting shared lib support on

View File

@ -1,3 +1,12 @@
Wed Jul 1 20:58:46 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
* gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
error that prevented signal to entry addition for signals with
parameters.
Wed Jul 1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
* ltconfig: fix for properly detecting shared lib support on

View File

@ -1,3 +1,12 @@
Wed Jul 1 20:58:46 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
* gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
error that prevented signal to entry addition for signals with
parameters.
Wed Jul 1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
* ltconfig: fix for properly detecting shared lib support on

View File

@ -1,3 +1,12 @@
Wed Jul 1 20:58:46 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
* gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
error that prevented signal to entry addition for signals with
parameters.
Wed Jul 1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
* ltconfig: fix for properly detecting shared lib support on

View File

@ -1,3 +1,12 @@
Wed Jul 1 20:58:46 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: temporary implementation of action signal "debug_msg"
* gtk/gtkbindings.c (gtk_binding_entry_add_signal): fixed an off-by-one
error that prevented signal to entry addition for signals with
parameters.
Wed Jul 1 10:05:36 PDT 1998 Manish Singh <yosh@gimp.org>
* ltconfig: fix for properly detecting shared lib support on

View File

@ -965,9 +965,9 @@ gchar*
gtk_accelerator_name (guint accelerator_key,
GdkModifierType accelerator_mods)
{
static const gchar text_release[] = "<Release>";
static const gchar text_shift[] = "<Shift>";
static const gchar text_control[] = "<Control>";
static const gchar text_release[] = "<Release>";
static const gchar text_mod1[] = "<Alt>";
static const gchar text_mod2[] = "<Mod2>";
static const gchar text_mod3[] = "<Mod3>";
@ -984,12 +984,12 @@ gtk_accelerator_name (guint accelerator_key,
keyval_name = "";
l = 0;
if (accelerator_mods & GDK_RELEASE_MASK)
l += sizeof (text_release) - 1;
if (accelerator_mods & GDK_SHIFT_MASK)
l += sizeof (text_shift) - 1;
if (accelerator_mods & GDK_CONTROL_MASK)
l += sizeof (text_control) - 1;
if (accelerator_mods & GDK_RELEASE_MASK)
l += sizeof (text_release) - 1;
if (accelerator_mods & GDK_MOD1_MASK)
l += sizeof (text_mod1) - 1;
if (accelerator_mods & GDK_MOD2_MASK)
@ -1006,6 +1006,11 @@ gtk_accelerator_name (guint accelerator_key,
l = 0;
accelerator[l] = 0;
if (accelerator_mods & GDK_RELEASE_MASK)
{
strcpy (accelerator + l, text_release);
l += sizeof (text_release) - 1;
}
if (accelerator_mods & GDK_SHIFT_MASK)
{
strcpy (accelerator + l, text_shift);
@ -1016,11 +1021,6 @@ gtk_accelerator_name (guint accelerator_key,
strcpy (accelerator + l, text_control);
l += sizeof (text_control) - 1;
}
if (accelerator_mods & GDK_RELEASE_MASK)
{
strcpy (accelerator + l, text_release);
l += sizeof (text_release) - 1;
}
if (accelerator_mods & GDK_MOD1_MASK)
{
strcpy (accelerator + l, text_mod1);

View File

@ -647,19 +647,19 @@ gtk_binding_entry_add_signal (GtkBindingSet *binding_set,
if (!arg->d.string_data)
{
g_warning ("gtk_binding_entry_add_signal(): value of `string' arg[%u] is `NULL'", i);
i = n_args + 2;
i += n_args + 1;
}
break;
default:
g_warning ("gtk_binding_entry_add_signal(): unsupported type `%s' for arg[%u]",
gtk_type_name (arg->arg_type), i);
i = n_args + 2;
i += n_args + 1;
break;
}
}
va_end (args);
if (i == n_args + 1 || i == 0)
if (i == n_args || i == 0)
{
slist = g_slist_reverse (slist);
gtk_binding_entry_add_signall (binding_set, keyval, modifiers, signal_name, slist);

View File

@ -61,15 +61,17 @@ gboolean gtk_pattern_match_simple (const gchar *pattern,
const gchar *string);
/* Binding sets
/* type arguments for internal use only
*/
#define GTK_BINDING_ARG_INT (GTK_TYPE_INT)
#define GTK_BINDING_ARG_LONG (GTK_TYPE_LONG)
#define GTK_BINDING_ARG_FLOAT (GTK_TYPE_FLOAT)
#define GTK_BINDING_ARG_DOUBLE (GTK_TYPE_DOUBLE)
#define GTK_BINDING_ARG_STRING (GTK_TYPE_STRING)
/* Binding sets
*/
typedef struct _GtkBindingSet GtkBindingSet;
typedef struct _GtkBindingEntry GtkBindingEntry;
typedef struct _GtkBindingSignal GtkBindingSignal;

View File

@ -579,10 +579,12 @@ gtk_item_factory_construct (GtkItemFactory *ifactory,
NULL);
gtk_object_ref (GTK_OBJECT (ifactory));
gtk_object_sink (GTK_OBJECT (ifactory));
gtk_signal_connect_object_while_alive (GTK_OBJECT (ifactory->widget),
/*
gtk_signal_connect_object_while_alive (GTK_OBJECT (ifactory->widget),
"destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_SIGNAL_FUNC (gtk_object_destroy),
GTK_OBJECT (ifactory));
*/
gtk_item_factory_add_item (ifactory,
"", NULL,
NULL, 0, NULL, 0,

View File

@ -85,6 +85,7 @@ enum {
CLIENT_EVENT,
NO_EXPOSE_EVENT,
VISIBILITY_NOTIFY_EVENT,
DEBUG_MSG,
LAST_SIGNAL
};
@ -286,6 +287,13 @@ gtk_widget_get_type (void)
*
* results:
*****************************************/
#include "stdio.h"
static void
gtk_widget_debug_msg (GtkWidget *widget,
const gchar *string)
{
fprintf (stderr, "Gtk-DEBUG: %s\n", string);
}
static void
gtk_widget_class_init (GtkWidgetClass *klass)
@ -687,6 +695,14 @@ gtk_widget_class_init (GtkWidgetClass *klass)
gtk_widget_marshal_signal_4,
GTK_TYPE_BOOL, 1,
GTK_TYPE_GDK_EVENT);
widget_signals[DEBUG_MSG] =
gtk_signal_new ("debug_msg",
GTK_RUN_LAST | GTK_RUN_ACTION,
object_class->type,
GTK_SIGNAL_OFFSET (GtkWidgetClass, debug_msg),
gtk_widget_marshal_signal_1,
GTK_TYPE_NONE, 1,
GTK_TYPE_STRING);
gtk_object_class_add_signals (object_class, widget_signals, LAST_SIGNAL);
@ -742,8 +758,10 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->drop_enter_event = NULL;
klass->drop_leave_event = NULL;
klass->drop_data_available_event = NULL;
klass->other_event = NULL;
klass->no_expose_event = NULL;
klass->other_event = NULL;
klass->debug_msg = gtk_widget_debug_msg;
/* bindings test
*/
@ -751,8 +769,11 @@ gtk_widget_class_init (GtkWidgetClass *klass)
GtkBindingSet *binding_set;
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, '9', GDK_CONTROL_MASK|GDK_RELEASE_MASK, "hide", 0);
gtk_binding_entry_add_signal (binding_set, '9', GDK_CONTROL_MASK|GDK_RELEASE_MASK, "show", 0);
gtk_binding_entry_add_signal (binding_set,
'9', GDK_CONTROL_MASK | GDK_RELEASE_MASK,
"debug_msg",
1,
GTK_TYPE_STRING, "GtkWidgetClass test");
}
}

View File

@ -337,6 +337,10 @@ struct _GtkWidgetClass
/* selection */
void (* selection_received) (GtkWidget *widget,
GtkSelectionData *selection_data);
/* action signals */
void (* debug_msg) (GtkWidget *widget,
const gchar *string);
};
struct _GtkWidgetAuxInfo