Commit Graph

385 Commits

Author SHA1 Message Date
Campbell Barton
ae23308dd6 made cmake ghost file less confusing (was globbing then removing files for each system). 2010-05-15 12:16:19 +00:00
Damien Plisson
6cb02a1672 Drag & drop from OS: set to accept any drop operation by default for now 2010-05-03 17:02:49 +00:00
Campbell Barton
8f1500da00 remove config.h references, was added for automake build system rev around 124-126 but isnt used by any build systems now. 2010-04-18 10:28:37 +00:00
Damien Plisson
5c24ce16b2 Cocoa fix [#21866] : force mouse move event to be sent upon cursor position set request 2010-04-11 11:19:30 +00:00
Brecht Van Lommel
2a1644401e Fix #20365: new render window does not respect Windows taskbar at top of screen. 2010-04-06 17:11:38 +00:00
Damien Plisson
dc4ac8a263 Fix [#21689] for coordinate issue (y flipped) when setting mouse cursor position
Mem leak when using BGE fixed too.
2010-03-28 19:42:08 +00:00
Damien Plisson
3dde2e224a Cocoa: fix some mem leaks appearing on 10.4 builds 2010-03-20 10:14:59 +00:00
Damien Plisson
8ac0359852 Fix [#21634] GHOST_WindowCocoa: activeWindow null pointer check 2010-03-16 20:42:12 +00:00
Damien Plisson
c12cfa3775 Fix [#20419] OSX Cocoa physical punctuation keys retrieval fix
Cocoa charactersIgnoringModifiers API still takes the Shift key into account. Fix is to use Apple new 10.5 Carbon(!) API that is 64bit compatible to take into account the international keyboard layout when retrieving the physical key pressed/released.
Needed to use an even older API for 10.4 builds.
2010-03-15 20:38:04 +00:00
Brecht Van Lommel
1ded5b37b7 Patch #21569 to fix bug #21530: on X11, middle mouse button drag cancelled
when moving wheel (with horizontal scrolling), was sending middle mouse
event in cases where it should not. Patch by Anthony Edlin, thanks!
2010-03-15 10:25:07 +00:00
Andrea Weikert
c0b3ab6ceb filebrowser:
* move own thread handling for thumbnails to WM_jobs 
* cleanup of thumbnail creation code
* added function to kill the job, which actually allows thread to terminate gracefully

vc9 projectfiles:
* fixed some missing includes for release target!
2010-03-10 19:30:20 +00:00
Damien Plisson
fa6beb4302 System dependent standard directory retrieval functions update : return const strings (as coded in libc) instead of malloc'ed buffers
and plug them into wip BLI_bfile.c to replace the hardcoded paths
2010-02-27 17:03:46 +00:00
Andrea Weikert
7e5d27502c compile fixes for MSVC!
* function must return value!
* missing _USE_MATH_DEFINES for M_PI
2010-02-16 18:12:44 +00:00
Damien Plisson
ed540dd1f1 Cocoa : mem leak fix
This fixes the mem leak part of bug report #21186
2010-02-16 16:38:29 +00:00
Damien Plisson
62e7e0ce77 Cocoa: bugfix [#21158] fix modifiers keys status upon gaining focus
10.6 new function to get modifiers flags status asynchronously returns erroneous value when application gets focus after a virtual desktop switch (Spaces).
Use legacy method to retrieve the modifiers flags status sent with the last  event. Works as at least the "focus gained" event is sent before this query. Bonus: should work also on pre-10.6!
2010-02-16 13:09:03 +00:00
Damien Plisson
df60ff553d OSX/deprecated Carbon: user and system base dirs retrieval implementation
As Carbon is bound to RIP, implemented only a static version of these retrieval functions.
2010-02-16 08:57:05 +00:00
Damien Plisson
1c0fa083b1 Cocoa: user and system base dirs retrieval implementation 2010-02-16 08:36:33 +00:00
Guillermo S. Romero
66f695653b Self tsk. Too much copy paste. 2010-02-16 01:12:21 +00:00
Martin Poirier
54765dfb31 Tsk! 2010-02-16 00:55:13 +00:00
Guillermo S. Romero
80bb824929 System dependant functions (skeletons) to retrieve user and system base dirs.
Thus #defines in BLI_bfile.c can be dropped, as suggested by Damien Plisson.
Feel free to fill in the non Unix ones. For extra info see:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/ResourceFilePaths
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/EnvironmentVariables
2010-02-15 22:50:53 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Damien Plisson
586acf21a7 Cocoa : use Cocoa NSWindow tag for identifying the window where a mouse/tablet/key event happened => enables some actions in inactive windows as per OSX standard
Previous code was assuming an event can only be sent from the active window.
On OSX, Right, Middle mouse buttons, mouse wheel and trackpad events are sent to inactive windows too.

For example, this allows to zoom, pan the view without changing the window order.
2010-02-10 14:16:02 +00:00
Benoit Bolsee
b6c643c19f Update MSVC project files. 2010-02-03 21:14:50 +00:00
Guillermo S. Romero
e15d6fa1df SVN maintenance. 2010-02-01 19:01:57 +00:00
Martin Poirier
f591f34e80 Wrong include path in revision 26519 (missing space when concatenating includes) 2010-02-01 18:23:24 +00:00
Damien Plisson
298f99bf05 Cocoa/DND : give feedback to user of drop possibility before actual drop
The '+' in the cursor during the DND operation is displayed only if drop is accepted.
(through a previous call to GHOST_setAcceptDragOperation(window, TRUE); )
2010-02-01 17:38:44 +00:00
Damien Plisson
cfe7c136f9 Cocoa/DND : added bitmap data type handling in drag'n'drop operations
Conversion of OS type to ImBuf is done inside ghost.
2010-02-01 17:33:41 +00:00
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