Moved struct and enum declarations from prefswindow.c to .h.
[claws.git] / src / gtk / prefswindow.h
index 6b67fd823e438256aac8e4af4e2c0188fcdebe5d..d8530a8f819755a03fab0f2abb19d01288f86649 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws Team
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -13,8 +13,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
  */
 
 #ifndef PREFSWINDOW_H
 #include <gtk/gtk.h>
 
 typedef struct _PrefsPage PrefsPage;
+typedef struct _PrefsWindow PrefsWindow;
 
 typedef void (*PrefsCreateWidgetFunc) (PrefsPage *, GtkWindow *window, gpointer);
 typedef void (*PrefsDestroyWidgetFunc) (PrefsPage *);
 typedef void (*PrefsSavePageFunc) (PrefsPage *);
 typedef gboolean (*PrefsCanClosePageFunc) (PrefsPage *);
-
+typedef void (*PrefsOpenCallbackFunc) (GtkWindow *);
+typedef void (*PrefsCloseCallbackFunc) (GtkWindow *);
 
 struct _PrefsPage
 {
@@ -44,15 +46,65 @@ struct _PrefsPage
        PrefsCanClosePageFunc     can_close;
 };
 
+enum {
+       PREFS_PAGE_TITLE,               /* page title */
+       PREFS_PAGE_DATA,                /* PrefsTreeNode data */
+       PREFS_PAGE_DATA_AUTO_FREE,      /* auto free for PREFS_PAGE_DATA */
+       PREFS_PAGE_WEIGHT,              /* weight */
+       PREFS_PAGE_INDEX,               /* index in original page list */
+       N_PREFS_PAGE_COLUMNS
+};
+
+typedef struct _PrefsTreeNode PrefsTreeNode;
+
+struct _PrefsWindow
+{
+       GtkWidget *window;
+       GtkWidget *vbox;
+       GtkWidget *paned;
+       GtkWidget *scrolledwindow1;
+       GtkWidget *tree_view;
+       GtkWidget *table2;
+       GtkWidget *pagelabel;
+       GtkWidget *labelframe;
+       GtkWidget *vbox2;
+       GtkWidget *notebook;
+       GtkWidget *confirm_area;
+       GtkWidget *ok_btn;
+       GtkWidget *cancel_btn;
+       GtkWidget *apply_btn;
+       gint *save_width;
+       gint *save_height;
+       PrefsCloseCallbackFunc open_cb;
+       PrefsCloseCallbackFunc close_cb;
+
+       GtkWidget *empty_page;
+
+       gpointer         data;
+       GSList          *prefs_pages;
+       GDestroyNotify func;
+};
+
+struct _PrefsTreeNode
+{
+       PrefsPage *page;
+       gfloat     treeweight; /* GTK2: not used */
+};
+
 void prefswindow_open_full             (const gchar *title, 
                                         GSList *prefs_pages,
                                         gpointer data,
-                                        GtkDestroyNotify func,
-                                        gint *save_width, gint *save_height);
+                                        GDestroyNotify func,
+                                        gint *save_width, gint *save_height,
+                                        gboolean preload_pages,
+                                        PrefsOpenCallbackFunc open_cb,
+                                        PrefsCloseCallbackFunc close_cb);
 
 void prefswindow_open                  (const gchar *title, 
                                         GSList *prefs_pages,
                                         gpointer data,
-                                        gint *save_width, gint *save_height);
+                                        gint *save_width, gint *save_height,
+                                        PrefsOpenCallbackFunc open_cb,
+                                        PrefsCloseCallbackFunc close_cb);
 
 #endif