Set up current working directory on File->Open
[gscope.git] / notebook.h
blob3e6db8a6fa82387d6ed3a6ad850eaf0002311c29
1 /*
2 * (c) 2010 Cyrill Gorcunov, gorcunov@gmail.com
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or (at
7 * your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20 #ifndef NOTEBOOK_H
21 #define NOTEBOOK_H
23 #include <gtk/gtk.h>
25 #include "list.h"
27 #define NB_STATUS_LOCKED (1 << 0)
28 #define NB_STATUS_SOURCE (1 << 1)
29 #define NB_STATUS_QUERY (1 << 2)
31 #define NB_ENOPAGE -2
33 struct notebook {
34 GtkWidget *me; /* this notebook */
35 struct list_head pages; /* all pages in notebook */
36 void *private; /* auxilary */
39 struct notebook_title {
40 GtkWidget *container; /* other widgets embedded in */
41 GtkWidget *label; /* notebook title string */
42 GtkWidget *lock_button; /* page locking specifics */
43 GtkWidget *lock_image;
44 GtkWidget *close_button; /* page closing specifics */
45 GtkWidget *close_image;
48 struct notebook_page {
49 struct list_head siblings; /* all pages in notebook */
51 struct notebook *notebook; /* whom we belong to */
52 struct notebook_title title; /* title specifics */
53 GtkWidget *parent; /* which object we're embedded */
54 GtkWidget *child; /* content of this page */
55 void *private; /* private for hooks */
56 void (*child_delete_hook)(GtkWidget *child, void *private);
57 void (*page_changed_hook)(struct notebook_page *page);
58 int status;
61 void notebook_init(void);
62 void notebook_fini(void);
64 struct notebook *notebook_create(void);
65 void notebook_delete(struct notebook *notebook);
66 struct notebook_page *notebook_create_page(struct notebook *notebook, char *title, int title_nchars, int status);
67 void notebook_page_child_attach(struct notebook_page *page, GtkWidget *widget, void *private,
68 void (*page_changed_hook)(struct notebook_page *page),
69 void (*child_delete_hook)(GtkWidget *child, void *private));
70 void notebook_page_child_dettach(struct notebook_page *page);
71 void notebook_activate_page(struct notebook *notebook, struct notebook_page *page);
73 struct notebook_page *notebook_page_find(struct notebook *notebook, GtkWidget *child);
75 #endif /* NOTEBOOK_H */