Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Mon, 4 Jun 2018 16:49:43 +0000 (18:49 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 4 Jun 2018 16:50:14 +0000 (18:50 +0200)
86 files changed:
intern/ghost/CMakeLists.txt
intern/ghost/GHOST_C-api.h
intern/ghost/GHOST_IEvent.h
intern/ghost/GHOST_ISystem.h
intern/ghost/GHOST_ISystemPaths.h
intern/ghost/GHOST_ITimerTask.h
intern/ghost/GHOST_IWindow.h
intern/ghost/GHOST_Path-api.h
intern/ghost/GHOST_Types.h
intern/ghost/intern/GHOST_Buttons.h
intern/ghost/intern/GHOST_C-api.cpp
intern/ghost/intern/GHOST_ContextWGL.h
intern/ghost/intern/GHOST_Debug.h
intern/ghost/intern/GHOST_DisplayManager.cpp
intern/ghost/intern/GHOST_DisplayManager.h
intern/ghost/intern/GHOST_DisplayManagerCocoa.h
intern/ghost/intern/GHOST_DisplayManagerWin32.cpp
intern/ghost/intern/GHOST_DisplayManagerWin32.h
intern/ghost/intern/GHOST_DisplayManagerX11.cpp
intern/ghost/intern/GHOST_DisplayManagerX11.h
intern/ghost/intern/GHOST_DropTargetWin32.cpp
intern/ghost/intern/GHOST_DropTargetWin32.h
intern/ghost/intern/GHOST_Event.h
intern/ghost/intern/GHOST_EventDragnDrop.h
intern/ghost/intern/GHOST_EventKey.h
intern/ghost/intern/GHOST_EventManager.cpp
intern/ghost/intern/GHOST_EventManager.h
intern/ghost/intern/GHOST_EventNDOF.h
intern/ghost/intern/GHOST_EventPrinter.cpp
intern/ghost/intern/GHOST_ISystemPaths.cpp
intern/ghost/intern/GHOST_NDOFManager.cpp
intern/ghost/intern/GHOST_NDOFManager.h
intern/ghost/intern/GHOST_NDOFManagerCocoa.h
intern/ghost/intern/GHOST_NDOFManagerUnix.cpp
intern/ghost/intern/GHOST_NDOFManagerUnix.h
intern/ghost/intern/GHOST_NDOFManagerWin32.cpp
intern/ghost/intern/GHOST_NDOFManagerWin32.h
intern/ghost/intern/GHOST_Rect.cpp
intern/ghost/intern/GHOST_System.cpp
intern/ghost/intern/GHOST_System.h
intern/ghost/intern/GHOST_SystemCocoa.h
intern/ghost/intern/GHOST_SystemPaths.h
intern/ghost/intern/GHOST_SystemPathsCocoa.h
intern/ghost/intern/GHOST_SystemPathsUnix.cpp
intern/ghost/intern/GHOST_SystemPathsUnix.h
intern/ghost/intern/GHOST_SystemPathsWin32.cpp
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_SystemWin32.h
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_SystemX11.h
intern/ghost/intern/GHOST_TaskbarWin32.h
intern/ghost/intern/GHOST_TaskbarX11.cpp
intern/ghost/intern/GHOST_TimerManager.cpp
intern/ghost/intern/GHOST_TimerManager.h
intern/ghost/intern/GHOST_TimerTask.h
intern/ghost/intern/GHOST_Window.cpp
intern/ghost/intern/GHOST_Window.h
intern/ghost/intern/GHOST_WindowCocoa.h
intern/ghost/intern/GHOST_WindowManager.cpp
intern/ghost/intern/GHOST_WindowManager.h
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowWin32.h
intern/ghost/intern/GHOST_WindowX11.cpp
intern/ghost/intern/GHOST_WindowX11.h
intern/ghost/test/CMakeLists.txt
intern/ghost/test/gears/GHOST_C-Test.c
intern/ghost/test/gears/GHOST_Test.cpp
intern/ghost/test/multitest/Basic.h
intern/ghost/test/multitest/EventToBuf.c
intern/ghost/test/multitest/MultiTest.c
intern/ghost/test/multitest/ScrollBar.c
intern/ghost/test/multitest/ScrollBar.h
intern/ghost/test/multitest/Util.c
intern/ghost/test/multitest/WindowData.c
intern/ghost/test/multitest/WindowData.h
release/scripts/addons
release/scripts/addons_contrib
source/tools
tests/gtests/blenlib/BLI_heap_test.cc
tests/python/bl_pyapi_mathutils.py
tests/python/collada/animation/test_animation_simple.py
tests/python/collada/mesh/test_mesh_simple.py
tests/python/ffmpeg_tests.py
tests/python/modules/test_utils.py
tests/python/rna_array.py
tests/python/view_layer/CMakeLists.txt

index e4b74ae..d8330d4 100644 (file)
@@ -280,7 +280,7 @@ elseif(WIN32)
        if(NOT WITH_GL_EGL)
                list(APPEND SRC
                        intern/GHOST_ContextWGL.cpp
-                               
+
                        intern/GHOST_ContextWGL.h
                )
        endif()
@@ -307,7 +307,7 @@ endif()
 if(WITH_GL_EGL AND NOT (WITH_HEADLESS OR WITH_GHOST_SDL))
        list(APPEND SRC
                intern/GHOST_ContextEGL.cpp
-                       
+
                intern/GHOST_ContextEGL.h
        )
 endif()
index 071474e..a911c45 100644 (file)
@@ -36,7 +36,7 @@
 #include "GHOST_Types.h"
 
 #ifdef __cplusplus
-extern "C" { 
+extern "C" {
 #endif
 
 /**
@@ -103,7 +103,7 @@ extern GHOST_TUns64 GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle);
 
 /**
  * Installs a timer.
- * Note that, on most operating systems, messages need to be processed in order 
+ * Note that, on most operating systems, messages need to be processed in order
  * for the timer callbacks to be invoked.
  * \param systemhandle The handle to the system
  * \param delay The time to wait for the first call to the timerProc (in milliseconds)
@@ -165,7 +165,7 @@ extern void GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle,
 
 /**
  * Create a new window.
- * The new window is added to the list of windows managed. 
+ * The new window is added to the list of windows managed.
  * Never explicitly delete the window, use disposeWindow() instead.
  * \param systemhandle The handle to the system
  * \param title The name of the window (displayed in the title bar of the window if the OS supports it).
@@ -218,7 +218,7 @@ extern GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandl
  * \param windowhandle The handle to the window
  * \param userdata The window user data.
  */
-extern void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle, 
+extern void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle,
                                     GHOST_TUserDataPtr userdata);
 
 /**
@@ -488,7 +488,7 @@ extern GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle);
 extern GHOST_TUns64 GHOST_GetEventTime(GHOST_EventHandle eventhandle);
 
 /**
- * Returns the window this event was generated on, 
+ * Returns the window this event was generated on,
  * or NULL if it is a 'system' event.
  * \param eventhandle The handle to the event
  * \return The generating window.
@@ -566,7 +566,7 @@ extern void GHOST_SetTitle(GHOST_WindowHandle windowhandle,
 /**
  * Returns the title displayed in the title bar. The title
  * should be free'd with free().
- * 
+ *
  * \param windowhandle The handle to the window
  * \return The title, free with free().
  */
index ba5d9ee..8327371 100644 (file)
@@ -42,8 +42,8 @@ class GHOST_IWindow;
  * Interface class for events received from GHOST.
  * You should not need to inherit this class. The system will pass these events
  * to the GHOST_IEventConsumer::processEvent() method of event consumers.<br>
- * Use the getType() method to retrieve the type of event and the getData() 
- * method to get the event data out. Using the event type you can cast the 
+ * Use the getType() method to retrieve the type of event and the getData()
+ * method to get the event data out. Using the event type you can cast the
  * event data to the correct event dat structure.
  * \see GHOST_IEventConsumer#processEvent
  * \see GHOST_TEventType
@@ -73,18 +73,18 @@ public:
        virtual GHOST_TUns64 getTime() = 0;
 
        /**
-        * Returns the window this event was generated on, 
+        * Returns the window this event was generated on,
         * or NULL if it is a 'system' event.
         * \return The generating window.
         */
        virtual GHOST_IWindow *getWindow() = 0;
-       
+
        /**
         * Returns the event data.
         * \return The event data.
         */
        virtual GHOST_TEventDataPtr getData() = 0;
-       
+
 #ifdef WITH_CXX_GUARDEDALLOC
        MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_IEvent")
 #endif
index 25b7fb2..1a6c0f9 100644 (file)
@@ -315,7 +315,7 @@ public:
         * \return The current status.
         */
        virtual bool getFullScreen(void) = 0;
-       
+
        /**
         * Native pixel size support (MacBook 'retina').
         */
index 8f81a22..14b1183 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,7 @@
  * The Original Code is Copyright (C) 2009 Blender Foundation.
  * All rights reserved.
  *
- * 
+ *
  * Contributor(s): Blender Foundation
  *
  * ***** END GPL LICENSE BLOCK *****
index 9bea697..dd3db56 100644 (file)
 /**
  * Interface for a timer task.
  * Timer tasks are created by the system and can be installed by the system.
- * After installation, the timer callback-procedure or "timerProc" will be called 
+ * After installation, the timer callback-procedure or "timerProc" will be called
  * periodically. You should not need to inherit this class. It is passed to the
  * application in the timer-callback.<br>
  * <br>
- * Note that GHOST processes timers in the UI thread. You should ask GHOST 
+ * Note that GHOST processes timers in the UI thread. You should ask GHOST
  * process messages in order for the timer-callbacks to be called.
  * \see GHOST_ISystem#installTimer
  * \see GHOST_TimerProcPtr
@@ -77,7 +77,7 @@ public:
         * \return The timer user data.
         */
        virtual GHOST_TUserDataPtr getUserData() const = 0;
-       
+
        /**
         * Changes the time user data.
         * \param userData: The timer user data.
index 4a4d6be..5a3403b 100644 (file)
@@ -361,7 +361,7 @@ public:
         */
        virtual void endIME() = 0;
 #endif /* WITH_INPUT_IME */
-       
+
 #ifdef WITH_CXX_GUARDEDALLOC
        MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_IWindow")
 #endif
index 5af3ada..9a4d065 100644 (file)
@@ -36,7 +36,7 @@
 #include "GHOST_Types.h"
 
 #ifdef __cplusplus
-extern "C" { 
+extern "C" {
 #endif
 
 GHOST_DECLARE_HANDLE(GHOST_SystemPathsHandle);
@@ -79,7 +79,7 @@ extern const GHOST_TUns8 *GHOST_getBinaryDir(void);
 extern void GHOST_addToSystemRecentFiles(const char *filename);
 
 #ifdef __cplusplus
-} 
+}
 #endif
 
 #endif
index 02b5063..b206bb6 100644 (file)
@@ -77,7 +77,7 @@ typedef enum {
        GHOST_kSuccess
 } GHOST_TSuccess;
 
-/* Xtilt and Ytilt represent how much the pen is tilted away from 
+/* Xtilt and Ytilt represent how much the pen is tilted away from
  * vertically upright in either the X or Y direction, with X and Y the
  * axes of the tablet surface.
  * In other words, Xtilt and Ytilt are components of a vector created by projecting
@@ -190,12 +190,12 @@ typedef enum {
        GHOST_kEventWindowSize,
        GHOST_kEventWindowMove,
        GHOST_kEventWindowDPIHintChanged,
-       
+
        GHOST_kEventDraggingEntered,
        GHOST_kEventDraggingUpdated,
        GHOST_kEventDraggingExited,
        GHOST_kEventDraggingDropDone,
-       
+
        GHOST_kEventOpenMainFile, // Needed for Cocoa to open double-clicked .blend file at startup
        GHOST_kEventNativeResolutionChange, // Needed for Cocoa when window moves to other display
 
@@ -214,9 +214,9 @@ typedef enum {
        GHOST_kStandardCursorDefault = 0,
        GHOST_kStandardCursorRightArrow,
        GHOST_kStandardCursorLeftArrow,
-       GHOST_kStandardCursorInfo, 
+       GHOST_kStandardCursorInfo,
        GHOST_kStandardCursorDestroy,
-       GHOST_kStandardCursorHelp,    
+       GHOST_kStandardCursorHelp,
        GHOST_kStandardCursorCycle,
        GHOST_kStandardCursorSpray,
        GHOST_kStandardCursorWait,
@@ -233,7 +233,7 @@ typedef enum {
        GHOST_kStandardCursorBottomRightCorner,
        GHOST_kStandardCursorBottomLeftCorner,
        GHOST_kStandardCursorCopy,
-       GHOST_kStandardCursorCustom, 
+       GHOST_kStandardCursorCustom,
        GHOST_kStandardCursorPencil,
 
        GHOST_kStandardCursorNumCursors
@@ -247,7 +247,7 @@ typedef enum {
        GHOST_kKeyLinefeed,
        GHOST_kKeyClear,
        GHOST_kKeyEnter  = 0x0D,
-       
+
        GHOST_kKeyEsc    = 0x1B,
        GHOST_kKeySpace  = ' ',
        GHOST_kKeyQuote  = 0x27,
@@ -305,7 +305,7 @@ typedef enum {
        GHOST_kKeyBackslash    = 0x5C,
        GHOST_kKeyAccentGrave  = '`',
 
-       
+
        GHOST_kKeyLeftShift = 0x100,
        GHOST_kKeyRightShift,
        GHOST_kKeyLeftControl,
@@ -377,7 +377,7 @@ typedef enum {
        GHOST_kKeyF22,
        GHOST_kKeyF23,
        GHOST_kKeyF24,
-       
+
        // Multimedia keypad buttons
        GHOST_kKeyMediaPlay,
        GHOST_kKeyMediaStop,
@@ -418,7 +418,7 @@ typedef enum {
        GHOST_kTrackpadEventSwipe, /* Reserved, not used for now */
        GHOST_kTrackpadEventMagnify
 } GHOST_TTrackpadEventSubTypes;
-       
+
 
 typedef struct {
        /** The event subtype */
index 0aa93a2..aed9a3c 100644 (file)
@@ -38,7 +38,7 @@
 
 /**
  * This struct stores the state of the mouse buttons.
- * Buttons can be set using button masks. 
+ * Buttons can be set using button masks.
  * \author     Maarten Gribnau
  * \date       May 15, 2001
  */
index c89ef49..90956cf 100644 (file)
@@ -119,7 +119,7 @@ void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
                                     GHOST_TUns32 *height)
 {
        GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
-       
+
        system->getMainDisplayDimensions(*width, *height);
 }
 
@@ -182,7 +182,7 @@ GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle,
 {
        GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
        GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
-       
+
        return system->disposeWindow(window);
 }
 
@@ -193,7 +193,7 @@ int GHOST_ValidWindow(GHOST_SystemHandle systemhandle,
 {
        GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
        GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
-       
+
        return (int) system->validWindow(window);
 }
 
@@ -211,7 +211,7 @@ GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle,
                bstereoVisual = true;
        else
                bstereoVisual = false;
-       
+
        system->beginFullScreen(*setting, &window, bstereoVisual);
 
        return (GHOST_WindowHandle)window;
@@ -240,7 +240,7 @@ int GHOST_GetFullScreen(GHOST_SystemHandle systemhandle)
 int GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, int waitForEvent)
 {
        GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
-       
+
        return (int) system->processEvents(waitForEvent ? true : false);
 }
 
@@ -249,7 +249,7 @@ int GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, int waitForEvent)
 void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
 {
        GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
-       
+
        system->dispatchEvents();
 }
 
@@ -257,7 +257,7 @@ void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
 GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
 {
        GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
-       
+
        return system->addEventConsumer((GHOST_CallbackEventConsumer *)consumerhandle);
 }
 
@@ -353,7 +353,7 @@ GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle,
                                        GHOST_TInt32 *y)
 {
        GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
-       
+
        return system->getCursorPosition(*x, *y);
 }
 
@@ -364,7 +364,7 @@ GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
                                        GHOST_TInt32 y)
 {
        GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
-       
+
        return system->setCursorPosition(x, y);
 }
 
@@ -398,7 +398,7 @@ GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
        GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
        GHOST_TSuccess result;
        bool isdown = false;
-       
+
        result = system->getModifierKeyState(mask, isdown);
        *isDown = (int) isdown;
 
@@ -414,7 +414,7 @@ GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
        GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
        GHOST_TSuccess result;
        bool isdown = false;
-       
+
        result = system->getButtonState(mask, isdown);
        *isDown = (int) isdown;
 
@@ -441,7 +441,7 @@ void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, GHOST_TInt8 c
 GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
 {
        GHOST_IEvent *event = (GHOST_IEvent *) eventhandle;
-       
+
        return event->getType();
 }
 
@@ -466,7 +466,7 @@ GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle)
 GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle)
 {
        GHOST_IEvent *event = (GHOST_IEvent *) eventhandle;
-       
+
        return event->getData();
 }
 
@@ -475,7 +475,7 @@ GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle)
 GHOST_TimerProcPtr GHOST_GetTimerProc(GHOST_TimerTaskHandle timertaskhandle)
 {
        GHOST_ITimerTask *timertask = (GHOST_ITimerTask *) timertaskhandle;
-       
+
        return timertask->getTimerProc();
 }
 
@@ -485,7 +485,7 @@ void GHOST_SetTimerProc(GHOST_TimerTaskHandle timertaskhandle,
                         GHOST_TimerProcPtr timerproc)
 {
        GHOST_ITimerTask *timertask = (GHOST_ITimerTask *) timertaskhandle;
-       
+
        timertask->setTimerProc(timerproc);
 }
 
@@ -504,13 +504,13 @@ void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle,
                                 GHOST_TUserDataPtr userdata)
 {
        GHOST_ITimerTask *timertask = (GHOST_ITimerTask *) timertaskhandle;
-       
+
        timertask->setUserData(userdata);
 }
 
 
 
-int GHOST_GetValid(GHOST_WindowHandle windowhandle) 
+int GHOST_GetValid(GHOST_WindowHandle windowhandle)
 {
        GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
 
@@ -542,7 +542,7 @@ void GHOST_SetTitle(GHOST_WindowHandle windowhandle,
                     const char *title)
 {
        GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
-       
+
        window->setTitle(title);
 }
 
@@ -567,7 +567,7 @@ char *GHOST_GetTitle(GHOST_WindowHandle windowhandle)
 
 
 
-GHOST_RectangleHandle GHOST_GetWindowBounds(GHOST_WindowHandle windowhandle) 
+GHOST_RectangleHandle GHOST_GetWindowBounds(GHOST_WindowHandle windowhandle)
 {
        GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
        GHOST_Rect *rectangle = NULL;
@@ -580,7 +580,7 @@ GHOST_RectangleHandle GHOST_GetWindowBounds(GHOST_WindowHandle windowhandle)
 
 
 
-GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle) 
+GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle)
 {
        GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
        GHOST_Rect *rectangle = NULL;
@@ -678,16 +678,16 @@ GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle,
 GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle, GHOST_TUns8 isUnsavedChanges)
 {
        GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
-       
+
        return window->setModifiedState(isUnsavedChanges);
-}      
+}
 
 
 GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle,
                                     GHOST_TWindowOrder order)
 {
        GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
-       
+
        return window->setOrder(order);
 }
 
@@ -725,7 +725,7 @@ GHOST_TUns16 GHOST_GetNumOfAASamples(GHOST_WindowHandle windowhandle)
 GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle)
 {
        GHOST_IWindow *window = (GHOST_IWindow *) windowhandle;
-       
+
        return window->activateDrawingContext();
 }
 
index 6f575db..be95758 100644 (file)
@@ -158,7 +158,7 @@ private:
        const int m_contextResetNotificationStrategy;
 
        HGLRC m_hGLRC;
-       
+
 #ifndef NDEBUG
        const char *m_dummyVendor;
        const char *m_dummyRenderer;
index db49627..658c9bf 100644 (file)
@@ -40,9 +40,9 @@
 #  endif // DEBUG
 #endif // _MSC_VER
 
-#ifdef WITH_GHOST_DEBUG 
+#ifdef WITH_GHOST_DEBUG
 #  define GHOST_DEBUG // spit ghost events to stdout
-#endif // WITH_GHOST_DEBUG 
+#endif // WITH_GHOST_DEBUG
 
 #ifdef GHOST_DEBUG
 #  include <iostream>
index 9f0b321..2f8240e 100644 (file)
@@ -179,9 +179,9 @@ GHOST_DisplayManager::findMatch(
                        best = score;
                }
        }
-       
+
        match = m_settings[display][found];
-       
+
        GHOST_PRINT("GHOST_DisplayManager::findMatch(): settings of match:\n");
        GHOST_PRINT("  setting.xPixels=" << match.xPixels << "\n");
        GHOST_PRINT("  setting.yPixels=" << match.yPixels << "\n");
index afdb115..02a742a 100644 (file)
@@ -50,7 +50,7 @@ public:
         * Constructor.
         */
        GHOST_DisplayManager(void);
-       
+
        /**
         * Destructor.
         */
@@ -79,7 +79,7 @@ public:
                                                     GHOST_TInt32& numSettings) const;
 
        /**
-        * Returns the current setting for this display device. 
+        * Returns the current setting for this display device.
         * \param display The index of the display to query with 0 <= display < getNumDisplays().
         * \param index   The setting index to be returned.
         * \param setting The setting of the display device with this index.
@@ -90,7 +90,7 @@ public:
                                                 GHOST_DisplaySetting& setting) const;
 
        /**
-        * Returns the current setting for this display device. 
+        * Returns the current setting for this display device.
         * \param display The index of the display to query with 0 <= display < getNumDisplays().
         * \param setting The current setting of the display device with this index.
         * \return Indication of success.
@@ -128,7 +128,7 @@ protected:
         * \return Indication of success.
         */
        GHOST_TSuccess initializeSettings(void);
-       
+
        /** Tells whether the list of display modes has been stored already. */
        bool m_settingsInitialized;
        /** The list with display settings for the main display. */
index f580820..3ce0b4e 100644 (file)
@@ -69,7 +69,7 @@ public:
        GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32& numSettings) const;
 
        /**
-        * Returns the current setting for this display device. 
+        * Returns the current setting for this display device.
         * \param display The index of the display to query with 0 <= display < getNumDisplays().
         * \param index   The setting index to be returned.
         * \param setting The setting of the display device with this index.
@@ -78,7 +78,7 @@ public:
        GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display, GHOST_TInt32 index, GHOST_DisplaySetting& setting) const;
 
        /**
-        * Returns the current setting for this display device. 
+        * Returns the current setting for this display device.
         * \param display The index of the display to query with 0 <= display < getNumDisplays().
         * \param setting The current setting of the display device with this index.
         * \return Indication of success.
@@ -86,14 +86,14 @@ public:
        GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display, GHOST_DisplaySetting& setting) const;
 
        /**
-        * Changes the current setting for this display device. 
+        * Changes the current setting for this display device.
         * \param display The index of the display to query with 0 <= display < getNumDisplays().
         * \param setting The current setting of the display device with this index.
         * \return Indication of success.
         */
        GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display, const GHOST_DisplaySetting& setting);
 
-protected:     
+protected:
        //Do not cache values as OS X supports screen hot plug
        /** Cached number of displays. */
        //CGDisplayCount m_numDisplays;
index 7b9a897..f5f6de3 100644 (file)
@@ -62,11 +62,11 @@ static BOOL get_dd(DWORD d, DISPLAY_DEVICE *dd)
 }
 
 /*
- * When you call EnumDisplaySettings with iModeNum set to zero, the operating system 
- * initializes and caches information about the display device. When you call 
- * EnumDisplaySettings with iModeNum set to a non-zero value, the function returns 
+ * When you call EnumDisplaySettings with iModeNum set to zero, the operating system
+ * initializes and caches information about the display device. When you call
+ * EnumDisplaySettings with iModeNum set to a non-zero value, the function returns
  * the information that was cached the last time the function was called with iModeNum
- * set to zero. 
+ * set to zero.
  */
 GHOST_TSuccess GHOST_DisplayManagerWin32::getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32& numSettings) const
 {
@@ -98,9 +98,9 @@ GHOST_TSuccess GHOST_DisplayManagerWin32::getDisplaySetting(GHOST_TUns8 display,
                setting.bpp         = dm.dmBitsPerPel;
                /* When you call the EnumDisplaySettings function, the dmDisplayFrequency member
                 * may return with the value 0 or 1. These values represent the display hardware's
-                * default refresh rate. This default rate is typically set by switches on a display 
-                * card or computer motherboard, or by a configuration program that does not use 
-                * Win32 display functions such as ChangeDisplaySettings. 
+                * default refresh rate. This default rate is typically set by switches on a display
+                * card or computer motherboard, or by a configuration program that does not use
+                * Win32 display functions such as ChangeDisplaySettings.
                 */
                /* First, we tried to explicitly set the frequency to 60 if EnumDisplaySettings
                 * returned 0 or 1 but this doesn't work since later on an exact match will
index ff8849f..f0d6d62 100644 (file)
@@ -69,7 +69,7 @@ public:
        GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32& numSettings) const;
 
        /**
-        * Returns the current setting for this display device. 
+        * Returns the current setting for this display device.
         * \param display The index of the display to query with 0 <= display < getNumDisplays().
         * \param index   The setting index to be returned.
         * \param setting The setting of the display device with this index.
@@ -78,7 +78,7 @@ public:
        GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display, GHOST_TInt32 index, GHOST_DisplaySetting& setting) const;
 
        /**
-        * Returns the current setting for this display device. 
+        * Returns the current setting for this display device.
         * \param display The index of the display to query with 0 <= display < getNumDisplays().
         * \param setting The current setting of the display device with this index.
         * \return Indication of success.
@@ -86,7 +86,7 @@ public:
        GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display, GHOST_DisplaySetting& setting) const;
 
        /**
-        * Changes the current setting for this display device. 
+        * Changes the current setting for this display device.
         * \param display The index of the display to query with 0 <= display < getNumDisplays().
         * \param setting The current setting of the display device with this index.
         * \return Indication of success.
index b3e6f2e..8a629b2 100644 (file)
@@ -158,7 +158,7 @@ getDisplaySetting(
 
        return GHOST_kSuccess;
 }
-       
+
 GHOST_TSuccess
 GHOST_DisplayManagerX11::
 getCurrentDisplaySetting(
index b54c53c..857a8a5 100644 (file)
@@ -76,7 +76,7 @@ public:
            ) const;
 
        /**
-        * Returns the current setting for this display device. 
+        * Returns the current setting for this display device.
         * \param display The index of the display to query with 0 <= display < getNumDisplays().
         * \param index   The setting index to be returned.
         * \param setting The setting of the display device with this index.
@@ -90,7 +90,7 @@ public:
            ) const;
 
        /**
-        * Returns the current setting for this display device. 
+        * Returns the current setting for this display device.
         * \param display The index of the display to query with 0 <= display < getNumDisplays().
         * \param setting The current setting of the display device with this index.
         * \return Indication of success.
@@ -102,7 +102,7 @@ public:
            ) const;
 
        /**
-        * Changes the current setting for this display device. 
+        * Changes the current setting for this display device.
         * \param display The index of the display to query with 0 <= display < getNumDisplays().
         * \param setting The current setting of the display device with this index.
         * \return Indication of success.
@@ -119,5 +119,5 @@ private:
 };
 
 
-#endif // 
+#endif //
 
index cbf37bf..79d7a2d 100644 (file)
@@ -29,7 +29,7 @@
  *  \ingroup GHOST
  */
 
+
 #include "GHOST_Debug.h"
 #include "GHOST_DropTargetWin32.h"
 #include <shellapi.h>
@@ -59,7 +59,7 @@ GHOST_DropTargetWin32::~GHOST_DropTargetWin32()
 }
 
 
-/* 
+/*
  *  IUnknown::QueryInterface
  */
 HRESULT __stdcall GHOST_DropTargetWin32::QueryInterface(REFIID riid, void **ppvObj)
@@ -81,8 +81,8 @@ HRESULT __stdcall GHOST_DropTargetWin32::QueryInterface(REFIID riid, void **ppvO
 }
 
 
-/* 
- *     IUnknown::AddRef 
+/*
+ *     IUnknown::AddRef
  */
 
 ULONG __stdcall GHOST_DropTargetWin32::AddRef(void)
@@ -90,13 +90,13 @@ ULONG __stdcall GHOST_DropTargetWin32::AddRef(void)
        return ::InterlockedIncrement(&m_cRef);
 }
 
-/* 
+/*
  * IUnknown::Release
  */
 ULONG __stdcall GHOST_DropTargetWin32::Release(void)
 {
        ULONG refs = ::InterlockedDecrement(&m_cRef);
-               
+
        if (refs == 0) {
                delete this;
                return 0;
@@ -106,7 +106,7 @@ ULONG __stdcall GHOST_DropTargetWin32::Release(void)
        }
 }
 
-/* 
+/*
  * Implementation of IDropTarget::DragEnter
  */
 HRESULT __stdcall GHOST_DropTargetWin32::DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
@@ -114,13 +114,13 @@ HRESULT __stdcall GHOST_DropTargetWin32::DragEnter(IDataObject *pDataObject, DWO
        // we accept all drop by default
        m_window->setAcceptDragOperation(true);
        *pdwEffect = DROPEFFECT_NONE;
-       
+
        m_draggedObjectType = getGhostType(pDataObject);
        m_system->pushDragDropEvent(GHOST_kEventDraggingEntered, m_draggedObjectType, m_window, pt.x, pt.y, NULL);
        return S_OK;
 }
 
-/* 
+/*
  * Implementation of IDropTarget::DragOver
  */
 HRESULT __stdcall GHOST_DropTargetWin32::DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
@@ -136,7 +136,7 @@ HRESULT __stdcall GHOST_DropTargetWin32::DragOver(DWORD grfKeyState, POINTL pt,
        return S_OK;
 }
 
-/* 
+/*
  * Implementation of IDropTarget::DragLeave
  */
 HRESULT __stdcall GHOST_DropTargetWin32::DragLeave(void)
@@ -147,7 +147,7 @@ HRESULT __stdcall GHOST_DropTargetWin32::DragLeave(void)
 }
 
 /* Implementation of IDropTarget::Drop
- * This function will not be called if pdwEffect is set to DROPEFFECT_NONE in 
+ * This function will not be called if pdwEffect is set to DROPEFFECT_NONE in
  * the implementation of IDropTarget::DragOver
  */
 HRESULT __stdcall GHOST_DropTargetWin32::Drop(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
@@ -162,15 +162,15 @@ HRESULT __stdcall GHOST_DropTargetWin32::Drop(IDataObject *pDataObject, DWORD gr
        }
        if (data)
                m_system->pushDragDropEvent(GHOST_kEventDraggingDropDone, m_draggedObjectType, m_window, pt.x, pt.y, data);
-               
+
        m_draggedObjectType = GHOST_kDragnDropTypeUnknown;
        return S_OK;
 }
 
-/* 
+/*
  * Helpers
  */
+
 DWORD GHOST_DropTargetWin32::allowedDropEffect(DWORD dwAllowed)
 {
        DWORD dwEffect = DROPEFFECT_NONE;
@@ -264,7 +264,7 @@ void *GHOST_DropTargetWin32::getDropDataAsFilenames(IDataObject *pDataObject)
                        // Free up memory.
                        ::GlobalUnlock(stgmed.hGlobal);
                        ::ReleaseStgMedium(&stgmed);
-                       
+
                        return strArray;
                }
        }
@@ -301,7 +301,7 @@ void *GHOST_DropTargetWin32::getDropDataAsString(IDataObject *pDataObject)
        if (pDataObject->QueryGetData(&fmtetc) == S_OK) {
                if (pDataObject->GetData(&fmtetc, &stgmed) == S_OK) {
                        char *str = (char *)::GlobalLock(stgmed.hGlobal);
-                       
+
                        tmp_string = (char *)::malloc(::strlen(str) + 1);
                        if (!tmp_string) {
                                ::GlobalUnlock(stgmed.hGlobal);
@@ -320,7 +320,7 @@ void *GHOST_DropTargetWin32::getDropDataAsString(IDataObject *pDataObject)
                        return tmp_string;
                }
        }
-       
+
        return NULL;
 }
 
@@ -338,7 +338,7 @@ int GHOST_DropTargetWin32::WideCharToANSI(LPCWSTR in, char * &out)
                                     0,
                                     NULL, NULL
                                     );
-       
+
        if (!size) {
 #ifdef GHOST_DEBUG
                ::printLastError();
index 56bae1f..3d7be45 100644 (file)
@@ -41,11 +41,11 @@ class GHOST_DropTargetWin32 : public IDropTarget
 {
 public:
        /* IUnknownd implementation.
-        * Enables clients to get pointers to other interfaces on a given object 
+        * Enables clients to get pointers to other interfaces on a given object
         * through the QueryInterface method, and manage the existence of the object
-        * through the AddRef and Release methods. All other COM interfaces are 
-        * inherited, directly or indirectly, from IUnknown. Therefore, the three 
-        * methods in IUnknown are the first entries in the VTable for every interface. 
+        * through the AddRef and Release methods. All other COM interfaces are
+        * inherited, directly or indirectly, from IUnknown. Therefore, the three
+        * methods in IUnknown are the first entries in the VTable for every interface.
         */
        HRESULT __stdcall QueryInterface(REFIID riid, void **ppvObj);
        ULONG __stdcall AddRef(void);
@@ -56,20 +56,20 @@ public:
         *   provide drag-and-drop operations in your application. It contains methods
         *   used in any application that can be a target for data during a
         *   drag-and-drop operation. A drop-target application is responsible for:
-        * 
+        *
         *  - Determining the effect of the drop on the target application.
         *  - Incorporating any valid dropped data when the drop occurs.
         *  - Communicating target feedback to the source so the source application
         *        can provide appropriate visual feedback such as setting the cursor.
         *  - Implementing drag scrolling.
         *  - Registering and revoking its application windows as drop targets.
-        * 
-        * The IDropTarget interface contains methods that handle all these 
-        * responsibilities except registering and revoking the application window 
-        * as a drop target, for which you must call the RegisterDragDrop and the 
+        *
+        * The IDropTarget interface contains methods that handle all these
+        * responsibilities except registering and revoking the application window
+        * as a drop target, for which you must call the RegisterDragDrop and the
         * RevokeDragDrop functions.
         */
-       
+
        HRESULT __stdcall DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
        HRESULT __stdcall DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
        HRESULT __stdcall DragLeave(void);
@@ -133,7 +133,7 @@ private:
 
        /**
         * Convert Unicode to ANSI, replacing unconvertable chars with '?'.
-        * The ANSI codepage is the system default codepage, 
+        * The ANSI codepage is the system default codepage,
         * and can change from system to system.
         * \param in LPCWSTR.
         * \param out char *. Is set to NULL on failure.
index 6a71549..2788707 100644 (file)
@@ -60,7 +60,7 @@ public:
         * \return The event type.
         */
        GHOST_TEventType getType()
-       { 
+       {
                return m_type;
        }
 
@@ -74,7 +74,7 @@ public:
        }
 
        /**
-        * Returns the window this event was generated on, 
+        * Returns the window this event was generated on,
         * or NULL if it is a 'system' event.
         * \return The generating window.
         */
index b7bf37c..c9f4f08 100644 (file)
@@ -41,9 +41,9 @@ extern "C" {
 
 /**
  * Drag & drop event
- * 
+ *
  * The dragging sequence is performed in four phases:
- * 
+ *
  * <li> Start sequence (GHOST_kEventDraggingEntered) that tells a drag'n'drop operation has started.
  * Already gives the object data type, and the entering mouse location
  *
@@ -93,13 +93,13 @@ public:
                m_dragnDropEventData.data = data;
                m_data = &m_dragnDropEventData;
        }
-       
+
        ~GHOST_EventDragnDrop()
        {
                //Free the dropped object data
                if (m_dragnDropEventData.data == NULL)
                        return;
-               
+
                switch (m_dragnDropEventData.dataType) {
                        case GHOST_kDragnDropTypeBitmap:
                                IMB_freeImBuf((ImBuf *)m_dragnDropEventData.data);
@@ -108,10 +108,10 @@ public:
                        {
                                GHOST_TStringArray *strArray = (GHOST_TStringArray *)m_dragnDropEventData.data;
                                int i;
-                               
+
                                for (i = 0; i < strArray->count; i++)
                                        free(strArray->strings[i]);
-                               
+
                                free(strArray->strings);
                                free(strArray);
                        }
@@ -124,8 +124,8 @@ public:
                                break;
                }
        }
-       
-       
+
+
 
 protected:
        /** The x,y-coordinates of the cursor position. */
index 54e38c0..7e86759 100644 (file)
@@ -60,7 +60,7 @@ public:
                m_keyEventData.utf8_buf[0] = '\0';
                m_data = &m_keyEventData;
        }
-       
+
        /**
         * Constructor.
         * \param msec  The time this event was generated.
@@ -82,7 +82,7 @@ public:
                else m_keyEventData.utf8_buf[0] = '\0';
                m_data = &m_keyEventData;
        }
-               
+
 protected:
        /** The key event data. */
        GHOST_TEventKeyData m_keyEventData;
index 0675ac7..bf92fa4 100644 (file)
@@ -127,7 +127,7 @@ GHOST_TSuccess GHOST_EventManager::addConsumer(GHOST_IEventConsumer *consumer)
 {
        GHOST_TSuccess success;
        GHOST_ASSERT(consumer, "invalid consumer");
-       
+
        // Check to see whether the consumer is already in our list
        TConsumerVector::const_iterator iter = std::find(m_consumers.begin(), m_consumers.end(), consumer);
 
index ae2971e..efad196 100644 (file)
@@ -143,7 +143,7 @@ protected:
 
        /** A stack with events. */
        typedef std::deque<GHOST_IEvent *> TEventStack;
-       
+
        /** The event stack. */
        std::deque<GHOST_IEvent *> m_events;
        std::deque<GHOST_IEvent *> m_handled_events;
index 754e109..b81f74b 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
index a6adba1..221b85b 100644 (file)
@@ -41,7 +41,7 @@
 bool GHOST_EventPrinter::processEvent(GHOST_IEvent *event)
 {
        bool handled = true;
-       
+
        GHOST_ASSERT(event, "event==0");
 
        if (event->getType() == GHOST_kEventWindowUpdate) return false;
@@ -95,7 +95,7 @@ bool GHOST_EventPrinter::processEvent(GHOST_IEvent *event)
                        std::cout << "GHOST_kEventKeyDown, key: " << str;
                }
                break;
-                       
+
                case GHOST_kEventDraggingEntered:
                {
                        GHOST_TEventDragnDropData *dragnDropData = (GHOST_TEventDragnDropData *)((GHOST_IEvent *)event)->getData();
@@ -103,7 +103,7 @@ bool GHOST_EventPrinter::processEvent(GHOST_IEvent *event)
                        std::cout << " mouse at x=" << dragnDropData->x << " y=" << dragnDropData->y;
                }
                break;
-                       
+
                case GHOST_kEventDraggingUpdated:
                {
                        GHOST_TEventDragnDropData *dragnDropData = (GHOST_TEventDragnDropData *)((GHOST_IEvent *)event)->getData();
@@ -118,7 +118,7 @@ bool GHOST_EventPrinter::processEvent(GHOST_IEvent *event)
                        std::cout << "GHOST_kEventDraggingExited, dragged object type : " << dragnDropData->dataType;
                }
                break;
-       
+
                case GHOST_kEventDraggingDropDone:
                {
                        GHOST_TEventDragnDropData *dragnDropData = (GHOST_TEventDragnDropData *)((GHOST_IEvent *)event)->getData();
@@ -148,14 +148,14 @@ bool GHOST_EventPrinter::processEvent(GHOST_IEvent *event)
                case GHOST_kEventOpenMainFile:
                {
                        GHOST_TEventDataPtr eventData = ((GHOST_IEvent *)event)->getData();
-                       
+
                        if (eventData)
                                std::cout << "GHOST_kEventOpenMainFile for path : " << (char *)eventData;
                        else
                                std::cout << "GHOST_kEventOpenMainFile with no path specified!!";
                }
                break;
-                       
+
                case GHOST_kEventQuit:
                        std::cout << "GHOST_kEventQuit";
                        break;
index 93ca0bc..8bd7fbe 100644 (file)
@@ -67,7 +67,7 @@ GHOST_TSuccess GHOST_ISystemPaths::create()
 #  else
                m_systemPaths = new GHOST_SystemPathsUnix();
 #  endif
-#endif 
+#endif
                success = m_systemPaths != NULL ? GHOST_kSuccess : GHOST_kFailure;
        }
        else {
index cab9bf4..1f2af73 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
index 0c0b945..78f24e0 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
index 3f1bfcf..6e676fa 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
index fff5aba..624d39b 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
index 3fd171d..8d83ac7 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,7 @@
  *
  * ***** END GPL LICENSE BLOCK *****
  */
+
 #ifndef __GHOST_NDOFMANAGERUNIX_H__
 #define __GHOST_NDOFMANAGERUNIX_H__
 
index 0023ee7..fbdac24 100644 (file)
@@ -1,11 +1,11 @@
 /*
- * 
+ *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
index 2f7bc9e..522a79f 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
index 9af4f30..646dae9 100644 (file)
@@ -108,7 +108,7 @@ void GHOST_Rect::setCenter(GHOST_TInt32 cx, GHOST_TInt32 cy)
 void GHOST_Rect::setCenter(GHOST_TInt32 cx, GHOST_TInt32 cy, GHOST_TInt32 w, GHOST_TInt32 h)
 {
        long w_2, h_2;
-       
+
        w_2 = w >> 1;
        h_2 = h >> 1;
        m_l = cx - w_2;
index 4db2f06..f849993 100644 (file)
@@ -113,7 +113,7 @@ GHOST_TSuccess GHOST_System::disposeWindow(GHOST_IWindow *window)
 
        /*
         * Remove all pending events for the window.
-        */ 
+        */
        if (m_windowManager->getWindowFound(window)) {
                m_eventManager->removeWindowEvents(window);
        }
@@ -272,7 +272,7 @@ GHOST_TSuccess GHOST_System::pushEvent(GHOST_IEvent *event)
 GHOST_TSuccess GHOST_System::getModifierKeyState(GHOST_TModifierKeyMask mask, bool& isDown) const
 {
        GHOST_ModifierKeys keys;
-       // Get the state of all modifier keys 
+       // Get the state of all modifier keys
        GHOST_TSuccess success = getModifierKeys(keys);
        if (success) {
                // Isolate the state of the key requested
@@ -306,7 +306,7 @@ GHOST_TSuccess GHOST_System::init()
        m_timerManager = new GHOST_TimerManager();
        m_windowManager = new GHOST_WindowManager();
        m_eventManager = new GHOST_EventManager();
-       
+
 #ifdef GHOST_DEBUG
        if (m_eventManager) {
                m_eventPrinter = new GHOST_EventPrinter();
index 50c893b..6831b3d 100644 (file)
@@ -91,7 +91,7 @@ public:
 
        /**
         * Installs a timer.
-        * Note that, on most operating systems, messages need to be processed in order 
+        * Note that, on most operating systems, messages need to be processed in order
         * for the timer callbacks to be invoked.
         * \param delay         The time to wait for the first call to the timerProc (in milliseconds)
         * \param interval      The interval between calls to the timerProc
@@ -114,7 +114,7 @@ public:
        /***************************************************************************************
         * Display/window management functionality
         ***************************************************************************************/
-       
+
        /**
         * Inherited from GHOST_ISystem but left pure virtual
         *
@@ -169,7 +169,7 @@ public:
         */
        bool getFullScreen(void);
 
-       
+
        /**
         * Native pixel size support (MacBook 'retina').
         * \return The pixel size in float.
@@ -237,7 +237,7 @@ public:
         * \return                      Indication of success.
         */
        GHOST_TSuccess getButtonState(GHOST_TButtonMask mask, bool& isDown) const;
-       
+
 #ifdef WITH_INPUT_NDOF
        /***************************************************************************************
         * Access to 3D mouse.
@@ -305,7 +305,7 @@ public:
         *
         */
        virtual GHOST_TUns8 *getClipboard(bool selection) const = 0;
-         
+
        /**
         * Put data to the Clipboard
         * \param buffer                The buffer to copy to the clipboard
@@ -324,7 +324,7 @@ public:
         */
        virtual bool supportsNativeDialogs(void);
 
-       
+
 protected:
        /**
         * Initialize the system.
@@ -362,7 +362,7 @@ protected:
        /** The N-degree of freedom device manager */
        GHOST_NDOFManager *m_ndofManager;
 #endif
-       
+
        /** Prints all the events. */
 #ifdef GHOST_DEBUG
        GHOST_EventPrinter *m_eventPrinter;
@@ -370,7 +370,7 @@ protected:
 
        /** Settings of the display before the display went fullscreen. */
        GHOST_DisplaySetting m_preFullScreenSetting;
-       
+
 };
 
 inline GHOST_TimerManager *GHOST_System::getTimerManager() const
index 8586c91..f070273 100644 (file)
@@ -88,7 +88,7 @@ public:
         * \return The dimension of the main display.
         */
        void getMainDisplayDimensions(GHOST_TUns32& width, GHOST_TUns32& height) const;
-       
+
        /** Returns the combine dimensions of all monitors.
         * \return The dimension of the workspace.
         */
@@ -122,7 +122,7 @@ public:
            const bool exclusive = false,
            const GHOST_TEmbedderWindowID parentWindow = 0
            );
-       
+
        /**
         * Create a new offscreen context.
         * Never explicitly delete the context, use disposeContext() instead.
@@ -152,19 +152,19 @@ public:
         * \return Indication of the presence of events.
         */
        bool processEvents(bool waitForEvent);
-       
+
        /**
         * Handle User request to quit, from Menu bar Quit, and Cmd+Q
         * Display alert panel if changes performed since last save
         */
        GHOST_TUns8 handleQuitRequest();
-       
+
        /**
         * Handle Cocoa openFile event
         * Display confirmation request panel if changes performed since last save
         */
        bool handleOpenDocumentRequest(void *filepathStr);
-       
+
        /**
         * Handles a drag'n'drop destination event. Called by GHOST_WindowCocoa window subclass
         * \param eventType The type of drag'n'drop event
@@ -176,7 +176,7 @@ public:
         */
        GHOST_TSuccess handleDraggingEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType,
                                           GHOST_WindowCocoa *window, int mouseX, int mouseY, void *data);
-       
+
        /***************************************************************************************
         * Cursor management functionality
         ***************************************************************************************/
@@ -196,7 +196,7 @@ public:
         * \return                      Indication of success.
         */
        GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y);
-       
+
        /***************************************************************************************
         * Access to mouse button and keyboard states.
         ***************************************************************************************/
@@ -221,7 +221,7 @@ public:
         * \return                              Returns the selected buffer
         */
        GHOST_TUns8 *getClipboard(bool selection) const;
-       
+
        /**
         * Puts buffer to system clipboard
         * \param buffer        The buffer to be copied
@@ -236,7 +236,7 @@ public:
         * \return Indication whether the event was handled.
         */
        GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa *window);
-       
+
        /**
         * Handles the Cocoa event telling the application has become active (again)
         * \return Indication whether the event was handled.
@@ -254,7 +254,7 @@ public:
        int toggleConsole(int action) {
                return 0;
        }
-       
+
        /**
         * Handles a tablet event.
         * \param eventPtr      An NSEvent pointer (casted to void* to enable compilation in standard C++)
@@ -279,7 +279,7 @@ public:
         * \return Indication whether the event was handled.
         */
        GHOST_TSuccess handleKeyEvent(void *eventPtr);
-       
+
        /**
         * Informs if the system provides native dialogs (eg. confirm quit)
         */
@@ -303,19 +303,19 @@ protected:
 
        /** Start time at initialization. */
        GHOST_TUns64 m_start_time;
-       
+
        /** Event has been processed directly by Cocoa (or NDOF manager) and has sent a ghost event to be dispatched */
        bool m_outsideLoopEventProcessed;
-       
+
        /** Raised window is not yet known by the window manager, so delay application become active event handling */
        bool m_needDelayedApplicationBecomeActiveEventProcessing;
-       
+
        /** State of the modifiers. */
        GHOST_TUns32 m_modifierMask;
 
        /** Ignores window size messages (when window is dragged). */
        bool m_ignoreWindowSizedMessages;
-       
+
        /** Temporarily ignore momentum scroll events */
        bool m_ignoreMomentumScroll;
        /** Is the scroll wheel event generated by a multitouch trackpad or mouse? */
index 22879c7..fbaa8ad 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,7 @@
  * The Original Code is Copyright (C) 2009 Blender Foundation.
  * All rights reserved.
  *
- * 
+ *
  * Contributor(s): Blender Foundation
  *
  * ***** END GPL LICENSE BLOCK *****
index 1c76284..3a1f3e1 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,7 @@
  * The Original Code is Copyright (C) 2010 Blender Foundation.
  * All rights reserved.
  *
- * 
+ *
  * Contributor(s): Damien Plisson 2010
  *
  * ***** END GPL LICENSE BLOCK *****
index 8738b8d..b4e1259 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,7 @@
  * The Original Code is Copyright (C) 2010 Blender Foundation.
  * All rights reserved.
  *
- * 
+ *
  * Contributor(s): Blender Foundation
  *
  * ***** END GPL LICENSE BLOCK *****
index 1502160..69c37c0 100644 (file)
@@ -4,7 +4,7 @@
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
+ * of the License, or (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,7 @@
  * The Original Code is Copyright (C) 2010 Blender Foundation.
  * All rights reserved.
  *
- * 
+ *
  * Contributor(s): Blender Foundation
  *
  * ***** END GPL LICENSE BLOCK *****
@@ -44,7 +44,7 @@ public:
         * this class should only be instanciated by GHOST_ISystem.
         */
        GHOST_SystemPathsUnix();
-       
+
        /**
         * Destructor.
         */
index 8056bc7..d122d3d 100644 (file)
@@ -17,7 +17,7 @@
  *
  * The Original Code is Copyright (C) 2011 Blender Foundation.
  * All rights reserved.
- * 
+ *
  * Contributor(s): Blender Foundation
  *                 Andrea Weikert
  *
index ccc90e3..625a34a 100644 (file)
@@ -240,7 +240,7 @@ GHOST_TUns64 GHOST_SystemWin32::getMilliSeconds() const
        __int64 delta = 1000 * (count - m_start);
 
        GHOST_TUns64 t = (GHOST_TUns64)(delta / m_freq);
-       return t; 
+       return t;
 }
 
 
@@ -407,7 +407,7 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
 #else
                        GHOST_TUns64 next = timerMgr->nextFireTime();
                        GHOST_TInt64 maxSleep = next - getMilliSeconds();
-                       
+
                        if (next == GHOST_kFireTimeNever) {
                                ::WaitMessage();
                        }
@@ -469,17 +469,17 @@ GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys &keys) cons
        keys.set(GHOST_kModifierKeyLeftShift, down);
        down = HIBYTE(::GetKeyState(VK_RSHIFT)) != 0;
        keys.set(GHOST_kModifierKeyRightShift, down);
-       
+
        down = HIBYTE(::GetKeyState(VK_LMENU)) != 0;
        keys.set(GHOST_kModifierKeyLeftAlt, down);
        down = HIBYTE(::GetKeyState(VK_RMENU)) != 0;
        keys.set(GHOST_kModifierKeyRightAlt, down);
-       
+
        down = HIBYTE(::GetKeyState(VK_LCONTROL)) != 0;
        keys.set(GHOST_kModifierKeyLeftControl, down);
        down = HIBYTE(::GetKeyState(VK_RCONTROL)) != 0;
        keys.set(GHOST_kModifierKeyRightControl, down);
-       
+
        bool lwindown = HIBYTE(::GetKeyState(VK_LWIN)) != 0;
        bool rwindown = HIBYTE(::GetKeyState(VK_RWIN)) != 0;
        if (lwindown || rwindown)
@@ -512,7 +512,7 @@ GHOST_TSuccess GHOST_SystemWin32::getButtons(GHOST_Buttons &buttons) const
 GHOST_TSuccess GHOST_SystemWin32::init()
 {
        GHOST_TSuccess success = GHOST_System::init();
-       
+
        /* Disable scaling on high DPI displays on Vista */
        HMODULE
            user32 = ::LoadLibraryA("user32.dll");
@@ -542,12 +542,12 @@ GHOST_TSuccess GHOST_SystemWin32::init()
                wc.cbWndExtra = 0;
                wc.hInstance = ::GetModuleHandle(0);
                wc.hIcon = ::LoadIcon(wc.hInstance, "APPICON");
-               
+
                if (!wc.hIcon) {
                        ::LoadIcon(NULL, IDI_APPLICATION);
                }
                wc.hCursor = ::LoadCursor(0, IDC_ARROW);
-               wc.hbrBackground = 
+               wc.hbrBackground =
 #ifdef INW32_COMPISITING
                        (HBRUSH)CreateSolidBrush
 #endif
@@ -560,7 +560,7 @@ GHOST_TSuccess GHOST_SystemWin32::init()
                        success = GHOST_kFailure;
                }
        }
-       
+
        return success;
 }
 
@@ -583,7 +583,7 @@ GHOST_TKey GHOST_SystemWin32::hardKey(RAWINPUT const &raw, int *keyDown, char *v
        *keyDown = !(raw.data.keyboard.Flags & RI_KEY_BREAK) && msg != WM_KEYUP && msg != WM_SYSKEYUP;
 
        key = this->convertKey(raw.data.keyboard.VKey, raw.data.keyboard.MakeCode, (raw.data.keyboard.Flags & (RI_KEY_E1 | RI_KEY_E0)));
-       
+
        // extra handling of modifier keys: don't send repeats out from GHOST
        if (key >= GHOST_kKeyLeftShift && key <= GHOST_kKeyRightAlt) {
                bool changed = false;
@@ -628,7 +628,7 @@ GHOST_TKey GHOST_SystemWin32::hardKey(RAWINPUT const &raw, int *keyDown, char *v
                        default:
                                break;
                }
-               
+
                if (changed) {
                        modifiers.set(modifier, (bool)*keyDown);
                        system->storeModifierKeys(modifiers);
@@ -637,7 +637,7 @@ GHOST_TKey GHOST_SystemWin32::hardKey(RAWINPUT const &raw, int *keyDown, char *v
                        key = GHOST_kKeyUnknown;
                }
        }
-       
+
 
        if (vk) *vk = raw.data.keyboard.VKey;
 
@@ -682,7 +682,7 @@ GHOST_TKey GHOST_SystemWin32::convertKey(short vKey, short scanCode, short exten
                switch (vKey) {
                        case VK_RETURN:
                                key = (extend) ? GHOST_kKeyNumpadEnter : GHOST_kKeyEnter; break;
-                       
+
                        case VK_BACK:     key = GHOST_kKeyBackSpace;        break;
                        case VK_TAB:      key = GHOST_kKeyTab;              break;
                        case VK_ESCAPE:   key = GHOST_kKeyEsc;              break;
@@ -782,7 +782,7 @@ GHOST_TKey GHOST_SystemWin32::convertKey(short vKey, short scanCode, short exten
                                break;
                }
        }
-       
+
        return key;
 }
 
@@ -799,7 +799,7 @@ GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_TEventType type,
 {
        GHOST_TInt32 x_screen, y_screen;
        GHOST_SystemWin32 *system = (GHOST_SystemWin32 *) getSystem();
-       
+
        system->getCursorPosition(x_screen, y_screen);
 
        /* TODO: CHECK IF THIS IS A TABLET EVENT */
@@ -856,7 +856,7 @@ void GHOST_SystemWin32::processWheelEvent(GHOST_WindowWin32 *window, WPARAM wPar
 
        int acc = system->m_wheelDeltaAccum;
        int delta = GET_WHEEL_DELTA_WPARAM(wParam);
-       
+
        if (acc * delta < 0) {
                // scroll direction reversed.
                acc = 0;
@@ -864,7 +864,7 @@ void GHOST_SystemWin32::processWheelEvent(GHOST_WindowWin32 *window, WPARAM wPar
        acc += delta;
        int direction = (acc >= 0) ? 1 : -1;
        acc = abs(acc);
-       
+
        while (acc >= WHEEL_DELTA) {
                system->pushEvent(new GHOST_EventWheel(system->getMilliSeconds(), window, direction));
                acc -= WHEEL_DELTA;
@@ -1178,10 +1178,10 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                 */
                                case WM_DEADCHAR:
                                        /* The WM_DEADCHAR message is posted to the window with the keyboard focus when a
-                                        * WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR 
-                                        * specifies a character code generated by a dead key. A dead key is a key that 
-                                        * generates a character, such as the umlaut (double-dot), that is combined with 
-                                        * another character to form a composite character. For example, the umlaut-O 
+                                        * WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR
+                                        * specifies a character code generated by a dead key. A dead key is a key that
+                                        * generates a character, such as the umlaut (double-dot), that is combined with
+                                        * another character to form a composite character. For example, the umlaut-O
                                         * character (Ö) is generated by typing the dead key for the umlaut character, and
                                         * then typing the O key.
                                         */
@@ -1193,16 +1193,16 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                 * a dead key that is pressed while holding down the alt key.
                                 */
                                case WM_SYSCHAR:
-                                       /* The WM_SYSCHAR message is sent to the window with the keyboard focus when 
-                                        * a WM_SYSCHAR message is translated by the TranslateMessage function. 
-                                        * WM_SYSCHAR specifies the character code of a dead key - that is, 
+                                       /* The WM_SYSCHAR message is sent to the window with the keyboard focus when
+                                        * a WM_SYSCHAR message is translated by the TranslateMessage function.
+                                        * WM_SYSCHAR specifies the character code of a dead key - that is,
                                         * a dead key that is pressed while holding down the alt key.
                                         * To prevent the sound, DefWindowProc must be avoided by return
                                         */
                                        break;
                                case WM_SYSCOMMAND:
-                                       /* The WM_SYSCHAR message is sent to the window when system commands such as 
-                                        * maximize, minimize  or close the window are triggered. Also it is sent when ALT 
+                                       /* The WM_SYSCHAR message is sent to the window when system commands such as
+                                        * maximize, minimize  or close the window are triggered. Also it is sent when ALT
                                         * button is press for menu. To prevent this we must return preventing DefWindowProc.
                                         */
                                        if (wParam == SC_KEYMENU) {
@@ -1269,11 +1269,11 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                        break;
                                case WM_MOUSEWHEEL:
                                {
-                                       /* The WM_MOUSEWHEEL message is sent to the focus window 
-                                        * when the mouse wheel is rotated. The DefWindowProc 
+                                       /* The WM_MOUSEWHEEL message is sent to the focus window
+                                        * when the mouse wheel is rotated. The DefWindowProc
                                         * function propagates the message to the window's parent.
-                                        * There should be no internal forwarding of the message, 
-                                        * since DefWindowProc propagates it up the parent chain 
+                                        * There should be no internal forwarding of the message,
+                                        * since DefWindowProc propagates it up the parent chain
                                         * until it finds a window that processes it.
                                         */
 
@@ -1281,7 +1281,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                        POINT mouse_pos = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
                                        HWND mouse_hwnd = ChildWindowFromPoint(HWND_DESKTOP, mouse_pos);
                                        GHOST_WindowWin32 *mouse_window = (GHOST_WindowWin32 *)::GetWindowLongPtr(mouse_hwnd, GWLP_USERDATA);
-                                       
+
                                        processWheelEvent(mouse_window ? mouse_window : window , wParam, lParam);
                                        eventHandled = true;
 #ifdef BROKEN_PEEK_TOUCHPAD
@@ -1293,7 +1293,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                        /* The WM_SETCURSOR message is sent to a window if the mouse causes the cursor
                                         * to move within a window and mouse input is not captured.
                                         * This means we have to set the cursor shape every time the mouse moves!
-                                        * The DefWindowProc function uses this message to set the cursor to an 
+                                        * The DefWindowProc function uses this message to set the cursor to an
                                         * arrow if it is not in the client area.
                                         */
                                        if (LOWORD(lParam) == HTCLIENT) {
@@ -1301,7 +1301,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                                window->loadCursor(window->getCursorVisibility(), window->getCursorShape());
                                                // Bypass call to DefWindowProc
                                                return 0;
-                                       } 
+                                       }
                                        else {
                                                // Outside of client area show standard cursor
                                                window->loadCursor(true, GHOST_kStandardCursorDefault);
@@ -1317,10 +1317,10 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                 * that contains the cursor. If a window has captured the mouse, this message is not posted.
                                 */
                                case WM_NCHITTEST:
-                                       /* The WM_NCHITTEST message is sent to a window when the cursor moves, or 
-                                        * when a mouse button is pressed or released. If the mouse is not captured, 
-                                        * the message is sent to the window beneath the cursor. Otherwise, the message 
-                                        * is sent to the window that has captured the mouse. 
+                                       /* The WM_NCHITTEST message is sent to a window when the cursor moves, or
+                                        * when a mouse button is pressed or released. If the mouse is not captured,
+                                        * the message is sent to the window beneath the cursor. Otherwise, the message
+                                        * is sent to the window that has captured the mouse.
                                         */
                                        break;
 
@@ -1332,11 +1332,11 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                        event = processWindowEvent(GHOST_kEventWindowClose, window);
                                        break;
                                case WM_ACTIVATE:
-                                       /* The WM_ACTIVATE message is sent to both the window being activated and the window being 
-                                        * deactivated. If the windows use the same input queue, the message is sent synchronously, 
+                                       /* The WM_ACTIVATE message is sent to both the window being activated and the window being
+                                        * deactivated. If the windows use the same input queue, the message is sent synchronously,
                                         * first to the window procedure of the top-level window being deactivated, then to the window
                                         * procedure of the top-level window being activated. If the windows use different input queues,
-                                        * the message is sent asynchronously, so the window is activated immediately. 
+                                        * the message is sent asynchronously, so the window is activated immediately.
                                         */
                                {
                                        GHOST_ModifierKeys modifiers;
@@ -1353,12 +1353,12 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                        break;
                                }
                                case WM_ENTERSIZEMOVE:
-                                       /* The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving 
-                                        * or sizing modal loop. The window enters the moving or sizing modal loop when the user 
-                                        * clicks the window's title bar or sizing border, or when the window passes the 
-                                        * WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the 
-                                        * message specifies the SC_MOVE or SC_SIZE value. The operation is complete when 
-                                        * DefWindowProc returns. 
+                                       /* The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving
+                                        * or sizing modal loop. The window enters the moving or sizing modal loop when the user
+                                        * clicks the window's title bar or sizing border, or when the window passes the
+                                        * WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the
+                                        * message specifies the SC_MOVE or SC_SIZE value. The operation is complete when
+                                        * DefWindowProc returns.
                                         */
                                        window->m_inLiveResize = 1;
                                        break;
@@ -1366,11 +1366,11 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                        window->m_inLiveResize = 0;
                                        break;
                                case WM_PAINT:
-                                       /* An application sends the WM_PAINT message when the system or another application 
+                                       /* An application sends the WM_PAINT message when the system or another application
                                         * makes a request to paint a portion of an application's window. The message is sent
-                                        * when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage 
-                                        * function when the application obtains a WM_PAINT message by using the GetMessage or 
-                                        * PeekMessage function. 
+                                        * when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage
+                                        * function when the application obtains a WM_PAINT message by using the GetMessage or
+                                        * PeekMessage function.
                                         */
                                        if (!window->m_inLiveResize) {
                                                event = processWindowEvent(GHOST_kEventWindowUpdate, window);
@@ -1381,10 +1381,10 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                        }
                                        break;
                                case WM_GETMINMAXINFO:
-                                       /* The WM_GETMINMAXINFO message is sent to a window when the size or 
-                                        * position of the window is about to change. An application can use 
-                                        * this message to override the window's default maximized size and 
-                                        * position, or its default minimum or maximum tracking size. 
+                                       /* The WM_GETMINMAXINFO message is sent to a window when the size or
+                                        * position of the window is about to change. An application can use
+                                        * this message to override the window's default maximized size and
+                                        * position, or its default minimum or maximum tracking size.
                                         */
                                        processMinMaxInfo((MINMAXINFO *) lParam);
                                        /* Let DefWindowProc handle it. */
@@ -1392,9 +1392,9 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                case WM_SIZING:
                                case WM_SIZE:
                                        /* The WM_SIZE message is sent to a window after its size has changed.
-                                        * The WM_SIZE and WM_MOVE messages are not sent if an application handles the 
+                                        * The WM_SIZE and WM_MOVE messages are not sent if an application handles the
                                         * WM_WINDOWPOSCHANGED message without calling DefWindowProc. It is more efficient
-                                        * to perform any move or size change processing during the WM_WINDOWPOSCHANGED 
+                                        * to perform any move or size change processing during the WM_WINDOWPOSCHANGED
                                         * message without calling DefWindowProc.
                                         */
                                        /* we get first WM_SIZE before we fully init. So, do not dispatch before we continiously resizng */
@@ -1415,10 +1415,10 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                         * and, if needed, change its size or position.
                                         */
                                case WM_MOVE:
-                                       /* The WM_SIZE and WM_MOVE messages are not sent if an application handles the 
+                                       /* The WM_SIZE and WM_MOVE messages are not sent if an application handles the
                                         * WM_WINDOWPOSCHANGED message without calling DefWindowProc. It is more efficient
-                                        * to perform any move or size change processing during the WM_WINDOWPOSCHANGED 
-                                        * message without calling DefWindowProc. 
+                                        * to perform any move or size change processing during the WM_WINDOWPOSCHANGED
+                                        * message without calling DefWindowProc.
                                         */
                                        /* see WM_SIZE comment*/
                                        if (window->m_inLiveResize) {
@@ -1487,13 +1487,13 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                 * that all child windows still exist.
                                 */
                                case WM_NCDESTROY:
-                                       /* The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The 
+                                       /* The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The
                                         * DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY
-                                        * message. WM_DESTROY is used to free the allocated memory object associated with the window. 
+                                        * message. WM_DESTROY is used to free the allocated memory object associated with the window.
                                         */
                                        break;
                                case WM_KILLFOCUS:
-                                       /* The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus. 
+                                       /* The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus.
                                         * We want to prevent this if a window is still active and it loses focus to nowhere*/
                                        if (!wParam && hwnd == ::GetActiveWindow())
                                                ::SetFocus(hwnd);
@@ -1526,7 +1526,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
                                         * when a timer expires. You can process the message by providing a WM_TIMER
                                         * case in the window procedure. Otherwise, the default window procedure will
                                         * call the TimerProc callback function specified in the call to the SetTimer
-                                        * function used to install the timer. 
+                                        * function used to install the timer.
                                         *
                                         * In GHOST, we let DefWindowProc call the timer callback.
                                         */
@@ -1565,7 +1565,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
 GHOST_TUns8 *GHOST_SystemWin32::getClipboard(bool selection) const
 {
        char *temp_buff;
-       
+
        if (IsClipboardFormatAvailable(CF_UNICODETEXT) && OpenClipboard(NULL) ) {
                wchar_t *buffer;
                HANDLE hData = GetClipboardData(CF_UNICODETEXT);
@@ -1578,14 +1578,14 @@ GHOST_TUns8 *GHOST_SystemWin32::getClipboard(bool selection) const
                        CloseClipboard();
                        return NULL;
                }
-               
+
                temp_buff = alloc_utf_8_from_16(buffer, 0);
-               
+
                /* Buffer mustn't be accessed after CloseClipboard
                 * it would like accessing free-d memory */
                GlobalUnlock(hData);
                CloseClipboard();
-               
+
                return (GHOST_TUns8 *)temp_buff;
        }
        else if (IsClipboardFormatAvailable(CF_TEXT) && OpenClipboard(NULL) ) {
@@ -1601,17 +1601,17 @@ GHOST_TUns8 *GHOST_SystemWin32::getClipboard(bool selection) const
                        CloseClipboard();
                        return NULL;
                }
-               
+
                len = strlen(buffer);
                temp_buff = (char *) malloc(len + 1);
                strncpy(temp_buff, buffer, len);
                temp_buff[len] = '\0';
-               
+
                /* Buffer mustn't be accessed after CloseClipboard
                 * it would like accessing free-d memory */
                GlobalUnlock(hData);
                CloseClipboard();
-               
+
                return (GHOST_TUns8 *)temp_buff;
        }
        else {
@@ -1626,11 +1626,11 @@ void GHOST_SystemWin32::putClipboard(GHOST_TInt8 *buffer, bool selection) const
        if (OpenClipboard(NULL)) {
                HLOCAL clipbuffer;
                wchar_t *data;
-               
+
                if (buffer) {
                        size_t len = count_utf_16_from_8(buffer);
                        EmptyClipboard();
-                       
+
                        clipbuffer = LocalAlloc(LMEM_FIXED, sizeof(wchar_t) * len);
                        data = (wchar_t *)GlobalLock(clipbuffer);
 
@@ -1686,7 +1686,7 @@ static bool getProcessName(int pid, char *buffer, int max_len)
 static bool isStartedFromCommandPrompt()
 {
        HWND hwnd = GetConsoleWindow();
-       
+
        if (hwnd) {
                DWORD pid = (DWORD)-1;
                DWORD ppid = GetParentProcessID();
index 0f15f91..e1fd82e 100644 (file)
@@ -110,7 +110,7 @@ public:
 
        /**
         * Create a new window.
-        * The new window is added to the list of windows managed. 
+        * The new window is added to the list of windows managed.
         * Never explicitly delete the window, use disposeWindow() instead.
         * \param       title   The name of the window (displayed in the title bar of the window if the OS supports it).
         * \param       left    The coordinate of the left edge of the window.
@@ -157,7 +157,7 @@ public:
         * \return Indication of the presence of events.
         */
        bool processEvents(bool waitForEvent);
-       
+
 
        /***************************************************************************************
         ** Cursor management functionality
@@ -203,7 +203,7 @@ public:
         * \return                              Returns the Clipboard
         */
        GHOST_TUns8 *getClipboard(bool selection) const;
-       
+
        /**
         * Puts buffer to system clipboard
         * \param selection             Used by X11 only
@@ -212,7 +212,7 @@ public:
        void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
 
        /**
-        * Creates a drag'n'drop event and pushes it immediately onto the event queue. 
+        * Creates a drag'n'drop event and pushes it immediately onto the event queue.
         * Called by GHOST_DropTargetWin32 class.
         * \param eventType The type of drag'n'drop event
         * \param draggedObjectType The type object concerned (currently array of file names, string, ?bitmap)
@@ -222,7 +222,7 @@ public:
         * \return Indication whether the event was handled.
         */
        static GHOST_TSuccess pushDragDropEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType, GHOST_WindowWin32 *window, int mouseX, int mouseY, void *data);
-       
+
        /**
         * Confirms quitting he program when there is just one window left open
         * in the application
@@ -242,7 +242,7 @@ protected:
         * \return A success value.
         */
        GHOST_TSuccess exit();
-       
+
        /**
         * Converts raw WIN32 key codes from the wndproc to GHOST keys.
         * \param vKey          The virtual key from hardKey
@@ -303,7 +303,7 @@ protected:
         */
        GHOST_TKey processSpecialKey(short vKey, short scanCode) const;
 
-       /** 
+       /**
         * Creates a window event.
         * \param type          The type of event to create.
         * \param window        The window receiving the event (the active window).
@@ -351,7 +351,7 @@ protected:
         * param keys The new state of the modifier keys.
         */
        inline void storeModifierKeys(const GHOST_ModifierKeys& keys);
-       
+
        /**
         * Check current key layout for AltGr
         */
@@ -373,7 +373,7 @@ protected:
         * \return current status (1 -visible, 0 - hidden)
         */
        int toggleConsole(int action);
-       
+
        /** The current state of the modifier keys. */
        GHOST_ModifierKeys m_modifierKeys;
        /** State variable set at initialization. */
index 69aa3a0..42bb05c 100644 (file)
@@ -121,7 +121,7 @@ GHOST_SystemX11(
 {
        XInitThreads();
        m_display = XOpenDisplay(NULL);
-       
+
        if (!m_display) {
                std::cerr << "Unable to open a display" << std::endl;
                abort(); /* was return before, but this would just mean it will crash later */
@@ -179,16 +179,16 @@ GHOST_SystemX11(
        if (gettimeofday(&tv, NULL) == -1) {
                GHOST_ASSERT(false, "Could not instantiate timer!");
        }
-       
+
        /* Taking care not to overflow the tv.tv_sec * 1000 */
        m_start_time = GHOST_TUns64(tv.tv_sec) * 1000 + tv.tv_usec / 1000;
-       
-       
+
+
        /* use detectable autorepeate, mac and windows also do this */
        int use_xkb;
        int xkb_opcode, xkb_event, xkb_error;
        int xkb_major = XkbMajorVersion, xkb_minor = XkbMinorVersion;
-       
+
        use_xkb = XkbQueryExtension(m_display, &xkb_opcode, &xkb_event, &xkb_error, &xkb_major, &xkb_minor);
        if (use_xkb) {
                XkbSetDetectableAutoRepeat(m_display, true, NULL);
@@ -244,7 +244,7 @@ GHOST_SystemX11::
        /* close tablet devices */
        if (m_xtablet.StylusDevice)
                XCloseDevice(m_display, m_xtablet.StylusDevice);
-       
+
        if (m_xtablet.EraserDevice)
                XCloseDevice(m_display, m_xtablet.EraserDevice);
 #endif /* WITH_X11_XINPUT */
@@ -285,7 +285,7 @@ getMilliSeconds() const
        /* Taking care not to overflow the tv.tv_sec * 1000 */
        return GHOST_TUns64(tv.tv_sec) * 1000 + tv.tv_usec / 1000 - m_start_time;
 }
-       
+
 GHOST_TUns8
 GHOST_SystemX11::
 getNumDisplays() const
@@ -358,9 +358,9 @@ createWindow(const STR_String& title,
                const GHOST_TEmbedderWindowID parentWindow)
 {
        GHOST_WindowX11 *window = NULL;
-       
+
        if (!m_display) return 0;
-       
+
        window = new GHOST_WindowX11(this, m_display, title,
                                     left, top, width, height,
                                     state, parentWindow, type,
@@ -386,7 +386,7 @@ createWindow(const STR_String& title,
        return window;
 }
 
-bool GHOST_SystemX11::supportsNativeDialogs(void) 
+bool GHOST_SystemX11::supportsNativeDialogs(void)
 {
        return false;
 }
@@ -516,7 +516,7 @@ GHOST_SystemX11::
 findGhostWindow(
                Window xwind) const
 {
-       
+
        if (xwind == 0) return NULL;
 
        /* It is not entirely safe to do this as the backptr may point
@@ -528,7 +528,7 @@ findGhostWindow(
 
        vector<GHOST_IWindow *>::iterator win_it = win_vec.begin();
        vector<GHOST_IWindow *>::const_iterator win_end = win_vec.end();
-       
+
        for (; win_it != win_end; ++win_it) {
                GHOST_WindowX11 *window = static_cast<GHOST_WindowX11 *>(*win_it);
                if (window->getXWindow() == xwind) {
@@ -536,14 +536,14 @@ findGhostWindow(
                }
        }
        return NULL;
-       
+
 }
 
 static void SleepTillEvent(Display *display, GHOST_TInt64 maxSleep)
 {
        int fd = ConnectionNumber(display);
        fd_set fds;
-       
+
        FD_ZERO(&fds);
        FD_SET(fd, &fds);
 
@@ -555,7 +555,7 @@ static void SleepTillEvent(Display *display, GHOST_TInt64 maxSleep)
 
                tv.tv_sec = maxSleep / 1000;
                tv.tv_usec = (maxSleep - tv.tv_sec * 1000) * 1000;
-       
+
                select(fd + 1, &fds, NULL, NULL, &tv);
        }
 }
@@ -618,15 +618,15 @@ processEvents(
 {
        /* Get all the current events -- translate them into
         * ghost events and call base class pushEvent() method. */
-       
+
        bool anyProcessed = false;
-       
+
        do {
                GHOST_TimerManager *timerMgr = getTimerManager();
-               
+
                if (waitForEvent && m_dirty_windows.empty() && !XPending(m_display)) {
                        GHOST_TUns64 next = timerMgr->nextFireTime();
-                       
+
                        if (next == GHOST_kFireTimeNever) {
                                SleepTillEvent(m_display, -1);
                        }
@@ -637,11 +637,11 @@ processEvents(
                                        SleepTillEvent(m_display, next - getMilliSeconds());
                        }
                }
-               
+
                if (timerMgr->fireTimers(getMilliSeconds())) {
                        anyProcessed = true;
                }
-               
+
                while (XPending(m_display)) {
                        XEvent xevent;
                        XNextEvent(m_display, &xevent);
@@ -738,7 +738,7 @@ processEvents(
 #endif  /* USE_UNITY_WORKAROUND */
 
                }
-               
+
                if (generateWindowExposeEvents()) {
                        anyProcessed = true;
                }
@@ -748,9 +748,9 @@ processEvents(
                        anyProcessed = true;
                }
 #endif
-               
+
        } while (waitForEvent && !anyProcessed);
-       
+
        return anyProcessed;
 }
 
@@ -971,7 +971,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
 #else
                        char *utf8_buf = NULL;
 #endif
-                       
+
                        GHOST_TEventType type = (xke->type == KeyPress) ?  GHOST_kEventKeyDown : GHOST_kEventKeyUp;
 
                        GHOST_TKey gkey;
@@ -1084,7 +1084,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                        }
 
                        gkey = convertXKey(key_sym);
-                       
+
                        if (!XLookupString(xke, &ascii, 1, NULL, NULL)) {
                                ascii = '\0';
                        }
@@ -1178,7 +1178,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                        if (utf8_buf != utf8_array)
                                free(utf8_buf);
 #endif
-                       
+
                        break;
                }
 
@@ -1187,7 +1187,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                {
                        XButtonEvent & xbe = xe->xbutton;
                        GHOST_TButtonMask gbmask = GHOST_kButtonMaskLeft;
-                       GHOST_TEventType type = (xbe.type == ButtonPress) ? 
+                       GHOST_TEventType type = (xbe.type == ButtonPress) ?
                                                GHOST_kEventButtonDown : GHOST_kEventButtonUp;
 
                        /* process wheel mouse events and break, only pass on press events */
@@ -1201,7 +1201,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                                        g_event = new GHOST_EventWheel(getMilliSeconds(), window, -1);
                                break;
                        }
-                       
+
                        /* process rest of normal mouse buttons */
                        if (xbe.button == Button1)
                                gbmask = GHOST_kButtonMaskLeft;
@@ -1233,13 +1233,13 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                            );
                        break;
                }
-                       
+
                /* change of size, border, layer etc. */
                case ConfigureNotify:
                {
                        /* XConfigureEvent & xce = xe->xconfigure; */
 
-                       g_event = new 
+                       g_event = new
                                  GHOST_Event(
                            getMilliSeconds(),
                            GHOST_kEventWindowSize,
@@ -1255,10 +1255,10 @@ GHOST_SystemX11::processEvent(XEvent *xe)
 
                        /* TODO: make sure this is the correct place for activate/deactivate */
                        // printf("X: focus %s for window %d\n", xfe.type == FocusIn ? "in" : "out", (int) xfe.window);
-               
+
                        /* May have to look at the type of event and filter some out. */
 
-                       GHOST_TEventType gtype = (xfe.type == FocusIn) ? 
+                       GHOST_TEventType gtype = (xfe.type == FocusIn) ?
                                                 GHOST_kEventWindowActivate : GHOST_kEventWindowDeactivate;
 
 #if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
@@ -1271,7 +1271,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                        }
 #endif
 
-                       g_event = new 
+                       g_event = new
                                  GHOST_Event(
                            getMilliSeconds(),
                            gtype,
@@ -1285,7 +1285,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                        XClientMessageEvent & xcme = xe->xclient;
 
                        if (((Atom)xcme.data.l[0]) == m_atom.WM_DELETE_WINDOW) {
-                               g_event = new 
+                               g_event = new
                                          GHOST_Event(
                                    getMilliSeconds(),
                                    GHOST_kEventWindowClose,
@@ -1329,14 +1329,14 @@ GHOST_SystemX11::processEvent(XEvent *xe)
 
                        break;
                }
-               
+
                case DestroyNotify:
                        ::exit(-1);
                /* We're not interested in the following things.(yet...) */
                case NoExpose:
                case GraphicsExpose:
                        break;
-               
+
                case EnterNotify:
                case LeaveNotify:
                {
@@ -1349,7 +1349,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                         */
                        XCrossingEvent &xce = xe->xcrossing;
                        if (xce.mode == NotifyNormal) {
-                               g_event = new 
+                               g_event = new
                                          GHOST_EventCursor(
                                    getMilliSeconds(),
                                    GHOST_kEventCursorMove,
@@ -1397,18 +1397,18 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                        XEvent nxe;
                        Atom target, utf8_string, string, compound_text, c_string;
                        XSelectionRequestEvent *xse = &xe->xselectionrequest;
-                       
+
                        target = XInternAtom(m_display, "TARGETS", False);
                        utf8_string = XInternAtom(m_display, "UTF8_STRING", False);
                        string = XInternAtom(m_display, "STRING", False);
                        compound_text = XInternAtom(m_display, "COMPOUND_TEXT", False);
                        c_string = XInternAtom(m_display, "C_STRING", False);
-                       
+
                        /* support obsolete clients */
                        if (xse->property == None) {
                                xse->property = xse->target;
                        }
-                       
+
                        nxe.xselection.type = SelectionNotify;
                        nxe.xselection.requestor = xse->requestor;
                        nxe.xselection.property = xse->property;
@@ -1416,7 +1416,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                        nxe.xselection.selection = xse->selection;
                        nxe.xselection.target = xse->target;
                        nxe.xselection.time = xse->time;
-                       
+
                        /* Check to see if the requestor is asking for String */
                        if (xse->target == utf8_string ||
                            xse->target == string ||
@@ -1447,13 +1447,13 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                                /* Change property to None because we do not support anything but STRING */
                                nxe.xselection.property = None;
                        }
-                       
+
                        /* Send the event to the client 0 0 == False, SelectionNotify */
                        XSendEvent(m_display, xse->requestor, 0, 0, &nxe);
                        XFlush(m_display);
                        break;
                }
-               
+
                default:
                {
 #ifdef WITH_X11_XINPUT
@@ -1584,7 +1584,7 @@ getButtons(
        }
        else {
                return GHOST_kFailure;
-       }       
+       }
 
        return GHOST_kSuccess;
 }
@@ -1688,7 +1688,7 @@ setCursorPosition(
 #endif
 
        XSync(m_display, 0); /* Sync to process all requests */
-       
+
        return GHOST_kSuccess;
 }
 
@@ -1699,7 +1699,7 @@ addDirtyWindow(
                GHOST_WindowX11 *bad_wind)
 {
        GHOST_ASSERT((bad_wind != NULL), "addDirtyWindow() NULL ptr trapped (window)");
-       
+
        m_dirty_windows.push_back(bad_wind);
 }
 
@@ -1711,7 +1711,7 @@ generateWindowExposeEvents()
        vector<GHOST_WindowX11 *>::iterator w_start = m_dirty_windows.begin();
        vector<GHOST_WindowX11 *>::const_iterator w_end = m_dirty_windows.end();
        bool anyProcessed = false;
-       
+
        for (; w_start != w_end; ++w_start) {
                GHOST_Event *g_event = new
                                       GHOST_Event(
@@ -1721,7 +1721,7 @@ generateWindowExposeEvents()
                    );
 
                (*w_start)->validate();
-               
+
                if (g_event) {
                        pushEvent(g_event);
                        anyProcessed = true;
@@ -2110,12 +2110,12 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
                unsigned char *tmp_data = (unsigned char *) malloc(sel_len + 1);
                memcpy((char *)tmp_data, (char *)sel_buf, sel_len);
                tmp_data[sel_len] = '\0';
-               
+
                if (sseln == m_atom.STRING)
                        XFree(sel_buf);
                else
                        free(sel_buf);
-               
+
                return tmp_data;
        }
        return(NULL);
@@ -2156,7 +2156,7 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
 }
 
 #ifdef WITH_XDND
-GHOST_TSuccess GHOST_SystemX11::pushDragDropEvent(GHOST_TEventType eventType, 
+GHOST_TSuccess GHOST_SystemX11::pushDragDropEvent(GHOST_TEventType eventType,
                GHOST_TDragnDropTypes draggedObjectType,
                GHOST_IWindow *window,
                int mouseX, int mouseY,
@@ -2322,7 +2322,7 @@ void GHOST_SystemX11::refreshXInputDevices()
 
                        for (int i = 0; i < device_count; ++i) {
                                char *device_type = device_info[i].type ? XGetAtomName(m_display, device_info[i].type) : NULL;
-                               
+
 //                             printf("Tablet type:'%s', name:'%s', index:%d\n", device_type, device_info[i].name, i);
 
 
@@ -2355,7 +2355,7 @@ void GHOST_SystemX11::refreshXInputDevices()
 
                                                                break;
                                                        }
-                                               
+
                                                        ici = (XAnyClassPtr)(((char *)ici) + ici->length);
                                                }
                                        }
index b910589..f279cf5 100644 (file)
@@ -86,7 +86,7 @@ public:
 
        GHOST_SystemX11(
            );
-       
+
        /**
         * Destructor.
         */
@@ -114,7 +114,7 @@ public:
        GHOST_TUns64
        getMilliSeconds(
            ) const;
-       
+
 
        /**
         * Returns the number of displays on this system.
@@ -146,7 +146,7 @@ public:
 
        /**
         * Create a new window.
-        * The new window is added to the list of windows managed. 
+        * The new window is added to the list of windows managed.
         * Never explicitly delete the window, use disposeWindow() instead.
         * \param       title   The name of the window (displayed in the title bar of the window if the OS supports it).
         * \param       left            The coordinate of the left edge of the window.
@@ -210,7 +210,7 @@ public:
            GHOST_TInt32& x,
            GHOST_TInt32& y
            ) const;
-       
+
        GHOST_TSuccess
        setCursorPosition(
            GHOST_TInt32 x,
@@ -239,15 +239,15 @@ public:
 
        /**
         * Flag a window as dirty. This will
-        * generate a GHOST window update event on a call to processEvents() 
+        * generate a GHOST window update event on a call to processEvents()
         */
 
        void
        addDirtyWindow(
            GHOST_WindowX11 *bad_wind
            );
-  
+
+
        /**
         * return a pointer to the X11 display structure
         */
@@ -256,7 +256,7 @@ public:
        getXDisplay(
                ) {
                return m_display;
-       }       
+       }
 
 #if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
        XIM
@@ -277,7 +277,7 @@ public:
         * \return                              Returns the Clipboard indicated by Flag
         */
        GHOST_TUns8 *getClipboard(bool selection) const;
-       
+
        /**
         * Puts buffer to system clipboard
         * \param buffer        The buffer to copy to the clipboard
@@ -287,14 +287,14 @@ public:
 
 #ifdef WITH_XDND
        /**
-        * Creates a drag'n'drop event and pushes it immediately onto the event queue. 
+        * Creates a drag'n'drop event and pushes it immediately onto the event queue.
         * Called by GHOST_DropTargetX11 class.
         * \param eventType The type of drag'n'drop event
         * \param draggedObjectType The type object concerned (currently array of file names, string, ?bitmap)
         * \param mouseX x mouse coordinate (in window coordinates)
         * \param mouseY y mouse coordinate
         * \param window The window on which the event occurred
-        * \return Indication whether the event was handled. 
+        * \return Indication whether the event was handled.
         */
        static GHOST_TSuccess pushDragDropEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType, GHOST_IWindow *window, int mouseX, int mouseY, void *data);
 #endif
index 0ef7175..f65207a 100644 (file)
@@ -87,7 +87,7 @@ typedef enum TBPFLAG {
        TBPF_PAUSED = 0x8,
 } TBPFLAG;
 
-#define THBN_CLICKED  0x1800   
+#define THBN_CLICKED  0x1800
 
 extern "C" {
        const GUID IID_ITaskList3 = {0xEA1AFB91, 0x9E28, 0x4B86, {0x90, 0xE9, 0x9E, 0x9F, 0x8A, 0x5E, 0xEF, 0xAF}};
index b47068d..2ef82dc 100644 (file)
@@ -127,4 +127,4 @@ void GHOST_TaskBarX11::set_progress_enabled(bool enabled)
        assert(is_valid());
        unity_set_progress_visible(handle, enabled ? 1 : 0);
        unity_event_loop(NULL, 0);
-}
\ No newline at end of file
+}
index f6ec9d3..1918fc2 100644 (file)
@@ -102,14 +102,14 @@ GHOST_TUns64 GHOST_TimerManager::nextFireTime()
 {
        GHOST_TUns64 smallest = GHOST_kFireTimeNever;
        TTimerVector::iterator iter;
-       
+
        for (iter = m_timers.begin(); iter != m_timers.end(); ++iter) {
                GHOST_TUns64 next = (*iter)->getNext();
-               
+
                if (next < smallest)
                        smallest = next;
        }
-       
+
        return smallest;
 }
 
index 6cf4bcf..78026a7 100644 (file)
@@ -90,11 +90,11 @@ public:
 
        /**
         * Finds the soonest time the next timer would fire.
-        * \return The soonest time the next timer would fire, 
+        * \return The soonest time the next timer would fire,
         * or GHOST_kFireTimeNever if no timers exist.
         */
        GHOST_TUns64 nextFireTime();
-       
+
        /**
         * Checks all timer tasks to see if they are expired and fires them if needed.
         * \param time The current time.
index 45aa66e..fa35fd1 100644 (file)
@@ -78,7 +78,7 @@ public:
         * \param start The timer start time.
         */
        void setStart(GHOST_TUns64 start)
-       { 
+       {
                m_start = start;
        }
 
@@ -96,7 +96,7 @@ public:
         * \param interval The timer interval.
         */
        void setInterval(GHOST_TUns64 interval)
-       { 
+       {
                m_interval = interval;
        }
 
@@ -114,7 +114,7 @@ public:
         * \param next The time the timerProc will be called.
         */
        void setNext(GHOST_TUns64 next)
-       { 
+       {
                m_next = next;
        }
 
@@ -144,7 +144,7 @@ public:
        {
                return m_userData;
        }
-       
+
        /**
         * Changes the time user data.
         * \param userData: The timer user data.
@@ -168,7 +168,7 @@ public:
         * \param auxData The auxiliary storage room.
         */
        void setAuxData(GHOST_TUns32 auxData)
-       { 
+       {
                m_auxData = auxData;
        }
 
index 71fa260..6596028 100644 (file)
@@ -58,12 +58,12 @@ GHOST_Window::GHOST_Window(
 {
        m_isUnsavedChanges = false;
        m_canAcceptDragOperation = false;
-       
+
        m_progressBarVisible = false;
-       
+
        m_cursorGrabAccumPos[0] = 0;
        m_cursorGrabAccumPos[1] = 0;
-       
+
        m_nativePixelSize = 1.0f;
 
        m_fullScreen = state == GHOST_kWindowStateFullScreen;
@@ -208,7 +208,7 @@ GHOST_TSuccess GHOST_Window::setCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHO
                                    16, 16, hotX, hotY, 0, 1);
 }
 
-GHOST_TSuccess GHOST_Window::setCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, 
+GHOST_TSuccess GHOST_Window::setCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask,
                                                   int sizex, int sizey, int hotX, int hotY,
                                                   int fg_color, int bg_color)
 {
@@ -234,7 +234,7 @@ bool GHOST_Window::canAcceptDragOperation() const
 GHOST_TSuccess GHOST_Window::setModifiedState(bool isUnsavedChanges)
 {
        m_isUnsavedChanges = isUnsavedChanges;
-       
+
        return GHOST_kSuccess;
 }
 
index 2798bdf..413a331 100644 (file)
@@ -40,7 +40,7 @@ class GHOST_Context;
 
 /**
  * Platform independent implementation of GHOST_IWindow.
- * Dimensions are given in screen coordinates that are relative to the 
+ * Dimensions are given in screen coordinates that are relative to the
  * upper-left corner of the screen.
  * Implements part of the GHOST_IWindow interface and adds some methods to
  * be implemented by childs of this class.
@@ -94,7 +94,7 @@ public:
         * virtual GHOST_TSuccess activateDrawingContext() = 0;
         * virtual GHOST_TSuccess invalidate() = 0;
         */
-        
+
        /**
         * Destructor.
         * Closes the window and disposes resources allocated.
@@ -105,7 +105,7 @@ public:
         * Returns indication as to whether the window is valid.
         * \return The validity of the window.
         */
-       virtual bool getValid() const { 
+       virtual bool getValid() const {
                return m_context != NULL;
        }
 
@@ -114,7 +114,7 @@ public:
         * \return The associated OS object/handle
         */
        virtual void *getOSWindow() const;
-       
+
        /**
         * Returns the current cursor shape.
         * \return      The current cursor shape.
@@ -185,14 +185,14 @@ public:
        virtual GHOST_TSuccess setProgressBar(float /*progress*/) {
                return GHOST_kFailure;
        }
-       
+
        /**
         * Hides the progress bar in the icon
         */
        virtual GHOST_TSuccess endProgressBar() {
                return GHOST_kFailure;
        }
-       
+
        /**
         * Sets the swap interval for swapBuffers.
         * \param interval The swap interval to use.
@@ -216,26 +216,26 @@ public:
         * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
         */
        void setAcceptDragOperation(bool canAccept);
-       
+
        /**
         * Returns acceptance of the dropped object
         * Usually called by the "object dropped" event handling function
         */
        bool canAcceptDragOperation() const;
-       
+
        /**
         * Sets the window "modified" status, indicating unsaved changes
         * \param isUnsavedChanges Unsaved changes or not
         * \return Indication of success.
         */
        virtual GHOST_TSuccess setModifiedState(bool isUnsavedChanges);
-       
+
        /**
         * Gets the window "modified" status, indicating unsaved changes
         * \return True if there are unsaved changes
         */
        virtual bool getModifiedState();
-       
+
        /**
         * Returns the type of drawing context used in this window.
         * \return The current type of drawing context.
@@ -278,7 +278,7 @@ public:
        {
                return m_userData;
        }
-       
+
        /**
         * Changes the window user data.
         * \param userData: The window user data.
@@ -287,7 +287,7 @@ public:
        {
                m_userData = userData;
        }
-       
+
        float getNativePixelSize(void)
        {
                if (m_nativePixelSize > 0.0f)
@@ -341,7 +341,7 @@ protected:
        virtual GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode /*mode*/) {
                return GHOST_kSuccess;
        }
-       
+
        /**
         * Sets the cursor shape on the window using
         * native window system calls.
@@ -355,15 +355,15 @@ protected:
        virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2],
                                                          GHOST_TUns8 mask[16][2],
                                                          int hotX, int hotY) = 0;
-       
-       virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, 
+
+       virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask,
                                                          int szx, int szy, int hotX, int hotY, int fg, int bg) = 0;
 
        GHOST_TSuccess releaseNativeHandles();
 
        /** The drawing context installed in this window. */
        GHOST_TDrawingContextType m_drawingContextType;
-       
+
        /** The window user data */
        GHOST_TUserDataPtr m_userData;
 
@@ -384,16 +384,16 @@ protected:
 
        /** The current shape of the cursor */
        GHOST_TStandardCursor m_cursorShape;
-    
+
        /** The presence of progress indicator with the application icon */
        bool m_progressBarVisible;
-       
+
        /** The acceptance of the "drop candidate" of the current drag'n'drop operation */
        bool m_canAcceptDragOperation;
-       
+
        /** Modified state : are there unsaved changes */
        bool m_isUnsavedChanges;
-       
+
        /** Stores whether this is a full screen window. */
        bool m_fullScreen;
 
@@ -407,7 +407,7 @@ protected:
        GHOST_TUns32 m_fullScreenWidth;
        /** Full-screen height */
        GHOST_TUns32 m_fullScreenHeight;
-       
+
        /* OSX only, retina screens */
        float m_nativePixelSize;
 
index 9dbc85d..54ecd2b 100644 (file)
@@ -89,7 +89,7 @@ public:
         * \return The validity of the window.
         */
        bool getValid() const;
-       
+
        /**
         * Returns the associated NSWindow object
         * \return The associated NSWindow object
@@ -110,11 +110,11 @@ public:
 
        /**
         * Returns the window rectangle dimensions.
-        * The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen. 
+        * The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
         * \param bounds The bounding rectangle of the window.
         */
        void getWindowBounds(GHOST_Rect& bounds) const;
-       
+
        /**
         * Returns the client rectangle dimensions.
         * The left and top members of the rectangle are always zero.
@@ -153,7 +153,7 @@ public:
         * \return Indication of success.
         */
        GHOST_TSuccess setModifiedState(bool isUnsavedChanges);
-       
+
        /**
         * Converts a point in screen coordinates to client rectangle coordinates
         * \param inX   The x-coordinate on the screen.
@@ -197,7 +197,7 @@ public:
         * \return The NSScreen object
         */
        NSScreen *getScreen();
-       
+
        /**
         * Sets the state of the window (normal, minimized, maximized).
         * \param state The state of the window.
@@ -213,7 +213,7 @@ public:
        GHOST_TSuccess setOrder(GHOST_TWindowOrder order);
 
        void loadCursor(bool visible, GHOST_TStandardCursor cursor) const;
-    
+
        const GHOST_TabletData *GetTabletData()
        {
                return &m_tablet;
@@ -223,32 +223,32 @@ public:
        {
                return m_tablet;
        }
-       
+
        /**
         * Sets the progress bar value displayed in the window/application icon
         * \param progress The progress % (0.0 to 1.0)
         */
        GHOST_TSuccess setProgressBar(float progress);
-       
+
        /**
         * Hides the progress bar icon
         */
        GHOST_TSuccess endProgressBar();
-       
-       
+
+
        void setNativePixelSize(void);
 
        GHOST_TSuccess beginFullScreen() const {return GHOST_kFailure;}
 
        GHOST_TSuccess endFullScreen() const {return GHOST_kFailure;}
-       
+
        /** public function to get the window containing the OpenGL view */
        CocoaWindow *getCocoaWindow() const {return m_window;};
 
        /* Internal value to ensure proper redraws during animations */
        void setImmediateDraw(bool value) { m_immediateDraw = value; }
        bool getImmediateDraw(void) const { return m_immediateDraw; }
-       
+
 protected:
 
        /**
@@ -268,13 +268,13 @@ protected:
         * native window system calls.
         */
        GHOST_TSuccess setWindowCursorVisibility(bool visible);
-       
+
        /**
         * Sets the cursor grab on the window using
         * native window system calls.
         */
        GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode);
-               
+
        /**
         * Sets the cursor shape on the window using
         * native window system calls.
@@ -287,14 +287,14 @@ protected:
         */
        GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask,
                                                          int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color);
-                                       
+
        GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY);
 
        /** The window containing the OpenGL view */
        CocoaWindow *m_window;
-       
+
        /** The openGL view */
-       CocoaOpenGLView *m_openGLView; 
+       CocoaOpenGLView *m_openGLView;
 
        /** The mother SystemCocoa class to send events */
        GHOST_SystemCocoa *m_systemCocoa;
index 790c73d..31e1b04 100644 (file)
@@ -42,7 +42,7 @@
 #include "GHOST_Window.h"
 
 
-GHOST_WindowManager::GHOST_WindowManager() : 
+GHOST_WindowManager::GHOST_WindowManager() :
        m_fullScreenWindow(0),
        m_activeWindow(0),
        m_activeWindowBeforeFullScreen(0)
@@ -61,7 +61,7 @@ GHOST_TSuccess GHOST_WindowManager::addWindow(GHOST_IWindow *window)
        GHOST_TSuccess success = GHOST_kFailure;
        if (window) {
                if (!getWindowFound(window)) {
-                       // Store the pointer to the window 
+                       // Store the pointer to the window
                        m_windows.push_back(window);
                        success = GHOST_kSuccess;
                }
@@ -170,7 +170,7 @@ GHOST_TSuccess GHOST_WindowManager::setActiveWindow(GHOST_IWindow *window)
        }
        return success;
 }
-       
+
 
 GHOST_IWindow *GHOST_WindowManager::getActiveWindow(void) const
 {
@@ -200,7 +200,7 @@ GHOST_IWindow *GHOST_WindowManager::getWindowAssociatedWithOSWindow(void *osWind
                if ((*iter)->getOSWindow() == osWindow)
                        return *iter;
        }
-       
+
        return NULL;
 }
 
@@ -208,7 +208,7 @@ bool GHOST_WindowManager::getAnyModifiedState()
 {
        bool isAnyModified = false;
        std::vector<GHOST_IWindow *>::iterator iter;
-       
+
        for (iter = m_windows.begin(); iter != m_windows.end(); ++iter) {
                if ((*iter)->getModifiedState())
                        isAnyModified = true;
index e868a9b..a7dde2a 100644 (file)
@@ -110,38 +110,38 @@ public:
         * \param window The new active window.
         */
        GHOST_TSuccess setActiveWindow(GHOST_IWindow *window);
-       
+
        /**
         * Returns the active window (the window receiving events).
         * There can be only one window active which should be in the current window list.
         * \return window The active window (or NULL if there is none).
         */
        GHOST_IWindow *getActiveWindow(void) const;
-       
+
 
        /**
         * Set this window to be inactive (not receiving events).
         * \param window The window to deactivate.
         */
        void setWindowInactive(const GHOST_IWindow *window);
-       
+
 
        /**
-        * Return a vector of the windows currently managed by this 
-        * class. 
+        * Return a vector of the windows currently managed by this
+        * class.
         * \warning It is very dangerous to mess with the contents of
-        * this vector. Please do not destroy or add windows use the 
+        * this vector. Please do not destroy or add windows use the
         * interface above for this,
         */
        std::vector<GHOST_IWindow *> & getWindows();
-       
+
        /**
         * Finds the window associated with an OS window object/handle
         * \param osWindow The OS window object/handle
         * \return The associated window, null if none corresponds
         */
        GHOST_IWindow *getWindowAssociatedWithOSWindow(void *osWindow);
-       
+
        /**
         * Return true if any windows has a modified status
         * \return True if any window has unsaved changes
@@ -164,7 +164,7 @@ protected:
 #ifdef WITH_CXX_GUARDEDALLOC
        MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_WindowManager")
 #endif
-       
+
 };
 
 #endif // __GHOST_WINDOWMANAGER_H__
index 3c9c7c4..676a29f 100644 (file)
@@ -99,7 +99,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
        if (state != GHOST_kWindowStateFullScreen) {
                RECT rect;
                MONITORINFO monitor;
-               GHOST_TUns32 tw, th; 
+               GHOST_TUns32 tw, th;
 
 #ifndef _MSC_VER
                int cxsizeframe = GetSystemMetrics(SM_CXSIZEFRAME);
@@ -158,7 +158,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
                        width = rect.right - rect.left;
                        height = rect.bottom - rect.top;
                }
-               
+
                wchar_t *title_16 = alloc_utf16_from_8((char *)(const char *)title, 0);
                m_hWnd = ::CreateWindowW(
                        s_windowClassName,          // pointer to registered class name
@@ -225,7 +225,7 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
                        ::ShowWindow(m_hWnd, nCmdShow);
 #ifdef WIN32_COMPOSITING
                        if (alphaBackground && parentwindowhwnd == 0) {
-                               
+
                                HRESULT hr = S_OK;
 
                                // Create and populate the Blur Behind structure
@@ -817,7 +817,7 @@ GHOST_TSuccess GHOST_WindowWin32::setWindowCursorGrab(GHOST_TGrabCursorMode mode
                m_cursorGrabBounds.m_l = m_cursorGrabBounds.m_r = -1; /* disable */
                registerMouseClickEvent(3);
        }
-       
+
        return GHOST_kSuccess;
 }
 
@@ -1041,7 +1041,7 @@ GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(
 
 
 GHOST_TSuccess GHOST_WindowWin32::setProgressBar(float progress)
-{      
+{
        /*SetProgressValue sets state to TBPF_NORMAL automaticly*/
        if (m_Bar && S_OK == m_Bar->SetProgressValue(m_hWnd, 10000 * progress, 10000))
                return GHOST_kSuccess;
index 75a3395..d998e86 100644 (file)
@@ -132,11 +132,11 @@ public:
 
        /**
         * Returns the window rectangle dimensions.
-        * The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen. 
+        * The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
         * \param bounds The bounding rectangle of the window.
         */
        void getWindowBounds(GHOST_Rect& bounds) const;
-       
+
        /**
         * Returns the client rectangle dimensions.
         * The left and top members of the rectangle are always zero.
@@ -211,19 +211,19 @@ public:
         * \param progress The progress %
         */
        GHOST_TSuccess setProgressBar(float progress);
-       
+
        /**
         * Hides the progress bar in the icon
         */
        GHOST_TSuccess endProgressBar();
-       
+
 
        /**
-        * Register a mouse click event (should be called 
+        * Register a mouse click event (should be called
         * for any real button press, controls mouse
         * capturing).
         *
-        * \param press 
+        * \param press
         *              0 - mouse pressed
         *              1 - mouse released
         *              2 - operator grab
@@ -286,14 +286,14 @@ private:
         * native window system calls.
         */
        GHOST_TSuccess setWindowCursorVisibility(bool visible);
-       
+
        /**
         * Sets the cursor grab on the window using native window system calls.
         * Using registerMouseClickEvent.
         * \param mode  GHOST_TGrabCursorMode.
         */
        GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode);
-       
+
        /**
         * Sets the cursor shape on the window using
         * native window system calls.
@@ -318,7 +318,7 @@ private:
            int fg_color,
            int bg_color
            );
-       
+
        /** Pointer to system */
        GHOST_SystemWin32 *m_system;
        /** Pointer to COM IDropTarget implementor */
@@ -330,7 +330,7 @@ private:
 
        /** Flag for if window has captured the mouse */
        bool m_hasMouseCaptured;
-       /** Flag if an operator grabs the mouse with WM_cursor_grab_enable/ungrab() 
+       /** Flag if an operator grabs the mouse with WM_cursor_grab_enable/ungrab()
         * Multiple grabs must be released with a single ungrab */
        bool m_hasGrabMouse;
        /** Count of number of pressed buttons */
index 3c291bd..ade4799 100644 (file)
@@ -204,7 +204,7 @@ static XVisualInfo *x11_visualinfo_from_glx(
                numOfAASamples = 0;
                actualSamples = 0;
        }
-       
+
 #ifdef WITH_X11_ALPHA
        if (   needAlpha
            && glx_version >= 103
@@ -276,7 +276,7 @@ static XVisualInfo *x11_visualinfo_from_glx(
                /* legacy, don't use extension */
                for (;;) {
                        GHOST_X11_GL_GetAttributes(glx_attribs, 64, actualSamples, stereoVisual, needAlpha, false);
-                       
+
                        visual = glXChooseVisual(display, DefaultScreen(display), glx_attribs);
 
                        /* Any sample level or even zero, which means oversampling disabled, is good
@@ -408,7 +408,7 @@ GHOST_WindowX11(GHOST_SystemX11 *system,
                Window root_return;
                int x_return, y_return;
                unsigned int w_return, h_return, border_w_return, depth_return;
-               
+
                XGetGeometry(m_display, parentWindow, &root_return, &x_return, &y_return,
                             &w_return, &h_return, &border_w_return, &depth_return);
 
@@ -430,8 +430,8 @@ GHOST_WindowX11(GHOST_SystemX11 *system,
                        &xattributes);
 
                XSelectInput(m_display, parentWindow, SubstructureNotifyMask);
-               
-       }       
+
+       }
 
 #ifdef WITH_XDND
        /* initialize drop target for newly created window */
@@ -717,12 +717,12 @@ getTitle(
                STR_String& title) const
 {
        char *name = NULL;
-       
+
        XFetchName(m_display, m_window, &name);
        title = name ? name : "untitled";
        XFree(name);
 }
-       
+
 void
 GHOST_WindowX11::
 getWindowBounds(
@@ -742,12 +742,12 @@ getClientBounds(
        int x_return, y_return;
        unsigned int w_return, h_return, border_w_return, depth_return;
        GHOST_TInt32 screen_x, screen_y;
-       
+
        XGetGeometry(m_display, m_window, &root_return, &x_return, &y_return,
                     &w_return, &h_return, &border_w_return, &depth_return);
 
        clientToScreen(0, 0, screen_x, screen_y);
-       
+
        bounds.m_l = screen_x;
        bounds.m_r = bounds.m_l + w_return;
        bounds.m_t = screen_y;
@@ -794,7 +794,7 @@ setClientSize(
        XConfigureWindow(m_display, m_window, value_mask, &values);
        return GHOST_kSuccess;
 
-}      
+}
 
 void
 GHOST_WindowX11::
@@ -818,7 +818,7 @@ screenToClient(
        outX = ax;
        outY = ay;
 }
-                
+
 void
 GHOST_WindowX11::
 clientToScreen(
@@ -1159,7 +1159,7 @@ setOrder(
                GHOST_TWindowOrder order)
 {
        if (order == GHOST_kWindowOrderTop) {
-               XWindowAttributes attr;   
+               XWindowAttributes attr;
                Atom atom;
 
                /* We use both XRaiseWindow and _NET_ACTIVE_WINDOW, since some
@@ -1209,7 +1209,7 @@ setOrder(
        else {
                return GHOST_kFailure;
        }
-       
+
        return GHOST_kSuccess;
 }
 
@@ -1233,8 +1233,8 @@ invalidate()
        if (m_invalid_window == false) {
                m_system->addDirtyWindow(this);
                m_invalid_window = true;
-       } 
+       }
+
        return GHOST_kSuccess;
 }
 
@@ -1242,15 +1242,15 @@ invalidate()
  * called by the X11 system implementation when expose events
  * for the window have been pushed onto the GHOST queue
  */
+
 void
 GHOST_WindowX11::
 validate()
 {
        m_invalid_window = false;
-}      
+}
+
+
 /**
  * Destructor.
  * Closes the window and disposes resources allocated.
@@ -1289,7 +1289,7 @@ GHOST_WindowX11::
                        XSetSelectionOwner(m_display, Clipboard_atom, None, CurrentTime);
                }
        }
-       
+
        if (m_visualInfo) {
                XFree(m_visualInfo);
        }
@@ -1425,13 +1425,13 @@ getStandardCursor(
 
        if (xcursor_id) {
                Cursor xcursor = m_standard_cursors[xcursor_id];
-               
+
                if (!xcursor) {
                        xcursor = XCreateFontCursor(m_display, xcursor_id);
 
                        m_standard_cursors[xcursor_id] = xcursor;
                }
-               
+
                return xcursor;
        }
        else {
@@ -1447,7 +1447,7 @@ getEmptyCursor(
                Pixmap blank;
                XColor dummy = {0};
                char data[1] = {0};
-                       
+
                /* make a blank cursor */
                blank = XCreateBitmapFromData(
                    m_display,
@@ -1468,7 +1468,7 @@ setWindowCursorVisibility(
                bool visible)
 {
        Cursor xcursor;
-       
+
        if (visible) {
                if (m_visible_cursor)
                        xcursor = m_visible_cursor;
@@ -1481,7 +1481,7 @@ setWindowCursorVisibility(
 
        XDefineCursor(m_display, m_window, xcursor);
        XFlush(m_display);
-       
+
        return GHOST_kSuccess;
 }
 
@@ -1544,7 +1544,7 @@ setWindowCursorGrab(
        }
 
        XFlush(m_display);
-       
+
        return GHOST_kSuccess;
 }
 
@@ -1556,7 +1556,7 @@ setWindowCursorShape(
        Cursor xcursor = getStandardCursor(shape);
 
        m_visible_cursor = xcursor;
-       
+
        XDefineCursor(m_display, m_window, xcursor);
        XFlush(m_display);
 
@@ -1578,7 +1578,7 @@ setWindowCustomCursorShape(
 
 GHOST_TSuccess
 GHOST_WindowX11::
-setWindowCustomCursorShape(    
+setWindowCustomCursorShape(
                GHOST_TUns8 *bitmap,
                GHOST_TUns8 *mask,
                int sizex,
@@ -1591,7 +1591,7 @@ setWindowCustomCursorShape(
        Colormap colormap = DefaultColormap(m_display, m_visualInfo->screen);
        Pixmap bitmap_pix, mask_pix;
        XColor fg, bg;
-       
+
        if (XAllocNamedColor(m_display, colormap, "White", &fg, &fg) == 0) return GHOST_kFailure;
        if (XAllocNamedColor(m_display, colormap, "Black", &bg, &bg) == 0) return GHOST_kFailure;
 
@@ -1601,13 +1601,13 @@ setWindowCustomCursorShape(
 
        bitmap_pix = XCreateBitmapFromData(m_display, m_window, (char *) bitmap, sizex, sizey);
        mask_pix = XCreateBitmapFromData(m_display, m_window, (char *) mask, sizex, sizey);
-               
+
        m_custom_cursor = XCreatePixmapCursor(m_display, bitmap_pix, mask_pix, &fg, &bg, hotX, hotY);
        XDefineCursor(m_display, m_window, m_custom_cursor);
        XFlush(m_display);
 
        m_visible_cursor = m_custom_cursor;
-       
+
        XFreePixmap(m_display, bitmap_pix);
        XFreePixmap(m_display, mask_pix);
 
index 236fe0b..bf2497e 100644 (file)
@@ -54,7 +54,7 @@ class GHOST_DropTargetX11;
 
 /**
  * X11 implementation of GHOST_IWindow.
- * Dimensions are given in screen coordinates that are relative to the upper-left corner of the screen. 
+ * Dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
  * \author     Laurence Bourn
  * \date       October 26, 2001
  */
@@ -112,7 +112,7 @@ public:
        getWindowBounds(
            GHOST_Rect& bounds
            ) const;
-       
+
        void
        getClientBounds(
            GHOST_Rect& bounds
@@ -149,7 +149,7 @@ public:
            GHOST_TInt32& outX,
            GHOST_TInt32& outY
            ) const;
-       
+
        GHOST_TWindowState
        getState(
            ) const;
@@ -158,12 +158,12 @@ public:
        setState(
            GHOST_TWindowState state
            );
-       
+
        GHOST_TSuccess
        setOrder(
            GHOST_TWindowOrder order
            );
-       
+
        GHOST_TSuccess
        invalidate(
            );
@@ -191,7 +191,7 @@ public:
        validate(
            );
 
-       /**     
+       /**
         * Return a handle to the x11 window type.
         */
        Window
@@ -257,7 +257,7 @@ protected:
        setWindowCursorVisibility(
            bool visible
            );
-       
+
        /**
         * Sets the cursor grab on the window using
         * native window system calls.
@@ -290,7 +290,7 @@ protected:
            int hotX,
            int hotY
            );
-       
+
        /**
         * Sets the cursor shape on the window using
         * native window system calls (Arbitrary size/color).
@@ -310,7 +310,7 @@ protected:
 private:
 
        /// Force use of public constructor.
-       
+
        GHOST_WindowX11(
            );
 
@@ -322,11 +322,11 @@ private:
        getStandardCursor(
            GHOST_TStandardCursor g_cursor
            );
-       
+
        Cursor
        getEmptyCursor(
            );
-       
+
        Window m_window;
        Display *m_display;
        XVisualInfo *m_visualInfo;
@@ -342,13 +342,13 @@ private:
 
        /** XCursor structure of an empty (blank) cursor */
        Cursor m_empty_cursor;
-       
+
        /** XCursor structure of the custom cursor */
        Cursor m_custom_cursor;
 
        /** XCursor to show when cursor is visible */
        Cursor m_visible_cursor;
-       
+
        /** Cache of XC_* ID's to XCursor structures */
        std::map<unsigned int, Cursor> m_standard_cursors;
 
index 0cec217..9f714ae 100644 (file)
@@ -103,7 +103,7 @@ suffix_relpaths(SRC_NEW "${SRC}" "../../guardedalloc/")
 include_directories(${INC_NEW})
 add_library(guardedalloc_lib ${SRC_NEW})
 
-# blenfont 
+# blenfont
 include(${CMAKE_SOURCE_DIR}/../../../source/blender/blenfont/CMakeLists.txt)
 suffix_relpaths(INC_NEW "${INC}" "../../../source/blender/blenfont/")
 suffix_relpaths(SRC_NEW "${SRC}" "../../../source/blender/blenfont/")
@@ -128,7 +128,7 @@ add_library(glewmx_lib ${SRC_NEW})
 include_directories(
                "../../../source/blender/blenlib"
                )
-add_library(bli_lib 
+add_library(bli_lib
                "../../../source/blender/blenlib/intern/fileops.c"
                "../../../source/blender/blenlib/intern/gsqueue.c"
                "../../../source/blender/blenlib/intern/rct.c"
index c635ab9..abaa625 100644 (file)
@@ -84,16 +84,16 @@ static void gearGL(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GL
        GLfloat angle, da;
        GLfloat u, v, len;
        const double pi = 3.14159264;
-       
+
        r0 = inner_radius;
        r1 = (float)(outer_radius - tooth_depth / 2.0);
        r2 = (float)(outer_radius + tooth_depth / 2.0);
-       
+
        da = (float)(2.0 * pi / teeth / 4.0);
-       
+
        glShadeModel(GL_FLAT);
        glNormal3f(0.0, 0.0, 1.0);
-       
+
        /* draw front face */
        glBegin(GL_QUAD_STRIP);
        for (i = 0; i <= teeth; i++) {
@@ -104,7 +104,7 @@ static void gearGL(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GL
                glVertex3f((float)(r1 * cos(angle + 3 * da)), (float)(r1 * sin(angle + 3 * da)), (float)(width * 0.5));
        }
        glEnd();
-       
+
        /* draw front sides of teeth */
        glBegin(GL_QUADS);
        da = (float)(2.0 * pi / teeth / 4.0);
@@ -116,9 +116,9 @@ static void gearGL(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GL
                glVertex3f((float)(r1 * cos(angle + 3 * da)), (float)(r1 * sin(angle + 3 * da)), (float)(width * 0.5));
        }
        glEnd();
-       
+
        glNormal3f(0.0, 0.0, -1.0);
-       
+
        /* draw back face */
        glBegin(GL_QUAD_STRIP);
        for (i = 0; i <= teeth; i++) {
@@ -129,7 +129,7 @@ static void gearGL(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GL
                glVertex3f((float)(r0 * cos(angle)), (float)(r0 * sin(angle)), (float)(-width * 0.5));
        }
        glEnd();
-       
+
        /* draw back sides of teeth */
        glBegin(GL_QUADS);
        da = (float)(2.0 * pi / teeth / 4.0);
@@ -141,7 +141,7 @@ static void gearGL(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GL
                glVertex3f((float)(r1 * cos(angle)), (float)(r1 * sin(angle)), (float)(-width * 0.5));
        }
        glEnd();
-       
+
        /* draw outward faces of teeth */
        glBegin(GL_QUAD_STRIP);
        for (i = 0; i < teeth; i++) {
@@ -169,9 +169,9 @@ static void gearGL(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, GL
        glVertex3f((float)(r1 * cos(0.0)), (float)(r1 * sin(0.0)), (float)(width * 0.5));
        glVertex3f((float)(r1 * cos(0.0)), (float)(r1 * sin(0.0)), (float)(-width * 0.5));
        glEnd();
-       
+
        glShadeModel(GL_SMOOTH);
-       
+
        /* draw inside radius cylinder */
        glBegin(GL_QUAD_STRIP);
        for (i = 0; i <= teeth; i++) {
@@ -191,13 +191,13 @@ static void drawGearGL(int id)
        static GLfloat ared[4] = { 0.8f, 0.1f, 0.0f, 1.0f };
        static GLfloat agreen[4] = { 0.0f, 0.8f, 0.2f, 1.0f };
        static GLfloat ablue[4] = { 0.2f, 0.2f, 1.0f, 1.0f };
-       
+
        glLightfv(GL_LIGHT0, GL_POSITION, pos);
        glEnable(GL_CULL_FACE);
        glEnable(GL_LIGHTING);
        glEnable(GL_LIGHT0);
        glEnable(GL_DEPTH_TEST);
-       
+
        switch (id)
        {
                case 1:
@@ -222,32 +222,32 @@ static void drawGearGL(int id)
 static void drawGL(void)
 {
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-       
+
        glPushMatrix();
-       
+
        glRotatef(view_rotx, 1.0, 0.0, 0.0);
        glRotatef(view_roty, 0.0, 1.0, 0.0);
        glRotatef(view_rotz, 0.0, 0.0, 1.0);
-       
+
        glPushMatrix();
        glTranslatef(-3.0, -2.0, 0.0);
        glRotatef(fAngle, 0.0, 0.0, 1.0);
        drawGearGL(1);
        glPopMatrix();
-       
+
        glPushMatrix();
        glTranslatef(3.1f, -2.0f, 0.0f);
        glRotatef((float)(-2.0 * fAngle - 9.0), 0.0, 0.0, 1.0);
        drawGearGL(2);
        glPopMatrix();
-       
+
        glPushMatrix();
        glTranslatef(-3.1f, 2.2f, -1.8f);
        glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
        glRotatef((float)(2.0 * fAngle - 2.0), 0.0, 0.0, 1.0);
        drawGearGL(3);
        glPopMatrix();
-       
+
        glPopMatrix();
 }
 
@@ -256,13 +256,13 @@ static void setViewPortGL(GHOST_WindowHandle hWindow)
 {
        GHOST_RectangleHandle hRect = NULL;
        GLfloat w, h;
-       
+
        GHOST_ActivateWindowDrawingContext(hWindow);
        hRect = GHOST_GetClientBounds(hWindow);
-       
+
        w = (float)GHOST_GetWidthRectangle(hRect) / (float)GHOST_GetHeightRectangle(hRect);
        h = 1.0;
-       
+
        glViewport(0, 0, GHOST_GetWidthRectangle(hRect), GHOST_GetHeightRectangle(hRect));
 
        glMatrixMode(GL_PROJECTION);
@@ -272,7 +272,7 @@ static void setViewPortGL(GHOST_WindowHandle hWindow)
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
        glTranslatef(0.0, 0.0, -40.0);
-       
+
        glClearColor(.2f, 0.0f, 0.0f, 0.0f);
        glClear(GL_COLOR_BUFFER_BIT);
 
@@ -290,7 +290,7 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
        GHOST_TEventWheelData *wheelData = NULL;
        GHOST_DisplaySetting setting;
        GHOST_WindowHandle window = GHOST_GetEventWindow(hEvent);
-       
+
        switch (GHOST_GetEventType(hEvent))
        {
 #if 0
@@ -316,7 +316,7 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
 
                case GHOST_kEventKeyUp:
                        break;
-               
+
                case GHOST_kEventKeyDown:
                {
                        keyData = (GHOST_TEventKeyData *)GHOST_GetEventData(hEvent);
@@ -391,7 +391,7 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
 
                                                sprintf(ntitle, "%s-", title);
                                                GHOST_SetTitle(sMainWindow, ntitle);
-                                               
+
                                                free(ntitle);
                                                free(title);
                                        }
@@ -402,7 +402,7 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
                        }
                }
                break;
-               
+
                case GHOST_kEventWindowClose:
                {
                        GHOST_WindowHandle window2 = GHOST_GetEventWindow(hEvent);
@@ -420,7 +420,7 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
                        }
                }
                break;
-               
+
                case GHOST_kEventWindowActivate:
                        handled = 0;
                        break;
@@ -437,7 +437,7 @@ int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData)
                        GHOST_SwapWindowBuffers(window2);
                }
                break;
-               
+
                default:
                        handled = 0;
                        break;
@@ -456,7 +456,7 @@ int main(int argc, char **argv)
        /* Create the system */
        shSystem = GHOST_CreateSystem();
        GHOST_AddEventConsumer(shSystem, consumer);
-       
+
        if (shSystem)
        {
                /* Create the main window */
@@ -471,7 +471,7 @@ int main(int argc, char **argv)
                        printf("could not create main window\n");
                        exit(-1);
                }
-               
+
                /* Create a secondary window */
                sSecondaryWindow = GHOST_CreateWindow(
                        shSystem,
@@ -485,7 +485,7 @@ int main(int argc, char **argv)
                        printf("could not create secondary window\n");
                        exit(-1);
                }
-               
+
                /* Install a timer to have the gears running */
                sGearsTimer = GHOST_InstallTimer(shSystem,
                                                 0,
@@ -496,7 +496,7 @@ int main(int argc, char **argv)
                /* Enter main loop */
                while (!sExitRequested)
                {
-                       if (!GHOST_ProcessEvents(shSystem, 0)) 
+                       if (!GHOST_ProcessEvents(shSystem, 0))
                        {
 #ifdef WIN32
                                /* If there were no events, be nice to other applications */
@@ -519,7 +519,7 @@ int main(int argc, char **argv)
 
        /* Dispose the system */
        GHOST_DisposeSystem(shSystem);
-       
+
        return 0;
 }
 
index f58a220..8c4d93f 100644 (file)
@@ -273,7 +273,7 @@ static void View(GHOST_IWindow *window, bool stereo, int eye = 0)
        if (stereo)
        {
                if (nVidiaWindows)
-               { 
+               {
                        // handled by nVidia driver so act as normal (explicitly put here since
                        // it -is- stereo)
                        glViewport(0, 0, bnds.getWidth(), bnds.getHeight());
@@ -666,7 +666,7 @@ bool Application::processEvent(GHOST_IEvent *event)
                        window2->swapBuffers();
                }
                break;
-               
+
                default:
                        handled = false;
                        break;
index c8f61d4..86d68ef 100644 (file)
 int            min_i                           (int a, int b);
 
 int            max_i                           (int a, int b);
-int            clamp_i                         (int val, int min, int max); 
+int            clamp_i                         (int val, int min, int max);
 
-float  min_f                           (float a, float b); 
-float  max_f                           (float a, float b); 
-float  clamp_f                         (float val, float min, float max); 
+float  min_f                           (float a, float b);
+float  max_f                           (float a, float b);
+float  clamp_f                         (float val, float min, float max);
 
 void   rect_copy                       (int dst[2][2], int src[2][2]);
 int            rect_contains_pt        (int rect[2][2], int pt[2]);
index 49255de..7401ab8 100644 (file)
@@ -47,7 +47,7 @@ char *eventtype_to_string(GHOST_TEventType type)
        case GHOST_kEventQuit:                          return "Quit";
 
        case GHOST_kEventWindowClose:           return "WindowClose";
-       case GHOST_kEventWindowActivate:        return "WindowActivate";        
+       case GHOST_kEventWindowActivate:        return "WindowActivate";
        case GHOST_kEventWindowDeactivate:      return "WindowDeactivate";
        case GHOST_kEventWindowUpdate:          return "WindowUpdate";
        case GHOST_kEventWindowSize:            return "WindowSize";
@@ -188,7 +188,7 @@ static char *keytype_to_string(GHOST_TKey key)
        K(KeyF22);
        K(KeyF23);
        K(KeyF24);
-       
+
        default:
                return "KeyUnknown";
        }
index 833b5c7..8cd31c3 100644 (file)
@@ -79,7 +79,7 @@ void rect_bevel_side(int rect[2][2], int side, float *lt, float *dk, const float
        int ltidx = (side / 2) % 4;
        int dkidx = (ltidx + 1 + (side & 1)) % 4;
        int i, corner;
-       
+
        glBegin(GL_LINES);
        for (i = 0; i < width; i++) {
                float ltf = pow(lt[i], 1.0 / 2.2), dkf = pow(dk[i], 1.0 / 2.2);
@@ -102,7 +102,7 @@ void rect_bevel_side(int rect[2][2], int side, float *lt, float *dk, const float
                }
        }
        glEnd();
-       
+
        glColor3fv(col);
        glRecti(rect[0][0] + width, rect[0][1] + width, rect[1][0] - width, rect[1][1] - width);
 }
@@ -113,17 +113,17 @@ void rect_bevel_smooth(int rect[2][2], int width)
        float *dk = malloc(sizeof(*dk) * width);
        float col[4];
        int i;
-       
+
        for (i = 0; i < width; i++) {
                float v = width - 1 ? ((float) i / (width - 1)) : 0;
                lt[i] = 1.2 + (1.0 - 1.2) * v;
                dk[i] = 0.2 + (1.0 - 0.2) * v;
        }
-       
+
        glGetFloatv(GL_CURRENT_COLOR, col);
-       
+
        rect_bevel_side(rect, 3, lt, dk, col, width);
-       
+
        free(lt);
        free(dk);
 }
@@ -136,11 +136,11 @@ typedef struct {
        MultiTestApp        *app;
 
        GHOST_WindowHandle win;
-       
+
        int size[2];
-       
+
        int lmouse[2], lmbut[3];
-       
+
        int tmouse[2];
 } MainWindow;
 
@@ -152,18 +152,18 @@ static void mainwindow_log(MainWindow *mw, char *str)
 static void mainwindow_do_draw(MainWindow *mw)
 {
        GHOST_ActivateWindowDrawingContext(mw->win);
-       
+
        if (mw->lmbut[0]) {
                glClearColor(0.5, 0.5, 0.5, 1);
        }
        else {
                glClearColor(1, 1, 1, 1);
-       }               
+       }
        glClear(GL_COLOR_BUFFER_BIT);
-       
+
        glColor3f(0.5, 0.6, 0.8);
        glRecti(mw->tmouse[0] - 5, mw->tmouse[1] - 5, mw->tmouse[0] + 5, mw->tmouse[1] + 5);
-       
+
        GHOST_SwapWindowBuffers(mw->win);
 }
 
@@ -175,7 +175,7 @@ static void mainwindow_do_reshape(MainWindow *mw)
 
        mw->size[0] = GHOST_GetWidthRectangle(bounds);
        mw->size[1] = GHOST_GetHeightRectangle(bounds);
-       
+
        glViewport(0, 0, mw->size[0], mw->size[1]);
 
        glMatrixMode(GL_PROJECTION);
@@ -234,7 +234,7 @@ static void mainwindow_do_key(MainWindow *mw, GHOST_TKey key, int press)
 static void mainwindow_do_move(MainWindow *mw, int x, int y)
 {
        mw->lmouse[0] = x, mw->lmouse[1] = y;
-       
+
        if (mw->lmbut[0]) {
                mw->tmouse[0] = x, mw->tmouse[1] = y;
                GHOST_InvalidateWindow(mw->win);
@@ -261,10 +261,10 @@ static void mainwindow_handle(void *priv, GHOST_EventHandle evt)
        MainWindow *mw = priv;
        GHOST_TEventType type = GHOST_GetEventType(evt);
        char buf[256];
-       
+
        event_to_buf(evt, buf);
        mainwindow_log(mw, buf);
-       
+
        switch (type) {
                case GHOST_kEventCursorMove:
                {
@@ -304,7 +304,7 @@ static void mainwindow_timer_proc(GHOST_TimerTaskHandle task, GHOST_TUns64 time)
 {
        MainWindow *mw = GHOST_GetTimerTaskUserData(task);
        char buf[64];
-       
+
        sprintf(buf, "timer: %6.2f", (double) ((GHOST_TInt64) time) / 1000);
        mainwindow_log(mw, buf);
 }
@@ -314,23 +314,23 @@ MainWindow *mainwindow_new(MultiTestApp *app)
        GHOST_SystemHandle sys = multitestapp_get_system(app);
        GHOST_WindowHandle win;
        GHOST_GLSettings glSettings = {0};
-       
+
        win = GHOST_CreateWindow(
                sys, "MultiTest:Main",
                40, 40, 400, 400,
                GHOST_kWindowStateNormal,
                GHOST_kDrawingContextTypeOpenGL,
                glSettings);
-       
+
        if (win) {
                MainWindow *mw = MEM_callocN(sizeof(*mw), "mainwindow_new");
                mw->app = app;
                mw->win = win;
-               
+
                GHOST_SetWindowUserData(mw->win, windowdata_new(mw, mainwindow_handle));
-               
+
                GHOST_InstallTimer(sys, 1000, 10000, mainwindow_timer_proc, mw);
-               
+
                return mw;
        }
        else {
@@ -356,23 +356,23 @@ struct _LoggerWindow {
 
        GHOST_WindowHandle win;
 
-#ifdef USE_BMF 
+#ifdef USE_BMF
        BMF_Font    *font;
 #else
        int font;
 #endif
        int fonttexid;
        int fontheight;
-       
+
        int size[2];
-       
+
        int ndisplines;
        int textarea[2][2];
        ScrollBar   *scroll;
-       
+
        char        **loglines;
        int nloglines, logsize;
-       
+
        int lmbut[3];
        int lmouse[2];
 };
@@ -383,7 +383,7 @@ struct _LoggerWindow {
 static void loggerwindow_recalc_regions(LoggerWindow *lw)
 {
        int nscroll[2][2];
-       
+
        nscroll[0][0] = SCROLLBAR_PAD;
        nscroll[0][1] = SCROLLBAR_PAD;
        nscroll[1][0] = nscroll[0][0] + SCROLLBAR_WIDTH;
@@ -418,10 +418,10 @@ static void loggerwindow_do_reshape(LoggerWindow *lw)
        GHOST_RectangleHandle bounds = GHOST_GetClientBounds(lw->win);
 
        GHOST_ActivateWindowDrawingContext(lw->win);
-       
+
        lw->size[0] = GHOST_GetWidthRectangle(bounds);
        lw->size[1] = GHOST_GetHeightRectangle(bounds);
-       
+
        loggerwindow_recalc_regions(lw);
        loggerwindow_setup_window_gl(lw);
 }
@@ -430,21 +430,21 @@ static void loggerwindow_do_draw(LoggerWindow *lw)
 {
        int i, ndisplines, startline;
        int sb_rect[2][2], sb_thumb[2][2];
-               
+
        GHOST_ActivateWindowDrawingContext(lw->win);
-       
+
        glClearColor(1, 1, 1, 1);
        glClear(GL_COLOR_BUFFER_BIT);
 
        glColor3f(0.8, 0.8, 0.8);
        rect_bevel_smooth(lw->textarea, 4);
-       
+
        scrollbar_get_rect(lw->scroll, sb_rect);
        scrollbar_get_thumb(lw->scroll, sb_thumb);
-       
+
        glColor3f(0.6, 0.6, 0.6);
        rect_bevel_smooth(sb_rect, 1);
-       
+
        if (scrollbar_is_scrolling(lw->scroll)) {
                glColor3f(0.6, 0.7, 0.5);
        }
@@ -452,16 +452,16 @@ static void loggerwindow_do_draw(LoggerWindow *lw)
                glColor3f(0.9, 0.9, 0.92);
        }
        rect_bevel_smooth(sb_thumb, 1);
-       
+
        startline = scrollbar_get_thumbpos(lw->scroll) * (lw->nloglines - 1);
        ndisplines = min_i(lw->ndisplines, lw->nloglines - startline);
 
        if (lw->fonttexid != -1) {
                glBindTexture(GL_TEXTURE_2D, lw->fonttexid);
-               
+
                glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
                glEnable(GL_BLEND);
-               glEnable(GL_TEXTURE_2D);                
+               glEnable(GL_TEXTURE_2D);
        }
        glColor3f(0, 0, 0);
        for (i = 0; i < ndisplines; i++) {
@@ -470,7 +470,7 @@ static void loggerwindow_do_draw(LoggerWindow *lw)
                int x_pos = lw->textarea[0][0] + 4;
                int y_pos = lw->textarea[0][1] + 4 + i * lw->fontheight;
 
-#ifdef USE_BMF         
+#ifdef USE_BMF
                if (lw->fonttexid == -1) {
                        glRasterPos2i(x_pos, y_pos);
                        BMF_DrawString(lw->font, line);
@@ -486,7 +486,7 @@ static void loggerwindow_do_draw(LoggerWindow *lw)
 
 #ifdef USE_BMF
        if (lw->fonttexid != -1) {
-               glDisable(GL_TEXTURE_2D);               
+               glDisable(GL_TEXTURE_2D);
                glDisable(GL_BLEND);
        }
 #endif
@@ -497,7 +497,7 @@ static void loggerwindow_do_draw(LoggerWindow *lw)
 static void loggerwindow_do_move(LoggerWindow *lw, int x, int y)
 {
        lw->lmouse[0] = x, lw->lmouse[1] = y;
-       
+
        if (scrollbar_is_scrolling(lw->scroll)) {
                scrollbar_keep_scrolling(lw->scroll, y);
                GHOST_InvalidateWindow(lw->win);
@@ -508,10 +508,10 @@ static void loggerwindow_do_button(LoggerWindow *lw, int which, int press)
 {
        if (which == GHOST_kButtonMaskLeft) {
                lw->lmbut[0] = press;
-               
+
                if (press) {
                        if (scrollbar_contains_pt(lw->scroll, lw->lmouse)) {
-                               scrollbar_start_scrolling(lw->scroll, lw->lmouse[1]);                           
+                               scrollbar_start_scrolling(lw->scroll, lw->lmouse[1]);
                                GHOST_SetCursorShape(lw->win, GHOST_kStandardCursorUpDown);
                                GHOST_InvalidateWindow(lw->win);
                        }
@@ -546,7 +546,7 @@ static void loggerwindow_handle(void *priv, GHOST_EventHandle evt)
 {
        LoggerWindow *lw = priv;
        GHOST_TEventType type = GHOST_GetEventType(evt);
-       
+
        switch (type) {
                case GHOST_kEventCursorMove:
                {
@@ -588,7 +588,7 @@ LoggerWindow *loggerwindow_new(MultiTestApp *app)
        GHOST_SystemHandle sys = multitestapp_get_system(app);
        GHOST_TUns32 screensize[2];
        GHOST_WindowHandle win;
-       
+
        GHOST_GetMainDisplayDimensions(sys, &screensize[0], &screensize[1]);
        win = GHOST_CreateWindow(
                sys, "MultiTest:Logger",
@@ -596,7 +596,7 @@ LoggerWindow *loggerwindow_new(MultiTestApp *app)
                GHOST_kWindowStateNormal,
                GHOST_kDrawingContextTypeOpenGL,
                glSettings);
-       
+
        if (win) {
                LoggerWindow *lw = MEM_callocN(sizeof(*lw), "loggerwindow_new");
                int bbox[2][2];
@@ -614,12 +614,12 @@ LoggerWindow *loggerwindow_new(MultiTestApp *app)
                BLF_size(lw->font, 11, 72);
                lw->fontheight = BLF_height(lw->font, "A_", 2);
 #endif
-               
+
                lw->nloglines = lw->logsize = 0;
                lw->loglines = MEM_mallocN(sizeof(*lw->loglines) * lw->nloglines, "loglines");
-               
+
                lw->scroll = scrollbar_new(2, 40);
-               
+
                GHOST_SetWindowUserData(lw->win, windowdata_new(lw, loggerwindow_handle));
 
                loggerwindow_do_reshape(lw);
@@ -636,10 +636,10 @@ void loggerwindow_log(LoggerWindow *lw, char *line)
        if (lw->nloglines == lw->logsize) {
                lw->loglines = memdbl(lw->loglines, &lw->logsize, sizeof(*lw->loglines));
        }
-       
+
        lw->loglines[lw->nloglines++] = string_dup(line);
        scrollbar_set_thumbpct(lw->scroll, (float) lw->ndisplines / lw->nloglines);
-       
+
        GHOST_InvalidateWindow(lw->win);
 }
 
@@ -652,7 +652,7 @@ void loggerwindow_free(LoggerWindow *lw)
                MEM_freeN(lw->loglines[i]);
        }
        MEM_freeN(lw->loglines);
-       
+
        windowdata_free(GHOST_GetWindowUserData(lw->win));
        GHOST_DisposeWindow(sys, lw->win);
        MEM_freeN(lw);
@@ -667,7 +667,7 @@ typedef struct {
        MultiTestApp        *app;
 
        GHOST_WindowHandle win;
-       
+
        int size[2];
 } ExtraWindow;
 
@@ -677,10 +677,10 @@ static void extrawindow_do_draw(ExtraWindow *ew)
 
        glClearColor(1, 1, 1, 1);
        glClear(GL_COLOR_BUFFER_BIT);
-       
+
        glColor3f(0.8, 0.8, 0.8);
        glRecti(10, 10, ew->size[0] - 10, ew->size[1] - 10);
-       
+
        GHOST_SwapWindowBuffers(ew->win);
 }
 
@@ -692,7 +692,7 @@ static void extrawindow_do_reshape(ExtraWindow *ew)
 
        ew->size[0] = GHOST_GetWidthRectangle(bounds);
        ew->size[1] = GHOST_GetHeightRectangle(bounds);
-       
+
        glViewport(0, 0, ew->size[0], ew->size[1]);
 
        glMatrixMode(GL_PROJECTION);
@@ -721,15 +721,15 @@ static void extrawindow_spin_cursor(ExtraWindow *ew, GHOST_TUns64 time)
        double ftime = (double) ((GHOST_TInt64) time) / 1000;
        float angle = fmod(ftime, 1.0) * 3.1415 * 2;
        int i;
-       
+
        memset(&bitmap, 0, sizeof(bitmap));
        memset(&mask, 0, sizeof(mask));
-       
+
        bitmap[0][0] |= mask[0][0] |= 0xF;
        bitmap[1][0] |= mask[1][0] |= 0xF;
        bitmap[2][0] |= mask[2][0] |= 0xF;
        bitmap[3][0] |= mask[3][0] |= 0xF;
-       
+
        for (i = 0; i < 7; i++) {
                int x = 7 + cos(angle) * i;
                int y = 7 + sin(angle) * i;
@@ -740,10 +740,10 @@ static void extrawindow_spin_cursor(ExtraWindow *ew, GHOST_TUns64 time)
                float v = (i / 63.0) * 3.1415 * 2;
                int x = 7 + cos(v) * 7;
                int y = 7 + sin(v) * 7;
-               
+
                mask[y][x / 8] |= (1 << (x % 8));
        }
-       
+
        GHOST_SetCustomCursorShape(ew->win, bitmap, mask, 0, 0);
 }
 
@@ -752,10 +752,10 @@ static void extrawindow_handle(void *priv, GHOST_EventHandle evt)
        ExtraWindow *ew = priv;
        GHOST_TEventType type = GHOST_GetEventType(evt);
        char buf[256];
-       
+
        event_to_buf(evt, buf);
        loggerwindow_log(multitestapp_get_logger(ew->app), buf);
-       
+
        switch (type) {
                case GHOST_kEventKeyDown:
                case GHOST_kEventKeyUp:
@@ -790,21 +790,21 @@ ExtraWindow *extrawindow_new(MultiTestApp *app)
        GHOST_GLSettings glSettings = {0};
        GHOST_SystemHandle sys = multitestapp_get_system(app);
        GHOST_WindowHandle win;
-       
+
        win = GHOST_CreateWindow(
                sys, "MultiTest:Extra",
                500, 40, 400, 400,
                GHOST_kWindowStateNormal,
                GHOST_kDrawingContextTypeOpenGL,
                glSettings);
-       
+
        if (win) {
                ExtraWindow *ew = MEM_callocN(sizeof(*ew), "mainwindow_new");
                ew->app = app;
                ew->win = win;
-               
+
                GHOST_SetWindowUserData(ew->win, windowdata_new(ew, extrawindow_handle));
-               
+
                return ew;
        }
        else {
@@ -824,13 +824,13 @@ void extrawindow_free(ExtraWindow *ew)
 /*
  * MultiTestApp
  */
-       
+
 struct _MultiTestApp {
        GHOST_SystemHandle sys;
        MainWindow          *main;
        LoggerWindow        *logger;
        ExtraWindow         *extra;
-       
+
        int exit;
 };
 
@@ -838,21 +838,21 @@ static int multitest_event_handler(GHOST_EventHandle evt, GHOST_TUserDataPtr dat
 {
        MultiTestApp *app = data;
        GHOST_WindowHandle win;
-       
+
        win = GHOST_GetEventWindow(evt);
        if (win && !GHOST_ValidWindow(app->sys, win)) {
                loggerwindow_log(app->logger, "WARNING: bad event, non-valid window\n");
                return 1;
        }
-               
+
        if (win) {
                WindowData *wb = GHOST_GetWindowUserData(win);
-               
+
                windowdata_handle(wb, evt);
        }
        else {
                GHOST_TEventType type = GHOST_GetEventType(evt);
-                       
+
                /* GHOST_kEventQuit are the only 'system' events,
                 * that is, events without a window.
                 */
@@ -866,7 +866,7 @@ static int multitest_event_handler(GHOST_EventHandle evt, GHOST_TUserDataPtr dat
                                break;
                }
        }
-       
+
        return 1;
 }
 
@@ -880,25 +880,25 @@ MultiTestApp *multitestapp_new(void) {
        if (!app->sys)
                fatal("Unable to create ghost system");
 
-       if (!GHOST_AddEventConsumer(app->sys, consumer))        
+       if (!GHOST_AddEventConsumer(app->sys, consumer))
                fatal("Unable to add multitest event consumer ");
-               
+
        app->main = mainwindow_new(app);
-       if (!app->main) 
+       if (!app->main)
                fatal("Unable to create main window");
-               
+
        app->logger = loggerwindow_new(app);
        if (!app->logger)
                fatal("Unable to create logger window");
 
        app->extra = NULL;
        app->exit = 0;
-       
+
        return app;
 }
 
 LoggerWindow *multitestapp_get_logger(MultiTestApp *app) {
-       return app->logger;     
+       return app->logger;
 }
 
 GHOST_SystemHandle multitestapp_get_system(MultiTestApp *app) {
@@ -943,7 +943,7 @@ void multitestapp_free(MultiTestApp *app)
 }
 
 /***/
-       
+
 int main(int argc, char **argv)
 {
        MultiTestApp *app;
@@ -953,9 +953,9 @@ int main(int argc, char **argv)
 #endif
 
        app = multitestapp_new();
-       
+
        multitestapp_run(app);
        multitestapp_free(app);
-       
+
        return 0;
 }
index 8964d30..2a363f3 100644 (file)
@@ -37,7 +37,7 @@
 struct _ScrollBar {
        int rect[2][2];
        float thumbpos, thumbpct;
-       
+
        int inset;
        int minthumb;
 
@@ -48,7 +48,7 @@ struct _ScrollBar {
 static int scrollbar_get_thumbH(ScrollBar *sb)
 {
        int scrollable_h = rect_height(sb->rect) - 2 * sb->inset;
-       
+
        return clamp_i(sb->thumbpct * scrollable_h, sb->minthumb, scrollable_h);
 }
 
@@ -56,7 +56,7 @@ static int scrollbar_get_thumbableH(ScrollBar *sb)
 {
        int scrollable_h = rect_height(sb->rect) - 2 * sb->inset;
        int thumb_h = scrollbar_get_thumbH(sb);
-       
+
        return scrollable_h - thumb_h;
 }
 
@@ -76,7 +76,7 @@ ScrollBar *scrollbar_new(int inset, int minthumb)
        ScrollBar *sb = MEM_callocN(sizeof(*sb), "scrollbar_new");
        sb->inset = inset;
        sb->minthumb = minthumb;
-       
+
        return sb;
 }
 
index 8c8d02d..dd73753 100644 (file)
@@ -29,7 +29,7 @@ typedef struct _ScrollBar ScrollBar;
 
 
        /***/
-       
+
 ScrollBar*     scrollbar_new                           (int inset, int minthumb);
 
 int                    scrollbar_is_scrolling          (ScrollBar *sb);
index bacd0a3..9ac7ae0 100644 (file)
@@ -40,10 +40,10 @@ void *memdbl(void *mem, int *size_pr, int item_size)
        int cur_size = *size_pr;
        int new_size = cur_size ? (cur_size * 2) : 1;
        void *nmem = MEM_mallocN(new_size * item_size, "memdbl");
-       
+
        memcpy(nmem, mem, cur_size * item_size);
        MEM_freeN(mem);
-               
+
        *size_pr = new_size;
        return nmem;
 }
@@ -54,19 +54,19 @@ char *string_dup(char *str)
        char *nstr = MEM_mallocN(len + 1, "string_dup");
 
        memcpy(nstr, str, len + 1);
-       
+
        return nstr;
 }
 
 void fatal(char *fmt, ...)
 {
        va_list ap;
-       
+
        fprintf(stderr, "FATAL: ");
        va_start(ap, fmt);
        vfprintf(stderr, fmt, ap);
        va_end(ap);
        fprintf(stderr, "\n");
-       
+
        exit(1);
 }
index de4992a..07078cd 100644 (file)
@@ -43,7 +43,7 @@ WindowData *windowdata_new(void *data, WindowDataHandler handler)
        WindowData *wb = MEM_mallocN(sizeof(*wb), "windowdata_new");
        wb->data = data;
        wb->handler = handler;
-       
+
        return wb;
 }
 
index f819810..0e6c751 100644 (file)
@@ -27,9 +27,9 @@
 
 typedef void (*WindowDataHandler)(void *priv, GHOST_EventHandle evt);
 typedef struct _WindowData WindowData;
-       
+
        /***/
-       
+
 WindowData*    windowdata_new          (void *data, WindowDataHandler handler);
 void           windowdata_handle       (WindowData *wb, GHOST_EventHandle evt);
 void           windowdata_free         (WindowData *wb);
index 4b91309..ebd058d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 4b91309b122bcdcddd1854b1137407b2c4f55c7e
+Subproject commit ebd058d7a6438d137522063bb3286c8acc325ca6
index cd57934..4747021 160000 (submodule)
@@ -1 +1 @@
-Subproject commit cd57934bd04c174fc3402888d01a74e6e6653b2f
+Subproject commit 474702157831f1a58bb50f5240ab8b1b02b6ba37
index 6bcd05c..4873683 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 6bcd05cf6aaafae07b8a15313d7fdda1471ff59e
+Subproject commit 48736838d421447d5e4d67ccd59bf1d22dcc85d9
index 82acdab..dd0bc34 100644 (file)
@@ -40,7 +40,7 @@ TEST(heap, One)
        const char *in = "test";
 
        heap = BLI_heap_new();
+
        BLI_heap_insert(heap, 0.0f, (void *)in);
        EXPECT_FALSE(BLI_heap_is_empty(heap));
        EXPECT_EQ(BLI_heap_len(heap), 1);
index 9ca0376..b2d3d79 100644 (file)
@@ -127,7 +127,7 @@ class MatrixTesting(unittest.TestCase):
                       (0, 0, 0, 1)))
 
         vec = Vector((1, 2, 3))
-        
+
         prod_mat_vec = Vector((7, 12, 4))
         prod_vec_mat = Vector((1, 12, 5))
 
index 6686d42..bdfae03 100644 (file)
@@ -113,37 +113,37 @@ class MeshExportTest4(AbstractColladaTest):
         test = "suzannes_parent_inverse_sample_10_matrix"
         reference_dae = self.testdir / Path("%s.dae" % test)
         outfile       = tempdir / Path("%s_out.dae" % test)
-        
+
         bpy.ops.wm.collada_export(filepath="%s" % str(outfile),
-            check_existing=True, 
-            filemode=8, 
-            display_type='DEFAULT', 
-            sort_method='FILE_SORT_ALPHA', 
-            apply_modifiers=True, 
-            export_mesh_type=0, 
-            export_mesh_type_selection='view', 
-            selected=True, 
-            include_children=True, 
-            include_armatures=True, 
-            include_shapekeys=False, 
-            deform_bones_only=False, 
-            include_animations=True, 
-            sample_animations=True, 
-            sampling_rate=10, 
-            active_uv_only=False, 
-            use_texture_copies=True, 
-            triangulate=False, 
-            use_object_instantiation=True, 
-            use_blender_profile=True, 
-            sort_by_name=False, 
-            export_transformation_type=0, 
-            export_transformation_type_selection='matrix', 
-            export_texture_type=0, 
-            export_texture_type_selection='mat', 
-            open_sim=False, 
-            limit_precision=True, 
+            check_existing=True,
+            filemode=8,
+            display_type='DEFAULT',
+            sort_method='FILE_SORT_ALPHA',
+            apply_modifiers=True,
+            export_mesh_type=0,
+            export_mesh_type_selection='view',
+            selected=True,
+            include_children=True,
+            include_armatures=True,
+            include_shapekeys=False,
+            deform_bones_only=False,
+            include_animations=True,
+            sample_animations=True,
+            sampling_rate=10,
+            active_uv_only=False,
+            use_texture_copies=True,
+            triangulate=False,
+            use_object_instantiation=True,
+            use_blender_profile=True,
+            sort_by_name=False,
+            export_transformation_type=0,
+            export_transformation_type_selection='matrix',
+            export_texture_type=0,
+            export_texture_type_selection='mat',
+            open_sim=False,
+            limit_precision=True,
             keep_bind_info=False)
-        
+
         # Now check the resulting Collada file.
         if not self.checkdae(reference_dae, outfile):
             self.fail()
@@ -154,37 +154,37 @@ class MeshExportTest3(AbstractColladaTest):
         test = "suzannes_parent_inverse_sample_10_channels"
         reference_dae = self.testdir / Path("%s.dae" % test)
         outfile       = tempdir / Path("%s_out.dae" % test)
-        
+
         bpy.ops.wm.collada_export(filepath="%s" % str(outfile),
-            check_existing=True, 
-            filemode=8, 
-            display_type='DEFAULT', 
-            sort_method='FILE_SORT_ALPHA', 
-            apply_modifiers=True, 
-            export_mesh_type=0, 
-            export_mesh_type_selection='view', 
-            selected=True, 
-            include_children=True, 
-            include_armatures=True, 
-            include_shapekeys=False, 
-            deform_bones_only=False, 
-            include_animations=True, 
-            sample_animations=True, 
-            sampling_rate=10, 
-            active_uv_only=False, 
-            use_texture_copies=True, 
-            triangulate=False, 
-            use_object_instantiation=True, 
-            use_blender_profile=True, 
-            sort_by_name=False, 
-            export_transformation_type=0, 
-            export_transformation_type_selection='transrotloc', 
-            export_texture_type=0, 
-            export_texture_type_selection='mat', 
-            open_sim=False, 
-            limit_precision=True, 
+            check_existing=True,
+            filemode=8,
+            display_type='DEFAULT',
+            sort_method='FILE_SORT_ALPHA',
+            apply_modifiers=True,
+            export_mesh_type=0,
+            export_mesh_type_selection='view',
+            selected=True,
+            include_children=True,
+            include_armatures=True,
+            include_shapekeys=False,
+            deform_bones_only=False,
+            include_animations=True,
+            sample_animations=True,
+            sampling_rate=10,
+            active_uv_only=False,
+            use_texture_copies=True,
+            triangulate=False,
+            use_object_instantiation=True,
+            use_blender_profile=True,
+            sort_by_name=False,
+            export_transformation_type=0,
+            export_transformation_type_selection='transrotloc',
+            export_texture_type=0,
+            export_texture_type_selection='mat',
+            open_sim=False,
+            limit_precision=True,
             keep_bind_info=False)
-        
+
         # Now check the resulting Collada file.
         if not self.checkdae(reference_dae, outfile):
             self.fail()
@@ -195,37 +195,37 @@ class MeshExportTest2(AbstractColladaTest):
         test = "suzannes_parent_inverse_keyframes_matrix"
         reference_dae = self.testdir / Path("%s.dae" % test)
         outfile       = tempdir / Path("%s_out.dae" % test)
-        
+
         bpy.ops.wm.collada_export(filepath="%s" % str(outfile),
-            check_existing=True, 
-            filemode=8, 
-            display_type='DEFAULT', 
-            sort_method='FILE_SORT_ALPHA', 
-            apply_modifiers=True, 
-            export_mesh_type=0, 
-            export_mesh_type_selection='view', 
-            selected=True, 
-            include_children=True, 
-            include_armatures=True, 
-            include_shapekeys=False, 
-            deform_bones_only=False, 
-            include_animations=True, 
-            sample_animations=False, 
-            sampling_rate=1, 
-            active_uv_only=False, 
-            use_texture_copies=True, 
-            triangulate=False, 
-            use_object_instantiation=True, 
-            use_blender_profile=True, 
-            sort_by_name=False, 
-            export_transformation_type=0, 
-            export_transformation_type_selection='matrix', 
-            export_texture_type=0, 
-            export_texture_type_selection='mat', 
-            open_sim=False, 
-            limit_precision=True, 
+            check_existing=True,
+            filemode=8,
+            display_type='DEFAULT',
+            sort_method='FILE_SORT_ALPHA',
+            apply_modifiers=True,
+            export_mesh_type=0,
+            export_mesh_type_selection='view',
+            selected=True,
+            include_children=True,
+            include_armatures=True,
+            include_shapekeys=False,
+            deform_bones_only=False,
+            include_animations=True,
+            sample_animations=False,
+            sampling_rate=1,
+            active_uv_only=False,
+            use_texture_copies=True,
+            triangulate=False,
+            use_object_instantiation=True,
+            use_blender_profile=True,
+            sort_by_name=False,
+            export_transformation_type=0,
+            export_transformation_type_selection='matrix',
+            export_texture_type=0,
+            export_texture_type_selection='mat',
+            open_sim=False,
+            limit_precision=True,
             keep_bind_info=False)
-        
+
         # Now check the resulting Collada file.
         if not self.checkdae(reference_dae, outfile):
             self.fail()
@@ -236,45 +236,45 @@ class MeshExportTest1(AbstractColladaTest):
         test = "suzannes_parent_inverse_keyframes_channels"
         reference_dae = self.testdir / Path("%s.dae" % test)
         outfile       = tempdir / Path("%s_out.dae" % test)
-        
+
         bpy.ops.wm.collada_export(filepath="%s" % str(outfile),
-            check_existing=True, 
-            filemode=8, 
-            display_type='DEFAULT', 
-            sort_method='FILE_SORT_ALPHA', 
-            apply_modifiers=True, 
-            export_mesh_type=0, 
-            export_mesh_type_selection='view', 
-            selected=True, 
-            include_children=True, 
-            include_armatures=True, 
-            include_shapekeys=False, 
-            deform_bones_only=False, 
-            include_animations=True, 
-            sample_animations=False, 
-            sampling_rate=1, 
-            active_uv_only=False, 
-            use_texture_copies=True, 
-            triangulate=False, 
-            use_object_instantiation=True, 
-            use_blender_profile=True, 
-            sort_by_name=False, 
-            export_transformation_type=0, 
-            export_transformation_type_selection='transrotloc', 
-            export_texture_type=0, 
-            export_texture_type_selection='mat', 
-            open_sim=False, 
-            limit_precision=True, 
+            check_existing=True,
+            filemode=8,
+            display_type='DEFAULT',
+            sort_method='FILE_SORT_ALPHA',
+            apply_modifiers=True,
+            export_mesh_type=0,
+            export_mesh_type_selection='view',
+            selected=True,
+            include_children=True,
+            include_armatures=True,
+            include_shapekeys=False,
+            deform_bones_only=False,
+            include_animations=True,
+            sample_animations=False,
+            sampling_rate=1,
+            active_uv_only=False,
+            use_texture_copies=True,
+            triangulate=False,
+            use_object_instantiation=True,
+            use_blender_profile=True,
+            sort_by_name=False,
+            export_transformation_type=0,
+            export_transformation_type_selection='transrotloc',
+            export_texture_type=0,
+            export_texture_type_selection='mat',
+            open_sim=False,
+            limit_precision=True,
             keep_bind_info=False)
-        
+
         # Now check the resulting Collada file.
         if not self.checkdae(reference_dae, outfile):
             self.fail()
 
-            
+
 if __name__ == '__main__':
     sys.argv = [__file__] + (sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else [])
     parser = argparse.ArgumentParser()
     parser.add_argument('--testdir', required=True)
     args, remaining = parser.parse_known_args()
-    unittest.main(argv=sys.argv[0:1]+remaining)
\ No newline at end of file
+    unittest.main(argv=sys.argv[0:1]+remaining)
index f592160..213c617 100644 (file)
@@ -113,7 +113,7 @@ class MeshExportTest(AbstractColladaTest):
         test = "mesh_simple_001"
         reference_dae = self.testdir / Path("%s.dae" % test)
         outfile       = tempdir / Path("%s_out.dae" % test)
-        
+
         bpy.ops.wm.collada_export(filepath="%s" % str(outfile),
             check_existing=True,
             filemode=8,
@@ -141,7 +141,7 @@ class MeshExportTest(AbstractColladaTest):
             open_sim=False,
             limit_precision=False,
             keep_bind_info=False)
-        
+
         # Now check the resulting Collada file.
         if not self.checkdae(reference_dae, outfile):
             self.fail()
@@ -151,4 +151,4 @@ if __name__ == '__main__':
     parser = argparse.ArgumentParser()
     parser.add_argument('--testdir', required=True)
     args, remaining = parser.parse_known_args()
-    unittest.main(argv=sys.argv[0:1]+remaining)
\ No newline at end of file
+    unittest.main(argv=sys.argv[0:1]+remaining)
index 9493d6f..7067767 100755 (executable)
@@ -60,7 +60,7 @@ class AbstractFFmpegSequencerTest(AbstractFFmpegTest):
 class FPSDetectionTest(AbstractFFmpegSequencerTest):
     def test_T51153(self):
         self.assertAlmostEqual(
-            self.get_movie_file_fps('T51153_bad_clip_2.mts'), 
+            self.get_movie_file_fps('T51153_bad_clip_2.mts'),
             29.97,
             places=2)
 
index 55ef882..c4496c3 100755 (executable)
@@ -61,7 +61,7 @@ class AbstractBlenderRunnerTest(unittest.TestCase):
     # Set in a subclass
     blender: pathlib.Path = None
     testdir: pathlib.Path = None
-    
+
 
     def run_blender(self, filepath: str, python_script: str, timeout: int=300) -> str:
         """Runs Blender by opening a blendfile and executing a script.
index f9777a5..dda13d2 100644 (file)
@@ -23,7 +23,7 @@ class TestArray(unittest.TestCase):
         test.farr= (1.0, 2.0, 3.0)
         test.iarr= (7, 8, 9)
         test.barr= (False, True, False)
-    
+
     # test access
     # test slice access, negative indices
     def test_access(self):
@@ -40,7 +40,7 @@ class TestArray(unittest.TestCase):
     def test_access_fail(self):
         for arr in (test.farr, test.iarr, test.barr):
             self.assertRaises(IndexError, lambda : arr[4])
-    
+
     # test assignment of a whole array
     def test_assign_array(self):
         # should accept int as float
@@ -83,7 +83,7 @@ class TestArray(unittest.TestCase):
             for i in range(len(arr)):
                 val= rand_func()
                 arr[i] = val
-                
+
                 self.assertEqual(arr[i], val)
 
         # float prop should accept also int
@@ -92,7 +92,7 @@ class TestArray(unittest.TestCase):
             test.farr[i] = val
             self.assertEqual(test.farr[i], float(val))
 
-        # 
+        #
 
     def test_assign_item_fail(self):
         def assign_bad_index(arr):
@@ -100,12 +100,12 @@ class TestArray(unittest.TestCase):
 
         def assign_bad_type(arr):
             arr[1] = "123"
-            
+
         for arr in [test.farr, test.iarr, test.barr]:
             self.assertRaises(IndexError, assign_bad_index, arr)
 
         # not testing bool because bool allows not only (True|False)
-        for arr in [test.farr, test.iarr]:    
+        for arr in [test.farr, test.iarr]:
             self.assertRaises(TypeError, assign_bad_type, arr)
 
     def test_dynamic_assign_array(self):
@@ -118,7 +118,7 @@ class TestArray(unittest.TestCase):
 
     def test_dynamic_assign_array_fail(self):
         # could also test too big length here
-        
+
         def assign_empty_list(arr):
             setattr(test, arr, ())
 
@@ -236,7 +236,7 @@ def make_random_array(len, rand_func):
     arr= []
     for i in range(len):
         arr.append(rand_func())
-        
+
     return arr
 
 def make_random_2d_array(dimsize, rand_func):
index 69f7af2..cec839a 100644 (file)
@@ -18,7 +18,7 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
-# --env-system-scripts allows to run without the install target. 
+# --env-system-scripts allows to run without the install target.
 
 # Use '--write-blend=/tmp/test.blend' to view output
 
@@ -43,7 +43,7 @@ else()
        set(TEST_BLENDER_EXE ${EXECUTABLE_OUTPUT_PATH}/blender)
 endif()
 
-# for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no 
+# for testing with valgrind prefix: valgrind --track-origins=yes --error-limit=no
 set(TEST_BLENDER_EXE ${TEST_BLENDER_EXE} --background -noaudio --factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)