Remmina - The GTK+ Remote Desktop Client  v1.4.33
Remmina is a remote desktop client written in GTK+, aiming to be useful for system administrators and travellers, who need to work with lots of remote computers in front of either large monitors or tiny netbooks. Remmina supports multiple network protocols in an integrated and consistent user interface. Currently RDP, VNC, NX, XDMCP and SSH are supported.
x2go_plugin.c File Reference

Go to the source code of this file.

Data Structures

struct  _RemminaPluginX2GoData
 
struct  _X2GoCustomUserData
 Can be used to pass custom user data between functions and threads. More...
 
struct  _DialogData
 DialogData: More...
 
struct  _ConnectionData
 Stores all necessary information needed for retrieving sessions from a X2Go server. More...
 
struct  onMainThread_cb_data
 

Typedefs

typedef struct _RemminaPluginX2GoData RemminaPluginX2GoData
 
typedef struct _X2GoCustomUserData X2GoCustomUserData
 Can be used to pass custom user data between functions and threads. More...
 
typedef enum _str2int_errno str2int_errno
 

Enumerations

enum  SESSION_PROPERTIES {
  SESSION_DISPLAY = 0, SESSION_STATUS, SESSION_SESSION_ID, SESSION_SUSPENDED_SINCE,
  SESSION_CREATE_DATE, SESSION_AGENT_PID, SESSION_USERNAME, SESSION_HOSTNAME,
  SESSION_COOKIE, SESSION_GRAPHIC_PORT, SESSION_SND_PORT, SESSION_SSHFS_PORT,
  SESSION_DIALOG_IS_VISIBLE, SESSION_NUM_PROPERTIES
}
 Used for the session chooser dialog (GtkListStore) See the example at: https://docs.gtk.org/gtk3/class.ListStore.html The order is the exact same as the user sees in the dialog. More...
 
enum  _str2int_errno {
  STR2INT_SUCCESS, STR2INT_OVERFLOW, STR2INT_UNDERFLOW, STR2INT_INCONVERTIBLE,
  STR2INT_INVALID_DATA
}
 
enum  SESSION_CHOOSER_RESPONSE_TYPE { SESSION_CHOOSER_RESPONSE_NEW = 0, SESSION_CHOOSER_RESPONSE_CHOOSE, SESSION_CHOOSER_RESPONSE_TERMINATE }
 These define the responses of session-chooser-dialog's buttons. More...
 

Functions

str2int_errno str2int (gint *out, gchar *s, gint base)
 Convert string s to int out. More...
 
static gboolean rmplugin_x2go_open_dialog (X2GoCustomUserData *custom_data)
 
static GtkWidget * rmplugin_x2go_find_child (GtkWidget *parent, const gchar *name)
 Finds a child GtkWidget of a parent GtkWidget. More...
 
static gboolean rmplugin_x2go_session_chooser_row_activated (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, X2GoCustomUserData *custom_data)
 Gets executed on "row-activated" signal. More...
 
static gchar * rmplugin_x2go_session_property_to_string (guint session_property)
 Translates a session property (described by SESSION_PROPERTIES enum) to a string containing it's display name. More...
 
static GtkWidget * rmplugin_x2go_choose_session_dialog_factory (X2GoCustomUserData *custom_data, GList *sessions_list)
 Builds a dialog which contains all found X2Go-Sessions of the remote server. More...
 
static GtkTreeModelFilter * rmplugin_x2go_session_chooser_get_filter_model (GtkWidget *dialog, GtkTreeView *treeview)
 Uses either 'dialog' or 'treeview' to return the GtkTreeModel of the Session-Chooser-Dialog. More...
 
static GtkTreePath * rmplugin_x2go_session_chooser_get_selected_row (GtkWidget *dialog)
 Gets the selected row of the Session-Chooser-Dialog. More...
 
static GValue rmplugin_x2go_session_chooser_get_property (GtkWidget *dialog, gint property_index, GtkTreePath *row)
 Finds the GtkTreeView inside of the session chooser dialog, determines the selected row and extracts a property. More...
 
static gchar * rmplugin_x2go_spawn_pyhoca_process (guint argc, gchar *argv[], GError **error, gchar **env)
 This function dumps all properties of a session to the console. More...
 
static gboolean rmplugin_x2go_session_chooser_set_row_visible (GtkTreePath *path, gboolean value, GtkDialog *dialog)
 Either sets a specific row visible or invisible. More...
 
static gboolean rmplugin_x2go_verify_connection_data (struct _ConnectionData *connect_data)
 
static gboolean rmplugin_x2go_pyhoca_terminate_session (X2GoCustomUserData *custom_data)
 Terminates a specific X2Go session using pyhoca-cli. More...
 
static gboolean rmplugin_x2go_session_chooser_callback (X2GoCustomUserData *custom_data, gint response_id, GtkDialog *self)
 Gets executed on dialog's 'response' signal. More...
 
static gboolean onMainThread_cb (struct onMainThread_cb_data *d)
 
static void onMainThread_cleanup_handler (gpointer data)
 
static void onMainThread_schedule_callback_and_wait (struct onMainThread_cb_data *d)
 
static void onMainThread_gtk_socket_add_id (GtkSocket *sk, Window w)
 
static void rmplugin_x2go_remove_window_id (Window window_id)
 
static gboolean rmplugin_x2go_cleanup (RemminaProtocolWidget *gp)
 
static gboolean rmplugin_x2go_close_connection (RemminaProtocolWidget *gp)
 
static void rmplugin_x2go_pyhoca_cli_exited (GPid pid, gint status, RemminaProtocolWidget *gp)
 
static gboolean rmplugin_x2go_save_credentials (RemminaFile *remminafile, gchar *s_username, gchar *s_password, gchar *errmsg)
 Saves s_password and s_username if set. More...
 
static gboolean rmplugin_x2go_get_ssh_passphrase (RemminaProtocolWidget *gp, gchar *errmsg, gchar **passphrase)
 Asks the user for a username and password. More...
 
static gboolean rmplugin_x2go_get_auth (RemminaProtocolWidget *gp, gchar *errmsg, gchar **default_username, gchar **default_password)
 Asks the user for a username and password. More...
 
static gchar * rmplugin_x2go_get_pyhoca_sessions (RemminaProtocolWidget *gp, GError **error, struct _ConnectionData *connect_data)
 Executes 'pyhoca-cli –list-sessions' for username. More...
 
static GList * rmplugin_x2go_parse_pyhoca_sessions (RemminaProtocolWidget *gp, GError **error, struct _ConnectionData *connect_data)
 This function is used to parse the output of rmplugin_x2go_get_pyhoca_sessions(). More...
 
static gchar * rmplugin_x2go_ask_session (RemminaProtocolWidget *gp, GError **error, struct _ConnectionData *connect_data)
 Asks the user, with the help of a dialog, to continue an already existing session, terminate or create a new one. More...
 
static gboolean rmplugin_x2go_exec_x2go (gchar *host, gint sshport, gchar *username, gchar *password, gchar *command, gchar *kbdlayout, gchar *kbdtype, gchar *audio, gchar *clipboard, gint dpi, gchar *resolution, gchar *ssh_privatekey, RemminaProtocolWidget *gp, gchar *errmsg)
 
static GList * rmplugin_x2go_old_pyhoca_features ()
 
static GList * rmplugin_x2go_populate_available_features_list ()
 
static void rmplugin_x2go_on_plug_added (GtkSocket *socket, RemminaProtocolWidget *gp)
 
static gboolean rmplugin_x2go_on_plug_removed (GtkSocket *socket, RemminaProtocolWidget *gp)
 
static void rmplugin_x2go_init (RemminaProtocolWidget *gp)
 
static gboolean rmplugin_x2go_try_window_id (Window window_id)
 
static int rmplugin_x2go_dummy_handler (Display *dsp, XErrorEvent *err)
 
static gboolean rmplugin_x2go_start_create_notify (RemminaProtocolWidget *gp, gchar *errmsg)
 
static gboolean rmplugin_x2go_monitor_create_notify (RemminaProtocolWidget *gp, const gchar *cmd, gchar *errmsg)
 
static gboolean rmplugin_x2go_start_session (RemminaProtocolWidget *gp)
 
static gboolean rmplugin_x2go_main (RemminaProtocolWidget *gp)
 
static gpointer rmplugin_x2go_main_thread (RemminaProtocolWidget *gp)
 
static gboolean rmplugin_x2go_open_connection (RemminaProtocolWidget *gp)
 
static gboolean rmplugin_x2go_query_feature (RemminaProtocolWidget *gp, const RemminaProtocolFeature *feature)
 
static gchar * rmplugin_x2go_enumeration_prettifier (const guint max_elements, const guint current_element, gchar *element_to_add, gchar *string)
 This function builds a string like: "'value1', 'value2' and 'value3'"
To be used in a loop. More...
 
static GError * rmplugin_x2go_string_setting_validator (gchar *key, gchar *value, gchar *data)
 Validator-functions are getting executed when the user wants to save profile settings. More...
 
static GError * rmplugin_x2go_int_setting_validator (gchar *key, gpointer value, gchar *data)
 Validator-functions are getting executed when the user wants to save profile settings. More...
 
G_MODULE_EXPORT gboolean remmina_plugin_entry (RemminaPluginService *service)
 

Variables

static RemminaPluginServicerm_plugin_service = NULL
 
static RemminaProtocolPlugin rmplugin_x2go
 
static pthread_mutex_t remmina_x2go_init_mutex
 
static GArray * remmina_x2go_window_id_array
 
static const RemminaProtocolFeature rmplugin_x2go_features []
 
static const RemminaProtocolSetting rmplugin_x2go_basic_settings []
 

Typedef Documentation

◆ RemminaPluginX2GoData

◆ str2int_errno

◆ X2GoCustomUserData

Can be used to pass custom user data between functions and threads.

AND pass the useful RemminaProtocolWidget with it along.

Enumeration Type Documentation

◆ _str2int_errno

Enumerator
STR2INT_SUCCESS 
STR2INT_OVERFLOW 
STR2INT_UNDERFLOW 
STR2INT_INCONVERTIBLE 
STR2INT_INVALID_DATA 

Definition at line 193 of file x2go_plugin.c.

◆ SESSION_CHOOSER_RESPONSE_TYPE

These define the responses of session-chooser-dialog's buttons.

Enumerator
SESSION_CHOOSER_RESPONSE_NEW 
SESSION_CHOOSER_RESPONSE_CHOOSE 
SESSION_CHOOSER_RESPONSE_TERMINATE 

Definition at line 367 of file x2go_plugin.c.

◆ SESSION_PROPERTIES

Used for the session chooser dialog (GtkListStore) See the example at: https://docs.gtk.org/gtk3/class.ListStore.html The order is the exact same as the user sees in the dialog.

SESSION_NUM_PROPERTIES is used to keep count of the properties and it must be the last object.

Enumerator
SESSION_DISPLAY 
SESSION_STATUS 
SESSION_SESSION_ID 
SESSION_SUSPENDED_SINCE 
SESSION_CREATE_DATE 
SESSION_AGENT_PID 
SESSION_USERNAME 
SESSION_HOSTNAME 
SESSION_COOKIE 
SESSION_GRAPHIC_PORT 
SESSION_SND_PORT 
SESSION_SSHFS_PORT 
SESSION_DIALOG_IS_VISIBLE 
SESSION_NUM_PROPERTIES 

Definition at line 174 of file x2go_plugin.c.

Function Documentation

◆ onMainThread_cb()

static gboolean onMainThread_cb ( struct onMainThread_cb_data d)
static

Definition at line 1486 of file x2go_plugin.c.

◆ onMainThread_cleanup_handler()

static void onMainThread_cleanup_handler ( gpointer  data)
static

Definition at line 1504 of file x2go_plugin.c.

◆ onMainThread_gtk_socket_add_id()

static void onMainThread_gtk_socket_add_id ( GtkSocket *  sk,
Window  w 
)
static

Definition at line 1527 of file x2go_plugin.c.

◆ onMainThread_schedule_callback_and_wait()

static void onMainThread_schedule_callback_and_wait ( struct onMainThread_cb_data d)
static

Definition at line 1511 of file x2go_plugin.c.

◆ remmina_plugin_entry()

G_MODULE_EXPORT gboolean remmina_plugin_entry ( RemminaPluginService service)

Definition at line 3445 of file x2go_plugin.c.

◆ rmplugin_x2go_ask_session()

static gchar* rmplugin_x2go_ask_session ( RemminaProtocolWidget gp,
GError **  error,
struct _ConnectionData connect_data 
)
static

Asks the user, with the help of a dialog, to continue an already existing session, terminate or create a new one.

Parameters
errorIs set if there is something to tell the user.
Not necessarily an error message.
connect_dataStores all necessary information needed for etrieving sessions from a X2Go server.
Returns
gchar* ID of session. Can be 'NULL' but then 'error' is set.

Definition at line 2198 of file x2go_plugin.c.

◆ rmplugin_x2go_choose_session_dialog_factory()

static GtkWidget* rmplugin_x2go_choose_session_dialog_factory ( X2GoCustomUserData custom_data,
GList *  sessions_list 
)
static

Builds a dialog which contains all found X2Go-Sessions of the remote server.

The dialog gives the user the option to choose between resuming or terminating an existing session or to create a new one.

Parameters
custom_dataX2GoCustomUserData structure with the following:
gp -> gp (RemminaProtocolWidget*)
dialog_data -> dialog data (struct _DialogData*)
connect_data -> connection data (struct _ConnectionData*)
sessions_listThe GList* Should contain all found X2Go-Sessions. Sessions are string arrays of properties. The type of the GList is gchar**.
Returns
GtkWidget* custom dialog.

Definition at line 509 of file x2go_plugin.c.

◆ rmplugin_x2go_cleanup()

static gboolean rmplugin_x2go_cleanup ( RemminaProtocolWidget gp)
static
Returns
: FALSE. This source should be removed from main loop. #G_SOURCE_CONTINUE and #G_SOURCE_REMOVE are more memorable names for the return value.

Definition at line 1572 of file x2go_plugin.c.

◆ rmplugin_x2go_close_connection()

static gboolean rmplugin_x2go_close_connection ( RemminaProtocolWidget gp)
static

Definition at line 1621 of file x2go_plugin.c.

◆ rmplugin_x2go_dummy_handler()

static int rmplugin_x2go_dummy_handler ( Display *  dsp,
XErrorEvent *  err 
)
static

Definition at line 2828 of file x2go_plugin.c.

◆ rmplugin_x2go_enumeration_prettifier()

static gchar* rmplugin_x2go_enumeration_prettifier ( const guint  max_elements,
const guint  current_element,
gchar *  element_to_add,
gchar *  string 
)
static

This function builds a string like: "'value1', 'value2' and 'value3'"
To be used in a loop.


See rmplugin_x2go_string_setting_validator() for an example.

Parameters
max_elementsNumber of maximum elements.
element_to_addNext element to add to the string
current_elementWhich element is element_to_add?
stringThe string to which element_to_add will be added.

Definition at line 3139 of file x2go_plugin.c.

◆ rmplugin_x2go_exec_x2go()

static gboolean rmplugin_x2go_exec_x2go ( gchar *  host,
gint  sshport,
gchar *  username,
gchar *  password,
gchar *  command,
gchar *  kbdlayout,
gchar *  kbdtype,
gchar *  audio,
gchar *  clipboard,
gint  dpi,
gchar *  resolution,
gchar *  ssh_privatekey,
RemminaProtocolWidget gp,
gchar *  errmsg 
)
static

Definition at line 2291 of file x2go_plugin.c.

◆ rmplugin_x2go_find_child()

static GtkWidget* rmplugin_x2go_find_child ( GtkWidget *  parent,
const gchar *  name 
)
static

Finds a child GtkWidget of a parent GtkWidget.

Copied from https://stackoverflow.com/a/23497087 ;)

Parameters
parentParent GtkWidget*
nameName string of child. (Must be set before, er else it will be a default string)
Returns
GtkWidget*

Definition at line 382 of file x2go_plugin.c.

◆ rmplugin_x2go_get_auth()

static gboolean rmplugin_x2go_get_auth ( RemminaProtocolWidget gp,
gchar *  errmsg,
gchar **  default_username,
gchar **  default_password 
)
static

Asks the user for a username and password.

Parameters
errmsgPointer to error message string (set if function failed).
usernamePointer to default username. Gets set to new username on success.
passwordPointer to default password. Gets set to new password on success.
Returns
FALSE if auth failed and TRUE on success.

Definition at line 1786 of file x2go_plugin.c.

◆ rmplugin_x2go_get_pyhoca_sessions()

static gchar* rmplugin_x2go_get_pyhoca_sessions ( RemminaProtocolWidget gp,
GError **  error,
struct _ConnectionData connect_data 
)
static

Executes 'pyhoca-cli –list-sessions' for username.

Parameters
gpRemminaProtocolWidget* is used to get the x2go-plugin data.
errorThis is where a error message will be when NULL gets returned.
connect_datastruct _ConnectionData* which stores all necessary information needed for retrieving sessions from a X2Go server.
Returns
Standard output of pyhoca-cli command. If NULL then errmsg is set to user-friendly error message.

Definition at line 1878 of file x2go_plugin.c.

◆ rmplugin_x2go_get_ssh_passphrase()

static gboolean rmplugin_x2go_get_ssh_passphrase ( RemminaProtocolWidget gp,
gchar *  errmsg,
gchar **  passphrase 
)
static

Asks the user for a username and password.

Parameters
errmsgPointer to error message string (set if function failed).
passphrasegchar** Passphrase which will be used to unlock SSH key.
Returns
FALSE if auth failed and TRUE on success.

Definition at line 1744 of file x2go_plugin.c.

◆ rmplugin_x2go_init()

static void rmplugin_x2go_init ( RemminaProtocolWidget gp)
static

Definition at line 2761 of file x2go_plugin.c.

◆ rmplugin_x2go_int_setting_validator()

static GError* rmplugin_x2go_int_setting_validator ( gchar *  key,
gpointer  value,
gchar *  data 
)
static

Validator-functions are getting executed when the user wants to save profile settings.

It uses the given data (See RemminaProtocolSetting array) to determine if the given value is a valid integer is in range and returns a end-user friendly error message.

Parameters
keyKey is the setting's name.
valueValue to validate.
dataData needed for validation process. See RemminaProtocolSetting array.
Returns
End-user friendly and translated error message, explaining why the given value is invalid. If the given value is error-free then NULL gets returned.

Definition at line 3266 of file x2go_plugin.c.

◆ rmplugin_x2go_main()

static gboolean rmplugin_x2go_main ( RemminaProtocolWidget gp)
static

Definition at line 3059 of file x2go_plugin.c.

◆ rmplugin_x2go_main_thread()

static gpointer rmplugin_x2go_main_thread ( RemminaProtocolWidget gp)
static

Definition at line 3071 of file x2go_plugin.c.

◆ rmplugin_x2go_monitor_create_notify()

static gboolean rmplugin_x2go_monitor_create_notify ( RemminaProtocolWidget gp,
const gchar *  cmd,
gchar *  errmsg 
)
static

Definition at line 2856 of file x2go_plugin.c.

◆ rmplugin_x2go_old_pyhoca_features()

static GList* rmplugin_x2go_old_pyhoca_features ( )
static
Returns
a GList* with all features which pyhoca-cli had before the feature system.

Definition at line 2639 of file x2go_plugin.c.

◆ rmplugin_x2go_on_plug_added()

static void rmplugin_x2go_on_plug_added ( GtkSocket *  socket,
RemminaProtocolWidget gp 
)
static

Definition at line 2730 of file x2go_plugin.c.

◆ rmplugin_x2go_on_plug_removed()

static gboolean rmplugin_x2go_on_plug_removed ( GtkSocket *  socket,
RemminaProtocolWidget gp 
)
static

Definition at line 2753 of file x2go_plugin.c.

◆ rmplugin_x2go_open_connection()

static gboolean rmplugin_x2go_open_connection ( RemminaProtocolWidget gp)
static

Definition at line 3092 of file x2go_plugin.c.

◆ rmplugin_x2go_open_dialog()

static gboolean rmplugin_x2go_open_dialog ( X2GoCustomUserData custom_data)
static
Parameters
custom_dataX2GoCustomUserData structure with the following:
gp -> gp (RemminaProtocolWidget*)
dialog_data -> dialog data (struct _DialogData*)
Returns
: FALSE. This source should be removed from main loop. #G_SOURCE_CONTINUE and #G_SOURCE_REMOVE are more memorable names for the return value.

Definition at line 290 of file x2go_plugin.c.

◆ rmplugin_x2go_parse_pyhoca_sessions()

static GList* rmplugin_x2go_parse_pyhoca_sessions ( RemminaProtocolWidget gp,
GError **  error,
struct _ConnectionData connect_data 
)
static

This function is used to parse the output of rmplugin_x2go_get_pyhoca_sessions().

Parameters
gpRemminaProtocolWidget* is used to get the x2go-plugin data.
errorThis is where a error message will be when NULL gets returned.
connect_datastruct _ConnectionData* which stores all necessary information needed for retrieving sessions from a X2Go server.
Returns
Returns either a GList containing the IDs of every already existing session found or if the function failes, NULL.

TODO: If pyhoca-cli (python-x2go) implements --json or similar option -> Replace entire function with JSON parsing.

Definition at line 2026 of file x2go_plugin.c.

◆ rmplugin_x2go_populate_available_features_list()

static GList* rmplugin_x2go_populate_available_features_list ( )
static
Returns
a GList* which includes all pyhoca-cli command line features we can use.

Definition at line 2667 of file x2go_plugin.c.

◆ rmplugin_x2go_pyhoca_cli_exited()

static void rmplugin_x2go_pyhoca_cli_exited ( GPid  pid,
gint  status,
RemminaProtocolWidget gp 
)
static

Definition at line 1639 of file x2go_plugin.c.

◆ rmplugin_x2go_pyhoca_terminate_session()

static gboolean rmplugin_x2go_pyhoca_terminate_session ( X2GoCustomUserData custom_data)
static

Terminates a specific X2Go session using pyhoca-cli.

Parameters
custom_dataX2GoCustomUserData structure with the following:
gp -> gp (RemminaProtocolWidget*)
dialog_data -> dialog data (struct _DialogData*)
connect_data -> connection data (struct _ConnectionData*)
opt1 -> selected row (GtkTreePath*)
opt2 -> session-selection-dialog (GtkDialog*)
Returns
G_SOURCE_REMOVE (FALSE), #G_SOURCE_CONTINUE and #G_SOURCE_REMOVE are more memorable names for the return value. See GLib docs.
https://docs.gtk.org/glib/const.SOURCE_REMOVE.html

Definition at line 1145 of file x2go_plugin.c.

◆ rmplugin_x2go_query_feature()

static gboolean rmplugin_x2go_query_feature ( RemminaProtocolWidget gp,
const RemminaProtocolFeature feature 
)
static

Definition at line 3116 of file x2go_plugin.c.

◆ rmplugin_x2go_remove_window_id()

static void rmplugin_x2go_remove_window_id ( Window  window_id)
static

Definition at line 1543 of file x2go_plugin.c.

◆ rmplugin_x2go_save_credentials()

static gboolean rmplugin_x2go_save_credentials ( RemminaFile remminafile,
gchar *  s_username,
gchar *  s_password,
gchar *  errmsg 
)
static

Saves s_password and s_username if set.

Returns
either TRUE or FALSE. If FALSE gets returned, errmsg is set.

Definition at line 1700 of file x2go_plugin.c.

◆ rmplugin_x2go_session_chooser_callback()

static gboolean rmplugin_x2go_session_chooser_callback ( X2GoCustomUserData custom_data,
gint  response_id,
GtkDialog *  self 
)
static

Gets executed on dialog's 'response' signal.

Parameters
custom_dataX2GoCustomUserData*:
gp -> gp (RemminaProtocolWidget*)
dialog_data -> dialog data (struct _DialogData*)
connect_data -> connection data (struct _ConnectionData*)
response_idSee GTK 'response' signal.
selfThe dialog itself.
Returns
gboolean, #G_SOURCE_CONTINUE and #G_SOURCE_REMOVE are more memorable names for the return value. See GLib docs.
https://docs.gtk.org/glib/const.SOURCE_REMOVE.html

Definition at line 1339 of file x2go_plugin.c.

◆ rmplugin_x2go_session_chooser_get_filter_model()

static GtkTreeModelFilter* rmplugin_x2go_session_chooser_get_filter_model ( GtkWidget *  dialog,
GtkTreeView *  treeview 
)
static

Uses either 'dialog' or 'treeview' to return the GtkTreeModel of the Session-Chooser-Dialog.

Directly giving 'treeview' as a parameter is faster. Only one parameter has to be given. The other one can be NULL. Error messages are all handled already.

Parameters
dialogThe Session-Chooser-Dialog itself. (Slower) Can be NULL.
treeviewThe GtkTreeView of the Session-Chooser-Dialog. (faster) Can be NULL.
Returns
GtkTreeModelFilter* (Does not contains all rows, only the visible ones!!!)
But you can get all rows with:
gtk_tree_model_filter_get_model(GTK_TREE_MODEL_FILTER(return_model));

Definition at line 702 of file x2go_plugin.c.

◆ rmplugin_x2go_session_chooser_get_property()

static GValue rmplugin_x2go_session_chooser_get_property ( GtkWidget *  dialog,
gint  property_index,
GtkTreePath *  row 
)
static

Finds the GtkTreeView inside of the session chooser dialog, determines the selected row and extracts a property.

Parameters
dialogGtkWidget* the dialog itself.
property_indexIndex of property.
rowA specific row to get the property of. (Can be NULL)
Returns
GValue The value of property. (Can be non-initialized!)

Definition at line 817 of file x2go_plugin.c.

◆ rmplugin_x2go_session_chooser_get_selected_row()

static GtkTreePath* rmplugin_x2go_session_chooser_get_selected_row ( GtkWidget *  dialog)
static

Gets the selected row of the Session-Chooser-Dialog.

The path gets converted with gtk_tree_model_filter_convert_child_path_to_path() before it gets returned. So path describes a row of 'filter' and not its child GtkTreeModel.

Parameters
dialogThe Session-Chooser-Dialog.
Returns
GtkTreePath* describing the path to the row.

Definition at line 753 of file x2go_plugin.c.

◆ rmplugin_x2go_session_chooser_row_activated()

static gboolean rmplugin_x2go_session_chooser_row_activated ( GtkTreeView *  treeview,
GtkTreePath *  path,
GtkTreeViewColumn *  column,
X2GoCustomUserData custom_data 
)
static

Gets executed on "row-activated" signal.

It is emitted when the method when the user double clicks a treeview row. It is also emitted when a non-editable row is selected and one of the keys: Space, Shift+Space, Return or Enter is pressed.

Parameters
custom_dataX2GoCustomUserData structure with the following:
gp -> gp (RemminaProtocolWidget*)
opt1 -> dialog widget (GtkWidget*)

Definition at line 419 of file x2go_plugin.c.

◆ rmplugin_x2go_session_chooser_set_row_visible()

static gboolean rmplugin_x2go_session_chooser_set_row_visible ( GtkTreePath *  path,
gboolean  value,
GtkDialog *  dialog 
)
static

Either sets a specific row visible or invisible.

Also handles 'terminate' and 'resume' buttons of session-chooser-dialog. If there are no sessions available anymore, disable all buttons which are not 'new' and if a session is available again, enable them.

Parameters
pathDescribes which row. (GtkTreePath*)
Should be from GtkTreeModelFilter's perspective!
valueTRUE = row is visible & FALSE = row is invisible (gboolean)
dialogSession-Chooser-Dialog (GtkDialog*)
Returns
Returns TRUE if successful. (gboolean)

Definition at line 1036 of file x2go_plugin.c.

◆ rmplugin_x2go_session_property_to_string()

static gchar* rmplugin_x2go_session_property_to_string ( guint  session_property)
static

Translates a session property (described by SESSION_PROPERTIES enum) to a string containing it's display name.

Parameters
session_propertyA session property. (as described by SESSION_PROPERTIES enum)
Returns
gchar* Translated display name. (Can be NULL, if session_property is invalid!)

Definition at line 471 of file x2go_plugin.c.

◆ rmplugin_x2go_spawn_pyhoca_process()

static gchar* rmplugin_x2go_spawn_pyhoca_process ( guint  argc,
gchar *  argv[],
GError **  error,
gchar **  env 
)
static

This function dumps all properties of a session to the console.

It can/should be used with:
gtk_tree_model_foreach(GTK_TREE_MODEL(model), (GtkTreeModelForeachFunc)
rmplugin_x2go_dump_session_properties,
dialog); This function synchronously spawns a pyhoca-cli process with argv as arguments.

Parameters
argcNumber of arguments.
argvArguments as string array.
Last elements has to be NULL.
Strings will get freed automatically.
errorWill be filled with an error message on fail.
envString array of enviroment variables.
The list is NULL terminated and each item in the list is of the form NAME=VALUE.
Returns
Returns either standard output string or NULL if it failed.

Definition at line 898 of file x2go_plugin.c.

◆ rmplugin_x2go_start_create_notify()

static gboolean rmplugin_x2go_start_create_notify ( RemminaProtocolWidget gp,
gchar *  errmsg 
)
static

Definition at line 2834 of file x2go_plugin.c.

◆ rmplugin_x2go_start_session()

static gboolean rmplugin_x2go_start_session ( RemminaProtocolWidget gp)
static

Definition at line 2966 of file x2go_plugin.c.

◆ rmplugin_x2go_string_setting_validator()

static GError* rmplugin_x2go_string_setting_validator ( gchar *  key,
gchar *  value,
gchar *  data 
)
static

Validator-functions are getting executed when the user wants to save profile settings.

It uses the given data (See RemminaProtocolSetting array) to determine which strings are allowed and returns a end-user friendly error message.

Parameters
keyKey is the setting's name.
valueValue to validate.
dataData needed for validation process. See RemminaProtocolSetting array.
Returns
End-user friendly and translated error message, explaining why the given value is invalid. If the given value is error-free then NULL gets returned.

Definition at line 3193 of file x2go_plugin.c.

◆ rmplugin_x2go_try_window_id()

static gboolean rmplugin_x2go_try_window_id ( Window  window_id)
static

Definition at line 2800 of file x2go_plugin.c.

◆ rmplugin_x2go_verify_connection_data()

static gboolean rmplugin_x2go_verify_connection_data ( struct _ConnectionData connect_data)
static

Definition at line 1102 of file x2go_plugin.c.

◆ str2int()

str2int_errno str2int ( gint *  out,
gchar *  s,
gint  base 
)

Convert string s to int out.

Parameters
outThe converted int. Cannot be NULL.
sInput string to be converted.
The format is the same as strtol, except that the following are inconvertible:
  • empty string
  • leading whitespace
  • or any trailing characters that are not part of the number
    Cannot be NULL.
baseBase to interpret string in. Same range as strtol (2 to 36).
Returns
Indicates if the operation succeeded, or why it failed with str2int_errno enum.

Definition at line 217 of file x2go_plugin.c.

Variable Documentation

◆ remmina_x2go_init_mutex

pthread_mutex_t remmina_x2go_init_mutex
static

Definition at line 1469 of file x2go_plugin.c.

◆ remmina_x2go_window_id_array

GArray* remmina_x2go_window_id_array
static

Definition at line 1470 of file x2go_plugin.c.

◆ rm_plugin_service

RemminaPluginService* rm_plugin_service = NULL
static

Definition at line 136 of file x2go_plugin.c.

◆ rmplugin_x2go

static RemminaProtocolPlugin rmplugin_x2go
static
Initial value:
= {
PLUGIN_NAME,
PLUGIN_DESCRIPTION,
GETTEXT_PACKAGE,
PLUGIN_VERSION,
PLUGIN_APPICON,
PLUGIN_SSH_APPICON,
NULL,
NULL,
NULL,
NULL,
}
static const RemminaProtocolFeature rmplugin_x2go_features[]
Definition: x2go_plugin.c:3123
static void rmplugin_x2go_init(RemminaProtocolWidget *gp)
Definition: x2go_plugin.c:2761
static const RemminaProtocolSetting rmplugin_x2go_basic_settings[]
Definition: x2go_plugin.c:3394
static gboolean rmplugin_x2go_close_connection(RemminaProtocolWidget *gp)
Definition: x2go_plugin.c:1621
static gboolean rmplugin_x2go_query_feature(RemminaProtocolWidget *gp, const RemminaProtocolFeature *feature)
Definition: x2go_plugin.c:3116
static gboolean rmplugin_x2go_open_connection(RemminaProtocolWidget *gp)
Definition: x2go_plugin.c:3092

Definition at line 1464 of file x2go_plugin.c.

◆ rmplugin_x2go_basic_settings

const RemminaProtocolSetting rmplugin_x2go_basic_settings[]
static
Initial value:
= {
{REMMINA_PROTOCOL_SETTING_TYPE_SERVER, "server", NULL, FALSE, NULL, NULL, NULL, NULL},
{REMMINA_PROTOCOL_SETTING_TYPE_TEXT, "username", N_("Username"), FALSE, NULL, NULL, NULL, NULL},
{REMMINA_PROTOCOL_SETTING_TYPE_PASSWORD, "password", N_("Password"), FALSE, NULL, NULL, NULL, NULL},
{REMMINA_PROTOCOL_SETTING_TYPE_COMBO, "command", N_("Startup program"), FALSE,
"MATE,KDE,XFCE,LXDE,TERMINAL",
N_("Which command should be executed after creating the X2Go session?"), NULL, NULL},
{REMMINA_PROTOCOL_SETTING_TYPE_RESOLUTION, "resolution", NULL, FALSE, NULL, NULL, NULL, NULL},
{REMMINA_PROTOCOL_SETTING_TYPE_TEXT, "kbdlayout", N_("Keyboard Layout (auto)"), FALSE, NULL, NULL, NULL, NULL},
{REMMINA_PROTOCOL_SETTING_TYPE_TEXT, "kbdtype", N_("Keyboard type (auto)"), FALSE, NULL, NULL, NULL, NULL},
{REMMINA_PROTOCOL_SETTING_TYPE_COMBO, "audio", N_("Audio support"), FALSE,
"pulse,esd,none",
N_("The sound system of the X2Go server (default: 'pulse')."),
"pulse,esd,none",
{REMMINA_PROTOCOL_SETTING_TYPE_COMBO, "clipboard", N_("Clipboard direction"), FALSE,
"none,server,client,both",
N_("Which direction should clipboard content be copied? "
"(default: 'both')."),
"none,server,client,both",
{REMMINA_PROTOCOL_SETTING_TYPE_INT, "dpi", N_("DPI resolution"), FALSE, NULL,
N_("Launch session with a specific resolution (in dots per inch). "
"Must be between 20 and 400."),
"20;400",
{REMMINA_PROTOCOL_SETTING_TYPE_FILE, "ssh_privatekey", N_("SSH identity file"), FALSE, NULL, N_("Your private key"), NULL, NULL },
{REMMINA_PROTOCOL_SETTING_TYPE_END, NULL, NULL, FALSE, NULL, NULL, NULL, NULL}}
static GError * rmplugin_x2go_int_setting_validator(gchar *key, gpointer value, gchar *data)
Validator-functions are getting executed when the user wants to save profile settings.
Definition: x2go_plugin.c:3266
static GError * rmplugin_x2go_string_setting_validator(gchar *key, gchar *value, gchar *data)
Validator-functions are getting executed when the user wants to save profile settings.
Definition: x2go_plugin.c:3193
N_("Unable to connect to VNC server")
Definition: vnc_plugin.c:953

Definition at line 3394 of file x2go_plugin.c.

◆ rmplugin_x2go_features

const RemminaProtocolFeature rmplugin_x2go_features[]
static
Initial value:

Definition at line 3123 of file x2go_plugin.c.