After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 774709 - Modernize our use of GObject
Modernize our use of GObject
Status: RESOLVED OBSOLETE
Product: libgd
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: libgd maintainer(s)
libgd maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-11-19 12:07 UTC by Debarshi Ray
Modified: 2021-07-05 12:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main-view: Use G_DEFINE_WITH_PRIVATE (1.65 KB, patch)
2016-11-19 12:08 UTC, Debarshi Ray
committed Details | Review
main-view: Drop the priv pointer (25.91 KB, patch)
2016-11-19 12:09 UTC, Debarshi Ray
committed Details | Review
main-view: Use G_DECLARE_DERIVABLE_TYPE (1.87 KB, patch)
2016-11-20 11:03 UTC, Debarshi Ray
committed Details | Review
main-view: Don't export the typedef for the private structure (1.48 KB, patch)
2016-11-20 11:04 UTC, Debarshi Ray
committed Details | Review
main-icon-view: Use G_ADD_PRIVATE (1.96 KB, patch)
2016-11-23 17:16 UTC, Debarshi Ray
committed Details | Review
main-icon-view: Drop the priv pointer (5.90 KB, patch)
2016-11-27 13:57 UTC, Debarshi Ray
committed Details | Review
main-icon-view: Use G_DECLARE_DERIVABLE_TYPE (1.75 KB, patch)
2018-08-17 13:21 UTC, Debarshi Ray
committed Details | Review
main-icon-view: Don't export the typedef for the private structure (1.55 KB, patch)
2018-08-17 13:21 UTC, Debarshi Ray
committed Details | Review
styled-test-renderer: Use G_DEFINE_WITH_PRIVATE (1.80 KB, patch)
2018-08-17 13:22 UTC, Debarshi Ray
committed Details | Review
styled-text-renderer: Drop the priv pointer (4.27 KB, patch)
2018-08-17 13:22 UTC, Debarshi Ray
committed Details | Review
styled-text-renderer: Use G_DECLARE_DERIVABLE_TYPE (2.20 KB, patch)
2018-08-17 13:22 UTC, Debarshi Ray
committed Details | Review
styled-text-renderer: Don't export the private typedef (1.57 KB, patch)
2018-08-17 13:22 UTC, Debarshi Ray
committed Details | Review
two-lines-renderer: Use G_DEFINE_WITH_PRIVATE (1.95 KB, patch)
2018-08-23 08:40 UTC, Debarshi Ray
committed Details | Review
two-lines-renderer: Drop the priv pointer (5.41 KB, patch)
2018-08-23 08:41 UTC, Debarshi Ray
committed Details | Review
two-lines-renderer: Use G_DECLARE_DERIVABLE_TYPE (1.91 KB, patch)
2018-08-23 08:42 UTC, Debarshi Ray
committed Details | Review
two-lines-renderer: Don't export the private typedef (1.63 KB, patch)
2018-08-23 08:42 UTC, Debarshi Ray
committed Details | Review
Remove trailing semi-colons from G_DEFINE_TYPE* calls (2.12 KB, patch)
2018-08-23 09:00 UTC, Debarshi Ray
committed Details | Review
toggle-pixbuf-renderer: Use G_DEFINE_WITH_PRIVATE (1.89 KB, patch)
2018-10-06 16:21 UTC, Debarshi Ray
committed Details | Review
toggle-pixbuf-renderer: Drop the priv pointer (5.03 KB, patch)
2018-10-06 16:21 UTC, Debarshi Ray
committed Details | Review
toggle-pixbuf-renderer: Use G_DECLARE_DERIVABLE_TYPE (2.16 KB, patch)
2018-10-06 16:23 UTC, Debarshi Ray
committed Details | Review
toggle-pixbuf-renderer: Don't export the private typedef (1.65 KB, patch)
2018-10-06 16:28 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2016-11-19 12:07:07 UTC
We should start using recent GObject improvements and conveniences like G_ADD_PRIVATE (or G_DEFINE_*TYPE_WITH_PRIVATE) and G_DECLARE_*_TYPE. Not only will it clean up and improve the code inside libgd, it will also let libgd users leverage g_auto*.

Some of these changes will change the ABI of the public structs, but that won't matter since we are not a conventional library.

I don't know if some libgd user is using a non-GCC/LLVM compiler, so I am not going to start using g_auto* inside libgd.
Comment 1 Debarshi Ray 2016-11-19 12:08:39 UTC
Created attachment 340298 [details] [review]
main-view: Use G_DEFINE_WITH_PRIVATE
Comment 2 Debarshi Ray 2016-11-19 12:09:01 UTC
Created attachment 340299 [details] [review]
main-view: Drop the priv pointer
Comment 3 Debarshi Ray 2016-11-20 11:03:47 UTC
Created attachment 340346 [details] [review]
main-view: Use G_DECLARE_DERIVABLE_TYPE
Comment 4 Debarshi Ray 2016-11-20 11:04:05 UTC
Created attachment 340347 [details] [review]
main-view: Don't export the typedef for the private structure
Comment 5 Cosimo Cecchi 2016-11-20 16:02:07 UTC
Review of attachment 340298 [details] [review]:

Looks good
Comment 6 Cosimo Cecchi 2016-11-20 16:04:11 UTC
Review of attachment 340299 [details] [review]:

OK
Comment 7 Cosimo Cecchi 2016-11-20 16:04:37 UTC
Review of attachment 340346 [details] [review]:

OK
Comment 8 Cosimo Cecchi 2016-11-20 16:04:53 UTC
Review of attachment 340347 [details] [review]:

OK
Comment 9 Debarshi Ray 2016-11-21 14:33:58 UTC
Pushed to master.
Comment 10 Debarshi Ray 2016-11-23 17:16:28 UTC
Created attachment 340623 [details] [review]
main-icon-view: Use G_ADD_PRIVATE
Comment 11 Cosimo Cecchi 2016-11-26 09:14:27 UTC
Review of attachment 340623 [details] [review]:

Looks good.
Comment 12 Debarshi Ray 2016-11-27 13:57:29 UTC
Created attachment 340842 [details] [review]
main-icon-view: Drop the priv pointer
Comment 13 Cosimo Cecchi 2016-11-27 16:37:30 UTC
Review of attachment 340842 [details] [review]:

Looks good.
Comment 14 Debarshi Ray 2018-08-17 13:21:22 UTC
Created attachment 373388 [details] [review]
main-icon-view: Use G_DECLARE_DERIVABLE_TYPE
Comment 15 Debarshi Ray 2018-08-17 13:21:41 UTC
Created attachment 373389 [details] [review]
main-icon-view: Don't export the typedef for the private structure
Comment 16 Debarshi Ray 2018-08-17 13:22:05 UTC
Created attachment 373390 [details] [review]
styled-test-renderer: Use G_DEFINE_WITH_PRIVATE
Comment 17 Debarshi Ray 2018-08-17 13:22:21 UTC
Created attachment 373391 [details] [review]
styled-text-renderer: Drop the priv pointer
Comment 18 Debarshi Ray 2018-08-17 13:22:40 UTC
Created attachment 373392 [details] [review]
styled-text-renderer: Use G_DECLARE_DERIVABLE_TYPE
Comment 19 Debarshi Ray 2018-08-17 13:22:55 UTC
Created attachment 373393 [details] [review]
styled-text-renderer: Don't export the private typedef
Comment 20 Debarshi Ray 2018-08-22 09:34:37 UTC
I pushed this set of patches. A few builds and smoke-testing later, they seem to work as expected. Comments still welcome, though.
Comment 21 Cosimo Cecchi 2018-08-22 18:10:20 UTC
Review of attachment 373390 [details] [review]:

::: libgd/gd-styled-text-renderer.c
@@ +26,3 @@
 };
 
+G_DEFINE_TYPE_WITH_PRIVATE (GdStyledTextRenderer, gd_styled_text_renderer, GTK_TYPE_CELL_RENDERER_TEXT);

Pre-existing, but you can drop the terminal semicolon
Comment 22 Cosimo Cecchi 2018-08-22 18:12:00 UTC
Only this one small comment; anything else left to do before we can close this ticket?
Comment 23 Debarshi Ray 2018-08-23 08:39:29 UTC
(In reply to Cosimo Cecchi from comment #22)
> Only this one small comment; anything else left to do before we can close
> this ticket?

There are a few more classes that use g_type_class_add_private that we need to migrate. Ever since it was actually marked as deprecated in GLib 2.57.2, it has started throwing deprecation warnings during the build.
Comment 24 Debarshi Ray 2018-08-23 08:40:32 UTC
Created attachment 373435 [details] [review]
two-lines-renderer: Use G_DEFINE_WITH_PRIVATE
Comment 25 Debarshi Ray 2018-08-23 08:41:07 UTC
Created attachment 373436 [details] [review]
two-lines-renderer: Drop the priv pointer
Comment 26 Debarshi Ray 2018-08-23 08:42:26 UTC
Created attachment 373437 [details] [review]
two-lines-renderer: Use G_DECLARE_DERIVABLE_TYPE
Comment 27 Debarshi Ray 2018-08-23 08:42:54 UTC
Created attachment 373438 [details] [review]
two-lines-renderer: Don't export the private typedef
Comment 28 Debarshi Ray 2018-08-23 09:00:19 UTC
Created attachment 373440 [details] [review]
Remove trailing semi-colons from G_DEFINE_TYPE* calls
Comment 29 Cosimo Cecchi 2018-08-23 19:02:05 UTC
Review of attachment 373435 [details] [review]:

LGTM
Comment 30 Cosimo Cecchi 2018-08-23 19:02:35 UTC
Review of attachment 373436 [details] [review]:

LGTM
Comment 31 Cosimo Cecchi 2018-08-23 19:02:53 UTC
Review of attachment 373437 [details] [review]:

LGTM
Comment 32 Cosimo Cecchi 2018-08-23 19:03:06 UTC
Review of attachment 373438 [details] [review]:

LGTM
Comment 33 Cosimo Cecchi 2018-08-23 19:03:20 UTC
Review of attachment 373440 [details] [review]:

LGTM
Comment 34 Debarshi Ray 2018-08-24 06:25:59 UTC
Thanks for all the reviews so far, Cosimo! Pushed them to master.
Comment 35 Debarshi Ray 2018-10-06 16:21:20 UTC
Created attachment 373857 [details] [review]
toggle-pixbuf-renderer: Use G_DEFINE_WITH_PRIVATE
Comment 36 Debarshi Ray 2018-10-06 16:21:43 UTC
Created attachment 373858 [details] [review]
toggle-pixbuf-renderer: Drop the priv pointer
Comment 37 Debarshi Ray 2018-10-06 16:23:38 UTC
Created attachment 373859 [details] [review]
toggle-pixbuf-renderer: Use G_DECLARE_DERIVABLE_TYPE
Comment 38 Debarshi Ray 2018-10-06 16:28:40 UTC
Created attachment 373860 [details] [review]
toggle-pixbuf-renderer: Don't export the private typedef
Comment 39 Cosimo Cecchi 2018-10-08 03:31:31 UTC
Review of attachment 373857 [details] [review]:

++
Comment 40 Cosimo Cecchi 2018-10-08 03:32:02 UTC
Review of attachment 373858 [details] [review]:

++
Comment 41 Cosimo Cecchi 2018-10-08 03:32:26 UTC
Review of attachment 373859 [details] [review]:

++
Comment 42 Cosimo Cecchi 2018-10-08 03:32:48 UTC
Review of attachment 373860 [details] [review]:

++
Comment 43 GNOME Infrastructure Team 2021-07-05 12:32:25 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libgd/-/issues/

Thank you for your understanding and your help.