1997-11-24 22:37:52 +00:00
|
|
|
/* 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 Library 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
|
1998-05-06 01:43:56 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
1997-11-24 22:37:52 +00:00
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
|
|
|
#include <stdarg.h>
|
1998-05-13 04:59:38 +00:00
|
|
|
#include <string.h>
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
#include <stdio.h>
|
1997-11-24 22:37:52 +00:00
|
|
|
#include "gtksignal.h"
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
#include "gtkargcollector.c"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
#define SIGNAL_BLOCK_SIZE (100)
|
|
|
|
#define HANDLER_BLOCK_SIZE (200)
|
|
|
|
#define EMISSION_BLOCK_SIZE (100)
|
|
|
|
#define DISCONNECT_INFO_BLOCK_SIZE (64)
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
#define MAX_SIGNAL_PARAMS (31)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
EMISSION_CONTINUE,
|
|
|
|
EMISSION_RESTART,
|
|
|
|
EMISSION_DONE
|
|
|
|
};
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
#define GTK_RUN_TYPE(x) ((x) & GTK_RUN_MASK)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
|
|
|
|
typedef struct _GtkSignal GtkSignal;
|
|
|
|
typedef struct _GtkSignalHash GtkSignalHash;
|
|
|
|
typedef struct _GtkHandler GtkHandler;
|
|
|
|
typedef struct _GtkHandlerInfo GtkHandlerInfo;
|
|
|
|
typedef struct _GtkEmission GtkEmission;
|
1998-05-07 09:23:50 +00:00
|
|
|
typedef union _GtkEmissionAllocator GtkEmissionAllocator;
|
1998-05-06 01:43:56 +00:00
|
|
|
typedef struct _GtkDisconnectInfo GtkDisconnectInfo;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
typedef void (*GtkSignalMarshaller0) (GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
gpointer data);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
struct _GtkSignal
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id;
|
|
|
|
GtkType object_type;
|
|
|
|
gchar *name;
|
|
|
|
guint function_offset;
|
1998-06-09 07:11:55 +00:00
|
|
|
GtkSignalRunType signal_flags;
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkSignalMarshaller marshaller;
|
|
|
|
GtkType return_val;
|
|
|
|
GtkType *params;
|
|
|
|
guint nparams;
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
struct _GtkSignalHash
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkType object_type;
|
1998-06-19 02:07:47 +00:00
|
|
|
GQuark quark;
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id;
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
1998-02-10 23:49:15 +00:00
|
|
|
struct _GtkHandler
|
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
guint id;
|
|
|
|
guint blocked : 20;
|
|
|
|
guint object_signal : 1;
|
|
|
|
guint after : 1;
|
|
|
|
guint no_marshal : 1;
|
|
|
|
guint16 ref_count;
|
|
|
|
guint16 signal_id;
|
|
|
|
GtkSignalFunc func;
|
|
|
|
gpointer func_data;
|
1998-02-10 23:49:15 +00:00
|
|
|
GtkSignalDestroy destroy_func;
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkHandler *prev;
|
|
|
|
GtkHandler *next;
|
1998-02-10 23:49:15 +00:00
|
|
|
};
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
struct _GtkHandlerInfo
|
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkObject *object;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkSignalMarshaller marshaller;
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkArg *params;
|
|
|
|
GtkType *param_types;
|
|
|
|
GtkType return_val;
|
1998-06-09 07:11:55 +00:00
|
|
|
GtkSignalRunType signal_flags;
|
1998-05-06 01:43:56 +00:00
|
|
|
guint nparams;
|
|
|
|
guint signal_id;
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkEmission
|
|
|
|
{
|
|
|
|
GtkObject *object;
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id;
|
|
|
|
};
|
|
|
|
|
1998-05-07 09:23:50 +00:00
|
|
|
union _GtkEmissionAllocator
|
|
|
|
{
|
|
|
|
GtkEmissionAllocator *next;
|
|
|
|
GtkEmission emission;
|
|
|
|
};
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
struct _GtkDisconnectInfo
|
|
|
|
{
|
|
|
|
GtkObject *object1;
|
|
|
|
guint disconnect_handler1;
|
|
|
|
guint signal_handler;
|
|
|
|
GtkObject *object2;
|
|
|
|
guint disconnect_handler2;
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1998-06-10 16:59:28 +00:00
|
|
|
static guint gtk_signal_hash (gconstpointer h);
|
|
|
|
static gint gtk_signal_compare (gconstpointer h1,
|
|
|
|
gconstpointer h2);
|
1997-11-24 22:37:52 +00:00
|
|
|
static GtkHandler* gtk_signal_handler_new (void);
|
1998-05-06 01:43:56 +00:00
|
|
|
static void gtk_signal_handler_ref (GtkHandler *handler);
|
|
|
|
static void gtk_signal_handler_unref (GtkHandler *handler,
|
1998-01-30 23:47:09 +00:00
|
|
|
GtkObject *object);
|
1998-05-06 01:43:56 +00:00
|
|
|
static void gtk_signal_handler_insert (GtkObject *object,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkHandler *handler);
|
1998-05-06 01:43:56 +00:00
|
|
|
static void gtk_signal_real_emit (GtkObject *object,
|
1998-07-15 12:25:43 +00:00
|
|
|
guint signal_id,
|
1998-05-09 01:17:03 +00:00
|
|
|
GtkArg *params);
|
1998-02-10 23:49:15 +00:00
|
|
|
static GtkHandler* gtk_signal_get_handlers (GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_type);
|
|
|
|
static guint gtk_signal_connect_by_type (GtkObject *object,
|
|
|
|
guint signal_id,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkSignalFunc func,
|
|
|
|
gpointer func_data,
|
|
|
|
GtkSignalDestroy destroy_func,
|
1998-05-06 01:43:56 +00:00
|
|
|
gint object_signal,
|
|
|
|
gint after,
|
|
|
|
gint no_marshal);
|
|
|
|
static guint gtk_alive_disconnecter (GtkDisconnectInfo *info);
|
|
|
|
static GtkEmission* gtk_emission_new (void);
|
|
|
|
static void gtk_emission_add (GList **emissions,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_type);
|
|
|
|
static void gtk_emission_remove (GList **emissions,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_type);
|
|
|
|
static gint gtk_emission_check (GList *emissions,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_type);
|
|
|
|
static gint gtk_handlers_run (GtkHandler *handlers,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkHandlerInfo *info,
|
1998-05-06 01:43:56 +00:00
|
|
|
gint after);
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
static gboolean gtk_signal_collect_params (GtkArg *params,
|
1998-05-06 01:43:56 +00:00
|
|
|
guint nparams,
|
|
|
|
GtkType *param_types,
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
GtkType return_type,
|
|
|
|
va_list var_args);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
#define LOOKUP_SIGNAL_ID(signal_id) ( \
|
|
|
|
signal_id > 0 && signal_id < gtk_n_signals ? \
|
|
|
|
(GtkSignal*) gtk_signals + signal_id : \
|
|
|
|
(GtkSignal*) 0 \
|
|
|
|
)
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
static GtkSignalMarshal global_marshaller = NULL;
|
|
|
|
static GtkSignalDestroy global_destroy_notify = NULL;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-05-07 09:23:50 +00:00
|
|
|
static guint gtk_handler_id = 1;
|
1998-06-19 02:07:47 +00:00
|
|
|
static guint handler_quark = 0;
|
1998-05-07 09:23:50 +00:00
|
|
|
static GHashTable *gtk_signal_hash_table = NULL;
|
|
|
|
static GtkSignal *gtk_signals = NULL;
|
|
|
|
static guint gtk_n_signals = 0;
|
|
|
|
static GMemChunk *gtk_signal_hash_mem_chunk = NULL;
|
|
|
|
static GMemChunk *gtk_disconnect_info_mem_chunk = NULL;
|
|
|
|
static GtkHandler *gtk_handler_free_list = NULL;
|
|
|
|
static GtkEmissionAllocator *gtk_emission_free_list = NULL;
|
|
|
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
static GList *current_emissions = NULL;
|
|
|
|
static GList *stop_emissions = NULL;
|
|
|
|
static GList *restart_emissions = NULL;
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
static GtkSignal*
|
|
|
|
gtk_signal_next_and_invalidate (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
static guint gtk_n_free_signals = 0;
|
|
|
|
register GtkSignal *signal;
|
|
|
|
register guint new_signal_id;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
/* don't keep *any* GtkSignal pointers across invokation of this function!!!
|
|
|
|
*/
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
if (gtk_n_free_signals == 0)
|
1998-01-29 20:44:14 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
register guint i;
|
|
|
|
register guint size;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
/* nearest pow
|
|
|
|
*/
|
|
|
|
size = gtk_n_signals + SIGNAL_BLOCK_SIZE;
|
|
|
|
size *= sizeof (GtkSignal);
|
|
|
|
i = 1;
|
|
|
|
while (i < size)
|
|
|
|
i <<= 1;
|
|
|
|
size = i;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signals = g_realloc (gtk_signals, size);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_n_free_signals = size / sizeof (GtkSignal) - gtk_n_signals;
|
|
|
|
|
|
|
|
memset (gtk_signals + gtk_n_signals, 0, gtk_n_free_signals * sizeof (GtkSignal));
|
1998-01-29 20:44:14 +00:00
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
new_signal_id = gtk_n_signals++;
|
|
|
|
gtk_n_free_signals--;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal = LOOKUP_SIGNAL_ID (new_signal_id);
|
|
|
|
if (signal)
|
|
|
|
signal->signal_id = new_signal_id;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
return signal;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_signal_init (void)
|
|
|
|
{
|
1998-06-19 02:07:47 +00:00
|
|
|
if (!handler_quark)
|
1998-05-06 01:43:56 +00:00
|
|
|
{
|
|
|
|
GtkSignal *zero;
|
|
|
|
|
|
|
|
zero = gtk_signal_next_and_invalidate ();
|
|
|
|
g_assert (zero == NULL);
|
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
handler_quark = g_quark_from_static_string ("gtk-signal-handlers");
|
1998-05-06 01:43:56 +00:00
|
|
|
|
|
|
|
gtk_signal_hash_mem_chunk =
|
|
|
|
g_mem_chunk_new ("GtkSignalHash mem chunk",
|
|
|
|
sizeof (GtkSignalHash),
|
|
|
|
sizeof (GtkSignalHash) * SIGNAL_BLOCK_SIZE,
|
|
|
|
G_ALLOC_ONLY);
|
|
|
|
gtk_disconnect_info_mem_chunk =
|
|
|
|
g_mem_chunk_new ("GtkDisconnectInfo mem chunk",
|
|
|
|
sizeof (GtkDisconnectInfo),
|
|
|
|
sizeof (GtkDisconnectInfo) * DISCONNECT_INFO_BLOCK_SIZE,
|
|
|
|
G_ALLOC_AND_FREE);
|
1998-05-07 09:23:50 +00:00
|
|
|
gtk_handler_free_list = NULL;
|
|
|
|
gtk_emission_free_list = NULL;
|
1998-05-06 01:43:56 +00:00
|
|
|
|
|
|
|
gtk_signal_hash_table = g_hash_table_new (gtk_signal_hash,
|
|
|
|
gtk_signal_compare);
|
|
|
|
}
|
1998-01-29 20:44:14 +00:00
|
|
|
}
|
|
|
|
|
1998-03-09 15:16:28 +00:00
|
|
|
guint
|
1998-05-07 09:23:50 +00:00
|
|
|
gtk_signal_newv (const gchar *r_name,
|
1998-06-09 07:11:55 +00:00
|
|
|
GtkSignalRunType signal_flags,
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkType object_type,
|
|
|
|
guint function_offset,
|
1998-01-29 20:44:14 +00:00
|
|
|
GtkSignalMarshaller marshaller,
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkType return_val,
|
|
|
|
guint nparams,
|
1998-01-29 20:44:14 +00:00
|
|
|
GtkType *params)
|
|
|
|
{
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkSignal *signal;
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkSignalHash *hash;
|
1998-06-19 02:07:47 +00:00
|
|
|
GQuark quark;
|
1998-01-29 20:44:14 +00:00
|
|
|
guint i;
|
1998-05-07 09:23:50 +00:00
|
|
|
gchar *name;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-07 09:23:50 +00:00
|
|
|
g_return_val_if_fail (r_name != NULL, 0);
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_val_if_fail (marshaller != NULL, 0);
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
g_return_val_if_fail (nparams < MAX_SIGNAL_PARAMS, 0);
|
1998-01-29 20:44:14 +00:00
|
|
|
if (nparams)
|
|
|
|
g_return_val_if_fail (params != NULL, 0);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
if (!handler_quark)
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_signal_init ();
|
1998-05-07 09:23:50 +00:00
|
|
|
|
1998-05-18 04:31:03 +00:00
|
|
|
|
1998-05-07 09:23:50 +00:00
|
|
|
name = g_strdup (r_name);
|
|
|
|
g_strdelimit (name, NULL, '_');
|
1998-05-18 04:31:03 +00:00
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
quark = gtk_signal_lookup (name, object_type);
|
|
|
|
if (quark)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-03-08 10:41:48 +00:00
|
|
|
g_warning ("gtk_signal_newv(): signal \"%s\" already exists in the `%s' class ancestry\n",
|
1998-05-07 09:23:50 +00:00
|
|
|
r_name,
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_type_name (object_type));
|
1998-05-07 09:23:50 +00:00
|
|
|
g_free (name);
|
1997-11-24 22:37:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-18 04:31:03 +00:00
|
|
|
if (return_val != GTK_TYPE_NONE &&
|
1998-06-09 07:11:55 +00:00
|
|
|
(signal_flags & GTK_RUN_BOTH) == GTK_RUN_FIRST)
|
1998-05-18 04:31:03 +00:00
|
|
|
{
|
|
|
|
g_warning ("gtk_signal_newv(): signal \"%s\" with return value `%s' excludes GTK_RUN_LAST",
|
|
|
|
name, gtk_type_name (return_val));
|
1998-06-19 02:07:47 +00:00
|
|
|
g_free (name);
|
1998-05-18 04:31:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal = gtk_signal_next_and_invalidate ();
|
|
|
|
|
|
|
|
/* signal->signal_id already set */
|
|
|
|
|
|
|
|
signal->object_type = object_type;
|
1998-05-07 09:23:50 +00:00
|
|
|
signal->name = name;
|
1997-11-24 22:37:52 +00:00
|
|
|
signal->function_offset = function_offset;
|
1998-06-09 07:11:55 +00:00
|
|
|
signal->signal_flags = signal_flags;
|
1997-11-24 22:37:52 +00:00
|
|
|
signal->marshaller = marshaller;
|
|
|
|
signal->return_val = return_val;
|
|
|
|
signal->nparams = nparams;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (nparams > 0)
|
|
|
|
{
|
|
|
|
signal->params = g_new (GtkType, nparams);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
for (i = 0; i < nparams; i++)
|
1998-01-29 20:44:14 +00:00
|
|
|
signal->params[i] = params[i];
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-01-29 20:44:14 +00:00
|
|
|
else
|
|
|
|
signal->params = NULL;
|
1998-05-07 09:23:50 +00:00
|
|
|
|
|
|
|
/* insert "signal_name" into hash table
|
|
|
|
*/
|
1998-05-06 01:43:56 +00:00
|
|
|
hash = g_chunk_new (GtkSignalHash, gtk_signal_hash_mem_chunk);
|
|
|
|
hash->object_type = object_type;
|
1998-06-19 02:07:47 +00:00
|
|
|
hash->quark = g_quark_from_string (signal->name);
|
1998-05-06 01:43:56 +00:00
|
|
|
hash->signal_id = signal->signal_id;
|
1998-05-13 04:59:38 +00:00
|
|
|
g_hash_table_insert (gtk_signal_hash_table, hash, GUINT_TO_POINTER (hash->signal_id));
|
1998-05-07 09:23:50 +00:00
|
|
|
|
|
|
|
/* insert "signal-name" into hash table
|
|
|
|
*/
|
|
|
|
g_strdelimit (signal->name, NULL, '-');
|
1998-06-19 02:07:47 +00:00
|
|
|
quark = g_quark_from_static_string (signal->name);
|
|
|
|
if (quark != hash->quark)
|
1998-05-07 09:23:50 +00:00
|
|
|
{
|
|
|
|
hash = g_chunk_new (GtkSignalHash, gtk_signal_hash_mem_chunk);
|
|
|
|
hash->object_type = object_type;
|
1998-06-19 02:07:47 +00:00
|
|
|
hash->quark = quark;
|
1998-05-07 09:23:50 +00:00
|
|
|
hash->signal_id = signal->signal_id;
|
1998-05-13 04:59:38 +00:00
|
|
|
g_hash_table_insert (gtk_signal_hash_table, hash, GUINT_TO_POINTER (hash->signal_id));
|
1998-05-07 09:23:50 +00:00
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
return signal->signal_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
|
|
|
gtk_signal_new (const gchar *name,
|
1998-06-09 07:11:55 +00:00
|
|
|
GtkSignalRunType signal_flags,
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkType object_type,
|
|
|
|
guint function_offset,
|
|
|
|
GtkSignalMarshaller marshaller,
|
|
|
|
GtkType return_val,
|
|
|
|
guint nparams,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
GtkType *params;
|
|
|
|
guint i;
|
|
|
|
va_list args;
|
|
|
|
guint signal_id;
|
|
|
|
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
g_return_val_if_fail (nparams < MAX_SIGNAL_PARAMS, 0);
|
1998-05-06 01:43:56 +00:00
|
|
|
|
|
|
|
if (nparams > 0)
|
|
|
|
{
|
|
|
|
params = g_new (GtkType, nparams);
|
|
|
|
|
|
|
|
va_start (args, nparams);
|
|
|
|
|
|
|
|
for (i = 0; i < nparams; i++)
|
|
|
|
params[i] = va_arg (args, GtkType);
|
|
|
|
|
|
|
|
va_end (args);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
params = NULL;
|
|
|
|
|
|
|
|
signal_id = gtk_signal_newv (name,
|
1998-06-09 07:11:55 +00:00
|
|
|
signal_flags,
|
1998-05-06 01:43:56 +00:00
|
|
|
object_type,
|
|
|
|
function_offset,
|
|
|
|
marshaller,
|
|
|
|
return_val,
|
|
|
|
nparams,
|
|
|
|
params);
|
|
|
|
|
|
|
|
g_free (params);
|
|
|
|
|
|
|
|
return signal_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
|
|
|
gtk_signal_lookup (const gchar *name,
|
|
|
|
GtkType object_type)
|
|
|
|
{
|
|
|
|
GtkSignalHash hash;
|
|
|
|
|
|
|
|
g_return_val_if_fail (name != NULL, 0);
|
1998-05-08 23:20:48 +00:00
|
|
|
g_return_val_if_fail (gtk_type_is_a (object_type, GTK_TYPE_OBJECT), 0);
|
1998-05-06 01:43:56 +00:00
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
hash.quark = g_quark_try_string (name);
|
|
|
|
if (hash.quark)
|
1998-05-06 01:43:56 +00:00
|
|
|
{
|
|
|
|
while (object_type)
|
|
|
|
{
|
|
|
|
guint signal_id;
|
|
|
|
|
|
|
|
hash.object_type = object_type;
|
|
|
|
|
1998-05-13 04:59:38 +00:00
|
|
|
signal_id = GPOINTER_TO_UINT (g_hash_table_lookup (gtk_signal_hash_table, &hash));
|
1998-05-06 01:43:56 +00:00
|
|
|
if (signal_id)
|
|
|
|
return signal_id;
|
|
|
|
|
|
|
|
object_type = gtk_type_parent (object_type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-01-29 20:44:14 +00:00
|
|
|
GtkSignalQuery*
|
1998-03-09 15:16:28 +00:00
|
|
|
gtk_signal_query (guint signal_id)
|
1998-01-29 20:44:14 +00:00
|
|
|
{
|
|
|
|
GtkSignalQuery *query;
|
|
|
|
GtkSignal *signal;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (signal_id >= 1, NULL);
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal = LOOKUP_SIGNAL_ID (signal_id);
|
1998-01-29 20:44:14 +00:00
|
|
|
if (signal)
|
|
|
|
{
|
|
|
|
query = g_new (GtkSignalQuery, 1);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
query->object_type = signal->object_type;
|
1998-03-09 15:16:28 +00:00
|
|
|
query->signal_id = signal_id;
|
1998-05-06 01:43:56 +00:00
|
|
|
query->signal_name = signal->name;
|
1998-01-29 20:44:14 +00:00
|
|
|
query->is_user_signal = signal->function_offset == 0;
|
1998-06-09 07:11:55 +00:00
|
|
|
query->signal_flags = signal->signal_flags;
|
1998-01-29 20:44:14 +00:00
|
|
|
query->return_val = signal->return_val;
|
|
|
|
query->nparams = signal->nparams;
|
|
|
|
query->params = signal->params;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
query = NULL;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-01-29 20:44:14 +00:00
|
|
|
return query;
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gchar*
|
1998-03-09 15:16:28 +00:00
|
|
|
gtk_signal_name (guint signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GtkSignal *signal;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (signal_id >= 1, NULL);
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal = LOOKUP_SIGNAL_ID (signal_id);
|
1997-11-24 22:37:52 +00:00
|
|
|
if (signal)
|
1998-05-06 01:43:56 +00:00
|
|
|
return signal->name;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1998-05-09 01:17:03 +00:00
|
|
|
void
|
|
|
|
gtk_signal_emitv (GtkObject *object,
|
|
|
|
guint signal_id,
|
|
|
|
GtkArg *params)
|
|
|
|
{
|
|
|
|
GtkSignal *signal;
|
|
|
|
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (signal_id >= 1);
|
|
|
|
|
|
|
|
signal = LOOKUP_SIGNAL_ID (signal_id);
|
|
|
|
g_return_if_fail (signal != NULL);
|
|
|
|
g_return_if_fail (gtk_type_is_a (GTK_OBJECT_TYPE (object), signal->object_type));
|
|
|
|
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
if (signal->nparams > 0)
|
|
|
|
g_return_if_fail (params != NULL);
|
|
|
|
|
1998-07-15 12:25:43 +00:00
|
|
|
gtk_signal_real_emit (object, signal_id, params);
|
1998-05-09 01:17:03 +00:00
|
|
|
}
|
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
void
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_signal_emit (GtkObject *object,
|
1998-05-09 01:17:03 +00:00
|
|
|
guint signal_id,
|
1997-11-24 22:37:52 +00:00
|
|
|
...)
|
|
|
|
{
|
1998-05-09 01:17:03 +00:00
|
|
|
GtkSignal *signal;
|
|
|
|
va_list args;
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
GtkArg params[MAX_SIGNAL_PARAMS + 1];
|
|
|
|
gboolean abort;
|
1998-05-09 01:17:03 +00:00
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
g_return_if_fail (signal_id >= 1);
|
|
|
|
|
1998-05-09 01:17:03 +00:00
|
|
|
signal = LOOKUP_SIGNAL_ID (signal_id);
|
|
|
|
g_return_if_fail (signal != NULL);
|
|
|
|
g_return_if_fail (gtk_type_is_a (GTK_OBJECT_TYPE (object), signal->object_type));
|
|
|
|
|
1998-03-09 15:16:28 +00:00
|
|
|
va_start (args, signal_id);
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
abort = gtk_signal_collect_params (params,
|
|
|
|
signal->nparams,
|
|
|
|
signal->params,
|
|
|
|
signal->return_val,
|
|
|
|
args);
|
1998-05-09 01:17:03 +00:00
|
|
|
va_end (args);
|
|
|
|
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
if (!abort)
|
1998-07-15 12:25:43 +00:00
|
|
|
gtk_signal_real_emit (object, signal_id, params);
|
1998-05-09 01:17:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_signal_emitv_by_name (GtkObject *object,
|
|
|
|
const gchar *name,
|
|
|
|
GtkArg *params)
|
|
|
|
{
|
|
|
|
guint signal_id;
|
|
|
|
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (name != NULL);
|
|
|
|
g_return_if_fail (params != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-09 01:17:03 +00:00
|
|
|
signal_id = gtk_signal_lookup (name, GTK_OBJECT_TYPE (object));
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-09 01:17:03 +00:00
|
|
|
if (signal_id >= 1)
|
|
|
|
{
|
|
|
|
GtkSignal *signal;
|
|
|
|
|
|
|
|
signal = LOOKUP_SIGNAL_ID (signal_id);
|
|
|
|
g_return_if_fail (signal != NULL);
|
|
|
|
g_return_if_fail (gtk_type_is_a (GTK_OBJECT_TYPE (object), signal->object_type));
|
|
|
|
|
1998-07-15 12:25:43 +00:00
|
|
|
gtk_signal_real_emit (object, signal_id, params);
|
1998-05-09 01:17:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("gtk_signal_emitv_by_name(): could not find signal \"%s\" in the `%s' class ancestry",
|
|
|
|
name,
|
|
|
|
gtk_type_name (GTK_OBJECT_TYPE (object)));
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
void
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_emit_by_name (GtkObject *object,
|
|
|
|
const gchar *name,
|
1997-11-24 22:37:52 +00:00
|
|
|
...)
|
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
g_return_if_fail (name != NULL);
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal_id = gtk_signal_lookup (name, GTK_OBJECT_TYPE (object));
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
if (signal_id >= 1)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-09 01:17:03 +00:00
|
|
|
GtkSignal *signal;
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
GtkArg params[MAX_SIGNAL_PARAMS + 1];
|
1998-05-09 01:17:03 +00:00
|
|
|
va_list args;
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
gboolean abort;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-09 01:17:03 +00:00
|
|
|
signal = LOOKUP_SIGNAL_ID (signal_id);
|
|
|
|
g_return_if_fail (signal != NULL);
|
|
|
|
g_return_if_fail (gtk_type_is_a (GTK_OBJECT_TYPE (object), signal->object_type));
|
|
|
|
|
|
|
|
va_start (args, name);
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
abort = gtk_signal_collect_params (params,
|
|
|
|
signal->nparams,
|
|
|
|
signal->params,
|
|
|
|
signal->return_val,
|
|
|
|
args);
|
1997-11-24 22:37:52 +00:00
|
|
|
va_end (args);
|
1998-05-09 01:17:03 +00:00
|
|
|
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
if (!abort)
|
1998-07-15 12:25:43 +00:00
|
|
|
gtk_signal_real_emit (object, signal_id, params);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-03-08 10:41:48 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("gtk_signal_emit_by_name(): could not find signal \"%s\" in the `%s' class ancestry",
|
1998-05-06 01:43:56 +00:00
|
|
|
name,
|
|
|
|
gtk_type_name (GTK_OBJECT_TYPE (object)));
|
1998-03-08 10:41:48 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_signal_emit_stop (GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (object != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
g_return_if_fail (signal_id >= 1);
|
|
|
|
|
|
|
|
if (gtk_emission_check (current_emissions, object, signal_id))
|
|
|
|
gtk_emission_add (&stop_emissions, object, signal_id);
|
1998-03-08 10:41:48 +00:00
|
|
|
else
|
1998-03-09 15:16:28 +00:00
|
|
|
g_warning ("gtk_signal_emit_stop(): no current emission (%u) for object `%s'",
|
1998-05-06 01:43:56 +00:00
|
|
|
signal_id,
|
|
|
|
gtk_type_name (GTK_OBJECT_TYPE (object)));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_emit_stop_by_name (GtkObject *object,
|
1997-11-24 22:37:52 +00:00
|
|
|
const gchar *name)
|
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (name != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal_id = gtk_signal_lookup (name, GTK_OBJECT_TYPE (object));
|
|
|
|
if (signal_id)
|
|
|
|
gtk_signal_emit_stop (object, signal_id);
|
1998-03-08 10:41:48 +00:00
|
|
|
else
|
|
|
|
g_warning ("gtk_signal_emit_stop_by_name(): could not find signal \"%s\" in the `%s' class ancestry",
|
1998-05-06 01:43:56 +00:00
|
|
|
name,
|
|
|
|
gtk_type_name (GTK_OBJECT_TYPE (object)));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-05-03 19:13:24 +00:00
|
|
|
guint
|
|
|
|
gtk_signal_n_emissions (GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id)
|
1998-05-03 19:13:24 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
GList *list;
|
1998-05-03 19:13:24 +00:00
|
|
|
guint n;
|
|
|
|
|
|
|
|
g_return_val_if_fail (object != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_OBJECT (object), 0);
|
|
|
|
|
|
|
|
n = 0;
|
1998-05-06 01:43:56 +00:00
|
|
|
for (list = current_emissions; list; list = list->next)
|
1998-05-03 19:13:24 +00:00
|
|
|
{
|
|
|
|
GtkEmission *emission;
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
emission = list->data;
|
1998-05-03 19:13:24 +00:00
|
|
|
|
|
|
|
if ((emission->object == object) &&
|
1998-05-06 01:43:56 +00:00
|
|
|
(emission->signal_id == signal_id))
|
1998-05-03 19:13:24 +00:00
|
|
|
n++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_n_emissions_by_name (GtkObject *object,
|
|
|
|
const gchar *name)
|
1998-05-03 19:13:24 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id;
|
1998-05-03 19:13:24 +00:00
|
|
|
guint n;
|
|
|
|
|
|
|
|
g_return_val_if_fail (object != NULL, 0);
|
|
|
|
g_return_val_if_fail (GTK_IS_OBJECT (object), 0);
|
|
|
|
g_return_val_if_fail (name != NULL, 0);
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal_id = gtk_signal_lookup (name, GTK_OBJECT_TYPE (object));
|
|
|
|
if (signal_id)
|
|
|
|
n = gtk_signal_n_emissions (object, signal_id);
|
1998-05-03 19:13:24 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("gtk_signal_n_emissions_by_name(): could not find signal \"%s\" in the `%s' class ancestry",
|
1998-05-06 01:43:56 +00:00
|
|
|
name,
|
|
|
|
gtk_type_name (GTK_OBJECT_TYPE (object)));
|
1998-05-03 19:13:24 +00:00
|
|
|
n = 0;
|
|
|
|
}
|
1998-05-06 01:43:56 +00:00
|
|
|
|
1998-05-03 19:13:24 +00:00
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
1998-03-09 15:16:28 +00:00
|
|
|
guint
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_connect (GtkObject *object,
|
|
|
|
const gchar *name,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkSignalFunc func,
|
1998-05-06 01:43:56 +00:00
|
|
|
gpointer func_data)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_val_if_fail (object != NULL, 0);
|
1998-05-03 19:13:24 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_OBJECT (object), 0);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal_id = gtk_signal_lookup (name, GTK_OBJECT_TYPE (object));
|
|
|
|
if (!signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-03-08 10:41:48 +00:00
|
|
|
g_warning ("gtk_signal_connect(): could not find signal \"%s\" in the `%s' class ancestry",
|
1998-05-06 01:43:56 +00:00
|
|
|
name,
|
|
|
|
gtk_type_name (GTK_OBJECT_TYPE (object)));
|
1997-11-24 22:37:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
return gtk_signal_connect_by_type (object, signal_id,
|
1997-11-24 22:37:52 +00:00
|
|
|
func, func_data, NULL,
|
1998-02-13 05:19:06 +00:00
|
|
|
FALSE, FALSE, FALSE);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-03-09 15:16:28 +00:00
|
|
|
guint
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_connect_after (GtkObject *object,
|
|
|
|
const gchar *name,
|
|
|
|
GtkSignalFunc func,
|
|
|
|
gpointer func_data)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_val_if_fail (object != NULL, 0);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal_id = gtk_signal_lookup (name, GTK_OBJECT_TYPE (object));
|
|
|
|
if (!signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-03-08 10:41:48 +00:00
|
|
|
g_warning ("gtk_signal_connect_after(): could not find signal \"%s\" in the `%s' class ancestry",
|
1998-05-06 01:43:56 +00:00
|
|
|
name,
|
|
|
|
gtk_type_name (GTK_OBJECT_TYPE (object)));
|
1997-11-24 22:37:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
return gtk_signal_connect_by_type (object, signal_id,
|
1997-11-24 22:37:52 +00:00
|
|
|
func, func_data, NULL,
|
1998-02-13 05:19:06 +00:00
|
|
|
FALSE, TRUE, FALSE);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
guint
|
|
|
|
gtk_signal_connect_full (GtkObject *object,
|
|
|
|
const gchar *name,
|
|
|
|
GtkSignalFunc func,
|
1998-02-13 05:19:06 +00:00
|
|
|
GtkCallbackMarshal marshal,
|
1998-05-06 01:43:56 +00:00
|
|
|
gpointer func_data,
|
1998-02-13 05:19:06 +00:00
|
|
|
GtkDestroyNotify destroy_func,
|
1998-05-06 01:43:56 +00:00
|
|
|
gint object_signal,
|
|
|
|
gint after)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_val_if_fail (object != NULL, 0);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal_id = gtk_signal_lookup (name, GTK_OBJECT_TYPE (object));
|
|
|
|
if (!signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-03-08 10:41:48 +00:00
|
|
|
g_warning ("gtk_signal_connect_full(): could not find signal \"%s\" in the `%s' class ancestry",
|
1998-05-06 01:43:56 +00:00
|
|
|
name,
|
|
|
|
gtk_type_name (GTK_OBJECT_TYPE (object)));
|
1997-11-24 22:37:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-02-13 05:19:06 +00:00
|
|
|
if (marshal)
|
1998-05-06 01:43:56 +00:00
|
|
|
return gtk_signal_connect_by_type (object, signal_id, (GtkSignalFunc) marshal,
|
1998-02-13 05:19:06 +00:00
|
|
|
func_data, destroy_func,
|
|
|
|
object_signal, after, TRUE);
|
|
|
|
else
|
1998-05-06 01:43:56 +00:00
|
|
|
return gtk_signal_connect_by_type (object, signal_id, func,
|
1998-02-13 05:19:06 +00:00
|
|
|
func_data, destroy_func,
|
|
|
|
object_signal, after, FALSE);
|
|
|
|
}
|
|
|
|
|
1998-03-09 15:16:28 +00:00
|
|
|
guint
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_connect_interp (GtkObject *object,
|
|
|
|
const gchar *name,
|
1998-02-13 05:19:06 +00:00
|
|
|
GtkCallbackMarshal func,
|
1998-05-06 01:43:56 +00:00
|
|
|
gpointer func_data,
|
1998-02-13 05:19:06 +00:00
|
|
|
GtkDestroyNotify destroy_func,
|
1998-05-06 01:43:56 +00:00
|
|
|
gint after)
|
1998-02-13 05:19:06 +00:00
|
|
|
{
|
|
|
|
return gtk_signal_connect_full (object, name, NULL, func,
|
|
|
|
func_data, destroy_func, FALSE, after);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-03-09 15:16:28 +00:00
|
|
|
guint
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_connect_object (GtkObject *object,
|
|
|
|
const gchar *name,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkSignalFunc func,
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkObject *slot_object)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_val_if_fail (object != NULL, 0);
|
1998-05-06 01:43:56 +00:00
|
|
|
/* slot_object needs to be treated as ordinary pointer
|
|
|
|
*/
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal_id = gtk_signal_lookup (name, GTK_OBJECT_TYPE (object));
|
|
|
|
if (!signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-03-08 10:41:48 +00:00
|
|
|
g_warning ("gtk_signal_connect_object(): could not find signal \"%s\" in the `%s' class ancestry",
|
1998-05-06 01:43:56 +00:00
|
|
|
name,
|
|
|
|
gtk_type_name (GTK_OBJECT_TYPE (object)));
|
1997-11-24 22:37:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
return gtk_signal_connect_by_type (object, signal_id,
|
1997-11-24 22:37:52 +00:00
|
|
|
func, slot_object, NULL,
|
1998-02-13 05:19:06 +00:00
|
|
|
TRUE, FALSE, FALSE);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-03-09 15:16:28 +00:00
|
|
|
guint
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_signal_connect_object_after (GtkObject *object,
|
|
|
|
const gchar *name,
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkSignalFunc func,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkObject *slot_object)
|
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_val_if_fail (object != NULL, 0);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
signal_id = gtk_signal_lookup (name, GTK_OBJECT_TYPE (object));
|
|
|
|
if (!signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-03-08 10:41:48 +00:00
|
|
|
g_warning ("gtk_signal_connect_object_after(): could not find signal \"%s\" in the `%s' class ancestry",
|
1998-05-06 01:43:56 +00:00
|
|
|
name,
|
|
|
|
gtk_type_name (GTK_OBJECT_TYPE (object)));
|
1997-11-24 22:37:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
return gtk_signal_connect_by_type (object, signal_id,
|
1997-11-24 22:37:52 +00:00
|
|
|
func, slot_object, NULL,
|
1998-02-13 05:19:06 +00:00
|
|
|
TRUE, TRUE, FALSE);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-02-03 21:36:06 +00:00
|
|
|
void
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_connect_while_alive (GtkObject *object,
|
|
|
|
const gchar *signal,
|
|
|
|
GtkSignalFunc func,
|
|
|
|
gpointer func_data,
|
|
|
|
GtkObject *alive_object)
|
1998-02-03 21:36:06 +00:00
|
|
|
{
|
|
|
|
GtkDisconnectInfo *info;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-02-03 21:36:06 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_OBJECT (object));
|
|
|
|
g_return_if_fail (signal != NULL);
|
|
|
|
g_return_if_fail (func != NULL);
|
|
|
|
g_return_if_fail (alive_object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_OBJECT (alive_object));
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
info = g_chunk_new (GtkDisconnectInfo, gtk_disconnect_info_mem_chunk);
|
1998-02-03 21:36:06 +00:00
|
|
|
info->object1 = object;
|
|
|
|
info->object2 = alive_object;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-02-03 21:36:06 +00:00
|
|
|
info->signal_handler = gtk_signal_connect (object, signal, func, func_data);
|
1998-05-06 01:43:56 +00:00
|
|
|
info->disconnect_handler1 =
|
|
|
|
gtk_signal_connect_object (info->object1,
|
|
|
|
"destroy",
|
|
|
|
GTK_SIGNAL_FUNC (gtk_alive_disconnecter),
|
|
|
|
(GtkObject*) info);
|
|
|
|
info->disconnect_handler2 =
|
|
|
|
gtk_signal_connect_object (info->object2,
|
|
|
|
"destroy",
|
|
|
|
GTK_SIGNAL_FUNC (gtk_alive_disconnecter),
|
|
|
|
(GtkObject*) info);
|
1998-02-03 21:36:06 +00:00
|
|
|
}
|
|
|
|
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
void
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_connect_object_while_alive (GtkObject *object,
|
|
|
|
const gchar *signal,
|
|
|
|
GtkSignalFunc func,
|
|
|
|
GtkObject *alive_object)
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
{
|
|
|
|
GtkDisconnectInfo *info;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_OBJECT (object));
|
|
|
|
g_return_if_fail (signal != NULL);
|
|
|
|
g_return_if_fail (func != NULL);
|
|
|
|
g_return_if_fail (alive_object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_OBJECT (alive_object));
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
info = g_chunk_new (GtkDisconnectInfo, gtk_disconnect_info_mem_chunk);
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
info->object1 = object;
|
|
|
|
info->object2 = alive_object;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
info->signal_handler = gtk_signal_connect_object (object, signal, func, alive_object);
|
1998-05-06 01:43:56 +00:00
|
|
|
info->disconnect_handler1 =
|
|
|
|
gtk_signal_connect_object (info->object1,
|
|
|
|
"destroy",
|
|
|
|
GTK_SIGNAL_FUNC (gtk_alive_disconnecter),
|
|
|
|
(GtkObject*) info);
|
|
|
|
info->disconnect_handler2 =
|
|
|
|
gtk_signal_connect_object (info->object2,
|
|
|
|
"destroy",
|
|
|
|
GTK_SIGNAL_FUNC (gtk_alive_disconnecter),
|
|
|
|
(GtkObject*) info);
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
|
|
|
gtk_signal_disconnect (GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
guint handler_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
GtkHandler *handler;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
g_return_if_fail (handler_id > 0);
|
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
handler = gtk_object_get_data_by_id (object, handler_quark);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
while (handler)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-03-09 15:16:28 +00:00
|
|
|
if (handler->id == handler_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler->id = 0;
|
1998-05-02 20:48:49 +00:00
|
|
|
handler->blocked += 1;
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
gtk_signal_handler_unref (handler, object);
|
1997-11-24 22:37:52 +00:00
|
|
|
return;
|
|
|
|
}
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler = handler->next;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
|
|
|
g_warning ("gtk_signal_disconnect(): could not find handler (%u)", handler_id);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-05-02 20:48:49 +00:00
|
|
|
void
|
|
|
|
gtk_signal_disconnect_by_func (GtkObject *object,
|
|
|
|
GtkSignalFunc func,
|
1998-05-06 01:43:56 +00:00
|
|
|
gpointer data)
|
1998-05-02 20:48:49 +00:00
|
|
|
{
|
|
|
|
GtkHandler *handler;
|
|
|
|
gint found_one;
|
|
|
|
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (func != NULL);
|
|
|
|
|
|
|
|
found_one = FALSE;
|
1998-06-19 02:07:47 +00:00
|
|
|
handler = gtk_object_get_data_by_id (object, handler_quark);
|
1998-05-02 20:48:49 +00:00
|
|
|
|
|
|
|
while (handler)
|
|
|
|
{
|
|
|
|
GtkHandler *handler_next;
|
|
|
|
|
|
|
|
handler_next = handler->next;
|
|
|
|
if ((handler->id > 0) &&
|
|
|
|
(handler->func == func) &&
|
|
|
|
(handler->func_data == data))
|
|
|
|
{
|
|
|
|
found_one = TRUE;
|
|
|
|
handler->id = 0;
|
|
|
|
handler->blocked += 1;
|
|
|
|
gtk_signal_handler_unref (handler, object);
|
|
|
|
}
|
|
|
|
handler = handler_next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!found_one)
|
|
|
|
g_warning ("gtk_signal_disconnect_by_func(): could not find handler (0x%0lX) containing data (0x%0lX)", (long) func, (long) data);
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
|
|
|
gtk_signal_disconnect_by_data (GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
gpointer data)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
GtkHandler *handler;
|
1997-11-24 22:37:52 +00:00
|
|
|
gint found_one;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
found_one = FALSE;
|
1998-06-19 02:07:47 +00:00
|
|
|
handler = gtk_object_get_data_by_id (object, handler_quark);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
while (handler)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
GtkHandler *handler_next;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler_next = handler->next;
|
1998-05-02 20:48:49 +00:00
|
|
|
if ((handler->id > 0) &&
|
|
|
|
(handler->func_data == data))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
found_one = TRUE;
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler->id = 0;
|
1998-05-02 20:48:49 +00:00
|
|
|
handler->blocked += 1;
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
gtk_signal_handler_unref (handler, object);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler = handler_next;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (!found_one)
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
g_warning ("gtk_signal_disconnect_by_data(): could not find handler containing data (0x%0lX)", (long) data);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_signal_handler_block (GtkObject *object,
|
1998-03-09 15:16:28 +00:00
|
|
|
guint handler_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-02 20:48:49 +00:00
|
|
|
GtkHandler *handler;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
g_return_if_fail (handler_id > 0);
|
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
handler = gtk_object_get_data_by_id (object, handler_quark);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-02 20:48:49 +00:00
|
|
|
while (handler)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-02 20:48:49 +00:00
|
|
|
if (handler->id == handler_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-02 20:48:49 +00:00
|
|
|
handler->blocked += 1;
|
1997-11-24 22:37:52 +00:00
|
|
|
return;
|
|
|
|
}
|
1998-05-02 20:48:49 +00:00
|
|
|
handler = handler->next;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
|
|
|
g_warning ("gtk_signal_handler_block(): could not find handler (%u)", handler_id);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-05-02 20:48:49 +00:00
|
|
|
void
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_handler_block_by_func (GtkObject *object,
|
|
|
|
GtkSignalFunc func,
|
|
|
|
gpointer data)
|
1998-05-02 20:48:49 +00:00
|
|
|
{
|
|
|
|
GtkHandler *handler;
|
|
|
|
gint found_one;
|
|
|
|
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (func != NULL);
|
|
|
|
|
|
|
|
found_one = FALSE;
|
1998-06-19 02:07:47 +00:00
|
|
|
handler = gtk_object_get_data_by_id (object, handler_quark);
|
1998-05-02 20:48:49 +00:00
|
|
|
|
|
|
|
while (handler)
|
|
|
|
{
|
|
|
|
if ((handler->id > 0) &&
|
|
|
|
(handler->func == func) &&
|
|
|
|
(handler->func_data == data))
|
|
|
|
{
|
|
|
|
found_one = TRUE;
|
|
|
|
handler->blocked += 1;
|
|
|
|
}
|
|
|
|
handler = handler->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!found_one)
|
|
|
|
g_warning ("gtk_signal_handler_block_by_func(): could not find handler (0x%0lX) containing data (0x%0lX)", (long) func, (long) data);
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
|
|
|
gtk_signal_handler_block_by_data (GtkObject *object,
|
|
|
|
gpointer data)
|
|
|
|
{
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
GtkHandler *handler;
|
1997-11-24 22:37:52 +00:00
|
|
|
gint found_one;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
found_one = FALSE;
|
1998-06-19 02:07:47 +00:00
|
|
|
handler = gtk_object_get_data_by_id (object, handler_quark);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
while (handler)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-02 20:48:49 +00:00
|
|
|
if ((handler->id > 0) &&
|
|
|
|
(handler->func_data == data))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
found_one = TRUE;
|
1998-05-02 20:48:49 +00:00
|
|
|
handler->blocked += 1;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler = handler->next;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (!found_one)
|
GTK_RESIZE_NEEDED is a private flag now.
Mon Feb 2 04:15:08 1998 Tim Janik <timj@gimp.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: GTK_RESIZE_NEEDED is a private flag now.
(gtk_container_register_toplevel): new function.
(gtk_container_unregister_toplevel): new function.
* gtk/gtkmain.c: GTK_LEAVE_PENDING is a private flag now.
* gtk/gtkmenu.c: call gtk_container_register_toplevel in
gtk_menu_class_init instead of this dirty gtk_widget_set_parent(,NULL)
hack. new default handler gtk_menu_destroy for calling
gtk_container_unregister_toplevel. removed GTK_ANCHORED, GTK_UNMAPPED.
* gtk/gtkobject.h: macro cleanups, added GTK_DESTROYED flag.
* gtk/gtkobject.c: only emit DESTROY signal if !GTK_OBJECT_DESTROYED
(object).
* gtk/gtkprivate.h: new file that will not be automatically included.
it holds the private flags for GtkWidget along with it's SET/UNSET
and examination macros.
* gtk/gtkwidget.c: private flags: GTK_RESIZE_NEEDED, GTK_REDRAW_PENDING,
GTK_RESIZE_PENDING, GTK_IN_REPARENT, GTK_USER_STYLE. GTK_ANCHORED is
replaced by GTK_TOPLEVEL. added missing UNSET for GTK_IN_REPARENT.
removed the gtk_widget_set_parent(, NULL) hack for toplevels.
upon destroy free memory for widgets with GTK_WIDGET_HAS_SHAPE_MASK.
* gtk/gtkwidget.h: split up the widget flags into a public and a private
portion. added an extra field private_flags to GtkWidget without making
it bigger by using an alignment gap of 16 bit. macro cleanups.
* gtk/gtkwindow.c: removed GTK_ANCHORED. new function gtk_window_destroy
for calling gtk_container_unregister_toplevel. removed the
gtk_widget_set_parent(,NULL), call gtk_container_register_toplevel
instead. remove GTK_UNMAPPED. GTK_RESIZE_NEEDED is private now.
* gtk/gtksignal.c (gtk_signal_disconnect): removed a bug on
removal that cut off the handler list -> living_objects == 0
with testgtk. made some warnings more descriptive.
new function gtk_signal_connect_object_while_alive, which
will automatically destroy the connection once one of the objects
is destroyed. didn't include this before removal of the above
mentioned bug.
* reflected refcounting revolution in ChangeLog
1998-02-02 04:54:25 +00:00
|
|
|
g_warning ("gtk_signal_handler_block_by_data(): could not find handler containing data (0x%0lX)", (long) data);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_signal_handler_unblock (GtkObject *object,
|
1998-03-09 15:16:28 +00:00
|
|
|
guint handler_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
GtkHandler *handler;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
g_return_if_fail (handler_id > 0);
|
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
handler = gtk_object_get_data_by_id (object, handler_quark);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
while (handler)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-03-09 15:16:28 +00:00
|
|
|
if (handler->id == handler_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-02 20:48:49 +00:00
|
|
|
if (handler->blocked > 0)
|
|
|
|
handler->blocked -= 1;
|
|
|
|
else
|
|
|
|
g_warning ("gtk_signal_handler_unblock(): handler (%u) is not blocked", handler_id);
|
1997-11-24 22:37:52 +00:00
|
|
|
return;
|
|
|
|
}
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler = handler->next;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
|
|
|
g_warning ("gtk_signal_handler_unblock(): could not find handler (%u)", handler_id);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-05-02 20:48:49 +00:00
|
|
|
void
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_handler_unblock_by_func (GtkObject *object,
|
1998-05-02 20:48:49 +00:00
|
|
|
GtkSignalFunc func,
|
1998-05-06 01:43:56 +00:00
|
|
|
gpointer data)
|
1998-05-02 20:48:49 +00:00
|
|
|
{
|
|
|
|
GtkHandler *handler;
|
|
|
|
gint found_one;
|
|
|
|
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (func != NULL);
|
|
|
|
|
|
|
|
found_one = FALSE;
|
1998-06-19 02:07:47 +00:00
|
|
|
handler = gtk_object_get_data_by_id (object, handler_quark);
|
1998-05-02 20:48:49 +00:00
|
|
|
|
|
|
|
while (handler)
|
|
|
|
{
|
|
|
|
if ((handler->id > 0) &&
|
|
|
|
(handler->func == func) &&
|
|
|
|
(handler->func_data == data) &&
|
|
|
|
(handler->blocked > 0))
|
|
|
|
{
|
|
|
|
handler->blocked -= 1;
|
|
|
|
found_one = TRUE;
|
|
|
|
}
|
|
|
|
handler = handler->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!found_one)
|
|
|
|
g_warning ("gtk_signal_handler_unblock_by_func(): could not find blocked handler (0x%0lX) containing data (0x%0lX)", (long) func, (long) data);
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
|
|
|
gtk_signal_handler_unblock_by_data (GtkObject *object,
|
|
|
|
gpointer data)
|
|
|
|
{
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
GtkHandler *handler;
|
1997-11-24 22:37:52 +00:00
|
|
|
gint found_one;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (object != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
found_one = FALSE;
|
1998-06-19 02:07:47 +00:00
|
|
|
handler = gtk_object_get_data_by_id (object, handler_quark);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
while (handler)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-02 20:48:49 +00:00
|
|
|
if ((handler->id > 0) &&
|
|
|
|
(handler->func_data == data) &&
|
1998-05-06 01:43:56 +00:00
|
|
|
(handler->blocked > 0))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-02 20:48:49 +00:00
|
|
|
handler->blocked -= 1;
|
1997-11-24 22:37:52 +00:00
|
|
|
found_one = TRUE;
|
|
|
|
}
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler = handler->next;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (!found_one)
|
1998-05-02 20:48:49 +00:00
|
|
|
g_warning ("gtk_signal_handler_unblock_by_data(): could not find blocked handler containing data (0x%0lX)", (long) data);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_signal_handlers_destroy (GtkObject *object)
|
|
|
|
{
|
|
|
|
GtkHandler *handler;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
/* we make the "optimization" of destroying the first handler in the last
|
|
|
|
* place, since we don't want gtk_signal_handler_unref() to reset the objects
|
|
|
|
* handler_key data on each removal
|
|
|
|
*/
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
handler = gtk_object_get_data_by_id (object, handler_quark);
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
if (handler)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler = handler->next;
|
|
|
|
while (handler)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
GtkHandler *next;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
next = handler->next;
|
|
|
|
gtk_signal_handler_unref (handler, object);
|
|
|
|
handler = next;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-06-19 02:07:47 +00:00
|
|
|
handler = gtk_object_get_data_by_id (object, handler_quark);
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
gtk_signal_handler_unref (handler, object);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_signal_default_marshaller (GtkObject *object,
|
|
|
|
GtkSignalFunc func,
|
1998-05-06 01:43:56 +00:00
|
|
|
gpointer func_data,
|
|
|
|
GtkArg *params)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GtkSignalMarshaller0 rfunc;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
rfunc = (GtkSignalMarshaller0) func;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
(* rfunc) (object, func_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_signal_set_funcs (GtkSignalMarshal marshal_func,
|
|
|
|
GtkSignalDestroy destroy_func)
|
|
|
|
{
|
1998-05-03 19:13:24 +00:00
|
|
|
global_marshaller = marshal_func;
|
|
|
|
global_destroy_notify = destroy_func;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static guint
|
1998-06-10 16:59:28 +00:00
|
|
|
gtk_signal_hash (gconstpointer h)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-06-09 23:18:11 +00:00
|
|
|
register const GtkSignalHash *hash = h;
|
1998-05-06 01:43:56 +00:00
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
return hash->object_type ^ hash->quark;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
1998-06-10 16:59:28 +00:00
|
|
|
gtk_signal_compare (gconstpointer h1,
|
|
|
|
gconstpointer h2)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-06-09 23:18:11 +00:00
|
|
|
register const GtkSignalHash *hash1 = h1;
|
|
|
|
register const GtkSignalHash *hash2 = h2;
|
1998-05-06 01:43:56 +00:00
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
return (hash1->quark == hash2->quark &&
|
1998-05-06 01:43:56 +00:00
|
|
|
hash1->object_type == hash2->object_type);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static guint
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_alive_disconnecter (GtkDisconnectInfo *info)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
g_return_val_if_fail (info != NULL, 0);
|
|
|
|
|
|
|
|
gtk_signal_disconnect (info->object1, info->disconnect_handler1);
|
|
|
|
gtk_signal_disconnect (info->object1, info->signal_handler);
|
|
|
|
gtk_signal_disconnect (info->object2, info->disconnect_handler2);
|
|
|
|
|
|
|
|
g_mem_chunk_free (gtk_disconnect_info_mem_chunk, info);
|
|
|
|
|
|
|
|
return 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GtkHandler*
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_signal_handler_new (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GtkHandler *handler;
|
1998-05-07 09:23:50 +00:00
|
|
|
|
|
|
|
if (!gtk_handler_free_list)
|
|
|
|
{
|
|
|
|
GtkHandler *handler_block;
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
handler_block = g_new0 (GtkHandler, HANDLER_BLOCK_SIZE);
|
|
|
|
for (i = 1; i < HANDLER_BLOCK_SIZE; i++)
|
|
|
|
{
|
|
|
|
(handler_block + i)->next = gtk_handler_free_list;
|
|
|
|
gtk_handler_free_list = (handler_block + i);
|
|
|
|
}
|
|
|
|
|
|
|
|
handler = handler_block;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
handler = gtk_handler_free_list;
|
|
|
|
gtk_handler_free_list = handler->next;
|
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
handler->id = 0;
|
1998-05-02 20:48:49 +00:00
|
|
|
handler->blocked = 0;
|
1998-05-06 01:43:56 +00:00
|
|
|
handler->signal_id = 0;
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler->object_signal = FALSE;
|
1997-11-24 22:37:52 +00:00
|
|
|
handler->after = FALSE;
|
|
|
|
handler->no_marshal = FALSE;
|
1998-05-02 20:48:49 +00:00
|
|
|
handler->ref_count = 1;
|
1997-11-24 22:37:52 +00:00
|
|
|
handler->func = NULL;
|
|
|
|
handler->func_data = NULL;
|
|
|
|
handler->destroy_func = NULL;
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler->prev = NULL;
|
1997-11-24 22:37:52 +00:00
|
|
|
handler->next = NULL;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return handler;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_signal_handler_ref (GtkHandler *handler)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-01-30 23:47:09 +00:00
|
|
|
handler->ref_count += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_signal_handler_unref (GtkHandler *handler,
|
|
|
|
GtkObject *object)
|
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
if (!handler->ref_count)
|
|
|
|
{
|
|
|
|
/* FIXME: i wanna get removed somewhen */
|
|
|
|
g_warning ("gtk_signal_handler_unref(): handler with ref_count==0!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
handler->ref_count -= 1;
|
1998-05-06 01:43:56 +00:00
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
if (handler->ref_count == 0)
|
|
|
|
{
|
1998-05-03 19:13:24 +00:00
|
|
|
if (handler->destroy_func)
|
1998-01-30 23:47:09 +00:00
|
|
|
(* handler->destroy_func) (handler->func_data);
|
1998-05-03 19:13:24 +00:00
|
|
|
else if (!handler->func && global_destroy_notify)
|
|
|
|
(* global_destroy_notify) (handler->func_data);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
if (handler->prev)
|
|
|
|
handler->prev->next = handler->next;
|
1998-05-08 23:20:48 +00:00
|
|
|
else if (handler->next)
|
1998-06-19 02:07:47 +00:00
|
|
|
gtk_object_set_data_by_id (object, handler_quark, handler->next);
|
1998-05-08 23:20:48 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
GTK_OBJECT_UNSET_FLAGS (object, GTK_CONNECTED);
|
1998-06-19 02:07:47 +00:00
|
|
|
gtk_object_set_data_by_id (object, handler_quark, NULL);
|
1998-05-08 23:20:48 +00:00
|
|
|
}
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
if (handler->next)
|
|
|
|
handler->next->prev = handler->prev;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-07 09:23:50 +00:00
|
|
|
handler->next = gtk_handler_free_list;
|
|
|
|
gtk_handler_free_list = handler;
|
1998-01-30 23:47:09 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_signal_handler_insert (GtkObject *object,
|
|
|
|
GtkHandler *handler)
|
|
|
|
{
|
|
|
|
GtkHandler *tmp;
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
|
|
|
|
/* FIXME: remove */ g_assert (handler->next == NULL);
|
|
|
|
/* FIXME: remove */ g_assert (handler->prev == NULL);
|
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
tmp = gtk_object_get_data_by_id (object, handler_quark);
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
if (!tmp)
|
1998-05-08 23:20:48 +00:00
|
|
|
{
|
|
|
|
GTK_OBJECT_SET_FLAGS (object, GTK_CONNECTED);
|
1998-06-19 02:07:47 +00:00
|
|
|
gtk_object_set_data_by_id (object, handler_quark, handler);
|
1998-05-08 23:20:48 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
while (tmp)
|
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
if (tmp->signal_id < handler->signal_id)
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
{
|
|
|
|
if (tmp->prev)
|
|
|
|
{
|
|
|
|
tmp->prev->next = handler;
|
|
|
|
handler->prev = tmp->prev;
|
|
|
|
}
|
|
|
|
else
|
1998-06-19 02:07:47 +00:00
|
|
|
gtk_object_set_data_by_id (object, handler_quark, handler);
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
tmp->prev = handler;
|
|
|
|
handler->next = tmp;
|
|
|
|
break;
|
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
if (!tmp->next)
|
|
|
|
{
|
|
|
|
tmp->next = handler;
|
|
|
|
handler->prev = tmp;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
static GtkObject *gtk_trace_signal_object = NULL;
|
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
static void
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_signal_real_emit (GtkObject *object,
|
1998-07-15 12:25:43 +00:00
|
|
|
guint signal_id,
|
1998-05-09 01:17:03 +00:00
|
|
|
GtkArg *params)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-07-15 12:25:43 +00:00
|
|
|
GtkSignal *signal;
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkHandler *handlers;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkHandlerInfo info;
|
1998-05-06 01:43:56 +00:00
|
|
|
guchar **signal_func_offset;
|
1998-07-15 12:25:43 +00:00
|
|
|
|
|
|
|
signal = LOOKUP_SIGNAL_ID (signal_id);
|
1998-05-18 22:34:43 +00:00
|
|
|
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
#ifdef G_ENABLE_DEBUG
|
|
|
|
if (gtk_debug_flags & GTK_DEBUG_SIGNALS ||
|
|
|
|
object == gtk_trace_signal_object)
|
|
|
|
fprintf (stdout, "trace: signal_emit(\"%s\") for %s:%p\n",
|
|
|
|
signal->name,
|
|
|
|
gtk_type_name (GTK_OBJECT_TYPE (object)),
|
|
|
|
object);
|
|
|
|
#endif /* G_ENABLE_DEBUG */
|
1998-01-30 23:47:09 +00:00
|
|
|
|
1998-06-09 07:11:55 +00:00
|
|
|
if ((signal->signal_flags & GTK_RUN_NO_RECURSE) &&
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_emission_check (current_emissions, object, signal_id))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_emission_add (&restart_emissions, object, signal_id);
|
1998-01-30 23:47:09 +00:00
|
|
|
return;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-01-30 23:47:09 +00:00
|
|
|
|
|
|
|
gtk_object_ref (object);
|
1998-05-09 01:17:03 +00:00
|
|
|
|
|
|
|
gtk_emission_add (¤t_emissions, object, signal_id);
|
1998-01-30 23:47:09 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
emission_restart:
|
1998-06-09 07:11:55 +00:00
|
|
|
if (GTK_RUN_TYPE (signal->signal_flags) != GTK_RUN_LAST && signal->function_offset != 0)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-01-30 23:47:09 +00:00
|
|
|
signal_func_offset = (guchar**) ((guchar*) object->klass +
|
|
|
|
signal->function_offset);
|
|
|
|
if (*signal_func_offset)
|
1998-07-15 12:25:43 +00:00
|
|
|
{
|
|
|
|
(* signal->marshaller) (object, (GtkSignalFunc) *signal_func_offset,
|
|
|
|
NULL, params);
|
|
|
|
signal = LOOKUP_SIGNAL_ID (signal_id);
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-01-30 23:47:09 +00:00
|
|
|
|
1998-05-08 23:20:48 +00:00
|
|
|
if (GTK_OBJECT_CONNECTED (object))
|
1998-01-30 23:47:09 +00:00
|
|
|
{
|
1998-05-08 23:20:48 +00:00
|
|
|
handlers = gtk_signal_get_handlers (object, signal_id);
|
|
|
|
if (handlers)
|
|
|
|
{
|
1998-07-15 12:25:43 +00:00
|
|
|
gint return_val;
|
|
|
|
|
1998-05-08 23:20:48 +00:00
|
|
|
info.object = object;
|
|
|
|
info.marshaller = signal->marshaller;
|
|
|
|
info.params = params;
|
|
|
|
info.param_types = signal->params;
|
|
|
|
info.return_val = signal->return_val;
|
|
|
|
info.nparams = signal->nparams;
|
1998-06-09 07:11:55 +00:00
|
|
|
info.signal_flags = signal->signal_flags;
|
1998-05-08 23:20:48 +00:00
|
|
|
info.signal_id = signal_id;
|
|
|
|
|
1998-07-15 12:25:43 +00:00
|
|
|
return_val = gtk_handlers_run (handlers, &info, FALSE);
|
|
|
|
signal = LOOKUP_SIGNAL_ID (signal_id);
|
|
|
|
switch (return_val)
|
1998-05-08 23:20:48 +00:00
|
|
|
{
|
|
|
|
case EMISSION_CONTINUE:
|
|
|
|
break;
|
|
|
|
case EMISSION_RESTART:
|
|
|
|
goto emission_restart;
|
|
|
|
case EMISSION_DONE:
|
|
|
|
goto emission_done;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
info.object = NULL;
|
1998-01-30 23:47:09 +00:00
|
|
|
}
|
1998-05-08 23:20:48 +00:00
|
|
|
else
|
|
|
|
info.object = NULL;
|
1998-01-30 23:47:09 +00:00
|
|
|
|
1998-06-09 07:11:55 +00:00
|
|
|
if (GTK_RUN_TYPE (signal->signal_flags) != GTK_RUN_FIRST && signal->function_offset != 0)
|
1998-01-30 23:47:09 +00:00
|
|
|
{
|
|
|
|
signal_func_offset = (guchar**) ((guchar*) object->klass +
|
|
|
|
signal->function_offset);
|
|
|
|
if (*signal_func_offset)
|
1998-07-15 12:25:43 +00:00
|
|
|
{
|
|
|
|
(* signal->marshaller) (object, (GtkSignalFunc) *signal_func_offset,
|
|
|
|
NULL, params);
|
|
|
|
signal = LOOKUP_SIGNAL_ID (signal_id);
|
|
|
|
}
|
1998-01-30 23:47:09 +00:00
|
|
|
}
|
|
|
|
|
1998-05-08 23:20:48 +00:00
|
|
|
if (GTK_OBJECT_CONNECTED (object))
|
1998-01-30 23:47:09 +00:00
|
|
|
{
|
1998-05-08 23:20:48 +00:00
|
|
|
handlers = gtk_signal_get_handlers (object, signal_id);
|
|
|
|
if (handlers)
|
|
|
|
{
|
1998-07-15 12:25:43 +00:00
|
|
|
gint return_val;
|
|
|
|
|
1998-05-08 23:20:48 +00:00
|
|
|
if (!info.object)
|
|
|
|
{
|
|
|
|
info.object = object;
|
|
|
|
info.marshaller = signal->marshaller;
|
|
|
|
info.params = params;
|
|
|
|
info.param_types = signal->params;
|
|
|
|
info.return_val = signal->return_val;
|
|
|
|
info.nparams = signal->nparams;
|
1998-06-09 07:11:55 +00:00
|
|
|
info.signal_flags = signal->signal_flags;
|
1998-05-08 23:20:48 +00:00
|
|
|
info.signal_id = signal_id;
|
|
|
|
}
|
1998-07-15 12:25:43 +00:00
|
|
|
return_val = gtk_handlers_run (handlers, &info, TRUE);
|
|
|
|
signal = LOOKUP_SIGNAL_ID (signal_id);
|
|
|
|
switch (return_val)
|
1998-05-08 23:20:48 +00:00
|
|
|
{
|
|
|
|
case EMISSION_CONTINUE:
|
|
|
|
break;
|
|
|
|
case EMISSION_RESTART:
|
|
|
|
goto emission_restart;
|
|
|
|
case EMISSION_DONE:
|
|
|
|
goto emission_done;
|
|
|
|
}
|
|
|
|
}
|
1998-01-30 23:47:09 +00:00
|
|
|
}
|
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
emission_done:
|
1998-01-30 23:47:09 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_emission_remove (¤t_emissions, object, signal_id);
|
1998-01-30 23:47:09 +00:00
|
|
|
|
1998-06-09 07:11:55 +00:00
|
|
|
if (signal->signal_flags & GTK_RUN_NO_RECURSE)
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_emission_remove (&restart_emissions, object, signal_id);
|
1998-01-30 23:47:09 +00:00
|
|
|
|
|
|
|
gtk_object_unref (object);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-02-10 23:49:15 +00:00
|
|
|
static GtkHandler*
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_signal_get_handlers (GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GtkHandler *handlers;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-06-19 02:07:47 +00:00
|
|
|
handlers = gtk_object_get_data_by_id (object, handler_quark);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
while (handlers)
|
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
if (handlers->signal_id == signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
return handlers;
|
|
|
|
handlers = handlers->next;
|
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1998-02-10 23:49:15 +00:00
|
|
|
guint
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_handler_pending (GtkObject *object,
|
|
|
|
guint signal_id,
|
1998-02-10 23:49:15 +00:00
|
|
|
gboolean may_be_blocked)
|
|
|
|
{
|
|
|
|
GtkHandler *handlers;
|
|
|
|
guint handler_id;
|
|
|
|
|
|
|
|
g_return_val_if_fail (object != NULL, 0);
|
1998-03-09 15:16:28 +00:00
|
|
|
g_return_val_if_fail (signal_id >= 1, 0);
|
1998-05-08 23:20:48 +00:00
|
|
|
|
|
|
|
if (GTK_OBJECT_CONNECTED (object))
|
|
|
|
handlers = gtk_signal_get_handlers (object, signal_id);
|
|
|
|
else
|
|
|
|
return 0;
|
1998-02-10 23:49:15 +00:00
|
|
|
|
|
|
|
handler_id = 0;
|
1998-05-06 01:43:56 +00:00
|
|
|
while (handlers && handlers->signal_id == signal_id)
|
1998-02-10 23:49:15 +00:00
|
|
|
{
|
|
|
|
if (handlers->id > 0 &&
|
1998-06-18 03:22:09 +00:00
|
|
|
(may_be_blocked || handlers->blocked == FALSE))
|
|
|
|
{
|
|
|
|
handler_id = handlers->id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
handlers = handlers->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return handler_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
guint
|
|
|
|
gtk_signal_handler_pending_by_func (GtkObject *object,
|
|
|
|
guint signal_id,
|
|
|
|
gboolean may_be_blocked,
|
|
|
|
GtkSignalFunc func,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkHandler *handlers;
|
|
|
|
guint handler_id;
|
|
|
|
|
|
|
|
g_return_val_if_fail (object != NULL, 0);
|
|
|
|
g_return_val_if_fail (func != NULL, 0);
|
|
|
|
g_return_val_if_fail (signal_id >= 1, 0);
|
|
|
|
|
|
|
|
if (GTK_OBJECT_CONNECTED (object))
|
|
|
|
handlers = gtk_signal_get_handlers (object, signal_id);
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
handler_id = 0;
|
|
|
|
while (handlers && handlers->signal_id == signal_id)
|
|
|
|
{
|
|
|
|
if (handlers->id > 0 &&
|
|
|
|
handlers->func == func &&
|
|
|
|
handlers->func_data == data &&
|
|
|
|
(may_be_blocked || handlers->blocked == FALSE))
|
1998-02-10 23:49:15 +00:00
|
|
|
{
|
|
|
|
handler_id = handlers->id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
handlers = handlers->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return handler_id;
|
|
|
|
}
|
|
|
|
|
1998-03-09 15:16:28 +00:00
|
|
|
static guint
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_signal_connect_by_type (GtkObject *object,
|
|
|
|
guint signal_id,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkSignalFunc func,
|
1998-05-06 01:43:56 +00:00
|
|
|
gpointer func_data,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkSignalDestroy destroy_func,
|
1998-05-06 01:43:56 +00:00
|
|
|
gint object_signal,
|
|
|
|
gint after,
|
|
|
|
gint no_marshal)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-01-29 20:44:14 +00:00
|
|
|
GtkObjectClass *class;
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkHandler *handler;
|
|
|
|
gint found_it;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_val_if_fail (object != NULL, 0);
|
|
|
|
g_return_val_if_fail (object->klass != NULL, 0);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* Search through the signals for this object and make
|
1998-01-29 20:44:14 +00:00
|
|
|
* sure the one we are adding is valid. We need to perform
|
|
|
|
* the lookup on the objects parents as well. If it isn't
|
|
|
|
* valid then issue a warning and return.
|
fixed an assertment.
Sat Jun 6 06:01:24 1998 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c (gtk_signal_emitv): fixed an assertment.
* gtk/makeenums.awk: a script to generate the GtkEnumValue arrays from,
this should eventually be done by gentypeinfo.el somewhen.
* gtk/gtkenumvalues.c: new generated file to hold GtkEnumValue arrays.
* gtk/gtktypeutils.h: new function gtk_enum_values() to retrive all the
enum values of an enum type.
* gtk/gtk.defs:
* gtk/gtkcurve.h:
* gtk/gtkobject.h:
* gtk/gtkprivate.h:
* gtk/gtkwidget.h:
* gtk/gtkenums.h:
brought enum/flags definitions in sync, added a few more enum
definitions for bindings and pattern matching.
* some more macro and GtkType fixups in various places.
* gdk/gdktypes.h (enum): added a new value GDK_AFTER_MASK, which is used
as a key-release modifier for the binding system.
Fri Jun 5 06:06:06 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenu.h (struct _GtkMenu): removed GList*children, since it
was a stale list pointer that is already present in GtkMenuShell.
* gtk/gtkmenushell.h (struct _GtkMenuShellClass): added a signal
GtkMenuShell::selection_done which is emitted after the menu shell
poped down again and all possible menu items have been activated.
Thu Jun 4 02:20:42 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_button_release): flush the x-queue
before activation of the menuitem, so the menu is actually taken off the
screen prior to any menu item activation.
* gtk/gtkctree.c (gtk_ctree_get_row_data): allow function invokation
for NULL nodes.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: new function gtk_widget_stop_accelerator to stop
the emission of the "add-accelerator" signal on a widget. this is
usefull to prevent accelerator installation on certain widgets.
* gtk/gtknotebook.c (gtk_notebook_menu_item_create): keep the menu
labels left justified, by setting their alignment. stop accelerator
installation for the menu items, since we use dynamic menus.
Wed Jun 3 06:41:22 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenufactory.c: adaptions to use the new accel groups. people
should *really* use GtkItemFactory. this is only for preserving source
compatibility where possible, use of GtkMenuFactory is deprecated as of
now.
* gtk/gtkobject.h (gtk_object_class_add_user_signal): new function
to create user signals of type GTK_RUN_NO_RECURSE. don't know why i
missed this possibility when i added gtk_object_class_add_user_signal
in late january.
* gtk/gtkmain.c (gtk_init): ignore subsequent function calls.
Sun May 31 07:31:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h:
* gtk/gtkaccelgroup.c: new implementation of the accelerator concept.
* gtk/gtkaccellabel.h:
* gtk/gtkaccellabel.c: new widget derived from GtkLabel whitch features
display of the accelerators associated with a certain widget.
* gtk/gtkitemfactory.h:
* gtk/gtkitemfactory.c: new widget, item factory with automatic rc
parsing and accelerator handling.
* gtk/gtkmenu.c (gtk_menu_reposition): new function to care for
positioning a menu.
(gtk_menu_map): removed the allocation code.
(gtk_menu_size_allocate): care for redrawing of children and resize
our widget->window correctly.
(gtk_menu_key_press): feature the new accelerator groups.
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): reposition the
submenu if neccessary.
* gtk/gtkmenuitem.c:
* gtk/gtkcheckmenuitem.c:
* gtk/gtkradiomenuitem.c: use GtkAccelLabel in the *_new_with_label()
function variants.
* gdk/gdk.c:
(gdk_keyval_from_name):
(gdk_keyval_name): new functions for keyval<->key-name associations.
(gdk_keyval_to_upper):
(gdk_keyval_to_lower):
(gdk_keyval_is_upper):
(gdk_keyval_is_lower): new functions to check/translate keyvalues with
regards to their cases.
Wed May 27 00:48:10 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_class_path): new function to calculate a
widget's class path.
(gtk_widget_path): new function to calculate a widget's name path.
* gtk/gtkrc.c: newly introduced GtkPatternSpec structures to speed up
pattern matching, features reversed pattern matches.
1998-06-07 06:48:56 +00:00
|
|
|
* As of now (1998-05-27) this lookup shouldn't be neccessarry
|
|
|
|
* anymore since gtk_signal_lookup() has been reworked to only
|
|
|
|
* return correct signal ids per class-branch.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
|
|
|
found_it = FALSE;
|
1998-01-29 20:44:14 +00:00
|
|
|
class = object->klass;
|
|
|
|
while (class)
|
|
|
|
{
|
|
|
|
GtkType parent;
|
1998-03-11 22:49:40 +00:00
|
|
|
guint *object_signals;
|
1998-03-09 15:16:28 +00:00
|
|
|
guint nsignals;
|
1998-01-29 20:44:14 +00:00
|
|
|
guint i;
|
|
|
|
|
|
|
|
object_signals = class->signals;
|
|
|
|
nsignals = class->nsignals;
|
|
|
|
|
|
|
|
for (i = 0; i < nsignals; i++)
|
1998-05-06 01:43:56 +00:00
|
|
|
if (object_signals[i] == signal_id)
|
1998-01-29 20:44:14 +00:00
|
|
|
{
|
|
|
|
found_it = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
parent = gtk_type_parent (class->type);
|
|
|
|
if (parent)
|
|
|
|
class = gtk_type_class (parent);
|
|
|
|
else
|
|
|
|
class = NULL;
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (!found_it)
|
|
|
|
{
|
1998-03-09 15:16:28 +00:00
|
|
|
g_warning ("gtk_signal_connect_by_type(): could not find signal id (%u) in the `%s' class ancestry",
|
1998-05-06 01:43:56 +00:00
|
|
|
signal_id,
|
|
|
|
gtk_type_name (object->klass->type));
|
1997-11-24 22:37:52 +00:00
|
|
|
return 0;
|
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
handler = gtk_signal_handler_new ();
|
1998-05-06 01:43:56 +00:00
|
|
|
handler->id = gtk_handler_id++;
|
|
|
|
handler->signal_id = signal_id;
|
1997-11-24 22:37:52 +00:00
|
|
|
handler->object_signal = object_signal;
|
|
|
|
handler->func = func;
|
|
|
|
handler->func_data = func_data;
|
|
|
|
handler->destroy_func = destroy_func;
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
handler->after = after != FALSE;
|
1997-11-24 22:37:52 +00:00
|
|
|
handler->no_marshal = no_marshal;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_signal_handler_insert (object, handler);
|
|
|
|
return handler->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkEmission*
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_emission_new (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GtkEmission *emission;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-07 09:23:50 +00:00
|
|
|
if (!gtk_emission_free_list)
|
|
|
|
{
|
|
|
|
GtkEmissionAllocator *emission_block;
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
emission_block = g_new0 (GtkEmissionAllocator, EMISSION_BLOCK_SIZE);
|
|
|
|
for (i = 1; i < EMISSION_BLOCK_SIZE; i++)
|
|
|
|
{
|
|
|
|
(emission_block + i)->next = gtk_emission_free_list;
|
|
|
|
gtk_emission_free_list = (emission_block + i);
|
|
|
|
}
|
|
|
|
|
|
|
|
emission = &emission_block->emission;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
emission = >k_emission_free_list->emission;
|
|
|
|
gtk_emission_free_list = gtk_emission_free_list->next;
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
emission->object = NULL;
|
1998-05-06 01:43:56 +00:00
|
|
|
emission->signal_id = 0;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return emission;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_emission_add (GList **emissions,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GtkEmission *emission;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (emissions != NULL);
|
|
|
|
g_return_if_fail (object != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
emission = gtk_emission_new ();
|
|
|
|
emission->object = object;
|
1998-05-06 01:43:56 +00:00
|
|
|
emission->signal_id = signal_id;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
*emissions = g_list_prepend (*emissions, emission);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_emission_remove (GList **emissions,
|
1998-05-06 01:43:56 +00:00
|
|
|
GtkObject *object,
|
|
|
|
guint signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GList *tmp;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
g_return_if_fail (emissions != NULL);
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
tmp = *emissions;
|
|
|
|
while (tmp)
|
|
|
|
{
|
1998-05-07 09:23:50 +00:00
|
|
|
GtkEmissionAllocator *ea;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1998-05-07 09:23:50 +00:00
|
|
|
ea = tmp->data;
|
|
|
|
|
|
|
|
if ((ea->emission.object == object) &&
|
|
|
|
(ea->emission.signal_id == signal_id))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
*emissions = g_list_remove_link (*emissions, tmp);
|
|
|
|
g_list_free (tmp);
|
1998-05-07 09:23:50 +00:00
|
|
|
|
|
|
|
ea->next = gtk_emission_free_list;
|
|
|
|
gtk_emission_free_list = ea;
|
1997-11-24 22:37:52 +00:00
|
|
|
break;
|
|
|
|
}
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
tmp = tmp->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_emission_check (GList *emissions,
|
|
|
|
GtkObject *object,
|
1998-05-06 01:43:56 +00:00
|
|
|
guint signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
GtkEmission *emission;
|
|
|
|
GList *tmp;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
tmp = emissions;
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
emission = tmp->data;
|
|
|
|
tmp = tmp->next;
|
1998-03-09 15:16:28 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if ((emission->object == object) &&
|
1998-05-06 01:43:56 +00:00
|
|
|
(emission->signal_id == signal_id))
|
1997-11-24 22:37:52 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
1998-05-06 01:43:56 +00:00
|
|
|
gtk_handlers_run (GtkHandler *handlers,
|
1997-11-24 22:37:52 +00:00
|
|
|
GtkHandlerInfo *info,
|
1998-05-06 01:43:56 +00:00
|
|
|
gint after)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-05-06 01:43:56 +00:00
|
|
|
while (handlers && handlers->signal_id == info->signal_id)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
GtkHandler *handlers_next;
|
1998-01-30 23:47:09 +00:00
|
|
|
|
1998-03-09 15:16:28 +00:00
|
|
|
gtk_signal_handler_ref (handlers);
|
1998-01-30 23:47:09 +00:00
|
|
|
|
1998-05-02 20:48:49 +00:00
|
|
|
if (handlers->blocked == 0 && (handlers->after == after))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
if (handlers->func)
|
|
|
|
{
|
|
|
|
if (handlers->no_marshal)
|
1998-05-03 19:13:24 +00:00
|
|
|
(* (GtkCallbackMarshal) handlers->func) (info->object,
|
|
|
|
handlers->func_data,
|
|
|
|
info->nparams,
|
|
|
|
info->params);
|
1997-11-24 22:37:52 +00:00
|
|
|
else if (handlers->object_signal)
|
1998-01-15 03:49:51 +00:00
|
|
|
(* info->marshaller) ((GtkObject*) handlers->func_data, /* don't GTK_OBJECT() cast */
|
1997-11-24 22:37:52 +00:00
|
|
|
handlers->func,
|
|
|
|
handlers->func_data,
|
|
|
|
info->params);
|
|
|
|
else
|
|
|
|
(* info->marshaller) (info->object,
|
|
|
|
handlers->func,
|
|
|
|
handlers->func_data,
|
|
|
|
info->params);
|
|
|
|
}
|
1998-05-03 19:13:24 +00:00
|
|
|
else if (global_marshaller)
|
|
|
|
(* global_marshaller) (info->object,
|
|
|
|
handlers->func_data,
|
|
|
|
info->nparams,
|
|
|
|
info->params,
|
|
|
|
info->param_types,
|
|
|
|
info->return_val);
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
if (gtk_emission_check (stop_emissions, info->object,
|
|
|
|
info->signal_id))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_emission_remove (&stop_emissions, info->object,
|
1998-05-06 01:43:56 +00:00
|
|
|
info->signal_id);
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
|
1998-06-09 07:11:55 +00:00
|
|
|
if (info->signal_flags & GTK_RUN_NO_RECURSE)
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_emission_remove (&restart_emissions, info->object,
|
1998-05-06 01:43:56 +00:00
|
|
|
info->signal_id);
|
1998-02-03 21:36:06 +00:00
|
|
|
gtk_signal_handler_unref (handlers, info->object);
|
1998-05-06 01:43:56 +00:00
|
|
|
return EMISSION_DONE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-06-09 07:11:55 +00:00
|
|
|
else if ((info->signal_flags & GTK_RUN_NO_RECURSE) &&
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_emission_check (restart_emissions, info->object,
|
1998-05-06 01:43:56 +00:00
|
|
|
info->signal_id))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_emission_remove (&restart_emissions, info->object,
|
1998-05-06 01:43:56 +00:00
|
|
|
info->signal_id);
|
1998-02-03 21:36:06 +00:00
|
|
|
gtk_signal_handler_unref (handlers, info->object);
|
1998-05-06 01:43:56 +00:00
|
|
|
return EMISSION_RESTART;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
handlers_next = handlers->next;
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
gtk_signal_handler_unref (handlers, info->object);
|
1998-01-30 23:47:09 +00:00
|
|
|
handlers = handlers_next;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
ok, there have been several severe bugs in the signal handler referencing
Tue Feb 10 07:12:07 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.h:
* gtk/gtksignal.c:
ok, there have been several severe bugs in the signal handler
referencing and ->next connection stuff. these bugs caused
invokations of handlers that are disconnected and - worse -
destroyed already. invokation of *destroyd* handlers mean:
anything can be executed , because the handler structure can just
as well be realocated.
at the cost of an extra ->prev field per handler we should have a
reasonable stable system now, because of the various places that
can cause a handler to be disconnected (*any* handler invokation can
cause *any* or *all* handlers to be disconnected, there is no way
around a doubly linked list, actually handler disconnection has never
worked correctly because of this.
handlers are connected together via a *doubly* linked list now, and it
is *not* valid to remove a handler out of this list untill all its
references have been droped, i.e. handler->ref_count==0.
to prevent emissions of disconnected but still referenced handlers,
disconnected handlers are simply marked as blocked and get an id of 0
which is an invalid signal handler id.
the handler->id has been changed to have 28 significant bits (using
alignment gaps), since 65536 (old range: guint16) signal connections
(as a total) can easily be reached by complex applications.
this whole handler thingy is at least as tedious as writing doubly
linked list implementations ;)
1998-02-10 06:53:08 +00:00
|
|
|
|
1998-05-06 01:43:56 +00:00
|
|
|
return EMISSION_CONTINUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
static gboolean
|
|
|
|
gtk_signal_collect_params (GtkArg *params,
|
|
|
|
guint n_params,
|
|
|
|
GtkType *param_types,
|
|
|
|
GtkType return_type,
|
|
|
|
va_list var_args)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
register GtkArg *last_param;
|
|
|
|
register gboolean failed = FALSE;
|
|
|
|
|
|
|
|
for (last_param = params + n_params; params < last_param; params++)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
register gchar *error;
|
|
|
|
|
|
|
|
params->type = *(param_types++);
|
|
|
|
params->name = NULL;
|
|
|
|
error = gtk_arg_collect_value (GTK_FUNDAMENTAL_TYPE (params->type),
|
|
|
|
params,
|
|
|
|
&var_args);
|
|
|
|
if (error)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
failed = TRUE;
|
|
|
|
g_warning ("gtk_signal_collect_params(): %s", error);
|
|
|
|
g_free (error);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
|
|
|
|
params->type = return_type;
|
|
|
|
params->name = NULL;
|
|
|
|
|
|
|
|
return_type = GTK_FUNDAMENTAL_TYPE (return_type);
|
|
|
|
if (return_type != GTK_TYPE_NONE)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-07-14 07:40:15 +00:00
|
|
|
if ((return_type >= GTK_TYPE_FLAT_FIRST &&
|
|
|
|
return_type <= GTK_TYPE_FLAT_LAST) ||
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
(return_type == GTK_TYPE_OBJECT))
|
|
|
|
{
|
|
|
|
GTK_VALUE_POINTER (*params) = va_arg (var_args, gpointer);
|
|
|
|
|
|
|
|
if (GTK_VALUE_POINTER (*params) == NULL)
|
|
|
|
{
|
|
|
|
failed = TRUE;
|
|
|
|
g_warning ("gtk_signal_collect_params(): invalid NULL pointer for return argument type `%s'",
|
|
|
|
gtk_type_name (params->type));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
failed = TRUE;
|
|
|
|
g_warning ("gtk_signal_collect_params(): unsupported return argument type `%s'",
|
|
|
|
gtk_type_name (params->type));
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
deleted most of the argument handling code, since that is now implemented
Fri Jul 10 00:02:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: deleted most of the argument handling code, since
that is now implemented in gtkarg.c. similar to gtk_object_args_collect,
we now export a new function gtk_container_child_args_collect().
for consistency with the object arguments, a few functions got renamed:
gtk_container_child_arg_get -> gtk_container_child_get,
gtk_container_child_arg_set -> gtk_container_child_set,
gtk_container_child_arg_getv -> gtk_container_child_getv,
gtk_container_child_arg_setv -> gtk_container_child_setv,
gtk_container_add_with_argv -> gtk_container_addv.
note, gtk_container_add_with_args() remained, because its equivalent
would be gtk_container_add(,, ...) which would break all existing code.
(gtk_container_add_child_arg_type): similar to gtk_object_add_arg_type,
we expect the `arg_name' argument to be a const static string now.
(gtk_container_get_child_arg_type): function removed.
Thu Jul 9 07:03:04 1998 Tim Janik <timj@gtk.org>
* gtk/gtkargcollector.c: new file which holds gtk_arg_collect_value().
this is a static inline function that collects command line arguments
from a va_list. this file can just be included in all places that
need this functionality.
* gtk/gtkarg.h:
* gtk/gtkarg.c: new files which implement most of the argument
handling stuff from gtkobject.c. also collected a few more
gtk_arg_* utility functions from else places.
* gtk/gtkobject.h:
* gtk/gtkobject.c: moved most of the argument handling code into
gtkarg.c. we now export gtk_object_args_collect() as a non-public
method with a blind va_list pointer.
(gtk_object_add_arg_type): the `arg_name' argument is required to be a
const static string now.
(gtk_object_get_arg_type): function got removed.
* gtk/gtkwidget.c:
(gtk_widget_set):
(gtk_widget_new): adaptions for gtk_object_args_collect().
* gtk/gtktypeutils.c (gtk_type_init_builtin_types): changed the internal
fundamental type name so as to have a valid prefix, e.g. "bool"->
"gboolean", "string"->"GtkString" and somesuch, left "void" as is,
though that should probably be something like GtkNone since the
type itself is called GTK_TYPE_NONE.
even the internal type names need to avoid name clashes and must live
in their own namespace, several code portions rely on that.
we should relly have typedefs such as typedef gchar* GtkString; so the
fundamental type names can be used for code dumpers just like with all
the Gtk/Gdk types.
1998-07-09 23:00:34 +00:00
|
|
|
else
|
|
|
|
GTK_VALUE_POINTER (*params) = NULL;
|
|
|
|
|
|
|
|
return failed;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|