mono / gtk-sharp

Gtk# is a Mono/.NET binding to the cross platform Gtk+ GUI toolkit and the foundation of most GUI apps built with Mono
http://www.mono-project.com/GtkSharp
Other
426 stars 141 forks source link

Replace strings with const strings #220

Closed decriptor closed 6 years ago

decriptor commented 6 years ago

This centralized a large chunk of the hard coded strings. The idea is to make it easier to convert from raw to gir. For example, RAW uses "enum", but GIR uses "enumeration". Using the const string we can find all places in the generator that references "enum" as well as update the name in only one place.

sundermann commented 6 years ago

Are you going to switch to gir for gtk 2.12?

decriptor commented 6 years ago

That's what I'm hoping for. The bigger idea/thought is once this is switched over to gir and flushed out that we could move to gtk 2.24 instead of gtk 2.12.

Therzok commented 6 years ago

@stsundermann yes, we are. And we're going to make incremental updates, like 2.12, 2.24 then move over to 3.x+

sundermann commented 6 years ago

Actually, I had the same idea and started working on a gir generator some months ago. Rather than updating the gtk generator I started from scratch since .gir is quite different from the .raw files. The idea was to even generate bindings for GObject and GLib using the new generator and then adding the type system on top of those automated bindings.

Therzok commented 6 years ago

@stsundermann I looked over the GIR files, they're not that much different, it's mostly a matter of mapping the gtk raw file metadata to GIR values

knocte commented 6 years ago

What's the motivation behind moving to 4.7.1?

sundermann commented 6 years ago

Do you consider splitting up the generator and type system from gtk-sharp (something like gi-sharp)? Currently, users have to install gtk-sharp even if a binding does not depend on gtk but only glib/gobject-sharp.

Therzok commented 6 years ago

@stsundermann There's a really rough doc atm on what we're planning, but feel free to add ideas into it and we can fix all the issues we currently have:

https://paper.dropbox.com/doc/GTK-modernizing-plan-0XpX07nxjdQyKsHx7c09G

This will be moved over to the wiki as soon as v1 of it is done.

sundermann commented 6 years ago

You can also take a look at https://github.com/shana/bindinator which converts .gir to .raw. It should provide information on the gir <-> raw xml tag mapping.

Therzok commented 6 years ago

What's the motivation behind moving to 4.7.1?

Removed that, we don't need to change that for now.

knocte commented 6 years ago

Removed that, we don't need to change that for now.

Thanks @Therzok. I guess you guys were thinking of allowing new C# language features. However, IMO it should remain easy to package/compile on at least LTS distributions (which maybe can compile 4.5.2, but not 4.7.1).

Therzok commented 6 years ago

@knocte there's also the fact that .NET Framework on windows is tied to specific Windows versions. We need to consider where to cut the line for dropping support for XP/Vista, etc

Therzok commented 6 years ago

.NET 4.0 is a good idea to bump to as XP is EOL already, but yeah.