1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
9 static Evas_Object *glb;
11 >>>>>>> remotes/origin/upstream
13 _bt_copy_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
15 Evas_Object *en = (Evas_Object*)(data);
16 const char *txt = elm_object_text_get(en);
19 elm_cnp_selection_set(ELM_SEL_TYPE_CLIPBOARD, elm_object_parent_widget_get(en),
21 elm_object_text_set(glb, txt);
22 elm_cnp_selection_set(elm_object_parent_widget_get(en), ELM_SEL_TYPE_CLIPBOARD,
23 >>>>>>> remotes/origin/upstream
24 ELM_SEL_FORMAT_TEXT, txt, strlen(txt));
28 _bt_paste_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
30 Evas_Object *en = (Evas_Object*)(data);
33 elm_cnp_selection_get(ELM_SEL_TYPE_CLIPBOARD, ELM_SEL_FORMAT_TEXT,
36 elm_cnp_selection_get(en, ELM_SEL_TYPE_CLIPBOARD, ELM_SEL_FORMAT_TEXT,
41 _bt_clear_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
43 Evas_Object *en = (Evas_Object*)(data);
45 elm_object_text_set(glb, "");
46 elm_object_cnp_selection_clear(elm_object_parent_widget_get(en), ELM_SEL_TYPE_CLIPBOARD);
47 >>>>>>> remotes/origin/upstream
51 test_cnp(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
54 Evas_Object *win, *bg, *gd, *bt, *en;
56 Evas_Object *win, *bg, *gd, *bt, *en, *lb;
57 >>>>>>> remotes/origin/upstream
59 win = elm_win_add(NULL, "CopyPaste", ELM_WIN_BASIC);
60 elm_win_title_set(win, "CopyPaste");
61 elm_win_autodel_set(win, EINA_TRUE);
64 elm_win_resize_object_add(win, bg);
65 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
68 gd = elm_grid_add(win);
69 elm_grid_size_set(gd, 100, 100);
70 elm_win_resize_object_add(win, gd);
71 evas_object_size_hint_weight_set(gd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
74 en = elm_entry_add(win);
75 elm_entry_scrollable_set(en, EINA_TRUE);
76 elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
77 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
78 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
80 elm_object_text_set(en,
81 "Elementary provides "
83 elm_grid_pack(gd, en, 10, 10, 60, 40);
85 elm_object_text_set(en, "Elementary provides ");
86 elm_grid_pack(gd, en, 10, 10, 60, 30);
87 >>>>>>> remotes/origin/upstream
90 bt = elm_button_add(win);
91 elm_object_text_set(bt, "Copy from left entry");
92 evas_object_smart_callback_add(bt, "clicked", _bt_copy_clicked, en);
94 elm_grid_pack(gd, bt, 70, 10, 22, 40);
96 elm_grid_pack(gd, bt, 70, 10, 22, 30);
99 bt = elm_button_add(win);
100 elm_object_text_set(bt, "Clear clipboard");
101 evas_object_smart_callback_add(bt, "clicked", _bt_clear_clicked, en);
102 elm_grid_pack(gd, bt, 70, 70, 22, 20);
103 >>>>>>> remotes/origin/upstream
104 evas_object_show(bt);
106 en = elm_entry_add(win);
107 elm_entry_scrollable_set(en, EINA_TRUE);
108 elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
109 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
110 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
112 elm_object_text_set(en,
113 "rich copying and pasting functionality,"
115 elm_grid_pack(gd, en, 10, 50, 60, 40);
117 elm_object_text_set(en, "rich copying and pasting functionality,");
118 elm_grid_pack(gd, en, 10, 40, 60, 30);
119 >>>>>>> remotes/origin/upstream
120 evas_object_show(en);
122 bt = elm_button_add(win);
123 elm_object_text_set(bt, "Paste to left entry");
124 evas_object_smart_callback_add(bt, "clicked", _bt_paste_clicked, en);
126 elm_grid_pack(gd, bt, 70, 50, 22, 40);
127 evas_object_show(bt);
129 evas_object_resize(win, 480, 140);
131 elm_grid_pack(gd, bt, 70, 40, 22, 30);
132 evas_object_show(bt);
134 lb = elm_label_add(win);
135 elm_object_text_set(lb, "<b>Clipboard:</b>");
136 evas_object_size_hint_weight_set(lb, 0.0, 0.0);
137 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, EVAS_HINT_FILL);
138 elm_grid_pack(gd, lb, 10, 70, 60, 10);
139 evas_object_show(lb);
141 glb = elm_label_add(win);
142 elm_object_text_set(glb, "");
143 evas_object_size_hint_weight_set(glb, 0.0, 0.0);
144 evas_object_size_hint_align_set(glb, EVAS_HINT_FILL, EVAS_HINT_FILL);
145 elm_grid_pack(gd, glb, 10, 80, 60, 10);
146 evas_object_show(glb);
148 evas_object_resize(win, 480, 200);
149 >>>>>>> remotes/origin/upstream
150 evas_object_show(win);