aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunetgtk_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunetgtk_common.h')
-rw-r--r--src/include/gnunetgtk_common.h201
1 files changed, 0 insertions, 201 deletions
diff --git a/src/include/gnunetgtk_common.h b/src/include/gnunetgtk_common.h
deleted file mode 100644
index 099e1e41..00000000
--- a/src/include/gnunetgtk_common.h
+++ /dev/null
@@ -1,201 +0,0 @@
1/*
2 This file is part of GNUnet
3 (C) 2005, 2006, 2007 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21/**
22 * @file src/include/gnunetgtk_common.h
23 * @author Igor Wronsky
24 * @author Christian Grothoff
25 */
26
27#ifndef GNUNET_GTK_COMMON_H
28#define GNUNET_GTK_COMMON_H
29
30#include <gtk/gtk.h>
31#include <gtk/gtktext.h>
32#include <glade/glade.h>
33
34#define GNUNET_GTK_DEBUG_GTK 0
35
36#if GNUNET_GTK_DEBUG_GTK
37#define GNUNET_GTK_DEBUG_BEGIN() fprintf(stderr, "BEGIN of %s\n", __FUNCTION__)
38#define GNUNET_GTK_DEBUG_MARK() fprintf(stderr, "AT %s:%d\n", __FILE__, __LINE__)
39#define GNUNET_GTK_DEBUG_END() fprintf(stderr, "END of %s\n", __FUNCTION__)
40#else
41#define GNUNET_GTK_DEBUG_BEGIN()
42#define GNUNET_GTK_DEBUG_MARK()
43#define GNUNET_GTK_DEBUG_END()
44#endif
45
46
47void GNUNET_GTK_initialize_common_library (const char * ccfn,
48 struct GNUNET_GC_Configuration
49 *cfg, void *callback);
50
51void GNUNET_GTK_shutdown_plugins (void);
52
53void GNUNET_GTK_shutdown_common_library (void);
54
55const char *GNUNET_GTK_get_client_config_filename (void);
56
57/**
58 * Get the name of the main glade file for gnunet-gtk.
59 */
60const char *GNUNET_GTK_get_glade_filename (void);
61
62/**
63 * Get the GladeXML for the main window of gnunet-gtk.
64 */
65GladeXML *GNUNET_GTK_get_main_glade_XML (void);
66
67/**
68 * Get the GtkIconFactory for gnunet-gtk
69 */
70GtkIconFactory *GNUNET_GTK_get_iconFactory (void);
71
72/**
73 * Get the GtkStatusIcon for the tray icon (if GTK >= 2.10)
74 */
75#if GTK_CHECK_VERSION(2,10,0)
76GtkStatusIcon *GNUNET_GTK_get_trayIcon (void);
77#endif
78
79/**
80 * Appends a message to the info window
81 * @param doPopup if GNUNET_YES, the info window will
82 * be opened
83 */
84void GNUNET_GTK_show_info_message (const char *format, ...);
85
86/**
87 * Appends a log entry to the info window
88 * and update the statusbar to show this
89 * message (until the next call).
90 *
91 * @param txt the log entry
92 */
93void GNUNET_GTK_add_log_entry (const char *txt, ...);
94
95struct GNUNET_GE_Context *GNUNET_GTK_create_gtk_logger (GNUNET_GE_KIND mask);
96
97void GNUNET_GTK_shutdown_logger ();
98
99#define GNUNET_GTK_NOTIFY_LEVEL_LOW 0
100#define GNUNET_GTK_NOTIFY_LEVEL_NORMAL 1
101#define GNUNET_GTK_NOTIFY_LEVEL_CRITICAL 2
102
103typedef enum
104{
105 GNUNET_GTK_STATUS_NODAEMON,
106 GNUNET_GTK_STATUS_DAEMONUP,
107 GNUNET_GTK_STATUS_DISCONNECTED,
108 GNUNET_GTK_STATUS_CONNECTED,
109 GNUNET_GTK_STATUS_UNKNOWN
110} GNUNET_GTK_STATUS;
111
112/*
113 * Update the status bar indicator and the status icon
114 * about daemon and connexions status.
115 *
116 * @param status current status of gnunetd
117 * @param peers number of connected peers (with GNUNET_GTK_STATUS_CONNECTED)
118 */
119void
120GNUNET_GTK_display_daemon_status (GNUNET_GTK_STATUS status,
121 unsigned long long peers);
122
123/**
124 * Sends a message to libnotify
125 */
126void GNUNET_GTK_notify (int type, const char *message, ...);
127
128/**
129 * Call a callback function from the mainloop/main thread ("SaveCall").
130 * Since GTK doesn't work with multi-threaded applications
131 * all GTK operations have to be done in the main thread
132 */
133void *GNUNET_GTK_save_call (GNUNET_ThreadMainFunction func, void *arg);
134
135/**
136 * Run the given "cb" function and save calls
137 * in parallel (used within the event loop to
138 * keep save calls going while something else
139 * happens).
140 */
141void *GNUNET_GTK_run_with_save_calls (GNUNET_ThreadMainFunction cb,
142 void *arg);
143
144/**
145 * Bind handlers defined by the various
146 * plugins to the signals defined by the
147 * Glade XML.
148 */
149void GNUNET_GTK_connect_glade_with_plugins (GladeXML * xml);
150
151/**
152 * Validate that a string is a Utf-8 string.
153 * If validation fails, msg is freed and a valid
154 * Utf-8 string is returned.
155 */
156char *GNUNET_GTK_validate_utf8 (char *msg);
157
158/**
159 * Gtk callback to save the main window state (tray icon use)
160 */
161void GNUNET_GTK_save_main_window_state (GtkWidget * main_window,
162 GdkEventWindowState * event,
163 gpointer user_data);
164
165/**
166 * Get the last main window state when restoring (tray icon use)
167 */
168GdkWindowState GNUNET_GTK_get_main_window_state (void);
169
170void GNUNET_GTK_main_quit (void);
171
172/**
173 * Identical to "gtk_tree_selection_selected_foreach",
174 * except that modifications of the underlying model
175 * during the iteration are tolerated.
176 */
177void GNUNET_GTK_tree_selection_selected_foreach (GtkTreeSelection * selection,
178 GtkTreeSelectionForeachFunc
179 func, gpointer data);
180
181/**
182 * Identical to "gtk_tree_model_foreach",
183 * except that modifications of the underlying model
184 * during the iteration are tolerated.
185 */
186void GNUNET_GTK_tree_model_foreach (GtkTreeModel * model,
187 GtkTreeSelectionForeachFunc func,
188 gpointer data);
189
190
191struct GNUNET_CronManager *GNUNET_GTK_get_cron_manager (void);
192
193
194GtkWidget *GNUNET_GTK_extract_main_widget_from_window (GladeXML * xml,
195 const char
196 *windowName);
197
198
199
200
201#endif