1 #include "e_mod_main.h"
3 static Evry_Action *act;
4 static Ecore_X_Window clipboard_win = 0;
7 _action(Evry_Action *act)
9 const Evry_Item *it = act->it1.item;
11 ecore_x_selection_primary_set(clipboard_win, it->label, strlen(it->label));
12 ecore_x_selection_clipboard_set(clipboard_win, it->label, strlen(it->label));
18 _check_item(Evry_Action *act __UNUSED__, const Evry_Item *it)
20 return it && it->label && (strlen(it->label) > 0);
24 evry_plug_clipboard_init(void)
26 if (!evry_api_version_check(EVRY_API_VERSION))
29 Ecore_X_Window win = ecore_x_window_new(0, 0, 0, 1, 1);
30 if (!win) return EINA_FALSE;
32 //FIXME: Icon name doesn't follow FDO Spec
33 act = EVRY_ACTION_NEW("Copy to Clipboard",
35 "everything-clipboard",
36 _action, _check_item);
37 act->remember_context = EINA_TRUE;
38 evry_action_register(act, 10);
46 evry_plug_clipboard_shutdown(void)
48 ecore_x_window_free(clipboard_win);
49 evry_action_free(act);