]> Pileus Git - ~andy/gtk/blob - gtk/gtksignal.h
disable USE_MMX for msvc build cause the assembler doesn't fit and is out
[~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_lookup                             g_signal_lookup
48 #define gtk_signal_name                               g_signal_name
49 #define gtk_signal_emit_stop(i,s)                     g_signal_stop_emission ((i), (s), 0)
50 #define gtk_signal_connect(o,s,f,d)                   gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 0, 0)
51 #define gtk_signal_connect_after(o,s,f,d)             gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 0, 1)
52 #define gtk_signal_connect_object(o,s,f,d)            gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 1, 0)
53 #define gtk_signal_connect_object_after(o,s,f,d)      gtk_signal_connect_full ((o), (s), (f), 0, (d), 0, 1, 1)
54 #define gtk_signal_disconnect                         g_signal_handler_disconnect
55 #define gtk_signal_handler_block                      g_signal_handler_block
56 #define gtk_signal_handler_unblock                    g_signal_handler_unblock
57 #define gtk_signal_disconnect_by_func(o,f,d)          gtk_signal_compat_matched ((o), (f), (d), G_SIGNAL_MATCH_FUNC | \
58                                                                                                 G_SIGNAL_MATCH_DATA, 0)
59 #define gtk_signal_disconnect_by_data(o,d)            gtk_signal_compat_matched ((o), 0, (d), G_SIGNAL_MATCH_DATA, 0)
60 #define gtk_signal_handler_block_by_func(o,f,d)       gtk_signal_compat_matched ((o), (f), (d), G_SIGNAL_MATCH_FUNC | \
61                                                                                                 G_SIGNAL_MATCH_DATA, 1)
62 #define gtk_signal_handler_block_by_data(o,d)         gtk_signal_compat_matched ((o), 0, (d), G_SIGNAL_MATCH_DATA, 1)
63 #define gtk_signal_handler_unblock_by_func(o,f,d)     gtk_signal_compat_matched ((o), (f), (d), G_SIGNAL_MATCH_FUNC | \
64                                                                                                 G_SIGNAL_MATCH_DATA, 2)
65 #define gtk_signal_handler_unblock_by_data(o,d)       gtk_signal_compat_matched ((o), 0, (d), G_SIGNAL_MATCH_DATA, 2)
66 #define gtk_signal_handler_pending(i,s,b)             g_signal_has_handler_pending ((i), 0, (s), (b))
67 #define gtk_signal_handler_pending_by_func(o,s,b,f,d) (g_signal_handler_find ((o), G_SIGNAL_MATCH_ID | \
68                                                                                    G_SIGNAL_MATCH_FUNC | \
69                                                                                    G_SIGNAL_MATCH_DATA | \
70                                                                                    ((b) ? 0 : G_SIGNAL_MATCH_UNBLOCKED), \
71                                                                                    (s), 0, 0, (f), (d)) != 0)
72
73
74 /* --- compat functions --- */
75 guint   gtk_signal_newv                         (const gchar        *name,
76                                                  GtkSignalRunType    signal_flags,
77                                                  GtkType             object_type,
78                                                  guint               function_offset,
79                                                  GtkSignalMarshaller marshaller,
80                                                  GtkType             return_val,
81                                                  guint               n_args,
82                                                  GtkType            *args);
83 guint   gtk_signal_new                          (const gchar        *name,
84                                                  GtkSignalRunType    signal_flags,
85                                                  GtkType             object_type,
86                                                  guint               function_offset,
87                                                  GtkSignalMarshaller marshaller,
88                                                  GtkType             return_val,
89                                                  guint               n_args,
90                                                  ...);
91 void    gtk_signal_emit_stop_by_name            (GtkObject          *object,
92                                                  const gchar        *name);
93 void    gtk_signal_connect_object_while_alive   (GtkObject          *object,
94                                                  const gchar        *signal,
95                                                  GtkSignalFunc       func,
96                                                  GtkObject          *alive_object);
97 void    gtk_signal_connect_while_alive          (GtkObject          *object,
98                                                  const gchar        *signal,
99                                                  GtkSignalFunc       func,
100                                                  gpointer            func_data,
101                                                  GtkObject          *alive_object);
102 guint   gtk_signal_connect_full                 (GtkObject          *object,
103                                                  const gchar        *name,
104                                                  GtkSignalFunc       func,
105                                                  GtkCallbackMarshal  unsupported,
106                                                  gpointer            data,
107                                                  GtkDestroyNotify    destroy_func,
108                                                  gint                object_signal,
109                                                  gint                after);
110 void    gtk_signal_emitv                        (GtkObject          *object,
111                                                  guint               signal_id,
112                                                  GtkArg             *args);
113 void    gtk_signal_emit                         (GtkObject          *object,
114                                                  guint               signal_id,
115                                                  ...);
116 void    gtk_signal_emit_by_name                 (GtkObject          *object,
117                                                  const gchar        *name,
118                                                  ...);
119 void    gtk_signal_emitv_by_name                (GtkObject          *object,
120                                                  const gchar        *name,
121                                                  GtkArg             *args);
122 void    gtk_signal_compat_matched               (GtkObject          *object,
123                                                  GtkSignalFunc       func,
124                                                  gpointer            data,
125                                                  GSignalMatchType    match,
126                                                  guint               action);
127
128
129 #ifdef __cplusplus
130 }
131 #endif /* __cplusplus */
132
133
134 #endif /* __GTK_SIGNAL_H__ */