NetSurf
tabs.h
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#ifndef NETSURF_GTK_TABS_H_
20#define NETSURF_GTK_TABS_H_
21
22struct gui_window;
23
24/**
25 * create notebook
26 *
27 * creates a notebook for use inside a window, creates the special add
28 * page(tab) and attaches all signals.
29 *
30 * \param builder the gtk builder object to create notbook from
31 * \param notebook_out reciveds the created notebook
32 * \return NSERROR_OK and notebook_out updated else error code
33 */
34nserror nsgtk_notebook_create(GtkBuilder *builder, GtkNotebook **notebook_out);
35
36/**
37 * Add new gui window page to notebook.
38 */
39void nsgtk_tab_add(struct gui_window *window, GtkWidget *tab_contents, bool background, const char *title, GdkPixbuf *icon_pixbuf);
40
41/**
42 * Add new page to a notebook
43 */
44nserror nsgtk_tab_add_page(GtkNotebook *notebook, GtkWidget *tab_contents, bool background, const char *title, GdkPixbuf *icon_pixbuf);
45
46
47/**
48 * set the tab title
49 *
50 * The tab title will be set to the parameter
51 *
52 * \note currently only called from nsgtk_window_set_title()
53 *
54 * \param page The page widget that was added to the notebook
55 * \param title The title text which may not be NULL.
56 * \return NSERROR_OK on sucess else appropriate code.
57 */
58nserror nsgtk_tab_set_title(GtkWidget *page, const char *title);
59
60/**
61 * set the tab icon
62 *
63 * The tab icon will be set to the \a pixbuf parameter
64 *
65 * \param page The page widget that was added to the notebook
66 * \param pixbuf The pixbuf to set the icon to.
67 * \return NSERROR_OK on sucess else appropriate code.
68 */
69nserror nsgtk_tab_set_icon(GtkWidget *page, GdkPixbuf *pixbuf);
70
71void nsgtk_tab_options_changed(GtkNotebook *notebook);
72nserror nsgtk_tab_close_current(GtkNotebook *notebook);
73nserror nsgtk_tab_prev(GtkNotebook *notebook);
74nserror nsgtk_tab_next(GtkNotebook *notebook);
75
76#endif
nserror
Enumeration of error codes.
Definition: errors.h:29
first entry in window list
Definition: gui.c:297
struct fbtk_widget_s * window
Definition: gui.h:33
char * title
Definition: gui.h:153
void nsgtk_tab_add(struct gui_window *window, GtkWidget *tab_contents, bool background, const char *title, GdkPixbuf *icon_pixbuf)
Add new gui window page to notebook.
Definition: tabs.c:452
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
nserror nsgtk_tab_next(GtkNotebook *notebook)
Definition: tabs.c:568
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
nserror nsgtk_notebook_create(GtkBuilder *builder, GtkNotebook **notebook_out)
create notebook
Definition: tabs.c:380
nserror nsgtk_tab_close_current(GtkNotebook *notebook)
Definition: tabs.c:527
nserror nsgtk_tab_prev(GtkNotebook *notebook)
Definition: tabs.c:560
void nsgtk_tab_options_changed(GtkNotebook *notebook)
Definition: tabs.c:372