Commit Graph

15037 Commits

Author SHA1 Message Date
Ton Roosendaal
962870b235 2.5
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
2008-12-16 18:42:12 +00:00
Brecht Van Lommel
e34528e1a6 UI:
* 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.
2008-12-16 17:36:51 +00:00
Campbell Barton
6c2750a6fe Added "bpydoc" to the global namespace of python scripts, making documentation available no matter what data is open in the current blend file, Directory type was also missing from the subtype enum causing the test rna-dump script to fail. 2008-12-16 16:32:48 +00:00
Ton Roosendaal
67dfe58f8c 2.5
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.
2008-12-16 13:49:51 +00:00
Ton Roosendaal
626e5c8b42 2.5
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.
2008-12-16 13:19:02 +00:00
Ton Roosendaal
6fe19cfc85 2.5
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.
2008-12-16 12:28:00 +00:00
Joshua Leung
f518fa8ea7 View2D: Presets for Initialising Views
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.
2008-12-16 11:24:24 +00:00
Brecht Van Lommel
998e682fc3 UI: added the following functions to create buttons for RNA properties and for
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..
2008-12-16 07:55:43 +00:00
Brecht Van Lommel
99575d31ff 2.5: Fix crash in sequencer reading code. 2008-12-16 07:53:59 +00:00
Brecht Van Lommel
1c1c89262e WM: changed WM_operator_call to take an argument, which specifies in
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.
2008-12-16 07:44:21 +00:00
Brecht Van Lommel
d272300da9 UI: bring back function to convert keyboard event to string, and
make the key event button work again.
2008-12-16 07:32:12 +00:00
Ton Roosendaal
89101d51bc 2.5
Undo last commit to save screen redraws on are switching, 
seems some initialize is missing.
2008-12-15 19:41:46 +00:00
Ton Roosendaal
98d710bd16 Depricated Image Select window, so it doesnt crash :) 2008-12-15 19:29:53 +00:00
Brecht Van Lommel
6283b0c8c5 UI: getting popup menus to work again, just the internal interface
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");
2008-12-15 19:19:39 +00:00
Ton Roosendaal
aad5e49701 2.5
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.
2008-12-15 18:43:18 +00:00
Ton Roosendaal
628f02d574 2.5
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 :)
2008-12-15 18:09:55 +00:00
Ton Roosendaal
a16df53619 2.5
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.
2008-12-15 16:54:47 +00:00
Brecht Van Lommel
c13bb258b1 RNA:
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);
2008-12-15 13:46:50 +00:00
Ton Roosendaal
a1e0868018 2.5
- 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)
2008-12-15 13:23:55 +00:00
Brecht Van Lommel
d48f4b6012 2.5: added support for setting RNA properties in keymap item,
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.
2008-12-15 13:10:29 +00:00
Ton Roosendaal
b4aef16733 2.5
Testing toy for space editor devs: press F5key in header or channel list
(or any 'alignment constrained' region to flip it to other side.
2008-12-15 11:59:42 +00:00
Joshua Leung
21ca594625 View2D: Simplification and documentation of settings
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...
2008-12-15 11:58:57 +00:00
Ton Roosendaal
f7106acde8 2.5
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.
2008-12-15 11:45:17 +00:00
Brecht Van Lommel
4a6d3b2ded RNA:
* 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.
2008-12-15 10:48:04 +00:00
Brecht Van Lommel
ed7bf5a479 2.50: added sequence.c in blenkernel for sequencer functionality
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.
2008-12-15 05:21:44 +00:00
Ton Roosendaal
b1e07d13ec 2.5
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. :)
2008-12-14 19:04:20 +00:00
Andrea Weikert
5858ce4495 2.5 MSVC9 projectfiles
update for space_action, space_nla,  space_script, space_sequencer, space_text,space_sound.
2008-12-14 18:12:30 +00:00
Ton Roosendaal
84b293fbc3 2.5
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.
2008-12-14 18:04:31 +00:00
Ton Roosendaal
cc51a4f211 2.5
And area-joining is memory-error free again!
2008-12-14 17:48:52 +00:00
Brecht Van Lommel
ec00764dd2 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17434:HEAD 2008-12-14 17:32:24 +00:00
Ton Roosendaal
131fa2e00c 2.5
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.
2008-12-14 17:25:46 +00:00
Ton Roosendaal
8be23f9490 2.5
Basics for the remaining 6 spacetypes. 

Note: Andrea prefers to merge SpaceImaSel with SpaceFile
for that I'll provide a good readfile.c patch later
2008-12-14 14:43:08 +00:00
Brecht Van Lommel
965f872c3e Fix for memory leak and perhaps other issues on switching space types
in an area, the handlers (UI and keymap) were not removed.
2008-12-14 13:59:34 +00:00
Brecht Van Lommel
d2a09da73f Fix scons warning for space_file, also sorted items alphabetically. 2008-12-14 13:42:25 +00:00
Brecht Van Lommel
3c14eba045 UI: fix for delayed UI callback functions, to avoid it being
called recursively.
2008-12-14 13:38:24 +00:00
Nathan Letwory
914a0aa8f4 * missing include path 2008-12-14 13:24:22 +00:00
Andrea Weikert
8beed4b033 2.5 MSVC9 projectfiles
update for space_info and new files in space_file.
2008-12-14 13:03:33 +00:00
Ton Roosendaal
a4b6ee672d 2.5
- 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.
2008-12-14 12:16:55 +00:00
Joshua Leung
21e01ccac3 2.5
Second attempt at fixing crashing when merging spaces after splitting them.
2008-12-14 11:55:49 +00:00
Joshua Leung
fd1c8aa62e View2D: More scroller related things
* 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...
2008-12-14 11:50:28 +00:00
Andrea Weikert
f436bc8327 added missing directory for space_file to Makefile, sorry 2008-12-14 11:43:38 +00:00
Nathan Letwory
af0ab8b72b * add space_file sconscript reference too. 2008-12-14 11:41:16 +00:00
Joshua Leung
dcdca963b0 2.5:
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 ;)
2008-12-14 11:39:00 +00:00
Andrea Weikert
a3c77e4d9e 2.5
Skeleton for bringing back SpaceFile.
Code to initialize the SpaceFile struct missing still, I think this is the right time to cleanup there :)
2008-12-14 11:25:00 +00:00
Joshua Leung
36fb509f96 View2D: Bugfixes...
* 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.
2008-12-14 10:57:52 +00:00
Ton Roosendaal
3a58eddec5 2.5
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).
2008-12-14 10:52:48 +00:00
Andrea Weikert
616ab233fa == MSVC9 projectfiles ==
* lots of updates for space types/ editors: ipo, view3d, node and image
* rna: update for constraints and armatures
2008-12-14 10:33:18 +00:00
Ton Roosendaal
7e6c5b912d 2.5
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?
2008-12-14 10:08:00 +00:00
Joshua Leung
93f3eaafea 2.5 - Fixed crashes when merging areas 2008-12-14 09:11:31 +00:00
Joshua Leung
ffc0089b7b View2D: Cosmetic changes and bugfixes
* 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...
2008-12-14 08:32:21 +00:00