Commit e031c4f5 authored by Javier Jardon's avatar Javier Jardon

Remove GtkSignal completely

parent d98aeeff
......@@ -1898,7 +1898,7 @@ not applied you'll have to use the
function. <literal>gtk_object_class_user_signal_new</literal> allows you
to add a new signal to a predefined GTK+ widget without any
modification of the GTK+ source code. The new signal can be
emited with <literal>gtk_signal_emit</literal> and can be
emited with <literal>g_signal_emit</literal> and can be
handled in the same way as other signals.</para>
<para>Tim Janik posted this code snippet:</para>
......@@ -1920,7 +1920,7 @@ gtk_widget_user_action (GtkWidget *widget,
{
g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_signal_emit (GTK_OBJECT (widget), signal_user_action, act_data);
g_signal_emit (widget, signal_user_action, act_data);
}
</programlisting>
......@@ -2559,10 +2559,10 @@ into the entry.</para>
signal handler with</para>
<programlisting role="C">
gtk_signal_connect(GTK_COMBO(cb)->entry,
"changed",
GTK_SIGNAL_FUNC(my_cb_change_handler),
NULL);
g_signal_connect(GTK_COMBO(cb)->entry,
"changed",
G_CALLBACK(my_cb_change_handler),
NULL);
</programlisting>
</sect1>
......@@ -2864,9 +2864,9 @@ be:</para>
<programlisting role="C">
entry = gtk_entry_new();
gtk_signal_connect (GTK_OBJECT(entry), "activate",
GTK_SIGNAL_FUNC(entry_callback),
NULL);
g_signal_connect (entry, "activate",
G_CALLBACK(entry_callback),
NULL);
</programlisting>
</sect1>
......@@ -3044,8 +3044,8 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (window), text);
/* connect after everything else */
gtk_signal_connect_after (GTK_OBJECT(text), "button_press_event",
GTK_SIGNAL_FUNC (insert_bar), NULL);
g_signal_connect_after (text, "button_press_event",
G_CALLBACK (insert_bar), NULL);
gtk_widget_show_all(window);
gtk_main();
......
......@@ -6293,46 +6293,6 @@ gtk_drag_source_add_image_targets
gtk_drag_source_add_uri_targets
</SECTION>
<SECTION>
<FILE>gtksignal</FILE>
<TITLE>Signals</TITLE>
GTK_SIGNAL_OFFSET
GtkSignalRunType
gtk_signal_new
gtk_signal_newv
gtk_signal_lookup
gtk_signal_name
gtk_signal_emit
gtk_signal_emit_by_name
gtk_signal_emitv
gtk_signal_emitv_by_name
gtk_signal_emit_stop
gtk_signal_emit_stop_by_name
gtk_signal_connect
gtk_signal_connect_after
gtk_signal_connect_object
gtk_signal_connect_object_after
gtk_signal_connect_full
gtk_signal_connect_while_alive
gtk_signal_connect_object_while_alive
gtk_signal_disconnect
gtk_signal_disconnect_by_func
gtk_signal_disconnect_by_data
gtk_signal_handler_block
gtk_signal_handler_block_by_func
gtk_signal_handler_block_by_data
gtk_signal_handler_unblock
gtk_signal_handler_unblock_by_func
gtk_signal_handler_unblock_by_data
gtk_signal_handler_pending
gtk_signal_handler_pending_by_func
gtk_signal_default_marshaller
<SUBSECTION Private>
gtk_signal_compat_matched
</SECTION>
<SECTION>
<FILE>gtktypeutils</FILE>
<TITLE>Types</TITLE>
......
......@@ -22,9 +22,9 @@ or gtk_object_get).
they describe <wordasword>signal arguments</wordasword>.
This is a lot less often needed but still useful.
Usually if you are just emitting or creating a particular signal
it is more convenient to just use gtk_signal_emit() or gtk_signal_new().
it is more convenient to just use g_signal_emit() or g_signal_new().
However if you are writing a function to emit or create an arbitrary
signal, you must use gtk_signal_emitv() or gtk_signal_newv().
signal, you must use g_signal_emitv() or g_signal_newv().
</para>
</listitem>
</itemizedlist>
......@@ -133,7 +133,7 @@ gboolean sigfunc(gpointer,gint,gint,guint);
<refsect2>
<title>Writing Custom Marshals</title>
<para>
Marshals are primarily used as arguments to gtk_signal_new().
Marshals are primarily used as arguments to g_signal_new().
Sometimes, you may find that a marshaller you need isn't available
in the standard list. Then you have to write your own.
</para>
......@@ -1203,7 +1203,7 @@ and swapped when the signal handler is invoked.
This is useful for handlers that are primarily notifying
other objects and could just invoke an already existing function
if the parameters were swapped.
See gtk_signal_connect_object() for more details.
See g_signal_connect_swapped() for more details.
</para>
......@@ -1215,7 +1215,7 @@ and swapped when the signal handler is invoked,
and so that the handler is invoked after all others.
</para>
<para>
See gtk_signal_connect_object_after() for more details.
See g_signal_connect_data() for more details.
</para>
......@@ -2899,14 +2899,14 @@ See the signal documentation for more general information.
@klass: the object class to define the signal for.
@name: the name of the signal.
@signal_flags: the default emission behavior for the signal.
See gtk_signal_new().
See g_signal_new().
@marshaller: a function that will take an array of GtkArgs
and invoke the appropriate handler with the normal calling
conventions.
@return_val: specify the return-value type for the signal
(or GTK_TYPE_NONE for no return-value).
@nparams: specify the number of parameters the signal
receives from the caller of gtk_signal_emit().
receives from the caller of g_signal_emit().
@Varargs: list of nparams #GtkTypes to pass to the signal handlers.
@Returns: the signal id. (See #GtkSignals)
......@@ -2919,7 +2919,7 @@ object.
@klass: the object class to define the signal for.
@name: the name of the signal.
@signal_flags: the default emission behavior for the signal.
See gtk_signal_new().
See g_signal_new().
@marshaller: takes a GtkObject, a #GtkSignalFunc, and an array
of arguments, and invokes the function using the appropriate
calling conventions. Usually just select a function
......@@ -2927,7 +2927,7 @@ out of gtkmarshal.h.
@return_val: specify the return-value type for the signal (possibly
#GTK_TYPE_NONE).
@nparams: specify the number of parameters the signal
receives from the caller of gtk_signal_emit().
receives from the caller of g_signal_emit().
@params: array of #GtkTypes the signal handlers for this signal
should have in their prototype (of length nparams).
@Returns: the signal id. (See #GtkSignals)
......@@ -3328,131 +3328,6 @@ Internal function.
@Returns:
<!-- ##### FUNCTION gtk_signal_add_emission_hook ##### -->
<para>
Add an emission hook for a type of signal, for any object.
</para>
@signal_id: the type of signal to hook for.
@hook_func: the function to invoke to handle the emission hook.
@data: the user data passed in to hook_func.
@Returns: the id (that you may pass as a parameter
to gtk_signal_remove_emission_hook()).
@i:
@h:
@d:
<!-- ##### FUNCTION gtk_signal_add_emission_hook_full ##### -->
<para>
Add an emission hook for a type of signal, for any object.
(with control of what happens when the hook is
destroyed).
</para>
@signal_id: the type of signal add the hook for.
@hook_func: the function to invoke to handle the hook.
@data: the user data passed in to hook_func.
@destroy: a function to invoke when the hook is destroyed,
to clean up any allocation done just for this
signal handler.
@Returns: the id (that you may pass as a parameter
to gtk_signal_remove_emission_hook()).
<!-- ##### FUNCTION gtk_signal_handler_pending_by_id ##### -->
<para>
Returns whether a connection id is valid (and optionally not blocked).
</para>
@object: the object to search for the desired handler.
@handler_id: the connection id.
@may_be_blocked: whether it is acceptable to return a blocked
handler.
@Returns: TRUE if the signal exists and wasn't blocked,
unless #may_be_blocked was specified. FALSE otherwise.
<!-- ##### FUNCTION gtk_signal_handlers_destroy ##### -->
<para>
Destroy all the signal handlers connected to an object.
This is done automatically when the object is destroyed.
</para>
<para>
This function is labeled private.
</para>
@object: the object whose signal handlers should be destroyed.
<!-- ##### FUNCTION gtk_signal_init ##### -->
<para>
</para>
<!-- ##### FUNCTION gtk_signal_n_emissions ##### -->
<para>
Find out the recursion depth of emissions for a particular type
of signal and object. (So it will
always return 0 or 1 if #GTK_RUN_NO_RECURSE is specified)
This is a way to avoid recursion: you can see if
you are currently running in that signal handler and emit it only
if you are.
</para>
<para>Another way to look at it is that this number increases
by one when #gtk_signal_emit(), et al, are called,
and decreases by one when #gtk_signal_emit() returns.
</para>
@object: the object with the signal handler.
@signal_id: the signal id.
@Returns: the recursion depth of emissions of this signal for this
object.
<!-- ##### FUNCTION gtk_signal_n_emissions_by_name ##### -->
<para>
Find out the recursion depth of emissions for a particular type
of signal and object. Just like gtk_signal_n_emissions()
except it will lookup the signal id for you.
</para>
@object: the object with the signal handler.
@name: the signal name.
@Returns: the recursion depth of emissions of this signal for this
object.
<!-- ##### FUNCTION gtk_signal_query ##### -->
<para>
Obtain information about a signal.
</para>
@signal_id: the signal type identifier.
@Returns: a pointer to a GtkSignalQuery structure
which contains all the information, or NULL.
The pointer is allocated just for you: you must g_free() it.
<!-- ##### FUNCTION gtk_signal_remove_emission_hook ##### -->
<para>
Delete an emission hook. (see gtk_signal_add_emission_hook())
</para>
@signal_id: the id of the signal type.
@hook_id: the id of the emission handler, returned by add_emission_hook().
@i:
@h:
<!-- ##### FUNCTION gtk_signal_set_funcs ##### -->
<para>
These set default functions to call when the user didn't
supply a function when connecting. (These are rarely
used, and probably only for language bindings)
</para>
<para>
By default, there are no such functions.
</para>
@marshal_func: the function to invoke on every handlers for which there
isn't a function pointer. May be NULL.
@destroy_func: the function to invoke when each hook is destroyed.
May be NULL.
<!-- ##### FUNCTION gtk_spin_button_set_shadow_type ##### -->
<para>
Creates a border around the arrows of a #GtkSpinButton. The type of border is determined by @shadow_type.
......
This diff is collapsed.
......@@ -637,12 +637,10 @@ gtk_base_c_sources = \
gtk_public_h_sources += \
gtkpixmap.h \
gtkprogress.h \
gtksignal.h \
gtktooltips.h
gtk_base_c_sources += \
gtkpixmap.c \
gtkprogress.c \
gtksignal.c \
gtktooltips.c
gtk_c_sources = $(gtk_base_c_sources)
......
......@@ -372,7 +372,6 @@ gtk_scroll_type_get_type G_GNUC_CONST
gtk_selection_mode_get_type G_GNUC_CONST
gtk_shadow_type_get_type G_GNUC_CONST
gtk_side_type_get_type G_GNUC_CONST
gtk_signal_run_type_get_type G_GNUC_CONST
gtk_size_group_mode_get_type G_GNUC_CONST
gtk_sort_type_get_type G_GNUC_CONST
gtk_spin_type_get_type G_GNUC_CONST
......@@ -3404,24 +3403,6 @@ gtk_rc_property_parse_requisition
#endif
#endif
#if IN_HEADER(__GTK_SIGNAL_H__)
#if IN_FILE(__GTK_SIGNAL_C__)
#ifndef GTK_DISABLE_DEPRECATED
gtk_signal_compat_matched
gtk_signal_connect_full
gtk_signal_connect_object_while_alive
gtk_signal_connect_while_alive
gtk_signal_emit
gtk_signal_emit_by_name
gtk_signal_emit_stop_by_name
gtk_signal_emitv
gtk_signal_emitv_by_name
gtk_signal_new
gtk_signal_newv
#endif
#endif
#endif
#if IN_HEADER(__GTK_SIZE_GROUP_H__)
#if IN_FILE(__GTK_SIZE_GROUP_C__)
gtk_size_group_add_widget
......
......@@ -36,9 +36,6 @@
#include <gtk/gtkwidget.h>
/* Not needed, retained for compatibility -Yosh */
#include <gtk/gtksignal.h>
G_BEGIN_DECLS
......
......@@ -2501,9 +2501,8 @@ gtk_print (gchar *str)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_window_set_title (GTK_WINDOW (window), "Messages");
......@@ -2552,9 +2551,8 @@ gtk_print (gchar *str)
button = gtk_button_new_with_label ("close");
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
G_CALLBACK (gtk_widget_hide),
GTK_OBJECT (window));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_hide), window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
......
This diff is collapsed.
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef GTK_DISABLE_DEPRECATED
#ifndef __GTK_SIGNAL_H__
#define __GTK_SIGNAL_H__
#include <gtk/gtk.h>
#include <gtk/gtkmarshal.h>
G_BEGIN_DECLS
#define gtk_signal_default_marshaller g_cclosure_marshal_VOID__VOID
/* --- compat defines --- */
#define GTK_SIGNAL_OFFSET G_STRUCT_OFFSET
#define gtk_signal_lookup(name,object_type) \
g_signal_lookup ((name), (object_type))
#define gtk_signal_name(signal_id) \
g_signal_name (signal_id)
#define gtk_signal_emit_stop(object,signal_id) \
g_signal_stop_emission ((object), (signal_id), 0)
#define gtk_signal_connect(object,name,func,func_data) \
gtk_signal_connect_full ((object), (name), (func), NULL, (func_data), NULL, 0, 0)
#define gtk_signal_connect_after(object,name,func,func_data) \
gtk_signal_connect_full ((object), (name), (func), NULL, (func_data), NULL, 0, 1)
#define gtk_signal_connect_object(object,name,func,slot_object) \
gtk_signal_connect_full ((object), (name), (func), NULL, (slot_object), NULL, 1, 0)
#define gtk_signal_connect_object_after(object,name,func,slot_object) \
gtk_signal_connect_full ((object), (name), (func), NULL, (slot_object), NULL, 1, 1)
#define gtk_signal_disconnect(object,handler_id) \
g_signal_handler_disconnect ((object), (handler_id))
#define gtk_signal_handler_block(object,handler_id) \
g_signal_handler_block ((object), (handler_id))
#define gtk_signal_handler_unblock(object,handler_id) \
g_signal_handler_unblock ((object), (handler_id))
#define gtk_signal_disconnect_by_func(object,func,data) \
gtk_signal_compat_matched ((object), (func), (data), \
(GSignalMatchType)(G_SIGNAL_MATCH_FUNC | \
G_SIGNAL_MATCH_DATA), 0)
#define gtk_signal_disconnect_by_data(object,data) \
gtk_signal_compat_matched ((object), 0, (data), G_SIGNAL_MATCH_DATA, 0)
#define gtk_signal_handler_block_by_func(object,func,data) \
gtk_signal_compat_matched ((object), (func), (data), \
(GSignalMatchType)(G_SIGNAL_MATCH_FUNC | \
G_SIGNAL_MATCH_DATA), 1)
#define gtk_signal_handler_block_by_data(object,data) \
gtk_signal_compat_matched ((object), 0, (data), G_SIGNAL_MATCH_DATA, 1)
#define gtk_signal_handler_unblock_by_func(object,func,data) \
gtk_signal_compat_matched ((object), (func), (data), \
(GSignalMatchType)(G_SIGNAL_MATCH_FUNC | \
G_SIGNAL_MATCH_DATA), 2)
#define gtk_signal_handler_unblock_by_data(object,data) \
gtk_signal_compat_matched ((object), 0, (data), G_SIGNAL_MATCH_DATA, 2)
#define gtk_signal_handler_pending(object,signal_id,may_be_blocked) \
g_signal_has_handler_pending ((object), (signal_id), 0, (may_be_blocked))
#define gtk_signal_handler_pending_by_func(object,signal_id,may_be_blocked,func,data) \
(g_signal_handler_find ((object), \
(GSignalMatchType)(G_SIGNAL_MATCH_ID | \
G_SIGNAL_MATCH_FUNC | \
G_SIGNAL_MATCH_DATA | \
((may_be_blocked) ? 0 : G_SIGNAL_MATCH_UNBLOCKED)),\
(signal_id), 0, 0, (func), (data)) != 0)
/* --- compat functions --- */
guint gtk_signal_newv (const gchar *name,
GtkSignalRunType signal_flags,
GType object_type,
guint function_offset,
GSignalCMarshaller marshaller,
GType return_val,
guint n_args,
GType *args);
guint gtk_signal_new (const gchar *name,
GtkSignalRunType signal_flags,
GType object_type,
guint function_offset,
GSignalCMarshaller marshaller,
GType return_val,
guint n_args,
...);
void gtk_signal_emit_stop_by_name (GtkObject *object,
const gchar *name);
void gtk_signal_connect_object_while_alive (GtkObject *object,
const gchar *name,
GCallback func,
GtkObject *alive_object);
void gtk_signal_connect_while_alive (GtkObject *object,
const gchar *name,
GCallback func,
gpointer func_data,
GtkObject *alive_object);
gulong gtk_signal_connect_full (GtkObject *object,
const gchar *name,
GCallback func,
GtkCallbackMarshal unsupported,
gpointer data,
GDestroyNotify destroy_func,
gint object_signal,
gint after);
void gtk_signal_emitv (GtkObject *object,
guint signal_id,
GtkArg *args);
void gtk_signal_emit (GtkObject *object,
guint signal_id,
...);
void gtk_signal_emit_by_name (GtkObject *object,
const gchar *name,
...);
void gtk_signal_emitv_by_name (GtkObject *object,
const gchar *name,
GtkArg *args);
void gtk_signal_compat_matched (GtkObject *object,
GCallback func,
gpointer data,
GSignalMatchType match,
guint action);
G_END_DECLS
#endif /* __GTK_SIGNAL_H__ */
#endif /* GTK_DISABLE_DEPRECATED */
......@@ -45,7 +45,6 @@
/* Not needed, retained for compatibility -Yosh */
#include <gtk/gtkpixmap.h>
#include <gtk/gtksignal.h>
#endif /* GTK_DISABLE_DEPRECATED */
......
......@@ -114,7 +114,6 @@ gtk_OBJECTS_deprecated = \
gtkprogress.obj \
gtktipsquery.obj \
gtkshow.obj \
gtksignal.obj \
gtkpixmap.obj \
gtkpreview.obj \
gtkseparatortoolitem.obj \
......@@ -502,7 +501,6 @@ gtk_public_h_sources = \
gtkseparatormenuitem.h \
gtkseparatortoolitem.h \
gtksettings.h \
gtksignal.h \
gtksizegroup.h \
gtksocket.h \
gtkspinbutton.h \
......@@ -618,8 +616,6 @@ gtkmarshal.c : gtkmarshal.list
gtktypefuncs.c : makefile.msc
echo /*none*/ > gtktypefuncs.c
gtksignal.obj : gtksignal.c gtkmarshal.c gtkmarshal.h
$(CC) $(CFLAGS) -GD -c -DGTK_COMPILATION -DG_LOG_DOMAIN=\"Gtk\" gtksignal.c
gtk-win32.res : gtk-win32.rc
rc -DBUILDNUMBER=0 -r -fo gtk-win32.res gtk-win32.rc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment