gtknotebook.c 261 KB
Newer Older
1
/* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */
Cody Russell's avatar
Cody Russell committed
2
/* GTK - The GIMP Toolkit
Elliot Lee's avatar
Elliot Lee committed
3 4 5
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
Elliot Lee's avatar
Elliot Lee committed
7 8 9 10 11 12
 * 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
13
 * Lesser General Public License for more details.
Elliot Lee's avatar
Elliot Lee committed
14
 *
15
 * You should have received a copy of the GNU Lesser General Public
16 17 18
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
Elliot Lee's avatar
Elliot Lee committed
19
 */
20 21

/*
22
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
23 24
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
25
 * GTK+ at ftp:ftp.gtk.org/pub/gtk/.
26 27
 */

28
#include "config.h"
29 30

#include <stdio.h>
Johan Dahlin's avatar
Johan Dahlin committed
31
#include <string.h>
32

33
#include "gtknotebook.h"
34

35 36 37 38
#include "gtkmain.h"
#include "gtkmenu.h"
#include "gtkmenuitem.h"
#include "gtklabel.h"
39
#include "gtkintl.h"
40
#include "gtkmarshalers.h"
41
#include "gtkbindings.h"
42
#include "gtkprivate.h"
43
#include "gtkdnd.h"
Johan Dahlin's avatar
Johan Dahlin committed
44
#include "gtkbuildable.h"
45
#include "gtktypebuiltins.h"
46
#include "a11y/gtknotebookaccessible.h"
47

48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

/**
 * SECTION:gtknotebook
 * @Short_description: A tabbed notebook container
 * @Title: GtkNotebook
 * @See_also: #GtkContainer
 *
 * The #GtkNotebook widget is a #GtkContainer whose children are pages that
 * can be switched between using tab labels along one edge.
 *
 * There are many configuration options for GtkNotebook. Among other
 * things, you can choose on which edge the tabs appear
 * (see gtk_notebook_set_tab_pos()), whether, if there are too many
 * tabs to fit the notebook should be made bigger or scrolling
 * arrows added (see gtk_notebook_set_scrollable()), and whether there
 * will be a popup menu allowing the users to switch pages.
 * (see gtk_notebook_popup_enable(), gtk_notebook_popup_disable())
 *
 * <refsect2 id="GtkNotebook-BUILDER-UI">
 * <title>GtkNotebook as GtkBuildable</title>
 * <para>
 * The GtkNotebook implementation of the #GtkBuildable interface
 * supports placing children into tabs by specifying "tab" as the
 * "type" attribute of a &lt;child&gt; element. Note that the content
 * of the tab must be created before the tab can be filled.
 * A tab child can be specified without specifying a &lt;child&gt;
 * type attribute.
75
 *
76 77 78
 * To add a child widget in the notebooks action area, specify
 * "action-start" or "action-end" as the "type" attribute of the &lt;child&gt;
 * element.
79
 * </para>
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
 * <example>
 * <title>A UI definition fragment with GtkNotebook</title>
 * <programlisting><![CDATA[
 * <object class="GtkNotebook">
 *   <child>
 *     <object class="GtkLabel" id="notebook-content">
 *       <property name="label">Content</property>
 *     </object>
 *   </child>
 *   <child type="tab">
 *     <object class="GtkLabel" id="notebook-tab">
 *       <property name="label">Tab</property>
 *     </object>
 *   </child>
 * </object>
 * ]]></programlisting>
 * </example>
 * </refsect2>
 */


101
#define SCROLL_DELAY_FACTOR   5
102 103
#define SCROLL_THRESHOLD      12
#define DND_THRESHOLD_MULTIPLIER 4
104 105
#define FRAMES_PER_SECOND     45
#define MSECS_BETWEEN_UPDATES (1000 / FRAMES_PER_SECOND)
Elliot Lee's avatar
Elliot Lee committed
106

107
typedef struct _GtkNotebookPage GtkNotebookPage;
108 109 110 111 112 113 114 115 116 117 118 119 120 121

typedef enum
{
  DRAG_OPERATION_NONE,
  DRAG_OPERATION_REORDER,
  DRAG_OPERATION_DETACH
} GtkNotebookDragOperation;

enum {
  ACTION_WIDGET_START,
  ACTION_WIDGET_END,
  N_ACTION_WIDGETS
};

122
struct _GtkNotebookPrivate
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
{
  GtkNotebookDragOperation   operation;
  GtkNotebookPage           *cur_page;
  GtkNotebookPage           *detached_tab;
  GtkTargetList             *source_targets;
  GtkWidget                 *action_widget[N_ACTION_WIDGETS];
  GtkWidget                 *dnd_window;
  GtkWidget                 *menu;

  GdkWindow               *drag_window;
  GdkWindow               *event_window;

  GList         *children;
  GList         *first_tab;             /* The first tab visible (for scrolling notebooks) */
  GList         *focus_tab;

  gint           drag_begin_x;
  gint           drag_begin_y;
  gint           drag_offset_x;
  gint           drag_offset_y;
  gint           drag_window_x;
  gint           drag_window_y;
  gint           mouse_x;
  gint           mouse_y;
  gint           pressed_button;

149
  GQuark         group;
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176

  guint          dnd_timer;
  guint          switch_tab_timer;

  guint32        timer;
  guint32        timestamp;

  guint          button             : 2;
  guint          child_has_focus    : 1;
  guint          click_child        : 3;
  guint          during_detach      : 1;
  guint          during_reorder     : 1;
  guint          focus_out          : 1; /* Flag used by ::move-focus-out implementation */
  guint          has_scrolled       : 1;
  guint          in_child           : 3;
  guint          need_timer         : 1;
  guint          show_border        : 1;
  guint          show_tabs          : 1;
  guint          scrollable         : 1;
  guint          tab_pos            : 2;

  guint          has_before_previous : 1;
  guint          has_before_next     : 1;
  guint          has_after_previous  : 1;
  guint          has_after_next      : 1;
};

177 178
enum {
  SWITCH_PAGE,
179 180
  FOCUS_TAB,
  SELECT_PAGE,
181
  CHANGE_CURRENT_PAGE,
182
  MOVE_FOCUS_OUT,
183
  REORDER_TAB,
184 185 186
  PAGE_REORDERED,
  PAGE_REMOVED,
  PAGE_ADDED,
187
  CREATE_WINDOW,
188 189 190
  LAST_SIGNAL
};

191 192 193 194 195
enum {
  STEP_PREV,
  STEP_NEXT
};

196 197 198 199 200 201 202 203 204
typedef enum
{
  ARROW_NONE,
  ARROW_LEFT_BEFORE,
  ARROW_RIGHT_BEFORE,
  ARROW_LEFT_AFTER,
  ARROW_RIGHT_AFTER
} GtkNotebookArrow;

205 206 207 208 209 210 211
typedef enum
{
  POINTER_BEFORE,
  POINTER_AFTER,
  POINTER_BETWEEN
} GtkNotebookPointerPosition;

212 213 214
#define ARROW_IS_LEFT(arrow)  ((arrow) == ARROW_LEFT_BEFORE || (arrow) == ARROW_LEFT_AFTER)
#define ARROW_IS_BEFORE(arrow) ((arrow) == ARROW_LEFT_BEFORE || (arrow) == ARROW_RIGHT_BEFORE)

215
enum {
216 217 218 219 220 221 222
  PROP_0,
  PROP_TAB_POS,
  PROP_SHOW_TABS,
  PROP_SHOW_BORDER,
  PROP_SCROLLABLE,
  PROP_PAGE,
  PROP_ENABLE_POPUP,
223
  PROP_GROUP_NAME
224 225 226
};

enum {
Tim Janik's avatar
Tim Janik committed
227 228 229 230 231 232
  CHILD_PROP_0,
  CHILD_PROP_TAB_LABEL,
  CHILD_PROP_MENU_LABEL,
  CHILD_PROP_POSITION,
  CHILD_PROP_TAB_EXPAND,
  CHILD_PROP_TAB_FILL,
233 234
  CHILD_PROP_REORDERABLE,
  CHILD_PROP_DETACHABLE
235 236
};

237 238
#define GTK_NOTEBOOK_PAGE(_glist_)         ((GtkNotebookPage *)((GList *)(_glist_))->data)

239 240 241 242 243 244 245
/* some useful defines for calculating coords */
#define PAGE_LEFT_X(_page_)   (((GtkNotebookPage *) (_page_))->allocation.x)
#define PAGE_RIGHT_X(_page_)  (((GtkNotebookPage *) (_page_))->allocation.x + ((GtkNotebookPage *) (_page_))->allocation.width)
#define PAGE_MIDDLE_X(_page_) (((GtkNotebookPage *) (_page_))->allocation.x + ((GtkNotebookPage *) (_page_))->allocation.width / 2)
#define PAGE_TOP_Y(_page_)    (((GtkNotebookPage *) (_page_))->allocation.y)
#define PAGE_BOTTOM_Y(_page_) (((GtkNotebookPage *) (_page_))->allocation.y + ((GtkNotebookPage *) (_page_))->allocation.height)
#define PAGE_MIDDLE_Y(_page_) (((GtkNotebookPage *) (_page_))->allocation.y + ((GtkNotebookPage *) (_page_))->allocation.height / 2)
246
#define NOTEBOOK_IS_TAB_LABEL_PARENT(_notebook_,_page_) (gtk_widget_get_parent (((GtkNotebookPage *) (_page_))->tab_label) == ((GtkWidget *) (_notebook_)))
247

248 249 250 251 252
struct _GtkNotebookPage
{
  GtkWidget *child;
  GtkWidget *tab_label;
  GtkWidget *menu_label;
253
  GtkWidget *last_focus_child;  /* Last descendant of the page that had focus */
254

255 256
  guint default_menu : 1;       /* If true, we create the menu label ourself */
  guint default_tab  : 1;       /* If true, we create the tab label ourself */
257 258
  guint expand       : 1;
  guint fill         : 1;
259 260
  guint reorderable  : 1;
  guint detachable   : 1;
261

262 263 264 265 266
  /* if true, the tab label was visible on last allocation; we track this so
   * that we know to redraw the tab area if a tab label was hidden then shown
   * without changing position */
  guint tab_allocated_visible : 1;

267 268
  GtkRequisition requisition;
  GtkAllocation allocation;
269

270 271
  gulong mnemonic_activate_signal;
  gulong notify_visible_handler;
272 273
};

274
static const GtkTargetEntry notebook_targets [] = {
275
  { "GTK_NOTEBOOK_TAB", GTK_TARGET_SAME_APP, 0 },
276 277
};

278 279
#ifdef G_DISABLE_CHECKS
#define CHECK_FIND_CHILD(notebook, child)                           \
280
 gtk_notebook_find_child (notebook, child, G_STRLOC)
281 282
#else
#define CHECK_FIND_CHILD(notebook, child)                           \
283
 gtk_notebook_find_child (notebook, child, NULL)
284
#endif
285

286
/*** GtkNotebook Methods ***/
287
static gboolean gtk_notebook_select_page         (GtkNotebook      *notebook,
288
                                                  gboolean          move_focus);
289
static gboolean gtk_notebook_focus_tab           (GtkNotebook      *notebook,
290
                                                  GtkNotebookTab    type);
291
static gboolean gtk_notebook_change_current_page (GtkNotebook      *notebook,
292
                                                  gint              offset);
293
static void     gtk_notebook_move_focus_out      (GtkNotebook      *notebook,
294
                                                  GtkDirectionType  direction_type);
295
static gboolean gtk_notebook_reorder_tab         (GtkNotebook      *notebook,
296 297
                                                  GtkDirectionType  direction_type,
                                                  gboolean          move_to_last);
298
static void     gtk_notebook_remove_tab_label    (GtkNotebook      *notebook,
299
                                                  GtkNotebookPage  *page);
300 301 302
static void     gtk_notebook_set_tab_label_packing   (GtkNotebook  *notebook,
                                                      GtkWidget    *child,
                                                      gboolean      expand,
303
                                                      gboolean      fill);
304 305 306
static void     gtk_notebook_query_tab_label_packing (GtkNotebook  *notebook,
                                                      GtkWidget    *child,
                                                      gboolean     *expand,
307
                                                      gboolean     *fill);
308

309
/*** GObject Methods ***/
310 311 312 313 314 315 316 317
static void gtk_notebook_set_property        (GObject         *object,
                                              guint            prop_id,
                                              const GValue    *value,
                                              GParamSpec      *pspec);
static void gtk_notebook_get_property        (GObject         *object,
                                              guint            prop_id,
                                              GValue          *value,
                                              GParamSpec      *pspec);
318

319
/*** GtkWidget Methods ***/
320
static void gtk_notebook_destroy             (GtkWidget        *widget);
321 322 323
static void gtk_notebook_map                 (GtkWidget        *widget);
static void gtk_notebook_unmap               (GtkWidget        *widget);
static void gtk_notebook_realize             (GtkWidget        *widget);
324
static void gtk_notebook_unrealize           (GtkWidget        *widget);
325
static void gtk_notebook_get_preferred_width (GtkWidget        *widget,
326 327
                                              gint             *minimum,
                                              gint             *natural);
328
static void gtk_notebook_get_preferred_height(GtkWidget        *widget,
329 330
                                              gint             *minimum,
                                              gint             *natural);
331 332 333 334 335 336 337 338 339 340
static void gtk_notebook_get_preferred_width_for_height
                                             (GtkWidget        *widget,
                                              gint              height,
                                              gint             *minimum,
                                              gint             *natural);
static void gtk_notebook_get_preferred_height_for_width
                                             (GtkWidget        *widget,
                                              gint              width,
                                              gint             *minimum,
                                              gint             *natural);
341
static void gtk_notebook_size_allocate       (GtkWidget        *widget,
342
                                              GtkAllocation    *allocation);
Benjamin Otte's avatar
Benjamin Otte committed
343 344
static gint gtk_notebook_draw                (GtkWidget        *widget,
                                              cairo_t          *cr);
345
static gint gtk_notebook_button_press        (GtkWidget        *widget,
346
                                              GdkEventButton   *event);
347
static gint gtk_notebook_button_release      (GtkWidget        *widget,
348
                                              GdkEventButton   *event);
349
static gboolean gtk_notebook_popup_menu      (GtkWidget        *widget);
350
static gint gtk_notebook_leave_notify        (GtkWidget        *widget,
351
                                              GdkEventCrossing *event);
352
static gint gtk_notebook_motion_notify       (GtkWidget        *widget,
353
                                              GdkEventMotion   *event);
354
static gint gtk_notebook_focus_in            (GtkWidget        *widget,
355
                                              GdkEventFocus    *event);
356
static gint gtk_notebook_focus_out           (GtkWidget        *widget,
357
                                              GdkEventFocus    *event);
Matthias Clasen's avatar
Matthias Clasen committed
358
static void gtk_notebook_grab_notify         (GtkWidget          *widget,
359
                                              gboolean            was_grabbed);
360
static void gtk_notebook_state_flags_changed (GtkWidget          *widget,
361
                                              GtkStateFlags       previous_state);
362
static gint gtk_notebook_focus               (GtkWidget        *widget,
363
                                              GtkDirectionType  direction);
364
static void gtk_notebook_style_updated       (GtkWidget        *widget);
365

366 367
/*** Drag and drop Methods ***/
static void gtk_notebook_drag_begin          (GtkWidget        *widget,
368
                                              GdkDragContext   *context);
369
static void gtk_notebook_drag_end            (GtkWidget        *widget,
370
                                              GdkDragContext   *context);
371
static gboolean gtk_notebook_drag_failed     (GtkWidget        *widget,
372 373
                                              GdkDragContext   *context,
                                              GtkDragResult     result);
374
static gboolean gtk_notebook_drag_motion     (GtkWidget        *widget,
375 376 377 378
                                              GdkDragContext   *context,
                                              gint              x,
                                              gint              y,
                                              guint             time);
379
static void gtk_notebook_drag_leave          (GtkWidget        *widget,
380 381
                                              GdkDragContext   *context,
                                              guint             time);
382
static gboolean gtk_notebook_drag_drop       (GtkWidget        *widget,
383 384 385 386
                                              GdkDragContext   *context,
                                              gint              x,
                                              gint              y,
                                              guint             time);
387
static void gtk_notebook_drag_data_get       (GtkWidget        *widget,
388 389 390 391
                                              GdkDragContext   *context,
                                              GtkSelectionData *data,
                                              guint             info,
                                              guint             time);
392
static void gtk_notebook_drag_data_received  (GtkWidget        *widget,
393 394 395 396 397 398
                                              GdkDragContext   *context,
                                              gint              x,
                                              gint              y,
                                              GtkSelectionData *data,
                                              guint             info,
                                              guint             time);
399

400
/*** GtkContainer Methods ***/
Tim Janik's avatar
Tim Janik committed
401
static void gtk_notebook_set_child_property  (GtkContainer     *container,
402 403 404 405
                                              GtkWidget        *child,
                                              guint             property_id,
                                              const GValue     *value,
                                              GParamSpec       *pspec);
Tim Janik's avatar
Tim Janik committed
406
static void gtk_notebook_get_child_property  (GtkContainer     *container,
407 408 409 410
                                              GtkWidget        *child,
                                              guint             property_id,
                                              GValue           *value,
                                              GParamSpec       *pspec);
411
static void gtk_notebook_add                 (GtkContainer     *container,
412
                                              GtkWidget        *widget);
413
static void gtk_notebook_remove              (GtkContainer     *container,
414
                                              GtkWidget        *widget);
415
static void gtk_notebook_set_focus_child     (GtkContainer     *container,
416
                                              GtkWidget        *child);
Manish Singh's avatar
Manish Singh committed
417
static GType gtk_notebook_child_type       (GtkContainer     *container);
418
static void gtk_notebook_forall              (GtkContainer     *container,
419 420 421
                                              gboolean          include_internals,
                                              GtkCallback       callback,
                                              gpointer          callback_data);
422 423
static GtkWidgetPath * gtk_notebook_get_path_for_child (GtkContainer *container,
                                                        GtkWidget    *widget);
424

425 426
/*** GtkNotebook Methods ***/
static gint gtk_notebook_real_insert_page    (GtkNotebook      *notebook,
427 428 429 430
                                              GtkWidget        *child,
                                              GtkWidget        *tab_label,
                                              GtkWidget        *menu_label,
                                              gint              position);
431

432 433 434 435 436
static GtkNotebook *gtk_notebook_create_window (GtkNotebook    *notebook,
                                                GtkWidget      *page,
                                                gint            x,
                                                gint            y);

437
/*** GtkNotebook Private Functions ***/
438
static void gtk_notebook_redraw_tabs         (GtkNotebook      *notebook);
439
static void gtk_notebook_redraw_tabs_junction (GtkNotebook     *notebook);
440
static void gtk_notebook_redraw_arrows       (GtkNotebook      *notebook);
441
static void gtk_notebook_real_remove         (GtkNotebook      *notebook,
442
                                              GList            *list);
443 444
static void gtk_notebook_update_labels       (GtkNotebook      *notebook);
static gint gtk_notebook_timer               (GtkNotebook      *notebook);
445
static void gtk_notebook_set_scroll_timer    (GtkNotebook *notebook);
446
static gint gtk_notebook_page_compare        (gconstpointer     a,
447
                                              gconstpointer     b);
448
static GList* gtk_notebook_find_child        (GtkNotebook      *notebook,
449 450
                                              GtkWidget        *child,
                                              const gchar      *function);
451
static GList * gtk_notebook_search_page      (GtkNotebook      *notebook,
452 453 454
                                              GList            *list,
                                              gint              direction,
                                              gboolean          find_visible);
455
static void  gtk_notebook_child_reordered    (GtkNotebook      *notebook,
456
                                              GtkNotebookPage  *page);
457

458
/*** GtkNotebook Drawing Functions ***/
459
static void gtk_notebook_paint               (GtkWidget        *widget,
460
                                              cairo_t          *cr);
461
static void gtk_notebook_draw_tab            (GtkNotebook      *notebook,
462 463
                                              GtkNotebookPage  *page,
                                              cairo_t          *cr,
464
                                              gboolean          use_flags);
465
static void gtk_notebook_draw_arrow          (GtkNotebook      *notebook,
466
                                              cairo_t          *cr,
467
                                              GtkNotebookArrow  arrow);
468

469
/*** GtkNotebook Size Allocate Functions ***/
470
static void gtk_notebook_pages_allocate      (GtkNotebook      *notebook);
471
static gboolean gtk_notebook_page_allocate   (GtkNotebook      *notebook,
472
                                              GtkNotebookPage  *page);
473
static void gtk_notebook_calc_tabs           (GtkNotebook      *notebook,
474 475 476 477
                                              GList            *start,
                                              GList           **end,
                                              gint             *tab_space,
                                              guint             direction);
478

479
/*** GtkNotebook Page Switch Methods ***/
480
static void gtk_notebook_real_switch_page    (GtkNotebook      *notebook,
481 482
                                              GtkWidget        *child,
                                              guint             page_num);
483

484
/*** GtkNotebook Page Switch Functions ***/
485
static void gtk_notebook_switch_page         (GtkNotebook      *notebook,
486
                                              GtkNotebookPage  *page);
487
static gint gtk_notebook_page_select         (GtkNotebook      *notebook,
488
                                              gboolean          move_focus);
489 490
static void gtk_notebook_switch_focus_tab    (GtkNotebook      *notebook,
                                              GList            *new_child);
491
static void gtk_notebook_menu_switch_page    (GtkWidget        *widget,
492
                                              GtkNotebookPage  *page);
493

494
/*** GtkNotebook Menu Functions ***/
495
static void gtk_notebook_menu_item_create    (GtkNotebook      *notebook,
496
                                              GList            *list);
497
static void gtk_notebook_menu_label_unparent (GtkWidget        *widget,
498
                                              gpointer          data);
499
static void gtk_notebook_menu_detacher       (GtkWidget        *widget,
500
                                              GtkMenu          *menu);
501

502
/*** GtkNotebook Private Setters ***/
503 504
static void gtk_notebook_update_tab_states             (GtkNotebook *notebook);
static gboolean gtk_notebook_mnemonic_activate_switch_page (GtkWidget *child,
505 506
                                                            gboolean overload,
                                                            gpointer data);
507

508 509
static gboolean focus_tabs_in  (GtkNotebook      *notebook);
static gboolean focus_child_in (GtkNotebook      *notebook,
510
                                GtkDirectionType  direction);
Elliot Lee's avatar
Elliot Lee committed
511

512
static void stop_scrolling (GtkNotebook *notebook);
513
static void do_detach_tab  (GtkNotebook *from,
514 515 516 517
                            GtkNotebook *to,
                            GtkWidget   *child,
                            gint         x,
                            gint         y);
518

Johan Dahlin's avatar
Johan Dahlin committed
519 520
/* GtkBuildable */
static void gtk_notebook_buildable_init           (GtkBuildableIface *iface);
521
static void gtk_notebook_buildable_add_child      (GtkBuildable *buildable,
522 523 524
                                                   GtkBuilder   *builder,
                                                   GObject      *child,
                                                   const gchar  *type);
525

526
static guint notebook_signals[LAST_SIGNAL] = { 0 };
Elliot Lee's avatar
Elliot Lee committed
527

Johan Dahlin's avatar
Johan Dahlin committed
528
G_DEFINE_TYPE_WITH_CODE (GtkNotebook, gtk_notebook, GTK_TYPE_CONTAINER,
529 530
                         G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
                                                gtk_notebook_buildable_init))
Elliot Lee's avatar
Elliot Lee committed
531

532 533
static void
add_tab_bindings (GtkBindingSet    *binding_set,
534 535
                  GdkModifierType   modifiers,
                  GtkDirectionType  direction)
536
{
537
  gtk_binding_entry_add_signal (binding_set, GDK_KEY_Tab, modifiers,
538 539
                                "move_focus_out", 1,
                                GTK_TYPE_DIRECTION_TYPE, direction);
540
  gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Tab, modifiers,
541 542 543 544 545 546
                                "move_focus_out", 1,
                                GTK_TYPE_DIRECTION_TYPE, direction);
}

static void
add_arrow_bindings (GtkBindingSet    *binding_set,
547 548
                    guint             keysym,
                    GtkDirectionType  direction)
549
{
550
  guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left;
551

552 553 554 555 556 557 558 559
  gtk_binding_entry_add_signal (binding_set, keysym, GDK_CONTROL_MASK,
                                "move_focus_out", 1,
                                GTK_TYPE_DIRECTION_TYPE, direction);
  gtk_binding_entry_add_signal (binding_set, keypad_keysym, GDK_CONTROL_MASK,
                                "move_focus_out", 1,
                                GTK_TYPE_DIRECTION_TYPE, direction);
}

560 561
static void
add_reorder_bindings (GtkBindingSet    *binding_set,
562 563 564
                      guint             keysym,
                      GtkDirectionType  direction,
                      gboolean          move_to_last)
565
{
566
  guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left;
567 568

  gtk_binding_entry_add_signal (binding_set, keysym, GDK_MOD1_MASK,
569 570 571
                                "reorder_tab", 2,
                                GTK_TYPE_DIRECTION_TYPE, direction,
                                G_TYPE_BOOLEAN, move_to_last);
572
  gtk_binding_entry_add_signal (binding_set, keypad_keysym, GDK_MOD1_MASK,
573 574 575
                                "reorder_tab", 2,
                                GTK_TYPE_DIRECTION_TYPE, direction,
                                G_TYPE_BOOLEAN, move_to_last);
576 577
}

578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593
static gboolean
gtk_object_handled_accumulator (GSignalInvocationHint *ihint,
                                GValue                *return_accu,
                                const GValue          *handler_return,
                                gpointer               dummy)
{
  gboolean continue_emission;
  GObject *object;

  object = g_value_get_object (handler_return);
  g_value_set_object (return_accu, object);
  continue_emission = !object;

  return continue_emission;
}

594
static void
595 596 597
gtk_notebook_compute_expand (GtkWidget *widget,
                             gboolean  *hexpand_p,
                             gboolean  *vexpand_p)
598
{
599
  GtkNotebook *notebook = GTK_NOTEBOOK (widget);
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626
  GtkNotebookPrivate *priv = notebook->priv;
  gboolean hexpand;
  gboolean vexpand;
  GList *list;
  GtkNotebookPage *page;

  hexpand = FALSE;
  vexpand = FALSE;

  for (list = priv->children; list; list = list->next)
    {
      page = list->data;

      hexpand = hexpand ||
        gtk_widget_compute_expand (page->child, GTK_ORIENTATION_HORIZONTAL);

      vexpand = vexpand ||
        gtk_widget_compute_expand (page->child, GTK_ORIENTATION_VERTICAL);

      if (hexpand & vexpand)
        break;
    }

  *hexpand_p = hexpand;
  *vexpand_p = vexpand;
}

Elliot Lee's avatar
Elliot Lee committed
627 628 629
static void
gtk_notebook_class_init (GtkNotebookClass *class)
{
Tim Janik's avatar
Tim Janik committed
630 631 632
  GObjectClass   *gobject_class = G_OBJECT_CLASS (class);
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
  GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
633
  GtkBindingSet *binding_set;
634

635 636
  gobject_class->set_property = gtk_notebook_set_property;
  gobject_class->get_property = gtk_notebook_get_property;
637

638
  widget_class->destroy = gtk_notebook_destroy;
Elliot Lee's avatar
Elliot Lee committed
639 640 641
  widget_class->map = gtk_notebook_map;
  widget_class->unmap = gtk_notebook_unmap;
  widget_class->realize = gtk_notebook_realize;
642
  widget_class->unrealize = gtk_notebook_unrealize;
643 644
  widget_class->get_preferred_width = gtk_notebook_get_preferred_width;
  widget_class->get_preferred_height = gtk_notebook_get_preferred_height;
645 646
  widget_class->get_preferred_width_for_height = gtk_notebook_get_preferred_width_for_height;
  widget_class->get_preferred_height_for_width = gtk_notebook_get_preferred_height_for_width;
Elliot Lee's avatar
Elliot Lee committed
647
  widget_class->size_allocate = gtk_notebook_size_allocate;
Benjamin Otte's avatar
Benjamin Otte committed
648
  widget_class->draw = gtk_notebook_draw;
Elliot Lee's avatar
Elliot Lee committed
649
  widget_class->button_press_event = gtk_notebook_button_press;
650
  widget_class->button_release_event = gtk_notebook_button_release;
651
  widget_class->popup_menu = gtk_notebook_popup_menu;
652 653
  widget_class->leave_notify_event = gtk_notebook_leave_notify;
  widget_class->motion_notify_event = gtk_notebook_motion_notify;
Matthias Clasen's avatar
Matthias Clasen committed
654
  widget_class->grab_notify = gtk_notebook_grab_notify;
655
  widget_class->state_flags_changed = gtk_notebook_state_flags_changed;
656
  widget_class->focus_in_event = gtk_notebook_focus_in;
657
  widget_class->focus_out_event = gtk_notebook_focus_out;
658
  widget_class->focus = gtk_notebook_focus;
659
  widget_class->style_updated = gtk_notebook_style_updated;
660
  widget_class->drag_begin = gtk_notebook_drag_begin;
661
  widget_class->drag_end = gtk_notebook_drag_end;
662
  widget_class->drag_motion = gtk_notebook_drag_motion;
663
  widget_class->drag_leave = gtk_notebook_drag_leave;
664 665 666
  widget_class->drag_drop = gtk_notebook_drag_drop;
  widget_class->drag_data_get = gtk_notebook_drag_data_get;
  widget_class->drag_data_received = gtk_notebook_drag_data_received;
667
  widget_class->drag_failed = gtk_notebook_drag_failed;
668
  widget_class->compute_expand = gtk_notebook_compute_expand;
669

Elliot Lee's avatar
Elliot Lee committed
670 671
  container_class->add = gtk_notebook_add;
  container_class->remove = gtk_notebook_remove;
672
  container_class->forall = gtk_notebook_forall;
Lars Hamann's avatar
Lars Hamann committed
673
  container_class->set_focus_child = gtk_notebook_set_focus_child;
Tim Janik's avatar
Tim Janik committed
674 675
  container_class->get_child_property = gtk_notebook_get_child_property;
  container_class->set_child_property = gtk_notebook_set_child_property;
676
  container_class->child_type = gtk_notebook_child_type;
677
  container_class->get_path_for_child = gtk_notebook_get_path_for_child;
678

679
  class->switch_page = gtk_notebook_real_switch_page;
680
  class->insert_page = gtk_notebook_real_insert_page;
681

682 683
  class->focus_tab = gtk_notebook_focus_tab;
  class->select_page = gtk_notebook_select_page;
684
  class->change_current_page = gtk_notebook_change_current_page;
685
  class->move_focus_out = gtk_notebook_move_focus_out;
686
  class->reorder_tab = gtk_notebook_reorder_tab;
687
  class->create_window = gtk_notebook_create_window;
688

689
  g_object_class_install_property (gobject_class,
690 691 692 693 694 695 696 697
                                   PROP_PAGE,
                                   g_param_spec_int ("page",
                                                     P_("Page"),
                                                     P_("The index of the current page"),
                                                     -1,
                                                     G_MAXINT,
                                                     -1,
                                                     GTK_PARAM_READWRITE));
Tim Janik's avatar
Tim Janik committed
698
  g_object_class_install_property (gobject_class,
699 700 701 702 703 704 705
                                   PROP_TAB_POS,
                                   g_param_spec_enum ("tab-pos",
                                                      P_("Tab Position"),
                                                      P_("Which side of the notebook holds the tabs"),
                                                      GTK_TYPE_POSITION_TYPE,
                                                      GTK_POS_TOP,
                                                      GTK_PARAM_READWRITE));
Tim Janik's avatar
Tim Janik committed
706
  g_object_class_install_property (gobject_class,
707 708 709 710 711 712
                                   PROP_SHOW_TABS,
                                   g_param_spec_boolean ("show-tabs",
                                                         P_("Show Tabs"),
                                                         P_("Whether tabs should be shown"),
                                                         TRUE,
                                                         GTK_PARAM_READWRITE));
Tim Janik's avatar
Tim Janik committed
713
  g_object_class_install_property (gobject_class,
714 715 716 717 718 719
                                   PROP_SHOW_BORDER,
                                   g_param_spec_boolean ("show-border",
                                                         P_("Show Border"),
                                                         P_("Whether the border should be shown"),
                                                         TRUE,
                                                         GTK_PARAM_READWRITE));
Tim Janik's avatar
Tim Janik committed
720
  g_object_class_install_property (gobject_class,
721 722 723 724 725 726
                                   PROP_SCROLLABLE,
                                   g_param_spec_boolean ("scrollable",
                                                         P_("Scrollable"),
                                                         P_("If TRUE, scroll arrows are added if there are too many tabs to fit"),
                                                         FALSE,
                                                         GTK_PARAM_READWRITE));
Tim Janik's avatar
Tim Janik committed
727
  g_object_class_install_property (gobject_class,
728 729 730 731 732 733
                                   PROP_ENABLE_POPUP,
                                   g_param_spec_boolean ("enable-popup",
                                                         P_("Enable Popup"),
                                                         P_("If TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page"),
                                                         FALSE,
                                                         GTK_PARAM_READWRITE));
Matthias Clasen's avatar
Matthias Clasen committed
734 735

  /**
736
   * GtkNotebook:group-name:
Matthias Clasen's avatar
Matthias Clasen committed
737
   *
738
   * Group name for tab drag and drop.
Matthias Clasen's avatar
Matthias Clasen committed
739 740
   *
   * Since: 2.24
741
   */
742
  g_object_class_install_property (gobject_class,
743 744 745 746
                                   PROP_GROUP_NAME,
                                   g_param_spec_string ("group-name",
                                                        P_("Group Name"),
                                                        P_("Group name for tab drag and drop"),
747
                                                        NULL,
748
                                                        GTK_PARAM_READWRITE));
Tim Janik's avatar
Tim Janik committed
749 750

  gtk_container_class_install_child_property (container_class,
751 752 753 754 755 756
                                              CHILD_PROP_TAB_LABEL,
                                              g_param_spec_string ("tab-label",
                                                                   P_("Tab label"),
                                                                   P_("The string displayed on the child's tab label"),
                                                                   NULL,
                                                                   GTK_PARAM_READWRITE));
Tim Janik's avatar
Tim Janik committed
757
  gtk_container_class_install_child_property (container_class,
758 759 760 761 762 763
                                              CHILD_PROP_MENU_LABEL,
                                              g_param_spec_string ("menu-label",
                                                                   P_("Menu label"),
                                                                   P_("The string displayed in the child's menu entry"),
                                                                   NULL,
                                                                   GTK_PARAM_READWRITE));
Tim Janik's avatar
Tim Janik committed
764
  gtk_container_class_install_child_property (container_class,
765 766 767 768 769 770
                                              CHILD_PROP_POSITION,
                                              g_param_spec_int ("position",
                                                                P_("Position"),
                                                                P_("The index of the child in the parent"),
                                                                -1, G_MAXINT, 0,
                                                                GTK_PARAM_READWRITE));
Tim Janik's avatar
Tim Janik committed
771
  gtk_container_class_install_child_property (container_class,
772 773 774 775 776 777
                                              CHILD_PROP_TAB_EXPAND,
                                              g_param_spec_boolean ("tab-expand",
                                                                    P_("Tab expand"),
                                                                    P_("Whether to expand the child's tab"),
                                                                    FALSE,
                                                                    GTK_PARAM_READWRITE));
Tim Janik's avatar
Tim Janik committed
778
  gtk_container_class_install_child_property (container_class,
779 780 781 782 783 784
                                              CHILD_PROP_TAB_FILL,
                                              g_param_spec_boolean ("tab-fill",
                                                                    P_("Tab fill"),
                                                                    P_("Whether the child's tab should fill the allocated area"),
                                                                    TRUE,
                                                                    GTK_PARAM_READWRITE));
785

786
  gtk_container_class_install_child_property (container_class,
787 788 789 790 791 792
                                              CHILD_PROP_REORDERABLE,
                                              g_param_spec_boolean ("reorderable",
                                                                    P_("Tab reorderable"),
                                                                    P_("Whether the tab is reorderable by user action"),
                                                                    FALSE,
                                                                    GTK_PARAM_READWRITE));
793
  gtk_container_class_install_child_property (container_class,
794 795 796 797 798 799
                                              CHILD_PROP_DETACHABLE,
                                              g_param_spec_boolean ("detachable",
                                                                    P_("Tab detachable"),
                                                                    P_("Whether the tab is detachable"),
                                                                    FALSE,
                                                                    GTK_PARAM_READWRITE));
800 801 802 803

/**
 * GtkNotebook:has-secondary-backward-stepper:
 *
804 805
 * The "has-secondary-backward-stepper" property determines whether
 * a second backward arrow button is displayed on the opposite end
806 807 808
 * of the tab area.
 *
 * Since: 2.4
809
 */
810
  gtk_widget_class_install_style_property (widget_class,
811 812 813 814 815
                                           g_param_spec_boolean ("has-secondary-backward-stepper",
                                                                 P_("Secondary backward stepper"),
                                                                 P_("Display a second backward arrow button on the opposite end of the tab area"),
                                                                 FALSE,
                                                                 GTK_PARAM_READABLE));
816

817 818 819
/**
 * GtkNotebook:has-secondary-forward-stepper:
 *
820 821
 * The "has-secondary-forward-stepper" property determines whether
 * a second forward arrow button is displayed on the opposite end
822 823 824
 * of the tab area.
 *
 * Since: 2.4
825
 */
826
  gtk_widget_class_install_style_property (widget_class,
827 828 829 830 831
                                           g_param_spec_boolean ("has-secondary-forward-stepper",
                                                                 P_("Secondary forward stepper"),
                                                                 P_("Display a second forward arrow button on the opposite end of the tab area"),
                                                                 FALSE,
                                                                 GTK_PARAM_READABLE));
832

833 834 835
/**
 * GtkNotebook:has-backward-stepper:
 *
836
 * The "has-backward-stepper" property determines whether
837 838 839
 * the standard backward arrow button is displayed.
 *
 * Since: 2.4
840
 */
841
  gtk_widget_class_install_style_property (widget_class,
842 843 844 845 846
                                           g_param_spec_boolean ("has-backward-stepper",
                                                                 P_("Backward stepper"),
                                                                 P_("Display the standard backward arrow button"),
                                                                 TRUE,
                                                                 GTK_PARAM_READABLE));
847

848 849 850
/**
 * GtkNotebook:has-forward-stepper:
 *
851
 * The "has-forward-stepper" property determines whether
852 853 854
 * the standard forward arrow button is displayed.
 *
 * Since: 2.4
855
 */
856
  gtk_widget_class_install_style_property (widget_class,
857 858 859 860 861 862
                                           g_param_spec_boolean ("has-forward-stepper",
                                                                 P_("Forward stepper"),
                                                                 P_("Display the standard forward arrow button"),
                                                                 TRUE,
                                                                 GTK_PARAM_READABLE));

863 864 865 866 867 868 869
/**
 * GtkNotebook:tab-overlap:
 *
 * The "tab-overlap" property defines size of tab overlap
 * area.
 *
 * Since: 2.10
870
 */
871
  gtk_widget_class_install_style_property (widget_class,
872 873 874 875 876 877 878
                                           g_param_spec_int ("tab-overlap",
                                                             P_("Tab overlap"),
                                                             P_("Size of tab overlap area"),
                                                             G_MININT,
                                                             G_MAXINT,
                                                             2,
                                                             GTK_PARAM_READABLE));
879 880 881 882 883 884 885

/**
 * GtkNotebook:tab-curvature:
 *
 * The "tab-curvature" property defines size of tab curvature.
 *
 * Since: 2.10
886
 */
887
  gtk_widget_class_install_style_property (widget_class,
888 889 890 891 892 893 894
                                           g_param_spec_int ("tab-curvature",
                                                             P_("Tab curvature"),
                                                             P_("Size of tab curvature"),
                                                             0,
                                                             G_MAXINT,
                                                             1,
                                                             GTK_PARAM_READABLE));
895

896 897 898
  /**
   * GtkNotebook:arrow-spacing:
   *
899
   * The "arrow-spacing" property defines the spacing between the scroll
900 901 902 903 904 905
   * arrows and the tabs.
   *
   * Since: 2.10
   */
  gtk_widget_class_install_style_property (widget_class,
                                           g_param_spec_int ("arrow-spacing",
906 907
                                                             P_("Arrow spacing"),
                                                             P_("Scroll arrow spacing"),
908 909 910 911 912
                                                             0,
                                                             G_MAXINT,
                                                             0,
                                                             GTK_PARAM_READABLE));

913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929
  /**
   * GtkNotebook:initial-gap:
   *
   * The "initial-gap" property defines the minimum size for the initial
   * gap between the first tab.
   *
   * Since: 3.2
   */
  gtk_widget_class_install_style_property (widget_class,
                                           g_param_spec_int ("initial-gap",
                                                             P_("Initial gap"),
                                                             P_("Initial gap before the first tab"),
                                                             0,
                                                             G_MAXINT,
                                                             0,
                                                             GTK_PARAM_READABLE));

930 931 932 933 934 935 936 937
  /**
   * GtkNotebook::switch-page:
   * @notebook: the object which received the signal.
   * @page: the new current page
   * @page_num: the index of the page
   *
   * Emitted when the user or a function changes the current page.
   */
938
  notebook_signals[SWITCH_PAGE] =
939
    g_signal_new (I_("switch-page"),
940 941 942 943 944 945 946 947 948
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkNotebookClass, switch_page),
                  NULL, NULL,
                  _gtk_marshal_VOID__OBJECT_UINT,
                  G_TYPE_NONE, 2,
                  GTK_TYPE_WIDGET,
                  G_TYPE_UINT);
  notebook_signals[FOCUS_TAB] =
949
    g_signal_new (I_("focus-tab"),
Manish Singh's avatar
Manish Singh committed
950
                  G_TYPE_FROM_CLASS (gobject_class),
951 952 953
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkNotebookClass, focus_tab),
                  NULL, NULL,
954
                  _gtk_marshal_BOOLEAN__ENUM,
955
                  G_TYPE_BOOLEAN, 1,
956
                  GTK_TYPE_NOTEBOOK_TAB);
957
  notebook_signals[SELECT_PAGE] =
958
    g_signal_new (I_("select-page"),
Manish Singh's avatar
Manish Singh committed
959
                  G_TYPE_FROM_CLASS (gobject_class),
960 961 962
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkNotebookClass, select_page),
                  NULL, NULL,
963 964
                  _gtk_marshal_BOOLEAN__BOOLEAN,
                  G_TYPE_BOOLEAN, 1,
965
                  G_TYPE_BOOLEAN);
966
  notebook_signals[CHANGE_CURRENT_PAGE] =
967
    g_signal_new (I_("change-current-page"),
Manish Singh's avatar
Manish Singh committed
968
                  G_TYPE_FROM_CLASS (gobject_class),
969 970 971
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkNotebookClass, change_current_page),
                  NULL, NULL,
972 973
                  _gtk_marshal_BOOLEAN__INT,
                  G_TYPE_BOOLEAN, 1,
974
                  G_TYPE_INT);
975
  notebook_signals[MOVE_FOCUS_OUT] =
976
    g_signal_new (I_("move-focus-out"),
Manish Singh's avatar
Manish Singh committed
977
                  G_TYPE_FROM_CLASS (gobject_class),
978 979 980 981 982 983
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkNotebookClass, move_focus_out),
                  NULL, NULL,
                  _gtk_marshal_VOID__ENUM,
                  G_TYPE_NONE, 1,
                  GTK_TYPE_DIRECTION_TYPE);
984
  notebook_signals[REORDER_TAB] =
985
    g_signal_new (I_("reorder-tab"),
986 987 988 989
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkNotebookClass, reorder_tab),
                  NULL, NULL,
990 991
                  _gtk_marshal_BOOLEAN__ENUM_BOOLEAN,
                  G_TYPE_BOOLEAN, 2,
992
                  GTK_TYPE_DIRECTION_TYPE,
993
                  G_TYPE_BOOLEAN);
994
  /**
995
   * GtkNotebook::page-reordered:
996 997 998 999
   * @notebook: the #GtkNotebook
   * @child: the child #GtkWidget affected
   * @page_num: the new page number for @child
   *
1000 1001
   * the ::page-reordered signal is emitted in the notebook
   * right after a page has been reordered.
1002 1003
   *
   * Since: 2.10
1004
   */
1005
  notebook_signals[PAGE_REORDERED] =
1006
    g_signal_new (I_("page-reordered"),
1007
                  G_TYPE_FROM_CLASS (gobject_class),
1008
                  G_SIGNAL_RUN_LAST,
1009 1010 1011
                  G_STRUCT_OFFSET (GtkNotebookClass, page_reordered),
                  NULL, NULL,
                  _gtk_marshal_VOID__OBJECT_UINT,
1012
                  G_TYPE_NONE, 2,
1013 1014
                  GTK_TYPE_WIDGET,
                  G_TYPE_UINT);
1015
  /**
1016
   * GtkNotebook::page-removed:
1017 1018 1019 1020
   * @notebook: the #GtkNotebook
   * @child: the child #GtkWidget affected
   * @page_num: the @child page number
   *
1021
   * the ::page-removed signal is emitted in the notebook
1022
   * right after a page is removed from the notebook.
1023 1024
   *
   * Since: 2.10
1025
   */
1026
  notebook_signals[PAGE_REMOVED] =
1027
    g_signal_new (I_("page-removed"),
1028
                  G_TYPE_FROM_CLASS (gobject_class),
1029
                  G_SIGNAL_RUN_LAST,
1030 1031 1032
                  G_STRUCT_OFFSET (GtkNotebookClass, page_removed),
                  NULL, NULL,
                  _gtk_marshal_VOID__OBJECT_UINT,
1033
                  G_TYPE_NONE, 2,
1034 1035
                  GTK_TYPE_WIDGET,
                  G_TYPE_UINT);
1036
  /**
1037
   * GtkNotebook::page-added:
1038 1039 1040 1041
   * @notebook: the #GtkNotebook
   * @child: the child #GtkWidget affected
   * @page_num: the new page number for @child
   *
1042 1043
   * the ::page-added signal is emitted in the notebook
   * right after a page is added to the notebook.
1044 1045
   *
   * Since: 2.10
1046
   */
1047
  notebook_signals[PAGE_ADDED] =
1048
    g_signal_new (I_("page-added"),
1049
                  G_TYPE_FROM_CLASS (gobject_class),
1050
                  G_SIGNAL_RUN_LAST,
1051 1052 1053
                  G_STRUCT_OFFSET (GtkNotebookClass, page_added),
                  NULL, NULL,
                  _gtk_marshal_VOID__OBJECT_UINT,
1054
                  G_TYPE_NONE, 2,
1055 1056
                  GTK_TYPE_WIDGET,
                  G_TYPE_UINT);
1057

1058 1059 1060 1061 <