www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - GtkD 3.5.0, GTK+ with D.

reply Mike Wey <mike-wey example.com> writes:
GtkD is a D binding and OO wrapper of Gtk+ and is released on the LGPL 
license.

Close to the 3.4 release, but the new functionality to now also remove 
registered signal handlers added by Gerald Nunn warrants a new release.
Signal handles can be removed with the 
`gobject.Signals.Signals.handlerDisconnect` function.

```
gulong id = addOnDraw(&myHandler);

Signals.handlerDisconnect(this, id);
```

Users who previously removed there handlers from the internal array used 
by GtkD will need to update there code to the new system.

Changelog: http://gtkd.org/changelog.html
Download: http://gtkd.org/Downloads/sources/GtkD-3.5.0.zip

-- 
Mike Wey
Jan 06
next sibling parent reply Joakim <dlang joakim.fea.st> writes:
On Friday, 6 January 2017 at 22:00:55 UTC, Mike Wey wrote:
 GtkD is a D binding and OO wrapper of Gtk+ and is released on 
 the LGPL license.

 Close to the 3.4 release, but the new functionality to now also 
 remove registered signal handlers added by Gerald Nunn warrants 
 a new release.
 Signal handles can be removed with the 
 `gobject.Signals.Signals.handlerDisconnect` function.

 ```
 gulong id = addOnDraw(&myHandler);

 Signals.handlerDisconnect(this, id);
 ```

 Users who previously removed there handlers from the internal 
 array used by GtkD will need to update there code to the new 
 system.

 Changelog: http://gtkd.org/changelog.html
 Download: http://gtkd.org/Downloads/sources/GtkD-3.5.0.zip
Hey Mike, any interest in providing a library for Android? You can try out my ldc cross-compiler for Android: https://github.com/joakim-noah/android/releases
Jan 06
parent reply Mike Wey <mike-wey example.com> writes:
On 01/07/2017 08:24 AM, Joakim wrote:
 Hey Mike, any interest in providing a library for Android?  You can try
 out my ldc cross-compiler for Android:

 https://github.com/joakim-noah/android/releases
There would first need to be a GTK version for Android. -- Mike Wey
Jan 07
parent reply Joakim <dlang joakim.fea.st> writes:
On Saturday, 7 January 2017 at 11:06:14 UTC, Mike Wey wrote:
 On 01/07/2017 08:24 AM, Joakim wrote:
 Hey Mike, any interest in providing a library for Android?  
 You can try
 out my ldc cross-compiler for Android:

 https://github.com/joakim-noah/android/releases
There would first need to be a GTK version for Android.
There is a repo for it: https://github.com/eugals/GTKAndroid But if Gtk doesn't really bother supporting Android and you don't want to mess with it either, that's fine.
Jan 07
parent Mike Wey <mike-wey example.com> writes:
On 01/07/2017 02:46 PM, Joakim wrote:
 On Saturday, 7 January 2017 at 11:06:14 UTC, Mike Wey wrote:
 On 01/07/2017 08:24 AM, Joakim wrote:
 Hey Mike, any interest in providing a library for Android?  You can try
 out my ldc cross-compiler for Android:

 https://github.com/joakim-noah/android/releases
There would first need to be a GTK version for Android.
There is a repo for it: https://github.com/eugals/GTKAndroid But if Gtk doesn't really bother supporting Android and you don't want to mess with it either, that's fine.
Maybe when the android support is more mature. -- Mike Wey
Jan 07
prev sibling parent reply dlang user <dlang.user gmx.com> writes:
On 01/06/2017 04:00 PM, Mike Wey wrote:
 GtkD is a D binding and OO wrapper of Gtk+ and is released on the LGPL
 license.

 Close to the 3.4 release, but the new functionality to now also remove
 registered signal handlers added by Gerald Nunn warrants a new release.
 Signal handles can be removed with the
 `gobject.Signals.Signals.handlerDisconnect` function.

 ```
 gulong id = addOnDraw(&myHandler);

 Signals.handlerDisconnect(this, id);
 ```

 Users who previously removed there handlers from the internal array used
 by GtkD will need to update there code to the new system.

 Changelog: http://gtkd.org/changelog.html
 Download: http://gtkd.org/Downloads/sources/GtkD-3.5.0.zip
When I compile the HelloWorld.d demo code on version 3.4.1 in debug mode the resulting file size is 26.4MB, when I compile the same code with 3.5.0 the file size is 70.7MB, that is quite a jump in size. I am using DMD V2.072.2 on 64bit Debian testing.
Jan 07
parent reply Gerald <gerald.b.nunn gmail.com> writes:
On Saturday, 7 January 2017 at 16:46:38 UTC, dlang user wrote:
 When I compile the HelloWorld.d demo code on version 3.4.1 in 
 debug mode the resulting file size is 26.4MB, when I compile 
 the same code with 3.5.0 the file size is 70.7MB, that is quite 
 a jump in size.  I am using DMD V2.072.2 on 64bit Debian 
 testing.
As you are probably aware, GtkD auto-generates code. Unfortunately, adding the ability to remove event handlers generated an increase in the size of code, instead of just tracking the delegate directly it now uses a wrapper class to also track the connect flags and returned handlerId. Right now a unique wrapper class is generated for each event handler which I suspect is the primary culprit for the increase in size. If this size increase is a major concern, one option might be for me to try to use a generic wrapper class instead of a generating a unique one. This would mean converting the generated code to cast the delegate before using it. I'll let Mike chime in with his thoughts first though before looking too much into it.
Jan 07
next sibling parent dlang user <dlang.user gmx.com> writes:
On 01/07/2017 11:32 AM, Gerald wrote:
 On Saturday, 7 January 2017 at 16:46:38 UTC, dlang user wrote:
 When I compile the HelloWorld.d demo code on version 3.4.1 in debug
 mode the resulting file size is 26.4MB, when I compile the same code
 with 3.5.0 the file size is 70.7MB, that is quite a jump in size.  I
 am using DMD V2.072.2 on 64bit Debian testing.
As you are probably aware, GtkD auto-generates code. Unfortunately, adding the ability to remove event handlers generated an increase in the size of code, instead of just tracking the delegate directly it now uses a wrapper class to also track the connect flags and returned handlerId. Right now a unique wrapper class is generated for each event handler which I suspect is the primary culprit for the increase in size. If this size increase is a major concern, one option might be for me to try to use a generic wrapper class instead of a generating a unique one. This would mean converting the generated code to cast the delegate before using it. I'll let Mike chime in with his thoughts first though before looking too much into it.
No, the size increase isn't a concern for me at all. It was just an observation that I made using the new version, and I wasn't sure if it was expected or not.
Jan 07
prev sibling parent Mike Wey <mike-wey example.com> writes:
On 01/07/2017 06:32 PM, Gerald wrote:
 On Saturday, 7 January 2017 at 16:46:38 UTC, dlang user wrote:
 When I compile the HelloWorld.d demo code on version 3.4.1 in debug
 mode the resulting file size is 26.4MB, when I compile the same code
 with 3.5.0 the file size is 70.7MB, that is quite a jump in size.  I
 am using DMD V2.072.2 on 64bit Debian testing.
As you are probably aware, GtkD auto-generates code. Unfortunately, adding the ability to remove event handlers generated an increase in the size of code, instead of just tracking the delegate directly it now uses a wrapper class to also track the connect flags and returned handlerId. Right now a unique wrapper class is generated for each event handler which I suspect is the primary culprit for the increase in size. If this size increase is a major concern, one option might be for me to try to use a generic wrapper class instead of a generating a unique one. This would mean converting the generated code to cast the delegate before using it. I'll let Mike chime in with his thoughts first though before looking too much into it.
I didn't expect a jump in size of that magnitude, but i didn't check for it either. In release builds the size difference is smaller, and the best results are with ldc. (-O -release + strip) With ldc the HelloWorld demo is just 2.4MB (2.2MiB) a 0.2MB increase from the previous release. For the library itself this is a bit more with a 30% increase in size. -- Mike Wey
Jan 07