More notifier and redraw cleanup
- notifiers are not filtered anymore, apart from window/screen notifiers,
they get to all regions.
- fixed drawing of 'action zones' in areas.
- added support for basic multilayer draw, like for action zones now,
and future other area decorations (tabs, region handlers)
check: ED_area_overdraw_flush()
ED_area_overdraw()
- bugfix in UI redraw tags, it was calling region pointer in free'd
data
- added notifier for marker-changed
- added keymap for markers to ipo window
* Only open tooltip when the mouse is still over the button.
* Remove an unnecessary redraw call, though the two mentioned
in the previous commit seem to be working OK (it's for action
buttons when you move the mouse away from the button, holding
the mouse button down).
* Fix missing alt key in key event strings.
Test for Brecht: this line makes drawing buttons fine.
However note:
- redraws on lines 3107 and 3024 don't do anything
- tooltip timer is messing with redraws too, if you
have tooltips on, it continuously sends redraws.
- I would code tooltip to reset on any mouse move,
and only start timer when mouse is still completely.
That would make them appear much more quietly.
More notifier cleanup;
- removed view2d sync notifier, its data operations are too complex
for UI hints/notes, direct calls work too :)
- updated missing gpl header in region file
Noticed weird delay on menu refreshing now... will check.
Work on getting notifiers in shape.
- Most important: local (to own region or area) redraw notifiers
have been depricated. This is not a good or correct notifier anyway.
Notifiers should be signals to other areas.
- Instead use these 2 functions:
ED_area_tag_redraw(area);
ED_region_tag_redraw(region);
It seems to me good convention to keep the area/region redraw tag
itself protected everywhere, for future improvements.
- Also added a basic WM function that checks overlapping regions,
and flushes redraws to underlying regions. This makes menus and
buttons allow to only send local region redraws.
(Brought back two "swapbuffer indicators" to test this.
- Todo: area 'action zone' redraws, and fixing other notifiers...
sending data pointers in a notifier seems to be bad idea.
Improved the View2D API so that initialising View2D data in init() callbacks (called on new regions and also on resizing regions) for regions is easier.
Added a few preset view configurations for use when initialising new views. Views with the V2D_IS_INITIALISED flag set will not be reinitialised in the init() callbacks. Currently, some of these configurations will set/override all settings (like V2D_COMMONVIEW_LIST and V2D_COMMONVIEW_HEADER), while other ones serve a more supplimentary role (i.e. V2D_COMMONVIEW_TIMELINE only sets the x-axis settings, relying on the region to have already set the relevant y-axis settings).
The future of such supplimentary configurations is yet to be seen, as I'm currently not sure whether they will cause the code to become too confusing, as you'd have to keep track of which settings belong/are set where. So far, only a few areas have been ported to use this. Tomorrow I'll check on a few more.
As this commit touches a lot of files, hopefully there aren't any critical bugs I've missed here.
operators. RNA property buttons will automatically fill in the label, min/max,
etc if they are not specified. Operator menu buttons will look up the key
combination in the handlers and add it automatically.
uiDefButR, uiDefIconButR, uiDefIconTextButR
uiDefButO, uiDefIconButO, uiDefIconTextButO
uiDefButO takes a context pointer to do the key lookup, don't really like this..
which context to run the operator: WM_OP_DEFAULT, WM_OP_REGION_WIN,
WM_OP_AREA or WM_OP_SCREEN. This also replaces WM_operator_call_rwin
since it is more general.
This is useful for buttons and popup menus to run operators, and also
used by a new function to lookup the keymap item for that operator in
the right context.
and event handling code still, how it integrates with operators and
handlers is not worked out yet. For testing, Ctrl+Q quit now shows
a confirmation popup using the following call:
okee_operator(C, "WM_OT_exit_blender", "Quit Blender");
Small improvements;
- switch spacedata now doesn't cause full screen refresh and draw
- cursor switching is not part of SCREEN_CHANGED notifier, this
makes area dragging ugly.
Added notifiers for timeline syncing. Works for Timeline window
only now.
Note that I've removed the malloc-free in a Notifier... notifier
system is still under probabtion :)
Mouse cursors now work again
- centralized screen-level cursor changes, no more operator
running for it.
- spacetypes have callback to check/set individual cursor
types. Use notifier SCREEN_CHANGED to make sure it works
on mode changes etc.
- new calls WM_cursor_modal() and WM_cursor_restore() to
make temporarily cursor types during modes.
- used above for view2d cursors.
Added some functionality to make inspecting all RNA structs possible. Not used
yet, but can be tested by replacing this line in space_outliner.c:
RNA_main_pointer_create(G.main, &cell.ptr);
with:
RNA_blender_rna_pointer_create(&cell.ptr);
- depricated area "headbutofs" and "headbutlen", which is now fully
replaced with view2d handling.
- needed to add header default V2D_ALIGN_NO_NEG_Y, V2D_LOCKOFS_Y seems
to not do anything atm :)
- new: running blender in debug (blender -d) will print the current
handler and operator in use (not mousemove)
which will then be set when the operator is called, example:
kmi= WM_keymap_add_item(keymap, "ED_SCR_OT_region_split", SKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "dir", 'h');
kmi= WM_keymap_add_item(keymap, "ED_SCR_OT_region_split", SKEY, KM_PRESS, KM_SHIFT, 0);
RNA_enum_set(kmi->ptr, "dir", 'v');
There is a hack I had to do here, since properties are defined
as member of wmOperator, will try to fix later, committing now
so it can be used already.
I've gone through and simplified some of the redundant options while documenting the various settings (in the code and also in the Wiki Doc), to make it clearer how to use each option.
'Preset' view-types have yet to be fully implemented, but started groundwork for this. Only some commonly used view configurations will be defined using this method. For all others, they still need to define all relavent view settings themselves (as there's too much variation in terms of the various editor's use of View2D).
IPO Editor now draws with channels on the left, like all other anim editors. Now, how to make this wider...
funtion WM_keymap_add_item() now returns keymap-item, so you can use it
to set default properties for operators with WM_keymap_property_set().
Brecht will fill in this function, requires rna magic!
Example: an operator ED_OB_OT_add_primitive can be configured with
keymap like this:
WM_keymap_property_set(keymapitem, "Primitivetype", "Sphere");
Similar conventions we can use later for button/menu calls.
This will make creating operators easier, allowing a developer to group
tools functionality nicely.
* DNA_sequence_types.h done, patch by Roelf de Kock, with various changes,
mainly the use of inheritance for different sequence types and hiding the
separate Strip struct.
that is not supposed to be in the editor but at blenkernel level
to avoid bad level calls. Added sequencer free and strip iterator
functions there and used them to make sequencer data load/save
work again.
Small fix: in the ghost part of WM event handling, a function was
setting 'active subwindow' and registering headers to be drawn active
for this or not. It should be nicely inside the handler queue, so
it doesnt get executed on modal window-handlers.
(This solves flashing area headers while dragging area edges)
Still needed to resolve how screen handling goes... via handlers
with operators? On my list to keep track of. :)
OSX crashed on double-click the Finder Blender icon
Removed 7 years old hack to get the correct arguments for this case, it
was a terrible hack anyway. Needs proper code.
Fix for crash on joining (previously splitted) areas.
Reason was the stored regions in pushed 'spaces' not being copied.
next: free running handlers on area join/split.
- Added file space (too) :) Andrea was first, this is more
complete.
- Suggestion from Joshua: move all standard header buttons to
1 function, makes it all easier, less code, and less area/space
stuff needs to be exposed.
* Scrollers now keep corners free for drawing widgets if there are horizontal and vertical ones in use. They draw a rect which covers up all of the excess over-flowing drawing that was previously masked by the vertical scrollers.
* Tweaked the behaviour of the scroller zoom-handles again as they still weren't behaving correctly on vertical scrollers. This was partly caused by a typo, but also wrong checks...
Fixed more crashers in screen/region/area/spacetype freeing code...
Hint to Ton: watch how you're getting the pointer to the next item in the list when freeing the list ;)
* Headers were twitching when moved again due to a hack I had made for the TimeLine
* Properly fixed TimeLine init so that grid will start in the right place.
The basics for InfoSpace.
Also added InfoSpace data to area by default, older files allowed to
have nothing here (space empty). (prevents reported crasher in switching
space info to others).
Also: added ifdeffed code in readfile.c to debug missing memory frees
from data read from files. (instead of "data from SCR" it will print
the actual struct names).
Added freeing functions in outliner space, this makes blender quit
without memory free errors in my test .b.blends.
Note: I'll move current rna viewer to new SpaceData editor, then I
can bring back original outliner stuff. Proposed menu name is
"Data Viewer". Probably better not not expose name 'rna' in UI?
* Scrollers now draw using nice rounded+shaded style everywhere
* When scrollers 'bubble' completely fills a scroller or is completely out of view, the view zooming using the handles is now only activated if the mouse is within a quarter of the total length of the scroller on either end of the scroller. Otherwise, pan is activated. This should make the scrollers more usable in anim editors.
* Fixed drawing of gridlines in TimeLine - needed to adjust ymin value of cur and tot rects to accomodate for the new mask/cur adjustments as old TimeLines didn't draw with 'real' scrollbars. Also, adjusted min/max values to fit these new tot/cur rect y-sizes.
* Tidying up vars and fixing errors in declaring new View2D types in preparation for simpler method of initialising views...