Commit Graph

458 Commits

Author SHA1 Message Date
Damien Plisson
7795e71377 Cocoa : fix mouse cursor hang when RMB-dragging in a not frontmost window
With continuous grab on, in 2+ window setup, when RMB-dragging an object in a 3D view of a not active (not frontmost) window, mouse cursor was stuck, with no escape.
Cursor grab must be done by the window that is key (able to receive mouse move events).
2010-02-01 11:20:01 +00:00
Damien Plisson
0e6b88f993 Cocoa : implement opening .blend file by double-clicking on it in OSX Finder
When the user double-clicks on a document file in the Finder, OSX doesn't simply give the filename as a command-line argument when calling Blender, as it is done in other OSes.
Instead, it launches the app if needed, and then sends an "openFile" event.

The user can also open a document file by dropping its icon on the app dock icon. But as this is not real Drag'n'drop, I've renamed the Ghost event to a less confusing "GHOST_kEventOpenMainFile" name.

DND Ghost wiki page updated : http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DragnDrop
2010-02-01 09:11:18 +00:00
Damien Plisson
e4882e3da2 Cocoa : correctly handle late events sent after window deactivate
Cocoa can still send events (tagged with the correct NSWindow handle) after having sent the window deactivate event.
This caused these events being discarded as there was no active window for GHOST_WindowManager.

Fix is to use this NSWindow handle to retrieve the target window and correctly push the event.

E.g. of effects of this bug: OSKey modifier stuck after having invoked Spotlight through its shortcut (Cmd + Space). This gave the impression the Blender window has not got focus back for the keyboard.

Ton, can you confirm if this fixes the "Cocoa window loses focus permanently on using Spotlight" issue you found ?
2010-01-28 19:18:36 +00:00
Damien Plisson
47e8ea5004 Cocoa : fix 'Draw Overlap' method swap issues 2010-01-28 10:56:35 +00:00
Ton Roosendaal
b119ce5fcc Drag and drop 2.5 integration! Finally, slashdot regulars can use
Blender too now! :)

** Drag works as follows:

- drag-able items are defined by the standard interface ui toolkit
- each button can get this feature, via uiButSetDragXXX(but, ...).
  There are calls to define drag-able images, ID blocks, RNA paths, 
  file paths, and so on. By default you drag an icon, exceptionally 
  an ImBuf
- Drag items are registered centrally in the WM, it allows more drag 
  items simultaneous too, but not implemented

** Drop works as follows:

- On mouse release, and if drag items exist in the WM, it converts 
  the mouse event to an EVT_DROP type. This event then gets the full 
  drag info as customdata

- drop regions are defined with WM_dropbox_add(), similar to keymaps 
  you can make a "drop map" this way, which become 'drop map handlers' 
  in the queues.
- next to that the UI kit handles some common button types (like 
  accepting ID or names) to be catching a drop event too.

- Every "drop box" has two callbacks:
  - poll() = check if the event drag data is relevant for this box
  - copy() = fill in custom properties in the dropbox to initialize 
    an operator
- The dropbox handler then calls its standard Operator with its 
  dropbox properties.

** Currently implemented

Drag items:
- ID icons in browse buttons
- ID icons in context menu of properties region
- ID icons in outliner and rna viewer
- FileBrowser icons
- FileBrowser preview images

Drag-able icons are subtly visualized by making them brighter a bit 
on mouse-over. In case the icon is a button or UI element too (most 
cases), the drag-able feature will make the item react to 
mouse-release instead of mouse-press. 

Drop options:

- UI buttons: ID and text buttons (paste name)
- View3d: Object ID drop copies object
- View3d: Material ID drop assigns to object under cursor
- View3d: Image ID drop assigns to object UV texture under cursor
- Sequencer: Path drop will add either Image or Movie strip
- Image window: Path drop will open image


** Drag and drop Notes:

- Dropping into another Blender window (from same application) works 
too. I've added code that passes on mousemoves and clicks to other 
windows, without activating them though. This does make using multi-window
Blender a bit friendler.

- Dropping a file path to an image, is not the same as dropping an 
Image ID... keep this in mind. Sequencer for example wants paths to 
be dropped,  textures in 3d window wants an Image ID.

- Although drop boxes could be defined via Python, I suggest they're 
part of the UI and editor design (= how we want an editor to work), and 
not default offered configurable like keymaps. 

- At the moment only one item can be dragged at a time. This is for 
several reasons.... For one, Blender doesn't have a well defined 
uniform way to define "what is selected" (files, outliner items, etc). 
Secondly there's potential conflicts on what todo when you drop mixed 
drag sets on spots. All undefined stuff... nice for later.

- Example to bypass the above: a collection of images that form a strip, 
should be represented in filewindow as a single sequence anyway. 
This then will fit well and gets handled neatly by design.

- Another option to check is to allow multiple options per drop... it 
could show the operator as a sort of menu, allowing arrow or scrollwheel 
to choose. For time being I'd prefer to try to design a singular drop 
though, just offer only one drop action per data type on given spots.

- What does work already, but a tad slow, is to use a function that 
detects an object (type) under cursor, so a drag item's option can be 
further refined (like drop object on object = parent). (disabled)


** More notes

- Added saving for Region layouts (like split points for toolbar)

- Label buttons now handle mouse over

- File list: added full path entry for drop feature.

- Filesel bugfix: wm_operator_exec() got called there and fully handled, 
while WM event code tried same. Added new OPERATOR_HANDLED flag for this. 
Maybe python needs it too?

- Cocoa: added window move event, so multi-win setups work OK (didnt save).

- Interface_handlers.c: removed win->active

- Severe area copy bug: area handlers were not set to NULL

- Filesel bugfix: next/prev folder list was not copied on area copies

** Leftover todos

- Cocoa windows seem to hang on cases still... needs check
- Cocoa 'draw overlap' swap doesn't work
- Cocoa window loses focus permanently on using Spotlight
  (for these reasons, makefile building has Carbon as default atm)

- ListView templates in UI cannot become dragged yet, needs review... 
it consists of two overlapping UI elements, preventing handling icon clicks.

- There's already Ghost library code to handle dropping from OS 
into Blender window. I've noticed this code is unfinished for Macs, but 
seems to be complete for Windows. Needs test... currently, an external 
drop event will print in console when succesfully delivered to Blender's WM.
2010-01-26 18:18:21 +00:00
Campbell Barton
8c0dff6bc3 Continuous grab in X11 could give events to a different window if the mouse was moved very fast (before it warped) or if there was another blender window with the same process set to always on top.
call XGrabPointer with owner_events set to false so mouse events are given to the window that initiated the grab.
2010-01-21 18:32:34 +00:00
Campbell Barton
9396bb2da9 - AIX ifdef's so windows works, cant test but this seems the most used define. might need to add to buildsystem config.
- transform default scale was too hight, calls to random were inconsistant. (fault of own modif's)
- cmake openal include was added twice on recent commit.
2010-01-19 15:57:02 +00:00
Campbell Barton
530b8bba42 patch [#20612] Making Blender compile on AIX 4.3.3
from Philipp Gühring (sourcerer)
2010-01-19 10:57:59 +00:00
Benoit Bolsee
de59a6c943 Update MSVC project files 2010-01-17 19:19:33 +00:00
Andrea Weikert
870df309c5 MSVC 9 projectfiles
* update for animviz.c
* updated glew dependency for ghost.
2010-01-17 14:47:14 +00:00
Damien Plisson
672aede6a0 Cocoa : fix for modifiers keys handling upon application switching
- fix race condition between applicationBecomeActive, and WindowBecomeKey events that discarded the modifiers keys status change event message
- workaround for a 10.6 bug that made the Cmd (oskey) modifier erroneously on.
2010-01-14 16:01:05 +00:00
Campbell Barton
b0f87935a8 spelling errors, no real changes to code. 2010-01-14 10:59:42 +00:00
Nathan Letwory
e594a8739b Patch [#20588] Adding multisample support to Win32 Ghost - by Mitchell Stokes (Moguri)
Note: AA is still disabled due to AA creating problems for selection tools. If you must, set AA to 2 or 4 in wm_window.c where the GHOST window is created (line 317).
2010-01-13 19:02:13 +00:00
Damien Plisson
32f4877c8c Cocoa : properly distinguish mouse from multitouch trackpad scroll events
Mighty mouse trackball now fires proper wheel events (and not trackpad pan ones)
2010-01-13 17:43:42 +00:00
Damien Plisson
636b4a0663 Cocoa : activate multitouch trackpad features only on equipped macbooks 2010-01-12 14:12:44 +00:00
Damien Plisson
4a011a99cb Multitouch trackpad 2 fingers gestures implementation
- 2 fingers scroll (MOUSEPAN / GHOST_kTrackpadEventScroll event) pans/scrolls the view
- 2 fingers pinch (MOUSEZOOM / GHOST_kTrackpadEventMagnify event) zooms the view
And in 3D view:
- alt + 2 fingers scroll rotates the view
- 2 fingers rotation (MOUSEROTATE / GHOST_kTrackpadEventRotate) orbits the view.

The implementation uses a new GHOST event type: GHOST_kEventTrackpad, that is then dispatched as Blender MOUSEPAN, MOUSEZOOM
or MOUSEROTATE events.

This is currently fully implemented for OSX (GHOST Cocoa fires the new events), with auto-detection of the source peripheral, so that a regular mouse still sends MOUSEWHEEL events.
2010-01-11 11:14:36 +00:00
Guillermo S. Romero
5074a4c307 Request different OpenGL oversampling levels before giving up. 2010-01-10 22:52:40 +00:00
Campbell Barton
6b4a8c5d72 attemp to fix [#20610] GHOST_WindowX11.cpp:202: X11 glXChooseVisual() failed, verify working openGL system!
cant test but should work.
2010-01-10 19:21:46 +00:00
Brecht Van Lommel
b504a48854 FSAA: was not disabled on X11 correctly. 2010-01-08 17:41:04 +00:00
Guillermo S. Romero
840ae92052 Do not ask for AA if not supported. 2010-01-07 23:23:00 +00:00
Campbell Barton
73b52e2430 Viewport AA for X11 2010-01-07 21:58:28 +00:00
Damien Plisson
a994a52497 Disable OpenGL anti-aliasing by default for now. 2010-01-06 15:34:49 +00:00
Damien Plisson
75f190bde8 OpenGL Anti-aliasing implementation for blender windows
Added GHOST_TUns16 numOfAASamples parameter to GHOST_CreateWindow to specify the number of AA samples (null if no AA wanted)
Implemented it in the cascade of GHOST classes.

Full implementation currently done for OSX/Cocoa, stubs for other OSes.
Moguri : it's ready for your win32 implementation !

Note that fallback to a non AA window (if gfx card doesn't support AA) is done inside GHOST OS specific layer, so that blender windowmanager still gets its window created properly.
2010-01-06 11:42:52 +00:00
Damien Plisson
ef8273428c Cocoa: small potential issue remained from fullscreen ancient ages in the Window getValid function 2010-01-06 09:22:40 +00:00
Brecht Van Lommel
50de143ca3 Fix #20558: open file with new window setup corrupts text and icons in the UI.
On X11, the opengl context was destroyed when closing a window. This lead to
the text and icon textures being lost (among other things), now the opengl
context is kept like on Win/Mac.
2010-01-04 16:26:03 +00:00
Stefan Gartner
1f33d574c2 OS X Makefiles:
* added some new variables (mostly the same as with scons):
  - USE_COCOA: use Cocoa for ghost (defaults to true)
  - MACOSX_ARCHITECTURE: can be ppc, ppc64, i386, x86_64. By default this is the host architecture
    (ppc for PowerPC Macs, i386 for Intel Macs). In theory this allows to cross compile blender for
    a different architecture, though cross compilation only works on Intel Macs, because makesdna
    and makesrna are built for the target architecture.
    For a 64 bit build, set MACOSX_ARCHITECTURE to x86_64 (Intel) or ppc64 (PowerPC).
  - MACOSX_MIN_VERS: minimum OS X version to run blender on (10.4 for 32 bit builds, 10.5 for 64 bit    builds)
  - MACOSX_DEPLOYMENT_TARGET: needed by the linker to create an Application targeted for a specific
    OS version (defaults to 10.4 for 32 bit builds, 10.5 for 64 bit builds)
  - MACOSX_SDK: path to a specific SDK. currently not used 
  - USE_QTKIT: use QTKit instead of QuickTime (defaults to true for 64 bit builds, as using QTKit
    is mandatory in that case))
 * use the same compiler flags as scons
 * default compiler now is gcc-4.0 when building for 10.4 and gcc-4.2 when building for 10.5
 * extract $(LCGDIR)/release/python_$(MACOSX_ARCHITECTURE).zip to Application bundle. This might
   break building on 10.4, to fix that, rename $(LCGDIR)/release/python.zip 

When compiling blender, only MACOSX_ARCHITECTURE might be of interest, as it allows doing 64 bit
builds (or 32 bit PowerPC builds on Intel). All other variables are then set to reasonable defaults.
For current users of the Makefile system, this commit shouldn't change much.
2010-01-03 20:35:13 +00:00
Damien Plisson
4ab4d2dd20 Fix some build warnings 2010-01-01 15:48:14 +00:00
Stefan Gartner
5e6e3453a5 OS X: added support for building with Cocoa to Makefiles
to build with Cocoa support, set WITH_COCOA to true in user-def.mk
2009-12-21 10:38:04 +00:00
Damien Plisson
c836b0ae18 Cocoa : add confirmation request before opening a .blend file (dropped on Blender icon or dbl-clicked in Finder) 2009-12-18 13:13:14 +00:00
Damien Plisson
f09d2e6bc1 Cocoa : fix Dropped on application event was not sent 2009-12-18 09:50:14 +00:00
Damien Plisson
b6bf852670 Reenable disabled window switching shortcuts in 10.4 builds 2009-12-12 08:45:16 +00:00
Martin Poirier
bca53f0906 [#20266] Blender starting without X11 segfaults
Abort when ghost x11 cannot initialize a display.

It would just crash later anyway, better to abort with a reasonable error message.
2009-12-05 20:06:19 +00:00
Benoit Bolsee
6bfb3cf6ef Update MSVC9 project files 2009-12-04 10:37:24 +00:00
Damien Plisson
3b1c6d6065 Quicktime Carbon: Fix memory leak when build with cocoa 2009-12-03 12:16:00 +00:00
Damien Plisson
863668a145 Cocoa: suppress unwanted beep when pressing Cmd + key on 10.4 2009-12-02 15:02:29 +00:00
Damien Plisson
dd90ffd47b Cocoa: remove errors for all supported SDK/CPU configs 2009-12-02 13:05:31 +00:00
Damien Plisson
39f42df424 CMake: remove new GHOST_DropTargetWin32.cpp file from non-win32 platforms builds 2009-12-02 10:21:10 +00:00
Damien Plisson
0efaf10b7a Cocoa: fix delaying issue for events that were fired outside the processEvents function
An example of a visible issue was a delayed wm resize when switching to/from fullscreen mode
2009-12-02 10:10:20 +00:00
Guillermo S. Romero
4913f415cc SVN maintenance. 2009-12-02 01:23:29 +00:00
Nathan Letwory
372bfeb0c5 * make sure we don't choke on what we don't have :° 2009-12-02 01:12:22 +00:00
Nathan Letwory
8847615116 * make sure drop target files are filtered too. 2009-12-02 01:05:37 +00:00
Nathan Letwory
5a3791ab5b Apply patch [#20145] Ghost Win32 roundup patch: Minimum Window Size, Continuous Grab and Drag And Drop
This nice patch by Matt D. (matd in #blendercoders) adds three nice features that can be seen already in the other supported OSes:

* minimum window size: to prevent some bugs with the window manager of Blender, system windows cannot be resized smaller than the minimum size.

* Continuous Grab is finally in Windows! Default settings since alpha 0 already have the feature enabled by default, so grab a new build and enjoy :)

* GHOST support for drag and drop added. This prepares Blender for drag and drop from OS -> Blender. Currently not very useful, since wm needs to be readied for that. But it does work (do BF_GHOST_DEBUG=1 build and drag a file onto a Blender window).

Thanks Matt D.!
2009-12-02 00:57:12 +00:00
Damien Plisson
d7877d360a Cocoa: proper implementation of the modifiers key wrong value when application becomes active again
Note: this works fine when running under 10.6, even if compiled with an older sdk
Under 10.4/10.5, workaround remains to assume no modifier key is pressed when the user restores the focus to the application
2009-12-01 15:46:37 +00:00
Damien Plisson
eb24e788b8 Cocoa: implement Cmd+W to close window, workaround for wrong modifiers key status upon focus retrieval
The carbon GetModifierFlag function (to get the current modifier keys status) is reimplemented in cocoa only from 10.6.
So we need to use a workaround to get the correct modifiers when blender application gets focus back. Current one is to assume no modifiers.
This at least fixes the issue when blender has been hidden using Cmd+H. The Cmd modifier was still seen as ON until the user pressed again on it.
2009-12-01 10:23:27 +00:00
Martin Poirier
eee8bf344a Cursor Grab bugfix: passing NULL for bounds didn't initialize properly.
Symptom: first button drag gets stuck on values.

Cause: Buttons didn't set grab bounds, to use the whole window. But Ghost didn't do anything in that case, it left the bounds value as is. It only affected the first cursor grab, because cursor ungrab sets it to -1, which forces it to use the whole window size (checking every mouse move) for subsequent grabs.

Solution: When NULL, init bounds to window size (and don't query every mouse move).
2009-11-26 02:58:53 +00:00
Martin Poirier
1aebd524a2 Fix for continuous grab on X11.
Need to stop accumulating warp coordinates after the first cursor warp (store time of new generated event and skip warp for events time smaller).

There's some interesting X11 code in there, if people are curious.
2009-11-24 19:47:57 +00:00
Damien Plisson
78ce1fb6ca compile fix when compiling with WAIT_FOR_VSYNC = 1 (btw, is this still used ?) 2009-11-24 10:19:07 +00:00
Damien Plisson
169b0cbee9 Drag'n'drop : moved "setAcceptDragOperation" functions at window level
GHOST/Cocoa : changed strings encoding to isoLatin1 (was UTF-8)
2009-11-19 08:56:26 +00:00
Damien Plisson
45e38635a4 Drag'n'drop : add freeing of dropped resources upon event object release 2009-11-17 08:27:11 +00:00
Damien Plisson
698086dfb1 MAC/Cocoa:
- Drag'n'Drop events are now correctly signaled to the main loop for dispatch (these events were directly handled in cocoa callbacks without notifying the process loop)
- Fix timestamping of events & add debug print of drag'n'drop events.
2009-11-15 08:34:31 +00:00
Damien Plisson
aac16ce4ec - scons fix for 10.4 build (use the 10.4 libs dir)
- warning fix in ghost/cocoa
2009-11-14 13:01:14 +00:00
Benoit Bolsee
2646558079 Update MSVC project files 2009-11-13 13:06:26 +00:00
Guillermo S. Romero
320fb05ebc SVN maintenance. 2009-11-10 19:22:10 +00:00
Damien Plisson
af2e6c38e9 Drag & drop implementation at GHOST level (only OSX for now)
The dragging sequence is performed in four phases:
 
- Start sequence (GHOST_kEventDraggingEntered) that tells a drag'n'drop operation has started. Already gives the object data type, and the entering mouse location

- Update mouse position (GHOST_kEventDraggingUpdated) sent upon each mouse move until the drag'n'drop operation stops, to give the updated mouse position.
Useful to highlight a potential destination, and update the status (through GHOST_setAcceptDragOperation) telling if the object can be dropped at the current cursor position.

- Abort drag'n'drop sequence (GHOST_kEventDraggingExited) sent when the user moved the mouse outside the window.

- Send the dropped data (GHOST_kEventDraggingDropDone)

- Outside of the normal sequence, dropped data can be sent (GHOST_kEventDraggingDropOnIcon). This can happen when the user drops an object on the application icon. (Also used in OSX to pass the filename of the document the user doubled-clicked in the finder)

Note that the event handler is responsible for freeing the received data.
And the mouse position is sent directly in blender client coordinates (y=0 at bottom)

The GHOST_setAcceptDragOperation(TRUE) call must be placed before the user drops the object for it to be accepted.

Current handled data types :
- Text string
- Array of filenames (full paths)
- Bitmap image (not implemented yet)
2009-11-10 12:56:46 +00:00
Damien Plisson
9c0cdd2501 - fix Cocoa window setOrder function to maintain focus on a blender window (e.g. ensure the blender window gets the focus when the user presses ESC to move back the render window)
- QuickTime export fixes.
Note that QuickTime export still crashes because it tries to open a "codec settings" dialog from the rendering background thread (and not the main/UI thread).
One quick fix may be to move the movie export initialization out of the render thread back into the operator function.
But a cleaner way would be to get rid of such a carbon/win32 dialog and place the codec settings inside blender interface
(additional fields in the output panel as it is currently the case for other file formats ?).
2009-11-09 17:06:48 +00:00
Damien Plisson
fe82c2674e Mac / Cocoa:
- Fix update event fired at each loop iteration. Thx Brecht for the patch
- Fix missing deactivate event when in fullscreen mode
2009-11-04 17:50:31 +00:00
Matt Ebb
8a57ff7afa Slightly nicer OS X quit message 2009-11-03 07:24:22 +00:00
Campbell Barton
6bfcd5a811 how embarrassing! 2009-11-02 17:25:15 +00:00
Damien Plisson
93173a6dd4 Mac / COCOA :
- fix 10.4 compile issues

- fix some scons issues & add WITH_BF_COLLADA = False in scons darwin_config.py to allow build waiting for complete Collada Mac implementation
2009-10-30 20:20:48 +00:00
Damien Plisson
b1a832a7e2 Mac / COCOA : Imbuf
- replace libtiff by calls to Cocoa services to load/save tiff files
(Libtiff, dynamically linked is not distributed with OS X, and would have had to be shipped for all four architectures)

The imb_cocoaLoadImage & imb_cocoaSaveImage are generic towards the bitmap format, and thus can handle TIFF, GIF, JPG, JP2000, BMP and raw camera formats (read-only for these), even if today only TIFF is used as the other formats are already handled.

- CMake updated
- scons updated (Thx to Jens Verwiebe)
2009-10-29 18:06:49 +00:00
Martin Poirier
63e3cfb82f ifix syntax error in SConscript 2009-10-27 14:17:29 +00:00
Nathan Letwory
abf7bebac5 and another bump! Gotta love indentation °_° 2009-10-27 14:15:40 +00:00
Nathan Letwory
8a7a70f55c bumping commit count. 2009-10-27 14:14:40 +00:00
Nathan Letwory
a9610d45b6 r24111 broke the build on non-osx systems. 2009-10-27 14:11:28 +00:00
Damien Plisson
b8a7f844ca Mac:
Fixed gcc-4.0 compile error (cocoa)

Updated scons to build cocoa (32bit & 64bit) (Thx Jens Verwiebe for the patch):
- make sure right python is unzipped to app-bundle ( printing information at the end of compiling )
- make sure arch-setting appends needed flags ( depending on OSX-version obsolete sometimes but harmless )
- link correct frameworks depending on gfx-api ( cocoa/carbon)
- conscript prepared for cocoa objC-files
- link to openAL-framework, using the headers from blender-lib + the symbols in framework

Usage instruction:
The default build is Cocoa 32bit.
To change it, copy config/darwin-config.py to user-config.py in the blender folder, and edit:
- WITH_GHOST_COCOA & MACOSX_ARCHITECTURE variables to select cocoa/carbon, and the arch (i386, X86_64, ppc, ..)
- the libs options as usual
2009-10-27 13:40:41 +00:00
Damien Plisson
2b1705afff Cocoa/Mac:
- fix bad window context initialization bug introduced in rev # 24081
2009-10-26 18:00:06 +00:00
Damien Plisson
21757e1161 Cocoa / Mac:
- use Cocoa function to convert keys character value to isoLatin-1 encoding instead of the translation table. Works better with international keyboards

- enable stereo GL option

- fix source/creator CMake file to remove unneeded folders in the app bundle (the __MACOSX stuff). (Thx jensverwiebe)
2009-10-26 08:43:24 +00:00
Damien Plisson
068ab484ac Cocoa / Mac:
- tablet : fix pressure retrieval => value sliding now works with tablet, UV-painting is pressure sensitive, and no more crash when clicking on window minimize button with the tablet

- update CMake file to remove unneeded folders in the app bundle (the __MACOSX stuff). From Jens' patch
2009-10-23 12:12:44 +00:00
Damien Plisson
eab11543f3 Cocoa / Mac:
- fix set mouse cursor position in case of multi-display setting. Enables continuous grab to work when blender window is on a secondary display
2009-10-21 15:39:32 +00:00
Campbell Barton
f4d6bbd656 - improvements from Mathias Panzenböck (panzi) patch [#19695], which avoid conversion to/from strings with context property assignment. though didnt apply entire patch.
- [#19698] Add Menu Item: View3d -> Object -> Move to layer
  from Howard Brooks (hbroo)
- had cursor grab commented by mistake for X11
2009-10-21 07:56:08 +00:00
Guillermo S. Romero
1224835188 Size and position are normally requested by program, not user. 2009-10-20 21:58:19 +00:00
Damien Plisson
5571d37e94 Cocoa:
- fix windowDidResize event not forwarded in some cases on 10.6
- fix crash on repeated Cmd-Q + Cancel quit actions
- place stub for .blend drop on blender app icon
2009-10-20 15:23:04 +00:00
Brecht Van Lommel
cb8f7fd385 Auto Save
Auto save is now working again in 2.5. It will also remember now what
the location of the original file was when recovering it, so that
library links still work and saving the restored file does not save to
the temp directory. There is also a new Recover Auto Save operator
which will open the filebrowser in the temp directory and show the
auto saved .blends.

Implemenation Notes:

* Timer storage was moved from window to windowmanager, so we can have
  windowmanager level timers too now, doesn't make sense to have
  autosave timer attached to a particular window.
* FileGlobal now has a filename field storing where the file was saved.
  Note that this is only used when loading a file through the recover
  operators, regular file read doesn't use it, so copying the quit.blend
  manually over the original file will still work as expected.
* Jobs timer no longer uses operator now, this seems more like an
  internal thing, changing keymaps should not make it possible to break
  the jobs manager.
* Autosave is postponed by 10 seconds when a modal operator is running,
  e.g. transform or file browsing.
* Moved setting G.sce in setup_app_data before depsgraph updates, these
  can use the filename for pointcaches.
2009-10-20 13:58:53 +00:00
Damien Plisson
1f9d8826db Cocoa:
- fix 10.6 API used in window resizing callback causing crash on 10.5 systems (Thx Jasper Mine for the bug report)
- implemented min window size enforcement to prevent tiny windows messing up blender's internal ui layout (same as done by Campbell on X11, is a partial fix of bug #19550)
- added (commented) code for enabling multithreaded opengl (this optimization is here for experimental tests, not for mainstream, so bleeding edge testers would want to uncomment the three "Multithreaded opengl code : uncomment for enabling" sections)
2009-10-20 08:13:12 +00:00
Campbell Barton
cae71123e5 set the min size hints for x11 to prevent tiny windows messing up blenders internal ui layout 2009-10-20 07:51:42 +00:00
Damien Plisson
b18eeed225 Cocoa :
- fix#19592 : implemented updated continuous grab feature (fixing compilation issues)
- fix some 10.6 & 64bit warnings
2009-10-19 10:49:45 +00:00
Campbell Barton
9b26e7d7ca minor changes to x11 cursor grab wrapping
- when wrapping 2 mouse events were added.
- on release blender still had the last event (possibly outside the screen), where menus would fail to show. Add a mouse event by calling XWarpPointer with no movement when leaving grab.
2009-10-18 09:55:39 +00:00
Campbell Barton
69c6a33ba1 wrap the mouse within the region while grabbing so on release the current view never changes and less likelyhood of loosing the cursor when running blender on 2+ screens. (assuming the 3d view isnt stretched over both) 2009-10-17 19:32:28 +00:00
Campbell Barton
d11888b470 - wrapping failed with the cursor at the screen edge,
- changed numbuts behavior with continuous grab so dragging back after passing the button limit immediately adjusts the value
2009-10-17 14:54:13 +00:00
Campbell Barton
91d89c1ff7 Adjustments to continuous grab
- Use an enum for grab modes rather then boolean options.
 -- GHOST_kGrabNormal: continuous grab userpref disabled
 -- GHOST_kGrabWrap: wrap the mouse at the screen bounds *
 -- GHOST_kGrabHide: hide the mouse while grabbing and restore the mouse where it was initially pressed *

GrabWrap is nice for transform and tools where you want some idea where the cursor is, previously I found both restoring the mouse at its original location and restoring at a clamped location was confusing with operators like transform, wrapping is not ideal but IMHO the best of a bad bunch of options.
GrabHide  is for numbuts, where restoring the mouse at the initial location isnt so confusing.
2009-10-17 14:08:01 +00:00
Damien Plisson
ee6dd8ec38 Cocoa :
- implemented custom cursor handling
2009-10-15 20:09:50 +00:00
Damien Plisson
3b2d752933 Cocoa :
- Small changes to make ghost_cocoa compatible with 10.4 + gcc4.0 (the initial goal was to be 10.5+ compatible, but 10.4 is finally also possible)

- Main window title is now in Apple document window title style (proxy icon + filename)

- fix for top menu "Blender" sub-menu not anchored correctly in 10.5
2009-10-15 08:27:31 +00:00
Damien Plisson
107447b79e Cocoa : bugfix #19591
Add trackpad 2 fingers gesture handling, to have it mimicking correctly mouse wheel, and thus zoom in/out correctly in the 3D view
2009-10-14 09:46:41 +00:00
Damien Plisson
6f2146e848 Cocoa : bugfix on continuous grab (cursor was returning to a wrong position upon button grab end) 2009-10-14 08:24:40 +00:00
Damien Plisson
9c7fe13a57 Cocoa : fix secondary window display bug issue 2009-10-12 16:51:36 +00:00
Damien Plisson
b4a113669d Cocoa : Fullscreen mode improvement (Bugfix# 16682)
Instead of capturing the display and all user input (video game mode), the mechanism is now to hide dock & menu bar, and enlarge the window made borderless to cover the whole screen surface.

Thus all OS X window management features remains available (other windows,multi screens compatible, process switching, expose, spaces, ..)
2009-10-12 09:53:28 +00:00
Damien Plisson
1234f4709b Cocoa : Bug fix for continuous grab feature implementation 2009-10-09 17:42:31 +00:00
Damien Plisson
8f57b368ca Cocoa :
Implement OS X support for Campbell's new continuous grab feature
2009-10-09 14:42:36 +00:00
Damien Plisson
ca3e778134 Cocoa port :
- Fullscreen mode is back!
- Cleaner fix for tablet events handling
2009-10-09 12:48:28 +00:00
Damien Plisson
d01c737283 Cocoa port :
Quick&dirty bug fix to catch ad discard tablet induced exceptions.

I'll make a clean fix upon getting a tablet to debug.
2009-10-08 17:13:57 +00:00
Damien Plisson
88613b9184 Cocoa port :
Bug fix : newly created window not seen as activated by WM

Added more conservative memory management (may need to optimize later)
2009-10-08 15:28:31 +00:00
Campbell Barton
0c857a4f14 - made ungrab a second function - WM_cursor_ungrab
- ungrab can restore the position of the mouse clamped to the window bounds (much nicer for transform)
2009-10-07 21:19:35 +00:00
Campbell Barton
77476b294f Experimental option to allow moving the mouse outside the view, "Continuous Grab" in the user-prefs.
- Useful for dragging buttons to the far right when theyd otherwise hit the screen edge.
- Useful for transform though probably NOT what you want when using the transform manipulator (should make an option).
- When enabled, number buttons use this as well as a different conversion of mouse movement
  float numbuts: mouse 1px == 1-clickstep
  int numbuts: 2px == 1 (tried 1:1 but its too jitter prone)

details...
- access as an option to GHOST_SetCursorGrab(grab, warp)
- Currently all operators that grab use this, could be made an operator flag
- only Ghost/X11 supported currently
2009-10-07 07:11:10 +00:00
Damien Plisson
07aba4f933 Cocoa port : First pure Cocoa version !
(Mostly for very early testers)

Cocoa uses coordinates with y=0 at bottom : updated wm_window.c and wm_event_system.c for COCOA build to avoid double conversions in response to mouse move events and GHOST_getCursorPosition

Known limitations:
No fullscreen support
Font issue in preference panel
libSDL uses some Carbon functions
2009-10-06 16:56:22 +00:00
Damien Plisson
77b8be6e13 Cocoa port : Fix bugs in clipboard operations 2009-10-05 15:00:07 +00:00
Damien Plisson
a344977147 Cocoa port :
- Window creation at preferred size
  Implement in Ghost the use of Cocoa functions to get the maximum visible rect (size and position) for the window contents (all screen excluding dock, top menu, and window title bar)
  Thus Apple specific code in window creation (wm_window.c & wm_apple.c) is no more needed => removed in case of Cocoa build

- Alert on exiting despite unsaved changes
  Add to GHOST method to maintain an all platforms (not apple specific anymore) status on unsaved changes
  Update GHOST_SystemCocoa to use this for asking or not user to confirm exit without saving changes
2009-10-05 12:55:16 +00:00
Damien Plisson
14c1dd941c Cocoa port : added standard menu in OSX menu bar 2009-10-03 18:25:54 +00:00
Damien Plisson
aa2cd95c1b Cocoa port : first Cocoa version of GHOST_DisplayManagerCocoa 2009-10-02 07:20:33 +00:00
Damien Plisson
3f3c2d0204 Cocoa port, events WIP:
- Fix keyboard keymap
- NSAutoReleasePool now drained at every cycle
- Tablet events combined with mouse events now handled
2009-10-01 08:58:09 +00:00
Guillermo S. Romero
727745bd49 SVN maintenance. 2009-09-30 17:13:57 +00:00
Damien Plisson
570c187ba1 Cocoa port start:
GHOST*Cocoa.mm & .h files creation
First Cocoa version of GHOST_SystemCocoa.mm
CMake files update to allow optional (WITH_COCOA option) Cocoa version build - disabled by default
SCons files are not updated to allow Cocoa build (the ghost .mm files)
2009-09-30 08:47:39 +00:00
Benoit Bolsee
1483fafd13 Merge of itasc branch. Project files, scons and cmake should be working. Makefile updated but not tested. Comes with Eigen2 2.0.6 C++ matrix library. 2009-09-24 21:22:24 +00:00
Campbell Barton
ad7fab49d4 5 button mouse support from b333rt in IRC with some edits for X11.
Tested in X11 where its fairly confusing.
buttons 4 and 5 are used for the wheel which is well known, but it seems 6 and 7 are used for horizontal scrolling, my mouse assigns the extra 2 buttons to events 8 & 9.

So the X11 events used for buttons called 4&5 in blender are 8&9 in X11.

The mouse buttons can be re-ordered like this once xorg starts (swaps 6,7 with 8,9)
  xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7"

Couldn't test Win32, Apple not supported.
If someone wants to add horizontal scrolling its quite easy.
2009-09-21 05:56:43 +00:00
Campbell Barton
fd6654d4ef remove brush_sample_falloff, #if 0, unused function is_tablet_cursor 2009-09-18 03:41:37 +00:00
Campbell Barton
a393a9c6f0 same as r23322 in 2.4x
--- 2.4x log
use functions to detect stylus and eraser from the wine project, supposed to work with non-wacom tablets too (searches for wizardpen & acecad as well as 'stylus').
2.4x did an exact check on the name, 2.5 does a case insensitive search on the type.

This does a case insensitive check on both the name and type.

close the devices on exit too.
2009-09-18 02:38:38 +00:00
Matt Ebb
4a15b40c37 * fix compilation on osx 2009-09-16 22:27:27 +00:00
Thomas Dinges
6b5ba70059 2.5 Ghost Compile Fix for windows. Patch by b333rt. Thanks! 2009-09-16 17:13:03 +00:00
Campbell Barton
7c5695c801 - bpy.data.sounds was a collection of ID's rather then Sounds
- last commit, missed include for rna_object_api.c & bad args to find_basis_mball
- use enum for GHOST tablet type None/Stylus/Eraser, had duplicate definition for these in C. Only tested X11, may need to cast to an int for other OS's.
2009-09-16 15:55:00 +00:00
Guillermo S. Romero
1b2344a1f1 Also set utf8 encoded hint for window title. 2009-09-14 20:17:56 +00:00
Campbell Barton
0a3694cd6e white space commit. (2 spaces -> tab).
Was annoying to use a different editor for cmake only.
theeth says this should be ok with gsoc and merges from branches.
2009-09-06 01:51:23 +00:00
Nathan Letwory
9216efcba2 == SCons ==
* bring back 'player' libtype, after investigation with ideasman.
  scons/mingw works nicely, for some reason msvc fails to link still, will look further into it.
2009-09-05 01:58:02 +00:00
Benoit Bolsee
6dbadb23ce update MSVC project files. 2009-08-20 09:18:55 +00:00
Nicholas Bishop
912c48442c 2.5/Ghost:
* Hopefully fixed X tablet support. The name string was not a reliable way of finding tablet anymore, so now we get the type string and search it for 'stylus' and 'eraser'. Still not very robust, but without UI I don't see how to do better.
2009-08-17 19:54:29 +00:00
Campbell Barton
c32fce0705 some fixes for netbsd with cmake
- CMake, use FIND_PACKAGE(Freetype) for unix/linux
- Only link with libdl.so on linux
- use statvfs rather then statfs for netbsd (size of statfs wasnt available)
- add x11 include path with ghost, glu.
2009-08-14 13:13:36 +00:00
Benoit Bolsee
e49ad2e148 Fix a bug in Ghost causing crash on Blender exit. 2009-08-11 11:44:45 +00:00
Campbell Barton
8aa3383408 fix for ghost memory leaks
- ghost data wasn't being freed (added wm_ghost_exit() call to wm_init_exit.c)
- GHOST_EventManager wasn't freeing GHOST_IEventConsumer's
- ghost/X11 wasnt calling XCloseDisplay(), some junk from X11 wasnt being freed
- ghost/X11 XAllocNamedColor wasn't freeing the colors when done making a custom cursor.
2009-08-05 02:40:51 +00:00
Campbell Barton
de36dd1e99 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22099:22130 2009-08-02 03:59:00 +00:00
Campbell Barton
f45dcf022d - X11 tablet was using uninitialized variables.
- Added BLENDER_FORCE_SWAPBUFFERS in help message.
2009-08-02 03:41:42 +00:00
Campbell Barton
41a0bfaf7c sizeof() was being used incorrectly to clear X11 m_keyboard_vector, would only have 4-8 bytes cleared rather then 32.
fix for harmless memleak too.
2009-08-01 09:07:45 +00:00
Diego Borghetti
00e92c4d8c Fix crash on Linux with some WM.
This is fixed on trunk but was remove in some merge (give conflict).
2009-07-28 19:14:25 +00:00
Daniel Genrich
dff9dce1cd Windows: fixing user preference window opening full screen 2009-07-25 20:16:56 +00:00
Brecht Van Lommel
a2a04bab8a 2.5: fix for last commit, left in debug print. 2009-07-09 18:10:35 +00:00
Brecht Van Lommel
b00409e72d 2.5: X11
* Pass on mouse location on window leave/enter too, fixing some
  issues with button highlights and tooltips.
* When a modal operator runs, grab the mouse cursor so that for
  example transform still works when you move your mouse outside
  of the window, previously it would just stop then. This is
  automatic now for all modal ops, perhaps not always needed?
* Fix for a trailing button highlight issue.
2009-07-09 16:05:01 +00:00
Brecht Van Lommel
c8b4cf9206 2.50:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19820:HEAD

Notes:
* Game and sequencer RNA, and sequencer header are now out of date
  a bit after changes in trunk.
* I didn't know how to port these bugfixes, most likely they are
  not needed anymore.
  * Fix "duplicate strip" always increase the user count for ipo.
  * IPO pinning on sequencer strips was lost during Undo.
2009-06-08 20:08:19 +00:00
Daniel Genrich
ab0ccbeef9 Win GUI fix: maximize works again without distorted regions 2009-06-08 11:55:16 +00:00
Daniel Genrich
82501bbec5 Win GUI fix: Blender won't hide behind the taskbar anymore on startup (in non maximized mode). Until now, the bottom of Blender always got hidden behind the taskbar - verified to fix at least Win7 + XP
- Windows devs (elubie, jesterKing): please check this fix.
2009-06-07 23:36:34 +00:00
Thomas Dinges
2a055ca728 2.5:
* Added new modifier tab.
* Fixed problems when no object was selected after delete.

* Added initial Armature, Bone, Curve and Font panels, by William Reynish (Billrey). Thanks!
* Small RNA changes

* Commit revision 20240 and 20268 from trunk. ("Mouse wheel zoom lost after rendering.")
2009-05-19 15:38:36 +00:00
Dalai Felinto
379f02f6e6 CMake + MSVC debug build fix
Initializing lResult = 0;
and removing NOP (if(!lResult) lResult = 0;

That was discussed with Genscher and Benoit in IRC.
2009-05-18 21:05:21 +00:00
Diego Borghetti
96348bc772 Commit revision 20062 and 20109 from trunk, also fix a small memory
error on interface, was try to free an incorrect pointer.
2009-05-18 19:47:04 +00:00
Thomas Dinges
65796e2c07 Patch #18758 for bug #17423 by Matt D. (foom) Thanks!
"Mouse wheel zoom lost after rendering."
2009-05-17 15:09:03 +00:00
Benoit Bolsee
b22605c4df BGE #18691: Blenderplayer fullscreen messes up desktop on OS X Leopard. Applied patch #18705 by sbn. I cannot compile osx but the patch seems perfectly alright to me. Can OSX users confirm that it compiles well on the various OSX version? 2009-05-13 06:53:21 +00:00
Diego Borghetti
cf8a37a3bb Fix Copy & Paste not working inside Blender.
My last patch remove the code that check if Blender is the owner
of the selection, that is why stop working.
2009-05-08 19:37:14 +00:00
Diego Borghetti
405cf80eb8 Big, big commit!!
1) Remove WITH_FREETYPE2 from code, so now blender always need freetype2
2) Remove the old bmfont
3) Remove ftfont and bFTGL library
4) Implement a new BLF_draw_default function for place that still need/use
   the old BMF api.

I try to update both, scons and cmake, but I only can test with make, so
hope all work fine.

MSVC is broken, but I don't have Windows, things to search and fix are
any reference to WITH_FREETYPE2, FTGL and BMFONT (take in care that
blenkernel also have a BKE_bmfont.h, this don't have anything to do with bmfont).
        Always have to link/include the freetype2 library
        Remove any reference to libbmfont
        Remove any reference to libftfont
        Remove any reference to libbftgl (or libbFTGL)
2009-05-05 23:10:32 +00:00
Diego Borghetti
4ecff51bfe BugFix [#18597] Blender's text editor cant paste from SciTE in linux
Commit patch [#18597] Blender's text editor cant paste from SciTE in linux
Submitted by Campbell.

I made some changes to cleanup a little the code, atoms are now in the
System class. The getClipboard_xcout try to convert/request:
	1) Request for UTF8, if fail
	2) Request for COMPOUND_TEXT, if fail
	3) Request for TEXT, if fail
	4) Request for STRING

Test here with SciTE Version 1.77, firefox, xterm and text editor working
with both library's gtk/qt and all work fine.
2009-05-04 18:46:34 +00:00
Diego Borghetti
0999cf406a Fix crash because XSetInputFocus fail.
Some WM send a WM_TAKE_FOCUS event before the window is really mapped
(for example, change from virtual desktop), because of this, the call
to XSetInputFocus fail and close Blender.
2009-05-04 15:31:28 +00:00
Brecht Van Lommel
874c29cea8 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
2009-04-20 15:06:46 +00:00
Guillermo S. Romero
441f26a170 Clean up for the imminent migration from SVN to GIT. 2009-03-31 22:34:34 +00:00
Chris Want
77e0199dc3 Makefile updates for Blender 2.5 (from GSR) 2009-03-19 01:50:45 +00:00
Brecht Van Lommel
d52400bfbd 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r18677:19317
Notes:
* Sequence transform strip uses G.scene global, this is commented
  out now, should be fixed.
* Etch-a-ton code was most difficult to merge. The files already in
  2.5 got merged, but no new files were added. Calls to these files
  are commented out with "XXX etch-a-ton". editarmature.c and
  transform_snap.c were complex to merge. Martin, please check?
* Game engine compiles and links again here for scons/make/cmake
  (player still fails to link).
2009-03-17 21:44:58 +00:00
Ton Roosendaal
a1a91f9c8b 2.5
Makes Ghost compile for Make. Apparently the 'debug' directories are
still in use?
2009-03-12 09:15:49 +00:00
Brecht Van Lommel
4902b6e8e0 2.5: fix for compiling Carbon clipboard code, forgot to update this line. 2009-03-02 14:34:33 +00:00
Brecht Van Lommel
6cc89b9d4e 2.5: Text Editor back.
There was very little structure in this code, using many globals
and duplicated code. Now it should be better structured. Most
things should work, the main parts that are not back yet are the
python plugins and markers. Notes:

* Blenfont is used for drawing the text, nicely anti-aliased.
* A monospace truetype font was added, since that is needed for
  the text editor. It's Bitstream Vera Sans Mono. This is the
  default gnome terminal font, but it doesn't fit entirely well
  with the other font I think, can be changed easily of course.

* Clipboard copy/cut/paste now always uses the system clipboard,
  the code for the own cut buffer was removed.
* The interface buttons should support copy/cut/paste again now
  as well.
* WM_clipboard_text_get/WM_clipboard_text_set were added to the
  windowmanager code.

* Find panel is now a kind of second header, instead of a panel.
  This needs especially a way to start editing the text field
  immediately on open still.

* Operators are independent of the actual space when possible,
  was a bit of puzzling but got it solved nice with notifiers,
  and some lazy init for syntax highlight in the drawing code.
* RNA was created for the text editor space and used for buttons.

* Operators:
    * New, Open, Reload, Save, Save As, Make Internal
    * Run Script, Refresh Pyconstraints
    * Copy, Cut, Paste
    * Convert Whitespace, Uncomment, Comment, Indent, Unindent
    * Line Break, Insert
    * Next Marker, Previous Marker, Clear All Markers, Mark All
    * Select Line, Select All
    * Jump, Move, Move Select, Delete, Toggle Overwrite
	* Scroll, Scroll Bar, Set Cursor, Line Number
    * Find and Replace, Find, Replace, Find Set Selected,
	  Replace Set Selected
    * To 3D Object
    * Resolve Conflict
2009-02-28 23:33:35 +00:00
Nathan Letwory
64dd45ef43 2.5 / Scons | Building on 64bit Windows
* add preliminary support for building Blender on 64bit Windows with _msvc_. The SConstruct should automatically detect if you are on a 64bit Windows and if you have that 64bit build is assumed. If you're not, 32bit build is assumed.
  NOTE: this is still very much wip, so your mileage may vary. Do please report on b25 taskforce ML in case of trouble.
  NOTE2: many of the libs are being linked in statically
  NOTE3: hopefully I didn't break anything for other build platforms (mingw, linux, osx).
  NOTE4: comes after NOTE3
2009-02-20 22:08:02 +00:00
Ton Roosendaal
915e989f9d 2.5
Added ghost display state hint 'modified file'.
Only supported in osx though (close button in bar gets dot).
2009-02-18 13:21:44 +00:00
Diego Borghetti
c63fcd2799 Fix revision: 18690, bug #17850
The problem was that Qt convert the text to the type
STRING or UTF8, that is why Blender can't get the text,
now should be work fine.
2009-01-30 21:01:18 +00:00
Campbell Barton
d95d110d8d [#17850] Copying text from Eric4 to Blender crashes Blender
The crash is caused by calling XGetWindowProperty when xevent.xselection.property is zero.
Not a proper fix because clipboard can paste the data without trouble.
2009-01-27 08:17:35 +00:00
Brecht Van Lommel
9bcdb4b758 2.5: various warning fixes. 2009-01-17 00:51:42 +00:00
Brecht Van Lommel
b08f15aa08 2.5: make and cmake fixes for recent changes. 2009-01-08 13:54:39 +00:00
Ton Roosendaal
ad4e1df46b 2.5
Bugfix in OSX ghost!
The GHOST_TWindowState was set to 'invisble' always... which is a
state now handled correctly in Blender. It caused the window to not 
refresh when resizing.
2009-01-02 10:58:30 +00:00
Ton Roosendaal
1ae7f038cd 2.5
Removed AUX buffer for OSX, was taking too much OGL memory, 
and since AUX was not used for other platforms, its benefits
faded away in the course of the time (it was just drawing
always).
2009-01-01 19:19:50 +00:00