Code review of GUI module
authorkrzsas <krzsas@gmail.com>
Fri, 11 Jan 2008 09:39:56 +0000 (09:39 +0000)
committerkrzsas <krzsas@gmail.com>
Fri, 11 Jan 2008 09:39:56 +0000 (09:39 +0000)
git-svn-id: file:///svnroot/mdictionary/trunk@230 5bde0345-f819-0410-ac75-e5045f9217cc

src/gui/include/ws_gui.h
src/gui/include/ws_gui_callbacks.h
src/gui/include/ws_gui_layout.h
src/gui/src/ws_gui.c
src/gui/src/ws_gui_callbacks.c
src/gui/src/ws_gui_layout.c

index 4b45cc8..3b7d0bd 100644 (file)
@@ -17,6 +17,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 Copyright 2006 ComArch S.A.
 *******************************************************************************/
+/** \addtogroup GUI
+ */
+/*@{*/
+/** \file ws_gui.h
+ * \brief Definitions of structures used by ws_gui.c
+ *
+ * \author Anna Gadomska \<anna.gadomska\@comarch.com\>
+ * \date 05-11-2007
+ * \version 1.0.0
+ */
 #ifndef _WS_GUI
 #define _WS_GUI 
 
index 06b9e08..32a24ba 100644 (file)
@@ -17,6 +17,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 Copyright 2006 ComArch S.A.
 *******************************************************************************/
+/** \addtogroup GUI
+ */
+/*@{*/
+/** \file ws_gui_callbacks.h
+ * \brief Declaration of structures used by ws_gui_callbacks.c
+ *
+ * \author Anna Gadomska \<anna.gadomska\@comarch.com\>
+ * \date 05-11-2007
+ * \version 1.0.0
+ */
 #ifndef _WS_GUI_CALLBACKS
 #define _WS_GUI_CALLBACKS 
 
index ed4509a..d829047 100644 (file)
@@ -17,6 +17,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 Copyright 2006 ComArch S.A.
 *******************************************************************************/
+/** \addtogroup GUI
+ */
+/*@{*/
+/** \file ws_gui_layout.h
+ * \brief Definitions of structures used by ws_gui_layout.c
+ *
+ * \author Anna Gadomska \<anna.gadomska\@comarch.com\>
+ * \date 05-11-2007
+ * \version 1.0.0
+ */
 #ifndef _WS_GUI_LAYOUT
 #define _WS_GUI_LAYOUT
 
index b5ecb1a..16b7349 100644 (file)
@@ -17,6 +17,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 Copyright 2006 ComArch S.A.
 *******************************************************************************/
+/** \addtogroup GUI
+ */
+/*@{*/
+/** \file ws_gui.c
+ * \brief Main GUI file.
+ *
+ * GUI main loop and basic configuration of gui modules.
+ * \author Anna Gadomska \<anna.gadomska\@comarch.com\>
+ * \date 05-11-2007
+ * \version 1.0.0
+ */
+
 #include <ws_gui.h>
 #include <ws_gui_callbacks.h>
 #include <ws_gui_layout.h>
@@ -46,23 +58,23 @@ int main(int argc, char *argv[])
        WSGuiApp *ws_gui_app;
        ws_gui_app = (WSGuiApp*)g_malloc(sizeof(WSGuiApp)); 
 
-       //memory allocation
+       /*memory allocation*/
        ws_gui_app->ws_gui_w_list = 
                (struct WSGuiList*)g_malloc(sizeof(struct WSGuiList));
        ws_gui_app->ws_gui_menu = 
                (struct WSGuiMenu*)g_malloc(sizeof(struct WSGuiMenu));
 
-       //gconf
+       /*gconf*/
        ws_gui_app->client = gconf_client_get_default();
 
        ws_gui_create_window(ws_gui_app);
        ws_gui_read_adjustment(ws_gui_app);
 
 
-       //dbus wrapper 
+       /*dbus wrapper*/
        ws_gui_app->dbus_data = ws_dbus_create ("mdictionaryGui", "v1.0");
 
-       //dbus wrapper configuration
+       /*dbus wrapper configuration*/
        ws_dbus_config (ws_gui_app->dbus_data, 
                        WS_DBUS_CONFIG_SERVICE,
                        GUI_SERVICE);
@@ -135,7 +147,7 @@ int main(int argc, char *argv[])
                        "signal",
                        ws_gui_signal_hander,
                        ws_gui_app);
-       //hisa
+       /*hisa*/
        ws_dbus_set_cb (ws_gui_app->dbus_data,
                        "search_home_applet",
                        ws_gui_search_home_handler,
@@ -143,12 +155,12 @@ int main(int argc, char *argv[])
 
        ws_dbus_connect (ws_gui_app->dbus_data);
 
-       //setting the clipboard
+       /*setting the clipboard*/
        ws_gui_app->ws_gui_clipboard = 
                gtk_widget_get_clipboard (GTK_WIDGET(ws_gui_app->ws_gui_html),
                                        GDK_SELECTION_CLIPBOARD);
 
-       //connecting the signals
+       /*connecting the signals*/
        g_signal_connect(G_OBJECT (ws_gui_app->ws_gui_w_list->ws_gui_view),
                        "cursor-changed",
                        G_CALLBACK (ws_gui_view_cursor_changed), 
index f8bb8bf..de1230a 100644 (file)
@@ -17,6 +17,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 Copyright 2006 ComArch S.A.
 *******************************************************************************/
+/** \addtogroup GUI
+ */
+/*@{*/
+/** \file ws_gui_callbacks.c
+ * \brief Declaration of GUI callback handler functions.
+ *
+ * Callbacks for GUI elements
+ * \author Anna Gadomska \<anna.gadomska\@comarch.com\>
+ * \date 05-11-2007
+ * \version 1.0.0
+ */
+
 #include <ws_gui_callbacks.h>
 #include <ws_gui.h>
 #include <ws_gui_layout.h>
index 3d11a81..02fe33f 100644 (file)
@@ -17,6 +17,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 Copyright 2006 ComArch S.A.
 *******************************************************************************/
+/** \addtogroup GUI
+ */
+/*@{*/
+/** \file ws_gui_layout.c
+ * \brief GUI layout definitions
+ *
+ * Defines the way GUI dialogues look
+ * \author Anna Gadomska \<anna.gadomska\@comarch.com\>
+ * \date 05-11-2007
+ * \version 1.0.0
+ */
+
 #include <ws_gui_layout.h>
 #include <ws_gui.h>
 #include <ws_gui_callbacks.h>
@@ -37,8 +49,8 @@ void ws_gui_create_window(gpointer user_data)
                                   _("ws_ni_welcome"), "<br><IMG SRC=file:/usr/share/pixmaps/mdictionary.png>", 
                                   NULL);
 
-//     ws_gui_app->ws_gui_w_list->ws_gui_list_item_data_string = 
-//                                                  (ws_gui_app->welcome_note);
+/*     ws_gui_app->ws_gui_w_list->ws_gui_list_item_data_string = 
+                                                    (ws_gui_app->welcome_note);*/
 
        GArray *array_tmp = g_array_new (TRUE, TRUE, sizeof(gchar*));
        ws_gui_app->raw_translation = g_string_new(" ");
@@ -46,19 +58,31 @@ void ws_gui_create_window(gpointer user_data)
        ws_gui_app->last_searched_in_book = NULL;
        ws_gui_app->last_word = NULL;
 
+       /*indicates that searching banner is displayed*/
        ws_gui_app->ws_gui_banner_flag = FALSE;
+       /*indicates full screen mode*/
        ws_gui_app->ws_gui_full_screen_flag = FALSE;
+       /*indicates that caching is in progress*/
        ws_gui_app->caching_flag = FALSE;
+       /*used for doubleclick recognition*/
        ws_gui_app->ws_gui_double_click = FALSE;
+       /*indicates a that a piece of text is selected*/
        ws_gui_app->ws_gui_sel_flag = FALSE;
+       /*indicates whether bookmark mode is active or not*/
        ws_gui_app->bookmark_mode = FALSE;
+       /*indicates if bookmarks database is available*/
        ws_gui_app->bookmark_avail = TRUE;
+       /*indicates that no translation has been found*/
        ws_gui_app->html_flag = TRUE;
+       /*indicates loading banner is displayed*/
        ws_gui_app->loading = FALSE;
+       /*differentiates between tap and hold and ordinary tap*/
        ws_gui_app->stop_clicked = FALSE;
-       ws_gui_app->first_run = TRUE; //if dictionary is just run
+       /*if dictionary is just run*/
+       ws_gui_app->first_run = TRUE; 
+       /*indicates that no words match a given search pattern*/
        ws_gui_app->no_words_found = TRUE;
-
+       
        ws_gui_app->zoom = ZOOM_DEFAULT;
 
        ws_gui_app->timer = g_timer_new();