-
Notifications
You must be signed in to change notification settings - Fork 80
Conversation
allows to use GtkSourceBuffer Added pagenumber function for GtkNotebook
And fix path_at_pos on 64 bit systems
and replace GtkTextBuffer by GtkTextBufferI in text.jl (GtkSourceBuffer inherits from GtkTextBufferI)
Yes. I'm starting to realize this may be the way to go for a lot of stuff: cache auto-gen info from GI and eval it at startup Let's keep them in Any idea how long it takes to parse this? I've measured that GAccessors took 0.5 sec to parse, or 0.01 to read from the fast-cache. This can probably be appended to the same cache file. I think we should either drop the usage of lowercase, or generate both symbols in the module, that should simplify the get_enum function (which may actually be faster than EnumName.get since it doesn't compile as many functions, and inference/codegen knows how to emit getfield efficiently. All it needs is a I still think stripping |
@bfredl Autogenerating enums seems great! But I am not totally sure: At which moment is GI required? Only once on your side and not on the Gtk.jl users side, rigtht? |
@vtjnash a quick test gives 0.38 for the entire Well, the introspection data actually contains the enum fields as lowercase, so I think a viable alternative is to only have the fields as lowercase. It's obvious imho that @tknopp Correct, all cached code from GI.jl should not runtime-depend on the introspection library. It works the same as the cindex accessors in this respect. |
List/Tree View Improvement / GtkToolbar / GtkScrolledWindow
Ok, I moved most of the generation code to Gtk.jl, so it's easier to special case stuff (like currently exclude GDK_KEY_* as these are almost more than the size of all other enums combined) and it only depends on the layer of GI.jl that I can let be api-stable right now. lowercase generates quite some keyword conflicts (like |
Firstly, this interfaces allows us to pass around raw GList pointers without bothering to first box them (which should be nice for performance). Secondly, it creates a real GList type which can be instantiated to create (and gc-root) a real GList (which should be nice for usability enhancements, since we can now code the rest of the GList setter API against this)
end | ||
constcache = joinpath(cachedir,"consts") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there no dependence on gtk_version?
Well, I thought constants were backwards compatible (as Gtk.jl has done well sofar with only one set of constants). It turns to be a few enums in gtk2 removed in gtk3, so I made it dependent on version. Seems like libgirepository cannot load both gtk2 and gtk3 in the same process, so one has to run the regeneration script twice. |
I've merged this. I'm not sure which approach (GI or Clang) is necessarily better so I'll keep both at present. It's good for verification that they generate nearly the same thing. Note: I removed |
Ah, I didn't know about the x.(y) syntax. That's very practical to know, thanks! |
This enables auto-generation of the complete set of consts and enums in Gtk/Gdk (using gobject-introspection). The support code is in https://github.com/bfredl/GI.jl . However there are a few outstanding issues:
Gobject-introspection does work on windows (used for instance by pygtk as of gtk3) but the introspection data is not currently included in the WinRPM packages. I think this comes down to enable some configuration flags in the WinRPM build scripts; I will look into it later. As with cindex it is only a dependency for regenerating the cache, not for using the package.
As of #24 "_MASK" are stripped of the Gdk mask enum values. If we want to keep this convention this could be done systematically also in the geneated enums, since libgirepo contains info which enums are in fact masks. Right now the enums are in a submodule but when this is resolved they could all be put in the main Gtk namespace.
This PR replaces the
EnumName.get
symbol lookup functions withgetfield
, which probably is somewhat slower (cannot be constant folded I guess). If this is a problemEnumName.get
could be generated as well (for all enums or a relevant subset of the enums).Would people consider this useful? If so I will try fix the remaining issues, as needed.