From 0d7f0081b5ff2736f58473857ebdf38b711cc240 Mon Sep 17 00:00:00 2001 From: Hyoyoung Chang Date: Thu, 16 Sep 2010 14:48:18 +0900 Subject: [PATCH] enable by default --- debian/cbhm.postinst | 2 +- debian/changelog | 9 +++++++++ src/clipdrawer.c | 4 +++- src/xcnphandler.c | 42 +++++++++++++++++++++++++++++++++++++++++- src/xcnphandler.h | 2 ++ 5 files changed, 56 insertions(+), 3 deletions(-) diff --git a/debian/cbhm.postinst b/debian/cbhm.postinst index 5bcff8c..8ab65f6 100755 --- a/debian/cbhm.postinst +++ b/debian/cbhm.postinst @@ -1,5 +1,5 @@ #!/bin/sh -#ln -s /etc/init.d/cbhm /etc/rc.d/rc3.d/S95cbhm +ln -s /etc/init.d/cbhm /etc/rc.d/rc3.d/S95cbhm sync diff --git a/debian/changelog b/debian/changelog index 2038709..a523540 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +cbhm (0.1.0-11) unstable; urgency=low + + * case of inhouse package + * Git: 165.213.180.234:/git/slp/pkgs/cbhm + * Tag: cbhm_0.1.0-11 + * enable by default + + -- Hyoyoung Chang Thu, 16 Sep 2010 14:46:41 +0900 + cbhm (0.1.0-10) unstable; urgency=low * case of inhouse package diff --git a/src/clipdrawer.c b/src/clipdrawer.c index a3cf06d..f996458 100644 --- a/src/clipdrawer.c +++ b/src/clipdrawer.c @@ -33,7 +33,7 @@ _image_click(void *data, Evas_Object *obj, void *event_info) p = malloc(len + 10); snprintf(p,len+10,"file:///%s/%s",dir,file); - elm_selection_set(1,data,2,p); + elm_selection_set(/*secondary*/1,data,/*image*/2,p); } static void _list_click( void *data, Evas_Object *obj, void *event_info ) @@ -58,6 +58,8 @@ static void _list_click( void *data, Evas_Object *obj, void *event_info ) snprintf(p, clen+1, "%s", cpdata); elm_selection_set(1, obj, /*mark up*/1, p); +// set_selection_secondary_data(p); + clipdrawer_lower_view(ad); } diff --git a/src/xcnphandler.c b/src/xcnphandler.c index b9050e4..4d40977 100755 --- a/src/xcnphandler.c +++ b/src/xcnphandler.c @@ -359,7 +359,7 @@ static int _xsel_request_cb(void *data, int ev_type, void *event) if (ev->selection != atomClipboard) return TRUE; - + DTRACE("SelectionRequest\n"); processing_selection_request(ev); @@ -490,3 +490,43 @@ static int _xclient_msg_cb(void *data, int ev_type, void *event) return TRUE; } +static Ecore_X_Window get_selection_secondary_target_win() +{ + Atom actual_type; + int actual_format; + unsigned long nitems, bytes_after; + unsigned char *prop_return = NULL; + Atom atomCbhmXTarget = XInternAtom(g_disp, "CBHM_XTARGET", False); + static Ecore_X_Window xtarget = None; + if (xtarget != None) + return xtarget; + + if(Success == + XGetWindowProperty(g_disp, DefaultRootWindow(g_disp), atomCbhmXTarget, + 0, sizeof(Ecore_X_Window), False, XA_WINDOW, + &actual_type, &actual_format, &nitems, &bytes_after, &prop_return) && + prop_return) + { + xtarget = *(Ecore_X_Window*)prop_return; + XFree(prop_return); + fprintf(stderr, "## find clipboard secondary target at root\n"); + } + return xtarget; +} + +int set_selection_secondary_data(char *sdata) +{ +// elm_selection_set(1, obj, /*mark up*/1, p); + Ecore_X_Window setwin = get_selection_secondary_target_win(); + if (setwin == None) + return 0; + + if (sdata == NULL) + return 0; + + int slen = strlen(sdata); + + fprintf(stderr, "## cbhm xwin = 0x%x, d = %s\n", setwin, sdata); + + ecore_x_selection_secondary_set(setwin, sdata, slen); +} diff --git a/src/xcnphandler.h b/src/xcnphandler.h index 9ea42ae..eed721a 100755 --- a/src/xcnphandler.h +++ b/src/xcnphandler.h @@ -34,6 +34,8 @@ static int _xsel_clear_cb(void *data, int ev_type, void *event); static int _xsel_request_cb(void *data, int ev_type, void *event); static int _xsel_notify_cb(void *data, int ev_type, void *event); static int _xclient_msg_cb(void *data, int ev_type, void *event); +static Ecore_X_Window get_selection_secondary_target_win(); +int set_selection_secondary_data(char *sdata); #define ATOM_CLIPBOARD_NAME "CLIPBOARD" #define ATOM_CLIPBOARD_MANAGER_NAME "CLIPBOARD_MANAGER" -- 2.7.4