2 * Declarations of GTK+-specific UI utility routines
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #ifndef __GUI_UTILS_H__
26 #define __GUI_UTILS_H__
28 #include "ui/ui_util.h"
30 /** @defgroup windows_group Windows
32 * There are the following toplevel windows:
34 * - @ref main_window_group
35 * - Statistic Windows (several different statistic windows)
37 * See: @ref howto_window_page for details.
41 /** @page howto_window_page How to develop a window / dialog
43 * Windows and dialogs are related to each other. Dialogs are special kind of windows, but they behave
44 * slightly different. A dialog sticks on its parent window; A normal window will be much more independent
45 * from its parent window. Dialogs should be used to ask or tell the user something, while windows should
46 * show data which is independent of the main window.
47 * Dialogs are created by calling dlg_window_new() which in turn will call window_new().
48 * After that, dialogs can be developed the same way as windows; all window related functions in gui_utils.h
49 * can be used for both.
51 * @section window_create Create a window
53 * A typical window / dialog will be created by the following calls:
55 * - window_new() will create a new window with default position and size,
56 * use dlg_window_new() if you need a dialog (transient to the main window)
57 * - gtk_window_set_default_size() will set the default size of the window. Only
58 * needed, if the initial size is not appropriate, e.g. when a scrolled_window_new() is used.
59 * - g_signal_connect(my_win, "destroy", my_destroy_cb, NULL) will create a callback if some cleanup
60 * needs to be done after the window is destroyed, e.g. free up memory, or set the window pointer
61 * of a singleton window (only one instance allowed, e.g. about dialog) back to zero
62 * - create and fill in the content and button widgets
63 * - gtk_widget_show_all() shows all the widgets in the window
64 * - window_present() will present the window on screen and
65 * (if available) set previously saved position and size
67 * @section window_events Events
69 * The following events are usually interesting:
71 * - "delete_event": the window manager's "X" (e.g. upper right edge) of the window
72 * was clicked; the default handler will call gtk_widget_destroy()
73 * - "destroy": everything is already gone; only cleanup of left over resources
74 * can/should be done now
76 * @section window_hints Hints
78 * If you want to save size and position, be sure to call window_destroy() instead of only
79 * gtk_widget_destroy(), so you will probably have to g_signal_connect() to the "delete_event"!
81 * Don't use gtk_widget_set_size_request() to set the size of a window;
82 * use gtk_window_set_default_size() for that purpose!
84 * Be sure to call window_present() / window_destroy() appropriately, if you
85 * want to have size and position of the window handled by ui_util.
90 * Utilities for Windows and other user interface functions. See: @ref howto_window_page for details.
91 * @ingroup dialog_group
92 * @ingroup windows_group
95 /** @name Window Functions
96 * @todo Move these window functions to a new file win_utils.h?
99 /** Create a new window with the Wireshark icon.
100 * If you want to create a dialog, use dlg_window_new() instead.
102 * @param type window type, typical GTK_WINDOW_TOPLEVEL
103 * @param title the title for the new window
104 * @return the newly created window
106 extern GtkWidget
*window_new(GtkWindowType type
, const gchar
*title
);
108 /** Same as window_new(), but will keep its geometry values (size, position, ...).
109 * Be sure to use window_present() and window_destroy() appropriately!
111 * @param type window type, typical GTK_WINDOW_TOPLEVEL
112 * @param title the title for the new window
113 * @param geom_name the name to distinguish this window; will also be used for the recent file (don't use special chars)
114 * @return the newly created window
116 extern GtkWidget
*window_new_with_geom(GtkWindowType type
, const gchar
*title
, const gchar
*geom_name
);
118 /** Create a new splash window, with no icon or title bar.
120 * @return the newly created window
122 extern GtkWidget
*splash_window_new(void);
124 /** Present the created window on the top of the screen. This will put the window on top and
125 * (if available) set previously saved position and size.
127 * @param win the window from window_new()
129 extern void window_present(GtkWidget
*win
);
131 /** callback function for window_set_cancel_button() */
132 typedef void (*window_cancel_button_fct
) (GtkWidget
*w
, gpointer data
);
134 /** Register the default cancel button "Cancel"/"Close"/"Ok" of this window.
135 * This will set the callback function for this button, grab this button as the default one and
136 * set the "ESC" key handler to call the callback function if key is pressed.
138 * @param win the window from window_new()
139 * @param bt the default button of this window
140 * @param cb callback function to be called, when this button is pressed
142 extern void window_set_cancel_button(GtkWidget
*win
, GtkWidget
*bt
, window_cancel_button_fct cb
);
144 /** Remember the current window position / size and then destroy the window.
145 * It's important to call this instead of gtk_widget_destroy() when using window_new_with_geom().
147 * @param win the window from window_new()
149 extern void window_destroy(GtkWidget
*win
);
151 /** Default callback handler for cancel button "clicked" signal.
152 * Use this for window_set_cancel_button(), if no user specific functionality required,
153 * will simply call window_destroy()
155 extern void window_cancel_button_cb(GtkWidget
*w _U_
, gpointer data
);
157 /** Default callback handler if the window manager's X of the window was clicked (delete_event).
158 * Use this for g_signal_connect(), if no user specific functionality required,
159 * will simply call window_destroy()
161 extern gboolean
window_delete_event_cb(GtkWidget
*win
, GdkEvent
*event _U_
, gpointer user_data _U_
);
163 /** Get the geometry of a window.
165 * @param win the window from window_new()
166 * @param geom the current geometry values of the window; the set_xy values will not be used
167 * @todo if main uses the window_new_with_geom() to save size and such, make this function static
169 extern void window_get_geometry(GtkWidget
*win
, window_geometry_t
*geom
);
171 /** Set the geometry of a window.
173 * @param win the window from window_new()
174 * @param geom the new geometry values of the window
175 * @todo if main uses the window_new_with_geom() to save size and such, make this function static
177 extern void window_set_geometry(GtkWidget
*win
, window_geometry_t
*geom
);
179 /** Raise a top-level window and de-iconify it.
180 * This routine is used if the user has done something to
181 * ask that a window of a certain type be popped up when there can be only
182 * one such window and such a window has already been popped up - we
183 * pop up the existing one rather than creating a new one.
185 * @param win the window from window_new() to be reactivated
187 extern void reactivate_window(GtkWidget
*win
);
191 /** Alert box for an invalid display filter expression.
192 * Assumes "dfilter_error_msg" has been set by "dfilter_compile()" to the
193 * error message for the filter.
195 * @param parent parent window from which the display filter came
196 * @param dftext text of the display filter
198 extern void bad_dfilter_alert_box(GtkWidget
*parent
, const char *dftext
);
200 /** Create a GtkScrolledWindow, set its scrollbar placement appropriately,
203 * @param hadjustment horizontal adjustment
204 * @param vadjustment vertical adjustment
205 * @return the new scrolled window
207 extern GtkWidget
*scrolled_window_new(GtkAdjustment
*hadjustment
,
208 GtkAdjustment
*vadjustment
);
210 /** Create a GtkTreeView, give it the right styles, and remember it.
212 * @param model The model (the data) of this tree view.
214 extern GtkWidget
*tree_view_new(GtkTreeModel
*model
);
216 /** Move the currently-selected item in a list store up or down one position.
218 * @param tree GtkTreeView using a GtkListStore.
219 * @param move_up TRUE to move the selected item up or FALSE to move it down.
220 * @return TRUE if successful, FALSE otherwise.
222 extern gboolean
tree_view_list_store_move_selection(GtkTreeView
*tree
, gboolean move_up
);
224 /** Find the selected row in a list store.
226 * @param tree GtkTreeView using a GtkListStore.
227 * @return The selected row number or -1 if no row is selected.
229 extern gint
tree_view_list_store_get_selected_row(GtkTreeView
*tree
);
231 /** Create a simple list widget.
233 * @param cols number of columns
234 * @param titles the titles of all columns
235 * @return the new simple list widget
237 extern GtkWidget
*simple_list_new(gint cols
, const gchar
**titles
);
238 /** Append a row to the simple list.
240 * @param list the list from simple_list_new()
241 * @param ... row and title, finished by -1 (e.g.: 0, "first", 1, "second", -1).
243 extern void simple_list_append(GtkWidget
*list
, ...);
245 /*** Make a column look like a url
247 * @param list the list from simple_list_new()
248 * @param col the column to make the values lookk like urls
250 extern void simple_list_url_col(GtkWidget
*list
, gint col
);
252 /*** Make a cell underline to look like links
254 * @param cell the cell renderer that will show the text as a link
257 extern void render_as_url(GtkCellRenderer
*cell
);
259 /** Set the styles of all Trees based upon user preferences. */
260 extern void set_tree_styles_all(void);
262 /** Convert an xpm picture into a GtkWidget showing it.
263 * Beware: Wireshark's main window must already be visible!
265 * @param xpm the character array containing the picture
266 * @return a newly created GtkWidget showing the picture
268 extern GtkWidget
*xpm_to_widget(const char ** xpm
);
270 /** Convert an xpm picture into a GtkWidget showing it.
271 * Beware: the given parent window must already be visible!
273 * @param parent the parent window of to widget to be generated
274 * @param xpm the character array containing the picture
275 * @return a newly created GtkWidget showing the picture
277 /*extern GtkWidget *xpm_to_widget_from_parent(GtkWidget *parent, const char ** xpm);*/
279 /** Convert an pixbuf data to a GtkWidget
281 * @param pb_data Inline pixbuf data. This should be created with "gdk-pixbuf-csource --raw"
283 extern GtkWidget
*pixbuf_to_widget(const guint8
* pb_data
);
285 /** Copy a GString to the clipboard.
287 * @param str GString that is to be copied to the clipboard.
289 extern void copy_to_clipboard(GString
*str
);
291 /** Copy an array of bytes to the clipboard.
292 * Copies as mime-type application/octet-stream in GTK 2.
294 * @param data_p Pointer to data to be copied.
295 * @param len Number of bytes in the data to be copied.
297 extern void copy_binary_to_clipboard(const guint8
* data_p
, int len
);
299 /** Create a new window title that includes user-defined preference string.
301 * @param caption string you want included in title (appended to user-defined string)
302 * @return a newly created title string including user-defined preference (if specified)
304 extern gchar
*create_user_window_title(const gchar
*caption
);
306 /** Set the title of a window based on a supplied caption and the
307 * display name for the capture file.
309 * @param win the window whose title is to be set
310 * @param caption caption string for the window
312 extern void set_window_title(GtkWidget
*win
, const gchar
*caption
);
314 /** Collapses tree item and his expanded children
316 * @param tree_view A GtkTreeView
317 * @param path Path to the field
319 extern void tree_collapse_path_all(GtkTreeView
*tree_view
, GtkTreePath
*path
);
321 /** Renders a float with two decimals precission, called from gtk_tree_view_column_set_cell_data_func().
322 * the user data must be the column number.
323 * Present floats with two decimals
325 * @param column A GtkTreeColumn
326 * @param renderer The GtkCellRenderer that is being rendered by tree_column
327 * @param model The GtkTreeModel being rendered
328 * @param iter A GtkTreeIter of the current row rendered
329 * @param user_data must be the column number to fetch the data from
331 void float_data_func (GtkTreeViewColumn
*column
, GtkCellRenderer
*renderer
, GtkTreeModel
*model
, GtkTreeIter
*iter
, gpointer user_data
);
333 /** Renders a unsinged integer as a hexadecimal value, called from gtk_tree_view_column_set_cell_data_func()
334 * The user data must be the column number.
335 * Present value as hexadecimal.
336 * @param column A GtkTreeColumn
337 * @param renderer The GtkCellRenderer that is being rendered by tree_column
338 * @param model The GtkTreeModel being rendered
339 * @param iter A GtkTreeIter of the current row rendered
340 * @param user_data must be the column number to fetch the data from
342 void present_as_hex_func (GtkTreeViewColumn
*column
, GtkCellRenderer
*renderer
, GtkTreeModel
*model
, GtkTreeIter
*iter
, gpointer user_data
);
344 /** Renders an unsigned 64 bits integer with space as thousand separator, called from gtk_tree_view_column_set_cell_data_func()
345 * The user data must be the column number.
346 * Present value as hexadecimal.
347 * @param column A GtkTreeColumn
348 * @param renderer The GtkCellRenderer that is being rendered by tree_column
349 * @param model The GtkTreeModel being rendered
350 * @param iter A GtkTreeIter of the current row rendered
351 * @param user_data must be the column number to fetch the data from
353 void u64_data_func (GtkTreeViewColumn
*column
, GtkCellRenderer
*renderer
, GtkTreeModel
*model
, GtkTreeIter
*iter
, gpointer user_data
);
355 /** This function can be called from gtk_tree_view_column_set_cell_data_func()
356 * the user data must be the column number.
357 * Present value as hexadecimal.
358 * @param column A GtkTreeColumn
359 * @param renderer The GtkCellRenderer that is being rendered by tree_column
360 * @param model The GtkTreeModel being rendered
361 * @param iter A GtkTreeIter of the current row rendered
362 * @param user_data must be the column number to fetch the data from
364 void str_ptr_data_func(GtkTreeViewColumn
*column
, GtkCellRenderer
*renderer
, GtkTreeModel
*model
, GtkTreeIter
*iter
, gpointer user_data
);
366 /** This function can be called from gtk_tree_sortable_set_sort_func()
367 * the user data must be the column number.
368 * Used together with str_ptr_data_func to sort the corresponding column.
369 * @param model The GtkTreeModel the comparison is within
370 * @param a A GtkTreeIter in model
371 * @param b Another GtkTreeIter in model
372 * @param user_data must be the column number to fetch the data from
375 gint
str_ptr_sort_func(GtkTreeModel
*model
,
380 /** Switch a GtkTReeView to fixed columns (speed optimization)
381 * @param view A GtkTreeView
383 void switch_to_fixed_col(GtkTreeView
*view
);
385 /** Return the size in pixels of a string displayed with the GtkWidget's font.
386 * @param view A GtkWidget
387 * @param str UTF8 string
389 gint
get_default_col_size(GtkWidget
*view
, const gchar
*str
);
392 /** --------------------------------------------------
393 * ws_combo_box_text_and_pointer convenience functions
394 * (Code adapted from GtkComboBox.c)
398 * ws_combo_box_new_text_and_pointer_full:
400 * Convenience function which constructs a new "text and pointer" combo box, which
401 * is a #GtkComboBox just displaying strings and storing a pointer associated with
402 * each combo_box entry; The pointer can be retrieved when an entry is selected.
403 * Also: optionally returns the cell renderer for the combo box.
404 * If you use this function to create a text_and_pointer combo_box,
405 * you should only manipulate its data source with the
406 * following convenience functions:
407 * ws_combo_box_append_text_and_pointer()
408 * ws_combo_box_append_text_and_pointer_full()
410 * @param cell_p pointer to return the 'GtkCellRenderer *' for the combo box (or NULL).
411 * @return A pointer to a new text_and_pointer combo_box.
413 GtkWidget
*ws_combo_box_new_text_and_pointer_full(GtkCellRenderer
**cell_p
);
416 * ws_combo_box_new_text_and_pointer:
418 * Convenience function which constructs a new "text and pointer" combo box, which
419 * is a #GtkComboBox just displaying strings and storing a pointer associated with
420 * each combo_box entry; The pointer can be retrieved when an entry is selected.
421 * If you use this function to create a text_and_pointer combo_box,
422 * you should only manipulate its data source with the
423 * following convenience functions:
424 * ws_combo_box_append_text_and_pointer()
425 * ws_combo_box_append_text_and_pointer_full()
427 * @return A pointer to a new text_and_pointer combo_box.
429 GtkWidget
*ws_combo_box_new_text_and_pointer(void);
432 * ws_combo_box_clear_text_and_pointer:
433 * @param combo_box A #GtkComboBox constructed using ws_combo_box_new_text_and_pointer()
435 * Clears all the text_and_pointer entries in the text_and_pointer combo_box.
436 * Note: A "changed" signal will be emitted after the clear if there was
437 * an active (selected) entry before the clear.
438 * You should use this function only with combo boxes constructed with
439 * ws_combo_box_new_text_and_pointer().
441 void ws_combo_box_clear_text_and_pointer(GtkComboBox
*combo_box
);
444 * ws_combo_box_append_text_and_pointer_full:
445 * @param combo_box A #GtkComboBox constructed using ws_combo_box_new_text_and_pointer()
446 * @param parent_iter Parent row for apending; NULL if appending to tree top-level;
447 * @param text A string to be displayed as an entry in the dropdown list of the combo_box
448 * @param ptr A pointer to be associated with this entry of the combo_box
449 * @param sensitive TRUE/FALSE to set sensitivity of the entry
450 * @return A GtkTreeIter pointing to the appended GtkVomboBox entry.
452 * Appends text and ptr to the list of strings and pointers stored in combo_box.
453 * The text and ptr can be appended to any existing level of the tree_store.
454 * The sensitivity of the row will be set as requested.
455 * Note that you can only use this function with combo boxes constructed with
456 * ws_combo_box_new_text_and_pointer().
459 ws_combo_box_append_text_and_pointer_full(GtkComboBox
*combo_box
,
460 GtkTreeIter
*parent_iter
,
463 const gboolean sensitive
);
466 * ws_combo_box_append_text_and_pointer:
467 * @param combo_box A #GtkComboBox constructed using ws_combo_box_new_text_and_pointer()
468 * @param text A string to be displayed as an entry in the dropdown list of the combo_box
469 * @param ptr A pointer to be associated with this entry of the combo_box
470 * @return A GtkTreeIter pointing to the appended GtkComboBox entry.
472 * Appends text and ptr to the list of strings and pointers stored in combo_box. Note that
473 * you can only use this function with combo boxes constructed with
474 * ws_combo_box_new_text_and_pointer().
477 ws_combo_box_append_text_and_pointer(GtkComboBox
*combo_box
,
482 * ws_combo_box_get_active_pointer:
483 * @param combo_box A #GtkComboBox constructed using ws_combo_box_new_text_and_pointer()
484 * @param ptr A pointer to a location in which to store the pointer associated with the active entry
485 * @return TRUE if an entry is selected (i.e: an active entry exists); FALSE otherwise
487 * You can only use this function with combo boxes constructed with
488 * ws_combo_box_new_text_and_pointer().
490 gboolean
ws_combo_box_get_active_pointer(GtkComboBox
*combo_box
, gpointer
*ptr
);
493 * ws_combo_box_get_active:
494 * @param combo_box A #GtkComboBox constructed using ws_combo_box_new_text_and_pointer()
495 * @return Index of the active entry; -1 if no entry is selected;
496 * Note: If the active item is not an immediate child of root of the tree then
497 * the index returned is that of the top-level for the acftive entry.
499 gint
ws_combo_box_get_active(GtkComboBox
*combo_box
);
502 * ws_combo_box_set_active:
503 * @param combo_box A #GtkComboBox constructed using ws_combo_box_new_text_and_pointer()
504 * @param idx Index of the entry which is to be set as active (ie: selected).
505 * Index refers to the immediate children of the tree.
507 void ws_combo_box_set_active(GtkComboBox
*combo_box
, gint idx
);
510 * ws_combo_box_set_active_iter:
511 * @param combo_box A #GtkComboBox constructed using ws_combo_box_new_text_and_pointer()
512 * @param iter of the entry which is to be set as active (ie: selected).
515 ws_combo_box_set_active_iter(GtkComboBox
*combo_box
, GtkTreeIter
*iter
);
517 #if GTK_CHECK_VERSION(2,22,0)
518 #if !GTK_CHECK_VERSION(3,0,0)
519 GdkPixbuf
*gdk_pixbuf_get_from_surface (cairo_surface_t
*surface
,
524 #endif /* GTK_CHECK_VERSION(3,0,0) */
525 #endif /* GTK_CHECK_VERSION(2,22,0) */
529 * @param orientation the box's orientation
530 * @param spacing the number of pixels to put between children
531 * @param homogeneous a boolean value, TRUE to create equal allotments, FALSE for variable allotments
533 GtkWidget
* ws_gtk_box_new(GtkOrientation orientation
, gint spacing
, gboolean homogeneous
);
535 #if !GTK_CHECK_VERSION(3,0,0)
543 GtkWidget
* gtk_button_box_new(GtkOrientation orientation
);
544 GtkWidget
* gtk_scrollbar_new(GtkOrientation orientation
, GtkAdjustment
*adjustment
);
545 GtkWidget
* gtk_paned_new(GtkOrientation orientation
);
546 GtkWidget
* gtk_separator_new (GtkOrientation orientation
);
547 void gdk_cairo_set_source_rgba(cairo_t
*cr
, const GdkRGBA
*rgba
);
548 #endif /* GTK_CHECK_VERSION(3,0,0) */
550 /** Create a new frame with no border and a bold title on appropriate platforms.
552 * @param title The title for the new frame
553 * @return The newly created window
555 extern GtkWidget
*frame_new(const gchar
*title
);
558 /* GtkTable is deprecated in Gtk3 ...
560 * ws_gtk_grid...() wrapper functions & macros matching basic GtkGrid functions
561 * have been created which can be used both on Gtk2 and Gtk3.
563 * The functionality provided matches the fairly simple Wireshatk
564 * Gtk2 GtkTable usage and is intended to replace same.
566 * The ws_gtk_grid...() functionality is implemented as follows:
567 * Gtk2: macros which effect calls to GtkTable functions
568 * (with GTK_GRID typedef'd as GTK_TABLE & etc).
569 * Gtk3: wrapper functions and macros which effect calls to gtk_grid...()
570 * and other Gtk3 functions as needed.
572 * The args to the ws_gtk_grid...() functions are identical to the corresponding
573 * Gtk3 gtk_grid...() functions (other than ws_gtk_attach_defaults() and
574 * ws_gtk_attach_extended() which have no gtk_grid...() equivalent).
576 * ws_gtk_grid_new() ;; gtk_table_new()
578 * ws_gtk_grid_attach() ;; gtk_table_attach( , , , , , ,0, 0, 0, 0)
579 * ;; that is: same as gtk_grid_attach()
580 * ;; Gt2/Gtk3: [h|v]expand = FALSE; (FILL ignored)
582 * ws_gtk_grid_attach_defaults() ;; gtk_table_attach_defaults()
583 * ;; Gtk3: sets GTK_EXPAND/GTK_FILL as default;
584 * ;; That is, the defaults used by gtk_table_attach_defaults()
585 * ws_gtk_grid_attach_extended() ;; gtk_table_attach()
586 * ;; Essentially gtk_grid_attach() with eadditional args
587 * ;; to specify 'options' and 'padding' [as used in gtk_table_attach()];
588 * ;; Gtk3: sets GTK_EXPAND/GTK_FILL & margins on child widgit
590 * ;; (See below for declaration).
591 * ws_gtk_grid_set_homogeneous() ;; gtk_table_set_homogeneous()
592 * ;; Gtk3 grid: sets both 'row-homogeneous' and 'column-homogeneous'
593 * ws_gtk_set_row_spacing() ;; gtk_table_set_row_spacings()
594 * ws_gtk_set_column_spacing() ;; gtk_table_set_col_spacings()
596 * Example: Existing Wireshark Gtk2 code:
597 * gtk_table_attach_defaults(GTK_TABLE(foo_tb), child, col, col+1, row, row+1)
599 * should be converted to:
600 * ws_gtk_grid_attach_defaults(GTK_GRID(foo_grid), child, col, row, 1, 1);
603 #if !GTK_CHECK_VERSION(3,0,0)
605 typedef GtkTable GtkGrid
;
606 #define GTK_GRID(x) GTK_TABLE(x)
608 #define ws_gtk_grid_new() \
609 gtk_table_new(0, 0, FALSE)
611 #define ws_gtk_grid_attach(grid, child, left, top, width, height) \
612 gtk_table_attach(grid, child, left, left+width, top, top+height, (GtkAttachOptions)0, (GtkAttachOptions)0, 0, 0)
614 #define ws_gtk_grid_attach_defaults(grid, child, left, top, width, height) \
615 gtk_table_attach_defaults(grid, child, left, left+width, top, top+height)
617 #define ws_gtk_grid_attach_extended(grid, child, left, top, width, height, xoptions, yoptions, xpadding, ypadding) \
618 gtk_table_attach(grid, child, left, left+width, top, top+height, xoptions, yoptions, xpadding, ypadding)
620 #define ws_gtk_grid_set_homogeneous(grid, homogeneous) \
621 gtk_table_set_homogeneous(grid, homogeneous)
623 #define ws_gtk_grid_set_row_spacing(grid, spacing) \
624 gtk_table_set_row_spacings(grid, spacing)
626 #define ws_gtk_grid_set_column_spacing(grid, spacing) \
627 gtk_table_set_col_spacings(grid, spacing)
631 #define ws_gtk_grid_new() \
635 #define ws_gtk_grid_attach(grid, child, left, top, width, height) \
636 gtk_grid_attach(grid, child, left, top, width, height)
638 extern void ws_gtk_grid_attach_defaults(GtkGrid
*grid
, GtkWidget
*child
,
639 gint left
, gint top
, gint width
, gint height
);
641 extern void ws_gtk_grid_attach_extended(GtkGrid
*grid
, GtkWidget
*child
,
642 gint left
, gint top
, gint width
, gint height
,
643 GtkAttachOptions xoptions
, GtkAttachOptions yoptions
,
644 guint xpadding
, guint ypadding
);
646 extern void ws_gtk_grid_set_homogeneous(GtkGrid
*grid
, gboolean homogeneous
);
648 #define ws_gtk_grid_set_row_spacing(grid, spacing) \
649 gtk_grid_set_row_spacing(grid, spacing)
651 #define ws_gtk_grid_set_column_spacing(grid, spacing) \
652 gtk_grid_set_column_spacing(grid, spacing)
655 #endif /* GTK_CHECK_VERSION(3,0,0) */
658 #endif /* __GUI_UTIL_H__ */