Blender Git Loki

Git Commits -> Revision 4a9ee46

Revision 4a9ee46 by Brecht Van Lommel (master)
December 10, 2008, 04:36 (GMT)

UI: don't use operators anymore for handling user interface events, but rather
a special UI handler which makes the code clearer. This UI handler is attached
to the region along with other handlers, and also gets a callback when all
handlers for the region are removed to ensure things are properly cleaned up.
This should fix XXX's in the UI code related to events and context switching.

Most of the changes are in interface_handlers.c, which was renamed from
interface_ops.c, to convert operators to the UI handler. UI code notes:
* uiBeginBlock/uiEndBlock/uiFreeBlocks now takes a context argument, this is
required to properly cancel things like timers or tooltips when the region
gets removed.
* UI_add_region_handlers will add the region level UI handlers, to be used
when adding keymap handlers etc. This replaces the UI keymap.
* When the UI code starts a modal interaction (number sliding, text editing,
opening a menu, ..), it will add an UI handler at the window level which
will block events.

Windowmanager changes:
* Added an UI handler next to the existing keymap and operator modal handlers.
It has an event handling and remove callback, and like operator modal handlers
will remember the area and region if it is registered at the window level.
* Removed the MESSAGE event.
* Operator cancel and UI handler remove callbacks now get the
window/area/region restored in the context, like the operator modal and UI
handler event callbacks.
* Regions now receive MOUSEMOVE events for the mouse going outside of the
region. This was already happening for areas, but UI buttons are at the region
level so we need it there.

Issues:
* Tooltips and menus stay open when switching to another window, and button
highlight doesn't work without moving the mouse first when Blender starts up.
I tried using some events like Q_FIRSTTIME, WINTHAW, but those don't seem to
arrive..
* Timeline header buttons seem to be moving one pixel or so sometimes when
interacting with them.
* Seems not due to this commit, but UI and keymap handlers are leaking. It
seems that handlers are being added to regions in all screens, also in regions
of areas that are not visible, but these handlers are not removed. Probably
there should only be handlers in visible regions?

Commit Details:

Full Hash: 4a9ee46c1446603bf67b37e9970ddbbc1320fb73
SVN Revision: 17769
Parent Commit: b205ec4
Lines Changed: +3785, -3701

1 Added Path:

/source/blender/editors/interface/interface_handlers.c (+3531, -0) (View)

1 Deleted Path:

/source/blender/editors/interface/interface_ops.c (+0, -3518)

17 Modified Paths:

/source/blender/editors/include/UI_interface.h (+57, -40) (Diff)
/source/blender/editors/interface/interface.c (+26, -20) (Diff)
/source/blender/editors/interface/interface.h (+14, -14) (Diff)
/source/blender/editors/interface/interface_regions.c (+30, -40) (Diff)
/source/blender/editors/screen/area.c (+3, -1) (Diff)
/source/blender/editors/screen/screen_edit.c (+10, -0) (Diff)
/source/blender/editors/screen/spacetypes.c (+0, -2) (Diff)
/source/blender/editors/space_outliner/space_outliner.c (+7, -9) (Diff)
/source/blender/editors/space_time/space_time.c (+1, -3) (Diff)
/source/blender/makesdna/DNA_screen_types.h (+1, -1) (Diff)
/source/blender/makesrna/intern/rna_brush.c (+1, -1) (Diff)
/source/blender/makesrna/intern/rna_image.c (+1, -1) (Diff)
/source/blender/windowmanager/intern/wm_event_system.c (+79, -40) (Diff)
/source/blender/windowmanager/WM_api.h (+5, -3) (Diff)
/source/blender/windowmanager/wm_event_system.h (+11, -5) (Diff)
/source/blender/windowmanager/wm_event_types.h (+0, -2) (Diff)
/source/blender/windowmanager/WM_types.h (+8, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021