-
Notifications
You must be signed in to change notification settings - Fork 220
gtk4: draft implementation #3100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I'm going to look through here, but this is great! I should be able to start here for a new gtk4 backend and then make that the default, so we wouldn't have both symbols in the same namespace due to loading both old and new gtk dlls. |
|
Changed Additionally I removed the |
|
I changed This also ends up changing some So far, I've only checked I'll check the others for missing words soon. |
|
My |
|
Are you waiting for me to review this? |
|
Hi @knottio I'd love to get this merged, anything you'd like to get done before review/merge!? |
|
Merged, thanks!! |
Initial draft of a
gtk4vocab.Summary
cairo_rectangle_int_tandcairo_region_ttypes tocairo.ffi, as they're required for parsing some GIR.cairo.gobject.ffiandvocabfreetype2.gobject.ffiwhich processes their respective GIR filesto load thetype-infos required by some of the other GIR.gtk4, and updated old ones.glib.ffisince they're now generated by the new GIR.gobject-introspectionto be able to process new GIR files.gtk4, along with necessary dependents,gsk,graphene, and the aforementioned.gobject.ffis.extras/gtk4-samples/openglto test the bare minimum..gobject.ffiSome GIR files aren't meant to be used for actually generating bindings for the libraries they describe, only for supporting GIR files that are meant for generating bindings. In these cases, I added aThese vocabs.gobject.ffivocab to the root vocab for the library.process the GIR files togenerate thetype-inforequired for processing other GIR files.This might need altered, since it currently still generates definitions. I'm unclear on the precise implications here.gobject-introspectionI added a
SKIP-DEFINITIONS:parsing word (similar toIMPLEMENT-STRUCTS:) which takes a list of definitions to be skipped when parsing the GIR. This helps with workarounds for definitions whichgobject-introspectionfails to parse. A manual definition can then be written. I used it forGObject.G_TYPE_FLAG_RESERVED_ID_BIT, which is a constant of typeGTypeand value1.GTypedoes typedef togulong, so it's probably feasible to get it to parse correctly, but I wasn't sure how to best approach that, so for now, it's using a workaround.I moved
def-conststo happen later indef-namespace, since otherwise some definitions haven't defined/deferred the necessary type yet.xml>array-typewas updated to handle nested arrays.fix-contsis now namedfix-constsand now usesidentifier-prefixesinstead ofsymbol-prefixes, resolving some ambiguity between the older and newer GIR files.load-functionsnow filters out xml elements with attributemoved-to, since they'll otherwise result in re-definitions.Added some more standard-types, some of which are needed, others weren't needed, but they're all assumed by
GNOME/gobject-introspection."GTK 2/3 symbols detected"
A standard bootstrap (on Linux) will use
ui.backend.gtk2, which results in things I'm unclear on, but the end result is that attempting to rungtk4-samples.openglwill fail with an error message:GTK 2/3 symbols detected. Using GTK 2/3 and GTK 4 in the same process is not supported. I'm currently using./factor -i=boot.unix-x86.64.image -exclude="tools help handbook ui ui.tools"to build the image for testinggtk4. Haven't check exactly which components bring ingtk2, but just-exclude="ui ui.toolswasn't enough.To-Do
ui.backend.gtk4.SKIP-DEFINITIONS:to take the more expected name.macosandwindows.