aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_evas/ecore_evas.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/ecore/src/lib/ecore_evas/ecore_evas.c252
1 files changed, 189 insertions, 63 deletions
diff --git a/libraries/ecore/src/lib/ecore_evas/ecore_evas.c b/libraries/ecore/src/lib/ecore_evas/ecore_evas.c
index 2b04488..6ecd609 100644
--- a/libraries/ecore/src/lib/ecore_evas/ecore_evas.c
+++ b/libraries/ecore/src/lib/ecore_evas/ecore_evas.c
@@ -509,24 +509,6 @@ _ecore_evas_constructor_sdl(int x __UNUSED__, int y __UNUSED__, int w, int h, co
509 509
510 return ee; 510 return ee;
511} 511}
512
513static Ecore_Evas *
514_ecore_evas_constructor_sdl16(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
515{
516 Ecore_Evas *ee;
517 unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0;
518 char *name = NULL;
519
520 _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
521 _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
522 _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface);
523 _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha);
524
525 ee = ecore_evas_sdl16_new(name, w, h, fullscreen, hwsurface, noframe, alpha);
526 free(name);
527
528 return ee;
529}
530#endif 512#endif
531 513
532#ifdef BUILD_ECORE_EVAS_OPENGL_SDL 514#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
@@ -606,12 +588,13 @@ static Ecore_Evas *
606_ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options) 588_ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options)
607{ 589{
608 char *disp_name = NULL; 590 char *disp_name = NULL;
609 unsigned int frame = 0; 591 unsigned int frame = 0, parent = 0;
610 Ecore_Evas *ee; 592 Ecore_Evas *ee;
611 593
612 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name); 594 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
613 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame); 595 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
614 ee = ecore_evas_wayland_shm_new(disp_name, x, y, w, h, frame); 596 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent);
597 ee = ecore_evas_wayland_shm_new(disp_name, parent, x, y, w, h, frame);
615 free(disp_name); 598 free(disp_name);
616 599
617 return ee; 600 return ee;
@@ -623,12 +606,13 @@ static Ecore_Evas *
623_ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options) 606_ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options)
624{ 607{
625 char *disp_name = NULL; 608 char *disp_name = NULL;
626 unsigned int frame = 0; 609 unsigned int frame = 0, parent = 0;
627 Ecore_Evas *ee; 610 Ecore_Evas *ee;
628 611
629 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name); 612 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
630 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame); 613 _ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
631 ee = ecore_evas_wayland_egl_new(disp_name, x, y, w, h, frame); 614 _ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent);
615 ee = ecore_evas_wayland_egl_new(disp_name, parent, x, y, w, h, frame);
632 free(disp_name); 616 free(disp_name);
633 617
634 return ee; 618 return ee;
@@ -788,7 +772,6 @@ static const struct ecore_evas_engine _engines[] = {
788 772
789#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL 773#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
790 {"sdl", _ecore_evas_constructor_sdl}, 774 {"sdl", _ecore_evas_constructor_sdl},
791 {"software_16_sdl", _ecore_evas_constructor_sdl16},
792#endif 775#endif
793 776
794 /* independent */ 777 /* independent */
@@ -944,7 +927,7 @@ ecore_evas_data_set(Ecore_Evas *ee, const char *key, const void *data)
944#define IFE return;} 927#define IFE return;}
945 928
946EAPI void 929EAPI void
947ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 930ecore_evas_callback_resize_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
948{ 931{
949 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 932 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
950 { 933 {
@@ -958,7 +941,7 @@ ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
958} 941}
959 942
960EAPI void 943EAPI void
961ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 944ecore_evas_callback_move_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
962{ 945{
963 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 946 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
964 { 947 {
@@ -972,7 +955,7 @@ ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
972} 955}
973 956
974EAPI void 957EAPI void
975ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 958ecore_evas_callback_show_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
976{ 959{
977 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 960 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
978 { 961 {
@@ -986,7 +969,7 @@ ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
986} 969}
987 970
988EAPI void 971EAPI void
989ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 972ecore_evas_callback_hide_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
990{ 973{
991 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 974 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
992 { 975 {
@@ -1000,7 +983,7 @@ ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1000} 983}
1001 984
1002EAPI void 985EAPI void
1003ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 986ecore_evas_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1004{ 987{
1005 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 988 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1006 { 989 {
@@ -1014,7 +997,7 @@ ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas
1014} 997}
1015 998
1016EAPI void 999EAPI void
1017ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 1000ecore_evas_callback_destroy_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1018{ 1001{
1019 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 1002 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1020 { 1003 {
@@ -1028,7 +1011,7 @@ ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1028} 1011}
1029 1012
1030EAPI void 1013EAPI void
1031ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 1014ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1032{ 1015{
1033 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 1016 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1034 { 1017 {
@@ -1042,7 +1025,7 @@ ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1042} 1025}
1043 1026
1044EAPI void 1027EAPI void
1045ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 1028ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1046{ 1029{
1047 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 1030 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1048 { 1031 {
@@ -1056,7 +1039,7 @@ ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1056} 1039}
1057 1040
1058EAPI void 1041EAPI void
1059ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 1042ecore_evas_callback_sticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1060{ 1043{
1061 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 1044 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1062 { 1045 {
@@ -1070,7 +1053,7 @@ ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1070} 1053}
1071 1054
1072EAPI void 1055EAPI void
1073ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 1056ecore_evas_callback_unsticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1074{ 1057{
1075 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 1058 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1076 { 1059 {
@@ -1084,7 +1067,7 @@ ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1084} 1067}
1085 1068
1086EAPI void 1069EAPI void
1087ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 1070ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1088{ 1071{
1089 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 1072 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1090 { 1073 {
@@ -1098,7 +1081,7 @@ ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1098} 1081}
1099 1082
1100EAPI void 1083EAPI void
1101ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 1084ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1102{ 1085{
1103 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 1086 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1104 { 1087 {
@@ -1112,7 +1095,7 @@ ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1112} 1095}
1113 1096
1114EAPI void 1097EAPI void
1115ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 1098ecore_evas_callback_pre_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1116{ 1099{
1117 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 1100 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1118 { 1101 {
@@ -1126,7 +1109,7 @@ ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)
1126} 1109}
1127 1110
1128EAPI void 1111EAPI void
1129ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 1112ecore_evas_callback_post_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1130{ 1113{
1131 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 1114 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1132 { 1115 {
@@ -1140,7 +1123,7 @@ ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee
1140} 1123}
1141 1124
1142EAPI void 1125EAPI void
1143ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)) 1126ecore_evas_callback_pre_free_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1144{ 1127{
1145 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 1128 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1146 { 1129 {
@@ -1151,6 +1134,18 @@ ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
1151 ee->func.fn_pre_free = func; 1134 ee->func.fn_pre_free = func;
1152} 1135}
1153 1136
1137EAPI void
1138ecore_evas_callback_state_change_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
1139{
1140 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1141 {
1142 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1143 "ecore_evas_callback_state_change_set");
1144 return;
1145 }
1146 ee->func.fn_state_change = func;
1147}
1148
1154/** 1149/**
1155 * Get an Ecore_Evas's Evas 1150 * Get an Ecore_Evas's Evas
1156 * @param ee The Ecore_Evas whose Evas you wish to get 1151 * @param ee The Ecore_Evas whose Evas you wish to get
@@ -2120,6 +2115,162 @@ ecore_evas_sticky_get(const Ecore_Evas *ee)
2120} 2115}
2121 2116
2122EAPI void 2117EAPI void
2118ecore_evas_window_group_set(Ecore_Evas *ee, const Ecore_Evas *ee_group)
2119{
2120 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2121 {
2122 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2123 "XXX");
2124 return;
2125 }
2126
2127 IFC(ee, fn_window_group_set) (ee, ee_group);
2128 IFE;
2129}
2130
2131EAPI const Ecore_Evas *
2132ecore_evas_window_group_get(const Ecore_Evas *ee)
2133{
2134 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2135 {
2136 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2137 "XXX");
2138 return EINA_FALSE;
2139 }
2140 return ee->prop.group_ee;
2141}
2142
2143EAPI void
2144ecore_evas_aspect_set(Ecore_Evas *ee, double aspect)
2145{
2146 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2147 {
2148 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2149 "XXX");
2150 return;
2151 }
2152
2153 IFC(ee, fn_aspect_set) (ee, aspect);
2154 IFE;
2155}
2156
2157EAPI double
2158ecore_evas_aspect_get(const Ecore_Evas *ee)
2159{
2160 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2161 {
2162 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2163 "XXX");
2164 return EINA_FALSE;
2165 }
2166 return ee->prop.aspect;
2167}
2168
2169EAPI void
2170ecore_evas_urgent_set(Ecore_Evas *ee, Eina_Bool urgent)
2171{
2172 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2173 {
2174 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2175 "XXX");
2176 return;
2177 }
2178
2179 IFC(ee, fn_urgent_set) (ee, urgent);
2180 IFE;
2181}
2182
2183EAPI Eina_Bool
2184ecore_evas_urgent_get(const Ecore_Evas *ee)
2185{
2186 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2187 {
2188 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2189 "XXX");
2190 return EINA_FALSE;
2191 }
2192 return ee->prop.urgent ? EINA_TRUE : EINA_FALSE;
2193}
2194
2195EAPI void
2196ecore_evas_modal_set(Ecore_Evas *ee, Eina_Bool modal)
2197{
2198 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2199 {
2200 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2201 "XXX");
2202 return;
2203 }
2204
2205 IFC(ee, fn_modal_set) (ee, modal);
2206 IFE;
2207}
2208
2209EAPI Eina_Bool
2210ecore_evas_modal_get(const Ecore_Evas *ee)
2211{
2212 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2213 {
2214 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2215 "XXX");
2216 return EINA_FALSE;
2217 }
2218 return ee->prop.modal ? EINA_TRUE : EINA_FALSE;
2219}
2220
2221EAPI void
2222ecore_evas_demand_attention_set(Ecore_Evas *ee, Eina_Bool demand)
2223{
2224 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2225 {
2226 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2227 "XXX");
2228 return;
2229 }
2230
2231 IFC(ee, fn_demands_attention_set) (ee, demand);
2232 IFE;
2233}
2234
2235EAPI Eina_Bool
2236ecore_evas_demand_attention_get(const Ecore_Evas *ee)
2237{
2238 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2239 {
2240 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2241 "XXX");
2242 return EINA_FALSE;
2243 }
2244 return ee->prop.demand_attention ? EINA_TRUE : EINA_FALSE;
2245}
2246
2247EAPI void
2248ecore_evas_focus_skip_set(Ecore_Evas *ee, Eina_Bool skip)
2249{
2250 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2251 {
2252 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2253 "XXX");
2254 return;
2255 }
2256
2257 IFC(ee, fn_focus_skip_set) (ee, skip);
2258 IFE;
2259}
2260
2261EAPI Eina_Bool
2262ecore_evas_focus_skip_get(const Ecore_Evas *ee)
2263{
2264 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
2265 {
2266 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
2267 "XXX");
2268 return EINA_FALSE;
2269 }
2270 return ee->prop.focus_skip ? EINA_TRUE : EINA_FALSE;
2271}
2272
2273EAPI void
2123ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore) 2274ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore)
2124{ 2275{
2125 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) 2276 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
@@ -2695,35 +2846,10 @@ ecore_evas_wayland_resize(Ecore_Evas *ee, int location)
2695 } 2846 }
2696} 2847}
2697 2848
2698EAPI void
2699ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source)
2700{
2701 if ((!ee) || (!source)) return;
2702 if (!ee->engine.wl.surface) return;
2703
2704 if (!strcmp(ee->driver, "wayland_shm"))
2705 {
2706#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
2707 _ecore_evas_wayland_shm_drag_start(ee, drag_ee, source);
2708#endif
2709 }
2710 else if (!strcmp(ee->driver, "wayland_egl"))
2711 {
2712#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
2713 _ecore_evas_wayland_egl_drag_start(ee, drag_ee, source);
2714#endif
2715 }
2716}
2717#else 2849#else
2718EAPI void 2850EAPI void
2719ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__) 2851ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__)
2720{ 2852{
2721 2853
2722} 2854}
2723
2724EAPI void
2725ecore_evas_wayland_drag_start(Ecore_Evas *ee __UNUSED__, Ecore_Evas *drag_ee __UNUSED__, void *source __UNUSED__)
2726{
2727
2728}
2729#endif 2855#endif