summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/directvnc/files/directvnc-0.6.1-api-fix.patch')
-rw-r--r--net-misc/directvnc/files/directvnc-0.6.1-api-fix.patch143
1 files changed, 143 insertions, 0 deletions
diff --git a/net-misc/directvnc/files/directvnc-0.6.1-api-fix.patch b/net-misc/directvnc/files/directvnc-0.6.1-api-fix.patch
new file mode 100644
index 000000000000..f49f4e55d73a
--- /dev/null
+++ b/net-misc/directvnc/files/directvnc-0.6.1-api-fix.patch
@@ -0,0 +1,143 @@
+--- dfb.c 2002-05-25 04:12:15.000000000 -0400
++++ ../../dfb.c 2002-07-06 10:20:21.000000000 -0400
+@@ -18,7 +18,6 @@
+ */
+
+ #include "directvnc.h"
+-#include "keysymdef.h"
+ #include <math.h>
+
+ /* DirectFB interfaces needed */
+@@ -61,14 +60,13 @@
+ /* FIXME */
+ dsc.pixelformat = DSPF_RGB16;
+
+- dfb->CreateSurface(dfb, &dsc, &primary );
++ DFBCHECK(dfb->CreateSurface(dfb, &dsc, &primary ));
+ primary->GetSize (primary, &opt.client.width, &opt.client.height);
+
+ DFBCHECK(dfb->GetInputDevice( dfb, DIDID_KEYBOARD, &keyboard ));
+ DFBCHECK(dfb->GetInputDevice( dfb, DIDID_MOUSE, &mouse ));
+ DFBCHECK(keyboard->CreateEventBuffer(keyboard, &input_buffer));
+ DFBCHECK(mouse->AttachEventBuffer(mouse, input_buffer));
+-
+ }
+
+
+@@ -156,36 +154,23 @@
+ * screen gets blanked for every unsuccessful connect (wrong password)
+ * which is not pretty either. I think I prefer checking here for the time
+ * being. */
+-
+ if (!dfb)
+ return 0;
+-
+ while(input_buffer->GetEvent(input_buffer, DFB_EVENT(&evt)) == DFB_OK)
+ {
+ switch (evt.type)
+ {
+ case DIET_KEYPRESS:
+- /* quit on ctrl-q */
+- if (evt.key_ascii && evt.key_ascii == 113
+- && evt.modifiers & DIMK_CTRL)
++ /* quit on ctrl-q FIXME make this configurable*/
++ if (evt.key_id == DIKI_Q && evt.modifiers & DIMM_CONTROL)
+ {
+ dfb_deinit();
+ exit(1);
+ }
+- /* ascii 13 is CR. We want XK_Return, so dont send the ascii but
+- * translate into keysym */
+- if (evt.key_ascii && evt.key_ascii != 13)
+- {
+- rfb_send_key_event(evt.key_ascii, 1);
+- }
+- else
+- rfb_send_key_event(dfb_get_keysym_from_keycode(evt.keycode, evt.modifiers), 1);
++ rfb_send_key_event(evt.key_symbol, 1);
+ break;
+ case DIET_KEYRELEASE:
+- if (evt.key_ascii && evt.key_ascii != 13)
+- rfb_send_key_event(evt.key_ascii, 0);
+- else
+- rfb_send_key_event(dfb_get_keysym_from_keycode(evt.keycode, evt.modifiers), 0);
++ rfb_send_key_event(evt.key_symbol, 0);
+ break;
+ case DIET_AXISMOTION:
+ if (evt.flags & DIEF_AXISREL)
+@@ -250,75 +235,6 @@
+ }
+
+ int
+-dfb_get_keysym_from_keycode(int keycode, int modifiers)
+-{
+-
+- switch (keycode)
+- {
+- case DIKC_BACKSPACE: return XK_BackSpace;
+- case DIKC_ENTER: return XK_Return;
+- case DIKC_PAUSE: return XK_Pause;
+- case DIKC_SCRLOCK: return XK_Scroll_Lock;
+- case DIKC_CAPSLOCK: return XK_Caps_Lock;
+- case DIKC_NUMLOCK: return XK_Num_Lock;
+-
+-
+- case DIKC_ALT: return XK_Alt_L;
+- case DIKC_ALTGR: return XK_Super_R;
+- case DIKC_SHIFT: return XK_Shift_R;
+- case DIKC_CTRL: return XK_Control_R;
+- case DIKC_INSERT: return XK_Insert;
+- case DIKC_DELETE: return XK_Delete;
+-
+- case DIKC_HOME: return XK_Home;
+- case DIKC_LEFT: return XK_Left;
+- case DIKC_RIGHT: return XK_Right;
+- case DIKC_UP: return XK_Up;
+- case DIKC_DOWN: return XK_Down;
+- case DIKC_PAGEUP: return XK_Page_Up;
+- case DIKC_PAGEDOWN: return XK_Page_Down;
+- case DIKC_END: return XK_End;
+-
+- /* Keypad Keys */
+- case DIKC_KP_PLUS: return XK_KP_Add;
+- case DIKC_KP_MULT: return XK_KP_Multiply;
+- case DIKC_KP_MINUS: return XK_KP_Subtract;
+- case DIKC_KP_DIV: return XK_KP_Divide;
+- case DIKC_KP_ENTER: return XK_KP_Enter;
+- case DIKC_KP_SPACE: return XK_KP_Space;
+- case DIKC_KP_TAB: return XK_KP_Tab;
+-
+- case DIKC_KP_0: return XK_KP_0;
+- case DIKC_KP_1: return XK_KP_1;
+- case DIKC_KP_2: return XK_KP_2;
+- case DIKC_KP_3: return XK_KP_3;
+- case DIKC_KP_4: return XK_KP_4;
+- case DIKC_KP_5: return XK_KP_5;
+- case DIKC_KP_6: return XK_KP_6;
+- case DIKC_KP_7: return XK_KP_7;
+- case DIKC_KP_8: return XK_KP_8;
+- case DIKC_KP_9: return XK_KP_9;
+-
+- case DIKC_KP_DELETE: return XK_KP_Delete;
+- case DIKC_KP_INSERT: return XK_KP_Insert;
+- case DIKC_KP_END: return XK_KP_End;
+- case DIKC_KP_DOWN: return XK_KP_Down;
+- case DIKC_KP_PAGE_DOWN: return XK_KP_Page_Down;
+- case DIKC_KP_LEFT: return XK_KP_Left;
+- case DIKC_KP_BEGIN: return XK_KP_Begin;
+- case DIKC_KP_RIGHT: return XK_KP_Right;
+- case DIKC_KP_HOME: return XK_KP_Home;
+- case DIKC_KP_UP: return XK_KP_Up;
+- case DIKC_KP_PAGE_UP: return XK_KP_Page_Up;
+-
+- case DIKC_UNKNOWN:
+- fprintf(stderr, "Unknown key pressed\n");
+- }
+-
+- return -1;
+-}
+-
+-int
+ dfb_draw_rect_with_rgb(int x, int y, int w, int h, int r, int g, int b)
+ {
+ primary->SetColor(primary, r,g,b,0xFF);