aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/extantz/fangWin.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-03 18:33:58 +1000
committerDavid Walter Seikel2014-05-03 18:33:58 +1000
commit3c0fb329ecc4a719bd8d80257298d08f80b1bfd3 (patch)
treea0bb12ea6772588b90b0d26c855aeb802b6e56c3 /src/extantz/fangWin.c
parentRemove Evas_3d example stuff from GuiLua, now that it's in extantz. (diff)
downloadSledjHamr-3c0fb329ecc4a719bd8d80257298d08f80b1bfd3.zip
SledjHamr-3c0fb329ecc4a719bd8d80257298d08f80b1bfd3.tar.gz
SledjHamr-3c0fb329ecc4a719bd8d80257298d08f80b1bfd3.tar.bz2
SledjHamr-3c0fb329ecc4a719bd8d80257298d08f80b1bfd3.tar.xz
Move non GL_View stuff from gld -> ourGlobals. Plus some white space fixes.
Diffstat (limited to 'src/extantz/fangWin.c')
-rw-r--r--src/extantz/fangWin.c138
1 files changed, 70 insertions, 68 deletions
diff --git a/src/extantz/fangWin.c b/src/extantz/fangWin.c
index 8f68658..c7ec145 100644
--- a/src/extantz/fangWin.c
+++ b/src/extantz/fangWin.c
@@ -78,79 +78,81 @@ static void create_handles(Evas_Object *obj)
78 } 78 }
79} 79}
80 80
81Evas_Object *fang_win_add(GLData *gld) 81Evas_Object *fang_win_add(globals *ourGlobals)
82{ 82{
83 Evas_Object *win, *bg; 83 GLData *gld = &ourGlobals->gld;
84 84 Evas_Object *win, *bg;
85 // In theory this should create an EWS window, in practice, I'm not seeing any difference. 85
86 // Guess I'll have to implement my own internal window manager. I don't think a basic one will be that hard. Famous last words. 86 // In theory this should create an EWS window, in practice, I'm not seeing any difference.
87// elm_config_engine_set("ews"); 87 // Guess I'll have to implement my own internal window manager. I don't think a basic one will be that hard. Famous last words.
88 win = elm_win_add(gld->win, "inlined", ELM_WIN_INLINED_IMAGE); 88// elm_config_engine_set("ews");
89 // On mouse down we try to shift focus to the backing image, this seems to be the correct thing to force focus onto it's widgets. 89 win = elm_win_add(ourGlobals->win, "inlined", ELM_WIN_INLINED_IMAGE);
90 // According to the Elm inlined image window example, this is what's needed to. 90 // On mouse down we try to shift focus to the backing image, this seems to be the correct thing to force focus onto it's widgets.
91 evas_object_event_callback_add(elm_win_inlined_image_object_get(win), EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down_elm, gld); 91 // According to the Elm inlined image window example, this is what's needed to.
92 elm_win_alpha_set(win, EINA_TRUE); 92 evas_object_event_callback_add(elm_win_inlined_image_object_get(win), EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down_elm, gld);
93 93 elm_win_alpha_set(win, EINA_TRUE);
94 // Apparently transparent is not good enough for ELM backgrounds, so make it a rectangle. 94
95 // Apparently coz ELM prefers stuff to have edjes. A bit over the top if all I want is a transparent rectangle. 95 // Apparently transparent is not good enough for ELM backgrounds, so make it a rectangle.
96 bg = evas_object_rectangle_add(evas_object_evas_get(win)); 96 // Apparently coz ELM prefers stuff to have edjes. A bit over the top if all I want is a transparent rectangle.
97 evas_object_color_set(bg, 50, 0, 100, 100); 97 bg = evas_object_rectangle_add(evas_object_evas_get(win));
98 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 98 evas_object_color_set(bg, 50, 0, 100, 100);
99 elm_win_resize_object_add(win, bg); 99 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
100 evas_object_show(bg); 100 elm_win_resize_object_add(win, bg);
101 101 evas_object_show(bg);
102 return win; 102
103 return win;
103} 104}
104 105
105void fang_win_complete(GLData *gld, Evas_Object *win, int x, int y, int w, int h) 106void fang_win_complete(globals *ourGlobals, Evas_Object *win, int x, int y, int w, int h)
106{ 107{
107 // image object for win is unlinked to its pos/size - so manual control 108 // image object for win is unlinked to its pos/size - so manual control
108 // this allows also for using map and other things with it. 109 // this allows also for using map and other things with it.
109 evas_object_move(elm_win_inlined_image_object_get(win), x, y); 110 evas_object_move(elm_win_inlined_image_object_get(win), x, y);
110 // Odd, it needs to be resized twice. WTF? 111 // Odd, it needs to be resized twice. WTF?
111 evas_object_resize(win, w, h); 112 evas_object_resize(win, w, h);
112 evas_object_resize(elm_win_inlined_image_object_get(win), w, h); 113 evas_object_resize(elm_win_inlined_image_object_get(win), w, h);
113 evas_object_show(win); 114 evas_object_show(win);
114 create_handles(elm_win_inlined_image_object_get(win)); 115 create_handles(elm_win_inlined_image_object_get(win));
115} 116}
116 117
117void overlay_add(GLData *gld) 118void overlay_add(globals *ourGlobals)
118{ 119{
119 Evas_Object *bg; 120 GLData *gld = &ourGlobals->gld;
120 121 Evas_Object *bg;
121 // There are many reasons for this window. 122
122 // The first is to cover the GL and provide something to click on to change focus. 123 // There are many reasons for this window.
123 // The second is to provide something to click on for all the GL type clicking stuff that needs to be done. In other words, no click through, we catch the clicks here. 124 // The first is to cover the GL and provide something to click on to change focus.
124 // So we can probably avoid the following issue - 125 // The second is to provide something to click on for all the GL type clicking stuff that needs to be done. In other words, no click through, we catch the clicks here.
125 // How to do click through? evas_object_pass_events_set(rectangle, EINA_TRUE), and maybe need to do that to the underlaying window to? 126 // So we can probably avoid the following issue -
126 // Though if the rectangle is entirely transparent, or even hidden, events might pass through anyway. 127 // How to do click through? evas_object_pass_events_set(rectangle, EINA_TRUE), and maybe need to do that to the underlaying window to?
127 // Gotta have click through on the parts where there's no other window. 128 // Though if the rectangle is entirely transparent, or even hidden, events might pass through anyway.
128 // The third is to have the other windows live here. 129 // Gotta have click through on the parts where there's no other window.
129 // This idea doesn't work, as it breaks the damn focus again. 130 // The third is to have the other windows live here.
130 // Don't think it's needed anyway. 131 // This idea doesn't work, as it breaks the damn focus again.
131 // While on the subject of layers, need a HUD layer of some sort, but Irrlicht might support that itself. 132 // Don't think it's needed anyway.
132 133 // While on the subject of layers, need a HUD layer of some sort, but Irrlicht might support that itself.
133 gld->winwin = elm_win_add(gld->win, "inlined", ELM_WIN_INLINED_IMAGE); 134
134 // On mouse down we try to shift focus to the backing image, this seems to be the correct thing to force focus onto it's widgets. 135 gld->winwin = elm_win_add(ourGlobals->win, "inlined", ELM_WIN_INLINED_IMAGE);
135 // According to the Elm inlined image window example, this is what's needed to. 136 // On mouse down we try to shift focus to the backing image, this seems to be the correct thing to force focus onto it's widgets.
136 evas_object_event_callback_add(elm_win_inlined_image_object_get(gld->winwin), EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down_elm, gld); 137 // According to the Elm inlined image window example, this is what's needed to.
137 // In this code, we are making our own camera, so grab it's input when we are focused. 138 evas_object_event_callback_add(elm_win_inlined_image_object_get(gld->winwin), EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down_elm, gld);
138 cameraAdd(gld->winwin, gld); 139 // In this code, we are making our own camera, so grab it's input when we are focused.
139 140 cameraAdd(gld->winwin, gld);
140 elm_win_alpha_set(gld->winwin, EINA_TRUE); 141
141 // Apparently transparent is not good enough for ELM backgrounds, so make it a rectangle. 142 elm_win_alpha_set(gld->winwin, EINA_TRUE);
142 // Apparently coz ELM prefers stuff to have edjes. A bit over the top if all I want is a transparent rectangle. 143 // Apparently transparent is not good enough for ELM backgrounds, so make it a rectangle.
143 bg = evas_object_rectangle_add(evas_object_evas_get(gld->winwin)); 144 // Apparently coz ELM prefers stuff to have edjes. A bit over the top if all I want is a transparent rectangle.
144 evas_object_color_set(bg, 0, 0, 0, 0); 145 bg = evas_object_rectangle_add(evas_object_evas_get(gld->winwin));
145 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 146 evas_object_color_set(bg, 0, 0, 0, 0);
146 elm_win_resize_object_add(gld->winwin, bg); 147 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
147 evas_object_show(bg); 148 elm_win_resize_object_add(gld->winwin, bg);
148 149 evas_object_show(bg);
149 // image object for win is unlinked to its pos/size - so manual control 150
150 // this allows also for using map and other things with it. 151 // image object for win is unlinked to its pos/size - so manual control
151 evas_object_move(elm_win_inlined_image_object_get(gld->winwin), 0, 0); 152 // this allows also for using map and other things with it.
152 // Odd, it needs to be resized twice. WTF? 153 evas_object_move(elm_win_inlined_image_object_get(gld->winwin), 0, 0);
153 evas_object_resize(gld->winwin, gld->win_w, gld->win_h); 154 // Odd, it needs to be resized twice. WTF?
154 evas_object_resize(elm_win_inlined_image_object_get(gld->winwin), gld->win_w, gld->win_h); 155 evas_object_resize(gld->winwin, ourGlobals->win_w, ourGlobals->win_h);
155 evas_object_show(gld->winwin); 156 evas_object_resize(elm_win_inlined_image_object_get(gld->winwin), ourGlobals->win_w, ourGlobals->win_h);
157 evas_object_show(gld->winwin);
156} 158}