~ubuntu-branches/ubuntu/gutsy/wireshark/gutsy-security

« back to all changes in this revision

Viewing changes to gtk/compat_macros.h

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2007-04-01 08:58:40 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070401085840-or3qhrpv8alt1bwg
Tags: 0.99.5-1
* New upstream release.
* debian/patches/09_idl2wrs.dpatch: updated to patch idl2wrs.sh.in.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* compat_macros.h
2
2
 * GTK-related Global defines, etc.
3
3
 *
4
 
 * $Id: compat_macros.h 19020 2006-08-24 21:40:53Z ulfl $
 
4
 * $Id: compat_macros.h 19924 2006-11-18 01:47:49Z gerald $
5
5
 *
6
6
 * Wireshark - Network traffic analyzer
7
7
 * By Gerald Combs <gerald@wireshark.org>
28
28
 
29
29
/** @file
30
30
 *
31
 
 * Helper macros for gtk1.x / gtk2.x compatibility. Use these macros instead of the GTK deprecated functions, 
 
31
 * Helper macros for gtk1.x / gtk2.x compatibility. Use these macros instead of the GTK deprecated functions,
32
32
 * to keep compatibility between GTK 1.x and 2.x.
33
33
 * For example in gtk2.x, gtk_signal_xxx is deprecated in favor of g_signal_xxx,
34
34
 *          gtk_object_xxx is deprecated in favor of g_object_xxx,
50
50
gtk_signal_connect(GTK_OBJECT(widget), name, GTK_SIGNAL_FUNC(callback), \
51
51
                   (gpointer)(arg))
52
52
 
53
 
/** This function is for registering a callback that will call another object's callback. 
54
 
 *  That is, instead of passing the object which is responsible for the event as the first 
55
 
 *  parameter of the callback, it is switched with the user data (so the object which emits 
 
53
/** This function is for registering a callback that will call another object's callback.
 
54
 *  That is, instead of passing the object which is responsible for the event as the first
 
55
 *  parameter of the callback, it is switched with the user data (so the object which emits
56
56
 *  the signal will be the last parameter, which is where the user data usually is).
57
57
 *
58
58
 * @param widget the widget to connect to
65
65
gtk_signal_connect_object(GTK_OBJECT(widget), name, GTK_SIGNAL_FUNC(callback), \
66
66
                          (gpointer)(arg))
67
67
 
68
 
/** Destroys all connections for a particular object, with the given 
 
68
/** Destroys all connections for a particular object, with the given
69
69
 *  function-pointer and user-data.
70
70
 *
71
71
 * @param object the object which emits the signal
76
76
gtk_signal_disconnect_by_func(GTK_OBJECT(object), func, data)
77
77
 
78
78
/** Each object carries around a table of associations from strings to pointers,
79
 
 *  this function lets you set an association. If the object already had an 
80
 
 *  association with that name, the old association will be destroyed. 
 
79
 *  this function lets you set an association. If the object already had an
 
80
 *  association with that name, the old association will be destroyed.
81
81
 *
82
82
 * @param widget object containing the associations
83
83
 * @param key name of the key
95
95
#define OBJECT_GET_DATA(widget, key) \
96
96
gtk_object_get_data(GTK_OBJECT(widget), key)
97
97
 
98
 
/** Sets the size of a widget. This will be useful to set the size of 
99
 
 * e.g. a GtkEntry. Don't use WIDGET_SET_SIZE() to set the size of a dialog 
 
98
/** Sets the size of a widget. This will be useful to set the size of
 
99
 * e.g. a GtkEntry. Don't use WIDGET_SET_SIZE() to set the size of a dialog
100
100
 * or window, use gtk_window_set_default_size() for that purpose!
101
101
 *
102
102
 * @param widget a GtkWidget
107
107
#define WIDGET_SET_SIZE(widget, width, height) \
108
108
gtk_widget_set_usize(GTK_WIDGET(widget), width, height)
109
109
 
110
 
/** Emits a signal. This causes the default handler and user-connected 
 
110
/** Emits a signal. This causes the default handler and user-connected
111
111
 *  handlers to be run.
112
 
 *
113
 
 * @param widget the object that emits the signal
114
 
 * @param name the name of the signal
115
 
 * @param arg value to pass to the handlers or NULL
116
112
 */
117
 
#define SIGNAL_EMIT_BY_NAME(widget, name, arg) \
118
 
gtk_signal_emit_by_name(GTK_OBJECT(widget), name, arg)
 
113
#define SIGNAL_EMIT_BY_NAME gtk_signal_emit_by_name
119
114
 
120
 
/** This function aborts a signal's current emission. It will prevent the 
121
 
 *  default method from running, if the signal was GTK_RUN_LAST and you 
122
 
 *  connected normally (i.e. without the "after" flag). It will print a 
123
 
 *  warning if used on a signal which isn't being emitted. It will lookup the 
 
115
/** This function aborts a signal's current emission. It will prevent the
 
116
 *  default method from running, if the signal was GTK_RUN_LAST and you
 
117
 *  connected normally (i.e. without the "after" flag). It will print a
 
118
 *  warning if used on a signal which isn't being emitted. It will lookup the
124
119
 *  signal id for you.
125
120
 *
126
121
 * @param widget the object whose signal handlers you wish to stop
308
303
#define WIDGET_SET_SIZE(widget, width, height) \
309
304
gtk_widget_set_size_request(GTK_WIDGET(widget), width, height)
310
305
 
311
 
#define SIGNAL_EMIT_BY_NAME(widget, name, arg) \
312
 
g_signal_emit_by_name(G_OBJECT(widget), name, arg)
 
306
#define SIGNAL_EMIT_BY_NAME g_signal_emit_by_name
313
307
 
314
308
#define SIGNAL_EMIT_STOP_BY_NAME(widget, name) \
315
309
g_signal_stop_emission_by_name(G_OBJECT(widget), name)