Commit Graph

15037 Commits

Author SHA1 Message Date
Ton Roosendaal
213f30078c 2.5
Added missing basic callbacks for region drawing of view3d and 
ipo channels.
2008-12-13 19:08:44 +00:00
Ton Roosendaal
2493644509 2.5
Added basics for oour precious Buttons Window. The one that will be
(OH NO!) vertical one day? ;)
2008-12-13 19:00:54 +00:00
Ton Roosendaal
04e264a7a2 2.5
The basics for Node Space.... no complaints sofar :)
2008-12-13 18:09:49 +00:00
Ton Roosendaal
e0ab792cf6 2.5
Added basic code for Space Image. Now let's check if this
commit has all it needed :)
2008-12-13 17:44:30 +00:00
Ton Roosendaal
e6897deec1 2.5
Bugfix in the "map cur with mask to region". Division had to be switched. :)
2008-12-13 11:34:03 +00:00
Joshua Leung
4de30b2304 View2D:
* Grid calculation now takes separate args for x/y units and clamping
* Timeline now gets V2D_LOCKZOOM_Y flag to prevent zooming in y-axis
2008-12-13 09:25:47 +00:00
Joshua Leung
9f06ed1b36 RNA: start of wrapping for Constraints
Still need to find out how to get the variable struct-type for constraint->data to work correctly. Any ideas brecht?
2008-12-12 23:30:23 +00:00
Joshua Leung
e83b5fabbf View2d: Removing some debug code I left in... 2008-12-12 23:28:47 +00:00
Joshua Leung
56557f223f 2.5 - Assorted View2D related fixes
IPO Editor Fixes:
* Grid now draws correct. Fixed typo in gridline calculations preventing drawing from occurring. Also, set the right arguments to the appropriate View2D calls.
* Limited Ton's cur<->mask mapping 'hack' to Outliner only, as it was causing problems with the drawing of the grid. Perhaps there's still some faulty code in curRect_validate that should be changed instead...
* Horizontal scroller draws frames now by default. However, the values are still offset a bit, so will need further investigation.

Outliner Fixes:
* Fixed overlapping text problem with RNA-path and menus. Now RNA path draws as a label beside the menus, so there shouldn't be any more problems there.
* do_versions code now sets all appropriate flags, as old OOPS views could cause errors with scroller drawing + view manipulation operators which depend on flags being set.
2008-12-12 23:25:54 +00:00
Nathan Letwory
f3dc0ba876 * spacetype time -> spacetype ipo 2008-12-12 20:59:59 +00:00
Kent Mein
e8effb2d0f started whiping cmake into shape for 2.5 still need to figure out
the rna stuff but its close.  Need to get it working for
blender then copy over same to game engine.

Kent
2008-12-12 20:41:30 +00:00
Nathan Letwory
0956f78d69 * To have IPO editor get both compiled and link, we also make sure it is actually built and linked to. 2008-12-12 20:11:45 +00:00
Ton Roosendaal
f2884fed5c 2.5
Another make file...
2008-12-12 19:19:09 +00:00
Ton Roosendaal
3b9781ba0d 2.5
Scons was missing WM includes
2008-12-12 18:56:15 +00:00
Ton Roosendaal
a46ddac1a9 2.5
- Added rudimentary support for Ipo window
  (Joshua can check on view2d issues for this? :)

- removed ED_area.h, added ED_space_api.h
2008-12-12 18:47:12 +00:00
Ton Roosendaal
faf7965b3c 2.5
- found fix for time-space view2d when increasing height of area,   it has min/max Y zoom stored based on size of area... needs 
  smarter way.

- outliner: header file added, area switch menu + dummy pulldown. 
  this will become template for other space types...
2008-12-12 17:10:54 +00:00
Ton Roosendaal
2fa23a0594 2.5
Fixes in view2d:

- mask/slider rects were calculated wrong 1 pixel (was overlapping)
- found bug with outliner stretching on area-edge-dragging. It required
  an extra mapping of the 'cur view' via mask to actual region.
- added v2d sanity check for uninitialized v2d's
- removed cruft in do_versions for headers (gets catched with above)
- added header-view2d-initialize function, for new-space calls

Fixes in areamanager:

- fixes in 'new space' for time/outliner/view2d
  (unfinished)

For Joshua:

- Making time window higher shows it doesn't update 'cur'. Not sure
  what kind of v2d flag should be checked or set?
2008-12-12 16:29:33 +00:00
Joshua Leung
05e5e00bc9 View2D: Cosmetic tweaks for scrollers
Scrollers now draw in the 'rounded + shaded' style as much of the rest of Blender now. This is just a rough draft of what they could look like (vertical scrollbers in particular highlight the need for a complementary version of gl_round_box_shade).
2008-12-12 11:41:05 +00:00
Ton Roosendaal
e02c15151f 2.5
Removed notifier SCREEN_CHANGED from creating menus or tooltips.
This one is used to re-initialize spaces, areas, regions in screen.
2008-12-12 10:55:36 +00:00
Ton Roosendaal
7f3a34d16c 2.5
Resolved cyclic calls for editors. 
Now there's a space_api/ module, here you can use functions calling
other editor modules. The functions in the module are only used by
the WindowManager module to initialize space types.

Note for sconzers and MSVC and cmake: the proper linking order for
editors is:

- space_api
- space_xxx
- object / mesh / transform / etc
- interface
- util / datafiles
- screen
2008-12-12 10:18:26 +00:00
Joshua Leung
6f6eee0923 2.5 - Fixed crashes when closing windows 2008-12-11 23:05:18 +00:00
Joshua Leung
b7426ab4e2 2.5 - Compiling fix (ED_newspace not defined yet) 2008-12-11 22:30:24 +00:00
Brecht Van Lommel
a10752f4bc UI: restored mechanism to only call button/block callback functions
after the menus are closed, to avoid conflicts with those callbacks
manipulating their own area or region.
2008-12-11 20:30:41 +00:00
Ton Roosendaal
7a1100c8b5 2.5
Today's progress; half working, but i better commit to prevent
conflicts tomorrow :)

- added storage for regions in spacedata
- added space switching (unfinished, gives mem-free errors)
- bugfix: icon of timewindow gave error on split-area
- cleaned interface_icons.c a bit, no warnings
- first work on space new() callbacks, they have to make regions too


NOTE: probably files saved with 2.5 crash now. Have to look at
patching this.

NOTE2: the Makefiles required libeditor screen twice... scons too?
2008-12-11 19:35:27 +00:00
Ton Roosendaal
d39b43aa20 2.5
TimeLine window pulldowns work sorta (for the options that were coded :)

Still trying to bring back code without recoding uiDefButs. In future these
will get directly operator stuff linked. For time being made a simple 
operator call function, like:

WM_operator_call(C, "ED_MARKER_OT_add");

and for forcing operator to run in the main region-window:

WM_operator_call_rwin(C, "ED_MARKER_OT_add");

These calls also work for modal operators, like marker grab in this case.
2008-12-11 15:38:16 +00:00
Ton Roosendaal
045306ae49 2.5
Small fix: Screen state  updating should be blocked while menus are open.
Caused draw errors for activated headers. Todo is: bring back separation
between window-handlers and screen-handlers, to solve this?
2008-12-11 14:59:57 +00:00
Joshua Leung
3c0c5e04bb RNA - Finished wrapping Armatures + Bones
Notes: 
- I'm not sure whether we want to move out the PoseMode hide flags from here, but PoseChannels directly get most of their flags from here.
- Some of the settings for Bones have not been exposed, as they are mostly internal flags or used only by transform
- I'm not sure whether we should be exposing EditMode settings like head/tail/roll directly here...
2008-12-11 10:36:40 +00:00
Joshua Leung
9fa6b03ea7 View2D: Various Fixes + Header Support
Added support for panning headers using View2D of the header regions (only done for TimeLine, as only that one has buttons on it). 
Currently, this uses some do_versions magic to initialise the View2D rects required, however, I'm not sure if all the information was safely ported over yet (notably height and position of rects due to alignment issues).

In the process, I noticed a few bugs with the current View2D code:
* UI_view2d_curRect_validate() is now called after UI_view2d_size_update(), as the size of the 'mask' rect is closely related to the size of the 'cur' rect (especially when zooming is locked).
* Fixed a bug in UI_view2d_curRect_validate() which meant that if the 'cur' rect was slightly larger than the 'tot' rect, and keeptot was set, the view would flicker between the two closely related positions.
2008-12-11 03:50:50 +00:00
Brecht Van Lommel
f00a75272e UI:
* Added context pointer to function callbacks for buttons and blocks.
* Added a uiBlockSetHandleFunc, which will be called with the button
  return value. This seems kind of redundant with uiBlockSetButmFunc,
  but the latter uses a2 to pass the value.
2008-12-10 19:22:10 +00:00
Ton Roosendaal
64f9c67ca8 2.5
- Brought back (most of) buttons in TimeLine window.
  They don't work yet though! Waiting for Brecht to commit callbacks
  for menus and ui-blocks

- Area headers hilite again when mouse is inside.
2008-12-10 17:58:18 +00:00
Ton Roosendaal
acce05c7e4 2.5
Fix: on quit with a ghost event, windows were freed without freeing screens.
2008-12-10 15:12:46 +00:00
Ton Roosendaal
54c4ed469a 2.5
Cleanup in area/region management

- more intelligence in area management for adding handlers and setting
  data correct. Space/Region type callbacks only have to do own things.

- added option for adding default handlers to areas/regions. (flag in
  type definition)

- ensured that region-types store the minsizes for regions.

- added boundbox check for handlers; note that it accepts pointer to
  boundbox, because handlers don't get reset on area-resizing or
  view changes. Example: view2d handlers use mask rect.

- handlers get now added on correct context levels (example frame change
  also worked in header)

- removed ->refresh() callback. Context refreshing is Listener.
  
- the ->init() is being called on all WM level actions, also after a
  file read, moving areas, re-opening areas etc. 

- fixed bug: crash on exit was caused by cleaning up Screen too late.

- UI_view2d_size_update() removed from draw callback, is init()

- regions now store (winx, winy) subwindow size.
2008-12-10 13:56:54 +00:00
Joshua Leung
1fdb9da2a7 RNA - Wrapped a few more Armature/Bone settings
* I've only got a few more Armature settings to go (path stuff)
* Bones have still only got name + layers so far
2008-12-10 12:00:36 +00:00
Joshua Leung
a8726cd9c3 View2D - Bugfixes
Fixed a few typos in View2D code, which included the zoom-locking flags not being checked for correctly by the zoom operators. 

This commit does NOT fix the problems with the Outliner 'cur' rect expanding/contracting as the view changes size. I still haven't found the cause of this, but it might be related to the off-by-1 errors with UI-widgets that brecht noted in TimeLine header...
2008-12-10 09:07:15 +00:00
Brecht Van Lommel
4a9ee46c14 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?
2008-12-10 04:36:33 +00:00
Ton Roosendaal
b205ec4f18 2.5
Area Manager: revised how an area subdivision gets managed. Originally
the 'spacedata' would store regiondata too, but this already became
impractical (like having view2d data in region is useful). So I left
that part how it is. See new diagram:

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/AreaManager

This means that regions in an Area define location/size or constraints
for how they get arranged. The "RegionType" which is linked to this 
defines its functionality. 

For fun, test, and code validation: two temporary hotkeys added.
SKEY: splits current region horizontally
SHIFT+S: splits vertically

Note - in outliner - that "context" sticks to the Area as whole, the region
here only defines view. That's the purpose. :) For two outliners with different
context you open 2 areas.
Also note that dragging screen-edges shows the region-alignment type (split
with percentage).
2008-12-09 15:59:43 +00:00
Joshua Leung
b9e04c67dc RNA: Start of RNA wrapping for Armatures
Wrapped most of Armature settings, but bones are not yet complete.
2008-12-09 11:29:40 +00:00
Joshua Leung
13c634c7ba 2.5 - Swapped order for adding View2D keymaps in TimeLine so that they can still work. 2008-12-09 06:23:40 +00:00
Ton Roosendaal
ab40dd4053 2.5
Stupid error made blender not compile!
2008-12-08 19:16:47 +00:00
Ton Roosendaal
dc50e7fd3c 2.5
Minor cleanups.
2008-12-08 16:43:19 +00:00
Ton Roosendaal
02e23c16dd 2.5
Part one of wrapping up area/region management.
Read design doc here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/AreaManager

This commit:
- brings keymap storage to WM, based on names/types. This structure
  allows rna-ifying it too, so you can browse keymaps etc.
- creating areas and regions works slightly different now, wich
  regiontypes stored in areatype.

Todo:
- better callbacks and structure for defining which handlers need to
  be added.
- using region types to validate regions
- proper implementation of local region data
- code method for customizing keymaps. Current idea is that you have
  to indicate an entire keymap to be custom, to prevent too complicated
  merging problems of default and custom maps (like order, multiple keys
  for same operator, disabling options, etc).
2008-12-08 15:02:57 +00:00
Joshua Leung
11e15bf689 View2D: Tweaks to make handles work better with no-clamping of bubble 2008-12-08 00:48:27 +00:00
Martin Poirier
af52f24fe4 fixing compile error 2008-12-08 00:40:27 +00:00
Joshua Leung
a09835a8f4 View2D: Modal Ctrl-MMB-drag Zoom Restored
Added back the Ctrl-MMB-drag zoom.
* It uses RNA-props for delta amounts to be added to the cur rect, as opposed to storing a transform factor like the others.
* Made the operator another repeatable one
* The user-pref Continue/Dolly/Scale options are still respected. Currently, this is not stored as an RNA-prop for repeated behaviour, as it is not necessary for this operator to function correctly (and also, this data would fall under 'context' info more)

Removed clamping of scroller 'bubble' to bounds of scroller, as it produced a confusing display when using handles to zoom view.
2008-12-07 23:54:41 +00:00
Joshua Leung
63b8fca5b3 View2D: Minor tweaks to scrollbar drawing
Handles on ends of bubble are now drawn as rects. When that axis is zoomable, the handles are darker than when they are not.
2008-12-07 22:19:41 +00:00
Nathan Letwory
f4d823fa02 * blenderlite works now on windows too.
- when WITH_BF_SDL=True entry-point is mainCTRStartup (due to SDL)
  - with WITH_BF_SDL=False this should be just main
2008-12-07 13:22:50 +00:00
Joshua Leung
ed015907df View2D: Scroller Manipulations
Implemented operator to work with scrollers. This should work reasonably well, but as always, more testing is needed.
* LMB-drag can now be used to initiate manipulations of scrollbars (so they can be dragged as per normal)
* By clicking on the 'dark regions' on the ends of the scroll bubble, it is possible to zoom the view (in a way similar to Sony Vegas scrollbars)

Tidied up code of other operators
* Re-labelled the current zoom operators, as there is still a modal click-drag zoom tool to be ported still
* Marked all of the existing view manipulation operators as redoable. Scrollers manipulator is not allowed to be redoable. 

Assorted changes:
* Added more flags for Outliner on reading old files, to prevent more weird things happening as code expects certain flags these days
2008-12-07 12:15:04 +00:00
Nathan Letwory
efdb726cf3 * put the PyRNA testing bit inside the DISABLE_PYTHON define, so we can use blenderlite as target too 2008-12-07 10:55:33 +00:00
Joshua Leung
b7fc71a3e2 View2D: Renamed a few API methods to follow standard naming conventions, and added define to use when an argument to these methods is irrelevant. 2008-12-07 06:21:06 +00:00
Joshua Leung
d2bfb9ae1d View2D: TimeCode display when displaying 'Seconds' not 'Frames'
When time grids are drawn in 'seconds' not 'frames' (use the TKEY to toggle this in Timeline for testing), times are now printed in a timecode format similar to SMPTE. It deviates from SMPTE in several respects, otherwise the timecodes will collide with the current grid spacings (Note: this will be subject to review in future). 

* Hours will only be shown when they are needed. This shouldn't cause too many problems, since it is highly unlikely to get sequences, etc. that long.
* Frames are only shown when zoomed in close enough. When they are shown, display of minutes is generally ommitted unless significant. 
* I've used the semicolon (;) character as the delimeter between frames and seconds. This seems to be the convention in Final Cut Pro, Vegas, and Quicktime...

---

Also in this commit:
* added UI_view2d_status_enforce() call to the end of UI_view2d_totRect_set(), so that the caller will not have to worry about doing so.

* swapped the order of V2D_GRID_(NO)CLAMP defines so to be more consistent with older versions of Blender. Default (0) is now no-clamping.
2008-12-07 03:42:25 +00:00