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 623711 - Add internal accessors for GtkRange's geometry struct
Add internal accessors for GtkRange's geometry struct
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkRange
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 623712
 
 
Reported: 2010-07-06 22:13 UTC by Alberto Ruiz
Modified: 2014-09-27 04:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add internal accessors for GtkRange's geometry struct (1.83 KB, patch)
2010-07-06 23:02 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Add internal accessors for GtkRange's geometry struct.v2 (2.70 KB, patch)
2010-07-06 23:51 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Exposes GtkRange elements' geometry internally (1.38 KB, patch)
2010-07-12 11:41 UTC, Alberto Ruiz
none Details | Review

Description Alberto Ruiz 2010-07-06 22:13:45 UTC
In order to add marker functionality to GtkScrollbar I need access to the trough geometry which is painted and placed in an internal struct in GtkRange.
Comment 1 Javier Jardón (IRC: jjardon) 2010-07-06 23:02:04 UTC
Created attachment 165388 [details] [review]
Add internal accessors for GtkRange's geometry struct
Comment 2 Alberto Ruiz 2010-07-06 23:32:24 UTC
That was fast
Comment 3 Alberto Ruiz 2010-07-06 23:38:19 UTC
I think that the steppers should be provided, the trough and the slider are enough for my usecase, but the point of this exposure is to provide as much info as possible.

Plus, it should be possible to use NULL as an argument and get only the info you're interested in :-)
Comment 4 Javier Jardón (IRC: jjardon) 2010-07-06 23:51:19 UTC
Created attachment 165391 [details] [review]
Add internal accessors for GtkRange's geometry struct.v2

I've added the steppers and you can use NULL as a entry parameter now
Comment 5 Matthias Clasen 2010-07-07 16:06:13 UTC
I don't think this is right.
Comment 6 Alberto Ruiz 2010-07-08 12:45:20 UTC
Matthias, would you elaborate a bit on why you think this is the case?

If you have a look at the expose code at GtkRange, you'll notice that the expose code has quite a bit of logic to figure out the geometry of the slider, trough and steppers.

I'm not too keen on duplicating all that code just to avoid an internal accessor.

If you have an alternative in mind please let us know :-)
Comment 7 Matthias Clasen 2010-07-08 13:54:14 UTC
I guess I am just disagreeing with the idea of starting to let that 'quite a bit of logic' leak out, after we've contained it in GtkRange for so long.
Comment 8 Matthias Clasen 2010-07-08 13:57:43 UTC
See bug 97326 for a similar request to expose the guts
Comment 9 Alberto Ruiz 2010-07-08 16:28:42 UTC
I'm assuming you understand I'm not considering exposing these elements in the public API.

Do you suggest we should duplicate the code then?

Another option would be to have a private function out of both widgets that would give you the geometry of all those elements from a given GtkRange. The problem I see with duplication is that if at some point the theming mechanism changes somehow, we would have to keep that in mind.

In any case, I don't quite understand why the expose logic of what ultimately is a GtkScrollbar lives in GtkRange anyway as it's supposed to be a base class. If moving that expose code down to GtkScrollbar seems like an option to you, I'm all for that, but my gut feeling tells me I'm prolly missing something here.

I lack any sort of background on the past of this widget and some of the consequences of the changes I'm proposing, so your advice is really appreciated.
Comment 10 Alberto Ruiz 2010-07-12 11:41:30 UTC
Created attachment 165722 [details] [review]
Exposes GtkRange elements' geometry internally

Didn't notice the previous patch was exposing these guts publicly, adding a private header here :-)
Comment 11 Gil Forcada 2010-07-20 06:56:51 UTC
Hi,

Small typo: the last if checks stepper_c while it should check stepper_d