2
* Remmina - The GTK+ Remote Desktop Client
3
* Copyright (C) 2009 - Vic Lee
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330,
18
* Boston, MA 02111-1307, USA.
22
#ifndef __REMMINAPUBLIC_H__
23
#define __REMMINAPUBLIC_H__
27
/* Wrapper marcos to make the compiler happy on both signle/multi-threaded mode */
29
#define IDLE_ADD gdk_threads_add_idle
30
#define TIMEOUT_ADD gdk_threads_add_timeout
31
#define CANCEL_ASYNC pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS,NULL);pthread_testcancel();
32
#define CANCEL_DEFER pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED,NULL);
33
#define THREADS_ENTER gdk_threads_enter();pthread_cleanup_push(remmina_public_threads_leave,NULL);
34
#define THREADS_LEAVE pthread_cleanup_pop(TRUE);
36
#define IDLE_ADD g_idle_add
37
#define TIMEOUT_ADD g_timeout_add
44
#define MAX_PATH_LEN 255
46
#define MAX_X_DISPLAY_NUMBER 99
47
#define X_UNIX_SOCKET "/tmp/.X11-unix/X%d"
49
#define STRING_DELIMITOR ','
53
/* items is separated by STRING_DELIMTOR */
54
GtkWidget* remmina_public_create_combo_entry (const gchar *text, const gchar *def, gboolean descending);
55
GtkWidget* remmina_public_create_combo_text_d (const gchar *text, const gchar *def, const gchar *empty_choice);
56
void remmina_public_load_combo_text_d (GtkWidget *combo, const gchar *text, const gchar *def, const gchar *empty_choice);
57
GtkWidget* remmina_public_create_combo (gboolean use_icon);
58
GtkWidget* remmina_public_create_combo_map (const gpointer *key_value_list, const gchar *def, gboolean use_icon, const gchar *domain);
59
GtkWidget* remmina_public_create_combo_mapint (const gpointer *key_value_list, gint def, gboolean use_icon, const gchar *domain);
61
void remmina_public_create_group (GtkTable* table, const gchar *group, gint row, gint rows, gint cols);
63
/* A function for gtk_menu_popup to get the position right below the widget specified by user_data */
64
void remmina_public_popup_position (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data);
66
/* Combine two paths into one by correctly handling trailing slash. Return newly allocated string */
67
gchar* remmina_public_combine_path (const gchar *path1, const gchar *path2);
69
/* Parse a server entry with server name and port */
70
void remmina_public_get_server_port (const gchar *server, gint defaultport, gchar **host, gint *port);
73
gboolean remmina_public_get_xauth_cookie (const gchar *display, gchar **msg);
74
gint remmina_public_open_xdisplay (const gchar *disp);
75
guint remmina_public_get_current_workspace (GdkScreen *screen);
76
guint remmina_public_get_window_workspace (GtkWindow *gtkwindow);
78
void remmina_public_threads_leave (void* data);
82
#endif /* __REMMINAPUBLIC_H__ */