clarifying changes in DBUS api
authorkrzsas <krzsas@gmail.com>
Fri, 23 Mar 2007 08:48:20 +0000 (08:48 +0000)
committerkrzsas <krzsas@gmail.com>
Fri, 23 Mar 2007 08:48:20 +0000 (08:48 +0000)
git-svn-id: file:///svnroot/mdictionary/trunk@108 5bde0345-f819-0410-ac75-e5045f9217cc

include/ws_dbus.h
src/dbus_wrapper/Doxyfile
src/dbus_wrapper/src/ws_dbus.c
src/gui/src/ws_gui_layout.c
src/manager/src/ws_manager.c

index 6cab554..f56cd7c 100644 (file)
@@ -136,7 +136,7 @@ setting some basic parameters.
 */
 WSDBusData * ws_dbus_create (gchar *name, gchar *version);
 
-/**\brief This function is used for setting dbus service/client parameters.
+/**\brief This function is used for setting dbus server/client parameters.
 *
 *These include the addresses of both remote and local apps communicating
 *@param ws_dbus_data - pointer to a structure uniquely identifying 
@@ -155,7 +155,7 @@ WSDBusStatus ws_dbus_config (WSDBusData * ws_dbus_data,
 /**
 *\brief Initialize D-BUS communication.
 *
-*It should be the called after <B>ws_dbus_create</B> and after setting all D-BUS
+*It should be called after <B>ws_dbus_create</B> and after setting all D-BUS
  parameters with the <B>ws_dbus_config</B> function. 
 *The structure it returns is necessary to call out every function implemented in
  this wrapper library.
@@ -305,95 +305,57 @@ application for DBus
 WSDBusStatus ws_dbus_server_return_translations (WSDBusData * ws_dbus_data,
                                                  gchar * translation);
 
-/**
-*This function is used for returning the list of translations the parsing thread       
-*finds. It should be ran after the *last thread finishes the search, because it 
-also   
-*signalizes the GUI that the search has finished.
+/**\brief Returns the progress of an operation.
 *
+*It's used to inform a GUI progressbar about the progress
 *@param ws_dbus_data - pointer to a structure uniquely identifying the 
 application for DBus
-*@param translation - a string containing the word's translation
+*@param progress - a double containing the progress. It cannot exceed 1.
 *@return WS_STATUS_OK - on success \n
 *WS_STATUS_ERROR - on error
 */
 
-/** \brief Sends an address of data to transmit
+WSDBusStatus ws_dbus_server_update_progressbar (WSDBusData * ws_dbus_data,
+                                         double progress);
+
+/**\brief It's used to search for words, that have recently been searched for
 *
-*Function used in order to increase the speed of data transmission. 
-For now it's been added just for testing purposes.
-*The goal is to use the main advantage of threads, that is memory sharing. 
-If <I>GUI</I> and <I>MANAGER</I> are in the
-*same memory area, the data pointers also stay in the same memory area.
 *@param ws_dbus_data - pointer to a structure uniquely identifying the 
 application for DBus
-*@param method - name of the method of the remote object to call
-*@param data_address - address of the data
+*@param word - a word.
 *@return WS_STATUS_OK - on success \n
 *WS_STATUS_ERROR - on error
 */
 
-WSDBusStatus ws_dbus_send_ptrtodata (WSDBusData * ws_dbus_data,
-                                     gchar *method,
-                                     gulong data_address);
-
-/**\brief Splits the data from buffer generated by ::ws_dbus_concat_data
-*
-*Function used in order to increase the speed of data transmission. 
-For now it's been added just for testing purposes.
-*It ommits the limit of D-BUS message fields in one message.
-*@param buffer - pointer to strings concatenated by ws_dbus_concat_data
-*@return GArray of strings
-*/
-
-GArray * ws_dbus_split_data (gpointer buffer);
-
-/**\brief Concatenates data from a GArray to one long buffer ::ws_dbus_split_data
-*
-*Function used in order to increase the speed of data transmission. 
-For now it's been added just for testing purposes.
-*It ommits the limit of D-BUS message fields in one message.
-*@param garray - a GArray to be concatenated
-*@return pointer to a buffer
-*/
-
-gpointer ws_dbus_concat_data (GArray *garray);
-
-WSDBusStatus ws_dbus_update_progressbar (WSDBusData * ws_dbus_data,
-                                         double progress);
-
 WSDBusStatus ws_dbus_client_search_in_history (WSDBusData * ws_dbus_data,
                                                gchar * word);
 
-/**\brief Add bookmark
+/**\brief Bookmark a given word
 *
-*This is run by <I>GUI</I>. When a user selects a word from the words list, 
-this function is called in order 
-*to find the translation of the selected word. 
+*The given word is stored by the manager in a bookmark's database
 *
 *@param ws_dbus_data - pointer to a structure uniquely identifying the 
 application for DBus
-*@param word - a word, for which the user wishes to find the translation
+*@param word - a word to bookmark
+*@param word - a word's translation
 *@return WS_STATUS_OK - on success \n
 *WS_STATUS_ERROR - on error
 */
 
-WSDBusStatus ws_dbus_add_bookmark (WSDBusData * ws_dbus_data, gchar * word, gchar *translation);
+WSDBusStatus ws_dbus_client_add_bookmark (WSDBusData * ws_dbus_data, gchar * word, gchar *translation);
 
 /**\brief Remove a bookmark
 *
-*This is run by <I>GUI</I>. When a user selects a word from the words list, 
-this function is called in order 
-*to find the translation of the selected word. 
+*The given word is removed from the bookmark's database
 *
 *@param ws_dbus_data - pointer to a structure uniquely identifying the 
 application for DBus
-*@param word - a word, for which the user wishes to find the translation
+*@param word - a word to remove from bookmarks
 *@return WS_STATUS_OK - on success \n
 *WS_STATUS_ERROR - on error
 */
 
-WSDBusStatus ws_dbus_remove_bookmark (WSDBusData * ws_dbus_data, gchar * word);
+WSDBusStatus ws_dbus_client_remove_bookmark (WSDBusData * ws_dbus_data, gchar * word);
 
 /**\brief Send a message for GUI to display it
 *
@@ -408,14 +370,37 @@ application for DBus
 *WS_STATUS_ERROR - on error
 */
 
-WSDBusStatus ws_dbus_send_message (WSDBusData* ws_dbus_data, gchar * word);
+WSDBusStatus ws_dbus_server_send_message (WSDBusData* ws_dbus_data, gchar * word);
+
 
-WSDBusStatus ws_dbus_extract_dictionary(WSDBusData* ws_dbus_data, 
+/**\brief Tells the manager to extract a given file
+*
+*This is run by <I>GUI</I>. It allows for decompressing dictionaries
+*compressed with bzip2.
+*
+*@param ws_dbus_data - pointer to a structure uniquely identifying the 
+application for DBus
+*@param path - a path to the file to decompress
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*/
+WSDBusStatus ws_dbus_client_extract_dictionary(WSDBusData* ws_dbus_data, 
                                        gchar* path);
 
+/**\brief Informs the GUI that the selected file has been extracted
+*
+*This is run by <I>MANAGER</I>.
+*
+*@param ws_dbus_data - pointer to a structure uniquely identifying the 
+application for DBus
+*@param path - a path to the decompressed files
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*/
 WSDBusStatus ws_dbus_server_return_extracted_dict(WSDBusData* ws_dbus_data, 
                                        gchar* path);
 
+
 #ifdef __cplusplus
 }
 #endif
index fc998bf..27787aa 100644 (file)
@@ -459,7 +459,7 @@ WARN_LOGFILE           =
 # directories like "/usr/src/myproject". Separate the files or directories 
 # with spaces.
  
-INPUT                  = src/ws_dbus.c ../include/ws_dbus.h
+INPUT                  = ../../include/ws_dbus.h
  
 # If the value of the INPUT tag contains directories, you can use the 
 # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
index bcfaf50..b2fbcfb 100644 (file)
@@ -806,7 +806,7 @@ GArray * ws_dbus_split_data (gpointer buffer)
         return garray;
 };
 
-WSDBusStatus ws_dbus_update_progressbar (WSDBusData * ws_dbus_data,
+WSDBusStatus ws_dbus_server_update_progressbar (WSDBusData * ws_dbus_data,
                                          double progress)
 
 {
@@ -848,7 +848,7 @@ WSDBusStatus ws_dbus_update_progressbar (WSDBusData * ws_dbus_data,
         return WS_DBUS_STATUS_OK;
 };
 
-WSDBusStatus ws_dbus_add_bookmark (WSDBusData * ws_dbus_data, gchar * word, gchar *translation)
+WSDBusStatus ws_dbus_client_add_bookmark (WSDBusData * ws_dbus_data, gchar * word, gchar *translation)
 
 {
         osso_return_t result;
@@ -891,7 +891,7 @@ WSDBusStatus ws_dbus_add_bookmark (WSDBusData * ws_dbus_data, gchar * word, gcha
         return WS_DBUS_STATUS_OK;
 };
 
-WSDBusStatus ws_dbus_remove_bookmark (WSDBusData * ws_dbus_data, gchar * word)
+WSDBusStatus ws_dbus_client_remove_bookmark (WSDBusData * ws_dbus_data, gchar * word)
 
 {
         osso_return_t result;
@@ -932,7 +932,7 @@ WSDBusStatus ws_dbus_remove_bookmark (WSDBusData * ws_dbus_data, gchar * word)
         return WS_DBUS_STATUS_OK;
 };
 
-WSDBusStatus ws_dbus_send_message (WSDBusData * ws_dbus_data, gchar * word)
+WSDBusStatus ws_dbus_server_send_message (WSDBusData * ws_dbus_data, gchar * word)
 
 {
         osso_return_t result;
@@ -973,7 +973,7 @@ WSDBusStatus ws_dbus_send_message (WSDBusData * ws_dbus_data, gchar * word)
         return WS_DBUS_STATUS_OK;
 };
 
-WSDBusStatus ws_dbus_extract_dictionary(WSDBusData * ws_dbus_data, 
+WSDBusStatus ws_dbus_client_extract_dictionary(WSDBusData * ws_dbus_data, 
                                        gchar* path)
 
 {
index 1f3e831..766b54c 100644 (file)
@@ -1187,7 +1187,7 @@ void ws_gui_dictionary_loader(GtkMenuItem *menuitem, gpointer user_data)
                else if (g_str_has_suffix(name, ".bz2"))
                {
                        gtk_widget_destroy(dialog);     
-                       ws_dbus_extract_dictionary(ws_gui_app->dbus_data, filename);
+                       ws_dbus_client_extract_dictionary(ws_gui_app->dbus_data, filename);
                }
                 else
                 {
@@ -1615,7 +1615,7 @@ void ws_gui_add_bookmark_dialog(gpointer user_data)
        if (gtk_dialog_run(GTK_DIALOG(dialog1)) == GTK_RESPONSE_OK)
        {
                book_word = gtk_entry_get_text(GTK_ENTRY(entry1));
-               ws_dbus_add_bookmark(ws_gui_app->dbus_data, 
+               ws_dbus_client_add_bookmark(ws_gui_app->dbus_data, 
                                     (gchar*)book_word, 
                                     ws_gui_app->raw_translation->str);
                gtk_widget_destroy(GTK_WIDGET(dialog1));
@@ -1679,7 +1679,7 @@ void ws_gui_remove_bookmark_dialog(gpointer user_data)
                gtk_widget_destroy(GTK_WIDGET(dialog1));
                gchar* tmp;
                
-               ws_dbus_remove_bookmark(ws_gui_app->dbus_data, 
+               ws_dbus_client_remove_bookmark(ws_gui_app->dbus_data, 
                                        ws_gui_app->last_word);
 
                ws_gui_fill_html(" ", ws_gui_app);
index f05c647..7f76a13 100644 (file)
@@ -183,7 +183,7 @@ static void ws_mng_progress_bar(double progress,
         //g_debug("->%s", __FUNCTION__);
         WSMngSearchData *data = (WSMngSearchData *) user_data;
         //return progress of caching to user interface
-        ws_dbus_update_progressbar(data->dbus_data, progress); 
+        ws_dbus_server_update_progressbar(data->dbus_data, progress); 
         //g_debug("<-%s", __FUNCTION__);
 }