Lots of stuff; couldn't commit in parts because of refactor work.
authorTon Roosendaal <ton@blender.org>
Tue, 2 Dec 2008 14:22:52 +0000 (14:22 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 2 Dec 2008 14:22:52 +0000 (14:22 +0000)
commit54908979c54ab332156f438e995d5dce8ee8420c
tree94558d3acad12b5c0f08e902d967ce3d6d0f0723
parentc4fe6d0f00aa2a9656445ebb53161768e0c51342
Lots of stuff; couldn't commit in parts because of refactor work.

* Changes in interface/ module

This commit brings back the way how buttons/menus work under control
of WM event system. The previous implementation extended usage of
handlers and operators in an interesting but confusing way. Better to
try it first according the design specs. :)

Most obviously:
- modal-handler operators are not stored anymore in regions/areas/windows.
  such modal handlers own their operator, and should remove it themselves.
- removed code to move handlers from one queue to another.
  (needs review with brecht!)
- WM fix: the API call to remove a modal handler got removed. This was a
  dangerous thing anyway, and you should leave that to the event system.
  Now, if a handler modal() call gets a cancel/finish return, it frees
  itself in event system. WM_event_remove_modal_handler was a confusing
  call anyway!

Todo:

- allow button-activate to refresh after using button
- re-enable arrow keys for menus
  (do both after commit)

- review return values of operator callbacks in interface_ops.c

* Fixes in WM system

- Freeing areas/regions/windows, also on quit, now correctly closes
  running modal handlers
- On starting a modal handler, the handler now stores previous area
  and region context, so they send proper notifiers etc.

* Other fixes

- Area-split operator had bug, wrong minimal size checking. This
  solves error when trying to split a very narrow area.
- removed DNA_USHORT_FIX from screen_types.h, gave warning
- operators didn't get ID name copied when activated, needed for
  later re-use or saving.
18 files changed:
source/blender/blenkernel/intern/screen.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_time/ed_markers.c
source/blender/editors/space_time/time_ops.c
source/blender/makesdna/DNA_screen_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/nodes/intern/CMP_util.h
source/blender/nodes/intern/SHD_util.h
source/blender/nodes/intern/TEX_util.h
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/wm_event_system.h