Back to index

lightning-sunbird  0.9+nobinonly
minimo_types.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is mozilla.org code.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Christopher Blizzard. Portions created by Christopher Blizzard are Copyright (C) Christopher Blizzard.  All Rights Reserved.
00018  * Portions created by the Initial Developer are Copyright (C) 2001
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *   Christopher Blizzard <blizzard@mozilla.org>
00023  *   Doug Turner <dougt@meer.net>  Branched from TestGtkEmbed.cpp
00024  *
00025  *   The 10LE Team (in alphabetical order)
00026  *   -------------------------------------
00027  *
00028  *    Ilias Biris       <ext-ilias.biris@indt.org.br> - Coordinator
00029  *    Afonso Costa      <afonso.costa@indt.org.br>
00030  *    Antonio Gomes     <antonio.gomes@indt.org.br>
00031  *    Diego Gonzalez    <diego.gonzalez@indt.org.br>
00032  *    Raoni Novellino   <raoni.novellino@indt.org.br>
00033  *    Andre Pedralho    <andre.pedralho@indt.org.br>
00034  *
00035  *
00036  * Alternatively, the contents of this file may be used under the terms of
00037  * either the GNU General Public License Version 2 or later (the "GPL"), or
00038  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00039  * in which case the provisions of the GPL or the LGPL are applicable instead
00040  * of those above. If you wish to allow use of your version of this file only
00041  * under the terms of either the GPL or the LGPL, and not to allow others to
00042  * use your version of this file under the terms of the MPL, indicate your
00043  * decision by deleting the provisions above and replace them with the notice
00044  * and other provisions required by the GPL or the LGPL. If you do not delete
00045  * the provisions above, a recipient may use your version of this file under
00046  * the terms of any one of the MPL, the GPL or the LGPL.
00047  *
00048  * ***** END LICENSE BLOCK ***** */
00049 
00050 #ifndef minimo_types_h
00051 #define minimo_types_h
00052 
00053 #include <gtk/gtk.h>
00054 #include <gdk/gdk.h>
00055 #include <gdk/gdkkeysyms.h>
00056 #include <stdio.h>
00057 #include <string.h>
00058 #include <stdlib.h>
00059 #include <sys/stat.h>
00060 #include <sys/types.h>
00061 #include <sys/wait.h>
00062 #include <sys/time.h>
00063 #include <fcntl.h>
00064 #include <unistd.h>
00065 #include <errno.h>
00066 #include <signal.h>
00067 #include <dirent.h>
00068 
00069 #include "gtkmozembed.h"
00070 
00071 /* MINIMO TOOLBAR STRUCT */
00072 typedef struct _MinimoToolBar {
00073   GtkWidget  *toolbar;
00074   
00075   GtkWidget *OpenButton;
00076   GtkWidget *BackButton;
00077   GtkWidget *ReloadButton;
00078   GtkWidget *ForwardButton;
00079   GtkWidget *StopButton;
00080   GtkWidget *PrefsButton;
00081   GtkWidget *InfoButton;
00082   GtkWidget *QuitButton;  
00083 } MinimoToolbar;
00084 
00085 /* MINIMO STRUCT */
00086 typedef struct _MinimoBrowser {
00087   
00088   GtkWidget  *topLevelWindow;
00089   GtkWidget  *topLevelVBox;
00090   GtkWidget  *mozEmbed;
00091   
00092   MinimoToolbar toolbar;
00093   
00094   gboolean    show_tabs;
00095   GtkWidget  *notebook;
00096   GtkWidget  *label_notebook;
00097   GtkWidget  *active_page;
00098   
00099   GtkWidget  *progressPopup;
00100   GtkWidget  *progressBar;
00101   gint        totalBytes;
00102   
00103   GtkWidget  *link_menu;
00104   GtkWidget  *image_menu;
00105   GtkWidget  *doc_menu;
00106   GtkWidget  *image_link_menu;
00107   GtkWidget  *reload_menu;
00108   
00109   gboolean didFind;
00110   
00111 } MinimoBrowser;
00112 
00113 typedef struct _PrefWindow         /* configuration data struct */
00114 {
00115   GtkWidget *dialog;
00116   GtkWidget *okbutton;
00117   GtkWidget *cancelbutton;
00118   GtkWidget *applybutton;
00119   GtkWidget *block_popup;
00120   GtkWidget *vbox_popup;
00121   GtkWidget *fr_connection;
00122   GtkWidget *vbox_connection;
00123   GtkWidget *hbox_connection;
00124   GtkWidget *hbox_direct_connection;
00125   GtkWidget *fr_popup;
00126   GtkWidget *lb_popup;
00127   
00128   GtkWidget *vbox_manual;
00129   GtkWidget *rb_manual_connection;
00130   GtkWidget *hbox_http;
00131   GtkWidget *lb_http;
00132   GtkWidget *en_http_proxy;
00133   GtkWidget *box_popup;
00134   
00135   GtkWidget *lb_port_http;
00136   GtkWidget *en_http_port;
00137   GtkWidget *hbox_ssl;
00138   GtkWidget *lb_ssl;
00139   GtkWidget *en_ssl;
00140   GtkWidget *lb_ssl_port;
00141   GtkWidget *en_ssl_port;
00142   GtkWidget *hbox_ftp;
00143   
00144   GtkWidget *lb_ftp;
00145   GtkWidget *en_ftp_proxy;
00146   GtkWidget *lb_ftp_port;
00147   GtkWidget *en_ftp_port;
00148   GtkWidget *hbox_noproxy;
00149   GtkWidget *lb_connection;
00150   
00151   GSList *rb_direct_connection_group;
00152   GSList *rb_manual_connection_group;
00153   GtkWidget *hbox_manual_connection;
00154   GtkWidget *rb_direct_connection;
00155   
00156 } PrefWindow;
00157 
00158 /* SPECIFIC STRUCT FOR SPECIFY SOME PARAMETERS OF '_open_dialog_params' METHOD */
00159 typedef struct _open_dialog_params
00160 {
00161   GtkWidget* dialog_combo;
00162   GtkWidget* main_combo;
00163 } OpenDialogParams;
00164 
00165 /* SPECIFIC STRUCT FOR THE RIGHT CLICK BUTTON EMULATION */
00166 typedef struct _right_button_click
00167 {
00168   GTimer *pressing_timer;
00169   gulong sig_handler;
00170   gboolean is_connected;
00171 } RightButtonClick;
00172 
00173 
00174 /****************/
00175 /* PREFERENCE.H */
00176 /****************/
00177 
00178 #define LANG_FONT_NUM 15
00179 #define DEFAULT_FONT_SIZE 10
00180 #define DEFAULT_MIN_FONT_SIZE 5
00181 #define DEFAULT_SERIF_FONT     "-adobe-times-medium-r-normal-*-14-*-*-*-p-*-iso8859-1"
00182 #define DEFAULT_SANSSERIF_FONT "-adobe-times-medium-r-normal-*-14-*-*-*-p-*-iso8859-1"
00183 #define DEFAULT_CURSIVE_FONT   "-adobe-times-medium-r-normal-*-14-*-*-*-p-*-iso8859-1"
00184 #define DEFAULT_FANTASY_FONT   "-adobe-times-medium-r-normal-*-14-*-*-*-p-*-iso8859-1"
00185 #define DEFAULT_MONOSPACE_FONT "-adobe-times-medium-r-normal-*-14-*-*-*-p-*-iso8859-1"
00186 
00187 static const char *lang_font_item [LANG_FONT_NUM] =
00188   {
00189     "x-western",
00190     "x-central-euro",
00191     "ja",
00192     "zh-TW",
00193     "zh-CN",
00194     "ko",
00195     "x-cyrillic",
00196     "x-baltic",
00197     "el",
00198     "tr",
00199     "x-unicode",
00200     "x-user-def",
00201     "th",
00202     "he",
00203     "ar"
00204   };
00205 
00209 typedef struct _ConfigData         /* configuration data struct */
00210 {
00211   /* minimo prefs */
00212   gchar *home;
00213   gchar *mailer;
00214   gint xsize;
00215   gint ysize;
00216   gint layout;
00217   gint maxpopupitems;
00218   gint max_go;     
00219   /* mozilla prefs */
00220   gchar *http_proxy;
00221   gchar *http_proxy_port;
00222   gchar *ftp_proxy;
00223   gchar *ftp_proxy_port;
00224   gchar *ssl_proxy;
00225   gchar *ssl_proxy_port;
00226   gint font_size[LANG_FONT_NUM];
00227   gint min_font_size[LANG_FONT_NUM];
00228   gint current_font_size;
00229   gboolean java;
00230   gboolean javascript;
00231   gboolean underline_links;
00232   gchar *no_proxy_for;
00233   gint direct_connection;
00234   gint popup_in_new_window;
00235   gint disable_popups;
00236   gint tab_text_length;
00237   
00238 } ConfigData;
00239 
00240 /****************/
00241 /* HISTORY.H    */
00242 /****************/
00243 
00244 /* History Window Structure */
00245 typedef struct _HistoryWindow{
00246   GtkWidget *window;
00247   GtkWidget *scrolled_window;
00248   GtkWidget *clist;
00249   GtkWidget *vbox;
00250   GtkWidget *remove;
00251   GtkWidget *close;
00252   GtkWidget *btnbox;
00253   GtkWidget *clear;
00254   GtkWidget *search_label;
00255   GtkWidget *search_entry;
00256   GtkWidget *search_box;
00257   GtkWidget *search_button;
00258   GtkWidget *go_button;
00259   GtkWidget *embed;
00260   gchar *title;
00261 }HistoryWindow;
00262 
00263 /****************/
00264 /*  BOOKMARK.H  */
00265 /****************/
00266 
00267 
00268 /* represent a bookmark item */
00269 typedef struct _BookmarkData {
00270   gchar *label;
00271   gchar *url;
00272 } BookmarkData;
00273 
00274 /* Represents Bookmarks List View*/
00275 typedef struct _BookmarkCTreeData {
00276   GtkWidget *ctree;
00277   GtkCTreeNode *parent;
00278 } BookmarkCTreeData;
00279 
00280 /* Bookmarks Window Structure */
00281 typedef struct _BookmarkWindow {
00282   GtkWidget *window;
00283   GtkWidget *scrolled_window;
00284   GtkWidget *vbox1;
00285   GtkWidget *hbox1;
00286   GtkWidget *hbox2;
00287   GtkWidget *hbox3;
00288   GtkWidget *text_label;
00289   GtkWidget *text_entry;
00290   GtkWidget *url_label;
00291   GtkWidget *url_entry;
00292   GtkWidget *add_button;
00293   GtkWidget *edit_button;
00294   GtkWidget *folder_entry;
00295   GtkWidget *remove_button;
00296   GtkWidget *ok_button;
00297   GtkWidget *go_button;
00298   GtkWidget *cancel_button;
00299   GtkWidget *ctree;
00300   GNode *temp_node;
00301   GNode *parent_node;
00302   GtkCTreeNode *menu_node;
00303   BookmarkData *menu_node_data;
00304   BookmarkCTreeData ctree_data;
00305   
00306   GtkWidget *reload_menu; /* context menu for reload flags */
00307   GtkWidget *doc_menu; /* pointer to document popup menu */
00308   GtkWidget *image_menu; /* pointer to image popup menu */
00309   GtkWidget *link_menu; /* pointer to link popup menu */
00310   GtkWidget *image_link_menu; /* pointer to image link popup menu */
00311   
00312 } BookmarkWindow;
00313 
00314 #endif