Render Objects

Widgets generally draw 3 things: text, icons and 'boxes' - ie mostly rectangular areas that get filled with some kind of theme-provided or custom-drawn content (fixme: example image). We've been moving widgets closer to the css box model (fixme: link ?), but many widgets really consist of multiple boxes in that sense, and better themability requires us to make these regions available for css selector matching. The original GTK+ css work had a concept of 'regions' that was an attempt at this, but it was not complete or consistent enough to be very useful. The goal is for render objects to represent these boxes.

Each widget will have a tree of render objects, and drawing the widget will mainly be a loop over all the render objects, which know how to draw themselves.

When we move onto clutter, render objects will be just clutter actors, and the render object tree will turn into the actor tree. And the widget will use an appropriate layout manager to organize its actors as appropriate. A GtkBox will use a box layout, but e.g. a GtkScale will have a custom layout manager that places the 'knob' actor at the right position on top of the 'trough' actor.

Since each widget will have a toplevel render object representing the widget itself, child widgets can just be added into the parents render object tree.

Projects/GTK+/RenderObjects (last edited 2013-11-22 15:36:59 by WilliamJonMcCann)