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 556145 - Move child API into GooCanvasContainer
Move child API into GooCanvasContainer
Status: RESOLVED OBSOLETE
Product: goocanvas
Classification: Other
Component: general
svn trunk
Other Linux
: Normal enhancement
: ---
Assigned To: goocanvas-maint
goocanvas-maint
Depends on:
Blocks:
 
 
Reported: 2008-10-13 14:15 UTC by Murray Cumming
Modified: 2021-05-17 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Initial patch (339.41 KB, patch)
2008-11-05 17:29 UTC, Armin Burgmeier
none Details | Review

Description Murray Cumming 2008-10-13 14:15:25 UTC
I think I've had a conversation about this on a mailing list, but I can't find it now, and I don't remember a good answer. Sorry if I'm wrong.

I think the child API (get_child(), etc) should be moved into the GooCanvasContainer, instead of the GooCanvasItem, because that obviously makes more sense. Openismus is likely to provide a patch for that.
Comment 1 Damon Chaplin 2008-10-15 11:15:57 UTC
Yes, I agreed a container class would have been better in hindsight.
But it would probably break API so wouldn't happen for a while.
Comment 2 Murray Cumming 2008-10-20 14:29:49 UTC
I've added this to our list of mini tasks for people at Openismus so a patch can be ready for whenever we want it.
Comment 3 Armin Burgmeier 2008-10-22 12:18:56 UTC
When you say GooCanvasContainer, do you mean GooCanvasGroup here? Or, do you mean to create a new GooCanvasContainer interface, that has GooCanvasItem as prerequisite and is implemented by GooCanvasGroup. I think I'd prefer the second option for cleanliness, but I'm not sure what you had in mind.
Comment 4 Murray Cumming 2008-10-22 13:09:55 UTC
I don't understand the need for a GooCanvasContainer. What item would be a container but not a group?
Comment 5 Armin Burgmeier 2008-10-22 15:04:51 UTC
I don't know whether there is an actual need for this. I was only wondering out of consistency reasons since GooCanvasItem is an interface as well. For example, I don't think there is an Item that does not derive from GooCanvasItemSimple, either. Also, it's not possible to create a container that does not derive from GooCanvasItemSimple (via GooCanvasGroup) that way. Again, I'm not sure whether that's needed or how much a restriction it is.
Comment 6 Armin Burgmeier 2008-10-29 14:53:55 UTC
I started to implement this, and I really think that a separate GooCanvasContainer interface would fit better into the current GooCanvas design, even if there is no immediate need for it. Damon, have you any preference on this?
Comment 7 Murray Cumming 2008-10-29 15:57:59 UTC
Armin, could you explain why?
Comment 8 Armin Burgmeier 2008-10-29 16:21:40 UTC
Since GooCanvasItem is an interface, it should not have anything to do with an implementation of it. However, GooCanvasGroup implements GooCanvasItem, by deriving from GooCanvasItemSimple. On the one hand this means that methods such as goo_canvas_item_get_parent need to "know" GooCanvasGroup, which seems wrong, (the idea of an interface is to be generic, not relying that a specific implementation exists). And on the other hand this means that every item that wants to be a container needs to derive from GooCanvasItemSimple as well (which is not the case for non-container items). So this would remove the flexibility to create container items that do not derive from GooCanvasItemSimple.

Again, it's not a technical issue. It's more a question of design or consistency.
Comment 9 Murray Cumming 2008-10-29 16:29:09 UTC
OK. I guess I don't know why GooCanvasItem is an interface, but that's a separate issue.
Comment 10 Armin Burgmeier 2008-11-05 17:29:01 UTC
Created attachment 122041 [details] [review]
Initial patch

This patch introduces a GooCanvasContainer interface, moves all the relevant functionality from GooCanvasItem to GooCanvasContainer and adapts the rest of the library and the demo for the API changes.
Comment 11 Murray Cumming 2009-02-07 17:25:03 UTC
Damon, are you still against the idea of an API break in goocanvas? I don't think it would disturb anybody much because they can keep on using the old API.
Comment 12 Damon Chaplin 2009-02-09 11:38:34 UTC
I'd only want to break the API to add a major new feature. I don't really think this is important enough.

Comment 13 GNOME Infrastructure Team 2021-05-17 13:39:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/goocanvas/-/issues/16.