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