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-2008 ComArch S.A. 00019 *******************************************************************************/ 00029 00036 #ifndef _WS_MANAGER 00037 #define _WS_MANAGER 00038 00039 #include <dictionary_engine.h> 00040 #include <glib-object.h> 00041 #include <gmodule.h> 00042 #include <ws_services.h> 00043 #include <ws_dbus.h> 00044 00045 #ifdef __cplusplus 00046 extern "C" { 00047 #endif 00048 00056 #if SQLITE==0 00057 #define LIBRARY "/usr/lib/libsqlite.so.0" 00058 #elif SQLITE==3 00059 #define LIBRARY "/usr/lib/libsqlite3.so.0" 00060 #endif 00061 00068 #define g_strlen(string) ( NULL == (string) ? 0 : strlen(string) ) 00069 00070 struct _WSMngSearchData; 00071 typedef struct _WSMngSearchData WSMngSearchData; 00072 00074 WSMngSearchData* ws_manager_create(); 00075 00077 void ws_mng_init_dbus (WSMngSearchData *data); 00078 00080 void ws_mng_init (WSMngSearchData *data); 00081 00083 void ws_mng_close (WSMngSearchData *data); 00084 00086 gboolean ws_mng_start_main_loop(WSMngSearchData* serach_data); 00087 00092 struct _WSMngSearchData 00093 { 00094 WSDBusData* dbus_data; 00097 GMainLoop* loop; 00100 GArray* modules; 00104 Engine* bookmark; 00107 GArray* dict; 00111 gchar* word; 00114 GArray* word_list; 00117 gchar* trans; 00120 gchar* last_search; 00123 gboolean search_in_history; 00126 /* thread connected data 00127 * added by Dariusz Wiechecki 00128 * we are moving to GLib threads */ 00129 GStaticMutex* action_working; 00133 GStaticMutex* thread_creation; 00137 GStaticRecMutex* action_stop; 00141 /* --- pthread structures are not needed anymore: 00142 * pthread_t p_thread; 00143 * pthread_t p_thread_trans; 00144 */ 00145 00146 GArray* library_path; 00149 GArray* libraries; 00152 gboolean bookmark_mode; 00155 GModule* bookmark_library; 00157 }; 00158 00159 00160 00161 #ifdef __cplusplus 00162 } 00163 #endif 00164 #endif 00165