]> Pileus Git - ~andy/gtk/blob - gtk/gtksignal.h
urg, removed implementation of gtk_marshal_VOID__INT_INT_INT_INT. if
[~andy/gtk] / gtk / gtksignal.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #ifndef __GTK_SIGNAL_H__
28 #define __GTK_SIGNAL_H__
29
30
31 #include <gtk/gtkenums.h>
32 #include <gtk/gtkobject.h>
33 #include <gtk/gtkmarshal.h>
34
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif /* __cplusplus */
39
40   
41
42 #define gtk_signal_default_marshaller   gtk_marshal_VOID__VOID
43
44
45 /* --- compat defines --- */
46 #define GTK_SIGNAL_OFFSET                             GTK_STRUCT_OFFSET
47 #define gtk_signal_init()                             g_type_init()
48 #define gtk_signal_lookup                             g_signal_lookup
49 #define gtk_signal_name                               g_signal_name
50 #define gtk_signal_emit_stop                          g_signal_stop_emission
51 #define gtk_signal_connect(o,s,f,d)                   gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 0, 0)
52 #define gtk_signal_connect_after(o,s,f,d)             gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 0, 1)
53 #define gtk_signal_connect_object(o,s,f,d)            gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 1, 0)
54 #define gtk_signal_connect_object_after(o,s,f,d)      gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 1, 1)
55 #define gtk_signal_disconnect                         g_signal_handler_disconnect
56 #define gtk_signal_handler_block                      g_signal_handler_block
57 #define gtk_signal_handler_unblock                    g_signal_handler_unblock
58 #define gtk_signal_disconnect_by_func(o,f,d)          gtk_signal_compat_matched ((o), (f), (d), G_SIGNAL_MATCH_FUNC | \
59                                                                                                 G_SIGNAL_MATCH_DATA, 0)
60 #define gtk_signal_disconnect_by_data(o,d)            gtk_signal_compat_matched ((o), 0, (d), G_SIGNAL_MATCH_DATA, 0)
61 #define gtk_signal_handler_block_by_func(o,f,d)       gtk_signal_compat_matched ((o), (f), (d), G_SIGNAL_MATCH_FUNC | \
62                                                                                                 G_SIGNAL_MATCH_DATA, 1)
63 #define gtk_signal_handler_block_by_data(o,d)         gtk_signal_compat_matched ((o), 0, (d), G_SIGNAL_MATCH_DATA, 1)
64 #define gtk_signal_handler_unblock_by_func(o,f,d)     gtk_signal_compat_matched ((o), (f), (d), G_SIGNAL_MATCH_FUNC | \
65                                                                                                 G_SIGNAL_MATCH_DATA, 2)
66 #define gtk_signal_handler_unblock_by_data(o,d)       gtk_signal_compat_matched ((o), 0, (d), G_SIGNAL_MATCH_DATA, 2)
67 #define gtk_signal_handler_pending                    g_signal_has_handler_pending
68 #define gtk_signal_handler_pending_by_func(o,s,b,f,d) (g_signal_handler_find ((o), G_SIGNAL_MATCH_ID | \
69                                                                                    G_SIGNAL_MATCH_FUNC | \
70                                                                                    G_SIGNAL_MATCH_DATA | \
71                                                                                    ((b) ? 0 : G_SIGNAL_MATCH_UNBLOCKED), \
72                                                                                    (s), 0, (f), (d)) != 0)
73
74
75 /* --- compat functions --- */
76 guint   gtk_signal_newv                         (const gchar        *name,
77                                                  GtkSignalRunType    signal_flags,
78                                                  GtkType             object_type,
79                                                  guint               function_offset,
80                                                  GtkSignalMarshaller marshaller,
81                                                  GtkType             return_val,
82                                                  guint               n_args,
83                                                  GtkType            *args);
84 guint   gtk_signal_new                          (const gchar        *name,
85                                                  GtkSignalRunType    signal_flags,
86                                                  GtkType             object_type,
87                                                  guint               function_offset,
88                                                  GtkSignalMarshaller marshaller,
89                                                  GtkType             return_val,
90                                                  guint               n_args,
91                                                  ...);
92 void    gtk_signal_emit_stop_by_name            (GtkObject          *object,
93                                                  const gchar        *name);
94 void    gtk_signal_connect_object_while_alive   (GtkObject          *object,
95                                                  const gchar        *signal,
96                                                  GtkSignalFunc       func,
97                                                  GtkObject          *alive_object);
98 void    gtk_signal_connect_while_alive          (GtkObject          *object,
99                                                  const gchar        *signal,
100                                                  GtkSignalFunc       func,
101                                                  gpointer            func_data,
102                                                  GtkObject          *alive_object);
103 guint   gtk_signal_connect_full                 (GtkObject          *object,
104                                                  const gchar        *name,
105                                                  GtkSignalFunc       func,
106                                                  GtkCallbackMarshal  unsupported,
107                                                  gpointer            data,
108                                                  GtkDestroyNotify    destroy_func,
109                                                  gint                object_signal,
110                                                  gint                after);
111 void    gtk_signal_emitv                        (GtkObject          *object,
112                                                  guint               signal_id,
113                                                  GtkArg             *args);
114 void    gtk_signal_emit                         (GtkObject          *object,
115                                                  guint               signal_id,
116                                                  ...);
117 void    gtk_signal_emit_by_name                 (GtkObject          *object,
118                                                  const gchar        *name,
119                                                  ...);
120 void    gtk_signal_emitv_by_name                (GtkObject          *object,
121                                                  const gchar        *name,
122                                                  GtkArg             *args);
123 void    gtk_signal_compat_matched               (GtkObject          *object,
124                                                  GtkSignalFunc       func,
125                                                  gpointer            data,
126                                                  GSignalMatchType    match,
127                                                  guint               action);
128
129
130 /* FIXME: non-functional relicts */
131 typedef gpointer GtkEmissionHook;
132 #define gtk_signal_add_emission_hook(i,h,d)     (0)
133 #define gtk_signal_remove_emission_hook(i,h)    while (0)
134
135
136 #ifdef __cplusplus
137 }
138 #endif /* __cplusplus */
139
140
141 #endif /* __GTK_SIGNAL_H__ */