Commit 7a1b8da7 authored by Muflone's avatar Muflone

Added function tracing if enabled using -DWITH_TRACE_CALLS=ON

parent 36aefc39
......@@ -107,6 +107,11 @@ find_required_package(PTHREAD)
find_suggested_package(GCRYPT)
find_suggested_package(AVAHI)
if(WITH_TRACE_CALLS)
message(STATUS "Enabling trace calls.")
add_definitions(-DWITH_TRACE_CALLS)
endif()
if(GCRYPT_FOUND)
add_definitions(-DHAVE_LIBGCRYPT)
endif()
......
......@@ -48,6 +48,7 @@ static GnomeKeyringPasswordSchema remmina_file_secret_schema =
void remmina_plugin_gkeyring_store_password(RemminaFile *remminafile, const gchar *key, const gchar *password)
{
TRACE_CALL("remmina_plugin_gkeyring_store_password");
GnomeKeyringResult r;
const gchar *path;
gchar *s;
......@@ -71,6 +72,7 @@ void remmina_plugin_gkeyring_store_password(RemminaFile *remminafile, const gcha
gchar*
remmina_plugin_gkeyring_get_password(RemminaFile *remminafile, const gchar *key)
{
TRACE_CALL("remmina_plugin_gkeyring_get_password");
GnomeKeyringResult r;
const gchar *path;
gchar *password;
......@@ -95,6 +97,7 @@ remmina_plugin_gkeyring_get_password(RemminaFile *remminafile, const gchar *key)
void remmina_plugin_gkeyring_delete_password(RemminaFile *remminafile, const gchar *key)
{
TRACE_CALL("remmina_plugin_gkeyring_delete_password");
GnomeKeyringResult r;
const gchar *path;
......@@ -119,6 +122,7 @@ TRUE, remmina_plugin_gkeyring_store_password, remmina_plugin_gkeyring_get_passwo
G_MODULE_EXPORT gboolean
remmina_plugin_entry(RemminaPluginService *service)
{
TRACE_CALL("remmina_plugin_entry");
remmina_plugin_service = service;
if (!service->register_plugin((RemminaPlugin *) &remmina_plugin_gkeyring))
......
......@@ -63,6 +63,7 @@
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include "remmina/remmina_trace_calls.h"
typedef void (*PThreadCleanupFunc)(void*);
......
......@@ -72,6 +72,7 @@ struct onMainThread_cb_data {
static gboolean onMainThread_cb(struct onMainThread_cb_data *d)
{
TRACE_CALL("onMainThread_cb");
if ( !d->cancelled ) {
switch( d->func ) {
case FUNC_GTK_SOCKET_ADD_ID:
......@@ -89,12 +90,14 @@ static gboolean onMainThread_cb(struct onMainThread_cb_data *d)
static void onMainThread_cleanup_handler( struct onMainThread_cb_data *d )
{
TRACE_CALL("onMainThread_cleanup_handler");
d->cancelled = TRUE;
}
static void onMainThread_schedule_callback_and_wait( struct onMainThread_cb_data *d )
{
TRACE_CALL("onMainThread_schedule_callback_and_wait");
d->cancelled = FALSE;
pthread_cleanup_push( onMainThread_cleanup_handler, (void *)d );
pthread_mutex_init( &d->mu, NULL );
......@@ -110,6 +113,7 @@ static void onMainThread_schedule_callback_and_wait( struct onMainThread_cb_data
static void onMainThread_gtk_socket_add_id( GtkSocket* sk, Window w)
{
TRACE_CALL("onMainThread_gtk_socket_add_id");
struct onMainThread_cb_data *d;
......@@ -129,6 +133,7 @@ static void onMainThread_gtk_socket_add_id( GtkSocket* sk, Window w)
static gboolean remmina_plugin_nx_try_window_id(Window window_id)
{
TRACE_CALL("remmina_plugin_nx_try_window_id");
gint i;
gboolean found = FALSE;
......@@ -152,6 +157,7 @@ static gboolean remmina_plugin_nx_try_window_id(Window window_id)
static void remmina_plugin_nx_remove_window_id(Window window_id)
{
TRACE_CALL("remmina_plugin_nx_remove_window_id");
gint i;
gboolean found = FALSE;
......@@ -173,16 +179,19 @@ static void remmina_plugin_nx_remove_window_id(Window window_id)
static void remmina_plugin_nx_on_plug_added(GtkSocket *socket, RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_plugin_nx_on_plug_added");
remmina_plugin_nx_service->protocol_plugin_emit_signal(gp, "connect");
}
static void remmina_plugin_nx_on_plug_removed(GtkSocket *socket, RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_plugin_nx_on_plug_removed");
remmina_plugin_nx_service->protocol_plugin_close_connection(gp);
}
gboolean remmina_plugin_nx_ssh_auth_callback(gchar **passphrase, gpointer userdata)
{
TRACE_CALL("remmina_plugin_nx_ssh_auth_callback");
RemminaProtocolWidget *gp = (RemminaProtocolWidget*) userdata;
gint ret;
......@@ -197,6 +206,7 @@ gboolean remmina_plugin_nx_ssh_auth_callback(gchar **passphrase, gpointer userda
static void remmina_plugin_nx_on_proxy_exit(GPid pid, gint status, gpointer data)
{
TRACE_CALL("remmina_plugin_nx_on_proxy_exit");
RemminaProtocolWidget *gp = (RemminaProtocolWidget*) data;
remmina_plugin_nx_service->protocol_plugin_close_connection(gp);
......@@ -204,11 +214,13 @@ static void remmina_plugin_nx_on_proxy_exit(GPid pid, gint status, gpointer data
static int remmina_plugin_nx_dummy_handler(Display *dsp, XErrorEvent *err)
{
TRACE_CALL("remmina_plugin_nx_dummy_handler");
return 0;
}
static gboolean remmina_plugin_nx_start_create_notify(RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_plugin_nx_start_create_notify");
RemminaPluginNxData *gpdata;
gpdata = (RemminaPluginNxData*) g_object_get_data(G_OBJECT(gp), "plugin-data");
......@@ -226,6 +238,7 @@ static gboolean remmina_plugin_nx_start_create_notify(RemminaProtocolWidget *gp)
static gboolean remmina_plugin_nx_monitor_create_notify(RemminaProtocolWidget *gp, const gchar *cmd)
{
TRACE_CALL("remmina_plugin_nx_monitor_create_notify");
RemminaPluginNxData *gpdata;
Atom atom;
XEvent xev;
......@@ -281,6 +294,7 @@ static gboolean remmina_plugin_nx_monitor_create_notify(RemminaProtocolWidget *g
static gint remmina_plugin_nx_wait_signal(RemminaPluginNxData *gpdata)
{
TRACE_CALL("remmina_plugin_nx_wait_signal");
fd_set set;
guchar dummy = 0;
......@@ -295,6 +309,7 @@ static gint remmina_plugin_nx_wait_signal(RemminaPluginNxData *gpdata)
static gboolean remmina_plugin_nx_start_session(RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_plugin_nx_start_session");
RemminaPluginNxData *gpdata;
RemminaFile *remminafile;
RemminaNXSession *nx;
......@@ -530,6 +545,7 @@ static gboolean remmina_plugin_nx_start_session(RemminaProtocolWidget *gp)
static gboolean remmina_plugin_nx_main(RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_plugin_nx_main");
RemminaPluginNxData *gpdata;
gboolean ret;
const gchar *err;
......@@ -553,6 +569,7 @@ static gboolean remmina_plugin_nx_main(RemminaProtocolWidget *gp)
static gpointer remmina_plugin_nx_main_thread(gpointer data)
{
TRACE_CALL("remmina_plugin_nx_main_thread");
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
CANCEL_ASYNC
......@@ -565,6 +582,7 @@ static gpointer remmina_plugin_nx_main_thread(gpointer data)
static void remmina_plugin_nx_init(RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_plugin_nx_init");
RemminaPluginNxData *gpdata;
gint flags;
......@@ -593,6 +611,7 @@ static void remmina_plugin_nx_init(RemminaProtocolWidget *gp)
static gboolean remmina_plugin_nx_open_connection(RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_plugin_nx_open_connection");
RemminaPluginNxData *gpdata;
RemminaFile *remminafile;
const gchar *resolution;
......@@ -632,6 +651,7 @@ static gboolean remmina_plugin_nx_open_connection(RemminaProtocolWidget *gp)
static gboolean remmina_plugin_nx_close_connection(RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_plugin_nx_close_connection");
RemminaPluginNxData *gpdata;
gpdata = (RemminaPluginNxData*) g_object_get_data(G_OBJECT(gp), "plugin-data");
......@@ -675,11 +695,13 @@ static gboolean remmina_plugin_nx_close_connection(RemminaProtocolWidget *gp)
static gboolean remmina_plugin_nx_query_feature(RemminaProtocolWidget *gp, const RemminaProtocolFeature *feature)
{
TRACE_CALL("remmina_plugin_nx_query_feature");
return FALSE;
}
static void remmina_plugin_nx_call_feature(RemminaProtocolWidget *gp, const RemminaProtocolFeature *feature)
{
TRACE_CALL("remmina_plugin_nx_call_feature");
}
static gpointer quality_list[] =
......@@ -715,6 +737,7 @@ static RemminaProtocolPlugin remmina_plugin_nx =
G_MODULE_EXPORT gboolean
remmina_plugin_entry(RemminaPluginService *service)
{
TRACE_CALL("remmina_plugin_entry");
Display *dpy;
XkbRF_VarDefsRec vd;
gchar *s;
......
This diff is collapsed.
......@@ -39,6 +39,7 @@
static void remmina_nx_session_manager_set_sensitive(RemminaProtocolWidget *gp, gboolean sensitive)
{
TRACE_CALL("remmina_nx_session_manager_set_sensitive");
RemminaPluginNxData *gpdata;
gpdata = (RemminaPluginNxData*) g_object_get_data(G_OBJECT(gp), "plugin-data");
......@@ -57,6 +58,7 @@ static void remmina_nx_session_manager_set_sensitive(RemminaProtocolWidget *gp,
static gboolean remmina_nx_session_manager_selection_func(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path,
gboolean path_currently_selected, gpointer user_data)
{
TRACE_CALL("remmina_nx_session_manager_selection_func");
RemminaProtocolWidget *gp;
RemminaPluginNxData *gpdata;
......@@ -79,6 +81,7 @@ static gboolean remmina_nx_session_manager_selection_func(GtkTreeSelection *sele
static void remmina_nx_session_manager_send_signal(RemminaPluginNxData *gpdata, gint event_type)
{
TRACE_CALL("remmina_nx_session_manager_send_signal");
guchar dummy = (guchar) event_type;
/* Signal the NX thread to resume execution */
if (write(gpdata->event_pipe[1], &dummy, 1))
......@@ -88,6 +91,7 @@ static void remmina_nx_session_manager_send_signal(RemminaPluginNxData *gpdata,
static void remmina_nx_session_manager_on_response(GtkWidget *dialog, gint response_id, RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_nx_session_manager_on_response");
RemminaPluginNxData *gpdata;
gint event_type;
......@@ -119,6 +123,7 @@ static void remmina_nx_session_manager_on_response(GtkWidget *dialog, gint respo
static gboolean remmina_nx_session_manager_main(RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_nx_session_manager_main");
RemminaPluginNxData *gpdata;
RemminaFile *remminafile;
GtkWidget *dialog;
......@@ -231,6 +236,7 @@ static gboolean remmina_nx_session_manager_main(RemminaProtocolWidget *gp)
void remmina_nx_session_manager_start(RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_nx_session_manager_start");
RemminaPluginNxData *gpdata;
gpdata = (RemminaPluginNxData*) g_object_get_data(G_OBJECT(gp), "plugin-data");
......
......@@ -44,6 +44,7 @@
UINT32 remmina_rdp_cliprdr_get_format_from_gdkatom(GdkAtom atom)
{
TRACE_CALL("remmina_rdp_cliprdr_get_format_from_gdkatom");
gchar* name = gdk_atom_name(atom);
if (g_strcmp0("UTF8_STRING", name) == 0 || g_strcmp0("text/plain;charset=utf-8", name) == 0)
{
......@@ -74,6 +75,7 @@ UINT32 remmina_rdp_cliprdr_get_format_from_gdkatom(GdkAtom atom)
void remmina_rdp_cliprdr_get_target_types(UINT32** formats, UINT16* size, GdkAtom* types, int count)
{
TRACE_CALL("remmina_rdp_cliprdr_get_target_types");
int i;
*size = 1;
*formats = (UINT32*) malloc(sizeof(UINT32) * (count+1));
......@@ -94,6 +96,7 @@ void remmina_rdp_cliprdr_get_target_types(UINT32** formats, UINT16* size, GdkAto
static UINT8* lf2crlf(UINT8* data, int* size)
{
TRACE_CALL("lf2crlf");
UINT8 c;
UINT8* outbuf;
UINT8* out;
......@@ -129,6 +132,7 @@ static UINT8* lf2crlf(UINT8* data, int* size)
static void crlf2lf(UINT8* data, size_t* size)
{
TRACE_CALL("crlf2lf");
UINT8 c;
UINT8* out;
UINT8* in;
......@@ -151,6 +155,7 @@ static void crlf2lf(UINT8* data, size_t* size)
int remmina_rdp_cliprdr_server_file_contents_request(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest)
{
TRACE_CALL("remmina_rdp_cliprdr_server_file_contents_request");
/* UINT32 uSize = 0;
BYTE* pData = NULL;
HRESULT hRet = S_OK;
......@@ -291,6 +296,7 @@ int remmina_rdp_cliprdr_server_file_contents_request(CliprdrClientContext* conte
}
int remmina_rdp_cliprdr_server_file_contents_response(CliprdrClientContext* context, CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse)
{
TRACE_CALL("remmina_rdp_cliprdr_server_file_contents_response");
/*
wfClipboard* clipboard = (wfClipboard*) context->custom;
clipboard->req_fsize = fileContentsResponse->cbRequested;
......@@ -304,6 +310,7 @@ int remmina_rdp_cliprdr_server_file_contents_response(CliprdrClientContext* cont
static int remmina_rdp_cliprdr_monitor_ready(CliprdrClientContext* context, CLIPRDR_MONITOR_READY* monitorReady)
{
TRACE_CALL("remmina_rdp_cliprdr_monitor_ready");
RemminaPluginRdpUiObject* ui;
rfClipboard* clipboard = (rfClipboard*)context->custom;
RemminaProtocolWidget* gp;
......@@ -321,12 +328,14 @@ static int remmina_rdp_cliprdr_monitor_ready(CliprdrClientContext* context, CLIP
static int remmina_rdp_cliprdr_server_capabilities(CliprdrClientContext* context, CLIPRDR_CAPABILITIES* capabilities)
{
TRACE_CALL("remmina_rdp_cliprdr_server_capabilities");
return 1;
}
static int remmina_rdp_cliprdr_server_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST* formatList)
{
TRACE_CALL("remmina_rdp_cliprdr_server_format_list");
/* Called when a user do a "Copy" on the server: we collect all formats
* the server send us and then setup the local clipboard with the appropiate
......@@ -395,12 +404,14 @@ static int remmina_rdp_cliprdr_server_format_list(CliprdrClientContext* context,
static int remmina_rdp_cliprdr_server_format_list_response(CliprdrClientContext* context, CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse)
{
TRACE_CALL("remmina_rdp_cliprdr_server_format_list_response");
return 1;
}
static int remmina_rdp_cliprdr_server_format_data_request(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest)
{
TRACE_CALL("remmina_rdp_cliprdr_server_format_data_request");
RemminaPluginRdpUiObject* ui;
RemminaProtocolWidget* gp;
......@@ -421,6 +432,7 @@ static int remmina_rdp_cliprdr_server_format_data_request(CliprdrClientContext*
static int remmina_rdp_cliprdr_server_format_data_response(CliprdrClientContext* context, CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse)
{
TRACE_CALL("remmina_rdp_cliprdr_server_format_data_response");
UINT8* data;
size_t size;
rfContext* rfi;
......@@ -558,6 +570,7 @@ static int remmina_rdp_cliprdr_server_format_data_response(CliprdrClientContext*
void remmina_rdp_cliprdr_request_data(GtkClipboard *gtkClipboard, GtkSelectionData *selection_data, guint info, RemminaProtocolWidget* gp )
{
TRACE_CALL("remmina_rdp_cliprdr_request_data");
/* Called when someone press "Paste" on the client side.
* We ask to the server the data we need */
......@@ -635,11 +648,13 @@ void remmina_rdp_cliprdr_request_data(GtkClipboard *gtkClipboard, GtkSelectionDa
void remmina_rdp_cliprdr_empty_clipboard(GtkClipboard *gtkClipboard, rfClipboard *clipboard)
{
TRACE_CALL("remmina_rdp_cliprdr_empty_clipboard");
/* No need to do anything here */
}
int remmina_rdp_cliprdr_send_client_capabilities(rfClipboard* clipboard)
{
TRACE_CALL("remmina_rdp_cliprdr_send_client_capabilities");
CLIPRDR_CAPABILITIES capabilities;
CLIPRDR_GENERAL_CAPABILITY_SET generalCapabilitySet;
......@@ -659,6 +674,7 @@ int remmina_rdp_cliprdr_send_client_capabilities(rfClipboard* clipboard)
int remmina_rdp_cliprdr_mt_send_format_list(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_cliprdr_mt_send_format_list");
GtkClipboard* gtkClipboard;
rfClipboard* clipboard = ui->clipboard.clipboard;
rfContext* rfi = GET_DATA(gp);
......@@ -710,6 +726,7 @@ int remmina_rdp_cliprdr_mt_send_format_list(RemminaProtocolWidget* gp, RemminaPl
static void remmina_rdp_cliprdr_send_data_response(rfClipboard* clipboard, BYTE* data, int size)
{
TRACE_CALL("remmina_rdp_cliprdr_send_data_response");
CLIPRDR_FORMAT_DATA_RESPONSE response;
ZeroMemory(&response, sizeof(CLIPRDR_FORMAT_DATA_RESPONSE));
......@@ -723,6 +740,7 @@ static void remmina_rdp_cliprdr_send_data_response(rfClipboard* clipboard, BYTE*
int remmina_rdp_cliprdr_mt_monitor_ready(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_cliprdr_mt_monitor_ready");
rfClipboard *clipboard = ui->clipboard.clipboard;
if ( clipboard->clipboard_wait )
......@@ -741,6 +759,7 @@ int remmina_rdp_cliprdr_mt_monitor_ready(RemminaProtocolWidget* gp, RemminaPlugi
void remmina_rdp_cliprdr_get_clipboard_data(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_cliprdr_get_clipboard_data");
GtkClipboard* gtkClipboard;
rfClipboard* clipboard;
......@@ -838,6 +857,7 @@ void remmina_rdp_cliprdr_get_clipboard_data(RemminaProtocolWidget* gp, RemminaPl
}
void remmina_rdp_cliprdr_set_clipboard_content(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_cliprdr_set_clipboard_content");
GtkClipboard* gtkClipboard;
rfContext* rfi = GET_DATA(gp);
rfClipboard* clipboard;
......@@ -857,6 +877,7 @@ void remmina_rdp_cliprdr_set_clipboard_content(RemminaProtocolWidget* gp, Remmin
void remmina_rdp_cliprdr_set_clipboard_data(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_cliprdr_set_clipboard_data");
GtkClipboard* gtkClipboard;
GtkTargetEntry* targets;
gint n_targets;
......@@ -879,6 +900,7 @@ void remmina_rdp_cliprdr_set_clipboard_data(RemminaProtocolWidget* gp, RemminaPl
void remmina_rdp_event_process_clipboard(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_event_process_clipboard");
switch (ui->clipboard.type)
{
......@@ -906,16 +928,19 @@ void remmina_rdp_event_process_clipboard(RemminaProtocolWidget* gp, RemminaPlugi
void remmina_rdp_clipboard_init(rfContext *rfi)
{
TRACE_CALL("remmina_rdp_clipboard_init");
// Future: initialize rfi->clipboard
}
void remmina_rdp_clipboard_free(rfContext *rfi)
{
TRACE_CALL("remmina_rdp_clipboard_free");
// Future: deinitialize rfi->clipboard
}
void remmina_rdp_cliprdr_init(rfContext* rfi, CliprdrClientContext* cliprdr)
{
TRACE_CALL("remmina_rdp_cliprdr_init");
rfClipboard* clipboard;
clipboard = &(rfi->clipboard);
......
......@@ -45,6 +45,7 @@
static void remmina_rdp_event_on_focus_in(GtkWidget* widget, GdkEventKey* event, RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_on_focus_in");
rfContext* rfi;
rdpInput* input;
GdkModifierType state;
......@@ -87,6 +88,7 @@ static void remmina_rdp_event_on_focus_in(GtkWidget* widget, GdkEventKey* event,
static void remmina_rdp_event_event_push(RemminaProtocolWidget* gp, const RemminaPluginRdpEvent* e)
{
TRACE_CALL("remmina_rdp_event_event_push");
rfContext* rfi;
RemminaPluginRdpEvent* event;
......@@ -107,6 +109,7 @@ static void remmina_rdp_event_event_push(RemminaProtocolWidget* gp, const Remmin
static void remmina_rdp_event_release_key(RemminaProtocolWidget* gp, DWORD scancode)
{
TRACE_CALL("remmina_rdp_event_release_key");
gint i, k;
rfContext* rfi;
RemminaPluginRdpEvent rdp_event = { 0 };
......@@ -149,6 +152,7 @@ static void remmina_rdp_event_release_key(RemminaProtocolWidget* gp, DWORD scanc
static void remmina_rdp_event_scale_area(RemminaProtocolWidget* gp, gint* x, gint* y, gint* w, gint* h)
{
TRACE_CALL("remmina_rdp_event_scale_area");
gint width, height;
gint sx, sy, sw, sh;
rfContext* rfi;
......@@ -196,6 +200,7 @@ static void remmina_rdp_event_scale_area(RemminaProtocolWidget* gp, gint* x, gin
void remmina_rdp_event_update_region(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_event_update_region");
rfContext* rfi;
gint x, y, w, h;
......@@ -214,6 +219,7 @@ void remmina_rdp_event_update_region(RemminaProtocolWidget* gp, RemminaPluginRdp
void remmina_rdp_event_update_rect(RemminaProtocolWidget* gp, gint x, gint y, gint w, gint h)
{
TRACE_CALL("remmina_rdp_event_update_rect");
rfContext* rfi;
rfi = GET_DATA(gp);
......@@ -226,6 +232,7 @@ void remmina_rdp_event_update_rect(RemminaProtocolWidget* gp, gint x, gint y, gi
static gboolean remmina_rdp_event_update_scale_factor(RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_update_scale_factor");
GtkAllocation a;
gboolean scale;
gint width, height;
......@@ -282,6 +289,11 @@ static gboolean remmina_rdp_event_on_expose(GtkWidget *widget, GdkEventExpose *e
static gboolean remmina_rdp_event_on_draw(GtkWidget* widget, cairo_t* context, RemminaProtocolWidget* gp)
#endif
{
#if GTK_VERSION == 2
TRACE_CALL("remmina_rdp_event_on_expose");
#else
TRACE_CALL("remmina_rdp_event_on_draw");
#endif
gboolean scale;
rfContext* rfi;
#if GTK_VERSION == 2
......@@ -323,6 +335,7 @@ static gboolean remmina_rdp_event_on_draw(GtkWidget* widget, cairo_t* context, R
static gboolean remmina_rdp_event_on_configure(GtkWidget* widget, GdkEventConfigure* event, RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_on_configure");
rfContext* rfi;
rfi = GET_DATA(gp);
......@@ -340,6 +353,7 @@ static gboolean remmina_rdp_event_on_configure(GtkWidget* widget, GdkEventConfig
static void remmina_rdp_event_translate_pos(RemminaProtocolWidget* gp, int ix, int iy, UINT16* ox, UINT16* oy)
{
TRACE_CALL("remmina_rdp_event_translate_pos");
rfContext* rfi;
rfi = GET_DATA(gp);
......@@ -359,6 +373,7 @@ static void remmina_rdp_event_translate_pos(RemminaProtocolWidget* gp, int ix, i
static gboolean remmina_rdp_event_on_motion(GtkWidget* widget, GdkEventMotion* event, RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_on_motion");
RemminaPluginRdpEvent rdp_event = { 0 };
rdp_event.type = REMMINA_RDP_EVENT_TYPE_MOUSE;
......@@ -372,6 +387,7 @@ static gboolean remmina_rdp_event_on_motion(GtkWidget* widget, GdkEventMotion* e
static gboolean remmina_rdp_event_on_button(GtkWidget* widget, GdkEventButton* event, RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_on_button");
gint flag;
RemminaPluginRdpEvent rdp_event = { 0 };
......@@ -415,6 +431,7 @@ static gboolean remmina_rdp_event_on_button(GtkWidget* widget, GdkEventButton* e
static gboolean remmina_rdp_event_on_scroll(GtkWidget* widget, GdkEventScroll* event, RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_on_scroll");
gint flag;
RemminaPluginRdpEvent rdp_event = { 0 };
......@@ -455,6 +472,7 @@ static gboolean remmina_rdp_event_on_scroll(GtkWidget* widget, GdkEventScroll* e
static gboolean remmina_rdp_event_on_key(GtkWidget* widget, GdkEventKey* event, RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_on_key");
GdkDisplay* display;
guint16 cooked_keycode;
rfContext* rfi;
......@@ -523,6 +541,7 @@ static gboolean remmina_rdp_event_on_key(GtkWidget* widget, GdkEventKey* event,
gboolean remmina_rdp_event_on_clipboard(GtkClipboard *gtkClipboard, GdkEvent *event, RemminaProtocolWidget *gp)
{
TRACE_CALL("remmina_rdp_event_on_clipboard");
RemminaPluginRdpUiObject* ui;
rfContext* rfi;
rfClipboard* clipboard;
......@@ -544,6 +563,7 @@ gboolean remmina_rdp_event_on_clipboard(GtkClipboard *gtkClipboard, GdkEvent *ev
void remmina_rdp_event_init(RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_init");
gchar* s;
gint flags;
rfContext* rfi;
......@@ -621,6 +641,7 @@ void remmina_rdp_event_init(RemminaProtocolWidget* gp)
void remmina_rdp_event_uninit(RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_uninit");
rfContext* rfi;
RemminaPluginRdpUiObject* ui;
......@@ -666,6 +687,7 @@ void remmina_rdp_event_uninit(RemminaProtocolWidget* gp)
void remmina_rdp_event_update_scale(RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_update_scale");
gint width, height;
gint hscale, vscale;
RemminaFile* remminafile;
......@@ -695,6 +717,7 @@ void remmina_rdp_event_update_scale(RemminaProtocolWidget* gp)
static void remmina_rdp_event_connected(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_event_connected");
rfContext* rfi;
int stride;
......@@ -715,6 +738,7 @@ static void remmina_rdp_event_connected(RemminaProtocolWidget* gp, RemminaPlugin
static void remmina_rdp_event_create_cursor(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_event_create_cursor");
GdkPixbuf* pixbuf;
rfContext* rfi = GET_DATA(gp);
rdpPointer* pointer = (rdpPointer*)ui->cursor.pointer;
......@@ -738,6 +762,7 @@ static void remmina_rdp_event_create_cursor(RemminaProtocolWidget* gp, RemminaPl
static void remmina_rdp_event_free_cursor(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_event_free_cursor");
#if GTK_VERSION == 3
g_object_unref(ui->cursor.pointer->cursor);
#else
......@@ -748,6 +773,7 @@ static void remmina_rdp_event_free_cursor(RemminaProtocolWidget* gp, RemminaPlug
static void remmina_rdp_event_cursor(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_event_cursor");
rfContext* rfi = GET_DATA(gp);
switch (ui->cursor.type)
......@@ -776,12 +802,14 @@ static void remmina_rdp_event_cursor(RemminaProtocolWidget* gp, RemminaPluginRdp
static void remmina_rdp_ui_event_update_scale(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_ui_event_update_scale");
remmina_rdp_event_update_scale(gp);
}
static void remmina_rdp_event_process_event(RemminaProtocolWidget* gp, RemminaPluginRdpUiObject* ui)
{
TRACE_CALL("remmina_rdp_event_process_event");
switch (ui->event.type)
{
case REMMINA_RDP_UI_EVENT_UPDATE_SCALE:
......@@ -793,6 +821,7 @@ static void remmina_rdp_event_process_event(RemminaProtocolWidget* gp, RemminaPl
gboolean remmina_rdp_event_queue_ui(RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_queue_ui");
rfContext* rfi;
RemminaPluginRdpUiObject* ui;
......@@ -853,5 +882,6 @@ gboolean remmina_rdp_event_queue_ui(RemminaProtocolWidget* gp)
void remmina_rdp_event_unfocus(RemminaProtocolWidget* gp)
{
TRACE_CALL("remmina_rdp_event_unfocus");
remmina_rdp_event_release_key(gp, 0);
}
......@@ -38,6 +38,7 @@
gboolean remmina_rdp_file_import_test(const gchar* from_file)
{
TRACE_CALL("remmina_rdp_file_import_test");
gchar* ext;
ext = strrchr(from_file, '.');
......@@ -58,6 +59,7 @@ gboolean remmina_rdp_file_import_test(const gchar* from_file)
static void remmina_rdp_file_import_field(RemminaFile* remminafile, const gchar* key, const gchar* value)
{
TRACE_CALL("remmina_rdp_file_import_field");
if (g_strcmp0(key, "desktopwidth") == 0)
{
remmina_plugin_service->file_set_string(remminafile, "resolution_width", value);
......@@ -131,6 +133,7 @@ static void remmina_rdp_file_import_field(RemminaFile* remminafile, const gchar*
static RemminaFile* remmina_rdp_file_import_channel(GIOChannel* channel)
{
TRACE_CALL("remmina_rdp_file_import_channel");
gchar* p;
const gchar* enc;
gchar* line = NULL;
......@@ -220,6 +223,7 @@ static RemminaFile* remmina_rdp_file_import_channel(GIOChannel* channel)
RemminaFile* remmina_rdp_file_import(const gchar* from_file)
{
TRACE_CALL("remmina_rdp_file_import");
GIOChannel* channel;
GError* error = NULL;
RemminaFile* remminafile;
......@@ -240,6 +244,7 @@ RemminaFile* remmina_rdp_file_import(const gchar* from_file)
gboolean remmina_rdp_file_export_test(RemminaFile* remminafile)
{
TRACE_CALL("remmina_rdp_file_export_test");
if (g_strcmp0(remmina_plugin_service->file_get_string(remminafile, "protocol"), "RDP") == 0)
return TRUE;
......@@ -248,6 +253,7 @@ gboolean remmina_rdp_file_export_test(RemminaFile* remminafile)
gboolean remmina_rdp_file_export_channel(RemminaFile* remminafile, FILE* fp)
{
TRACE_CALL("remmina_rdp_file_export_channel");
gchar* s;
gchar* p;
const gchar* cs;
......@@ -315,6 +321,7 @@ gboolean remmina_rdp_file_export_channel(RemminaFile* remminafile, FILE* fp)
gboolean remmina_rdp_file_export(RemminaFile* remminafile, const gchar* to_file)
{
TRACE_CALL("remmina_rdp_file_export");
FILE* fp;
gchar* p;
gboolean ret;
......
......@@ -45,6 +45,7 @@
static void rf_desktop_resize(rdpContext* context)
{
TRACE_CALL("rf_desktop_resize");
RemminaProtocolWidget* gp;
RemminaPluginRdpUiObject* ui;
rfContext* rfi;
......@@ -70,60 +71,72 @@ static void rf_desktop_resize(rdpContext* context)
static void rf_gdi_palette(rdpContext* context, PALETTE_UPDATE* palette)
{
TRACE_CALL("rf_gdi_palette");
g_print("palette\n");
}
static void rf_gdi_set_bounds(rdpContext* context, rdpBounds* bounds)
{
TRACE_CALL("rf_gdi_set_bounds");
}
static void rf_gdi_dstblt(rdpContext* context, DSTBLT_ORDER* dstblt)
{
TRACE_CALL("rf_gdi_dstblt");
g_print("dstblt\n");
}
static void rf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
{
TRACE_CALL("rf_gdi_patblt");
g_print("patblt\n");
}