summaryrefslogtreecommitdiff
path: root/src/examples/edje
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2014-01-04 13:25:21 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2014-01-04 13:25:21 +0900
commit3ebc18731fa3712e9f7b29758908bf19fec7df83 (patch)
treea8aa6907b8c4be867689d02331aab1288e68af7e /src/examples/edje
parent9637c2b835c4b48b84a4509d57c1af19d1b8608f (diff)
Use key instead of keyname for considering setxkbmap
Diffstat (limited to 'src/examples/edje')
-rw-r--r--src/examples/edje/edje-animations.c6
-rw-r--r--src/examples/edje/edje-basic.c10
-rw-r--r--src/examples/edje/edje-basic2.c12
-rw-r--r--src/examples/edje/edje-box.c12
-rw-r--r--src/examples/edje/edje-box2.c8
-rw-r--r--src/examples/edje/edje-drag.c16
-rw-r--r--src/examples/edje/edje-perspective.c22
-rw-r--r--src/examples/edje/edje-signals-messages.c8
-rw-r--r--src/examples/edje/sigtest.c14
9 files changed, 54 insertions, 54 deletions
diff --git a/src/examples/edje/edje-animations.c b/src/examples/edje/edje-animations.c
index 413394c5ca..65f60c266d 100644
--- a/src/examples/edje/edje-animations.c
+++ b/src/examples/edje/edje-animations.c
@@ -73,7 +73,7 @@ _on_key_down(void *data EINA_UNUSED, Evas *evas EINA_UNUSED, Evas_Object *obj, v
73 73
74 ev = (Evas_Event_Key_Down *)event_info; 74 ev = (Evas_Event_Key_Down *)event_info;
75 75
76 if (!strcmp(ev->keyname, "h")) 76 if (!strcmp(ev->key, "h"))
77 { 77 {
78 fprintf(stdout, commands); 78 fprintf(stdout, commands);
79 return; 79 return;
@@ -137,11 +137,11 @@ _on_key_down(void *data EINA_UNUSED, Evas *evas EINA_UNUSED, Evas_Object *obj, v
137 edje_object_animation_set(obj, EINA_FALSE); 137 edje_object_animation_set(obj, EINA_FALSE);
138 fprintf(stdout, "Stopping the animation in the Edje object\n"); 138 fprintf(stdout, "Stopping the animation in the Edje object\n");
139 } 139 }
140 else if (!strcmp(ev->keyname, "Escape")) 140 else if (!strcmp(ev->key, "Escape"))
141 ecore_main_loop_quit(); 141 ecore_main_loop_quit();
142 else 142 else
143 { 143 {
144 printf("unhandled key: %s\n", ev->keyname); 144 printf("unhandled key: %s\n", ev->key);
145 fprintf(stdout, commands); 145 fprintf(stdout, commands);
146 } 146 }
147} 147}
diff --git a/src/examples/edje/edje-basic.c b/src/examples/edje/edje-basic.c
index 4c7fad6357..a49cf08433 100644
--- a/src/examples/edje/edje-basic.c
+++ b/src/examples/edje/edje-basic.c
@@ -49,12 +49,12 @@ _on_keydown(void *data,
49 ev = (Evas_Event_Key_Down *)einfo; 49 ev = (Evas_Event_Key_Down *)einfo;
50 edje_obj = (Evas_Object *)data; 50 edje_obj = (Evas_Object *)data;
51 51
52 if (strcmp(ev->keyname, "h") == 0) /* print help */ 52 if (strcmp(ev->key, "h") == 0) /* print help */
53 { 53 {
54 fprintf(stdout, commands); 54 fprintf(stdout, commands);
55 return; 55 return;
56 } 56 }
57 else if (strcmp(ev->keyname, "s") == 0) /* global scaling factor */ 57 else if (strcmp(ev->key, "s") == 0) /* global scaling factor */
58 { 58 {
59 double scale = edje_scale_get(); 59 double scale = edje_scale_get();
60 60
@@ -69,7 +69,7 @@ _on_keydown(void *data,
69 69
70 return; 70 return;
71 } 71 }
72 else if (strcmp(ev->keyname, "r") == 0) /* individual scaling factor */ 72 else if (strcmp(ev->key, "r") == 0) /* individual scaling factor */
73 { 73 {
74 double scale = edje_object_scale_get(edje_obj); 74 double scale = edje_object_scale_get(edje_obj);
75 75
@@ -86,11 +86,11 @@ _on_keydown(void *data,
86 86
87 return; 87 return;
88 } 88 }
89 else if (!strcmp(ev->keyname, "Escape")) 89 else if (!strcmp(ev->key, "Escape"))
90 ecore_main_loop_quit(); 90 ecore_main_loop_quit();
91 else 91 else
92 { 92 {
93 printf("unhandled key: %s\n", ev->keyname); 93 printf("unhandled key: %s\n", ev->key);
94 fprintf(stdout, commands); 94 fprintf(stdout, commands);
95 } 95 }
96} 96}
diff --git a/src/examples/edje/edje-basic2.c b/src/examples/edje/edje-basic2.c
index 8836e7e700..e3cdde395f 100644
--- a/src/examples/edje/edje-basic2.c
+++ b/src/examples/edje/edje-basic2.c
@@ -44,29 +44,29 @@ _on_key_down(void *data,
44 44
45 evas_object_geometry_get(edje_obj, &x, &y, NULL, NULL); 45 evas_object_geometry_get(edje_obj, &x, &y, NULL, NULL);
46 46
47 if(strcmp(ev->keyname,"Escape") == 0) 47 if(strcmp(ev->key,"Escape") == 0)
48 { 48 {
49 ecore_main_loop_quit(); 49 ecore_main_loop_quit();
50 } 50 }
51 else if(strcmp(ev->keyname, "Down") == 0) 51 else if(strcmp(ev->key, "Down") == 0)
52 { 52 {
53 y+=WALK; 53 y+=WALK;
54 } 54 }
55 else if(strcmp(ev->keyname, "Up") == 0) 55 else if(strcmp(ev->key, "Up") == 0)
56 { 56 {
57 y-=WALK; 57 y-=WALK;
58 } 58 }
59 else if(strcmp(ev->keyname, "Right") == 0) 59 else if(strcmp(ev->key, "Right") == 0)
60 { 60 {
61 x+=WALK; 61 x+=WALK;
62 } 62 }
63 else if(strcmp(ev->keyname, "Left") == 0) 63 else if(strcmp(ev->key, "Left") == 0)
64 { 64 {
65 x-=WALK; 65 x-=WALK;
66 } 66 }
67 else 67 else
68 { 68 {
69 fprintf(stdout, "Key %s not supported.\nCommands:%s", ev->keyname, commands); 69 fprintf(stdout, "Key %s not supported.\nCommands:%s", ev->key, commands);
70 return; 70 return;
71 } 71 }
72 72
diff --git a/src/examples/edje/edje-box.c b/src/examples/edje/edje-box.c
index 20cf56e094..978a5309c3 100644
--- a/src/examples/edje/edje-box.c
+++ b/src/examples/edje/edje-box.c
@@ -111,12 +111,12 @@ _on_bg_key_down(void *data, Evas *e, Evas_Object *o EINA_UNUSED, void *event_inf
111 ev = (Evas_Event_Key_Down *)event_info; 111 ev = (Evas_Event_Key_Down *)event_info;
112 edje_obj = ecore_evas_data_get(ee, "edje_obj"); 112 edje_obj = ecore_evas_data_get(ee, "edje_obj");
113 113
114 if (!strcmp(ev->keyname, "h")) 114 if (!strcmp(ev->key, "h"))
115 { 115 {
116 fprintf(stdout, commands); 116 fprintf(stdout, commands);
117 return; 117 return;
118 } 118 }
119 if (!strcmp(ev->keyname, "i")) 119 if (!strcmp(ev->key, "i"))
120 { 120 {
121 rect = evas_object_rectangle_add(e); 121 rect = evas_object_rectangle_add(e);
122 evas_object_color_set(rect, 0, 0, 128, 255); 122 evas_object_color_set(rect, 0, 0, 128, 255);
@@ -130,7 +130,7 @@ _on_bg_key_down(void *data, Evas *e, Evas_Object *o EINA_UNUSED, void *event_inf
130 130
131 evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _on_rect_mouse_down, NULL); 131 evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _on_rect_mouse_down, NULL);
132 } 132 }
133 else if (!strcmp(ev->keyname, "a")) 133 else if (!strcmp(ev->key, "a"))
134 { 134 {
135 rect = evas_object_rectangle_add(e); 135 rect = evas_object_rectangle_add(e);
136 evas_object_color_set(rect, 0, 128, 0, 255); 136 evas_object_color_set(rect, 0, 128, 0, 255);
@@ -144,13 +144,13 @@ _on_bg_key_down(void *data, Evas *e, Evas_Object *o EINA_UNUSED, void *event_inf
144 144
145 evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _on_rect_mouse_down, NULL); 145 evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_DOWN, _on_rect_mouse_down, NULL);
146 } 146 }
147 else if (!strcmp(ev->keyname, "c")) 147 else if (!strcmp(ev->key, "c"))
148 edje_object_part_box_remove_all(edje_obj, "example/box", EINA_TRUE); 148 edje_object_part_box_remove_all(edje_obj, "example/box", EINA_TRUE);
149 else if (!strcmp(ev->keyname, "Escape")) 149 else if (!strcmp(ev->key, "Escape"))
150 ecore_main_loop_quit(); 150 ecore_main_loop_quit();
151 else 151 else
152 { 152 {
153 printf("unhandled key: %s\n", ev->keyname); 153 printf("unhandled key: %s\n", ev->key);
154 fprintf(stdout, commands); 154 fprintf(stdout, commands);
155 } 155 }
156} 156}
diff --git a/src/examples/edje/edje-box2.c b/src/examples/edje/edje-box2.c
index e2a172f267..c61913bfbf 100644
--- a/src/examples/edje/edje-box2.c
+++ b/src/examples/edje/edje-box2.c
@@ -85,7 +85,7 @@ on_keydown(void *data, Evas *evas, Evas_Object *o EINA_UNUSED, void *einfo)
85 edje_obj = (Evas_Object *)data; 85 edje_obj = (Evas_Object *)data;
86 86
87 mods = evas_key_modifier_get(evas); 87 mods = evas_key_modifier_get(evas);
88 if (!strcmp(ev->keyname, "h")) 88 if (!strcmp(ev->key, "h"))
89 { 89 {
90 fprintf(stdout, commands); 90 fprintf(stdout, commands);
91 return; 91 return;
@@ -94,7 +94,7 @@ on_keydown(void *data, Evas *evas, Evas_Object *o EINA_UNUSED, void *einfo)
94 { 94 {
95 int pos; 95 int pos;
96 Evas_Object *obj = NULL; 96 Evas_Object *obj = NULL;
97 pos = atoi(ev->keyname); 97 pos = atoi(ev->key);
98 obj = edje_object_part_box_remove_at(edje_obj, "example/box", pos); 98 obj = edje_object_part_box_remove_at(edje_obj, "example/box", pos);
99 if (obj) 99 if (obj)
100 evas_object_del(obj); 100 evas_object_del(obj);
@@ -104,13 +104,13 @@ on_keydown(void *data, Evas *evas, Evas_Object *o EINA_UNUSED, void *einfo)
104 { 104 {
105 Evas_Object *obj; 105 Evas_Object *obj;
106 int pos; 106 int pos;
107 pos = atoi(ev->keyname); 107 pos = atoi(ev->key);
108 obj = new_greenie_block(evas); 108 obj = new_greenie_block(evas);
109 if (!edje_object_part_box_insert_at(edje_obj, "example/box", obj, pos)) 109 if (!edje_object_part_box_insert_at(edje_obj, "example/box", obj, pos))
110 edje_object_part_box_append(edje_obj, "example/box", obj); 110 edje_object_part_box_append(edje_obj, "example/box", obj);
111 return; 111 return;
112 } 112 }
113 if (!strcmp(ev->keyname, "Escape")) 113 if (!strcmp(ev->key, "Escape"))
114 ecore_main_loop_quit(); 114 ecore_main_loop_quit();
115} 115}
116 116
diff --git a/src/examples/edje/edje-drag.c b/src/examples/edje/edje-drag.c
index da7504f07c..6098fd9efb 100644
--- a/src/examples/edje/edje-drag.c
+++ b/src/examples/edje/edje-drag.c
@@ -78,36 +78,36 @@ _on_bg_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, voi
78 ev = (Evas_Event_Key_Down *)event_info; 78 ev = (Evas_Event_Key_Down *)event_info;
79 edje_obj = ecore_evas_data_get(ee, "edje_obj"); 79 edje_obj = ecore_evas_data_get(ee, "edje_obj");
80 80
81 if (!strcmp(ev->keyname, "h")) 81 if (!strcmp(ev->key, "h"))
82 { 82 {
83 fprintf(stdout, commands); 83 fprintf(stdout, commands);
84 return; 84 return;
85 } 85 }
86 else if (!strcmp(ev->keyname, "Down")) 86 else if (!strcmp(ev->key, "Down"))
87 { 87 {
88 edje_object_part_drag_step(edje_obj, PARTNAME, 0, 1.0); 88 edje_object_part_drag_step(edje_obj, PARTNAME, 0, 1.0);
89 } 89 }
90 else if (!strcmp(ev->keyname, "Up")) 90 else if (!strcmp(ev->key, "Up"))
91 { 91 {
92 edje_object_part_drag_step(edje_obj, PARTNAME, 0, -1.0); 92 edje_object_part_drag_step(edje_obj, PARTNAME, 0, -1.0);
93 } 93 }
94 else if (!strcmp(ev->keyname, "m")) 94 else if (!strcmp(ev->key, "m"))
95 { 95 {
96 edje_object_part_drag_value_set(edje_obj, PARTNAME, 0.0, 0.5); 96 edje_object_part_drag_value_set(edje_obj, PARTNAME, 0.0, 0.5);
97 } 97 }
98 else if (!strcmp(ev->keyname, "Prior")) 98 else if (!strcmp(ev->key, "Prior"))
99 { 99 {
100 edje_object_part_drag_page(edje_obj, PARTNAME, 0.0, -1.0); 100 edje_object_part_drag_page(edje_obj, PARTNAME, 0.0, -1.0);
101 } 101 }
102 else if (!strcmp(ev->keyname, "Next")) 102 else if (!strcmp(ev->key, "Next"))
103 { 103 {
104 edje_object_part_drag_page(edje_obj, PARTNAME, 0.0, 1.0); 104 edje_object_part_drag_page(edje_obj, PARTNAME, 0.0, 1.0);
105 } 105 }
106 else if (!strcmp(ev->keyname, "Escape")) 106 else if (!strcmp(ev->key, "Escape"))
107 ecore_main_loop_quit(); 107 ecore_main_loop_quit();
108 else 108 else
109 { 109 {
110 printf("unhandled key: %s\n", ev->keyname); 110 printf("unhandled key: %s\n", ev->key);
111 fprintf(stdout, commands); 111 fprintf(stdout, commands);
112 } 112 }
113} 113}
diff --git a/src/examples/edje/edje-perspective.c b/src/examples/edje/edje-perspective.c
index dc8c248fe8..7bdcbf49f3 100644
--- a/src/examples/edje/edje-perspective.c
+++ b/src/examples/edje/edje-perspective.c
@@ -98,44 +98,44 @@ _on_bg_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, voi
98 struct _App *app = data; 98 struct _App *app = data;
99 Evas_Event_Key_Down *ev = event_info; 99 Evas_Event_Key_Down *ev = event_info;
100 100
101 if (!strcmp(ev->keyname, "h")) 101 if (!strcmp(ev->key, "h"))
102 { 102 {
103 fprintf(stdout, commands); 103 fprintf(stdout, commands);
104 return; 104 return;
105 } 105 }
106 // just moving the part and text 106 // just moving the part and text
107 else if (!strcmp(ev->keyname, "Down")) 107 else if (!strcmp(ev->key, "Down"))
108 { 108 {
109 _part_move(app, 0, 1); 109 _part_move(app, 0, 1);
110 } 110 }
111 else if (!strcmp(ev->keyname, "Up")) 111 else if (!strcmp(ev->key, "Up"))
112 { 112 {
113 _part_move(app, 0, -1); 113 _part_move(app, 0, -1);
114 } 114 }
115 else if (!strcmp(ev->keyname, "Left")) 115 else if (!strcmp(ev->key, "Left"))
116 { 116 {
117 _part_move(app, -1, 0); 117 _part_move(app, -1, 0);
118 } 118 }
119 else if (!strcmp(ev->keyname, "Right")) 119 else if (!strcmp(ev->key, "Right"))
120 { 120 {
121 _part_move(app, 1, 0); 121 _part_move(app, 1, 0);
122 } 122 }
123 else if (!strcmp(ev->keyname, "Prior")) 123 else if (!strcmp(ev->key, "Prior"))
124 { 124 {
125 _part_move(app, -1, -1); 125 _part_move(app, -1, -1);
126 } 126 }
127 else if (!strcmp(ev->keyname, "Next")) 127 else if (!strcmp(ev->key, "Next"))
128 { 128 {
129 _part_move(app, 1, 1); 129 _part_move(app, 1, 1);
130 } 130 }
131 // adjusting the perspective focal point distance 131 // adjusting the perspective focal point distance
132 else if (!strcmp(ev->keyname, "KP_Add")) 132 else if (!strcmp(ev->key, "KP_Add"))
133 { 133 {
134 app->focal += 5; 134 app->focal += 5;
135 edje_perspective_set(app->ps, 240, 160, 0, app->focal); 135 edje_perspective_set(app->ps, 240, 160, 0, app->focal);
136 edje_object_calc_force(app->edje_obj); 136 edje_object_calc_force(app->edje_obj);
137 } 137 }
138 else if (!strcmp(ev->keyname, "KP_Subtract")) 138 else if (!strcmp(ev->key, "KP_Subtract"))
139 { 139 {
140 app->focal -= 5; 140 app->focal -= 5;
141 if (app->focal < 5) 141 if (app->focal < 5)
@@ -145,11 +145,11 @@ _on_bg_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, voi
145 edje_object_calc_force(app->edje_obj); 145 edje_object_calc_force(app->edje_obj);
146 } 146 }
147 // exiting 147 // exiting
148 else if (!strcmp(ev->keyname, "Escape")) 148 else if (!strcmp(ev->key, "Escape"))
149 ecore_main_loop_quit(); 149 ecore_main_loop_quit();
150 else 150 else
151 { 151 {
152 printf("unhandled key: %s\n", ev->keyname); 152 printf("unhandled key: %s\n", ev->key);
153 fprintf(stdout, commands); 153 fprintf(stdout, commands);
154 } 154 }
155} 155}
diff --git a/src/examples/edje/edje-signals-messages.c b/src/examples/edje/edje-signals-messages.c
index b9b5f347e0..22155fde0f 100644
--- a/src/examples/edje/edje-signals-messages.c
+++ b/src/examples/edje/edje-signals-messages.c
@@ -51,12 +51,12 @@ _on_keydown(void *data,
51 ev = (Evas_Event_Key_Down *)einfo; 51 ev = (Evas_Event_Key_Down *)einfo;
52 edje_obj = (Evas_Object *)data; 52 edje_obj = (Evas_Object *)data;
53 53
54 if (!strcmp(ev->keyname, "h")) /* print help */ 54 if (!strcmp(ev->key, "h")) /* print help */
55 { 55 {
56 fprintf(stdout, commands); 56 fprintf(stdout, commands);
57 return; 57 return;
58 } 58 }
59 else if (!strcmp(ev->keyname, "t")) /* toggle right rectangle's visibility */ 59 else if (!strcmp(ev->key, "t")) /* toggle right rectangle's visibility */
60 { 60 {
61 char buf[1024]; 61 char buf[1024];
62 62
@@ -70,11 +70,11 @@ _on_keydown(void *data,
70 70
71 return; 71 return;
72 } 72 }
73 else if (!strcmp(ev->keyname, "Escape")) 73 else if (!strcmp(ev->key, "Escape"))
74 ecore_main_loop_quit(); 74 ecore_main_loop_quit();
75 else 75 else
76 { 76 {
77 printf("unhandled key: %s\n", ev->keyname); 77 printf("unhandled key: %s\n", ev->key);
78 fprintf(stdout, commands); 78 fprintf(stdout, commands);
79 } 79 }
80} 80}
diff --git a/src/examples/edje/sigtest.c b/src/examples/edje/sigtest.c
index 2d600fff98..a949ca3552 100644
--- a/src/examples/edje/sigtest.c
+++ b/src/examples/edje/sigtest.c
@@ -45,12 +45,12 @@ _on_keydown(void *data,
45 edje_obj = ecore_evas_data_get(ee, "edje_obj"); 45 edje_obj = ecore_evas_data_get(ee, "edje_obj");
46 edje_file = ecore_evas_data_get(ee, "file"); 46 edje_file = ecore_evas_data_get(ee, "file");
47 47
48 if (!strcmp(ev->keyname, "h")) 48 if (!strcmp(ev->key, "h"))
49 { 49 {
50 fprintf(stdout, commands); 50 fprintf(stdout, commands);
51 return; 51 return;
52 } 52 }
53 else if (!strcmp(ev->keyname, "e")) 53 else if (!strcmp(ev->key, "e"))
54 { 54 {
55 if (!edje_object_file_set(edje_obj, edje_file, "plain/edje/group")) 55 if (!edje_object_file_set(edje_obj, edje_file, "plain/edje/group"))
56 { 56 {
@@ -64,7 +64,7 @@ _on_keydown(void *data,
64 " file sigtest.edj with success!\n"); 64 " file sigtest.edj with success!\n");
65 return; 65 return;
66 } 66 }
67 else if (!strcmp(ev->keyname, "l")) 67 else if (!strcmp(ev->key, "l"))
68 { 68 {
69 if (!edje_object_file_set(edje_obj, edje_file, "lua_base")) 69 if (!edje_object_file_set(edje_obj, edje_file, "lua_base"))
70 { 70 {
@@ -78,7 +78,7 @@ _on_keydown(void *data,
78 " file sigtest.edj with success!\n"); 78 " file sigtest.edj with success!\n");
79 return; 79 return;
80 } 80 }
81 else if (!strcmp(ev->keyname, "m")) 81 else if (!strcmp(ev->key, "m"))
82 { 82 {
83 Edje_Message_String *msg = malloc(sizeof(*msg)); 83 Edje_Message_String *msg = malloc(sizeof(*msg));
84 84
@@ -89,7 +89,7 @@ _on_keydown(void *data,
89 fprintf(stdout, "C message sent\n"); 89 fprintf(stdout, "C message sent\n");
90 return; 90 return;
91 } 91 }
92 else if (!strcmp(ev->keyname, "s")) 92 else if (!strcmp(ev->key, "s"))
93 { 93 {
94 fprintf(stdout, "\n"); 94 fprintf(stdout, "\n");
95 edje_object_signal_emit(edje_obj, "C signal 1", "Csource"); 95 edje_object_signal_emit(edje_obj, "C signal 1", "Csource");
@@ -97,11 +97,11 @@ _on_keydown(void *data,
97 fprintf(stdout, "C signal sent\n"); 97 fprintf(stdout, "C signal sent\n");
98 return; 98 return;
99 } 99 }
100 else if (!strcmp(ev->keyname, "Escape")) 100 else if (!strcmp(ev->key, "Escape"))
101 ecore_main_loop_quit(); 101 ecore_main_loop_quit();
102 else 102 else
103 { 103 {
104 printf("unhandled key: %s\n", ev->keyname); 104 printf("unhandled key: %s\n", ev->key);
105 fprintf(stdout, commands); 105 fprintf(stdout, commands);
106 } 106 }
107} 107}