diff options
author | David Walter Seikel | 2014-03-19 12:38:35 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-03-19 12:38:35 +1000 |
commit | 38f370822fc3e497467594175e0d45bac9cf33ba (patch) | |
tree | f859e7472fe8dc151ac2786f257f253383ad3085 | |
parent | typo --, and fill in a blank. (diff) | |
download | SledjHamr-38f370822fc3e497467594175e0d45bac9cf33ba.zip SledjHamr-38f370822fc3e497467594175e0d45bac9cf33ba.tar.gz SledjHamr-38f370822fc3e497467594175e0d45bac9cf33ba.tar.bz2 SledjHamr-38f370822fc3e497467594175e0d45bac9cf33ba.tar.xz |
More design notes.
-rw-r--r-- | ClientHamr/GuiLua/README | 106 |
1 files changed, 104 insertions, 2 deletions
diff --git a/ClientHamr/GuiLua/README b/ClientHamr/GuiLua/README index e586318..4198025 100644 --- a/ClientHamr/GuiLua/README +++ b/ClientHamr/GuiLua/README | |||
@@ -125,6 +125,7 @@ Raster also wants to thread lots of edje, likely including having edje | |||
125 | Lua scripts as threads, much like I'm doing with LuaSL already. Plus | 125 | Lua scripts as threads, much like I'm doing with LuaSL already. Plus |
126 | LuaJIT SPEEEEED!!. B-) | 126 | LuaJIT SPEEEEED!!. B-) |
127 | 127 | ||
128 | |||
128 | Skang notes | 129 | Skang notes |
129 | ----------- | 130 | ----------- |
130 | 131 | ||
@@ -149,6 +150,11 @@ with "character" mode (this is a new thing) - | |||
149 | 150 | ||
150 | foo = widget.label(0, "0.1", 0.5, 0, 'Text goes here") | 151 | foo = widget.label(0, "0.1", 0.5, 0, 'Text goes here") |
151 | 152 | ||
153 | This could even allow relative placement as mentioned in the skang TODO - | ||
154 | |||
155 | foo = widget.label(0, "otherWidget+0.1", 0.5, 0, 'Text goes here") | ||
156 | |||
157 | |||
152 | "widget" would be a table with functions for dealing with widgets. It | 158 | "widget" would be a table with functions for dealing with widgets. It |
153 | would include metatable stuff for widget set introspection. So | 159 | would include metatable stuff for widget set introspection. So |
154 | "widget.label" would introspect in our widget set for a widget type of | 160 | "widget.label" would introspect in our widget set for a widget type of |
@@ -186,7 +192,7 @@ foo = 'bar' -- Using the metatable to override '=' to set the actual value of th | |||
186 | bar = foo -- The reverse of the above. Though perhaps these can't be done? | 192 | bar = foo -- The reverse of the above. Though perhaps these can't be done? |
187 | foo = foo .. 'stuff' .. 'more stuff' .. 'another line of the dropdown or whatever' | 193 | foo = foo .. 'stuff' .. 'more stuff' .. 'another line of the dropdown or whatever' |
188 | 194 | ||
189 | OK, first two can't be done, metatable only overides that for table elements. The third one can only be - | 195 | OK, first two can't be done, metatable only overides that for table elements. The third one can only be (I might be wrong there) - |
190 | 196 | ||
191 | foo.value = 'stuff' .. 'more stuff' | 197 | foo.value = 'stuff' .. 'more stuff' |
192 | foo.value = foo.value .. 'another line of the dropdown or whatever' | 198 | foo.value = foo.value .. 'another line of the dropdown or whatever' |
@@ -288,11 +294,107 @@ work, as it uses symbols. On the other hand, we will be using Lua | |||
288 | tables anyway. B-) | 294 | tables anyway. B-) |
289 | 295 | ||
290 | 296 | ||
297 | NAWS | ||
298 | ---- | ||
299 | |||
300 | NAWS was always planned, but never actually written. Though some stuff | ||
301 | was kinda prototyped, especially UberMatrix stuff. I think this time | ||
302 | around, NAWS should be written in C, based on pure Evas + Edje. Perhaps | ||
303 | with direct support for introspection? After EO settles down, I might | ||
304 | use that to. | ||
305 | |||
306 | |||
307 | Edje_Lua notes | ||
308 | -------------- | ||
309 | |||
310 | Edje_Lua is sandboxed firmly inside of edje files. This makes it | ||
311 | unsuitable for our use, as we want to step outside that sandbox. | ||
312 | However, we still want to wrap Lua around EFL stuff, preferably using | ||
313 | the same API. Raster fought against using this new eolian stuff to | ||
314 | generate edje_lua2.c, and seems to be against having a "no sandbox" flag | ||
315 | in edje_lua2.c. For now I'll let q66 go ahead with his Edje Lua via | ||
316 | LuaJIT FFI conversion that uses a variation of eolian written in Lua. | ||
317 | Seems like much more work than my way of doing it. shrugs | ||
318 | |||
319 | Unfortunately, this might not be ready soon enough for me, AND it might | ||
320 | not even be suitable. While I agree that LuaJIT FFI stuff might be a | ||
321 | good idea, if I read the docs correctly FFI simply wraps around C | ||
322 | headers and libraries directly, making it less suitable for sandboxes | ||
323 | and other environments where you want to wrap those library functions | ||
324 | differently. | ||
325 | |||
326 | So, I might have to go ahead with my own plan anyway. On the other | ||
327 | hand, for skang, I want to wrap things a bit differently. Might be best | ||
328 | to do that wrapping C side. In other words, the skang and widget Lua | ||
329 | packages get written in C, and are different from edje_lua2.c. | ||
330 | |||
331 | On the gripping hand, there might be use in including edje_lua2.c style | ||
332 | bindings in GuiLua as an edje package, evas package, elementary package, | ||
333 | etc. This could be done by going ahead with my plans to modify | ||
334 | edje_lua2.c to include the "no sandbox" flag, then compile it with that | ||
335 | flag turned on to produce a standard Lua package. Then get eolian to | ||
336 | produce evas_lua.c, elementary_lua.c, etc. | ||
337 | |||
338 | Another idea worth investigating is to rewrite edje_lua2.c to use | ||
339 | introspection directly to figure out it's "combined set and get" style | ||
340 | bindings. | ||
341 | |||
342 | |||
343 | Introspected EFL notes | ||
344 | ---------------------- | ||
345 | |||
346 | See below for the basic EO notes, where I come to the conclusion that | ||
347 | the other EFL devs wont be adding introspection to EO themselves. It's | ||
348 | all too hard they say. Pffft | ||
349 | |||
350 | So, I might have to do this myself, call it "entro".... | ||
351 | |||
352 | Write a patch against eolian that outputs introspection data. That data | ||
353 | is C code for a hash of EO class names. Each hash points to a data | ||
354 | structure that includes a hash of method names for that class, and a | ||
355 | pointer to the class description. Each of those hashes points to a data | ||
356 | structure that includes an array of argument types and names. The | ||
357 | method ID should be in that structure to, and maybe even the doc text. | ||
358 | Might even include an Eo internal data structure that links Op IDs to | ||
359 | that method structure (I dunno what they call that). The final output | ||
360 | is a library of that C code, that includes functions for doing the | ||
361 | actual introspection. | ||
362 | |||
363 | See? Not to hard at all, all described in a paragraph. lol | ||
364 | |||
365 | One function we could include is a way to "compile" eo_do arguments. | ||
366 | That would be an array (va_list actually) of method ID's followed by the | ||
367 | arguments for that method. Some of those arguments might be pointers to | ||
368 | memory structures, so this is not suitable for storing on disk. | ||
369 | Instead, it could be used for "compiling" commonly used code or hot | ||
370 | paths to get the introspection overhead out of the way early. Could | ||
371 | also compile parameterized versions, with numbered place holders that | ||
372 | get filled in later. Certainly we need a Lua interface to eo_do of some | ||
373 | sort. | ||
374 | |||
375 | In the same way that Java skang cached the results of introspection in | ||
376 | ThingSpace.CLASS, we could use cache introspection lookups to speed | ||
377 | things up. Not a great saving, one hash lookup versus two. Caching the | ||
378 | "class.method" string that points to the method structure for any method | ||
379 | we have used already. | ||
380 | |||
381 | NAWS could use the compile function to create eo_do commands needed to | ||
382 | create each of it's widget types, and the window. Yes, I know, NAWS | ||
383 | only has two "widget types". B-) | ||
384 | |||
385 | |||
386 | For quick and dirty early testing, I'll probably write a widget package | ||
387 | that has hard coded mappings between some basic "label", "button", etc. | ||
388 | and ordinary elementary widgets. Proper introspection can come later. | ||
389 | |||
390 | |||
291 | EO notes | 391 | EO notes |
292 | -------- | 392 | -------- |
293 | 393 | ||
294 | tl;dr - eo introspection doesn't actually exist, even though it was | 394 | tl;dr - eo introspection doesn't actually exist, even though it was |
295 | "promised" years ago, but looks trivial to add. | 395 | "promised" years ago, but looks trivial to add. On the other hand, the |
396 | other EFL devs seem to be fighting against it, so I might need to write | ||
397 | my own. sigh | ||
296 | 398 | ||
297 | object = eo_add(EVAS_OBJ_LINE_CLASS, canvas); | 399 | object = eo_add(EVAS_OBJ_LINE_CLASS, canvas); |
298 | evas_line.eo.h -> #define EVAS_OBJ_LINE_CLASS evas_obj_line_class_get() | 400 | evas_line.eo.h -> #define EVAS_OBJ_LINE_CLASS evas_obj_line_class_get() |