src/gui/include/ws_gui.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 This file is part of mdictionary.
00003 
00004 mdictionary is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation; either version 2 of the License, or
00007 (at your option) any later version.
00008 
00009 mdictionary is distributed in the hope that it will be useful, 
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License 
00015 along with mdictionary; if not, write to the Free Software
00016 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00017 
00018 Copyright 2006 ComArch S.A.
00019 *******************************************************************************/
00030 #ifndef _WS_GUI
00031 #define _WS_GUI 
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 
00038 #ifdef CHINOOK
00039 #include <hildon/hildon-program.h>
00040 #include <hildon/hildon-window.h>
00041 #include <hildon/hildon-banner.h>
00042 #include <hildon/hildon-find-toolbar.h>
00043 #include <hildon/hildon-file-chooser-dialog.h>
00044 #include <hildon/hildon-caption.h>
00045 #else
00046 #include <hildon-widgets/hildon-program.h>
00047 #include <hildon-widgets/hildon-window.h>
00048 #include <hildon-widgets/hildon-banner.h>
00049 #include <hildon-widgets/hildon-find-toolbar.h>
00050 #include <hildon-fm/hildon-widgets/hildon-file-chooser-dialog.h>
00051 #include <hildon-widgets/hildon-caption.h>
00052 #endif
00053 
00054 #include <gtk/gtkfilechooser.h>
00055 #include <gtk/gtkdialog.h>
00056 #include <gdk/gdkkeysyms.h>
00057 
00058 //#include <hildon-widgets/gtk-infoprint.h>
00059 #include <gdk/gdkkeysyms.h>
00060 #include <gtk/gtk.h>
00061 #include <gtkhtml/gtkhtml.h>
00062 #include <glib.h>
00063 #include <glib/gprintf.h>
00064 #include <string.h>
00065 #include <stdlib.h>
00066 #include <signal.h>
00067 #include <sys/time.h>
00068 
00069 #include <ws_services.h>
00070 #include <ws_dbus.h>
00071 
00072 #include <gtkhtml/gtkhtml-stream.h>
00073 #include <gconf/gconf.h>
00074 #include <gconf/gconf-client.h>
00075 
00076 #define ZOOM_MIN 1.000000
00077 #define ZOOM_MAX 2.000000
00078 #define ZOOM_STEP 0.100000
00079 #define ZOOM_DEFAULT 1.300000
00080 #define PRESS_TIME 1.0
00081 #define HISTORY_LEN 5
00082 #define SCROLL_STEP_H 50
00083 #define SCROLL_STEP_V 20
00084 #define GCONF_PATH "/apps/maemo/mdictionary/dictionaries"
00085 #define GCONF_CONF "/apps/maemo/mdictionary/configuration"
00086 
00087 
00088 #include <libintl.h>
00089 #include <locale.h>
00090 
00091 #define _(String) gettext (String)
00092 #define WS_GUI_ABS(x) (((x)<0.0)?((-1)*(x)):(x))
00093 
00094 void html_engine_unselect_all(HTMLEngine   *e);
00095 void html_engine_block_selection (HTMLEngine   *e);
00096 gboolean html_engine_is_selection_active (HTMLEngine *e);
00097 
00098 typedef struct WSGuiAppData WSGuiApp;
00099 
00100 enum
00101 {
00102   COL_WORD = 0,
00103   NUM_COLS
00104 };
00105 
00106 
00111 struct HtmlLayout {
00112 gchar *bg_color;
00113 gchar *bg_image;
00114 gchar *bg_font_color;
00115 
00116 gchar *th_color;
00117 gchar *th_image;
00118 gchar *th_font_color;
00119 
00120 gchar *td_color;
00121 gchar *td_image;
00122 gchar *td_font_color;
00123 };
00124 
00129 struct WSGuiMenu {
00130         /*application menu*/
00131         GtkWidget *ws_gui_main_menu; 
00132         GtkWidget *ws_gui_menu_dictionaries; 
00133         GtkWidget *ws_gui_menu_load_dict; 
00134         GtkWidget *ws_gui_menu_select_dict; 
00135         GtkWidget *ws_gui_menu_remove_dict; 
00136         GtkWidget *ws_gui_menu_optimize_dict; 
00137         
00138         GtkWidget *ws_gui_menu_bookmarks; 
00139         GtkWidget *ws_gui_menu_open_bookmark; 
00140         GtkWidget *ws_gui_menu_close_bookmark; 
00141         GtkWidget *ws_gui_menu_add_bookmark; 
00142         GtkWidget *ws_gui_menu_remove_bookmark; 
00143         
00144         GtkWidget *ws_gui_menu_edit; 
00145         GtkWidget *ws_gui_menu_copy; 
00146         GtkWidget *ws_gui_menu_paste; 
00147         GtkWidget *ws_gui_menu_select_all; 
00148         GtkWidget *ws_gui_menu_view; 
00149         GtkWidget *ws_gui_menu_hide_list; 
00150         GtkWidget *ws_gui_menu_zoom_in; 
00151         GtkWidget *ws_gui_menu_zoom_out; 
00152         GtkWidget *ws_gui_menu_full_screen; 
00153         GtkWidget *ws_gui_menu_search; 
00154         GtkWidget *ws_gui_menu_find_word; 
00155         GtkWidget *ws_gui_menu_find_prev; 
00156         GtkWidget *ws_gui_menu_find_next; 
00157         GtkWidget *ws_gui_menu_stop; 
00158         GtkWidget *ws_gui_menu_about; 
00159         GtkWidget *ws_gui_menu_close; 
00160         
00161         GtkWidget *ws_gui_submenu_0; 
00162         GtkWidget *ws_gui_submenu_1; 
00163         GtkWidget *ws_gui_submenu_2; 
00164         GtkWidget *ws_gui_submenu_3; 
00165         GtkWidget *ws_gui_submenu_4; 
00166         GtkWidget *ws_gui_separator; 
00167         
00168         /*ws_gui_menu popup*/
00169         GtkWidget *ws_gui_popup_menu;  
00170         GtkWidget *ws_gui_popup_search;
00171         GtkWidget *ws_gui_popup_bookmark;
00172         GtkWidget *ws_gui_popup_edit; 
00173         GtkWidget *ws_gui_popup_submenu; 
00174         GtkWidget *ws_gui_popup_copy; 
00175         GtkWidget *ws_gui_popup_paste; 
00176         GtkWidget *ws_gui_popup_select_all; 
00177         GtkWidget *ws_gui_popup_zoom_in; 
00178         GtkWidget *ws_gui_popup_zoom_out; 
00179         
00180         GtkWidget *ws_gui_separator1; 
00181         GtkWidget *ws_gui_separator2; 
00182 };
00183 
00188 struct WSGuiList {
00189         GtkWidget* ws_gui_list; 
00190         GtkWidget* ws_gui_list_item; 
00191         GtkWidget* ws_gui_list_label; 
00192         
00193         GtkObject* ws_gui_list_item_object; 
00194         //gchar* ws_gui_list_item_data_string; ///< variable which stores translation of word (html content)
00195 
00196         GtkListStore* ws_gui_store; 
00197         GtkTreeIter ws_gui_iter; 
00198         GtkCellRenderer* ws_gui_renderer; 
00199         GtkTreeModel* ws_gui_model; 
00200         GtkWidget* ws_gui_view; 
00201         GtkTreeSelection* ws_gui_selection; 
00202 };
00203 
00208 struct WSGuiAppData {
00209         HildonProgram *ws_gui_hildon_program; 
00210         HildonWindow *ws_gui_hildon_window; 
00211         gchar *welcome_note; 
00212         GtkWidget *ws_gui_html; 
00213         GtkWidget *ws_gui_hpane; 
00214         HildonFindToolbar *ws_gui_hildon_find_toolbar; 
00215         GtkToolItem *ws_gui_toobar_button_close; 
00216         GtkToolItem *ws_gui_toobar_button_back; 
00217         GtkToolItem *ws_gui_toobar_button_forward; 
00218         GtkToolItem *ws_gui_toobar_button_stop; 
00219         GtkToolItem *ws_gui_toobar_button_start; 
00220         GtkWidget *ws_gui_banner_list_searching; 
00221         GtkWidget *ws_gui_banner_caching; 
00222         GtkWidget *ws_gui_banner_translation_loading; 
00223         gboolean caching_flag; 
00224         gboolean loading; 
00225         gboolean stop_clicked; 
00226         GtkWidget *ws_gui_banner_extracting;
00227         GtkToolItem *ws_gui_toobar_button_hide; 
00228         GtkWidget *ws_gui_scrolledwindow_right; 
00229         GtkWidget *ws_gui_scrolledwindow_left; 
00230 
00231         GtkWidget *ws_gui_list_vbox;
00232         GtkWidget *ws_gui_list_hbox;
00233         GtkWidget *ws_gui_list_label;
00234         GtkWidget *ws_gui_list_eventbox;
00235         GtkWidget *ws_gui_list_image;
00236 
00237         gchar *ws_gui_html_source; 
00238         
00239         GtkAdjustment* ws_gui_vadj; 
00240         GtkAdjustment* ws_gui_hadj; 
00241         gdouble v_delta; 
00242         gdouble v_new_value; 
00243         gdouble h_delta; 
00244         gdouble h_new_value; 
00245         gdouble cur_vadj; 
00246         gdouble prev_vadj; 
00247         gdouble cur_hadj; 
00248         gdouble prev_hadj; 
00249         
00250         GArray *ws_gui_history; 
00251         GArray *ws_gui_history_list;
00252         GArray *ws_gui_history_iter;
00253         GArray *ws_gui_history_bookmarks;
00254         gboolean history_flag;
00255         gint ws_gui_history_cur_pos; 
00256         
00257 
00258         struct WSGuiMenu *ws_gui_menu; 
00259         struct WSGuiList *ws_gui_w_list; 
00260         
00261         gboolean ws_gui_banner_flag; 
00262         gboolean ws_gui_full_screen_flag; 
00263         gboolean ws_gui_double_click; 
00264         gboolean ws_gui_sel_flag; 
00265         
00266         WSDBusData *dbus_data; 
00267         
00268         GtkWidget* ws_message_dialog; 
00269         
00270         GSList *directories; 
00271         GSList *directories_last; 
00272         GConfClient *client; 
00273         GtkClipboard *ws_gui_clipboard; 
00274         GtkClipboard *ws_gui_clipboard_primary;
00275         PangoFontDescription* p; 
00276         GtkWidget *licence_dialog; 
00277         GTimer *timer; 
00278         GArray *bookmarks_list; 
00279         gboolean bookmark_on; 
00280         gchar *word_book; 
00281         gchar *translation_book; 
00282         
00283         gboolean bookmark_avail; 
00284         gboolean bookmark_mode; 
00285         gchar *last_word; 
00286         GString *raw_translation; 
00287         gchar *last_searched;
00288         gchar *last_searched_in_book;
00289         gdouble zoom;
00290         gboolean html_flag;
00291         gboolean no_words_found;
00292         
00293         gboolean first_run;
00294 
00295 };
00296 
00297 #ifdef __cplusplus
00298 }
00299 #endif
00300 
00301 #endif

Generated on Fri Jan 11 14:30:17 2008 for mDictionary Project by  doxygen 1.5.1