-
Notifications
You must be signed in to change notification settings - Fork 27
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
Custom GObjects #52
Custom GObjects #52
Conversation
Missing;
|
I am liking this approach quite a lot more. The type registration is fundamentally the same but you've managed to bypass the typedict, which I always considered a necessessary evil. I agree that we'd be better off not having a type dictionary if we can avoid it, since we're basically just reimplementing GType. I might have a go at handling object lifecycles (wrapping, lifetimes, toggle refs, etc) on top of this branch to see if we can stick with this going forward. |
I would suggest you create a new branch for your lifecycle management code on top of this. In this way we can discuss the pros and cons afterwards if i have s.th. working. I think the code in this branch could be improved. I like your style of coding / documenting, it is very easy to read and follow along. I think whatever code we decide to take over, we should work over it together. |
Mainly fleshes out our support for construct-time properties. Also contains some general code cleanup, commenting, etc
Unfortunately encountered difficulties with managing object lifecycles without a type dictionary. It looks like the typedict might be necessary after all. Added a type dict (entirely self-contained in GObject.Object however), and implemented methods for looking up types that have yet to be registered. Attempted to register recursively where possible. Also: - Corrected class name InitallyUnowned -> Init*i*allyUnowned - Changed file name Object.TypeSystemIntegration.cs to the shorter Object.TypeIntegration.cs
This commit makes a limited subset of Gtk3 work with the new GObject code. It adds `Samples/Gtk3/QuickStart` which tests basic type dictionary code. Next steps include: - Autogenerating API-level code - Making other libraries compile
Object Integration + Basic Lifecycle Management
@na2axl An Update for you: @firox263 and I just had a meeting on how to progress. We decided to generate parts of the core libraries to ease up object creation. The result of this inital work for this is in the Samples/Gtk3/Quickstart. I'm probably going to implement the generator today. If this is done we have the most important things for the type system integration available. Afterwards it would be nice if you can rebase your pull request #58 on this one. Than we have a foundation on which we can apply all the small things to make it nice and finalize the work on the properties. If this is done the generator should generate the properties, too. The last part are methods and we need to figure out if we want / can generate them. (I'm not sure if this will be easy, because I want the |
- Do not add generated files to git - Generate core class files into "Classes" folder - Clean generated core class files
I updated the code to generate the core classes partially. The code is compiling but not working because I had to remove the connections to the properties. I think this could be the start of our future gir.core base. |
- Fix compile errors - Move SignalArgs indexer support to Object - Use Notebook as testclass for generic signals
Fix various parts of the quick-start demo, as well as add significant amounts of commenting to serve as a self-contained tutorial for learning Gir.Core.
QuickStart Demo
- Support concrete types as sender (without null check in client code) - Support Events which just send empty EventArgs
Finally got this .editorconfig file. Configured to follow the default C# code spec, and compatible with StyleCop.
Apply .editorconfig code style
Generate Signals
Generate gobject
# Conflicts: # Generator/Templates/Core/class.sbntxt # Libs/GObject/Core/Classes/Binding.cs # Libs/GObject/Core/Classes/InitiallyUnowned.cs # Libs/GObject/Core/Classes/Object.cs # Libs/GObject/Core/Classes/Signal.cs # Libs/GObject/Core/Classes/TypeModule.cs # Libs/Gtk3/Classes/Button.cs # Libs/Gtk3/Classes/Window.cs # Samples/Gtk3/QuickStart/Gtk/Bin.Generated.cs # Samples/Gtk3/QuickStart/Gtk/Button.Generated.cs # Samples/Gtk3/QuickStart/Gtk/Container.Generated.cs # Samples/Gtk3/QuickStart/Gtk/Container.cs # Samples/Gtk3/QuickStart/Gtk/Widget.Generated.cs # Samples/Gtk3/QuickStart/Gtk/Widget.cs # Samples/Gtk3/QuickStart/Gtk/Window.Generated.cs
Generate v2
Some remarks for this implementation:
Sys.Type GetGType()
it is assumed that this type is a wrapper_new
function. Meaning it can only be created with an existing pointer or via the construct only properties.I suppose that in most cases it is okay, to just call the base constructor without any parameters. Because after the base constructor finished the object is constructed and we can set the properties of our instance afterwards in the C# constructor.
If there are some properties which are construct only (like in GBinding) we could call the
Object(params Prop[] properties)
constructor without the need to implement this kind of constructor in a subclass.Edit:
Todo
Sys.Type
+Sys.Value
inCore