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 636892 - emblemedicon: make GEmblemedIcon subclassable
emblemedicon: make GEmblemedIcon subclassable
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.27.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 637169
 
 
Reported: 2010-12-09 17:35 UTC by Cosimo Cecchi
Modified: 2010-12-20 14:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
emblemedicon: make GEmblemedIcon subclassable (4.29 KB, patch)
2010-12-09 17:35 UTC, Cosimo Cecchi
needs-work Details | Review
emblemedicon: make GEmblemedIcon subclassable (8.59 KB, patch)
2010-12-15 11:06 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2010-12-09 17:35:42 UTC
Hiding the object/class structs in the source file makes this class not
subclassable.

Move them to the public header, and add a property for the icon, so that
subclasses can just use

  g_object_new (DERIVED_TYPE,
                "gicon", icon,
                NULL);

to create an emblemed icon.
Comment 1 Cosimo Cecchi 2010-12-09 17:35:44 UTC
Created attachment 176140 [details] [review]
emblemedicon: make GEmblemedIcon subclassable
Comment 2 Matthias Clasen 2010-12-15 02:48:39 UTC
Review of attachment 176140 [details] [review]:

Shall we use a private here ? Like

struct _GEmblemedIcon
{
  GObject parent_instance;

  /*< private >*/
  GEmblemedIconPrivate *priv;
}
Comment 3 Cosimo Cecchi 2010-12-15 11:06:41 UTC
Created attachment 176455 [details] [review]
emblemedicon: make GEmblemedIcon subclassable

Hiding the object/class structs in the source file makes this class not
subclassable.

Move them to the public header, and add a property for the icon, so that
subclasses can just use

  g_object_new (DERIVED_TYPE,
                "gicon", icon,
                NULL);

to create an emblemed icon.
Comment 4 Cosimo Cecchi 2010-12-15 11:12:07 UTC
(In reply to comment #2)

> Shall we use a private here ?

Good idea, as the struct was opaque anyway. I updated my patch to include private data.
Comment 5 Matthias Clasen 2010-12-20 14:33:32 UTC
Please commit after adding the private.
Comment 6 Cosimo Cecchi 2010-12-20 14:43:37 UTC
Attachment 176455 [details] pushed as 01ba7bd - emblemedicon: make GEmblemedIcon subclassable