diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunetgtk_common.h | 74 | ||||
-rw-r--r-- | src/include/plibc.h | 10 |
2 files changed, 42 insertions, 42 deletions
diff --git a/src/include/gnunetgtk_common.h b/src/include/gnunetgtk_common.h index ce04f283..30c2a27d 100644 --- a/src/include/gnunetgtk_common.h +++ b/src/include/gnunetgtk_common.h | |||
@@ -24,8 +24,8 @@ | |||
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #ifndef GTKUI_HELPER_H | 27 | #ifndef GNUNET_GTK_COMMON_H |
28 | #define GTKUI_HELPER_H | 28 | #define GNUNET_GTK_COMMON_H |
29 | 29 | ||
30 | #include <gtk/gtk.h> | 30 | #include <gtk/gtk.h> |
31 | #include <gtk/gtktext.h> | 31 | #include <gtk/gtktext.h> |
@@ -34,38 +34,38 @@ | |||
34 | #define DEBUG_GTK 0 | 34 | #define DEBUG_GTK 0 |
35 | 35 | ||
36 | #if DEBUG_GTK | 36 | #if DEBUG_GTK |
37 | #define DEBUG_BEGIN() fprintf(stderr, "BEGIN of %s\n", __FUNCTION__) | 37 | #define GNUNET_GTK_DEBUG_BEGIN() fprintf(stderr, "BEGIN of %s\n", __FUNCTION__) |
38 | #define DEBUG_MARK() fprintf(stderr, "AT %s:%d\n", __FILE__, __LINE__) | 38 | #define GNUNET_GTK_DEBUG_MARK() fprintf(stderr, "AT %s:%d\n", __FILE__, __LINE__) |
39 | #define DEBUG_END() fprintf(stderr, "END of %s\n", __FUNCTION__) | 39 | #define GNUNET_GTK_DEBUG_END() fprintf(stderr, "END of %s\n", __FUNCTION__) |
40 | #else | 40 | #else |
41 | #define DEBUG_BEGIN() | 41 | #define GNUNET_GTK_DEBUG_BEGIN() |
42 | #define DEBUG_MARK() | 42 | #define GNUNET_GTK_DEBUG_MARK() |
43 | #define DEBUG_END() | 43 | #define GNUNET_GTK_DEBUG_END() |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | void initGNUnetGTKCommon (struct GE_Context *ectx, | 46 | void GNUNET_GTK_initialize_common_library (struct GNUNET_GEContext *ectx, |
47 | struct GC_Configuration *cfg, void *callback); | 47 | struct GNUNET_GC_Configuration *cfg, void *callback); |
48 | 48 | ||
49 | void shutdownPlugins (void); | 49 | void GNUNET_GTK_shutdown_plugins (void); |
50 | 50 | ||
51 | void doneGNUnetGTKCommon (void); | 51 | void GNUNET_GTK_shutdown_common_library (void); |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * Get the name of the main glade file for gnunet-gtk. | 54 | * Get the name of the main glade file for gnunet-gtk. |
55 | */ | 55 | */ |
56 | const char *getGladeFileName (void); | 56 | const char *GNUNET_GTK_get_glade_filename (void); |
57 | 57 | ||
58 | /** | 58 | /** |
59 | * Get the GladeXML for the main window of gnunet-gtk. | 59 | * Get the GladeXML for the main window of gnunet-gtk. |
60 | */ | 60 | */ |
61 | GladeXML *getMainXML (void); | 61 | GladeXML *GNUNET_GTK_get_main_glade_XML (void); |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * Appends a message to the info window | 64 | * Appends a message to the info window |
65 | * @param doPopup if GNUNET_YES, the info window will | 65 | * @param doPopup if GNUNET_YES, the info window will |
66 | * be opened | 66 | * be opened |
67 | */ | 67 | */ |
68 | void infoMessage (int doPopup, const char *format, ...); | 68 | void GNUNET_GTK_show_info_message (int doPopup, const char *format, ...); |
69 | 69 | ||
70 | /** | 70 | /** |
71 | * Appends a log entry to the info window | 71 | * Appends a log entry to the info window |
@@ -74,16 +74,25 @@ void infoMessage (int doPopup, const char *format, ...); | |||
74 | * | 74 | * |
75 | * @param txt the log entry | 75 | * @param txt the log entry |
76 | */ | 76 | */ |
77 | void addLogEntry (const char *txt, ...); | 77 | void GNUNET_GTK_add_log_entry (const char *txt, ...); |
78 | 78 | ||
79 | struct GE_Context *createGtkLogger (GE_KIND mask); | 79 | struct GNUNET_GEContext *GNUNET_GTK_create_gtk_logger (GNUNET_GEKIND mask); |
80 | |||
81 | #define GNUNET_GTK_NOTIFY_LEVEL_LOW 0 | ||
82 | #define GNUNET_GTK_NOTIFY_LEVEL_NORMAL 1 | ||
83 | #define GNUNET_GTK_NOTIFY_LEVEL_CRITICAL 2 | ||
84 | |||
85 | /** | ||
86 | * Sends a message to libnotify | ||
87 | */ | ||
88 | void GNUNET_GTK_notify (int type, const char *message, ...); | ||
80 | 89 | ||
81 | /** | 90 | /** |
82 | * Call a callback function from the mainloop/main thread ("SaveCall"). | 91 | * Call a callback function from the mainloop/main thread ("SaveCall"). |
83 | * Since GTK doesn't work with multi-threaded applications under Windows, | 92 | * Since GTK doesn't work with multi-threaded applications under Windows, |
84 | * all GTK operations have to be done in the main thread | 93 | * all GTK operations have to be done in the main thread |
85 | */ | 94 | */ |
86 | void *gtkSaveCall (GNUNET_ThreadMainFunction func, void *arg); | 95 | void *GNUNET_GTK_save_call (GNUNET_ThreadMainFunction func, void *arg); |
87 | 96 | ||
88 | /** | 97 | /** |
89 | * Run the given "cb" function and save calls | 98 | * Run the given "cb" function and save calls |
@@ -91,57 +100,48 @@ void *gtkSaveCall (GNUNET_ThreadMainFunction func, void *arg); | |||
91 | * keep save calls going while something else | 100 | * keep save calls going while something else |
92 | * happens). | 101 | * happens). |
93 | */ | 102 | */ |
94 | void *run_with_save_calls (GNUNET_ThreadMainFunction cb, void *arg); | 103 | void *GNUNET_GTK_run_with_save_calls (GNUNET_ThreadMainFunction cb, void *arg); |
95 | 104 | ||
96 | /** | 105 | /** |
97 | * Bind handlers defined by the various | 106 | * Bind handlers defined by the various |
98 | * plugins to the signals defined by the | 107 | * plugins to the signals defined by the |
99 | * Glade XML. | 108 | * Glade XML. |
100 | */ | 109 | */ |
101 | void connectGladeWithPlugins (GladeXML * xml); | 110 | void GNUNET_GTK_connect_glade_with_plugins (GladeXML * xml); |
102 | |||
103 | #define NOTIFY_LOW 0 | ||
104 | #define NOTIFY_NORMAL 1 | ||
105 | #define NOTIFY_CRITICAL 2 | ||
106 | |||
107 | /** | ||
108 | * Sends a message to libnotify | ||
109 | */ | ||
110 | void gnunetgtk_notify (int type, const char *message, ...); | ||
111 | 111 | ||
112 | /** | 112 | /** |
113 | * Validate that a string is a Utf-8 string. | 113 | * Validate that a string is a Utf-8 string. |
114 | * If validation fails, msg is freed and a valid | 114 | * If validation fails, msg is freed and a valid |
115 | * Utf-8 string is returned. | 115 | * Utf-8 string is returned. |
116 | */ | 116 | */ |
117 | char *validate_utf8 (char *msg); | 117 | char *GNUNET_GTK_validate_utf8 (char *msg); |
118 | 118 | ||
119 | /** | 119 | /** |
120 | * Gtk callback to save the main window state (tray icon use) | 120 | * Gtk callback to save the main window state (tray icon use) |
121 | */ | 121 | */ |
122 | void saveMainWindowState (GtkWidget * main_window, | 122 | void GNUNET_GTK_save_main_window_state (GtkWidget * main_window, |
123 | GdkEventWindowState * event, gpointer user_data); | 123 | GdkEventWindowState * event, gpointer user_data); |
124 | 124 | ||
125 | /** | 125 | /** |
126 | * Get the last main window state when restoring (tray icon use) | 126 | * Get the last main window state when restoring (tray icon use) |
127 | */ | 127 | */ |
128 | GdkWindowState getMainWindowState (void); | 128 | GdkWindowState GNUNET_GTK_get_main_window_state (void); |
129 | 129 | ||
130 | void gnunet_gtk_main_quit (void); | 130 | void GNUNET_GTK_main_quit (void); |
131 | 131 | ||
132 | /** | 132 | /** |
133 | * Start gnunet-setup, asking for a password if needed | 133 | * Start gnunet-setup, asking for a password if needed |
134 | * @param run_wizard TRUE to run the wizard, FALSE to run the complete tool | 134 | * @param run_wizard TRUE to run the wizard, FALSE to run the complete tool |
135 | * @returns FALSE if gnunet-setup was run, TRUE else | 135 | * @returns FALSE if gnunet-setup was run, TRUE else |
136 | */ | 136 | */ |
137 | gboolean startGNUnetSetup (gboolean run_wizard); | 137 | gboolean GNUNET_GTK_run_gnunet_setup (gboolean run_wizard); |
138 | 138 | ||
139 | /** | 139 | /** |
140 | * Identical to "gtk_tree_selection_selected_foreach", | 140 | * Identical to "gtk_tree_selection_selected_foreach", |
141 | * except that modifications of the underlying model | 141 | * except that modifications of the underlying model |
142 | * during the iteration are tolerated. | 142 | * during the iteration are tolerated. |
143 | */ | 143 | */ |
144 | void ggc_tree_selection_selected_foreach (GtkTreeSelection * selection, | 144 | void GNUNET_GTK_tree_selection_selected_foreach (GtkTreeSelection * selection, |
145 | GtkTreeSelectionForeachFunc func, | 145 | GtkTreeSelectionForeachFunc func, |
146 | gpointer data); | 146 | gpointer data); |
147 | 147 | ||
@@ -150,10 +150,10 @@ void ggc_tree_selection_selected_foreach (GtkTreeSelection * selection, | |||
150 | * except that modifications of the underlying model | 150 | * except that modifications of the underlying model |
151 | * during the iteration are tolerated. | 151 | * during the iteration are tolerated. |
152 | */ | 152 | */ |
153 | void ggc_tree_model_foreach (GtkTreeModel * model, | 153 | void GNUNET_GTK_tree_model_foreach (GtkTreeModel * model, |
154 | GtkTreeSelectionForeachFunc func, gpointer data); | 154 | GtkTreeSelectionForeachFunc func, gpointer data); |
155 | 155 | ||
156 | 156 | ||
157 | struct GNUNET_CronManager *gnunet_gtk_get_cron (void); | 157 | struct GNUNET_CronManager *GNUNET_GTK_get_cron_manager (void); |
158 | 158 | ||
159 | #endif | 159 | #endif |
diff --git a/src/include/plibc.h b/src/include/plibc.h index 2178dc76..d493121b 100644 --- a/src/include/plibc.h +++ b/src/include/plibc.h | |||
@@ -58,7 +58,7 @@ extern "C" | |||
58 | /* Conflicts with our definitions */ | 58 | /* Conflicts with our definitions */ |
59 | #define __G_WIN32_H__ | 59 | #define __G_WIN32_H__ |
60 | 60 | ||
61 | /* Convert LARGE_INTEGER to double */ | 61 | /* Convert LARGNUNET_GEINTEGER to double */ |
62 | #define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + \ | 62 | #define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + \ |
63 | (double)((x).LowPart)) | 63 | (double)((x).LowPart)) |
64 | 64 | ||
@@ -241,10 +241,10 @@ extern "C" | |||
241 | 241 | ||
242 | typedef struct | 242 | typedef struct |
243 | { | 243 | { |
244 | LARGE_INTEGER IdleTime; | 244 | LARGNUNET_GEINTEGER IdleTime; |
245 | LARGE_INTEGER KernelTime; | 245 | LARGNUNET_GEINTEGER KernelTime; |
246 | LARGE_INTEGER UserTime; | 246 | LARGNUNET_GEINTEGER UserTime; |
247 | LARGE_INTEGER Reserved1[2]; | 247 | LARGNUNET_GEINTEGER Reserved1[2]; |
248 | ULONG Reserved2; | 248 | ULONG Reserved2; |
249 | } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; | 249 | } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; |
250 | 250 | ||