From 0dbfccbf3824f1a30f550dd902d37058e62f6274 Mon Sep 17 00:00:00 2001 From: Antenore Gatta Date: Thu, 1 Jun 2023 13:02:31 +0000 Subject: Automatic doc build by remmina-ci --- public/plugin_8h_source.html | 14 ++++++------ public/remmina__log_8c.html | 28 ++++++++++++------------ public/remmina__log_8c_source.html | 30 +++++++++++++------------- public/remmina__log_8h.html | 20 ++++++++--------- public/remmina__log_8h_source.html | 20 ++++++++--------- public/remmina__plugin__manager_8c_source.html | 18 ++++++++-------- public/remmina__ssh_8c_source.html | 2 +- 7 files changed, 66 insertions(+), 66 deletions(-) diff --git a/public/plugin_8h_source.html b/public/plugin_8h_source.html index 240fbfd55..e344c5f04 100644 --- a/public/plugin_8h_source.html +++ b/public/plugin_8h_source.html @@ -118,7 +118,7 @@ $(document).ready(function(){initNavTree('plugin_8h_source.html','');});
const gchar * version
Definition: plugin.h:95
static PyObject * protocol_widget_get_current_scale_mode(PyRemminaProtocolWidget *self, PyObject *args)
static PyObject * protocol_widget_unlock_dynres(PyRemminaProtocolWidget *self, PyObject *args)
-
void _remmina_critical(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:381
+
void _remmina_critical(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:382
RemminaProtocolSSHSetting ssh_setting
Definition: plugin.h:76
struct _RemminaProtocolPlugin RemminaProtocolPlugin
static PyObject * protocol_widget_panel_show_listen(PyRemminaProtocolWidget *self, PyObject *args)
@@ -128,14 +128,14 @@ $(document).ready(function(){initNavTree('plugin_8h_source.html','');});
const RemminaProtocolFeature * features
Definition: plugin.h:77
const gchar * domain
Definition: plugin.h:60
-
void _remmina_warning(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:285
+
void _remmina_warning(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:286
static PyObject * protocol_widget_update_align(PyRemminaProtocolWidget *self, PyObject *args)
const gchar * domain
Definition: plugin.h:139
gboolean(* is_service_available)(struct _RemminaSecretPlugin *instance)
Definition: plugin.h:144
void(* delete_password)(struct _RemminaSecretPlugin *instance, RemminaFile *remminafile, const gchar *key)
Definition: plugin.h:147
const gchar * domain
Definition: plugin.h:94
const gchar * domain
Definition: plugin.h:128
-
void _remmina_audit(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:312
+
void _remmina_audit(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:313
RemminaScaleMode remmina_protocol_widget_get_current_scale_mode(RemminaProtocolWidget *gp)
const gchar * domain
Definition: plugin.h:104
RemminaPluginType type
Definition: plugin.h:151
@@ -147,7 +147,7 @@ $(document).ready(function(){initNavTree('plugin_8h_source.html','');});
const gchar * description
Definition: plugin.h:93
Definition: plugin.h:90
struct _RemminaToolPlugin RemminaToolPlugin
-
void _remmina_debug(const gchar *fun, const gchar *fmt,...)
Print a string in the Remmina Debug Windows and in the terminal.
Definition: remmina_log.c:258
+
void _remmina_debug(const gchar *fun, const gchar *fmt,...)
Print a string in the Remmina Debug Windows and in the terminal.
Definition: remmina_log.c:259
static PyObject * file_unsave_passwords(PyRemminaFile *self, PyObject *args)
const gchar * domain
Definition: plugin.h:154
static PyObject * protocol_widget_send_keys_signals(PyRemminaProtocolWidget *self, PyObject *args)
@@ -182,7 +182,7 @@ $(document).ready(function(){initNavTree('plugin_8h_source.html','');});
RemminaPluginType type
Definition: plugin.h:66
const gchar * name
Definition: plugin.h:116
static PyObject * protocol_widget_get_expand(PyRemminaProtocolWidget *self, PyObject *args)
-
void _remmina_info(const gchar *fmt,...)
Definition: remmina_log.c:205
+
void _remmina_info(const gchar *fmt,...)
Definition: remmina_log.c:206
Definition: types.h:116
gboolean(* RemminaPluginEntryFunc)(RemminaPluginService *service)
Definition: plugin.h:306
RemminaScaleMode
Definition: types.h:141
@@ -211,7 +211,7 @@ $(document).ready(function(){initNavTree('plugin_8h_source.html','');});
static PyObject * protocol_widget_panel_show(PyRemminaProtocolWidget *self, PyObject *args)
struct _RemminaPlugin RemminaPlugin
const gchar * icon_name
Definition: plugin.h:72
-
void _remmina_message(const gchar *fmt,...)
Definition: remmina_log.c:229
+
void _remmina_message(const gchar *fmt,...)
Definition: remmina_log.c:230
RemminaPluginType type
Definition: plugin.h:115
static PyObject * protocol_widget_panel_changed_certificate(PyRemminaProtocolWidget *self, PyObject *args)
Definition: plugin.h:52
@@ -221,7 +221,7 @@ $(document).ready(function(){initNavTree('plugin_8h_source.html','');});
Definition: plugin.h:165
const gchar * name
Definition: plugin.h:58
Definition: plugin.h:48
-
void _remmina_error(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:354
+
void _remmina_error(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:355
diff --git a/public/remmina__log_8c.html b/public/remmina__log_8c.html index 87de47968..9d707129c 100644 --- a/public/remmina__log_8c.html +++ b/public/remmina__log_8c.html @@ -221,7 +221,7 @@ Variables
-

Definition at line 312 of file remmina_log.c.

+

Definition at line 313 of file remmina_log.c.

@@ -257,7 +257,7 @@ Variables
-

Definition at line 381 of file remmina_log.c.

+

Definition at line 382 of file remmina_log.c.

@@ -296,7 +296,7 @@ Variables

Print a string in the Remmina Debug Windows and in the terminal.

The string will be visible in the terminal if G_MESSAGES_DEBUG=all Variadic function of REMMINA_DEBUG

-

Definition at line 258 of file remmina_log.c.

+

Definition at line 259 of file remmina_log.c.

@@ -332,7 +332,7 @@ Variables
-

Definition at line 354 of file remmina_log.c.

+

Definition at line 355 of file remmina_log.c.

@@ -362,7 +362,7 @@ Variables
-

Definition at line 205 of file remmina_log.c.

+

Definition at line 206 of file remmina_log.c.

@@ -392,7 +392,7 @@ Variables
-

Definition at line 229 of file remmina_log.c.

+

Definition at line 230 of file remmina_log.c.

@@ -428,7 +428,7 @@ Variables
-

Definition at line 285 of file remmina_log.c.

+

Definition at line 286 of file remmina_log.c.

@@ -510,7 +510,7 @@ Variables
-

Definition at line 425 of file remmina_log.c.

+

Definition at line 426 of file remmina_log.c.

@@ -530,7 +530,7 @@ Variables
-

Definition at line 196 of file remmina_log.c.

+

Definition at line 197 of file remmina_log.c.

@@ -558,7 +558,7 @@ Variables
-

Definition at line 180 of file remmina_log.c.

+

Definition at line 181 of file remmina_log.c.

@@ -588,7 +588,7 @@ Variables
-

Definition at line 410 of file remmina_log.c.

+

Definition at line 411 of file remmina_log.c.

@@ -608,7 +608,7 @@ Variables
-

Definition at line 161 of file remmina_log.c.

+

Definition at line 162 of file remmina_log.c.

@@ -636,7 +636,7 @@ Variables
-

Definition at line 167 of file remmina_log.c.

+

Definition at line 168 of file remmina_log.c.

@@ -770,7 +770,7 @@ Variables
-

Definition at line 444 of file remmina_log.c.

+

Definition at line 445 of file remmina_log.c.

diff --git a/public/remmina__log_8c_source.html b/public/remmina__log_8c_source.html index 5e22de773..2f67cf329 100644 --- a/public/remmina__log_8c_source.html +++ b/public/remmina__log_8c_source.html @@ -86,30 +86,30 @@ $(document).ready(function(){initNavTree('remmina__log_8c_source.html','');});
remmina_log.c
-Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2010 Vic Lee
4  * Copyright (C) 2014-2015 Antenore Gatta, Fabio Castelli, Giovanni Panozzo
5  * Copyright (C) 2016-2023 Antenore Gatta, Giovanni Panozzo
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  * In addition, as a special exception, the copyright holders give
23  * permission to link the code of portions of this program with the
24  * OpenSSL library under certain conditions as described in each
25  * individual source file, and distribute linked combinations
26  * including the two.
27  * You must obey the GNU General Public License in all respects
28  * for all of the code used other than OpenSSL. * If you modify
29  * file(s) with this exception, you may extend this exception to your
30  * version of the file(s), but you are not obligated to do so. * If you
31  * do not wish to do so, delete this exception statement from your
32  * version. * If you delete this exception statement from all source
33  * files in the program, then also delete it here.
34  *
35  */
36 
37 #include <gtk/gtk.h>
38 #include <glib/gi18n.h>
39 #include "remmina_public.h"
40 #include "remmina_pref.h"
41 #include "remmina_log.h"
42 #include "remmina_stats.h"
44 
45 gboolean logstart;
46 
47 /***** Define the log window GUI *****/
48 #define REMMINA_TYPE_LOG_WINDOW (remmina_log_window_get_type())
49 #define REMMINA_LOG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), REMMINA_TYPE_LOG_WINDOW, RemminaLogWindow))
50 #define REMMINA_LOG_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), REMMINA_TYPE_LOG_WINDOW, RemminaLogWindowClass))
51 #define REMMINA_IS_LOG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), REMMINA_TYPE_LOG_WINDOW))
52 #define REMMINA_IS_LOG_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), REMMINA_TYPE_LOG_WINDOW))
53 #define REMMINA_LOG_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), REMMINA_TYPE_LOG_WINDOW, RemminaLogWindowClass))
54 
55 typedef struct _RemminaLogWindow {
56  GtkWindow window;
57 
58  GtkWidget *log_view;
59  GtkTextBuffer *log_buffer;
61 
62 typedef struct _RemminaLogWindowClass {
63  GtkWindowClass parent_class;
65 
67 G_GNUC_CONST;
68 
69 G_DEFINE_TYPE(RemminaLogWindow, remmina_log_window, GTK_TYPE_WINDOW)
70 
71 void remmina_log_stats()
72 {
73  TRACE_CALL(__func__);
74  JsonNode *n;
75 
77  if (n != NULL) {
78 
79  JsonGenerator *g = json_generator_new();
80  json_generator_set_pretty (g, TRUE);
81  json_generator_set_root(g, n);
82  json_node_unref(n);
83  g_autofree gchar *s = json_generator_to_data(g, NULL); // s=serialized stats
84  REMMINA_DEBUG("STATS: JSON data%s\n", s);
85  g_object_unref(g);
86  }
87 }
88 
90 {
91  TRACE_CALL(__func__);
92 }
93 
94 /* We will always only have one log window per instance */
95 static GtkWidget *log_window = NULL;
96 
97 static GtkWidget*
99 {
100  TRACE_CALL(__func__);
101  return GTK_WIDGET(g_object_new(REMMINA_TYPE_LOG_WINDOW, NULL));
102 }
103 
104 static void remmina_log_end(GtkWidget *widget, gpointer data)
105 {
106  TRACE_CALL(__func__);
107  log_window = NULL;
108 }
109 
110 static void remmina_log_start_stop (GtkSwitch *logswitch, gpointer user_data)
111 {
112  TRACE_CALL(__func__);
113  logstart = !logstart;
114 }
115 
117 {
118  TRACE_CALL(__func__);
119  if (log_window) {
120  gtk_window_present(GTK_WINDOW(log_window));
121  }else {
123  gtk_window_set_default_size(GTK_WINDOW(log_window), 640, 480);
124  gtk_window_set_resizable (GTK_WINDOW(log_window), TRUE);
125  gtk_window_set_decorated (GTK_WINDOW(log_window), TRUE);
126 
127  /* Header bar */
128  GtkWidget *header = gtk_header_bar_new ();
129  gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (header), TRUE);
130  gtk_header_bar_set_title (GTK_HEADER_BAR (header), _("Remmina debugging window"));
131  gtk_header_bar_set_has_subtitle (GTK_HEADER_BAR (header), FALSE);
132  /* Stats */
133  GtkWidget *getstat = gtk_button_new ();
134  gtk_widget_set_tooltip_text (getstat, _("Paste system info in the Remmina debugging window"));
135  GIcon *icon = g_themed_icon_new ("edit-paste-symbolic");
136  GtkWidget *image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_BUTTON);
137  g_object_unref (icon);
138  gtk_container_add (GTK_CONTAINER (getstat), image);
139  gtk_header_bar_pack_start (GTK_HEADER_BAR (header), getstat);
140  /* Start logging */
141  GtkWidget *start = gtk_switch_new ();
142  logstart = TRUE;
143  gtk_switch_set_active (GTK_SWITCH(start), logstart);
144  gtk_header_bar_pack_start (GTK_HEADER_BAR (header), start);
145 
146  gtk_window_set_titlebar (GTK_WINDOW (log_window), header);
147 
148  g_signal_connect(getstat, "button-press-event", G_CALLBACK(remmina_log_stats), NULL);
149  g_signal_connect(start, "notify::active", G_CALLBACK(remmina_log_start_stop), NULL);
150  g_signal_connect(G_OBJECT(log_window), "destroy", G_CALLBACK(remmina_log_end), NULL);
151  gtk_widget_show_all(log_window);
152  }
153 
154  remmina_log_print(_("This window can help you find connection problems.\n"
155  "You can stop and start the logging at any moment using the On/Off switch.\n"
156  "The stats button (Ctrl+T), can be useful to gather system info you may share when reporting a bug.\n"
157  "There is more info about debugging Remmina on https://gitlab.com/Remmina/Remmina/-/wikis/Usage/Remmina-debugging\n"
158  ));
159 }
160 
161 gboolean remmina_log_running(void)
162 {
163  TRACE_CALL(__func__);
164  return (log_window != NULL);
165 }
166 
167 static gboolean remmina_log_scroll_to_end(gpointer data)
168 {
169  TRACE_CALL(__func__);
170  GtkTextIter iter;
171 
172  if (log_window) {
173  gtk_text_buffer_get_end_iter(REMMINA_LOG_WINDOW(log_window)->log_buffer, &iter);
174  gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(REMMINA_LOG_WINDOW(log_window)->log_view), &iter, 0.0, FALSE, 0.0,
175  0.0);
176  }
177  return FALSE;
178 }
179 
180 static gboolean remmina_log_print_real(gpointer data)
181 {
182  TRACE_CALL(__func__);
183  GtkTextIter iter;
184 
185  if (log_window && logstart) {
186  gtk_text_buffer_get_end_iter(REMMINA_LOG_WINDOW(log_window)->log_buffer, &iter);
187  gtk_text_buffer_insert(REMMINA_LOG_WINDOW(log_window)->log_buffer, &iter, (const gchar*)data, -1);
188  IDLE_ADD(remmina_log_scroll_to_end, NULL);
189  }
190  g_free(data);
191  return FALSE;
192 }
193 
194 // Only prints into Remmina's own debug window. (Not stdout!)
195 // See _remmina_{debug, info, error, critical, warning}
196 void remmina_log_print(const gchar *text)
197 {
198  TRACE_CALL(__func__);
199  if (!log_window)
200  return;
201 
202  IDLE_ADD(remmina_log_print_real, g_strdup(text));
203 }
204 
205 void _remmina_info(const gchar *fmt, ...)
206 {
207  TRACE_CALL(__func__);
208 
209  va_list args;
210  g_autofree gchar *text;
211  va_start(args, fmt);
212  text = g_strdup_vprintf(fmt, args);
213  va_end(args);
214 
215  // always appends newline
216  g_info ("%s", text);
217 
218  g_autofree gchar *buf_tmp = g_strconcat(text, "\n", NULL);
219  /* freed in remmina_log_print_real */
220  gchar *bufn = g_strconcat("(INFO) - ", buf_tmp, NULL);
221 
222  if (!log_window) {
223  free(bufn);
224  return;
225  }
226  IDLE_ADD(remmina_log_print_real, bufn);
227 }
228 
229 void _remmina_message(const gchar *fmt, ...)
230 {
231  TRACE_CALL(__func__);
232 
233  va_list args;
234  g_autofree gchar *text;
235  va_start(args, fmt);
236  text = g_strdup_vprintf(fmt, args);
237  va_end(args);
238 
239  // always appends newline
240  g_message ("%s", text);
241 
242  if (!log_window) {
243  return;
244  }
245 
246  g_autofree gchar *buf_tmp = g_strconcat(text, "\n", NULL);
247  /* freed in remmina_log_print_real */
248  gchar *bufn = g_strconcat("(MESSAGE) - ", buf_tmp, NULL);
249 
250  IDLE_ADD(remmina_log_print_real, bufn);
251 }
252 
258 void _remmina_debug(const gchar *fun, const gchar *fmt, ...)
259 {
260  TRACE_CALL(__func__);
261 
262  va_list args;
263  gchar *text;
264  va_start(args, fmt);
265  text = g_strdup_vprintf(fmt, args);
266  va_end(args);
267 
268  g_autofree gchar *buf = g_strconcat("(", fun, ") - ", text, NULL);
269  g_free(text);
270 
271  // always appends newline
272  g_debug ("%s", buf);
273 
274  if (!log_window) {
275  return;
276  }
277 
278  g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL);
279  /* freed in remmina_log_print_real */
280  gchar *bufn = g_strconcat("(DEBUG) - ", buf_tmp, NULL);
281 
282  IDLE_ADD(remmina_log_print_real, bufn);
283 }
284 
285 void _remmina_warning(const gchar *fun, const gchar *fmt, ...)
286 {
287  TRACE_CALL(__func__);
288 
289  va_list args;
290  gchar *text;
291  va_start(args, fmt);
292  text = g_strdup_vprintf(fmt, args);
293  va_end(args);
294 
295  g_autofree gchar *buf = g_strconcat("(", fun, ") - ", text, NULL);
296  g_free(text);
297 
298  // always appends newline
299  g_warning ("%s", buf);
300 
301  if (!log_window) {
302  return;
303  }
304 
305  g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL);
306  /* freed in remmina_log_print_real */
307  gchar *bufn = g_strconcat("(WARN) - ", buf_tmp, NULL);
308 
309  IDLE_ADD(remmina_log_print_real, bufn);
310 }
311 
312 void _remmina_audit(const gchar *fun, const gchar *fmt, ...)
313 {
314  TRACE_CALL(__func__);
315  va_list args;
316  va_start(args, fmt);
317  gchar *text = g_strdup_vprintf(fmt, args);
318  va_end(args);
319 
320 #if GLIB_CHECK_VERSION(2,62,0)
321  GDateTime* tv = g_date_time_new_now_local();
322  gchar *isodate = g_date_time_format_iso8601(tv);
323  g_date_time_unref(tv);
324 #else
325  GTimeVal tv;
326  g_get_current_time(&tv);
327  gchar *isodate = g_time_val_to_iso8601(&tv);
328 #endif
329 
330  g_autofree gchar *buf = g_strdup("");
331 
332  if (isodate) {
333 
334  buf = g_strconcat(
335  "[", isodate, "] - ",
336  g_get_host_name (),
337  " - ",
338  g_get_user_name (),
339  " - ",
340  text,
341  NULL);
342 
343  }
344 
345  g_free(text);
346  if (remmina_pref_get_boolean("audit"))
347  _remmina_message(buf);
348  else
349  _remmina_debug(fun, buf);
350 }
351 
352 // !!! Calling this function will crash Remmina !!!
353 // !!! purposefully and send a trap signal !!!
354 void _remmina_error(const gchar *fun, const gchar *fmt, ...)
355 {
356  TRACE_CALL(__func__);
357 
358  va_list args;
359  gchar *text;
360  va_start(args, fmt);
361  text = g_strdup_vprintf(fmt, args);
362  va_end(args);
363 
364  g_autofree gchar *buf = g_strconcat("(", fun, ") - ", text, NULL);
365  g_free(text);
366 
367  // always appends newline
368  g_error ("%s", buf);
369 
370  if (!log_window) {
371  return;
372  }
373 
374  g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL);
375  /* freed in remmina_log_print_real */
376  gchar *bufn = g_strconcat("(ERROR) - ", buf_tmp, NULL);
377 
378  IDLE_ADD(remmina_log_print_real, bufn);
379 }
380 
381 void _remmina_critical(const gchar *fun, const gchar *fmt, ...)
382 {
383  TRACE_CALL(__func__);
384 
385  va_list args;
386  gchar *text;
387  va_start(args, fmt);
388  text = g_strdup_vprintf(fmt, args);
389  va_end(args);
390 
391  g_autofree gchar *buf = g_strconcat("(", fun, ") - ", text, NULL);
392  g_free(text);
393 
394  // always appends newline
395  g_critical ("%s", buf);
396 
397  if (!log_window) {
398  return;
399  }
400 
401  g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL);
402  /* freed in remmina_log_print_real */
403  gchar *bufn = g_strconcat("(CRIT) - ", buf_tmp, NULL);
404 
405  IDLE_ADD(remmina_log_print_real, bufn);
406 }
407 
408 // Only prints into Remmina's own debug window. (Not stdout!)
409 // See _remmina_{message, info, debug warning, error, critical}
410 void remmina_log_printf(const gchar *fmt, ...)
411 {
412  TRACE_CALL(__func__);
413  va_list args;
414  gchar *text;
415 
416  if (!log_window) return;
417 
418  va_start(args, fmt);
419  text = g_strdup_vprintf(fmt, args);
420  va_end(args);
421 
422  IDLE_ADD(remmina_log_print_real, text);
423 }
424 
425 static gboolean remmina_log_on_keypress(GtkWidget *widget, GdkEvent *event, gpointer user_data)
426 {
427  TRACE_CALL(__func__);
428 
429  if (!log_window)
430  return FALSE;
431 
432  GdkEventKey *e = (GdkEventKey *)event;
433 
434  if ((e->state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK) {
435  if (e->keyval == GDK_KEY_t) {
436  remmina_log_stats();
437  }
438  return TRUE;
439  }
440 
441  return FALSE;
442 }
443 
445 {
446  TRACE_CALL(__func__);
447  GtkWidget *scrolledwindow;
448  GtkWidget *widget;
449 
450  gtk_container_set_border_width(GTK_CONTAINER(logwin), 4);
451 
452  scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
453  gtk_widget_show(scrolledwindow);
454  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
455  gtk_container_add(GTK_CONTAINER(logwin), scrolledwindow);
456 
457  widget = gtk_text_view_new();
458  gtk_widget_show(widget);
459  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(widget), GTK_WRAP_WORD_CHAR);
460  gtk_text_view_set_editable(GTK_TEXT_VIEW(widget), FALSE);
461  gtk_text_view_set_monospace(GTK_TEXT_VIEW(widget), TRUE);
462  gtk_container_add(GTK_CONTAINER(scrolledwindow), widget);
463  logwin->log_view = widget;
464  logwin->log_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
465 
466  g_signal_connect(G_OBJECT(logwin->log_view), "key-press-event", G_CALLBACK(remmina_log_on_keypress), (gpointer)logwin);
467 }
468 
void remmina_log_start(void)
Definition: remmina_log.c:116
+Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2010 Vic Lee
4  * Copyright (C) 2014-2015 Antenore Gatta, Fabio Castelli, Giovanni Panozzo
5  * Copyright (C) 2016-2023 Antenore Gatta, Giovanni Panozzo
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  * In addition, as a special exception, the copyright holders give
23  * permission to link the code of portions of this program with the
24  * OpenSSL library under certain conditions as described in each
25  * individual source file, and distribute linked combinations
26  * including the two.
27  * You must obey the GNU General Public License in all respects
28  * for all of the code used other than OpenSSL. * If you modify
29  * file(s) with this exception, you may extend this exception to your
30  * version of the file(s), but you are not obligated to do so. * If you
31  * do not wish to do so, delete this exception statement from your
32  * version. * If you delete this exception statement from all source
33  * files in the program, then also delete it here.
34  *
35  */
36 
37 #include <gtk/gtk.h>
38 #include <glib/gi18n.h>
39 #include "remmina_public.h"
40 #include "remmina_pref.h"
41 #include "remmina_log.h"
42 #include "remmina_stats.h"
44 
45 gboolean logstart;
46 
47 /***** Define the log window GUI *****/
48 #define REMMINA_TYPE_LOG_WINDOW (remmina_log_window_get_type())
49 #define REMMINA_LOG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), REMMINA_TYPE_LOG_WINDOW, RemminaLogWindow))
50 #define REMMINA_LOG_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), REMMINA_TYPE_LOG_WINDOW, RemminaLogWindowClass))
51 #define REMMINA_IS_LOG_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), REMMINA_TYPE_LOG_WINDOW))
52 #define REMMINA_IS_LOG_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), REMMINA_TYPE_LOG_WINDOW))
53 #define REMMINA_LOG_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), REMMINA_TYPE_LOG_WINDOW, RemminaLogWindowClass))
54 
55 typedef struct _RemminaLogWindow {
56  GtkWindow window;
57 
58  GtkWidget *log_view;
59  GtkTextBuffer *log_buffer;
61 
62 typedef struct _RemminaLogWindowClass {
63  GtkWindowClass parent_class;
65 
67 G_GNUC_CONST;
68 
69 G_DEFINE_TYPE(RemminaLogWindow, remmina_log_window, GTK_TYPE_WINDOW)
70 
71 void remmina_log_stats()
72 {
73  TRACE_CALL(__func__);
74  JsonNode *n;
75 
77  if (n != NULL) {
78 
79  JsonGenerator *g = json_generator_new();
80  json_generator_set_pretty (g, TRUE);
81  json_generator_set_root(g, n);
82  json_node_unref(n);
83  g_autofree gchar *s = json_generator_to_data(g, NULL); // s=serialized stats
84  REMMINA_DEBUG("STATS: JSON data%s\n", s);
85  g_object_unref(g);
86  }
87 }
88 
90 {
91  TRACE_CALL(__func__);
92 }
93 
94 /* We will always only have one log window per instance */
95 static GtkWidget *log_window = NULL;
96 
97 static GtkWidget*
99 {
100  TRACE_CALL(__func__);
101  return GTK_WIDGET(g_object_new(REMMINA_TYPE_LOG_WINDOW, NULL));
102 }
103 
104 static void remmina_log_end(GtkWidget *widget, gpointer data)
105 {
106  TRACE_CALL(__func__);
107  log_window = NULL;
108 }
109 
110 static void remmina_log_start_stop (GtkSwitch *logswitch, gpointer user_data)
111 {
112  TRACE_CALL(__func__);
113  logstart = !logstart;
114 }
115 
117 {
118  TRACE_CALL(__func__);
119  if (log_window) {
120  gtk_window_present(GTK_WINDOW(log_window));
121  }else {
123  gtk_window_set_default_size(GTK_WINDOW(log_window), 640, 480);
124  gtk_window_set_resizable (GTK_WINDOW(log_window), TRUE);
125  gtk_window_set_decorated (GTK_WINDOW(log_window), TRUE);
126 
127  /* Header bar */
128  GtkWidget *header = gtk_header_bar_new ();
129  gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (header), TRUE);
130  gtk_header_bar_set_title (GTK_HEADER_BAR (header), _("Remmina debugging window"));
131  gtk_header_bar_set_has_subtitle (GTK_HEADER_BAR (header), FALSE);
132  /* Stats */
133  GtkWidget *getstat = gtk_button_new ();
134  gtk_widget_set_tooltip_text (getstat, _("Paste system info in the Remmina debugging window"));
135  GIcon *icon = g_themed_icon_new ("edit-paste-symbolic");
136  GtkWidget *image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_BUTTON);
137  g_object_unref (icon);
138  gtk_container_add (GTK_CONTAINER (getstat), image);
139  gtk_header_bar_pack_start (GTK_HEADER_BAR (header), getstat);
140  /* Start logging */
141  GtkWidget *start = gtk_switch_new ();
142  logstart = TRUE;
143  gtk_switch_set_active (GTK_SWITCH(start), logstart);
144  gtk_widget_set_valign (start, GTK_ALIGN_CENTER);
145  gtk_header_bar_pack_start (GTK_HEADER_BAR (header), start);
146 
147  gtk_window_set_titlebar (GTK_WINDOW (log_window), header);
148 
149  g_signal_connect(getstat, "button-press-event", G_CALLBACK(remmina_log_stats), NULL);
150  g_signal_connect(start, "notify::active", G_CALLBACK(remmina_log_start_stop), NULL);
151  g_signal_connect(G_OBJECT(log_window), "destroy", G_CALLBACK(remmina_log_end), NULL);
152  gtk_widget_show_all(log_window);
153  }
154 
155  remmina_log_print(_("This window can help you find connection problems.\n"
156  "You can stop and start the logging at any moment using the On/Off switch.\n"
157  "The stats button (Ctrl+T), can be useful to gather system info you may share when reporting a bug.\n"
158  "There is more info about debugging Remmina on https://gitlab.com/Remmina/Remmina/-/wikis/Usage/Remmina-debugging\n"
159  ));
160 }
161 
162 gboolean remmina_log_running(void)
163 {
164  TRACE_CALL(__func__);
165  return (log_window != NULL);
166 }
167 
168 static gboolean remmina_log_scroll_to_end(gpointer data)
169 {
170  TRACE_CALL(__func__);
171  GtkTextIter iter;
172 
173  if (log_window) {
174  gtk_text_buffer_get_end_iter(REMMINA_LOG_WINDOW(log_window)->log_buffer, &iter);
175  gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(REMMINA_LOG_WINDOW(log_window)->log_view), &iter, 0.0, FALSE, 0.0,
176  0.0);
177  }
178  return FALSE;
179 }
180 
181 static gboolean remmina_log_print_real(gpointer data)
182 {
183  TRACE_CALL(__func__);
184  GtkTextIter iter;
185 
186  if (log_window && logstart) {
187  gtk_text_buffer_get_end_iter(REMMINA_LOG_WINDOW(log_window)->log_buffer, &iter);
188  gtk_text_buffer_insert(REMMINA_LOG_WINDOW(log_window)->log_buffer, &iter, (const gchar*)data, -1);
189  IDLE_ADD(remmina_log_scroll_to_end, NULL);
190  }
191  g_free(data);
192  return FALSE;
193 }
194 
195 // Only prints into Remmina's own debug window. (Not stdout!)
196 // See _remmina_{debug, info, error, critical, warning}
197 void remmina_log_print(const gchar *text)
198 {
199  TRACE_CALL(__func__);
200  if (!log_window)
201  return;
202 
203  IDLE_ADD(remmina_log_print_real, g_strdup(text));
204 }
205 
206 void _remmina_info(const gchar *fmt, ...)
207 {
208  TRACE_CALL(__func__);
209 
210  va_list args;
211  g_autofree gchar *text;
212  va_start(args, fmt);
213  text = g_strdup_vprintf(fmt, args);
214  va_end(args);
215 
216  // always appends newline
217  g_info ("%s", text);
218 
219  g_autofree gchar *buf_tmp = g_strconcat(text, "\n", NULL);
220  /* freed in remmina_log_print_real */
221  gchar *bufn = g_strconcat("(INFO) - ", buf_tmp, NULL);
222 
223  if (!log_window) {
224  free(bufn);
225  return;
226  }
227  IDLE_ADD(remmina_log_print_real, bufn);
228 }
229 
230 void _remmina_message(const gchar *fmt, ...)
231 {
232  TRACE_CALL(__func__);
233 
234  va_list args;
235  g_autofree gchar *text;
236  va_start(args, fmt);
237  text = g_strdup_vprintf(fmt, args);
238  va_end(args);
239 
240  // always appends newline
241  g_message ("%s", text);
242 
243  if (!log_window) {
244  return;
245  }
246 
247  g_autofree gchar *buf_tmp = g_strconcat(text, "\n", NULL);
248  /* freed in remmina_log_print_real */
249  gchar *bufn = g_strconcat("(MESSAGE) - ", buf_tmp, NULL);
250 
251  IDLE_ADD(remmina_log_print_real, bufn);
252 }
253 
259 void _remmina_debug(const gchar *fun, const gchar *fmt, ...)
260 {
261  TRACE_CALL(__func__);
262 
263  va_list args;
264  gchar *text;
265  va_start(args, fmt);
266  text = g_strdup_vprintf(fmt, args);
267  va_end(args);
268 
269  g_autofree gchar *buf = g_strconcat("(", fun, ") - ", text, NULL);
270  g_free(text);
271 
272  // always appends newline
273  g_debug ("%s", buf);
274 
275  if (!log_window) {
276  return;
277  }
278 
279  g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL);
280  /* freed in remmina_log_print_real */
281  gchar *bufn = g_strconcat("(DEBUG) - ", buf_tmp, NULL);
282 
283  IDLE_ADD(remmina_log_print_real, bufn);
284 }
285 
286 void _remmina_warning(const gchar *fun, const gchar *fmt, ...)
287 {
288  TRACE_CALL(__func__);
289 
290  va_list args;
291  gchar *text;
292  va_start(args, fmt);
293  text = g_strdup_vprintf(fmt, args);
294  va_end(args);
295 
296  g_autofree gchar *buf = g_strconcat("(", fun, ") - ", text, NULL);
297  g_free(text);
298 
299  // always appends newline
300  g_warning ("%s", buf);
301 
302  if (!log_window) {
303  return;
304  }
305 
306  g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL);
307  /* freed in remmina_log_print_real */
308  gchar *bufn = g_strconcat("(WARN) - ", buf_tmp, NULL);
309 
310  IDLE_ADD(remmina_log_print_real, bufn);
311 }
312 
313 void _remmina_audit(const gchar *fun, const gchar *fmt, ...)
314 {
315  TRACE_CALL(__func__);
316  va_list args;
317  va_start(args, fmt);
318  gchar *text = g_strdup_vprintf(fmt, args);
319  va_end(args);
320 
321 #if GLIB_CHECK_VERSION(2,62,0)
322  GDateTime* tv = g_date_time_new_now_local();
323  gchar *isodate = g_date_time_format_iso8601(tv);
324  g_date_time_unref(tv);
325 #else
326  GTimeVal tv;
327  g_get_current_time(&tv);
328  gchar *isodate = g_time_val_to_iso8601(&tv);
329 #endif
330 
331  g_autofree gchar *buf = g_strdup("");
332 
333  if (isodate) {
334 
335  buf = g_strconcat(
336  "[", isodate, "] - ",
337  g_get_host_name (),
338  " - ",
339  g_get_user_name (),
340  " - ",
341  text,
342  NULL);
343 
344  }
345 
346  g_free(text);
347  if (remmina_pref_get_boolean("audit"))
348  _remmina_message(buf);
349  else
350  _remmina_debug(fun, buf);
351 }
352 
353 // !!! Calling this function will crash Remmina !!!
354 // !!! purposefully and send a trap signal !!!
355 void _remmina_error(const gchar *fun, const gchar *fmt, ...)
356 {
357  TRACE_CALL(__func__);
358 
359  va_list args;
360  gchar *text;
361  va_start(args, fmt);
362  text = g_strdup_vprintf(fmt, args);
363  va_end(args);
364 
365  g_autofree gchar *buf = g_strconcat("(", fun, ") - ", text, NULL);
366  g_free(text);
367 
368  // always appends newline
369  g_error ("%s", buf);
370 
371  if (!log_window) {
372  return;
373  }
374 
375  g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL);
376  /* freed in remmina_log_print_real */
377  gchar *bufn = g_strconcat("(ERROR) - ", buf_tmp, NULL);
378 
379  IDLE_ADD(remmina_log_print_real, bufn);
380 }
381 
382 void _remmina_critical(const gchar *fun, const gchar *fmt, ...)
383 {
384  TRACE_CALL(__func__);
385 
386  va_list args;
387  gchar *text;
388  va_start(args, fmt);
389  text = g_strdup_vprintf(fmt, args);
390  va_end(args);
391 
392  g_autofree gchar *buf = g_strconcat("(", fun, ") - ", text, NULL);
393  g_free(text);
394 
395  // always appends newline
396  g_critical ("%s", buf);
397 
398  if (!log_window) {
399  return;
400  }
401 
402  g_autofree gchar *buf_tmp = g_strconcat(buf, "\n", NULL);
403  /* freed in remmina_log_print_real */
404  gchar *bufn = g_strconcat("(CRIT) - ", buf_tmp, NULL);
405 
406  IDLE_ADD(remmina_log_print_real, bufn);
407 }
408 
409 // Only prints into Remmina's own debug window. (Not stdout!)
410 // See _remmina_{message, info, debug warning, error, critical}
411 void remmina_log_printf(const gchar *fmt, ...)
412 {
413  TRACE_CALL(__func__);
414  va_list args;
415  gchar *text;
416 
417  if (!log_window) return;
418 
419  va_start(args, fmt);
420  text = g_strdup_vprintf(fmt, args);
421  va_end(args);
422 
423  IDLE_ADD(remmina_log_print_real, text);
424 }
425 
426 static gboolean remmina_log_on_keypress(GtkWidget *widget, GdkEvent *event, gpointer user_data)
427 {
428  TRACE_CALL(__func__);
429 
430  if (!log_window)
431  return FALSE;
432 
433  GdkEventKey *e = (GdkEventKey *)event;
434 
435  if ((e->state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK) {
436  if (e->keyval == GDK_KEY_t) {
437  remmina_log_stats();
438  }
439  return TRUE;
440  }
441 
442  return FALSE;
443 }
444 
446 {
447  TRACE_CALL(__func__);
448  GtkWidget *scrolledwindow;
449  GtkWidget *widget;
450 
451  gtk_container_set_border_width(GTK_CONTAINER(logwin), 4);
452 
453  scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
454  gtk_widget_show(scrolledwindow);
455  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
456  gtk_container_add(GTK_CONTAINER(logwin), scrolledwindow);
457 
458  widget = gtk_text_view_new();
459  gtk_widget_show(widget);
460  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(widget), GTK_WRAP_WORD_CHAR);
461  gtk_text_view_set_editable(GTK_TEXT_VIEW(widget), FALSE);
462  gtk_text_view_set_monospace(GTK_TEXT_VIEW(widget), TRUE);
463  gtk_container_add(GTK_CONTAINER(scrolledwindow), widget);
464  logwin->log_view = widget;
465  logwin->log_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
466 
467  g_signal_connect(G_OBJECT(logwin->log_view), "key-press-event", G_CALLBACK(remmina_log_on_keypress), (gpointer)logwin);
468 }
469 
void remmina_log_start(void)
Definition: remmina_log.c:116
gboolean logstart
Definition: remmina_log.c:45
GtkWindow window
Definition: remmina_log.c:56
-
void _remmina_critical(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:381
+
void _remmina_critical(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:382
static void remmina_log_start_stop(GtkSwitch *logswitch, gpointer user_data)
Definition: remmina_log.c:110
-
void _remmina_warning(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:285
-
void _remmina_audit(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:312
-
static gboolean remmina_log_print_real(gpointer data)
Definition: remmina_log.c:180
+
void _remmina_warning(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:286
+
void _remmina_audit(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:313
+
static gboolean remmina_log_print_real(gpointer data)
Definition: remmina_log.c:181
struct _RemminaLogWindowClass RemminaLogWindowClass
-
static gboolean remmina_log_scroll_to_end(gpointer data)
Definition: remmina_log.c:167
-
void _remmina_debug(const gchar *fun, const gchar *fmt,...)
Print a string in the Remmina Debug Windows and in the terminal.
Definition: remmina_log.c:258
+
static gboolean remmina_log_scroll_to_end(gpointer data)
Definition: remmina_log.c:168
+
void _remmina_debug(const gchar *fun, const gchar *fmt,...)
Print a string in the Remmina Debug Windows and in the terminal.
Definition: remmina_log.c:259
GtkTextBuffer * log_buffer
Definition: remmina_log.c:59
-
gboolean remmina_log_running(void)
Definition: remmina_log.c:161
+
gboolean remmina_log_running(void)
Definition: remmina_log.c:162
GtkWidget * log_view
Definition: remmina_log.c:58
G_DEFINE_TYPE(RemminaConnectionWindow, rcw, GTK_TYPE_WINDOW)
Definition: rcw.c:81
gboolean remmina_pref_get_boolean(const gchar *key)
-
static void remmina_log_window_init(RemminaLogWindow *logwin)
Definition: remmina_log.c:444
-
void _remmina_info(const gchar *fmt,...)
Definition: remmina_log.c:205
-
static gboolean remmina_log_on_keypress(GtkWidget *widget, GdkEvent *event, gpointer user_data)
Definition: remmina_log.c:425
+
static void remmina_log_window_init(RemminaLogWindow *logwin)
Definition: remmina_log.c:445
+
void _remmina_info(const gchar *fmt,...)
Definition: remmina_log.c:206
+
static gboolean remmina_log_on_keypress(GtkWidget *widget, GdkEvent *event, gpointer user_data)
Definition: remmina_log.c:426
GType remmina_log_window_get_type(void)
Definition: remmina_log.c:66
static GtkWidget * remmina_log_window_new(void)
Definition: remmina_log.c:98
@@ -117,12 +117,12 @@ $(document).ready(function(){initNavTree('remmina__log_8c_source.html','');});
struct _RemminaLogWindow RemminaLogWindow
static GtkWidget * log_window
Definition: remmina_log.c:95
-
void remmina_log_printf(const gchar *fmt,...)
Definition: remmina_log.c:410
+
void remmina_log_printf(const gchar *fmt,...)
Definition: remmina_log.c:411
static void remmina_log_window_class_init(RemminaLogWindowClass *klass)
Definition: remmina_log.c:89
-
void remmina_log_print(const gchar *text)
Definition: remmina_log.c:196
-
void _remmina_message(const gchar *fmt,...)
Definition: remmina_log.c:229
+
void remmina_log_print(const gchar *text)
Definition: remmina_log.c:197
+
void _remmina_message(const gchar *fmt,...)
Definition: remmina_log.c:230
static void remmina_log_end(GtkWidget *widget, gpointer data)
Definition: remmina_log.c:104
-
void _remmina_error(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:354
+
void _remmina_error(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:355
GtkWindowClass parent_class
Definition: remmina_log.c:63
diff --git a/public/remmina__log_8h.html b/public/remmina__log_8h.html index 78f66ddc9..b336b4262 100644 --- a/public/remmina__log_8h.html +++ b/public/remmina__log_8h.html @@ -150,7 +150,7 @@ Functions
-

Definition at line 312 of file remmina_log.c.

+

Definition at line 313 of file remmina_log.c.

@@ -186,7 +186,7 @@ Functions
-

Definition at line 381 of file remmina_log.c.

+

Definition at line 382 of file remmina_log.c.

@@ -225,7 +225,7 @@ Functions

Print a string in the Remmina Debug Windows and in the terminal.

The string will be visible in the terminal if G_MESSAGES_DEBUG=all Variadic function of REMMINA_DEBUG

-

Definition at line 258 of file remmina_log.c.

+

Definition at line 259 of file remmina_log.c.

@@ -261,7 +261,7 @@ Functions
-

Definition at line 354 of file remmina_log.c.

+

Definition at line 355 of file remmina_log.c.

@@ -291,7 +291,7 @@ Functions
-

Definition at line 205 of file remmina_log.c.

+

Definition at line 206 of file remmina_log.c.

@@ -321,7 +321,7 @@ Functions
-

Definition at line 229 of file remmina_log.c.

+

Definition at line 230 of file remmina_log.c.

@@ -357,7 +357,7 @@ Functions
-

Definition at line 285 of file remmina_log.c.

+

Definition at line 286 of file remmina_log.c.

@@ -377,7 +377,7 @@ Functions
-

Definition at line 196 of file remmina_log.c.

+

Definition at line 197 of file remmina_log.c.

@@ -407,7 +407,7 @@ Functions
-

Definition at line 410 of file remmina_log.c.

+

Definition at line 411 of file remmina_log.c.

@@ -427,7 +427,7 @@ Functions
-

Definition at line 161 of file remmina_log.c.

+

Definition at line 162 of file remmina_log.c.

diff --git a/public/remmina__log_8h_source.html b/public/remmina__log_8h_source.html index 0e074fcd6..8e9475ed5 100644 --- a/public/remmina__log_8h_source.html +++ b/public/remmina__log_8h_source.html @@ -86,17 +86,17 @@ $(document).ready(function(){initNavTree('remmina__log_8h_source.html','');});
remmina_log.h
-Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2010 Vic Lee
4  * Copyright (C) 2017-2023 Antenore Gatta, Giovanni Panozzo
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * In addition, as a special exception, the copyright holders give
22  * permission to link the code of portions of this program with the
23  * OpenSSL library under certain conditions as described in each
24  * individual source file, and distribute linked combinations
25  * including the two.
26  * You must obey the GNU General Public License in all respects
27  * for all of the code used other than OpenSSL. * If you modify
28  * file(s) with this exception, you may extend this exception to your
29  * version of the file(s), but you are not obligated to do so. * If you
30  * do not wish to do so, delete this exception statement from your
31  * version. * If you delete this exception statement from all source
32  * files in the program, then also delete it here.
33  *
34  */
35 
36 #pragma once
37 
38 #include <stdarg.h>
39 #include <glib.h>
40 
41 G_BEGIN_DECLS
42 
43 #define REMMINA_INFO(fmt, ...) _remmina_info(fmt, ## __VA_ARGS__)
44 #define REMMINA_MESSAGE(fmt, ...) _remmina_message(fmt, ## __VA_ARGS__)
45 #define REMMINA_DEBUG(fmt, ...) _remmina_debug(__func__, fmt, ## __VA_ARGS__)
46 #define REMMINA_WARNING(fmt, ...) _remmina_warning(__func__, fmt, ## __VA_ARGS__)
47 #define REMMINA_AUDIT(fmt, ...) _remmina_audit(__func__, fmt, ## __VA_ARGS__)
48 #define REMMINA_ERROR(fmt, ...) _remmina_error(__func__, fmt, ## __VA_ARGS__)
49 #define REMMINA_CRITICAL(fmt, ...) _remmina_critical(__func__, fmt, ## __VA_ARGS__)
50 
51 void remmina_log_start(void);
52 gboolean remmina_log_running(void);
53 void remmina_log_print(const gchar *text);
54 void _remmina_info(const gchar *fmt, ...);
55 void _remmina_message(const gchar *fmt, ...);
56 void _remmina_debug(const gchar *fun, const gchar *fmt, ...);
57 void _remmina_warning(const gchar *fun, const gchar *fmt, ...);
58 void _remmina_audit(const gchar *fun, const gchar *fmt, ...);
59 void _remmina_error(const gchar *fun, const gchar *fmt, ...);
60 void _remmina_critical(const gchar *fun, const gchar *fmt, ...);
61 void remmina_log_printf(const gchar *fmt, ...);
62 
63 G_END_DECLS
void _remmina_error(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:354
-
void _remmina_warning(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:285
-
void _remmina_audit(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:312
-
void _remmina_message(const gchar *fmt,...)
Definition: remmina_log.c:229
-
void _remmina_debug(const gchar *fun, const gchar *fmt,...)
Print a string in the Remmina Debug Windows and in the terminal.
Definition: remmina_log.c:258
-
void _remmina_info(const gchar *fmt,...)
Definition: remmina_log.c:205
-
gboolean remmina_log_running(void)
Definition: remmina_log.c:161
+Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2010 Vic Lee
4  * Copyright (C) 2017-2023 Antenore Gatta, Giovanni Panozzo
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * In addition, as a special exception, the copyright holders give
22  * permission to link the code of portions of this program with the
23  * OpenSSL library under certain conditions as described in each
24  * individual source file, and distribute linked combinations
25  * including the two.
26  * You must obey the GNU General Public License in all respects
27  * for all of the code used other than OpenSSL. * If you modify
28  * file(s) with this exception, you may extend this exception to your
29  * version of the file(s), but you are not obligated to do so. * If you
30  * do not wish to do so, delete this exception statement from your
31  * version. * If you delete this exception statement from all source
32  * files in the program, then also delete it here.
33  *
34  */
35 
36 #pragma once
37 
38 #include <stdarg.h>
39 #include <glib.h>
40 
41 G_BEGIN_DECLS
42 
43 #define REMMINA_INFO(fmt, ...) _remmina_info(fmt, ## __VA_ARGS__)
44 #define REMMINA_MESSAGE(fmt, ...) _remmina_message(fmt, ## __VA_ARGS__)
45 #define REMMINA_DEBUG(fmt, ...) _remmina_debug(__func__, fmt, ## __VA_ARGS__)
46 #define REMMINA_WARNING(fmt, ...) _remmina_warning(__func__, fmt, ## __VA_ARGS__)
47 #define REMMINA_AUDIT(fmt, ...) _remmina_audit(__func__, fmt, ## __VA_ARGS__)
48 #define REMMINA_ERROR(fmt, ...) _remmina_error(__func__, fmt, ## __VA_ARGS__)
49 #define REMMINA_CRITICAL(fmt, ...) _remmina_critical(__func__, fmt, ## __VA_ARGS__)
50 
51 void remmina_log_start(void);
52 gboolean remmina_log_running(void);
53 void remmina_log_print(const gchar *text);
54 void _remmina_info(const gchar *fmt, ...);
55 void _remmina_message(const gchar *fmt, ...);
56 void _remmina_debug(const gchar *fun, const gchar *fmt, ...);
57 void _remmina_warning(const gchar *fun, const gchar *fmt, ...);
58 void _remmina_audit(const gchar *fun, const gchar *fmt, ...);
59 void _remmina_error(const gchar *fun, const gchar *fmt, ...);
60 void _remmina_critical(const gchar *fun, const gchar *fmt, ...);
61 void remmina_log_printf(const gchar *fmt, ...);
62 
63 G_END_DECLS
void _remmina_error(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:355
+
void _remmina_warning(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:286
+
void _remmina_audit(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:313
+
void _remmina_message(const gchar *fmt,...)
Definition: remmina_log.c:230
+
void _remmina_debug(const gchar *fun, const gchar *fmt,...)
Print a string in the Remmina Debug Windows and in the terminal.
Definition: remmina_log.c:259
+
void _remmina_info(const gchar *fmt,...)
Definition: remmina_log.c:206
+
gboolean remmina_log_running(void)
Definition: remmina_log.c:162
void remmina_log_start(void)
Definition: remmina_log.c:116
-
void _remmina_critical(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:381
-
void remmina_log_print(const gchar *text)
Definition: remmina_log.c:196
-
void remmina_log_printf(const gchar *fmt,...)
Definition: remmina_log.c:410
+
void _remmina_critical(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:382
+
void remmina_log_print(const gchar *text)
Definition: remmina_log.c:197
+
void remmina_log_printf(const gchar *fmt,...)
Definition: remmina_log.c:411
diff --git a/public/remmina__plugin__manager_8c_source.html b/public/remmina__plugin__manager_8c_source.html index 04b64a5b0..b27e2b1f1 100644 --- a/public/remmina__plugin__manager_8c_source.html +++ b/public/remmina__plugin__manager_8c_source.html @@ -129,7 +129,7 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
gchar * remmina_protocol_widget_get_domain(RemminaProtocolWidget *gp)
GtkWidget * rcw_open_from_file_full(RemminaFile *remminafile, GCallback disconnect_cb, gpointer data, guint *handler)
Definition: rcw.c:4499
void remmina_widget_pool_register(GtkWidget *widget)
-
void _remmina_critical(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:381
+
void _remmina_critical(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:382
Definition: types.h:101
int init_order
Definition: plugin.h:141
@@ -140,13 +140,13 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
RemminaFilePlugin * remmina_plugin_manager_get_export_file_handler(RemminaFile *remminafile)
const gchar * domain
Definition: plugin.h:60
-
void _remmina_warning(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:285
+
void _remmina_warning(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:286
RemminaFilePlugin * remmina_plugin_manager_get_import_file_handler(const gchar *file)
RemminaSecretPlugin * remmina_plugin_manager_get_secret_plugin(void)
gchar * remmina_protocol_widget_get_cacert(RemminaProtocolWidget *gp)
void remmina_protocol_widget_lock_dynres(RemminaProtocolWidget *gp)
gint remmina_protocol_widget_get_height(RemminaProtocolWidget *gp)
-
void _remmina_audit(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:312
+
void _remmina_audit(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:313
RemminaScaleMode remmina_protocol_widget_get_current_scale_mode(RemminaProtocolWidget *gp)
void remmina_protocol_widget_update_align(RemminaProtocolWidget *gp)
gint remmina_protocol_widget_panel_authx509(RemminaProtocolWidget *gp)
@@ -156,7 +156,7 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
const gchar * version
Definition: plugin.h:61
gboolean(* load)(struct _RemminaLanguageWrapperPlugin *instance, const gchar *plugin_file)
Definition: plugin.h:159
-
void _remmina_debug(const gchar *fun, const gchar *fmt,...)
Print a string in the Remmina Debug Windows and in the terminal.
Definition: remmina_log.c:258
+
void _remmina_debug(const gchar *fun, const gchar *fmt,...)
Print a string in the Remmina Debug Windows and in the terminal.
Definition: remmina_log.c:259
void remmina_protocol_widget_set_display(RemminaProtocolWidget *gp, gint display)
void remmina_protocol_widget_set_width(RemminaProtocolWidget *gp, gint width)
static gboolean remmina_plugin_manager_show_for_each(RemminaPlugin *plugin, GtkListStore *store)
@@ -194,7 +194,7 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
gchar * remmina_file_get_datadir(void)
Return datadir_path from pref or first found data dir as per XDG specs.
gboolean remmina_protocol_widget_ssh_exec(RemminaProtocolWidget *gp, gboolean wait, const gchar *fmt,...)
gchar * remmina_protocol_widget_get_cacrl(RemminaProtocolWidget *gp)
-
void _remmina_info(const gchar *fmt,...)
Definition: remmina_log.c:205
+
void _remmina_info(const gchar *fmt,...)
Definition: remmina_log.c:206
RemminaProtocolFeatureType
Definition: types.h:46
void remmina_protocol_widget_set_height(RemminaProtocolWidget *gp, gint height)
RemminaProtocolSettingType type
Definition: types.h:117
@@ -224,12 +224,12 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
static GHashTable * encrypted_settings_cache
void remmina_protocol_widget_set_expand(RemminaProtocolWidget *gp, gboolean expand)
-
void remmina_log_printf(const gchar *fmt,...)
Definition: remmina_log.c:410
+
void remmina_log_printf(const gchar *fmt,...)
Definition: remmina_log.c:411
static gboolean remmina_plugin_manager_show_for_each_stdout(RemminaPlugin *plugin)
void remmina_file_set_string(RemminaFile *remminafile, const gchar *setting, const gchar *value)
Definition: remmina_file.c:469
void remmina_protocol_widget_send_keys_signals(GtkWidget *widget, const guint *keyvals, int keyvals_length, GdkEventType action)
-
void remmina_log_print(const gchar *text)
Definition: remmina_log.c:196
-
void _remmina_message(const gchar *fmt,...)
Definition: remmina_log.c:229
+
void remmina_log_print(const gchar *text)
Definition: remmina_log.c:197
+
void _remmina_message(const gchar *fmt,...)
Definition: remmina_log.c:230
Definition: types.h:98
void remmina_file_unsave_passwords(RemminaFile *remminafile)
Definition: remmina_file.c:976
@@ -246,7 +246,7 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
void remmina_protocol_widget_chat_open(RemminaProtocolWidget *gp, const gchar *name, void(*on_send)(RemminaProtocolWidget *gp, const gchar *text), void(*on_destroy)(RemminaProtocolWidget *gp))
const gchar * name
Definition: plugin.h:58
gchar * remmina_protocol_widget_get_username(RemminaProtocolWidget *gp)
-
void _remmina_error(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:354
+
void _remmina_error(const gchar *fun, const gchar *fmt,...)
Definition: remmina_log.c:355
const gchar * name
Definition: types.h:118
diff --git a/public/remmina__ssh_8c_source.html b/public/remmina__ssh_8c_source.html index a3e9896f0..283fff7f4 100644 --- a/public/remmina__ssh_8c_source.html +++ b/public/remmina__ssh_8c_source.html @@ -156,7 +156,7 @@ $(document).ready(function(){initNavTree('remmina__ssh_8c_source.html','');});
RemminaSSHTunnelCallback disconnect_func
Definition: remmina_ssh.h:177
gboolean remmina_ssh_init_from_file(RemminaSSH *ssh, RemminaFile *remminafile, gboolean is_tunnel)
remmina_ssh_auth_result
Definition: remmina_ssh.h:107
-
gboolean remmina_log_running(void)
Definition: remmina_log.c:161
+
gboolean remmina_log_running(void)
Definition: remmina_log.c:162
gchar * remmina_file_format_properties(RemminaFile *remminafile, const gchar *setting)
Definition: remmina_file.c:561
gchar * remmina_ssh_identity_path(const gchar *id)
Definition: remmina_ssh.c:628
gint port
Definition: remmina_ssh.h:65
-- cgit v1.2.3