NetSurf
tabs.c
Go to the documentation of this file.
1/*
2 * Copyright 2008 Michael Lester <element3260@gmail.com>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <stdint.h>
20#include <string.h>
21
22#include "utils/nsoption.h"
23#include "utils/log.h"
25#include "desktop/search.h"
26
27#include "gtk/compat.h"
28#include "gtk/toolbar_items.h"
29#include "gtk/scaffolding.h"
30#include "gtk/window.h"
31#include "gtk/search.h"
32#include "gtk/tabs.h"
33
34#define TAB_WIDTH_N_CHARS 15
35
36static gint srcpagenum;
37
38/**
39 * callback to update sizes when style-set gtk signal
40 */
41static void
42nsgtk_tab_update_size(GtkWidget *hbox,
43 GtkStyle *previous_style,
44 GtkWidget *close_button)
45{
46 PangoFontMetrics *metrics;
47 PangoContext *context;
48 int char_width, h, w;
49 GtkStyleContext *style;
50 GtkStateFlags state;
51
52 state = nsgtk_widget_get_state_flags(hbox);
54
55 context = gtk_widget_get_pango_context(hbox);
56 metrics = pango_context_get_metrics(context,
57 nsgtk_style_context_get_font(style, state),
58 pango_context_get_language(context));
59
60 char_width = pango_font_metrics_get_approximate_digit_width(metrics);
61 pango_font_metrics_unref(metrics);
62
63 nsgtk_icon_size_lookup_for_settings(gtk_widget_get_settings (hbox),
64 GTK_ICON_SIZE_MENU, &w, &h);
65
66 gtk_widget_set_size_request(hbox,
67 TAB_WIDTH_N_CHARS * PANGO_PIXELS(char_width) + 2 * w,
68 -1);
69
70 gtk_widget_set_size_request(close_button, w + 4, h + 4);
71}
72
73
74/**
75 * gtk event handler for button release on tab hbox
76 */
77static gboolean
78nsgtk_tab_button_release(GtkWidget *widget,
79 GdkEventButton *event,
80 gpointer user_data)
81{
82 GtkWidget *page;
83
84 if ((event->type == GDK_BUTTON_RELEASE) && (event->button == 2)) {
85 page = (GtkWidget *)user_data;
86 gtk_widget_destroy(page);
87 return TRUE;
88 }
89 return FALSE;
90}
91
92
93/**
94 * Create a notebook tab label
95 *
96 * \param page The page content widget
97 * \param title The title of the page
98 * \param icon_pixbuf The icon of the page
99 */
100static GtkWidget *
101nsgtk_tab_label_setup(GtkWidget *page,
102 const char *title,
103 GdkPixbuf *icon_pixbuf)
104{
105 GtkWidget *ebox, *hbox, *favicon, *label, *button, *close;
106
107 /* horizontal box */
108 hbox = nsgtk_hbox_new(FALSE, 3);
109
110 /* event box */
111 ebox = gtk_event_box_new();
112 gtk_widget_set_events(ebox, GDK_BUTTON_PRESS_MASK);
113 gtk_container_add(GTK_CONTAINER(ebox), hbox);
114
115 /* construct a favicon */
116 favicon = gtk_image_new();
117 if (icon_pixbuf != NULL) {
118 gtk_image_set_from_pixbuf(GTK_IMAGE(favicon), icon_pixbuf);
119 }
120
121 /* construct a label */
122 label = gtk_label_new(title);
123 gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END);
124 gtk_label_set_single_line_mode(GTK_LABEL(label), TRUE);
126 nsgtk_widget_set_margins(label, 0, 0);
127 gtk_widget_show(label);
128
129 /* construct a close button */
130 button = gtk_button_new();
131
133 GTK_ICON_SIZE_LARGE_TOOLBAR);
134 gtk_container_add(GTK_CONTAINER(button), close);
135 nsgtk_button_set_focus_on_click(GTK_BUTTON(button), FALSE);
136 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
137 gtk_widget_set_tooltip_text(button, "Close this tab.");
138
139 /* pack the widgets into the label box */
140 gtk_box_pack_start(GTK_BOX(hbox), favicon, FALSE, FALSE, 0);
141 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
142 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
143
144 /* make the icon and label widgets findable by name */
145 g_object_set_data(G_OBJECT(ebox), "favicon", favicon);
146 g_object_set_data(G_OBJECT(ebox), "label", label);
147
148 /* attach signal handlers */
149 g_signal_connect_swapped(button,
150 "clicked",
151 G_CALLBACK(gtk_widget_destroy), page);
152
153 g_signal_connect(hbox,
154 "style-set",
155 G_CALLBACK(nsgtk_tab_update_size),
156 button);
157
158 g_signal_connect(ebox,
159 "button-release-event",
160 G_CALLBACK(nsgtk_tab_button_release),
161 page);
162
163
164 gtk_widget_show_all(ebox);
165
166 return ebox;
167}
168
169
170/**
171 * The before switch-page gtk signal handler
172 *
173 * This signal is handled both before and after delivery to work round
174 * issue that setting the selected tab during the switch-page signal
175 * fails
176 *
177 * \param notebook The notebook being changed
178 * \param page The notebook page being switched to
179 * \param selpagenum The currently selected page number
180 * \param user_data Unused
181 */
182static void
183nsgtk_tab_switch_page(GtkNotebook *notebook,
184 GtkWidget *page,
185 guint selpagenum,
186 gpointer user_data)
187{
188 srcpagenum = gtk_notebook_get_current_page(notebook);
189}
190
191
192/**
193 * The after switch-page gtk signal handler
194 *
195 * \param notebook The notebook being changed
196 * \param selpage The notebook page selected
197 * \param selpagenum The currently selected page number
198 * \param user_data Unused
199 */
200static void
201nsgtk_tab_switch_page_after(GtkNotebook *notebook,
202 GtkWidget *selpage,
203 guint selpagenum,
204 gpointer user_data)
205{
206 GtkWidget *srcpage;
207 GtkWidget *addpage;
208 GtkMenuBar *menubar;
209 struct gui_window *gw = NULL;
211
212 addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
213
214 /* check if trying to select the "add page" tab */
215 if (selpage != addpage) {
216 NSLOG(netsurf, INFO, "sel %d", selpagenum);
218 gw = g_object_get_data(G_OBJECT(selpage), "gui_window");
219 if (gw != NULL) {
220 /* tab with web page in it */
222 gtk_widget_show(GTK_WIDGET(addpage));
223 gtk_widget_set_sensitive(GTK_WIDGET(menubar), true);
224 } else {
225 /* tab with non browser content (e.g. tb customize) */
226 gtk_widget_hide(GTK_WIDGET(addpage));
227 gtk_widget_set_sensitive(GTK_WIDGET(menubar), false);
228 }
229 return;
230 }
231
232 NSLOG(netsurf, INFO, "src %d sel %d", srcpagenum, selpagenum);
233
234 /* ensure the add tab is not already selected */
235 if ((srcpagenum == -1) || (srcpagenum == (gint)selpagenum)) {
236 return;
237 }
238
239 srcpage = gtk_notebook_get_nth_page(notebook, srcpagenum);
240
241 gw = g_object_get_data(G_OBJECT(srcpage), "gui_window");
242
243 if (gw != NULL) {
245 }
246 if (res != NSERROR_OK) {
247 NSLOG(netsurf, INFO, "Failed to open new tab.");
248 }
249}
250
251
252/**
253 * The tab reordered gtk signal handler
254 *
255 * \param notebook The notebook being changed
256 * \param page_num The currently selected page number
257 * \param user_data Unused
258 */
259static void
260nsgtk_tab_page_reordered(GtkNotebook *notebook,
261 GtkWidget *child,
262 guint page_num,
263 gpointer user_data)
264{
265 gint pages;
266 GtkWidget *addpage;
267
268 pages = gtk_notebook_get_n_pages(notebook);
269 addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
270
271 if (((gint)page_num == (pages - 1)) &&
272 (child != addpage)) {
273 /* moved tab to end */
274 gtk_notebook_reorder_child(notebook, addpage, -1);
275 }
276}
277
278/**
279 * The tab orientation signal handler
280 *
281 * \param notebook The notebook being changed
282 * \param page_num The currently selected page number
283 * \param user_data Unused
284 */
285static void
286nsgtk_tab_orientation(GtkNotebook *notebook)
287{
288 switch (nsoption_int(position_tab)) {
289 case 0:
290 gtk_notebook_set_tab_pos(notebook, GTK_POS_TOP);
291 break;
292
293 case 1:
294 gtk_notebook_set_tab_pos(notebook, GTK_POS_LEFT);
295 break;
296
297 case 2:
298 gtk_notebook_set_tab_pos(notebook, GTK_POS_RIGHT);
299 break;
300
301 case 3:
302 gtk_notebook_set_tab_pos(notebook, GTK_POS_BOTTOM);
303 break;
304
305 }
306}
307
308/**
309 * adds a "new tab" tab
310 */
311static GtkWidget *
312nsgtk_tab_add_newtab(GtkNotebook *notebook)
313{
314 GtkWidget *tablabel;
315 GtkWidget *tabcontents;
316 GtkWidget *add;
317
318 tablabel = nsgtk_hbox_new(FALSE, 1);
319 tabcontents = nsgtk_hbox_new(FALSE, 1);
320
321 add = gtk_image_new_from_icon_name(NSGTK_STOCK_ADD,
322 GTK_ICON_SIZE_LARGE_TOOLBAR);
323 gtk_widget_set_tooltip_text(add, "New Tab");
324
325 gtk_box_pack_start(GTK_BOX(tablabel), add, FALSE, FALSE, 0);
326
327 gtk_widget_show_all(tablabel);
328
329 gtk_notebook_append_page(notebook, tabcontents, tablabel);
330
331 gtk_notebook_set_tab_reorderable(notebook, tabcontents, false);
332
333 gtk_widget_show_all(tabcontents);
334
335 g_object_set_data(G_OBJECT(notebook), "addtab", tabcontents);
336
337 return tablabel;
338}
339
340
341/**
342 * callback to alter tab visibility when pages are added or removed
343 */
344static void
345nsgtk_tab_visibility_update(GtkNotebook *notebook, GtkWidget *child, guint page)
346{
347 gint pagec;
348 GtkWidget *addpage;
349
350 pagec = gtk_notebook_get_n_pages(notebook);
351 if (pagec > 1) {
352 addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
353 if (addpage != NULL) {
354 pagec--; /* skip the add tab */
355 if ((gint)page == pagec) {
356 /* ensure the add new tab cannot be current */
357 gtk_notebook_set_current_page(notebook,
358 page - 1);
359 }
360 }
361 }
362
363 if ((nsoption_bool(show_single_tab) == true) || (pagec > 1)) {
364 gtk_notebook_set_show_tabs(notebook, TRUE);
365 } else {
366 gtk_notebook_set_show_tabs(notebook, FALSE);
367 }
368}
369
370
371/* exported interface documented in gtk/tabs.h */
372void nsgtk_tab_options_changed(GtkNotebook *notebook)
373{
374 nsgtk_tab_orientation(notebook);
375 nsgtk_tab_visibility_update(notebook, NULL, 0);
376}
377
378
379/* exported interface documented in gtk/tabs.h */
380nserror nsgtk_notebook_create(GtkBuilder *builder, GtkNotebook **notebook_out)
381{
382 GtkNotebook *notebook;
383
384 notebook = GTK_NOTEBOOK(gtk_builder_get_object(builder, "notebook"));
385
386 nsgtk_tab_add_newtab(notebook);
387
388 g_signal_connect(notebook,
389 "switch-page",
390 G_CALLBACK(nsgtk_tab_switch_page),
391 NULL);
392 g_signal_connect_after(notebook,
393 "switch-page",
394 G_CALLBACK(nsgtk_tab_switch_page_after),
395 NULL);
396 g_signal_connect(notebook,
397 "page-removed",
398 G_CALLBACK(nsgtk_tab_visibility_update),
399 NULL);
400 g_signal_connect(notebook,
401 "page-added",
402 G_CALLBACK(nsgtk_tab_visibility_update),
403 NULL);
404 g_signal_connect(notebook,
405 "page-reordered",
406 G_CALLBACK(nsgtk_tab_page_reordered),
407 NULL);
408
410
411 *notebook_out = notebook;
412
413 return NSERROR_OK;
414}
415
416/* exported interface documented in gtk/tabs.h */
418nsgtk_tab_add_page(GtkNotebook *notebook,
419 GtkWidget *tab_contents,
420 bool background,
421 const char *title,
422 GdkPixbuf *icon_pixbuf)
423{
424 GtkWidget *tabBox;
425 gint remember;
426 gint pages;
427 gint newpage;
428
429 tabBox = nsgtk_tab_label_setup(tab_contents, title, icon_pixbuf);
430
431 remember = gtk_notebook_get_current_page(notebook);
432
433 pages = gtk_notebook_get_n_pages(notebook);
434
435 newpage = gtk_notebook_insert_page(notebook, tab_contents, tabBox, pages - 1);
436
437 gtk_notebook_set_tab_reorderable(notebook, tab_contents, true);
438
439 gtk_widget_show_all(tab_contents);
440
441 if (background) {
442 gtk_notebook_set_current_page(notebook, remember);
443 } else {
444 gtk_notebook_set_current_page(notebook, newpage);
445 }
446
447 return NSERROR_OK;
448}
449
450
451/* exported interface documented in gtk/tabs.h */
452void nsgtk_tab_add(struct gui_window *gw,
453 GtkWidget *tab_contents,
454 bool background,
455 const char *title,
456 GdkPixbuf *icon_pixbuf)
457{
458 GtkNotebook *notebook;
459
460 g_object_set_data(G_OBJECT(tab_contents), "gui_window", gw);
461
463
464 nsgtk_tab_add_page(notebook, tab_contents, background, title, icon_pixbuf);
465
466}
467
468
469/* exported interface documented in gtk/tabs.h */
470nserror nsgtk_tab_set_icon(GtkWidget *page, GdkPixbuf *pixbuf)
471{
472 GtkImage *favicon;
473 GtkWidget *tab_label;
474 GtkNotebook *notebook;
475
476 if (pixbuf == NULL) {
477 return NSERROR_INVALID;
478 }
479 notebook = GTK_NOTEBOOK(gtk_widget_get_ancestor(page, GTK_TYPE_NOTEBOOK));
480 if (notebook == NULL) {
482 }
483
484 tab_label = gtk_notebook_get_tab_label(notebook, page);
485 if (tab_label == NULL) {
486 return NSERROR_INVALID;
487 }
488
489 favicon = GTK_IMAGE(g_object_get_data(G_OBJECT(tab_label), "favicon"));
490
491 gtk_image_set_from_pixbuf(favicon, pixbuf);
492
493 return NSERROR_OK;
494}
495
496
497/* exported interface documented in gtk/tabs.h */
498nserror nsgtk_tab_set_title(GtkWidget *page, const char *title)
499{
500 GtkLabel *label;
501 GtkWidget *tab_label;
502 GtkNotebook *notebook;
503
504 if (title == NULL) {
505 return NSERROR_INVALID;
506 }
507
508 notebook = GTK_NOTEBOOK(gtk_widget_get_ancestor(page, GTK_TYPE_NOTEBOOK));
509 if (notebook == NULL) {
511 }
512
513 tab_label = gtk_notebook_get_tab_label(notebook, page);
514 if (tab_label == NULL) {
515 return NSERROR_INVALID;
516 }
517
518 label = GTK_LABEL(g_object_get_data(G_OBJECT(tab_label), "label"));
519
520 gtk_label_set_text(label, title);
521 gtk_widget_set_tooltip_text(tab_label, title);
522
523 return NSERROR_OK;
524}
525
526/* exported interface documented in gtk/tabs.h */
527nserror nsgtk_tab_close_current(GtkNotebook *notebook)
528{
529 gint pagen;
530 GtkWidget *page;
531 struct gui_window *gw;
532 GtkWidget *addpage;
533
534 pagen = gtk_notebook_get_current_page(notebook);
535 if (pagen == -1) {
536 return NSERROR_OK;
537 }
538
539 page = gtk_notebook_get_nth_page(notebook, pagen);
540 if (page == NULL) {
541 return NSERROR_OK;
542 }
543
544 addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
545 if (page == addpage) {
546 /* the add new tab page is current, cannot close that */
547 return NSERROR_OK;
548 }
549
550 gw = g_object_get_data(G_OBJECT(page), "gui_window");
551 if (gw == NULL) {
552 return NSERROR_OK;
553 }
554
556
557 return NSERROR_OK;
558}
559
560nserror nsgtk_tab_prev(GtkNotebook *notebook)
561{
562 gtk_notebook_prev_page(notebook);
563
564 return NSERROR_OK;
565
566}
567
568nserror nsgtk_tab_next(GtkNotebook *notebook)
569{
570 gint pagen;
571 GtkWidget *page;
572 GtkWidget *addpage;
573
574 pagen = gtk_notebook_get_current_page(notebook);
575 if (pagen == -1) {
576 return NSERROR_OK;
577 }
578
579 page = gtk_notebook_get_nth_page(notebook, pagen + 1);
580 if (page == NULL) {
581 return NSERROR_OK;
582 }
583
584 addpage = g_object_get_data(G_OBJECT(notebook), "addtab");
585 if (page == addpage) {
586 /* cannot make add new tab page current */
587 return NSERROR_OK;
588 }
589
590 gtk_notebook_set_current_page(notebook, pagen + 1);
591
592 return NSERROR_OK;
593}
Browser window creation and manipulation interface.
GtkStateFlags nsgtk_widget_get_state_flags(GtkWidget *widget)
Definition: compat.c:335
void nsgtk_button_set_focus_on_click(GtkButton *button, gboolean focus_on_click)
Sets whether the button will grab focus when it is clicked with the mouse.
Definition: compat.c:219
GtkWidget * nsgtk_image_new_from_stock(const gchar *id, GtkIconSize size)
Creates a GtkImage displaying a stock icon.
Definition: compat.c:198
void nsgtk_widget_set_margins(GtkWidget *widget, gint hmargin, gint vmargin)
Set the margins of a widget.
Definition: compat.c:625
const PangoFontDescription * nsgtk_style_context_get_font(GtkStyleContext *style, GtkStateFlags state)
Definition: compat.c:357
GtkWidget * nsgtk_hbox_new(gboolean homogeneous, gint spacing)
Definition: compat.c:317
GtkStyleContext * nsgtk_widget_get_style_context(GtkWidget *widget)
Definition: compat.c:348
void nsgtk_widget_set_alignment(GtkWidget *widget, GtkAlign halign, GtkAlign valign)
Set the alignment of a widget.
Definition: compat.c:585
gboolean nsgtk_icon_size_lookup_for_settings(GtkSettings *settings, GtkIconSize size, gint *width, gint *height)
Definition: compat.c:572
Compatibility functions for older GTK versions (interface)
GtkStyle GtkStyleContext
Definition: compat.h:157
@ GTK_ALIGN_CENTER
Definition: compat.h:75
@ GTK_ALIGN_START
Definition: compat.h:73
#define NSGTK_STOCK_CLOSE
Definition: compat.h:57
GtkStateType GtkStateFlags
Definition: compat.h:156
#define NSGTK_STOCK_ADD
Definition: compat.h:54
Browseing window text search interface.
nserror
Enumeration of error codes.
Definition: errors.h:29
@ NSERROR_BAD_PARAMETER
Bad Parameter.
Definition: errors.h:48
@ NSERROR_INVALID
Invalid data.
Definition: errors.h:49
@ NSERROR_OK
No error.
Definition: errors.h:30
free text page search for gtk interface
void nsgtk_window_destroy_browser(struct gui_window *gw)
destroy browsing context
Definition: window.c:1663
struct nsgtk_scaffolding * nsgtk_get_scaffold(struct gui_window *g)
get containing nsgtk scaffolding handle from gui window handle
Definition: window.c:1626
nserror nsgtk_window_item_activate(struct gui_window *gw, nsgtk_toolbar_button itemid)
activate the handler for a item in a toolbar of a gui window
Definition: window.c:1656
#define NSLOG(catname, level, logmsg, args...)
Definition: log.h:116
void nsgtk_scaffolding_set_top_level(struct gui_window *gw)
Set the current active top level gui window.
Definition: scaffolding.c:1349
GtkNotebook * nsgtk_scaffolding_notebook(struct nsgtk_scaffolding *g)
Get the gtk notebook from a scaffold.
Definition: scaffolding.c:1316
GtkMenuBar * nsgtk_scaffolding_menu_bar(struct nsgtk_scaffolding *gs)
Definition: scaffolding.c:1323
struct nsgtk_scaffolding * nsgtk_scaffolding_from_notebook(GtkNotebook *notebook)
find which scaffolding contains a gtk notebook
Definition: scaffolding.c:1482
Interface to utility string handling.
first entry in window list
Definition: gui.c:297
struct hlcache_handle * favicon
Definition: gui.c:310
char * title
Definition: gui.h:153
#define TAB_WIDTH_N_CHARS
Definition: tabs.c:34
nserror nsgtk_tab_set_title(GtkWidget *page, const char *title)
set the tab title
Definition: tabs.c:498
nserror nsgtk_tab_set_icon(GtkWidget *page, GdkPixbuf *pixbuf)
set the tab icon
Definition: tabs.c:470
static GtkWidget * nsgtk_tab_add_newtab(GtkNotebook *notebook)
adds a "new tab" tab
Definition: tabs.c:312
static gint srcpagenum
Definition: tabs.c:36
nserror nsgtk_tab_next(GtkNotebook *notebook)
Definition: tabs.c:568
static gboolean nsgtk_tab_button_release(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
gtk event handler for button release on tab hbox
Definition: tabs.c:78
nserror nsgtk_tab_add_page(GtkNotebook *notebook, GtkWidget *tab_contents, bool background, const char *title, GdkPixbuf *icon_pixbuf)
Add new page to a notebook.
Definition: tabs.c:418
static GtkWidget * nsgtk_tab_label_setup(GtkWidget *page, const char *title, GdkPixbuf *icon_pixbuf)
Create a notebook tab label.
Definition: tabs.c:101
static void nsgtk_tab_orientation(GtkNotebook *notebook)
The tab orientation signal handler.
Definition: tabs.c:286
nserror nsgtk_notebook_create(GtkBuilder *builder, GtkNotebook **notebook_out)
create notebook
Definition: tabs.c:380
static void nsgtk_tab_visibility_update(GtkNotebook *notebook, GtkWidget *child, guint page)
callback to alter tab visibility when pages are added or removed
Definition: tabs.c:345
static void nsgtk_tab_switch_page(GtkNotebook *notebook, GtkWidget *page, guint selpagenum, gpointer user_data)
The before switch-page gtk signal handler.
Definition: tabs.c:183
static void nsgtk_tab_update_size(GtkWidget *hbox, GtkStyle *previous_style, GtkWidget *close_button)
callback to update sizes when style-set gtk signal
Definition: tabs.c:42
nserror nsgtk_tab_close_current(GtkNotebook *notebook)
Definition: tabs.c:527
static void nsgtk_tab_page_reordered(GtkNotebook *notebook, GtkWidget *child, guint page_num, gpointer user_data)
The tab reordered gtk signal handler.
Definition: tabs.c:260
static void nsgtk_tab_switch_page_after(GtkNotebook *notebook, GtkWidget *selpage, guint selpagenum, gpointer user_data)
The after switch-page gtk signal handler.
Definition: tabs.c:201
nserror nsgtk_tab_prev(GtkNotebook *notebook)
Definition: tabs.c:560
void nsgtk_tab_options_changed(GtkNotebook *notebook)
Definition: tabs.c:372
void nsgtk_tab_add(struct gui_window *gw, GtkWidget *tab_contents, bool background, const char *title, GdkPixbuf *icon_pixbuf)
Add new gui window page to notebook.
Definition: tabs.c:452
@ NEWTAB_BUTTON
Definition: toolbar_items.h:35
Option reading and saving interface.
#define nsoption_int(OPTION)
Get the value of an integer option.
Definition: nsoption.h:313
#define nsoption_bool(OPTION)
Get the value of a boolean option.
Definition: nsoption.h:304