Page MenuHome

Initial uiWidget architecture Refactor
AbandonedPublic

Authored by Julian Eisel (Severin) on Jul 20 2015, 1:50 PM.

Details

Summary

Initial uiWidget architecture Refactor

Aiming towards the following goals:

  • Widget Draw Styles (see T45025 - heavily overlaps with this)
  • Isolating widget code to make it more future proof
  • Adding callback based widgets handling module (currently handled in interface_handler.c)

Adds the following folders/files:
interface/widgets/
interface/widgets/widgets.c
interface/widgets/widgets.h
interface/widgets/widgets_draw/
interface/widgets/widgets_draw/drawstyle_classic.c
interface/widgets/widgets_draw/widgets_draw.c
interface/widgets/widgets_draw/widgets_draw_text.c
interface/widgets/widgets_draw/widgets_draw_intern.h

Branch: temp-ui-widget-refactor

Will add some more info here soonish


NOTE: This is still WIP, but thought it might be good to start reviewing early on (mainly general architecture changes).

WIP doc: http://wiki.blender.org/index.php/User:Julianeisel/ui-widgets

Diff Detail

Repository
rB Blender
Branch
temp-ui-widget-refactor

Event Timeline

Julian Eisel (Severin) retitled this revision from to Initial uiWidget architecture Refactor.
Julian Eisel (Severin) updated this object.
Julian Eisel (Severin) set the repository for this revision to rB Blender.
Julian Eisel (Severin) updated this object.
Sergey Sharybin (sergey) added inline comments.
source/blender/editors/interface/widgets/widgets.c
71

This worth making an init() callback of widget type instead of having it all hardcoded here.

Campbell Barton (campbellbarton) requested changes to this revision.Jul 23 2015, 9:36 AM
Campbell Barton (campbellbarton) edited edge metadata.

Hey, checked and works fine, so nice start :)

General feedback on the way forward...

  • We should first have 2... probably 3 different token styles (maybe one totally simple, another a variation of classic? --- just to save time).
  • Figure out what functions should be shared between then and move into utility module.
  • Then finalize styles (probably improve and keep the 'simple' style), for merging into master.

With only one style, think its too hard to evaluate the patch, its just moving functions about (which is good), but not significant enough to approve.

This revision now requires changes to proceed.Jul 23 2015, 9:36 AM

@Campbell Barton (campbellbarton), yep, still agree on adding another style to check if everything is working, but wanted to get overall refactor changes done and approved first. Will start working on that soon.

source/blender/editors/interface/widgets/widgets.c
71

Not really sure what you mean here tbh ;P

Like:

void (*init)(...)
...
    case UI_WTYPE_FOO:
        init = widget_init_foo;
        break;
...
init(...);

?

Julian Eisel (Severin) edited edge metadata.
Julian Eisel (Severin) edited edge metadata.

Update patch to work with D1464

This was an interesting experiment, but I'm not too sure it's the best way forward (I rather spend time on https://github.com/julianeisel/bWidgets ;) ). The code is quite outdated too.