From 1640652ee044b7fbf0c5b7e84b0b3aa319fbae6e Mon Sep 17 00:00:00 2001 From: C-o-r-E Date: Mon, 10 Jun 2013 19:52:16 -0400 Subject: [PATCH] core: added OnPan, xfreerdp: modified special keys --- client/X11/xf_keyboard.c | 32 ++++++++++++++++++++++++-------- include/freerdp/client.h | 3 +++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/client/X11/xf_keyboard.c b/client/X11/xf_keyboard.c index 1c02c8ad5..a57451fb3 100644 --- a/client/X11/xf_keyboard.c +++ b/client/X11/xf_keyboard.c @@ -284,12 +284,17 @@ BOOL xf_kbd_handle_special_keys(xfInfo* xfi, KeySym keysym) || xf_kbd_key_pressed(xfi, XK_Control_R))) { + /* xfi->offset_x -= 5; xf_transform_window(xfi); xf_draw_screen_scaled(xfi, 0, 0, 0, 0, FALSE); printf("pan left : %d\n", xfi->offset_x); + */ + + IFCALL(xfi->client->OnPan, xfi->instance, -5, 0); + return TRUE; } } @@ -302,15 +307,19 @@ BOOL xf_kbd_handle_special_keys(xfInfo* xfi, KeySym keysym) || xf_kbd_key_pressed(xfi, XK_Control_R))) { - xfi->offset_x += 5; /* - if (xfi->offset_x > 0) - xfi->offset_x = 0; -*/ + xfi->offset_x += 5; + + //if (xfi->offset_x > 0) + // xfi->offset_x = 0; + xf_transform_window(xfi); xf_draw_screen_scaled(xfi, 0, 0, 0, 0, FALSE); printf("pan right : %d\n", xfi->offset_x); +*/ + + IFCALL(xfi->client->OnPan, xfi->instance, 5, 0); return TRUE; } } @@ -323,12 +332,15 @@ BOOL xf_kbd_handle_special_keys(xfInfo* xfi, KeySym keysym) || xf_kbd_key_pressed(xfi, XK_Control_R))) { +/* xfi->offset_y -= 5; xf_transform_window(xfi); xf_draw_screen_scaled(xfi, 0, 0, 0, 0, FALSE); printf("pan up : %d\n", xfi->offset_y); +*/ + IFCALL(xfi->client->OnPan, xfi->instance, 0, -5); return TRUE; } } @@ -341,18 +353,22 @@ BOOL xf_kbd_handle_special_keys(xfInfo* xfi, KeySym keysym) || xf_kbd_key_pressed(xfi, XK_Control_R))) { - xfi->offset_y += 5; /* - if (xfi->offset_y > 0) - xfi->offset_y = 0; -*/ + xfi->offset_y += 5; + + //if (xfi->offset_y > 0) + //xfi->offset_y = 0; + xf_transform_window(xfi); xf_draw_screen_scaled(xfi, 0, 0, 0, 0, FALSE); printf("pan down : %d\n", xfi->offset_y); +*/ + IFCALL(xfi->client->OnPan, xfi->instance, 0, 5); return TRUE; } } + return FALSE; } diff --git a/include/freerdp/client.h b/include/freerdp/client.h index a65a83cf6..1a30a1a1e 100644 --- a/include/freerdp/client.h +++ b/include/freerdp/client.h @@ -40,12 +40,15 @@ typedef void (*pOnWindowStateChange)(freerdp* instance, int state); typedef void (*pOnErrorInfo)(freerdp* instance, UINT32 code); typedef void (*pOnParamChange)(freerdp* instance, int id); +typedef void (*pOnPan)(freerdp* instance, int xdiff, int ydiff); + struct rdp_client { pOnResizeWindow OnResizeWindow; pOnWindowStateChange OnWindowStateChange; pOnErrorInfo OnErrorInfo; pOnParamChange OnParamChange; + pOnPan OnPan; }; /**