1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319
|
- current build status
sparc: builds; all tests fail; gtk.window_new not found.
powerpc: builds; all tests fail; gtk.window_new not found
i386: builds; test #11 fails
hppa: builds; all tests fail; gtk.window_new not found
s390: builds; all testse fail; gtk.window_new not found;
gtk.GTK_CAN_DEFAULT not found
mipsel: liblua5.1-bit0 not found
BUGS
====
- regressions
dump_struct: show what a struct* is if it is not NULL
- overrides don't do the trace output, which happens in luagtk_call.
How to do this?? This should happen automatically and not require some
boilerplate code for each override. There are C and Lua overrides, about
30 in total.
Problem: the override is called without its name being accessible, right?
So the function would have to call ``show trace("my name")''
GdkColor...
- Next problem. Arrays? This is currently ignored. It should add another
level of indirection, and possibly set a max. number of elements. Basically
arrays could be nested, does this happen?
- Next problem. substructures and subunions are currently ignored. Must
be supported e.g. for GdkEvent. This has worked before?
The elements can be accessed, though, e.g.
dump_struct(gdkevent.grab_broken). So, in reality, the data is all there.
Just drop the warning messages?
- The size field for structure elements should not be set if the referenced
type has this info. Must be present for bitfields, but max. value should
be 32 (or 64 on 64 bit archs).
Interestingly, sometimes the size is set for fundamental types (like struct,
union) when this type has no fixed size. This size should be zero!
- maybe check the "const" flag sometimes at runtime for something? disallow
writing into such structures.
- g_convert & friends on win32 don't work. some library component missing?
- GtkTextTag sometimes freed with refcount 1, and later tagbuffer frees
it again. some override is required!
- GSList. you have to call g_slist_free() yourself. what about the
items pointed to?
- review all the code for improvements and maybe some bugs
- GdkAtom represented in the function list with one level of indirection too
many? Like, GdkAtom* should be GdkAtom etc. This is because GdkAtom is
defined to be a pointer to the opaque _GdkAtom structure.
- check refcounting usage, memory leaks
- valgrind
- glib memory statistics
- make sure my reference counting (g_object_ref/_unref) is correct.
seems to be ok...
- refcounting on GIOChannel not OK. Sometimes in-use channels are
freed, which aborts communication. (probably already fixed)
- GObject documentation on memory management says that when an object
is destroyed, the "dispose" handler should release all references
it might hold, while finalize really frees the object. Does this
apply to lua-gtk? Usually GObjects will have just one ref from
Lua, while the Lua proxy object may have multiple references.
- running Win executables with wine under Linux, and using glade.lua - font
sizes are insanely large.
MISSING FEATURES
================
- socket_co: connect attempts must be asynchronous, otherwise the GUI can be
blocked (by a slow DNS server, for example).
getaddrinfo_a in libc. available in mingw?
libws2_32.a has _getaddrinfo@16, but not getaddrinfo_w.
libc-ares1
adns -- quite "fat" according to udns description
write an own non-recursing simple dns resolver? might be easy.
http://www.network-research.org/udns.html
udns
- handle data type float*, e.g. GtkCurve.ctlpoint
- handle data type "signed char", e.g. GdkEventAny.send_event
- wrapper for gtk_tree_model_get would be nice.
- add more #defines from the Gtk includes to the ENUM list automatically.
gdk/gdkselection.h
- more documentation
- user documentation must be written by hand, the luadoc output
is cute but not really helpful.
- set up a wiki to edit documentation?
- improve the homepage, add more content, better layout
- use luadoc tags for all user visible functions in the C modules
- developer documentation to give pointers for hacking
- call tracing should show the actual values of the arguments; would require
a new callback for each parameter type, some kind of tostring.
- try LuaJIT - should speed everything up. at least check that it works with
it because in a larger project, somebody might want to use it.
IMPROVEMENTS
============
- Cache the result of the lookup in luagtk_type_modify. Allocate (type_count)
number of short integers to store the offsets into the sorted string table.
- make it more modular? I.e. support additional APIs through additional data
files or rather .so/.dll files. E.g. GtkSpell, or move GtkHTML into a
separate module. Pure data file is not enough as overrides may be
required, i.e. code. May need to load additional libraries.
- separate module to use the build infrastructure. create types.xml,
filter out interesting symbols, enums, structures, build a hash
table etc. Can't just include all symbols, because that would
overlap a lot with the base lib.
- what is the base lib? for example, glib could be a separate
module, gtk on top of that etc. Build the base first, then
the next level; same process, but omit all symbols already in the
first library.
- results in multiple hash tables that have to be checked separately.
couldn't they be combined? probably not. performance impact?
probably small.
- compile it in if so requested, this should be possible too.
-- specify additional modules; if built in, nothing happens.
require("gtk", "GtkSpell", "GtkHtml")
gtk.load("GtkSpell")
gtk.load("GtkHtml")
Advantages: Could be built and installed separately. Might be required when
more and more libraries are added; either have everything as compile time
option, or build separately.
Disadvantages: code and build more complex, slower runtime (can't extend
the precomputed hash tables, must check multiple).
- Current data sizes:
Structure curr -html old
---------------------------------------------
type_list 13592 11616 5976
elem_list 23784 19160 19064
type_strings_types 21019 17372 32349 for all strings
type_strings_elem 21876 18610
type_strings_proto 2035 1840
_funcs_fch.g 2320
_funcs_data 21793 20412 32881
_funcs_index 24191 22847 34269
_enums_fch.g 1902
_enums_data 18567 14417 14417
_enums_index 19359 14599 21897
override_data 2689 2689 2987
ffi_type_map 416 408 408
----------------------------------------------
TOTALS 173543
SIZE 251845 265093
_*_fch.g requires _*_fch.b * sizeof(short) bytes, I reckon.
- Add a debug function that shows these numbers
- Try to reduce
2. more efficient encoding of enum data?
3. in production, enum data could be used without hash values; saves
about 10k, or just one byte of hash value, saves 5k
4. More efficient encoding of function prototypes? try different
variants. Current version:
0 invalid
1-127 this type
>128 unset high bit, shift right 8 + add next byte
one byte encoding enough 17500/23100 times = 76%
total = 17500 + 5600*2 = 28700
0 invalid (required for something? maybe not)
1-249 this type
250 next byte + 250
251 next byte + 250 + 256
252 next byte + 250 + 256*2
253 next byte + 250 + 256*3
254 next byte + 250 + 256*4
255 two bytes follow for full range
one byte enough 19580 times = 85%
total = 19580 + 3520 = 26620 bytes
The three byte version is required for > 1530 types, which
is currently not reached.
Not much to be gained.
5. try to combine strings.
long_some_thing
some_thing
thing
GtkMenu
GtkMenuBar
GtkMenuBarButton
Store 16 bit offset plus 8 bit length
Strings stored without NUL byte
Generation:
- build a list of all strings
- find common substrings. maybe descending sort
by string length, and search substring before adding
for each string.
- an object might encapsulate this functionality
6. remove the func_nnnn dummy type names and element names. Use just
"func" or so for all of them.
- use a better module definition, see
http://lua-users.org/wiki/LuaDesignPatterns
- Additional Library Support. If available at compile time and enabled,
compile it in. If not available at runtime, disable this part of the API.
Done: Cairo, GLib, GObject, ATK, Pango, gdk-pixbuf, GDK, GTK+, GtkHTML
GNOME Developer Platform Libraries (only non-deprecated):
glib, gio, gobject, atk, at-spi, gail, pango, gdk-pixbuf, gdk, gtk+,
libxml2, libxslt, libglade, gconf.
Still missing:
gio, at-spi, gail, libxml2, libxslt, libglade, gconf.
gio
pkg-config gio-2.0 gio-unix-2.0
#include <gio/gio.h>
#include <gio/gunixmounts.h>
#include <gio/gdesktopappinf.h>
#include <gio/gunixinputstream.h>
#include <gio/gunixoutputstream.h>
- cairo - http://cairographics.org/
partly working, not tested much
- GL
libgtkgl2.0-dev
libgtkglext1-dev
- GDA
libgda3-dev
- GConf2
libgconf2-dev
liborbit2-dev
- GD2
libgd2-xpm-dev
libfreetype6-dev
libpng12-dev
libjpeg62-dev
- GAIL
libgail-dev
- Gnome Libraries
libgnome2-dev
libgnomedb3-dev
libgnomeprint2.2-dev
libart-2.0-dev
- xml2
libxml2-dev
already included in types.xml, but functions are not extracted.
- libxslt
libxslt1-dev
- libglade - maybe not, use GtkBuilder
- GtkImageView
libgtkimageview0
libgtkimageview-dev
http://trac.bjourne.webfactional.com/
- GCC attributes. Use when GCC is available.
http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Function-Attributes.html
How does this compare to the "alien" library?
http://alien.luaforge.net/
- alien is not designed to support a large number of functions efficiently;
they have to be declared individually.
- doesn't know about Gtk's type hierarchy
|