enlightenment/src/modules/everything/evry_plug_clipboard.c

52 lines
1.1 KiB
C
Raw Normal View History

#include "e_mod_main.h"
static Evry_Action *act;
static Ecore_X_Window clipboard_win = 0;
static int
_action(Evry_Action *action)
{
const Evry_Item *it = action->it1.item;
ecore_x_selection_primary_set(clipboard_win, it->label, strlen(it->label));
ecore_x_selection_clipboard_set(clipboard_win, it->label, strlen(it->label));
return 1;
}
static int
_check_item(Evry_Action *action __UNUSED__, const Evry_Item *it)
{
return it && it->label && (strlen(it->label) > 0);
}
Eina_Bool
evry_plug_clipboard_init(void)
{
if (!evry_api_version_check(EVRY_API_VERSION))
return EINA_FALSE;
Ecore_X_Window win = ecore_x_window_new(0, 0, 0, 1, 1);
if (!win) return EINA_FALSE;
Fix common misspellings Some misspellings were manually reverted since in E there are tons of .po with phrases in other languages. Other than that all the changes in the following files were reverted: * src/modules/illume/dicts/English_(US).dic * src/modules/illume-keyboard/dicts/English_(US).dic Following misspellings were fixed: acquited->acquitted adres->address adress->address alreayd->already aquire->acquire arbitarily->arbitrarily cant->can't Capetown->Cape carefull->careful causalities->casualties Celcius->Celsius certian->certain commandoes->commandos considerd->considered conveyer->conveyor dependant->dependent didnt->didn't discontentment->discontent doesnt->doesn't everytime->every exemple->example existance->existence existant->existent existince->existence Farenheit->Fahrenheit forbad->forbade funguses->fungi guage->gauge guerilla->guerrilla guerillas->guerrillas happend->happened hasnt->hasn't heros->heroes inbetween->between independant->independent inital->initial intrusted->entrusted irregardless->regardless isnt->isn't knifes->knives layed->laid loosing->losing marrage->marriage midwifes->midwives miniscule->minuscule monickers->monikers mroe->more noone->no one occured->occurred omre->more paralell->parallel payed->paid planed->planned quitted->quit quizes->quizzes seperated->separated seperate->separate shoudl->should similiar->similar simplier->simpler specifiying->specifying teh->the toke->took torpedos->torpedoes Tuscon->Tucson unecessary->unnecessary useage->usage usefull->useful useing->using waht->what wanna->want whith->with wich->which withing->within SVN revision: 52006
2010-09-08 16:59:07 -07:00
//FIXME: Icon name doesn't follow FDO Spec
act = EVRY_ACTION_NEW(N_("Copy to Clipboard"),
EVRY_TYPE_TEXT, 0,
"everything-clipboard",
_action, _check_item);
act->remember_context = EINA_TRUE;
evry_action_register(act, 10);
clipboard_win = win;
return EINA_TRUE;
}
void
evry_plug_clipboard_shutdown(void)
{
ecore_x_window_free(clipboard_win);
evry_action_free(act);
}