style cleanup: ghost headers

This commit is contained in:
Campbell Barton
2012-05-19 09:23:08 +00:00
parent 03ed173fe6
commit 112b1a0779
49 changed files with 798 additions and 753 deletions

View File

@@ -30,7 +30,7 @@
* \brief GHOST C-API function and type declarations. * \brief GHOST C-API function and type declarations.
*/ */
#ifndef __GHOST_C_API_H__ #ifndef __GHOST_C_API_H__
#define __GHOST_C_API_H__ #define __GHOST_C_API_H__
#include "GHOST_Types.h" #include "GHOST_Types.h"
@@ -113,10 +113,10 @@ extern GHOST_TUns64 GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle);
* @return A timer task (0 if timer task installation failed). * @return A timer task (0 if timer task installation failed).
*/ */
extern GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle, extern GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle,
GHOST_TUns64 delay, GHOST_TUns64 delay,
GHOST_TUns64 interval, GHOST_TUns64 interval,
GHOST_TimerProcPtr timerProc, GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData); GHOST_TUserDataPtr userData);
/** /**
* Removes a timer. * Removes a timer.
@@ -125,11 +125,11 @@ extern GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle, extern GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle,
GHOST_TimerTaskHandle timertaskhandle); GHOST_TimerTaskHandle timertaskhandle);
/*************************************************************************************** /***************************************************************************************
** Display/window management functionality ** Display/window management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the number of displays on this system. * Returns the number of displays on this system.
@@ -146,8 +146,8 @@ extern GHOST_TUns8 GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle);
* @return void. * @return void.
*/ */
extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle, extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
GHOST_TUns32* width, GHOST_TUns32 *width,
GHOST_TUns32* height); GHOST_TUns32 *height);
/** /**
* Create a new window. * Create a new window.
@@ -166,15 +166,15 @@ extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
* @return A handle to the new window ( == NULL if creation failed). * @return A handle to the new window ( == NULL if creation failed).
*/ */
extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle, extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
const char* title, const char *title,
GHOST_TInt32 left, GHOST_TInt32 left,
GHOST_TInt32 top, GHOST_TInt32 top,
GHOST_TUns32 width, GHOST_TUns32 width,
GHOST_TUns32 height, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
const int stereoVisual, const int stereoVisual,
const GHOST_TUns16 numOfAASamples); const GHOST_TUns16 numOfAASamples);
/** /**
* Returns the window user data. * Returns the window user data.
@@ -189,7 +189,7 @@ extern GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandl
* @param data The window user data. * @param data The window user data.
*/ */
extern void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle, extern void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle,
GHOST_TUserDataPtr userdata); GHOST_TUserDataPtr userdata);
/** /**
* Dispose a window. * Dispose a window.
@@ -198,7 +198,7 @@ extern void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle, extern GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle,
GHOST_WindowHandle windowhandle); GHOST_WindowHandle windowhandle);
/** /**
* Returns whether a window is valid. * Returns whether a window is valid.
@@ -207,7 +207,7 @@ extern GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle,
* @return Indication of validity. * @return Indication of validity.
*/ */
extern int GHOST_ValidWindow(GHOST_SystemHandle systemhandle, extern int GHOST_ValidWindow(GHOST_SystemHandle systemhandle,
GHOST_WindowHandle windowhandle); GHOST_WindowHandle windowhandle);
/** /**
* Begins full screen mode. * Begins full screen mode.
@@ -217,8 +217,8 @@ extern int GHOST_ValidWindow(GHOST_SystemHandle systemhandle,
* This window is invalid after full screen has been ended. * This window is invalid after full screen has been ended.
*/ */
extern GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle, extern GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle,
GHOST_DisplaySetting* setting, GHOST_DisplaySetting *setting,
const int stereoVisual); const int stereoVisual);
/** /**
* Ends full screen mode. * Ends full screen mode.
@@ -235,8 +235,8 @@ extern GHOST_TSuccess GHOST_EndFullScreen(GHOST_SystemHandle systemhandle);
extern int GHOST_GetFullScreen(GHOST_SystemHandle systemhandle); extern int GHOST_GetFullScreen(GHOST_SystemHandle systemhandle);
/*************************************************************************************** /***************************************************************************************
** Event management functionality ** Event management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Retrieves events from the system and stores them in the queue. * Retrieves events from the system and stores them in the queue.
@@ -261,7 +261,7 @@ extern int GHOST_DispatchEvents(GHOST_SystemHandle systemhandle);
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, extern GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle,
GHOST_EventConsumerHandle consumerhandle); GHOST_EventConsumerHandle consumerhandle);
/** /**
* Remove the given event consumer to our list. * Remove the given event consumer to our list.
@@ -270,11 +270,11 @@ extern GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_RemoveEventConsumer(GHOST_SystemHandle systemhandle, extern GHOST_TSuccess GHOST_RemoveEventConsumer(GHOST_SystemHandle systemhandle,
GHOST_EventConsumerHandle consumerhandle); GHOST_EventConsumerHandle consumerhandle);
/*************************************************************************************** /***************************************************************************************
** Progress bar functionality ** Progress bar functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Sets the progress bar value displayed in the window/application icon * Sets the progress bar value displayed in the window/application icon
@@ -290,8 +290,8 @@ extern GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle, floa
extern GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle); extern GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle);
/*************************************************************************************** /***************************************************************************************
** Cursor management functionality ** Cursor management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the current cursor shape. * Returns the current cursor shape.
@@ -307,7 +307,7 @@ extern GHOST_TStandardCursor GHOST_GetCursorShape(GHOST_WindowHandle windowhandl
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle,
GHOST_TStandardCursor cursorshape); GHOST_TStandardCursor cursorshape);
/** /**
* Set the shape of the cursor to a custom cursor. * Set the shape of the cursor to a custom cursor.
@@ -319,10 +319,10 @@ extern GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle,
GHOST_TUns8 bitmap[16][2], GHOST_TUns8 bitmap[16][2],
GHOST_TUns8 mask[16][2], GHOST_TUns8 mask[16][2],
int hotX, int hotX,
int hotY); int hotY);
/** /**
* Set the shape of the cursor to a custom cursor of specified size. * Set the shape of the cursor to a custom cursor of specified size.
* @param windowhandle The handle to the window * @param windowhandle The handle to the window
@@ -333,13 +333,13 @@ extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle
* @param hotY The Y coordinate of the cursor hotspot. * @param hotY The Y coordinate of the cursor hotspot.
* @param fg_color, bg_color Colors of the cursor * @param fg_color, bg_color Colors of the cursor
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetCustomCursorShapeEx(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetCustomCursorShapeEx(GHOST_WindowHandle windowhandle,
GHOST_TUns8 *bitmap, GHOST_TUns8 *bitmap,
GHOST_TUns8 *mask, GHOST_TUns8 *mask,
int sizex, int sizey, int sizex, int sizey,
int hotX, int hotY, int hotX, int hotY,
int fg_color, int bg_color ); int fg_color, int bg_color);
/** /**
* Returns the visibility state of the cursor. * Returns the visibility state of the cursor.
@@ -355,7 +355,7 @@ extern int GHOST_GetCursorVisibility(GHOST_WindowHandle windowhandle);
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle,
int visible); int visible);
/** /**
* Returns the current location of the cursor (location in screen coordinates) * Returns the current location of the cursor (location in screen coordinates)
@@ -365,8 +365,8 @@ extern GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle, extern GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle,
GHOST_TInt32* x, GHOST_TInt32 *x,
GHOST_TInt32* y); GHOST_TInt32 *y);
/** /**
* Updates the location of the cursor (location in screen coordinates). * Updates the location of the cursor (location in screen coordinates).
@@ -377,8 +377,8 @@ extern GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle, extern GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
GHOST_TInt32 x, GHOST_TInt32 x,
GHOST_TInt32 y); GHOST_TInt32 y);
/** /**
* Grabs the cursor for a modal operation, to keep receiving * Grabs the cursor for a modal operation, to keep receiving
@@ -390,12 +390,12 @@ extern GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
GHOST_TGrabCursorMode mode, GHOST_TGrabCursorMode mode,
int* bounds); int *bounds);
/*************************************************************************************** /***************************************************************************************
** Access to mouse button and keyboard states. ** Access to mouse button and keyboard states.
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the state of a modifier key (ouside the message queue). * Returns the state of a modifier key (ouside the message queue).
@@ -405,8 +405,8 @@ extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle, extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
GHOST_TModifierKeyMask mask, GHOST_TModifierKeyMask mask,
int* isDown); int *isDown);
/** /**
* Returns the state of a mouse button (ouside the message queue). * Returns the state of a mouse button (ouside the message queue).
@@ -416,13 +416,13 @@ extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle, extern GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
GHOST_TButtonMask mask, GHOST_TButtonMask mask,
int* isDown); int *isDown);
/*************************************************************************************** /***************************************************************************************
** Drag'n'drop operations ** Drag'n'drop operations
***************************************************************************************/ ***************************************************************************************/
/** /**
* Tells if the ongoing drag'n'drop object can be accepted upon mouse drop * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
@@ -472,7 +472,7 @@ extern GHOST_TimerProcPtr GHOST_GetTimerProc(GHOST_TimerTaskHandle timertaskhand
* @param timerProc The timer callback. * @param timerProc The timer callback.
*/ */
extern void GHOST_SetTimerProc(GHOST_TimerTaskHandle timertaskhandle, extern void GHOST_SetTimerProc(GHOST_TimerTaskHandle timertaskhandle,
GHOST_TimerProcPtr timerProc); GHOST_TimerProcPtr timerProc);
/** /**
* Returns the timer user data. * Returns the timer user data.
@@ -487,7 +487,7 @@ extern GHOST_TUserDataPtr GHOST_GetTimerTaskUserData(GHOST_TimerTaskHandle timer
* @param data The timer user data. * @param data The timer user data.
*/ */
extern void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle, extern void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle,
GHOST_TUserDataPtr userData); GHOST_TUserDataPtr userData);
/** /**
* Returns indication as to whether the window is valid. * Returns indication as to whether the window is valid.
@@ -510,7 +510,7 @@ extern GHOST_TDrawingContextType GHOST_GetDrawingContextType(GHOST_WindowHandle
* @return Indication as to whether installation has succeeded. * @return Indication as to whether installation has succeeded.
*/ */
extern GHOST_TSuccess GHOST_SetDrawingContextType(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetDrawingContextType(GHOST_WindowHandle windowhandle,
GHOST_TDrawingContextType type); GHOST_TDrawingContextType type);
/** /**
* Sets the title displayed in the title bar. * Sets the title displayed in the title bar.
@@ -518,7 +518,7 @@ extern GHOST_TSuccess GHOST_SetDrawingContextType(GHOST_WindowHandle windowhandl
* @param title The title to display in the title bar. * @param title The title to display in the title bar.
*/ */
extern void GHOST_SetTitle(GHOST_WindowHandle windowhandle, extern void GHOST_SetTitle(GHOST_WindowHandle windowhandle,
const char* title); const char *title);
/** /**
* Returns the title displayed in the title bar. The title * Returns the title displayed in the title bar. The title
@@ -527,7 +527,7 @@ extern void GHOST_SetTitle(GHOST_WindowHandle windowhandle,
* @param windowhandle The handle to the window * @param windowhandle The handle to the window
* @return The title, free with free(). * @return The title, free with free().
*/ */
extern char* GHOST_GetTitle(GHOST_WindowHandle windowhandle); extern char *GHOST_GetTitle(GHOST_WindowHandle windowhandle);
/** /**
* Returns the window rectangle dimensions. * Returns the window rectangle dimensions.
@@ -558,7 +558,7 @@ void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle);
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle,
GHOST_TUns32 width); GHOST_TUns32 width);
/** /**
* Resizes client rectangle height. * Resizes client rectangle height.
@@ -567,7 +567,7 @@ extern GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle,
GHOST_TUns32 height); GHOST_TUns32 height);
/** /**
* Resizes client rectangle. * Resizes client rectangle.
@@ -577,8 +577,8 @@ extern GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
GHOST_TUns32 width, GHOST_TUns32 width,
GHOST_TUns32 height); GHOST_TUns32 height);
/** /**
* Converts a point in screen coordinates to client rectangle coordinates * Converts a point in screen coordinates to client rectangle coordinates
@@ -589,10 +589,10 @@ extern GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
* @param outY The y-coordinate in the client rectangle. * @param outY The y-coordinate in the client rectangle.
*/ */
extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle, extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
GHOST_TInt32 inX, GHOST_TInt32 inX,
GHOST_TInt32 inY, GHOST_TInt32 inY,
GHOST_TInt32* outX, GHOST_TInt32 *outX,
GHOST_TInt32* outY); GHOST_TInt32 *outY);
/** /**
* Converts a point in screen coordinates to client rectangle coordinates * Converts a point in screen coordinates to client rectangle coordinates
@@ -603,10 +603,10 @@ extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
* @param outY The y-coordinate on the screen. * @param outY The y-coordinate on the screen.
*/ */
extern void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle, extern void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle,
GHOST_TInt32 inX, GHOST_TInt32 inX,
GHOST_TInt32 inY, GHOST_TInt32 inY,
GHOST_TInt32* outX, GHOST_TInt32 *outX,
GHOST_TInt32* outY); GHOST_TInt32 *outY);
/** /**
* Returns the state of the window (normal, minimized, maximized). * Returns the state of the window (normal, minimized, maximized).
@@ -622,7 +622,7 @@ extern GHOST_TWindowState GHOST_GetWindowState(GHOST_WindowHandle windowhandle);
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle,
GHOST_TWindowState state); GHOST_TWindowState state);
/** /**
@@ -632,7 +632,7 @@ extern GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle,
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle,
GHOST_TUns8 isUnsavedChanges); GHOST_TUns8 isUnsavedChanges);
/** /**
* Sets the order of the window (bottom, top). * Sets the order of the window (bottom, top).
@@ -641,7 +641,7 @@ extern GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhand
* @return Indication of success. * @return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle, extern GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle,
GHOST_TWindowOrder order); GHOST_TWindowOrder order);
/** /**
* Swaps front and back buffers of a window. * Swaps front and back buffers of a window.
@@ -694,10 +694,10 @@ extern GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehand
* @param b Pointer to return bottom coordinate in. * @param b Pointer to return bottom coordinate in.
*/ */
extern void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle, extern void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32* l, GHOST_TInt32 *l,
GHOST_TInt32* t, GHOST_TInt32 *t,
GHOST_TInt32* r, GHOST_TInt32 *r,
GHOST_TInt32* b); GHOST_TInt32 *b);
/** /**
* Sets all members of the rectangle. * Sets all members of the rectangle.
@@ -708,10 +708,10 @@ extern void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle,
* @param b requested bottom coordinate of the rectangle * @param b requested bottom coordinate of the rectangle
*/ */
extern void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle, extern void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 l, GHOST_TInt32 l,
GHOST_TInt32 t, GHOST_TInt32 t,
GHOST_TInt32 r, GHOST_TInt32 r,
GHOST_TInt32 b); GHOST_TInt32 b);
/** /**
* Returns whether this rectangle is empty. * Returns whether this rectangle is empty.
@@ -736,7 +736,7 @@ extern GHOST_TSuccess GHOST_IsValidRectangle(GHOST_RectangleHandle rectanglehand
* @param i The amount of offset given to each extreme (negative values shrink the rectangle). * @param i The amount of offset given to each extreme (negative values shrink the rectangle).
*/ */
extern void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle, extern void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 i); GHOST_TInt32 i);
/** /**
* Does a union of the rectangle given and this rectangle. * Does a union of the rectangle given and this rectangle.
@@ -745,7 +745,7 @@ extern void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle,
* @param r The rectangle that is input for the union operation. * @param r The rectangle that is input for the union operation.
*/ */
extern void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle, extern void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_RectangleHandle anotherrectanglehandle); GHOST_RectangleHandle anotherrectanglehandle);
/** /**
* Grows the rectangle to included a point. * Grows the rectangle to included a point.
@@ -754,8 +754,8 @@ extern void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle,
* @param y The y-coordinate of the point. * @param y The y-coordinate of the point.
*/ */
extern void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle, extern void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 x, GHOST_TInt32 x,
GHOST_TInt32 y); GHOST_TInt32 y);
/** /**
* Returns whether the point is inside this rectangle. * Returns whether the point is inside this rectangle.
@@ -766,8 +766,8 @@ extern void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle,
* @return intean value (true if point is inside). * @return intean value (true if point is inside).
*/ */
extern GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehandle, extern GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 x, GHOST_TInt32 x,
GHOST_TInt32 y); GHOST_TInt32 y);
/** /**
* Returns whether the rectangle is inside this rectangle. * Returns whether the rectangle is inside this rectangle.
@@ -776,7 +776,7 @@ extern GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehan
* @return visibility (not, partially or fully visible). * @return visibility (not, partially or fully visible).
*/ */
extern GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rectanglehandle, extern GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rectanglehandle,
GHOST_RectangleHandle anotherrectanglehandle); GHOST_RectangleHandle anotherrectanglehandle);
/** /**
* Sets rectangle members. * Sets rectangle members.
@@ -786,8 +786,8 @@ extern GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rect
* @param cy requested center y-coordinate of the rectangle * @param cy requested center y-coordinate of the rectangle
*/ */
extern void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle, extern void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 cx, GHOST_TInt32 cx,
GHOST_TInt32 cy); GHOST_TInt32 cy);
/** /**
* Sets rectangle members. * Sets rectangle members.
@@ -800,10 +800,10 @@ extern void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle,
* @param h requested height of the rectangle * @param h requested height of the rectangle
*/ */
extern void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle, extern void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle,
GHOST_TInt32 cx, GHOST_TInt32 cx,
GHOST_TInt32 cy, GHOST_TInt32 cy,
GHOST_TInt32 w, GHOST_TInt32 w,
GHOST_TInt32 h); GHOST_TInt32 h);
/** /**
* Clips a rectangle. * Clips a rectangle.
@@ -814,14 +814,14 @@ extern void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle,
* @return whether clipping has occurred * @return whether clipping has occurred
*/ */
extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle, extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
GHOST_RectangleHandle anotherrectanglehandle); GHOST_RectangleHandle anotherrectanglehandle);
/** /**
* Return the data from the clipboad * Return the data from the clipboad
* @param return the selection instead, X11 only feature * @param return the selection instead, X11 only feature
* @return clipboard data * @return clipboard data
*/ */
extern GHOST_TUns8* GHOST_getClipboard(int selection); extern GHOST_TUns8 *GHOST_getClipboard(int selection);
/** /**
* Put data to the Clipboard * Put data to the Clipboard

View File

@@ -77,7 +77,7 @@ public:
* or NULL if it is a 'system' event. * or NULL if it is a 'system' event.
* @return The generating window. * @return The generating window.
*/ */
virtual GHOST_IWindow* getWindow() = 0; virtual GHOST_IWindow *getWindow() = 0;
/** /**
* Returns the event data. * Returns the event data.
@@ -87,8 +87,12 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC
public: public:
void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GHOST:GHOST_IEvent"); } void *operator new(size_t num_bytes) {
void operator delete( void *mem ) { MEM_freeN(mem); } return MEM_mallocN(num_bytes, "GHOST:GHOST_IEvent");
}
void operator delete(void *mem) {
MEM_freeN(mem);
}
#endif #endif
}; };

View File

@@ -61,7 +61,7 @@ public:
* @param event The event that can be handled or ignored. * @param event The event that can be handled or ignored.
* @return Indication as to whether the event was handled. * @return Indication as to whether the event was handled.
*/ */
virtual bool processEvent(GHOST_IEvent* event) = 0; virtual bool processEvent(GHOST_IEvent *event) = 0;
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC
public: public:

View File

@@ -129,12 +129,12 @@ class GHOST_IEventConsumer;
* There should be only one system class in an application. * There should be only one system class in an application.
* Therefore, the routines to create and dispose the system are static. * Therefore, the routines to create and dispose the system are static.
* Provides: * Provides:
* -# Time(r) management. * -# Time(r) management.
* -# Display/window management (windows are only created on the main display). * -# Display/window management (windows are only created on the main display).
* -# Event management. * -# Event management.
* -# Cursor shape management (no custom cursors for now). * -# Cursor shape management (no custom cursors for now).
* -# Access to the state of the mouse buttons and the keyboard. * -# Access to the state of the mouse buttons and the keyboard.
* -# Menus for windows with events generated when they are accessed (this is * -# Menus for windows with events generated when they are accessed (this is
* work in progress). * work in progress).
* @author Maarten Gribnau * @author Maarten Gribnau
* @date May 30, 2001 * @date May 30, 2001
@@ -158,25 +158,27 @@ public:
* Returns a pointer to the one and only system (nil if it hasn't been created). * Returns a pointer to the one and only system (nil if it hasn't been created).
* @return A pointer to the system. * @return A pointer to the system.
*/ */
static GHOST_ISystem* getSystem(); static GHOST_ISystem *getSystem();
protected: protected:
/** /**
* Constructor. * Constructor.
* Protected default constructor to force use of static createSystem member. * Protected default constructor to force use of static createSystem member.
*/ */
GHOST_ISystem() {} GHOST_ISystem() {
}
/** /**
* Destructor. * Destructor.
* Protected default constructor to force use of static dispose member. * Protected default constructor to force use of static dispose member.
*/ */
virtual ~GHOST_ISystem() {} virtual ~GHOST_ISystem() {
}
public: public:
/*************************************************************************************** /***************************************************************************************
** Time(r) functionality ** Time(r) functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the system time. * Returns the system time.
@@ -196,7 +198,7 @@ public:
* @param userData Placeholder for user data. * @param userData Placeholder for user data.
* @return A timer task (0 if timer task installation failed). * @return A timer task (0 if timer task installation failed).
*/ */
virtual GHOST_ITimerTask* installTimer(GHOST_TUns64 delay, virtual GHOST_ITimerTask *installTimer(GHOST_TUns64 delay,
GHOST_TUns64 interval, GHOST_TUns64 interval,
GHOST_TimerProcPtr timerProc, GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData = 0) = 0; GHOST_TUserDataPtr userData = 0) = 0;
@@ -206,17 +208,17 @@ public:
* @param timerTask Timer task to be removed. * @param timerTask Timer task to be removed.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess removeTimer(GHOST_ITimerTask* timerTask) = 0; virtual GHOST_TSuccess removeTimer(GHOST_ITimerTask *timerTask) = 0;
/*************************************************************************************** /***************************************************************************************
** Display/window management functionality ** Display/window management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the number of displays on this system. * Returns the number of displays on this system.
* @return The number of displays. * @return The number of displays.
*/ */
virtual GHOST_TUns8 getNumDisplays() const = 0; virtual GHOST_TUns8 getNumDisplays() const = 0;
/** /**
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
@@ -237,30 +239,30 @@ public:
* @param type The type of drawing context installed in this window. * @param type The type of drawing context installed in this window.
* @param stereoVisual Create a stereo visual for quad buffered stereo. * @param stereoVisual Create a stereo visual for quad buffered stereo.
* @param numOfAASamples Number of samples used for AA (zero if no AA) * @param numOfAASamples Number of samples used for AA (zero if no AA)
* @param parentWindow Parent (embedder) window * @param parentWindow Parent (embedder) window
* @return The new window (or 0 if creation failed). * @return The new window (or 0 if creation failed).
*/ */
virtual GHOST_IWindow* createWindow( virtual GHOST_IWindow *createWindow(
const STR_String& title, const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TDrawingContextType type, GHOST_TWindowState state, GHOST_TDrawingContextType type,
const bool stereoVisual = false, const bool stereoVisual = false,
const GHOST_TUns16 numOfAASamples = 0, const GHOST_TUns16 numOfAASamples = 0,
const GHOST_TEmbedderWindowID parentWindow = 0) = 0; const GHOST_TEmbedderWindowID parentWindow = 0) = 0;
/** /**
* Dispose a window. * Dispose a window.
* @param window Pointer to the window to be disposed. * @param window Pointer to the window to be disposed.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess disposeWindow(GHOST_IWindow* window) = 0; virtual GHOST_TSuccess disposeWindow(GHOST_IWindow *window) = 0;
/** /**
* Returns whether a window is valid. * Returns whether a window is valid.
* @param window Pointer to the window to be checked. * @param window Pointer to the window to be checked.
* @return Indication of validity. * @return Indication of validity.
*/ */
virtual bool validWindow(GHOST_IWindow* window) = 0; virtual bool validWindow(GHOST_IWindow *window) = 0;
/** /**
* Begins full screen mode. * Begins full screen mode.
@@ -269,8 +271,8 @@ public:
* This window is invalid after full screen has been ended. * This window is invalid after full screen has been ended.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow **window,
const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0) = 0; const bool stereoVisual, const GHOST_TUns16 numOfAASamples = 0) = 0;
/** /**
* Updates the resolution while in fullscreen mode. * Updates the resolution while in fullscreen mode.
@@ -279,7 +281,7 @@ public:
* *
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess updateFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window) = 0; virtual GHOST_TSuccess updateFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow **window) = 0;
/** /**
* Ends full screen mode. * Ends full screen mode.
@@ -294,8 +296,8 @@ public:
virtual bool getFullScreen(void) = 0; virtual bool getFullScreen(void) = 0;
/*************************************************************************************** /***************************************************************************************
** Event management functionality ** Event management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Retrieves events from the system and stores them in the queue. * Retrieves events from the system and stores them in the queue.
@@ -315,18 +317,18 @@ public:
* @param consumer The event consumer to add. * @param consumer The event consumer to add.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess addEventConsumer(GHOST_IEventConsumer* consumer) = 0; virtual GHOST_TSuccess addEventConsumer(GHOST_IEventConsumer *consumer) = 0;
/** /**
* Removes the given event consumer to our list. * Removes the given event consumer to our list.
* @param consumer The event consumer to remove. * @param consumer The event consumer to remove.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess removeEventConsumer(GHOST_IEventConsumer* consumer) = 0; virtual GHOST_TSuccess removeEventConsumer(GHOST_IEventConsumer *consumer) = 0;
/*************************************************************************************** /***************************************************************************************
** Cursor management functionality ** Cursor management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the current location of the cursor (location in screen coordinates) * Returns the current location of the cursor (location in screen coordinates)
@@ -346,8 +348,8 @@ public:
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) = 0; virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) = 0;
/*************************************************************************************** /***************************************************************************************
** Access to mouse button and keyboard states. ** Access to mouse button and keyboard states.
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the state of a modifier key (ouside the message queue). * Returns the state of a modifier key (ouside the message queue).
@@ -377,15 +379,15 @@ public:
virtual int toggleConsole(int action) = 0; virtual int toggleConsole(int action) = 0;
/*************************************************************************************** /***************************************************************************************
** Access to clipboard. ** Access to clipboard.
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the selection buffer * Returns the selection buffer
* @return Returns "unsinged char" from X11 XA_CUT_BUFFER0 buffer * @return Returns "unsinged char" from X11 XA_CUT_BUFFER0 buffer
* *
*/ */
virtual GHOST_TUns8* getClipboard(bool selection) const = 0; virtual GHOST_TUns8 *getClipboard(bool selection) const = 0;
/** /**
* Put data to the Clipboard * Put data to the Clipboard
@@ -396,7 +398,7 @@ public:
* Confirms quitting he program when there is just one window left open * Confirms quitting he program when there is just one window left open
* in the application * in the application
*/ */
virtual int confirmQuit(GHOST_IWindow * window) const = 0; virtual int confirmQuit(GHOST_IWindow *window) const = 0;
protected: protected:
/** /**
* Initialize the system. * Initialize the system.
@@ -411,12 +413,16 @@ protected:
virtual GHOST_TSuccess exit() = 0; virtual GHOST_TSuccess exit() = 0;
/** The one and only system */ /** The one and only system */
static GHOST_ISystem* m_system; static GHOST_ISystem *m_system;
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC
public: public:
void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GHOST:GHOST_ISystem"); } void *operator new(size_t num_bytes) {
void operator delete( void *mem ) { MEM_freeN(mem); } return MEM_mallocN(num_bytes, "GHOST:GHOST_ISystem");
}
void operator delete(void *mem) {
MEM_freeN(mem);
}
#endif #endif
}; };

View File

@@ -52,20 +52,22 @@ public:
* Returns a pointer to the one and only system (nil if it hasn't been created). * Returns a pointer to the one and only system (nil if it hasn't been created).
* @return A pointer to the system. * @return A pointer to the system.
*/ */
static GHOST_ISystemPaths* get(); static GHOST_ISystemPaths *get();
protected: protected:
/** /**
* Constructor. * Constructor.
* Protected default constructor to force use of static createSystem member. * Protected default constructor to force use of static createSystem member.
*/ */
GHOST_ISystemPaths() {} GHOST_ISystemPaths() {
}
/** /**
* Destructor. * Destructor.
* Protected default constructor to force use of static dispose member. * Protected default constructor to force use of static dispose member.
*/ */
virtual ~GHOST_ISystemPaths() {} virtual ~GHOST_ISystemPaths() {
}
public: public:
/** /**
@@ -73,29 +75,29 @@ public:
* "unpack and run" path, then look for properly installed path, not including versioning. * "unpack and run" path, then look for properly installed path, not including versioning.
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/). * @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
*/ */
virtual const GHOST_TUns8* getSystemDir() const = 0; virtual const GHOST_TUns8 *getSystemDir() const = 0;
/** /**
* Determine the base dir in which user configuration is stored, not including versioning. * Determine the base dir in which user configuration is stored, not including versioning.
* If needed, it will create the base directory. * If needed, it will create the base directory.
* @return Unsigned char string pointing to user dir (eg ~/.blender/). * @return Unsigned char string pointing to user dir (eg ~/.blender/).
*/ */
virtual const GHOST_TUns8* getUserDir() const = 0; virtual const GHOST_TUns8 *getUserDir() const = 0;
/** /**
* Determine the directory of the current binary * Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir * @return Unsigned char string pointing to the binary dir
*/ */
virtual const GHOST_TUns8* getBinaryDir() const = 0; virtual const GHOST_TUns8 *getBinaryDir() const = 0;
/** /**
* Add the file to the operating system most recently used files * Add the file to the operating system most recently used files
*/ */
virtual void addToSystemRecentFiles(const char* filename) const = 0; virtual void addToSystemRecentFiles(const char *filename) const = 0;
private: private:
/** The one and only system paths*/ /** The one and only system paths*/
static GHOST_ISystemPaths* m_systemPaths; static GHOST_ISystemPaths *m_systemPaths;
}; };
#endif #endif

View File

@@ -86,8 +86,12 @@ public:
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC
public: public:
void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GHOST:GHOST_ITimerTask"); } void *operator new(size_t num_bytes) {
void operator delete( void *mem ) { MEM_freeN(mem); } return MEM_mallocN(num_bytes, "GHOST:GHOST_ITimerTask");
}
void operator delete(void *mem) {
MEM_freeN(mem);
}
#endif #endif
}; };

View File

@@ -70,13 +70,13 @@ public:
* Returns indication as to whether the window is valid. * Returns indication as to whether the window is valid.
* @return The validity of the window. * @return The validity of the window.
*/ */
virtual bool getValid() const = 0; virtual bool getValid() const = 0;
/** /**
* Returns the associated OS object/handle * Returns the associated OS object/handle
* @return The associated OS object/handle * @return The associated OS object/handle
*/ */
virtual void* getOSWindow() const = 0; virtual void *getOSWindow() const = 0;
/** /**
* Returns the type of drawing context used in this window. * Returns the type of drawing context used in this window.
@@ -108,33 +108,33 @@ public:
* These are screen coordinates. * These are screen coordinates.
* @param bounds The bounding rectangle of the window. * @param bounds The bounding rectangle of the window.
*/ */
virtual void getWindowBounds(GHOST_Rect& bounds) const = 0; virtual void getWindowBounds(GHOST_Rect& bounds) const = 0;
/** /**
* Returns the client rectangle dimensions. * Returns the client rectangle dimensions.
* The left and top members of the rectangle are always zero. * The left and top members of the rectangle are always zero.
* @param bounds The bounding rectangle of the client area of the window. * @param bounds The bounding rectangle of the client area of the window.
*/ */
virtual void getClientBounds(GHOST_Rect& bounds) const = 0; virtual void getClientBounds(GHOST_Rect& bounds) const = 0;
/** /**
* Resizes client rectangle width. * Resizes client rectangle width.
* @param width The new width of the client area of the window. * @param width The new width of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width) = 0; virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width) = 0;
/** /**
* Resizes client rectangle height. * Resizes client rectangle height.
* @param height The new height of the client area of the window. * @param height The new height of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height) = 0; virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height) = 0;
/** /**
* Resizes client rectangle. * Resizes client rectangle.
* @param width The new width of the client area of the window. * @param width The new width of the client area of the window.
* @param height The new height of the client area of the window. * @param height The new height of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) = 0; virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) = 0;
/** /**
* Converts a point in screen coordinates to client rectangle coordinates * Converts a point in screen coordinates to client rectangle coordinates
@@ -143,7 +143,7 @@ public:
* @param outX The x-coordinate in the client rectangle. * @param outX The x-coordinate in the client rectangle.
* @param outY The y-coordinate in the client rectangle. * @param outY The y-coordinate in the client rectangle.
*/ */
virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0; virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0;
/** /**
* Converts a point in screen coordinates to client rectangle coordinates * Converts a point in screen coordinates to client rectangle coordinates
@@ -152,7 +152,7 @@ public:
* @param outX The x-coordinate on the screen. * @param outX The x-coordinate on the screen.
* @param outY The y-coordinate on the screen. * @param outY The y-coordinate on the screen.
*/ */
virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0; virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0;
/** /**
* Tells if the ongoing drag'n'drop object can be accepted upon mouse drop * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
@@ -232,14 +232,14 @@ public:
* Returns the tablet data (pressure etc). * Returns the tablet data (pressure etc).
* @return The tablet data (pressure etc). * @return The tablet data (pressure etc).
*/ */
virtual const GHOST_TabletData* GetTabletData() = 0; virtual const GHOST_TabletData *GetTabletData() = 0;
/*************************************************************************************** /***************************************************************************************
** Progress bar functionality ** Progress bar functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Sets the progress bar value displayed in the window/application icon * Sets the progress bar value displayed in the window/application icon
* @param progress The progress % * @param progress The progress %
*/ */
virtual GHOST_TSuccess setProgressBar(float progress) = 0; virtual GHOST_TSuccess setProgressBar(float progress) = 0;
@@ -250,8 +250,8 @@ public:
virtual GHOST_TSuccess endProgressBar() = 0; virtual GHOST_TSuccess endProgressBar() = 0;
/*************************************************************************************** /***************************************************************************************
** Cursor management functionality ** Cursor management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the current cursor shape. * Returns the current cursor shape.
@@ -275,15 +275,15 @@ public:
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 bitmap[16][2], virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 bitmap[16][2],
GHOST_TUns8 mask[16][2], GHOST_TUns8 mask[16][2],
int hotX, int hotX,
int hotY) = 0; int hotY) = 0;
virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 *bitmap, virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 *bitmap,
GHOST_TUns8 *mask, GHOST_TUns8 *mask,
int sizex, int sizey, int sizex, int sizey,
int hotX, int hotY, int hotX, int hotY,
int fg_color, int bg_color) = 0; int fg_color, int bg_color) = 0;
/** /**
* Returns the visibility state of the cursor. * Returns the visibility state of the cursor.

View File

@@ -30,7 +30,7 @@
*/ */
#ifndef __GHOST_PATH_API_H__ #ifndef __GHOST_PATH_API_H__
#define __GHOST_PATH_API_H__ #define __GHOST_PATH_API_H__
#include "GHOST_Types.h" #include "GHOST_Types.h"
@@ -58,25 +58,25 @@ extern GHOST_TSuccess GHOST_DisposeSystemPaths(void);
* "unpack and run" path, then look for properly installed path, not including versioning. * "unpack and run" path, then look for properly installed path, not including versioning.
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/). * @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
*/ */
extern const GHOST_TUns8* GHOST_getSystemDir(void); extern const GHOST_TUns8 *GHOST_getSystemDir(void);
/** /**
* Determine the base dir in which user configuration is stored, not including versioning. * Determine the base dir in which user configuration is stored, not including versioning.
* @return Unsigned char string pointing to user dir (eg ~). * @return Unsigned char string pointing to user dir (eg ~).
*/ */
extern const GHOST_TUns8* GHOST_getUserDir(void); extern const GHOST_TUns8 *GHOST_getUserDir(void);
/** /**
* Determine the dir in which the binary file is found. * Determine the dir in which the binary file is found.
* @return Unsigned char string pointing to binary dir (eg ~/usr/local/bin/). * @return Unsigned char string pointing to binary dir (eg ~/usr/local/bin/).
*/ */
extern const GHOST_TUns8* GHOST_getBinaryDir(void); extern const GHOST_TUns8 *GHOST_getBinaryDir(void);
/** /**
* Add the file to the operating system most recently used files * Add the file to the operating system most recently used files
*/ */
extern void GHOST_addToSystemRecentFiles(const char* filename); extern void GHOST_addToSystemRecentFiles(const char *filename);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -55,20 +55,23 @@ public:
* @param r requested right coordinate of the rectangle * @param r requested right coordinate of the rectangle
* @param b requested bottom coordinate of the rectangle * @param b requested bottom coordinate of the rectangle
*/ */
GHOST_Rect(GHOST_TInt32 l=0, GHOST_TInt32 t=0, GHOST_TInt32 r=0, GHOST_TInt32 b=0) GHOST_Rect(GHOST_TInt32 l = 0, GHOST_TInt32 t = 0, GHOST_TInt32 r = 0, GHOST_TInt32 b = 0)
: m_l(l), m_t(t), m_r(r), m_b(b) {} : m_l(l), m_t(t), m_r(r), m_b(b)
{}
/** /**
* Copy constructor. * Copy constructor.
* @param r rectangle to copy * @param r rectangle to copy
*/ */
GHOST_Rect(const GHOST_Rect& r) GHOST_Rect(const GHOST_Rect& r)
: m_l(r.m_l), m_t(r.m_t), m_r(r.m_r), m_b(r.m_b) {} : m_l(r.m_l), m_t(r.m_t), m_r(r.m_r), m_b(r.m_b)
{}
/** /**
* Destructor. * Destructor.
*/ */
virtual ~GHOST_Rect() {}; virtual ~GHOST_Rect()
{};
/** /**
* Access to rectangle width. * Access to rectangle width.
@@ -155,7 +158,7 @@ public:
* @param cx requested center x-coordinate of the rectangle * @param cx requested center x-coordinate of the rectangle
* @param cy requested center y-coordinate of the rectangle * @param cy requested center y-coordinate of the rectangle
*/ */
virtual void setCenter(GHOST_TInt32 cx, GHOST_TInt32 cy); virtual void setCenter(GHOST_TInt32 cx, GHOST_TInt32 cy);
/** /**
* Sets rectangle members. * Sets rectangle members.
@@ -166,7 +169,7 @@ public:
* @param w requested width of the rectangle * @param w requested width of the rectangle
* @param h requested height of the rectangle * @param h requested height of the rectangle
*/ */
virtual void setCenter(GHOST_TInt32 cx, GHOST_TInt32 cy, GHOST_TInt32 w, GHOST_TInt32 h); virtual void setCenter(GHOST_TInt32 cx, GHOST_TInt32 cy, GHOST_TInt32 w, GHOST_TInt32 h);
/** /**
* Clips a rectangle. * Clips a rectangle.
@@ -175,7 +178,7 @@ public:
* @param r the rectangle to clip * @param r the rectangle to clip
* @return whether clipping has occurred * @return whether clipping has occurred
*/ */
virtual bool clip(GHOST_Rect& r) const; virtual bool clip(GHOST_Rect& r) const;
/** Left coordinate of the rectangle */ /** Left coordinate of the rectangle */
GHOST_TInt32 m_l; GHOST_TInt32 m_l;
@@ -209,7 +212,7 @@ inline void GHOST_Rect::set(GHOST_TInt32 l, GHOST_TInt32 t, GHOST_TInt32 r, GHOS
m_l = l; m_t = t; m_r = r; m_b = b; m_l = l; m_t = t; m_r = r; m_b = b;
} }
inline bool GHOST_Rect::isEmpty() const inline bool GHOST_Rect::isEmpty() const
{ {
return (getWidth() == 0) || (getHeight() == 0); return (getWidth() == 0) || (getHeight() == 0);
} }
@@ -237,18 +240,18 @@ inline void GHOST_Rect::unionPoint(GHOST_TInt32 x, GHOST_TInt32 y)
#include <stdio.h> #include <stdio.h>
inline void GHOST_Rect::wrapPoint(GHOST_TInt32 &x, GHOST_TInt32 &y, GHOST_TInt32 ofs) inline void GHOST_Rect::wrapPoint(GHOST_TInt32 &x, GHOST_TInt32 &y, GHOST_TInt32 ofs)
{ {
GHOST_TInt32 w= getWidth(); GHOST_TInt32 w = getWidth();
GHOST_TInt32 h= getHeight(); GHOST_TInt32 h = getHeight();
/* highly unlikely but avoid eternal loop */ /* highly unlikely but avoid eternal loop */
if (w-ofs*2 <= 0 || h-ofs*2 <= 0) { if (w - ofs * 2 <= 0 || h - ofs * 2 <= 0) {
return; return;
} }
while(x-ofs < m_l) x+= w-(ofs*2); while (x - ofs < m_l) x += w - (ofs * 2);
while(y-ofs < m_t) y+= h-(ofs*2); while (y - ofs < m_t) y += h - (ofs * 2);
while(x+ofs > m_r) x-= w-(ofs*2); while (x + ofs > m_r) x -= w - (ofs * 2);
while(y+ofs > m_b) y-= h-(ofs*2); while (y + ofs > m_b) y -= h - (ofs * 2);
} }
inline bool GHOST_Rect::isInside(GHOST_TInt32 x, GHOST_TInt32 y) const inline bool GHOST_Rect::isInside(GHOST_TInt32 x, GHOST_TInt32 y) const

View File

@@ -39,22 +39,22 @@
#define GHOST_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name #define GHOST_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
typedef char GHOST_TInt8; typedef char GHOST_TInt8;
typedef unsigned char GHOST_TUns8; typedef unsigned char GHOST_TUns8;
typedef short GHOST_TInt16; typedef short GHOST_TInt16;
typedef unsigned short GHOST_TUns16; typedef unsigned short GHOST_TUns16;
typedef int GHOST_TInt32; typedef int GHOST_TInt32;
typedef unsigned int GHOST_TUns32; typedef unsigned int GHOST_TUns32;
#if defined(WIN32) && !defined(FREE_WINDOWS) #if defined(WIN32) && !defined(FREE_WINDOWS)
typedef __int64 GHOST_TInt64; typedef __int64 GHOST_TInt64;
typedef unsigned __int64 GHOST_TUns64; typedef unsigned __int64 GHOST_TUns64;
#else #else
typedef long long GHOST_TInt64; typedef long long GHOST_TInt64;
typedef unsigned long long GHOST_TUns64; typedef unsigned long long GHOST_TUns64;
#endif #endif
typedef void* GHOST_TUserDataPtr; typedef void *GHOST_TUserDataPtr;
typedef enum typedef enum
{ {
@@ -77,9 +77,9 @@ typedef enum {
typedef struct GHOST_TabletData { typedef struct GHOST_TabletData {
GHOST_TTabletMode Active; /* 0=None, 1=Stylus, 2=Eraser */ GHOST_TTabletMode Active; /* 0=None, 1=Stylus, 2=Eraser */
float Pressure; /* range 0.0 (not touching) to 1.0 (full pressure) */ float Pressure; /* range 0.0 (not touching) to 1.0 (full pressure) */
float Xtilt; /* range 0.0 (upright) to 1.0 (tilted fully against the tablet surface) */ float Xtilt; /* range 0.0 (upright) to 1.0 (tilted fully against the tablet surface) */
float Ytilt; /* as above */ float Ytilt; /* as above */
} GHOST_TabletData; } GHOST_TabletData;
@@ -152,14 +152,14 @@ typedef enum {
typedef enum { typedef enum {
GHOST_kEventUnknown = 0, GHOST_kEventUnknown = 0,
GHOST_kEventCursorMove, /// Mouse move event GHOST_kEventCursorMove, /// Mouse move event
GHOST_kEventButtonDown, /// Mouse button event GHOST_kEventButtonDown, /// Mouse button event
GHOST_kEventButtonUp, /// Mouse button event GHOST_kEventButtonUp, /// Mouse button event
GHOST_kEventWheel, /// Mouse wheel event GHOST_kEventWheel, /// Mouse wheel event
GHOST_kEventTrackpad, /// Trackpad event GHOST_kEventTrackpad, /// Trackpad event
GHOST_kEventNDOFMotion, /// N degree of freedom device motion event GHOST_kEventNDOFMotion, /// N degree of freedom device motion event
GHOST_kEventNDOFButton, /// N degree of freedom device button event GHOST_kEventNDOFButton, /// N degree of freedom device button event
GHOST_kEventKeyDown, GHOST_kEventKeyDown,
GHOST_kEventKeyUp, GHOST_kEventKeyUp,
@@ -289,8 +289,8 @@ typedef enum {
GHOST_kKeyRightControl, GHOST_kKeyRightControl,
GHOST_kKeyLeftAlt, GHOST_kKeyLeftAlt,
GHOST_kKeyRightAlt, GHOST_kKeyRightAlt,
GHOST_kKeyOS, // Command key on Apple, Windows key(s) on Windows GHOST_kKeyOS, // Command key on Apple, Windows key(s) on Windows
GHOST_kKeyGrLess , // German PC only! GHOST_kKeyGrLess, // German PC only!
GHOST_kKeyCapsLock, GHOST_kKeyCapsLock,
GHOST_kKeyNumLock, GHOST_kKeyNumLock,
@@ -363,13 +363,13 @@ typedef enum {
} GHOST_TKey; } GHOST_TKey;
typedef enum { typedef enum {
GHOST_kGrabDisable = 0, /* grab not set */ GHOST_kGrabDisable = 0, /* grab not set */
GHOST_kGrabNormal, /* no cursor adjustments */ GHOST_kGrabNormal, /* no cursor adjustments */
GHOST_kGrabWrap, /* wrap the mouse location to prevent limiting screen bounds */ GHOST_kGrabWrap, /* wrap the mouse location to prevent limiting screen bounds */
GHOST_kGrabHide, /* hide the mouse while grabbing and restore the original location on release (numbuts) */ GHOST_kGrabHide, /* hide the mouse while grabbing and restore the original location on release (numbuts) */
} GHOST_TGrabCursorMode; } GHOST_TGrabCursorMode;
typedef void* GHOST_TEventDataPtr; typedef void *GHOST_TEventDataPtr;
typedef struct { typedef struct {
/** The x-coordinate of the cursor position. */ /** The x-coordinate of the cursor position. */
@@ -389,7 +389,7 @@ typedef struct {
} GHOST_TEventWheelData; } GHOST_TEventWheelData;
typedef enum { typedef enum {
GHOST_kTrackpadEventUnknown =0, GHOST_kTrackpadEventUnknown = 0,
GHOST_kTrackpadEventScroll, GHOST_kTrackpadEventScroll,
GHOST_kTrackpadEventRotate, GHOST_kTrackpadEventRotate,
GHOST_kTrackpadEventSwipe, /* Reserved, not used for now */ GHOST_kTrackpadEventSwipe, /* Reserved, not used for now */
@@ -412,7 +412,7 @@ typedef struct {
typedef enum { typedef enum {
GHOST_kDragnDropTypeUnknown =0, GHOST_kDragnDropTypeUnknown = 0,
GHOST_kDragnDropTypeFilenames, /*Array of strings representing file names (full path) */ GHOST_kDragnDropTypeFilenames, /*Array of strings representing file names (full path) */
GHOST_kDragnDropTypeString, /* Unformatted text UTF-8 string */ GHOST_kDragnDropTypeString, /* Unformatted text UTF-8 string */
GHOST_kDragnDropTypeBitmap /*Bitmap image data */ GHOST_kDragnDropTypeBitmap /*Bitmap image data */
@@ -440,7 +440,7 @@ typedef enum {
GHOST_kInProgress, GHOST_kInProgress,
GHOST_kFinishing, GHOST_kFinishing,
GHOST_kFinished GHOST_kFinished
} GHOST_TProgress; } GHOST_TProgress;
typedef struct { typedef struct {
/** N-degree of freedom device data v3 [GSoC 2010] */ /** N-degree of freedom device data v3 [GSoC 2010] */
@@ -448,14 +448,14 @@ typedef struct {
// These use blender standard view coordinates, with positive rotations being CCW about the axis. // These use blender standard view coordinates, with positive rotations being CCW about the axis.
float tx, ty, tz; // translation float tx, ty, tz; // translation
float rx, ry, rz; // rotation: float rx, ry, rz; // rotation:
// axis = (rx,ry,rz).normalized // axis = (rx,ry,rz).normalized
// amount = (rx,ry,rz).magnitude [in revolutions, 1.0 = 360 deg] // amount = (rx,ry,rz).magnitude [in revolutions, 1.0 = 360 deg]
float dt; // time since previous NDOF Motion event float dt; // time since previous NDOF Motion event
GHOST_TProgress progress; // Starting, InProgress or Finishing (for modal handlers) GHOST_TProgress progress; // Starting, InProgress or Finishing (for modal handlers)
} GHOST_TEventNDOFMotionData; } GHOST_TEventNDOFMotionData;
typedef enum { GHOST_kPress, GHOST_kRelease } GHOST_TButtonAction; typedef enum { GHOST_kPress, GHOST_kRelease } GHOST_TButtonAction;
// good for mouse or other buttons too, hmmm? // good for mouse or other buttons too, hmmm?
typedef struct { typedef struct {
GHOST_TButtonAction action; GHOST_TButtonAction action;
@@ -464,7 +464,7 @@ typedef struct {
typedef struct { typedef struct {
/** The key code. */ /** The key code. */
GHOST_TKey key; GHOST_TKey key;
/* ascii / utf8: both should always be set when possible, /* ascii / utf8: both should always be set when possible,
* - ascii may be '\0' however if the user presses a non ascii key * - ascii may be '\0' however if the user presses a non ascii key
@@ -476,20 +476,20 @@ typedef struct {
* use ascii, unicode is ignored - campbell. * use ascii, unicode is ignored - campbell.
*/ */
/** The ascii code for the key event ('\0' if none). */ /** The ascii code for the key event ('\0' if none). */
char ascii; char ascii;
/** The unicode character. if the length is 6, not NULL terminated if all 6 are set */ /** The unicode character. if the length is 6, not NULL terminated if all 6 are set */
char utf8_buf[6]; char utf8_buf[6];
} GHOST_TEventKeyData; } GHOST_TEventKeyData;
typedef struct { typedef struct {
/** Number of pixels on a line. */ /** Number of pixels on a line. */
GHOST_TUns32 xPixels; GHOST_TUns32 xPixels;
/** Number of lines. */ /** Number of lines. */
GHOST_TUns32 yPixels; GHOST_TUns32 yPixels;
/** Numberof bits per pixel. */ /** Numberof bits per pixel. */
GHOST_TUns32 bpp; GHOST_TUns32 bpp;
/** Refresh rate (in Hertz). */ /** Refresh rate (in Hertz). */
GHOST_TUns32 frequency; GHOST_TUns32 frequency;
} GHOST_DisplaySetting; } GHOST_DisplaySetting;
@@ -509,10 +509,10 @@ typedef int GHOST_TEmbedderWindowID;
*/ */
#ifdef __cplusplus #ifdef __cplusplus
class GHOST_ITimerTask; class GHOST_ITimerTask;
typedef void (*GHOST_TimerProcPtr)(GHOST_ITimerTask* task, GHOST_TUns64 time); typedef void (*GHOST_TimerProcPtr)(GHOST_ITimerTask *task, GHOST_TUns64 time);
#else #else
struct GHOST_TimerTaskHandle__; struct GHOST_TimerTaskHandle__;
typedef void (*GHOST_TimerProcPtr)(struct GHOST_TimerTaskHandle__* task, GHOST_TUns64 time); typedef void (*GHOST_TimerProcPtr)(struct GHOST_TimerTaskHandle__ *task, GHOST_TUns64 time);
#endif #endif
#endif // __GHOST_TYPES_H__ #endif // __GHOST_TYPES_H__

View File

@@ -69,9 +69,9 @@ struct GHOST_Buttons {
*/ */
virtual void clear(); virtual void clear();
GHOST_TUns8 m_ButtonLeft : 1; GHOST_TUns8 m_ButtonLeft : 1;
GHOST_TUns8 m_ButtonMiddle : 1; GHOST_TUns8 m_ButtonMiddle : 1;
GHOST_TUns8 m_ButtonRight : 1; GHOST_TUns8 m_ButtonRight : 1;
}; };
#endif // __GHOST_BUTTONS_H__ #endif // __GHOST_BUTTONS_H__

View File

@@ -51,8 +51,8 @@ public:
* @param userData The data passed back though the call-back routine. * @param userData The data passed back though the call-back routine.
*/ */
GHOST_CallbackEventConsumer( GHOST_CallbackEventConsumer(
GHOST_EventCallbackProcPtr eventCallback, GHOST_EventCallbackProcPtr eventCallback,
GHOST_TUserDataPtr userData); GHOST_TUserDataPtr userData);
/** /**
* Destructor. * Destructor.
@@ -66,13 +66,13 @@ public:
* @param event The event that can be handled or ignored. * @param event The event that can be handled or ignored.
* @return Indication as to whether the event was handled. * @return Indication as to whether the event was handled.
*/ */
virtual bool processEvent(GHOST_IEvent* event); virtual bool processEvent(GHOST_IEvent *event);
protected: protected:
/** The call-back routine invoked. */ /** The call-back routine invoked. */
GHOST_EventCallbackProcPtr m_eventCallback; GHOST_EventCallbackProcPtr m_eventCallback;
/** The data passed back though the call-back routine. */ /** The data passed back though the call-back routine. */
GHOST_TUserDataPtr m_userData; GHOST_TUserDataPtr m_userData;
}; };
#endif // __GHOST_CALLBACKEVENTCONSUMER_H__ #endif // __GHOST_CALLBACKEVENTCONSUMER_H__

View File

@@ -108,7 +108,7 @@ protected:
/** Cached number of displays. */ /** Cached number of displays. */
CGDisplayCount m_numDisplays; CGDisplayCount m_numDisplays;
/** Cached display id's for each display. */ /** Cached display id's for each display. */
CGDirectDisplayID* m_displayIDs; CGDirectDisplayID *m_displayIDs;
}; };

View File

@@ -43,7 +43,7 @@ public:
GHOST_TSuccess getCurrentDisplaySetting( GHOST_TUns8 display, GHOST_DisplaySetting& setting ) const { return getDisplaySetting(display,GHOST_TInt32(0),setting); } GHOST_TSuccess getCurrentDisplaySetting( GHOST_TUns8 display, GHOST_DisplaySetting& setting ) const { return getDisplaySetting(display,GHOST_TInt32(0),setting); }
GHOST_TSuccess setCurrentDisplaySetting( GHOST_TUns8 display, const GHOST_DisplaySetting& setting ){ return GHOST_kSuccess; } GHOST_TSuccess setCurrentDisplaySetting( GHOST_TUns8 display, const GHOST_DisplaySetting& setting ){ return GHOST_kSuccess; }
private : private:
GHOST_SystemNULL * m_system; GHOST_SystemNULL * m_system;
}; };

View File

@@ -68,8 +68,8 @@ public:
setCurrentDisplaySetting(GHOST_TUns8 display, setCurrentDisplaySetting(GHOST_TUns8 display,
const GHOST_DisplaySetting& setting); const GHOST_DisplaySetting& setting);
private : private:
GHOST_SystemSDL * m_system; GHOST_SystemSDL *m_system;
SDL_DisplayMode m_mode; SDL_DisplayMode m_mode;
}; };

View File

@@ -47,22 +47,22 @@ public:
* inherited, directly or indirectly, from IUnknown. Therefore, the three * inherited, directly or indirectly, from IUnknown. Therefore, the three
* methods in IUnknown are the first entries in the VTable for every interface. * methods in IUnknown are the first entries in the VTable for every interface.
*/ */
HRESULT __stdcall QueryInterface (REFIID riid, void ** ppvObj); HRESULT __stdcall QueryInterface(REFIID riid, void **ppvObj);
ULONG __stdcall AddRef (void); ULONG __stdcall AddRef(void);
ULONG __stdcall Release (void); ULONG __stdcall Release(void);
/* IDropTarget implementation /* IDropTarget implementation
+ The IDropTarget interface is one of the interfaces you implement to * + The IDropTarget interface is one of the interfaces you implement to
provide drag-and-drop operations in your application. It contains methods * provide drag-and-drop operations in your application. It contains methods
used in any application that can be a target for data during a * used in any application that can be a target for data during a
drag-and-drop operation. A drop-target application is responsible for: * drag-and-drop operation. A drop-target application is responsible for:
* *
* - Determining the effect of the drop on the target application. * - Determining the effect of the drop on the target application.
* - Incorporating any valid dropped data when the drop occurs. * - Incorporating any valid dropped data when the drop occurs.
* - Communicating target feedback to the source so the source application * - Communicating target feedback to the source so the source application
* can provide appropriate visual feedback such as setting the cursor. * can provide appropriate visual feedback such as setting the cursor.
* - Implementing drag scrolling. * - Implementing drag scrolling.
* - Registering and revoking its application windows as drop targets. * - Registering and revoking its application windows as drop targets.
* *
* The IDropTarget interface contains methods that handle all these * The IDropTarget interface contains methods that handle all these
* responsibilities except registering and revoking the application window * responsibilities except registering and revoking the application window
@@ -70,10 +70,10 @@ public:
* RevokeDragDrop functions. * RevokeDragDrop functions.
*/ */
HRESULT __stdcall DragEnter (IDataObject * pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect); HRESULT __stdcall DragEnter(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
HRESULT __stdcall DragOver (DWORD grfKeyState, POINTL pt, DWORD * pdwEffect); HRESULT __stdcall DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
HRESULT __stdcall DragLeave (void); HRESULT __stdcall DragLeave(void);
HRESULT __stdcall Drop (IDataObject * pDataObject, DWORD grfKeyState, POINTL pt, DWORD * pdwEffect); HRESULT __stdcall Drop(IDataObject *pDataObject, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
/** /**
* Constructor * Constructor
@@ -83,7 +83,7 @@ public:
* @param window The window to register as drop target. * @param window The window to register as drop target.
* @param system The associated system. * @param system The associated system.
*/ */
GHOST_DropTargetWin32(GHOST_WindowWin32 * window, GHOST_SystemWin32 * system); GHOST_DropTargetWin32(GHOST_WindowWin32 *window, GHOST_SystemWin32 *system);
/** /**
* Destructor * Destructor
@@ -107,7 +107,7 @@ private:
* @param pDataObject Pointer to the DataObject. * @param pDataObject Pointer to the DataObject.
* @return GHOST data type. * @return GHOST data type.
*/ */
GHOST_TDragnDropTypes getGhostType(IDataObject * pDataObject); GHOST_TDragnDropTypes getGhostType(IDataObject *pDataObject);
/** /**
* Get data to pass in event. * Get data to pass in event.
@@ -115,21 +115,21 @@ private:
* @param pDataObject Pointer to the DataObject. * @param pDataObject Pointer to the DataObject.
* @return Pointer to data. * @return Pointer to data.
*/ */
void * getGhostData(IDataObject * pDataObject); void *getGhostData(IDataObject *pDataObject);
/** /**
* Allocate data as file array to pass in event. * Allocate data as file array to pass in event.
* @param pDataObject Pointer to the DataObject. * @param pDataObject Pointer to the DataObject.
* @return Pointer to data. * @return Pointer to data.
*/ */
void * getDropDataAsFilenames(IDataObject * pDataObject); void *getDropDataAsFilenames(IDataObject *pDataObject);
/** /**
* Allocate data as string to pass in event. * Allocate data as string to pass in event.
* @param pDataObject Pointer to the DataObject. * @param pDataObject Pointer to the DataObject.
* @return Pointer to data. * @return Pointer to data.
*/ */
void * getDropDataAsString(IDataObject * pDataObject); void *getDropDataAsString(IDataObject *pDataObject);
/** /**
* Convert Unicode to ANSI, replacing unconvertable chars with '?'. * Convert Unicode to ANSI, replacing unconvertable chars with '?'.
@@ -143,16 +143,15 @@ private:
/* Private member variables */ /* Private member variables */
/* COM reference count. */ /* COM reference count. */
LONG m_cRef; LONG m_cRef;
/* Handle of the associated window. */ /* Handle of the associated window. */
HWND m_hWnd; HWND m_hWnd;
/* The associated GHOST_WindowWin32. */ /* The associated GHOST_WindowWin32. */
GHOST_WindowWin32 * m_window; GHOST_WindowWin32 *m_window;
/* The System. */ /* The System. */
GHOST_SystemWin32 * m_system; GHOST_SystemWin32 *m_system;
/* Data type of the dragged object */ /* Data type of the dragged object */
GHOST_TDragnDropTypes m_draggedObjectType; GHOST_TDragnDropTypes m_draggedObjectType;
}; };
#endif // __GHOST_DROPTARGETWIN32_H__ #endif // __GHOST_DROPTARGETWIN32_H__

View File

@@ -50,7 +50,7 @@ public:
* @param type The type of this event. * @param type The type of this event.
* @param window The generating window (or NULL if system event). * @param window The generating window (or NULL if system event).
*/ */
GHOST_Event(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window) GHOST_Event(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow *window)
: m_type(type), m_time(msec), m_window(window), m_data(0) : m_type(type), m_time(msec), m_window(window), m_data(0)
{ {
} }
@@ -78,7 +78,7 @@ public:
* or NULL if it is a 'system' event. * or NULL if it is a 'system' event.
* @return The generating window. * @return The generating window.
*/ */
virtual GHOST_IWindow* getWindow() virtual GHOST_IWindow *getWindow()
{ {
return m_window; return m_window;
} }
@@ -98,7 +98,7 @@ protected:
/** The time this event was generated. */ /** The time this event was generated. */
GHOST_TUns64 m_time; GHOST_TUns64 m_time;
/** Pointer to the generating window. */ /** Pointer to the generating window. */
GHOST_IWindow* m_window; GHOST_IWindow *m_window;
/** Pointer to the event data. */ /** Pointer to the event data. */
GHOST_TEventDataPtr m_data; GHOST_TEventDataPtr m_data;
}; };

View File

@@ -51,7 +51,7 @@ public:
* @param y The y-coordinate of the location the cursor was at at the time of the event. * @param y The y-coordinate of the location the cursor was at at the time of the event.
* @param buttons The state of the buttons was at at the time of the event. * @param buttons The state of the buttons was at at the time of the event.
*/ */
GHOST_EventButton(GHOST_TUns64 time, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TButtonMask button) GHOST_EventButton(GHOST_TUns64 time, GHOST_TEventType type, GHOST_IWindow *window, GHOST_TButtonMask button)
: GHOST_Event(time, type, window) : GHOST_Event(time, type, window)
{ {
m_buttonEventData.button = button; m_buttonEventData.button = button;

View File

@@ -50,7 +50,7 @@ public:
* @param x The x-coordinate of the location the cursor was at at the time of the event. * @param x The x-coordinate of the location the cursor was at at the time of the event.
* @param y The y-coordinate of the location the cursor was at at the time of the event. * @param y The y-coordinate of the location the cursor was at at the time of the event.
*/ */
GHOST_EventCursor(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TInt32 x, GHOST_TInt32 y) GHOST_EventCursor(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow *window, GHOST_TInt32 x, GHOST_TInt32 y)
: GHOST_Event(msec, type, window) : GHOST_Event(msec, type, window)
{ {
m_cursorEventData.x = x; m_cursorEventData.x = x;

View File

@@ -83,8 +83,8 @@ public:
GHOST_EventDragnDrop(GHOST_TUns64 time, GHOST_EventDragnDrop(GHOST_TUns64 time,
GHOST_TEventType type, GHOST_TEventType type,
GHOST_TDragnDropTypes dataType, GHOST_TDragnDropTypes dataType,
GHOST_IWindow* window, GHOST_IWindow *window,
int x, int y, GHOST_TEventDataPtr data) int x, int y, GHOST_TEventDataPtr data)
: GHOST_Event(time, type, window) : GHOST_Event(time, type, window)
{ {
m_dragnDropEventData.x = x; m_dragnDropEventData.x = x;
@@ -102,22 +102,22 @@ public:
switch (m_dragnDropEventData.dataType) { switch (m_dragnDropEventData.dataType) {
case GHOST_kDragnDropTypeBitmap: case GHOST_kDragnDropTypeBitmap:
IMB_freeImBuf((ImBuf*)m_dragnDropEventData.data); IMB_freeImBuf((ImBuf *)m_dragnDropEventData.data);
break; break;
case GHOST_kDragnDropTypeFilenames: case GHOST_kDragnDropTypeFilenames:
{ {
GHOST_TStringArray *strArray = (GHOST_TStringArray*)m_dragnDropEventData.data; GHOST_TStringArray *strArray = (GHOST_TStringArray *)m_dragnDropEventData.data;
int i; int i;
for (i=0;i<strArray->count;i++) for (i = 0; i < strArray->count; i++)
free(strArray->strings[i]); free(strArray->strings[i]);
free(strArray); free(strArray);
} }
break; break;
case GHOST_kDragnDropTypeString: case GHOST_kDragnDropTypeString:
free(m_dragnDropEventData.data); free(m_dragnDropEventData.data);
break; break;
default: default:
break; break;

View File

@@ -51,13 +51,13 @@ public:
*/ */
GHOST_EventKey(GHOST_TUns64 msec, GHOST_EventKey(GHOST_TUns64 msec,
GHOST_TEventType type, GHOST_TEventType type,
GHOST_IWindow* window, GHOST_IWindow *window,
GHOST_TKey key) GHOST_TKey key)
: GHOST_Event(msec, type, window) : GHOST_Event(msec, type, window)
{ {
m_keyEventData.key = key; m_keyEventData.key = key;
m_keyEventData.ascii = '\0'; m_keyEventData.ascii = '\0';
m_keyEventData.utf8_buf[0]= '\0'; m_keyEventData.utf8_buf[0] = '\0';
m_data = &m_keyEventData; m_data = &m_keyEventData;
} }
@@ -70,7 +70,7 @@ public:
*/ */
GHOST_EventKey(GHOST_TUns64 msec, GHOST_EventKey(GHOST_TUns64 msec,
GHOST_TEventType type, GHOST_TEventType type,
GHOST_IWindow* window, GHOST_IWindow *window,
GHOST_TKey key, GHOST_TKey key,
char ascii, char ascii,
const char utf8_buf[6]) const char utf8_buf[6])
@@ -79,7 +79,7 @@ public:
m_keyEventData.key = key; m_keyEventData.key = key;
m_keyEventData.ascii = ascii; m_keyEventData.ascii = ascii;
if (utf8_buf) memcpy(m_keyEventData.utf8_buf, utf8_buf, sizeof(m_keyEventData.utf8_buf)); if (utf8_buf) memcpy(m_keyEventData.utf8_buf, utf8_buf, sizeof(m_keyEventData.utf8_buf));
else m_keyEventData.utf8_buf[0]= '\0'; else m_keyEventData.utf8_buf[0] = '\0';
m_data = &m_keyEventData; m_data = &m_keyEventData;
} }

View File

@@ -64,21 +64,21 @@ public:
* Returns the number of events currently on the stack. * Returns the number of events currently on the stack.
* @return The number of events on the stack. * @return The number of events on the stack.
*/ */
virtual GHOST_TUns32 getNumEvents(); virtual GHOST_TUns32 getNumEvents();
/** /**
* Returns the number of events of a certain type currently on the stack. * Returns the number of events of a certain type currently on the stack.
* @param type The type of events to be counted. * @param type The type of events to be counted.
* @return The number of events on the stack of this type. * @return The number of events on the stack of this type.
*/ */
virtual GHOST_TUns32 getNumEvents(GHOST_TEventType type); virtual GHOST_TUns32 getNumEvents(GHOST_TEventType type);
/** /**
* Return the event at the top of the stack without removal. * Return the event at the top of the stack without removal.
* Do not delete the event! * Do not delete the event!
* @return The event at the top of the stack. * @return The event at the top of the stack.
*/ */
virtual GHOST_IEvent* peekEvent(); virtual GHOST_IEvent *peekEvent();
/** /**
* Pushes an event on the stack. * Pushes an event on the stack.
@@ -86,13 +86,13 @@ public:
* Do not delete the event! * Do not delete the event!
* @param event The event to push on the stack. * @param event The event to push on the stack.
*/ */
virtual GHOST_TSuccess pushEvent(GHOST_IEvent* event); virtual GHOST_TSuccess pushEvent(GHOST_IEvent *event);
/** /**
* Dispatches the given event directly, bypassing the event stack. * Dispatches the given event directly, bypassing the event stack.
* @return Indication as to whether any of the consumers handled the event. * @return Indication as to whether any of the consumers handled the event.
*/ */
virtual bool dispatchEvent(GHOST_IEvent* event); virtual bool dispatchEvent(GHOST_IEvent *event);
/** /**
* Dispatches the event at the back of the stack. * Dispatches the event at the back of the stack.
@@ -113,23 +113,23 @@ public:
* @param consumer The consumer added to the list. * @param consumer The consumer added to the list.
* @return Indication as to whether addition has succeeded. * @return Indication as to whether addition has succeeded.
*/ */
virtual GHOST_TSuccess addConsumer(GHOST_IEventConsumer* consumer); virtual GHOST_TSuccess addConsumer(GHOST_IEventConsumer *consumer);
/** /**
* Removes a consumer from the list of event consumers. * Removes a consumer from the list of event consumers.
* @param consumer The consumer removed from the list. * @param consumer The consumer removed from the list.
* @return Indication as to whether removal has succeeded. * @return Indication as to whether removal has succeeded.
*/ */
virtual GHOST_TSuccess removeConsumer(GHOST_IEventConsumer* consumer); virtual GHOST_TSuccess removeConsumer(GHOST_IEventConsumer *consumer);
/** /**
* Removes all events for a window from the stack. * Removes all events for a window from the stack.
* @param window The window to remove events for. * @param window The window to remove events for.
*/ */
virtual void virtual void
removeWindowEvents( removeWindowEvents(
GHOST_IWindow* window GHOST_IWindow *window
); );
/** /**
* Removes all events of a certain type from the stack. * Removes all events of a certain type from the stack.
@@ -138,11 +138,11 @@ public:
* @param type The type of events to be removed. * @param type The type of events to be removed.
* @param window The window to remove the events for. * @param window The window to remove the events for.
*/ */
virtual void virtual void
removeTypeEvents( removeTypeEvents(
GHOST_TEventType type, GHOST_TEventType type,
GHOST_IWindow* window = 0 GHOST_IWindow *window = 0
); );
protected: protected:
/** /**
@@ -150,7 +150,7 @@ protected:
* Delete the event after use! * Delete the event after use!
* @return The event at the top of the stack. * @return The event at the top of the stack.
*/ */
virtual GHOST_IEvent* popEvent(); virtual GHOST_IEvent *popEvent();
/** /**
* Removes all events from the stack. * Removes all events from the stack.
@@ -158,13 +158,13 @@ protected:
virtual void disposeEvents(); virtual void disposeEvents();
/** A stack with events. */ /** A stack with events. */
typedef std::deque<GHOST_IEvent*> TEventStack; typedef std::deque<GHOST_IEvent *> TEventStack;
/** The event stack. */ /** The event stack. */
std::deque<GHOST_IEvent*> m_events; std::deque<GHOST_IEvent *> m_events;
/** A vector with event consumers. */ /** A vector with event consumers. */
typedef std::vector<GHOST_IEventConsumer*> TConsumerVector; typedef std::vector<GHOST_IEventConsumer *> TConsumerVector;
/** The list with event consumers. */ /** The list with event consumers. */
TConsumerVector m_consumers; TConsumerVector m_consumers;

View File

@@ -32,31 +32,30 @@
class GHOST_EventNDOFMotion : public GHOST_Event class GHOST_EventNDOFMotion : public GHOST_Event
{
protected:
GHOST_TEventNDOFMotionData m_axisData;
public:
GHOST_EventNDOFMotion(GHOST_TUns64 time, GHOST_IWindow *window)
: GHOST_Event(time, GHOST_kEventNDOFMotion, window)
{ {
protected: m_data = &m_axisData;
GHOST_TEventNDOFMotionData m_axisData; }
};
public:
GHOST_EventNDOFMotion(GHOST_TUns64 time, GHOST_IWindow* window)
: GHOST_Event(time, GHOST_kEventNDOFMotion, window)
{
m_data = &m_axisData;
}
};
class GHOST_EventNDOFButton : public GHOST_Event class GHOST_EventNDOFButton : public GHOST_Event
{ {
protected: protected:
GHOST_TEventNDOFButtonData m_buttonData; GHOST_TEventNDOFButtonData m_buttonData;
public:
GHOST_EventNDOFButton(GHOST_TUns64 time, GHOST_IWindow* window)
: GHOST_Event(time, GHOST_kEventNDOFButton, window)
{
m_data = &m_buttonData;
}
};
public:
GHOST_EventNDOFButton(GHOST_TUns64 time, GHOST_IWindow *window)
: GHOST_Event(time, GHOST_kEventNDOFButton, window)
{
m_data = &m_buttonData;
}
};
#endif // __GHOST_EVENTNDOF_H__ #endif // __GHOST_EVENTNDOF_H__

View File

@@ -49,7 +49,7 @@ public:
* @param event The event that can be handled or not. * @param event The event that can be handled or not.
* @return Indication as to whether the event was handled. * @return Indication as to whether the event was handled.
*/ */
virtual bool processEvent(GHOST_IEvent* event); virtual bool processEvent(GHOST_IEvent *event);
protected: protected:
/** /**
@@ -57,7 +57,7 @@ protected:
* @param key The GHOST key code to convert. * @param key The GHOST key code to convert.
* @param str The GHOST key code converted to a readable string. * @param str The GHOST key code converted to a readable string.
*/ */
void getKeyString(GHOST_TKey key, char str[32]) const; void getKeyString(GHOST_TKey key, char str[32]) const;
}; };
#endif // __GHOST_EVENTPRINTER_H__ #endif // __GHOST_EVENTPRINTER_H__

View File

@@ -51,9 +51,10 @@ public:
* @param window The generating window (or NULL if system event). * @param window The generating window (or NULL if system event).
* @param data_ptr Pointer to the (unformatted) data associated with the event * @param data_ptr Pointer to the (unformatted) data associated with the event
*/ */
GHOST_EventString(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TEventDataPtr data_ptr) GHOST_EventString(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow *window, GHOST_TEventDataPtr data_ptr)
: GHOST_Event(msec, type, window) { : GHOST_Event(msec, type, window)
m_data = data_ptr; {
m_data = data_ptr;
} }
~GHOST_EventString() ~GHOST_EventString()

View File

@@ -51,7 +51,7 @@ public:
* @param y The y-delta of the pan event. * @param y The y-delta of the pan event.
*/ */
GHOST_EventTrackpad(GHOST_TUns64 msec, GHOST_EventTrackpad(GHOST_TUns64 msec,
GHOST_IWindow* window, GHOST_IWindow *window,
GHOST_TTrackpadEventSubTypes subtype, GHOST_TTrackpadEventSubTypes subtype,
GHOST_TInt32 x, GHOST_TInt32 y, GHOST_TInt32 x, GHOST_TInt32 y,
GHOST_TInt32 deltaX, GHOST_TInt32 deltaY) GHOST_TInt32 deltaX, GHOST_TInt32 deltaY)

View File

@@ -51,7 +51,7 @@ public:
* @param type The type of this event. * @param type The type of this event.
* @param z The displacement of the mouse wheel. * @param z The displacement of the mouse wheel.
*/ */
GHOST_EventWheel(GHOST_TUns64 msec, GHOST_IWindow* window, GHOST_TInt32 z) GHOST_EventWheel(GHOST_TUns64 msec, GHOST_IWindow *window, GHOST_TInt32 z)
: GHOST_Event(msec, GHOST_kEventWheel, window) : GHOST_Event(msec, GHOST_kEventWheel, window)
{ {
m_wheelEventData.z = z; m_wheelEventData.z = z;

View File

@@ -41,8 +41,7 @@
* @author Maarten Gribnau * @author Maarten Gribnau
* @date May 17, 2001 * @date May 17, 2001
*/ */
struct GHOST_ModifierKeys struct GHOST_ModifierKeys {
{
/** /**
* Constructor. * Constructor.
*/ */

View File

@@ -44,7 +44,7 @@ typedef enum {
NDOF_Spaceball5000, NDOF_Spaceball5000,
NDOF_SpaceTraveler NDOF_SpaceTraveler
} NDOF_DeviceT; } NDOF_DeviceT;
// NDOF device button event types // NDOF device button event types
typedef enum { typedef enum {
@@ -100,7 +100,7 @@ typedef enum {
NDOF_BUTTON_C, NDOF_BUTTON_C,
// the end // the end
NDOF_BUTTON_LAST NDOF_BUTTON_LAST
} NDOF_ButtonT; } NDOF_ButtonT;
class GHOST_NDOFManager class GHOST_NDOFManager
{ {
@@ -149,13 +149,13 @@ protected:
GHOST_System& m_system; GHOST_System& m_system;
private: private:
void sendButtonEvent(NDOF_ButtonT, bool press, GHOST_TUns64 time, GHOST_IWindow*); void sendButtonEvent(NDOF_ButtonT, bool press, GHOST_TUns64 time, GHOST_IWindow *);
void sendKeyEvent(GHOST_TKey, bool press, GHOST_TUns64 time, GHOST_IWindow*); void sendKeyEvent(GHOST_TKey, bool press, GHOST_TUns64 time, GHOST_IWindow *);
NDOF_DeviceT m_deviceType; NDOF_DeviceT m_deviceType;
int m_buttonCount; int m_buttonCount;
int m_buttonMask; int m_buttonMask;
const NDOF_ButtonT* m_hidMap; const NDOF_ButtonT *m_hidMap;
short m_translation[3]; short m_translation[3];
short m_rotation[3]; short m_rotation[3];

View File

@@ -76,8 +76,8 @@ protected:
public: public:
/*************************************************************************************** /***************************************************************************************
** Time(r) functionality ** Time(r) functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the system time. * Returns the system time.
@@ -97,7 +97,7 @@ public:
* @param userData Placeholder for user data. * @param userData Placeholder for user data.
* @return A timer task (0 if timer task installation failed). * @return A timer task (0 if timer task installation failed).
*/ */
virtual GHOST_ITimerTask* installTimer(GHOST_TUns64 delay, virtual GHOST_ITimerTask *installTimer(GHOST_TUns64 delay,
GHOST_TUns64 interval, GHOST_TUns64 interval,
GHOST_TimerProcPtr timerProc, GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData = 0); GHOST_TUserDataPtr userData = 0);
@@ -107,11 +107,11 @@ public:
* @param timerTask Timer task to be removed. * @param timerTask Timer task to be removed.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess removeTimer(GHOST_ITimerTask* timerTask); virtual GHOST_TSuccess removeTimer(GHOST_ITimerTask *timerTask);
/*************************************************************************************** /***************************************************************************************
** Display/window management functionality ** Display/window management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Inherited from GHOST_ISystem but left pure virtual * Inherited from GHOST_ISystem but left pure virtual
@@ -126,14 +126,14 @@ public:
* @param window Pointer to the window to be disposed. * @param window Pointer to the window to be disposed.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess disposeWindow(GHOST_IWindow* window); virtual GHOST_TSuccess disposeWindow(GHOST_IWindow *window);
/** /**
* Returns whether a window is valid. * Returns whether a window is valid.
* @param window Pointer to the window to be checked. * @param window Pointer to the window to be checked.
* @return Indication of validity. * @return Indication of validity.
*/ */
virtual bool validWindow(GHOST_IWindow* window); virtual bool validWindow(GHOST_IWindow *window);
/** /**
* Begins full screen mode. * Begins full screen mode.
@@ -143,8 +143,8 @@ public:
* This window is invalid after full screen has been ended. * This window is invalid after full screen has been ended.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow **window,
const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0); const bool stereoVisual, const GHOST_TUns16 numOfAASamples = 0);
/** /**
* Updates the resolution while in fullscreen mode. * Updates the resolution while in fullscreen mode.
@@ -153,7 +153,7 @@ public:
* *
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess updateFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window); virtual GHOST_TSuccess updateFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow **window);
/** /**
* Ends full screen mode. * Ends full screen mode.
@@ -169,13 +169,13 @@ public:
/*************************************************************************************** /***************************************************************************************
** Event management functionality ** Event management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Inherited from GHOST_ISystem but left pure virtual * Inherited from GHOST_ISystem but left pure virtual
* *
* virtual bool processEvents(bool waitForEvent) = 0; * virtual bool processEvents(bool waitForEvent) = 0;
*/ */
@@ -192,18 +192,18 @@ public:
* @param consumer The event consumer to add. * @param consumer The event consumer to add.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess addEventConsumer(GHOST_IEventConsumer* consumer); virtual GHOST_TSuccess addEventConsumer(GHOST_IEventConsumer *consumer);
/** /**
* Remove the given event consumer to our list. * Remove the given event consumer to our list.
* @param consumer The event consumer to remove. * @param consumer The event consumer to remove.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess removeEventConsumer(GHOST_IEventConsumer* consumer); virtual GHOST_TSuccess removeEventConsumer(GHOST_IEventConsumer *consumer);
/*************************************************************************************** /***************************************************************************************
** Cursor management functionality ** Cursor management functionality
***************************************************************************************/ ***************************************************************************************/
/** Inherited from GHOST_ISystem but left pure virtual /** Inherited from GHOST_ISystem but left pure virtual
* GHOST_TSuccess getCursorPosition(GHOST_TInt32& x, GHOST_TInt32& y) const = 0; * GHOST_TSuccess getCursorPosition(GHOST_TInt32& x, GHOST_TInt32& y) const = 0;
@@ -211,8 +211,8 @@ public:
*/ */
/*************************************************************************************** /***************************************************************************************
** Access to mouse button and keyboard states. ** Access to mouse button and keyboard states.
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the state of a modifier key (ouside the message queue). * Returns the state of a modifier key (ouside the message queue).
@@ -231,8 +231,8 @@ public:
virtual GHOST_TSuccess getButtonState(GHOST_TButtonMask mask, bool& isDown) const; virtual GHOST_TSuccess getButtonState(GHOST_TButtonMask mask, bool& isDown) const;
/*************************************************************************************** /***************************************************************************************
** Other (internal) functionality. ** Other (internal) functionality.
***************************************************************************************/ ***************************************************************************************/
/** /**
* Pushes an event on the stack. * Pushes an event on the stack.
@@ -240,32 +240,32 @@ public:
* Do not delete the event! * Do not delete the event!
* @param event The event to push on the stack. * @param event The event to push on the stack.
*/ */
virtual GHOST_TSuccess pushEvent(GHOST_IEvent* event); virtual GHOST_TSuccess pushEvent(GHOST_IEvent *event);
/** /**
* Returns the timer manager. * Returns the timer manager.
* @return The timer manager. * @return The timer manager.
*/ */
inline virtual GHOST_TimerManager* getTimerManager() const; inline virtual GHOST_TimerManager *getTimerManager() const;
/** /**
* Returns a pointer to our event manager. * Returns a pointer to our event manager.
* @return A pointer to our event manager. * @return A pointer to our event manager.
*/ */
virtual inline GHOST_EventManager* getEventManager() const; virtual inline GHOST_EventManager *getEventManager() const;
/** /**
* Returns a pointer to our window manager. * Returns a pointer to our window manager.
* @return A pointer to our window manager. * @return A pointer to our window manager.
*/ */
virtual inline GHOST_WindowManager* getWindowManager() const; virtual inline GHOST_WindowManager *getWindowManager() const;
#ifdef WITH_INPUT_NDOF #ifdef WITH_INPUT_NDOF
/** /**
* Returns a pointer to our n-degree of freedeom manager. * Returns a pointer to our n-degree of freedeom manager.
* @return A pointer to our n-degree of freedeom manager. * @return A pointer to our n-degree of freedeom manager.
*/ */
virtual inline GHOST_NDOFManager* getNDOFManager() const; virtual inline GHOST_NDOFManager *getNDOFManager() const;
#endif #endif
/** /**
@@ -285,23 +285,23 @@ public:
/** /**
* Returns the selection buffer * Returns the selection buffer
* @param selection Only used on X11 * @param selection Only used on X11
* @return Returns the clipboard data * @return Returns the clipboard data
* *
*/ */
virtual GHOST_TUns8* getClipboard(bool selection) const = 0; virtual GHOST_TUns8 *getClipboard(bool selection) const = 0;
/** /**
* Put data to the Clipboard * Put data to the Clipboard
* @param buffer The buffer to copy to the clipboard * @param buffer The buffer to copy to the clipboard
* @param selection The clipboard to copy too only used on X11 * @param selection The clipboard to copy too only used on X11
*/ */
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0; virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0;
/** /**
* Confirms quitting he program when there is just one window left open * Confirms quitting he program when there is just one window left open
* in the application * in the application
*/ */
virtual int confirmQuit(GHOST_IWindow * window) const; virtual int confirmQuit(GHOST_IWindow *window) const;
@@ -323,52 +323,52 @@ protected:
* @param window The window created. * @param window The window created.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess createFullScreenWindow(GHOST_Window** window, virtual GHOST_TSuccess createFullScreenWindow(GHOST_Window **window,
const bool stereoVisual, const GHOST_TUns16 numOfAASamples=0); const bool stereoVisual, const GHOST_TUns16 numOfAASamples = 0);
/** The display manager (platform dependant). */ /** The display manager (platform dependant). */
GHOST_DisplayManager* m_displayManager; GHOST_DisplayManager *m_displayManager;
/** The timer manager. */ /** The timer manager. */
GHOST_TimerManager* m_timerManager; GHOST_TimerManager *m_timerManager;
/** The window manager. */ /** The window manager. */
GHOST_WindowManager* m_windowManager; GHOST_WindowManager *m_windowManager;
/** The event manager. */ /** The event manager. */
GHOST_EventManager* m_eventManager; GHOST_EventManager *m_eventManager;
#ifdef WITH_INPUT_NDOF #ifdef WITH_INPUT_NDOF
/** The N-degree of freedom device manager */ /** The N-degree of freedom device manager */
GHOST_NDOFManager* m_ndofManager; GHOST_NDOFManager *m_ndofManager;
#endif #endif
/** Prints all the events. */ /** Prints all the events. */
#ifdef GHOST_DEBUG #ifdef GHOST_DEBUG
GHOST_EventPrinter* m_eventPrinter; GHOST_EventPrinter *m_eventPrinter;
#endif // GHOST_DEBUG #endif // GHOST_DEBUG
/** Settings of the display before the display went fullscreen. */ /** Settings of the display before the display went fullscreen. */
GHOST_DisplaySetting m_preFullScreenSetting; GHOST_DisplaySetting m_preFullScreenSetting;
}; };
inline GHOST_TimerManager* GHOST_System::getTimerManager() const inline GHOST_TimerManager *GHOST_System::getTimerManager() const
{ {
return m_timerManager; return m_timerManager;
} }
inline GHOST_EventManager* GHOST_System::getEventManager() const inline GHOST_EventManager *GHOST_System::getEventManager() const
{ {
return m_eventManager; return m_eventManager;
} }
inline GHOST_WindowManager* GHOST_System::getWindowManager() const inline GHOST_WindowManager *GHOST_System::getWindowManager() const
{ {
return m_windowManager; return m_windowManager;
} }
#ifdef WITH_INPUT_NDOF #ifdef WITH_INPUT_NDOF
inline GHOST_NDOFManager* GHOST_System::getNDOFManager() const inline GHOST_NDOFManager *GHOST_System::getNDOFManager() const
{ {
return m_ndofManager; return m_ndofManager;
} }

View File

@@ -84,7 +84,7 @@ public:
* Returns the number of displays on this system. * Returns the number of displays on this system.
* @return The number of displays. * @return The number of displays.
*/ */
virtual GHOST_TUns8 getNumDisplays() const; virtual GHOST_TUns8 getNumDisplays() const;
/** /**
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
@@ -103,29 +103,29 @@ public:
* @param height The height the window. * @param height The height the window.
* @param state The state of the window when opened. * @param state The state of the window when opened.
* @param type The type of drawing context installed in this window. * @param type The type of drawing context installed in this window.
* @param parentWindow Parent (embedder) window * @param parentWindow Parent (embedder) window
* @return The new window (or 0 if creation failed). * @return The new window (or 0 if creation failed).
*/ */
virtual GHOST_IWindow* createWindow( virtual GHOST_IWindow *createWindow(
const STR_String& title, const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 left,
GHOST_TInt32 top, GHOST_TInt32 top,
GHOST_TUns32 width, GHOST_TUns32 width,
GHOST_TUns32 height, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
const bool stereoVisual, const bool stereoVisual,
const GHOST_TUns16 numOfAASamples = 0, const GHOST_TUns16 numOfAASamples = 0,
const GHOST_TEmbedderWindowID parentWindow = 0 const GHOST_TEmbedderWindowID parentWindow = 0
); );
virtual GHOST_TSuccess beginFullScreen( virtual GHOST_TSuccess beginFullScreen(
const GHOST_DisplaySetting& setting, const GHOST_DisplaySetting& setting,
GHOST_IWindow** window, GHOST_IWindow **window,
const bool stereoVisual const bool stereoVisual
); );
virtual GHOST_TSuccess endFullScreen( void ); virtual GHOST_TSuccess endFullScreen(void);
/*************************************************************************************** /***************************************************************************************
** Event management functionality ** Event management functionality
@@ -181,7 +181,7 @@ public:
* @param selection Indicate which buffer to return * @param selection Indicate which buffer to return
* @return Returns the selected buffer * @return Returns the selected buffer
*/ */
virtual GHOST_TUns8* getClipboard(bool selection) const; virtual GHOST_TUns8 *getClipboard(bool selection) const;
/** /**
* Puts buffer to system clipboard * Puts buffer to system clipboard
@@ -193,7 +193,9 @@ public:
/** /**
* @see GHOST_ISystem * @see GHOST_ISystem
*/ */
int toggleConsole(int action) { return 0; } int toggleConsole(int action) {
return 0;
}
protected: protected:
/** /**
@@ -258,7 +260,7 @@ protected:
/** /**
* Callback for Carbon when it has events. * Callback for Carbon when it has events.
*/ */
static OSStatus sEventHandlerProc(EventHandlerCallRef handler, EventRef event, void* userData); static OSStatus sEventHandlerProc(EventHandlerCallRef handler, EventRef event, void *userData);
/** Apple Event Handlers */ /** Apple Event Handlers */
static OSErr sAEHandlerLaunch(const AppleEvent *event, AppleEvent *reply, SInt32 refCon); static OSErr sAEHandlerLaunch(const AppleEvent *event, AppleEvent *reply, SInt32 refCon);

View File

@@ -62,8 +62,8 @@ public:
~GHOST_SystemCocoa(); ~GHOST_SystemCocoa();
/*************************************************************************************** /***************************************************************************************
** Time(r) functionality ** Time(r) functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the system time. * Returns the system time.
@@ -74,14 +74,14 @@ public:
virtual GHOST_TUns64 getMilliSeconds() const; virtual GHOST_TUns64 getMilliSeconds() const;
/*************************************************************************************** /***************************************************************************************
** Display/window management functionality ** Display/window management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the number of displays on this system. * Returns the number of displays on this system.
* @return The number of displays. * @return The number of displays.
*/ */
virtual GHOST_TUns8 getNumDisplays() const; virtual GHOST_TUns8 getNumDisplays() const;
/** /**
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
@@ -102,25 +102,25 @@ public:
* @param type The type of drawing context installed in this window. * @param type The type of drawing context installed in this window.
* @param stereoVisual Stereo visual for quad buffered stereo. * @param stereoVisual Stereo visual for quad buffered stereo.
* @param numOfAASamples Number of samples used for AA (zero if no AA) * @param numOfAASamples Number of samples used for AA (zero if no AA)
* @param parentWindow Parent (embedder) window * @param parentWindow Parent (embedder) window
* @return The new window (or 0 if creation failed). * @return The new window (or 0 if creation failed).
*/ */
virtual GHOST_IWindow* createWindow( virtual GHOST_IWindow *createWindow(
const STR_String& title, const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 left,
GHOST_TInt32 top, GHOST_TInt32 top,
GHOST_TUns32 width, GHOST_TUns32 width,
GHOST_TUns32 height, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
const bool stereoVisual = false, const bool stereoVisual = false,
const GHOST_TUns16 numOfAASamples = 0, const GHOST_TUns16 numOfAASamples = 0,
const GHOST_TEmbedderWindowID parentWindow = 0 const GHOST_TEmbedderWindowID parentWindow = 0
); );
/*************************************************************************************** /***************************************************************************************
** Event management functionality ** Event management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Gets events from the system and stores them in the queue. * Gets events from the system and stores them in the queue.
@@ -151,11 +151,11 @@ public:
* @return Indication whether the event was handled. * @return Indication whether the event was handled.
*/ */
GHOST_TSuccess handleDraggingEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType, GHOST_TSuccess handleDraggingEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType,
GHOST_WindowCocoa* window, int mouseX, int mouseY, void* data); GHOST_WindowCocoa *window, int mouseX, int mouseY, void *data);
/*************************************************************************************** /***************************************************************************************
** Cursor management functionality ** Cursor management functionality
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the current location of the cursor (location in screen coordinates) * Returns the current location of the cursor (location in screen coordinates)
@@ -174,8 +174,8 @@ public:
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y); virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y);
/*************************************************************************************** /***************************************************************************************
** Access to mouse button and keyboard states. ** Access to mouse button and keyboard states.
***************************************************************************************/ ***************************************************************************************/
/** /**
* Returns the state of all modifier keys. * Returns the state of all modifier keys.
@@ -196,7 +196,7 @@ public:
* @param selection Indicate which buffer to return * @param selection Indicate which buffer to return
* @return Returns the selected buffer * @return Returns the selected buffer
*/ */
virtual GHOST_TUns8* getClipboard(bool selection) const; virtual GHOST_TUns8 *getClipboard(bool selection) const;
/** /**
* Puts buffer to system clipboard * Puts buffer to system clipboard
@@ -211,7 +211,7 @@ public:
* @param window The window on which the event occurred * @param window The window on which the event occurred
* @return Indication whether the event was handled. * @return Indication whether the event was handled.
*/ */
GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa* window); GHOST_TSuccess handleWindowEvent(GHOST_TEventType eventType, GHOST_WindowCocoa *window);
/** /**
* Handles the Cocoa event telling the application has become active (again) * Handles the Cocoa event telling the application has become active (again)
@@ -227,7 +227,9 @@ public:
/** /**
* @see GHOST_ISystem * @see GHOST_ISystem
*/ */
int toggleConsole(int action) { return 0; } int toggleConsole(int action) {
return 0;
}
protected: protected:

View File

@@ -66,19 +66,19 @@ public:
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_IWindow* createWindow( GHOST_IWindow *createWindow(
const STR_String& title, const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 left,
GHOST_TInt32 top, GHOST_TInt32 top,
GHOST_TUns32 width, GHOST_TUns32 width,
GHOST_TUns32 height, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
bool stereoVisual, bool stereoVisual,
const GHOST_TUns16 numOfAASamples, const GHOST_TUns16 numOfAASamples,
const GHOST_TEmbedderWindowID parentWindow const GHOST_TEmbedderWindowID parentWindow)
) { {
return new GHOST_WindowNULL (this, title, left, top, width, height, state, parentWindow, type, stereoVisual, 1); return new GHOST_WindowNULL(this, title, left, top, width, height, state, parentWindow, type, stereoVisual, 1);
} }
}; };

View File

@@ -40,13 +40,13 @@ protected:
* Constructor. * Constructor.
* Protected default constructor to force use of static createSystem member. * Protected default constructor to force use of static createSystem member.
*/ */
GHOST_SystemPaths(){}; GHOST_SystemPaths() {};
/** /**
* Destructor. * Destructor.
* Protected default constructor to force use of static dispose member. * Protected default constructor to force use of static dispose member.
*/ */
virtual ~GHOST_SystemPaths(){}; virtual ~GHOST_SystemPaths() {};
public: public:
@@ -55,25 +55,25 @@ public:
* "unpack and run" path, then look for properly installed path, not including versioning. * "unpack and run" path, then look for properly installed path, not including versioning.
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/). * @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
*/ */
virtual const GHOST_TUns8* getSystemDir() const = 0; virtual const GHOST_TUns8 *getSystemDir() const = 0;
/**
* Determine the base dir in which user configuration is stored, not including versioning.
* If needed, it will create the base directory.
* @return Unsigned char string pointing to user dir (eg ~/.blender/).
*/
virtual const GHOST_TUns8* getUserDir() const = 0;
/** /**
* Determine the directory of the current binary * Determine the base dir in which user configuration is stored, not including versioning.
* @return Unsigned char string pointing to the binary dir * If needed, it will create the base directory.
*/ * @return Unsigned char string pointing to user dir (eg ~/.blender/).
virtual const GHOST_TUns8* getBinaryDir() const = 0; */
virtual const GHOST_TUns8 *getUserDir() const = 0;
/**
* Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir
*/
virtual const GHOST_TUns8 *getBinaryDir() const = 0;
/** /**
* Add the file to the operating system most recently used files * Add the file to the operating system most recently used files
*/ */
virtual void addToSystemRecentFiles(const char* filename) const = 0; virtual void addToSystemRecentFiles(const char *filename) const = 0;
}; };

View File

@@ -63,25 +63,25 @@ public:
* "unpack and run" path, then look for properly installed path, not including versioning. * "unpack and run" path, then look for properly installed path, not including versioning.
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/). * @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
*/ */
virtual const GHOST_TUns8* getSystemDir() const; virtual const GHOST_TUns8 *getSystemDir() const;
/** /**
* Determine the base dir in which user configuration is stored, not including versioning. * Determine the base dir in which user configuration is stored, not including versioning.
* If needed, it will create the base directory. * If needed, it will create the base directory.
* @return Unsigned char string pointing to user dir (eg ~/.blender/). * @return Unsigned char string pointing to user dir (eg ~/.blender/).
*/ */
virtual const GHOST_TUns8* getUserDir() const; virtual const GHOST_TUns8 *getUserDir() const;
/** /**
* Determine the directory of the current binary * Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir * @return Unsigned char string pointing to the binary dir
*/ */
virtual const GHOST_TUns8* getBinaryDir() const; virtual const GHOST_TUns8 *getBinaryDir() const;
/** /**
* Add the file to the operating system most recently used files * Add the file to the operating system most recently used files
*/ */
void addToSystemRecentFiles(const char* filename) const; void addToSystemRecentFiles(const char *filename) const;
}; };
#endif // __GHOST_SYSTEMPATHSCARBON_H__ #endif // __GHOST_SYSTEMPATHSCARBON_H__

View File

@@ -57,25 +57,25 @@ public:
* "unpack and run" path, then look for properly installed path, not including versioning. * "unpack and run" path, then look for properly installed path, not including versioning.
* @return Unsigned char string pointing to system dir (eg /usr/share/blender/). * @return Unsigned char string pointing to system dir (eg /usr/share/blender/).
*/ */
virtual const GHOST_TUns8* getSystemDir() const; virtual const GHOST_TUns8 *getSystemDir() const;
/** /**
* Determine the base dir in which user configuration is stored, not including versioning. * Determine the base dir in which user configuration is stored, not including versioning.
* If needed, it will create the base directory. * If needed, it will create the base directory.
* @return Unsigned char string pointing to user dir (eg ~/.blender/). * @return Unsigned char string pointing to user dir (eg ~/.blender/).
*/ */
virtual const GHOST_TUns8* getUserDir() const; virtual const GHOST_TUns8 *getUserDir() const;
/** /**
* Determine the directory of the current binary * Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir * @return Unsigned char string pointing to the binary dir
*/ */
virtual const GHOST_TUns8* getBinaryDir() const; virtual const GHOST_TUns8 *getBinaryDir() const;
/** /**
* Add the file to the operating system most recently used files * Add the file to the operating system most recently used files
*/ */
void addToSystemRecentFiles(const char* filename) const; void addToSystemRecentFiles(const char *filename) const;
}; };
#endif // __GHOST_SYSTEMPATHSCOCOA_H__ #endif // __GHOST_SYSTEMPATHSCOCOA_H__

View File

@@ -67,20 +67,20 @@ public:
* "unpack and run" path, then look for properly installed path, not including versioning. * "unpack and run" path, then look for properly installed path, not including versioning.
* @return Unsigned char string pointing to system dir (eg /usr/share/). * @return Unsigned char string pointing to system dir (eg /usr/share/).
*/ */
const GHOST_TUns8* getSystemDir() const; const GHOST_TUns8 *getSystemDir() const;
/** /**
* Determine the base dir in which user configuration is stored, not including versioning. * Determine the base dir in which user configuration is stored, not including versioning.
* If needed, it will create the base directory. * If needed, it will create the base directory.
* @return Unsigned char string pointing to user dir (eg ~/). * @return Unsigned char string pointing to user dir (eg ~/).
*/ */
const GHOST_TUns8* getUserDir() const; const GHOST_TUns8 *getUserDir() const;
/** /**
* Determine the directory of the current binary * Determine the directory of the current binary
* @return Unsigned char string pointing to the binary dir * @return Unsigned char string pointing to the binary dir
*/ */
const GHOST_TUns8* getBinaryDir() const; const GHOST_TUns8 *getBinaryDir() const;
/** /**
* Add the file to the operating system most recently used files * Add the file to the operating system most recently used files

View File

@@ -110,7 +110,7 @@ private:
); );
/* SDL specific */ /* SDL specific */
GHOST_WindowSDL * findGhostWindow(SDL_Window *sdl_win); GHOST_WindowSDL *findGhostWindow(SDL_Window *sdl_win);
bool bool
generateWindowExposeEvents(); generateWindowExposeEvents();

View File

@@ -45,7 +45,7 @@
#include "GHOST_System.h" #include "GHOST_System.h"
#if defined(__CYGWIN32__) #if defined(__CYGWIN32__)
# define __int64 long long # define __int64 long long
#endif #endif
class GHOST_EventButton; class GHOST_EventButton;
@@ -93,7 +93,7 @@ public:
* Returns the number of displays on this system. * Returns the number of displays on this system.
* @return The number of displays. * @return The number of displays.
*/ */
virtual GHOST_TUns8 getNumDisplays() const; virtual GHOST_TUns8 getNumDisplays() const;
/** /**
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
@@ -114,16 +114,16 @@ public:
* @param type The type of drawing context installed in this window. * @param type The type of drawing context installed in this window.
* @param stereoVisual Stereo visual for quad buffered stereo. * @param stereoVisual Stereo visual for quad buffered stereo.
* @param numOfAASamples Number of samples used for AA (zero if no AA) * @param numOfAASamples Number of samples used for AA (zero if no AA)
* @param parentWindow Parent (embedder) window * @param parentWindow Parent (embedder) window
* @return The new window (or 0 if creation failed). * @return The new window (or 0 if creation failed).
*/ */
virtual GHOST_IWindow* createWindow( virtual GHOST_IWindow *createWindow(
const STR_String& title, const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TDrawingContextType type, GHOST_TWindowState state, GHOST_TDrawingContextType type,
const bool stereoVisual = false, const bool stereoVisual = false,
const GHOST_TUns16 numOfAASamples = 0, const GHOST_TUns16 numOfAASamples = 0,
const GHOST_TEmbedderWindowID parentWindow = 0 ); const GHOST_TEmbedderWindowID parentWindow = 0);
/*************************************************************************************** /***************************************************************************************
** Event management functionality ** Event management functionality
@@ -180,7 +180,7 @@ public:
* @param selection Used by X11 only * @param selection Used by X11 only
* @return Returns the Clipboard * @return Returns the Clipboard
*/ */
virtual GHOST_TUns8* getClipboard(bool selection) const; virtual GHOST_TUns8 *getClipboard(bool selection) const;
/** /**
* Puts buffer to system clipboard * Puts buffer to system clipboard
@@ -199,13 +199,13 @@ public:
* @param window The window on which the event occurred * @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); static GHOST_TSuccess pushDragDropEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType, GHOST_IWindow *window, int mouseX, int mouseY, void *data);
/** /**
* Confirms quitting he program when there is just one window left open * Confirms quitting he program when there is just one window left open
* in the application * in the application
*/ */
virtual int confirmQuit(GHOST_IWindow * window) const; virtual int confirmQuit(GHOST_IWindow *window) const;
protected: protected:
/** /**
@@ -239,7 +239,7 @@ protected:
* @param vk Pointer to virtual key * @param vk Pointer to virtual key
* @return The GHOST key (GHOST_kKeyUnknown if no match). * @return The GHOST key (GHOST_kKeyUnknown if no match).
*/ */
virtual GHOST_TKey hardKey(GHOST_IWindow *window, RAWINPUT const& raw, int * keyDown, char * vk); virtual GHOST_TKey hardKey(GHOST_IWindow *window, RAWINPUT const& raw, int *keyDown, char *vk);
/** /**
* Creates modifier key event(s) and updates the key data stored locally (m_modifierKeys). * Creates modifier key event(s) and updates the key data stored locally (m_modifierKeys).
@@ -248,7 +248,7 @@ protected:
* events generated for both keys. * events generated for both keys.
* @param window The window receiving the event (the active window). * @param window The window receiving the event (the active window).
*/ */
GHOST_EventKey* processModifierKeys(GHOST_IWindow *window); GHOST_EventKey *processModifierKeys(GHOST_IWindow *window);
/** /**
* Creates mouse button event. * Creates mouse button event.
@@ -257,7 +257,7 @@ protected:
* @param mask The button mask of this event. * @param mask The button mask of this event.
* @return The event created. * @return The event created.
*/ */
static GHOST_EventButton* processButtonEvent(GHOST_TEventType type, GHOST_IWindow *window, GHOST_TButtonMask mask); static GHOST_EventButton *processButtonEvent(GHOST_TEventType type, GHOST_IWindow *window, GHOST_TButtonMask mask);
/** /**
* Creates cursor event. * Creates cursor event.
@@ -265,7 +265,7 @@ protected:
* @param window The window receiving the event (the active window). * @param window The window receiving the event (the active window).
* @return The event created. * @return The event created.
*/ */
static GHOST_EventCursor* processCursorEvent(GHOST_TEventType type, GHOST_IWindow *Iwindow); static GHOST_EventCursor *processCursorEvent(GHOST_TEventType type, GHOST_IWindow *Iwindow);
/** /**
* Creates a mouse wheel event. * Creates a mouse wheel event.
@@ -273,7 +273,7 @@ protected:
* @param wParam The wParam from the wndproc * @param wParam The wParam from the wndproc
* @param lParam The lParam from the wndproc * @param lParam The lParam from the wndproc
*/ */
static GHOST_EventWheel* processWheelEvent(GHOST_IWindow *window, WPARAM wParam, LPARAM lParam); static GHOST_EventWheel *processWheelEvent(GHOST_IWindow *window, WPARAM wParam, LPARAM lParam);
/** /**
* Creates a key event and updates the key data stored locally (m_modifierKeys). * Creates a key event and updates the key data stored locally (m_modifierKeys).
@@ -282,7 +282,7 @@ protected:
* @param window The window receiving the event (the active window). * @param window The window receiving the event (the active window).
* @param raw RawInput structure with detailed info about the key event * @param raw RawInput structure with detailed info about the key event
*/ */
static GHOST_EventKey* processKeyEvent(GHOST_IWindow *window, RAWINPUT const& raw); static GHOST_EventKey *processKeyEvent(GHOST_IWindow *window, RAWINPUT const& raw);
/** /**
* Process special keys (VK_OEM_*), to see if current key layout * Process special keys (VK_OEM_*), to see if current key layout
@@ -299,13 +299,13 @@ protected:
* @param window The window receiving the event (the active window). * @param window The window receiving the event (the active window).
* @return The event created. * @return The event created.
*/ */
static GHOST_Event* processWindowEvent(GHOST_TEventType type, GHOST_IWindow* window); static GHOST_Event *processWindowEvent(GHOST_TEventType type, GHOST_IWindow *window);
/** /**
* Handles minimum window size. * Handles minimum window size.
* @param minmax The MINMAXINFO structure. * @param minmax The MINMAXINFO structure.
*/ */
static void processMinMaxInfo(MINMAXINFO * minmax); static void processMinMaxInfo(MINMAXINFO *minmax);
#ifdef WITH_INPUT_NDOF #ifdef WITH_INPUT_NDOF
/** /**
@@ -342,14 +342,14 @@ protected:
static LRESULT WINAPI s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); static LRESULT WINAPI s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
/** /**
* Toggles console * Toggles console
* @action 0 - Hides * @action 0 - Hides
* 1 - Shows * 1 - Shows
* 2 - Toggles * 2 - Toggles
* 3 - Hides if it runs not from command line * 3 - Hides if it runs not from command line
* * - Does nothing * * - Does nothing
* @return current status (1 -visible, 0 - hidden) * @return current status (1 -visible, 0 - hidden)
*/ */
int toggleConsole(int action); int toggleConsole(int action);
/** The current state of the modifier keys. */ /** The current state of the modifier keys. */
@@ -390,12 +390,12 @@ inline void GHOST_SystemWin32::handleKeyboardChange(void)
// save the language identifier. // save the language identifier.
m_langId = LOWORD(m_keylayout); m_langId = LOWORD(m_keylayout);
for(m_hasAltGr = false, i = 32; i < 256; ++i) { for (m_hasAltGr = false, i = 32; i < 256; ++i) {
s = VkKeyScanEx((char)i, m_keylayout); s = VkKeyScanEx((char)i, m_keylayout);
// s == -1 means no key that translates passed char code // s == -1 means no key that translates passed char code
// high byte contains shift state. bit 2 ctrl pressed, bit 4 alt pressed // high byte contains shift state. bit 2 ctrl pressed, bit 4 alt pressed
// if both are pressed, we have AltGr keycombo on keylayout // if both are pressed, we have AltGr keycombo on keylayout
if(s!=-1 && (s & 0x600) == 0x600) { if (s != -1 && (s & 0x600) == 0x600) {
m_hasAltGr = true; m_hasAltGr = true;
break; break;
} }

View File

@@ -19,54 +19,54 @@
// GHOST_WindowWin32 // GHOST_WindowWin32
#ifndef __ITaskbarList_INTERFACE_DEFINED__ #ifndef __ITaskbarList_INTERFACE_DEFINED__
#define __ITaskbarList_INTERFACE_DEFINED__ #define __ITaskbarList_INTERFACE_DEFINED__
extern "C" {const GUID CLSID_TaskbarList = {0x56FDF344, 0xFD6D, 0x11D0, {0x95, 0x8A, 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90} }; extern "C" {const GUID CLSID_TaskbarList = {0x56FDF344, 0xFD6D, 0x11D0, {0x95, 0x8A, 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90} };
const GUID IID_ITaskbarList = {0x56FDF342, 0xFD6D, 0x11D0, {0x95, 0x8A, 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90} }; } const GUID IID_ITaskbarList = {0x56FDF342, 0xFD6D, 0x11D0, {0x95, 0x8A, 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90} }; }
class ITaskbarList : public IUnknown class ITaskbarList : public IUnknown
{ {
public: public:
virtual HRESULT STDMETHODCALLTYPE HrInit (void) = 0; virtual HRESULT STDMETHODCALLTYPE HrInit(void) = 0;
virtual HRESULT STDMETHODCALLTYPE AddTab (HWND hwnd) = 0; virtual HRESULT STDMETHODCALLTYPE AddTab(HWND hwnd) = 0;
virtual HRESULT STDMETHODCALLTYPE DeleteTab (HWND hwnd) = 0; virtual HRESULT STDMETHODCALLTYPE DeleteTab(HWND hwnd) = 0;
virtual HRESULT STDMETHODCALLTYPE ActivateTab (HWND hwnd) = 0; virtual HRESULT STDMETHODCALLTYPE ActivateTab(HWND hwnd) = 0;
virtual HRESULT STDMETHODCALLTYPE SetActiveAlt (HWND hwnd) = 0; virtual HRESULT STDMETHODCALLTYPE SetActiveAlt(HWND hwnd) = 0;
}; };
#endif /* ITaskbarList */ #endif /* ITaskbarList */
#ifndef __ITaskbarList2_INTERFACE_DEFINED__ #ifndef __ITaskbarList2_INTERFACE_DEFINED__
#define __ITaskbarList2_INTERFACE_DEFINED__ #define __ITaskbarList2_INTERFACE_DEFINED__
extern "C" {const GUID IID_ITaskbarList2 = {0x602D4995, 0xB13A, 0x429b, {0xA6, 0x6E, 0x19, 0x35, 0xE4, 0x4F, 0x43, 0x17} }; } extern "C" {const GUID IID_ITaskbarList2 = {0x602D4995, 0xB13A, 0x429b, {0xA6, 0x6E, 0x19, 0x35, 0xE4, 0x4F, 0x43, 0x17} }; }
class ITaskbarList2 : public ITaskbarList class ITaskbarList2 : public ITaskbarList
{ {
public: public:
virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fFullscreen) = 0; virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fFullscreen) = 0;
}; };
#endif /* ITaskbarList2 */ #endif /* ITaskbarList2 */
#ifndef __ITaskbarList3_INTERFACE_DEFINED__ #ifndef __ITaskbarList3_INTERFACE_DEFINED__
#define __ITaskbarList3_INTERFACE_DEFINED__ #define __ITaskbarList3_INTERFACE_DEFINED__
typedef enum THUMBBUTTONFLAGS {THBF_ENABLED = 0, THBF_DISABLED = 0x1, THBF_DISMISSONCLICK = 0x2, THBF_NOBACKGROUND = 0x4, THBF_HIDDEN = 0x8, THBF_NONINTERACTIVE = 0x10} THUMBBUTTONFLAGS; typedef enum THUMBBUTTONFLAGS {THBF_ENABLED = 0, THBF_DISABLED = 0x1, THBF_DISMISSONCLICK = 0x2, THBF_NOBACKGROUND = 0x4, THBF_HIDDEN = 0x8, THBF_NONINTERACTIVE = 0x10} THUMBBUTTONFLAGS;
typedef enum THUMBBUTTONMASK {THB_BITMAP = 0x1, THB_ICON = 0x2, THB_TOOLTIP = 0x4, THB_FLAGS = 0x8} THUMBBUTTONMASK; typedef enum THUMBBUTTONMASK {THB_BITMAP = 0x1, THB_ICON = 0x2, THB_TOOLTIP = 0x4, THB_FLAGS = 0x8} THUMBBUTTONMASK;
typedef struct THUMBBUTTON {THUMBBUTTONMASK dwMask; UINT iId; UINT iBitmap; HICON hIcon; WCHAR szTip[260]; THUMBBUTTONFLAGS dwFlags; } THUMBBUTTON; typedef struct THUMBBUTTON {THUMBBUTTONMASK dwMask; UINT iId; UINT iBitmap; HICON hIcon; WCHAR szTip[260]; THUMBBUTTONFLAGS dwFlags; } THUMBBUTTON;
typedef enum TBPFLAG {TBPF_NOPROGRESS = 0, TBPF_INDETERMINATE = 0x1, TBPF_NORMAL = 0x2, TBPF_ERROR = 0x4, TBPF_PAUSED = 0x8 } TBPFLAG; typedef enum TBPFLAG {TBPF_NOPROGRESS = 0, TBPF_INDETERMINATE = 0x1, TBPF_NORMAL = 0x2, TBPF_ERROR = 0x4, 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} };} extern "C" {const GUID IID_ITaskList3 = { 0xEA1AFB91, 0x9E28, 0x4B86, {0x90, 0xE9, 0x9E, 0x9F, 0x8A, 0x5E, 0xEF, 0xAF} }; }
class ITaskbarList3 : public ITaskbarList2 class ITaskbarList3 : public ITaskbarList2
{ {
public: public:
virtual HRESULT STDMETHODCALLTYPE SetProgressValue (HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) = 0; virtual HRESULT STDMETHODCALLTYPE SetProgressValue(HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) = 0;
virtual HRESULT STDMETHODCALLTYPE SetProgressState (HWND hwnd, TBPFLAG tbpFlags) = 0; virtual HRESULT STDMETHODCALLTYPE SetProgressState(HWND hwnd, TBPFLAG tbpFlags) = 0;
virtual HRESULT STDMETHODCALLTYPE RegisterTab (HWND hwndTab, HWND hwndMDI) = 0; virtual HRESULT STDMETHODCALLTYPE RegisterTab(HWND hwndTab, HWND hwndMDI) = 0;
virtual HRESULT STDMETHODCALLTYPE UnregisterTab (HWND hwndTab) = 0; virtual HRESULT STDMETHODCALLTYPE UnregisterTab(HWND hwndTab) = 0;
virtual HRESULT STDMETHODCALLTYPE SetTabOrder (HWND hwndTab, HWND hwndInsertBefore) = 0; virtual HRESULT STDMETHODCALLTYPE SetTabOrder(HWND hwndTab, HWND hwndInsertBefore) = 0;
virtual HRESULT STDMETHODCALLTYPE SetTabActive (HWND hwndTab, HWND hwndMDI, DWORD dwReserved) = 0; virtual HRESULT STDMETHODCALLTYPE SetTabActive(HWND hwndTab, HWND hwndMDI, DWORD dwReserved) = 0;
virtual HRESULT STDMETHODCALLTYPE ThumbBarAddButtons (HWND hwnd, UINT cButtons, THUMBBUTTON * pButton) = 0; virtual HRESULT STDMETHODCALLTYPE ThumbBarAddButtons(HWND hwnd, UINT cButtons, THUMBBUTTON *pButton) = 0;
virtual HRESULT STDMETHODCALLTYPE ThumbBarUpdateButtons (HWND hwnd, UINT cButtons, THUMBBUTTON * pButton) = 0; virtual HRESULT STDMETHODCALLTYPE ThumbBarUpdateButtons(HWND hwnd, UINT cButtons, THUMBBUTTON *pButton) = 0;
virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList (HWND hwnd, HIMAGELIST himl) = 0; virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList(HWND hwnd, HIMAGELIST himl) = 0;
virtual HRESULT STDMETHODCALLTYPE SetOverlayIcon (HWND hwnd, HICON hIcon, LPCWSTR pszDescription) = 0; virtual HRESULT STDMETHODCALLTYPE SetOverlayIcon(HWND hwnd, HICON hIcon, LPCWSTR pszDescription) = 0;
virtual HRESULT STDMETHODCALLTYPE SetThumbnailTooltip (HWND hwnd, LPCWSTR pszTip) = 0; virtual HRESULT STDMETHODCALLTYPE SetThumbnailTooltip(HWND hwnd, LPCWSTR pszTip) = 0;
virtual HRESULT STDMETHODCALLTYPE SetThumbnailClip (HWND hwnd, RECT *prcClip) = 0; virtual HRESULT STDMETHODCALLTYPE SetThumbnailClip(HWND hwnd, RECT *prcClip) = 0;
}; };
#endif /* ITaskbarList3 */ #endif /* ITaskbarList3 */
#endif /*__GHOST_TASKBARWIN32_H__*/ #endif /*__GHOST_TASKBARWIN32_H__*/

View File

@@ -64,13 +64,13 @@ public:
* Returns the number of timer tasks. * Returns the number of timer tasks.
* @return The number of events on the stack. * @return The number of events on the stack.
*/ */
virtual GHOST_TUns32 getNumTimers(); virtual GHOST_TUns32 getNumTimers();
/** /**
* Returns whther this timer task ins in our list. * Returns whther this timer task ins in our list.
* @return Indication of presence. * @return Indication of presence.
*/ */
virtual bool getTimerFound(GHOST_TimerTask* timer); virtual bool getTimerFound(GHOST_TimerTask *timer);
/** /**
* Adds a timer task to the list. * Adds a timer task to the list.
@@ -78,7 +78,7 @@ public:
* @param timer The timer task added to the list. * @param timer The timer task added to the list.
* @return Indication as to whether addition has succeeded. * @return Indication as to whether addition has succeeded.
*/ */
virtual GHOST_TSuccess addTimer(GHOST_TimerTask* timer); virtual GHOST_TSuccess addTimer(GHOST_TimerTask *timer);
/** /**
* Removes a timer task from the list. * Removes a timer task from the list.
@@ -86,7 +86,7 @@ public:
* @param timer The timer task to be removed from the list. * @param timer The timer task to be removed from the list.
* @return Indication as to whether removal has succeeded. * @return Indication as to whether removal has succeeded.
*/ */
virtual GHOST_TSuccess removeTimer(GHOST_TimerTask* timer); virtual GHOST_TSuccess removeTimer(GHOST_TimerTask *timer);
/** /**
* Finds the soonest time the next timer would fire. * Finds the soonest time the next timer would fire.
@@ -108,7 +108,7 @@ public:
* @param task The timer task to check and optionally fire. * @param task The timer task to check and optionally fire.
* @return True if the timer fired. * @return True if the timer fired.
*/ */
virtual bool fireTimer(GHOST_TUns64 time, GHOST_TimerTask* task); virtual bool fireTimer(GHOST_TUns64 time, GHOST_TimerTask *task);
protected: protected:
/** /**
@@ -116,7 +116,7 @@ protected:
*/ */
void disposeTimers(); void disposeTimers();
typedef std::vector<GHOST_TimerTask*> TTimerVector; typedef std::vector<GHOST_TimerTask *> TTimerVector;
/** The list with event consumers. */ /** The list with event consumers. */
TTimerVector m_timers; TTimerVector m_timers;
}; };

View File

@@ -56,11 +56,11 @@ public:
GHOST_TimerProcPtr timerProc, GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData = 0) GHOST_TUserDataPtr userData = 0)
: m_start(start), : m_start(start),
m_interval(interval), m_interval(interval),
m_next(start), m_next(start),
m_timerProc(timerProc), m_timerProc(timerProc),
m_userData(userData), m_userData(userData),
m_auxData(0) m_auxData(0)
{ {
} }

View File

@@ -83,12 +83,12 @@ public:
* @param numOfAASamples Number of samples used for AA (zero if no AA) * @param numOfAASamples Number of samples used for AA (zero if no AA)
*/ */
GHOST_Window( GHOST_Window(
GHOST_TUns32 width, GHOST_TUns32 width,
GHOST_TUns32 height, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone, GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
const bool stereoVisual = false, const bool stereoVisual = false,
const GHOST_TUns16 numOfAASamples = 0); const GHOST_TUns16 numOfAASamples = 0);
/** /**
* @section Interface inherited from GHOST_IWindow left for derived class * @section Interface inherited from GHOST_IWindow left for derived class
@@ -121,7 +121,7 @@ public:
* Returns the associated OS object/handle * Returns the associated OS object/handle
* @return The associated OS object/handle * @return The associated OS object/handle
*/ */
virtual void* getOSWindow() const; virtual void *getOSWindow() const;
/** /**
* Returns the current cursor shape. * Returns the current cursor shape.
@@ -145,15 +145,15 @@ public:
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 bitmap[16][2], virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 bitmap[16][2],
GHOST_TUns8 mask[16][2], GHOST_TUns8 mask[16][2],
int hotX, int hotX,
int hotY); int hotY);
virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 *bitmap, virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 *bitmap,
GHOST_TUns8 *mask, GHOST_TUns8 *mask,
int sizex, int sizey, int sizex, int sizey,
int hotX, int hotY, int hotX, int hotY,
int fg_color, int bg_color); int fg_color, int bg_color);
/** /**
* Returns the visibility state of the cursor. * Returns the visibility state of the cursor.
@@ -187,15 +187,19 @@ public:
virtual GHOST_TSuccess getCursorGrabBounds(GHOST_Rect& bounds); virtual GHOST_TSuccess getCursorGrabBounds(GHOST_Rect& bounds);
/** /**
* Sets the progress bar value displayed in the window/application icon * Sets the progress bar value displayed in the window/application icon
* @param progress The progress % (0.0 to 1.0) * @param progress The progress % (0.0 to 1.0)
*/ */
virtual GHOST_TSuccess setProgressBar(float progress) {return GHOST_kFailure;}; virtual GHOST_TSuccess setProgressBar(float progress) {
return GHOST_kFailure;
};
/** /**
* Hides the progress bar in the icon * Hides the progress bar in the icon
*/ */
virtual GHOST_TSuccess endProgressBar() {return GHOST_kFailure;}; virtual GHOST_TSuccess endProgressBar() {
return GHOST_kFailure;
};
/** /**
* Tells if the ongoing drag'n'drop object can be accepted upon mouse drop * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
@@ -278,7 +282,9 @@ protected:
* Sets the cursor grab on the window using * Sets the cursor grab on the window using
* native window system calls. * native window system calls.
*/ */
virtual GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode) { return GHOST_kSuccess; }; virtual GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode) {
return GHOST_kSuccess;
};
/** /**
* Sets the cursor shape on the window using * Sets the cursor shape on the window using
@@ -295,7 +301,7 @@ protected:
int hotX, int hotY) = 0; 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; int szx, int szy, int hotX, int hotY, int fg, int bg) = 0;
/** The the of drawing context installed in this window. */ /** The the of drawing context installed in this window. */
GHOST_TDrawingContextType m_drawingContextType; GHOST_TDrawingContextType m_drawingContextType;
@@ -365,8 +371,8 @@ inline GHOST_TGrabCursorMode GHOST_Window::getCursorGrabMode() const
inline bool GHOST_Window::getCursorGrabModeIsWarp() const inline bool GHOST_Window::getCursorGrabModeIsWarp() const
{ {
return (m_cursorGrab == GHOST_kGrabWrap) || return (m_cursorGrab == GHOST_kGrabWrap) ||
(m_cursorGrab == GHOST_kGrabHide); (m_cursorGrab == GHOST_kGrabHide);
} }
inline void GHOST_Window::getCursorGrabInitPos(GHOST_TInt32 &x, GHOST_TInt32 &y) const inline void GHOST_Window::getCursorGrabInitPos(GHOST_TInt32 &x, GHOST_TInt32 &y) const
@@ -377,14 +383,14 @@ inline void GHOST_Window::getCursorGrabInitPos(GHOST_TInt32 &x, GHOST_TInt32 &y)
inline void GHOST_Window::getCursorGrabAccum(GHOST_TInt32 &x, GHOST_TInt32 &y) const inline void GHOST_Window::getCursorGrabAccum(GHOST_TInt32 &x, GHOST_TInt32 &y) const
{ {
x= m_cursorGrabAccumPos[0]; x = m_cursorGrabAccumPos[0];
y= m_cursorGrabAccumPos[1]; y = m_cursorGrabAccumPos[1];
} }
inline void GHOST_Window::setCursorGrabAccum(GHOST_TInt32 x, GHOST_TInt32 y) inline void GHOST_Window::setCursorGrabAccum(GHOST_TInt32 x, GHOST_TInt32 y)
{ {
m_cursorGrabAccumPos[0]= x; m_cursorGrabAccumPos[0] = x;
m_cursorGrabAccumPos[1]= y; m_cursorGrabAccumPos[1] = y;
} }
inline GHOST_TStandardCursor GHOST_Window::getCursorShape() const inline GHOST_TStandardCursor GHOST_Window::getCursorShape() const

View File

@@ -73,16 +73,16 @@ public:
* @param stereoVisual Stereo visual for quad buffered stereo. * @param stereoVisual Stereo visual for quad buffered stereo.
*/ */
GHOST_WindowCarbon( GHOST_WindowCarbon(
const STR_String& title, const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 left,
GHOST_TInt32 top, GHOST_TInt32 top,
GHOST_TUns32 width, GHOST_TUns32 width,
GHOST_TUns32 height, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone, GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
const bool stereoVisual = false, const bool stereoVisual = false,
const GHOST_TUns16 numOfAASamples = 0 const GHOST_TUns16 numOfAASamples = 0
); );
/** /**
* Destructor. * Destructor.
@@ -94,7 +94,7 @@ public:
* Returns indication as to whether the window is valid. * Returns indication as to whether the window is valid.
* @return The validity of the window. * @return The validity of the window.
*/ */
virtual bool getValid() const; virtual bool getValid() const;
/** /**
* Sets the title displayed in the title bar. * Sets the title displayed in the title bar.
@@ -113,33 +113,33 @@ public:
* 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. * @param bounds The bounding rectangle of the window.
*/ */
virtual void getWindowBounds(GHOST_Rect& bounds) const; virtual void getWindowBounds(GHOST_Rect& bounds) const;
/** /**
* Returns the client rectangle dimensions. * Returns the client rectangle dimensions.
* The left and top members of the rectangle are always zero. * The left and top members of the rectangle are always zero.
* @param bounds The bounding rectangle of the cleient area of the window. * @param bounds The bounding rectangle of the cleient area of the window.
*/ */
virtual void getClientBounds(GHOST_Rect& bounds) const; virtual void getClientBounds(GHOST_Rect& bounds) const;
/** /**
* Resizes client rectangle width. * Resizes client rectangle width.
* @param width The new width of the client area of the window. * @param width The new width of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width); virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width);
/** /**
* Resizes client rectangle height. * Resizes client rectangle height.
* @param height The new height of the client area of the window. * @param height The new height of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height); virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height);
/** /**
* Resizes client rectangle. * Resizes client rectangle.
* @param width The new width of the client area of the window. * @param width The new width of the client area of the window.
* @param height The new height of the client area of the window. * @param height The new height of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height); virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height);
/** /**
* Returns the state of the window (normal, minimized, maximized). * Returns the state of the window (normal, minimized, maximized).
@@ -154,7 +154,7 @@ public:
* @param outX The x-coordinate in the client rectangle. * @param outX The x-coordinate in the client rectangle.
* @param outY The y-coordinate in the client rectangle. * @param outY The y-coordinate in the client rectangle.
*/ */
virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const; virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
/** /**
* Converts a point in screen coordinates to client rectangle coordinates * Converts a point in screen coordinates to client rectangle coordinates
@@ -163,7 +163,7 @@ public:
* @param outX The x-coordinate on the screen. * @param outX The x-coordinate on the screen.
* @param outY The y-coordinate on the screen. * @param outY The y-coordinate on the screen.
*/ */
virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const; virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
/** /**
* Sets the state of the window (normal, minimized, maximized). * Sets the state of the window (normal, minimized, maximized).
@@ -206,16 +206,20 @@ public:
*/ */
virtual bool getFullScreenDirty(); virtual bool getFullScreenDirty();
/* accessor for fullscreen window */ /* accessor for fullscreen window */
virtual void setMac_windowState(short value); virtual void setMac_windowState(short value);
virtual short getMac_windowState(); virtual short getMac_windowState();
const GHOST_TabletData* GetTabletData() const GHOST_TabletData *GetTabletData()
{ return &m_tablet; } {
return &m_tablet;
}
GHOST_TabletData& GetCarbonTabletData() GHOST_TabletData& GetCarbonTabletData()
{ return m_tablet; } {
return m_tablet;
}
protected: protected:
/** /**
* Tries to install a rendering context in this window. * Tries to install a rendering context in this window.
@@ -232,7 +236,7 @@ protected:
/** /**
* Invalidates the contents of this window. * Invalidates the contents of this window.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess invalidate(); virtual GHOST_TSuccess invalidate();
@@ -253,7 +257,7 @@ protected:
* native window system calls. * native window system calls.
*/ */
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask,
int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color); int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color);
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY); virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY);
@@ -278,7 +282,7 @@ protected:
/** The first created OpenGL context (for sharing display lists) */ /** The first created OpenGL context (for sharing display lists) */
static AGLContext s_firstaglCtx; static AGLContext s_firstaglCtx;
Cursor* m_customCursor; Cursor *m_customCursor;
GHOST_TabletData m_tablet; GHOST_TabletData m_tablet;
@@ -286,15 +290,15 @@ protected:
bool m_fullScreenDirty; bool m_fullScreenDirty;
/** specific MacOs X full screen window setting as we use partially system mechanism /** specific MacOs X full screen window setting as we use partially system mechanism
values : 0 not maximizable default * values : 0 not maximizable default
1 normal state * 1 normal state
2 maximized state * 2 maximized state
*
this will be reworked when rebuilding GHOST carbon to use new OS X apis * this will be reworked when rebuilding GHOST carbon to use new OS X apis
in order to be unified with GHOST fullscreen/maximised settings * in order to be unified with GHOST fullscreen/maximised settings
*
(lukep) * (lukep)
**/ **/
short mac_windowState; short mac_windowState;

View File

@@ -74,17 +74,17 @@ public:
* @param numOfAASamples Number of samples used for AA (zero if no AA) * @param numOfAASamples Number of samples used for AA (zero if no AA)
*/ */
GHOST_WindowCocoa( GHOST_WindowCocoa(
GHOST_SystemCocoa *systemCocoa, GHOST_SystemCocoa *systemCocoa,
const STR_String& title, const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 left,
GHOST_TInt32 bottom, GHOST_TInt32 bottom,
GHOST_TUns32 width, GHOST_TUns32 width,
GHOST_TUns32 height, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone, GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
const bool stereoVisual = false, const bool stereoVisual = false,
const GHOST_TUns16 numOfAASamples = 0 const GHOST_TUns16 numOfAASamples = 0
); );
/** /**
* Destructor. * Destructor.
@@ -96,13 +96,13 @@ public:
* Returns indication as to whether the window is valid. * Returns indication as to whether the window is valid.
* @return The validity of the window. * @return The validity of the window.
*/ */
virtual bool getValid() const; virtual bool getValid() const;
/** /**
* Returns the associated NSWindow object * Returns the associated NSWindow object
* @return The associated NSWindow object * @return The associated NSWindow object
*/ */
virtual void* getOSWindow() const; virtual void *getOSWindow() const;
/** /**
* Sets the title displayed in the title bar. * Sets the title displayed in the title bar.
@@ -121,33 +121,33 @@ public:
* 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. * @param bounds The bounding rectangle of the window.
*/ */
virtual void getWindowBounds(GHOST_Rect& bounds) const; virtual void getWindowBounds(GHOST_Rect& bounds) const;
/** /**
* Returns the client rectangle dimensions. * Returns the client rectangle dimensions.
* The left and top members of the rectangle are always zero. * The left and top members of the rectangle are always zero.
* @param bounds The bounding rectangle of the cleient area of the window. * @param bounds The bounding rectangle of the cleient area of the window.
*/ */
virtual void getClientBounds(GHOST_Rect& bounds) const; virtual void getClientBounds(GHOST_Rect& bounds) const;
/** /**
* Resizes client rectangle width. * Resizes client rectangle width.
* @param width The new width of the client area of the window. * @param width The new width of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width); virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width);
/** /**
* Resizes client rectangle height. * Resizes client rectangle height.
* @param height The new height of the client area of the window. * @param height The new height of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height); virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height);
/** /**
* Resizes client rectangle. * Resizes client rectangle.
* @param width The new width of the client area of the window. * @param width The new width of the client area of the window.
* @param height The new height of the client area of the window. * @param height The new height of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height); virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height);
/** /**
* Returns the state of the window (normal, minimized, maximized). * Returns the state of the window (normal, minimized, maximized).
@@ -169,7 +169,7 @@ public:
* @param outX The x-coordinate in the client rectangle. * @param outX The x-coordinate in the client rectangle.
* @param outY The y-coordinate in the client rectangle. * @param outY The y-coordinate in the client rectangle.
*/ */
virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const; virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
/** /**
* Converts a point in screen coordinates to client rectangle coordinates * Converts a point in screen coordinates to client rectangle coordinates
@@ -178,7 +178,7 @@ public:
* @param outX The x-coordinate on the screen. * @param outX The x-coordinate on the screen.
* @param outY The y-coordinate on the screen. * @param outY The y-coordinate on the screen.
*/ */
virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const; virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
/** /**
* Converts a point in screen coordinates to client rectangle coordinates * Converts a point in screen coordinates to client rectangle coordinates
@@ -204,7 +204,7 @@ public:
* Gets the screen the window is displayed in * Gets the screen the window is displayed in
* @return The NSScreen object * @return The NSScreen object
*/ */
NSScreen* getScreen(); NSScreen *getScreen();
/** /**
* Sets the state of the window (normal, minimized, maximized). * Sets the state of the window (normal, minimized, maximized).
@@ -242,11 +242,15 @@ public:
virtual void loadCursor(bool visible, GHOST_TStandardCursor cursor) const; virtual void loadCursor(bool visible, GHOST_TStandardCursor cursor) const;
const GHOST_TabletData* GetTabletData() const GHOST_TabletData *GetTabletData()
{ return &m_tablet; } {
return &m_tablet;
}
GHOST_TabletData& GetCocoaTabletData() GHOST_TabletData& GetCocoaTabletData()
{ return m_tablet; } {
return m_tablet;
}
/** /**
* Sets the progress bar value displayed in the window/application icon * Sets the progress bar value displayed in the window/application icon
@@ -274,7 +278,7 @@ protected:
/** /**
* Invalidates the contents of this window. * Invalidates the contents of this window.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess invalidate(); virtual GHOST_TSuccess invalidate();
@@ -301,7 +305,7 @@ protected:
* native window system calls. * native window system calls.
*/ */
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask,
int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color); int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color);
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY); virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY);
@@ -320,7 +324,7 @@ protected:
/** The first created OpenGL context (for sharing display lists) */ /** The first created OpenGL context (for sharing display lists) */
static NSOpenGLContext *s_firstOpenGLcontext; static NSOpenGLContext *s_firstOpenGLcontext;
NSCursor* m_customCursor; NSCursor *m_customCursor;
GHOST_TabletData m_tablet; GHOST_TabletData m_tablet;
}; };

View File

@@ -63,40 +63,40 @@ public:
* @param window Pointer to the window to be added. * @param window Pointer to the window to be added.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess addWindow(GHOST_IWindow* window); virtual GHOST_TSuccess addWindow(GHOST_IWindow *window);
/** /**
* Remove a window from our list. * Remove a window from our list.
* @param window Pointer to the window to be removed. * @param window Pointer to the window to be removed.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess removeWindow(const GHOST_IWindow* window); virtual GHOST_TSuccess removeWindow(const GHOST_IWindow *window);
/** /**
* Returns whether the window is in our list. * Returns whether the window is in our list.
* @param window Pointer to the window to query. * @param window Pointer to the window to query.
* @return A boolean indicator. * @return A boolean indicator.
*/ */
virtual bool getWindowFound(const GHOST_IWindow* window) const; virtual bool getWindowFound(const GHOST_IWindow *window) const;
/** /**
* Returns whether one of the windows is fullscreen. * Returns whether one of the windows is fullscreen.
* @return A boolean indicator. * @return A boolean indicator.
*/ */
virtual bool getFullScreen(void) const; virtual bool getFullScreen(void) const;
/** /**
* Returns pointer to the full-screen window. * Returns pointer to the full-screen window.
* @return The fll-screen window (0 if not in full-screen). * @return The fll-screen window (0 if not in full-screen).
*/ */
virtual GHOST_IWindow* getFullScreenWindow(void) const; virtual GHOST_IWindow *getFullScreenWindow(void) const;
/** /**
* Activates fullscreen mode for a window. * Activates fullscreen mode for a window.
* @param window The window displayed fullscreen. * @param window The window displayed fullscreen.
* @return Indication of success. * @return Indication of success.
*/ */
virtual GHOST_TSuccess beginFullScreen(GHOST_IWindow* window, const bool stereoVisual); virtual GHOST_TSuccess beginFullScreen(GHOST_IWindow *window, const bool stereoVisual);
/** /**
* Closes fullscreen mode down. * Closes fullscreen mode down.
@@ -109,21 +109,21 @@ public:
* There can be only one window active which should be in the current window list. * There can be only one window active which should be in the current window list.
* @param window The new active window. * @param window The new active window.
*/ */
virtual GHOST_TSuccess setActiveWindow(GHOST_IWindow* window); virtual GHOST_TSuccess setActiveWindow(GHOST_IWindow *window);
/** /**
* Returns the active window (the window receiving events). * Returns the active window (the window receiving events).
* There can be only one window active which should be in the current window list. * 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). * @return window The active window (or NULL if there is none).
*/ */
virtual GHOST_IWindow* getActiveWindow(void) const; virtual GHOST_IWindow *getActiveWindow(void) const;
/** /**
* Set this window to be inactive (not receiving events). * Set this window to be inactive (not receiving events).
* @param window The window to decativate. * @param window The window to decativate.
*/ */
virtual void setWindowInactive(const GHOST_IWindow* window); virtual void setWindowInactive(const GHOST_IWindow *window);
/** /**
@@ -140,7 +140,7 @@ public:
* @param osWindow The OS window object/handle * @param osWindow The OS window object/handle
* @return The associated window, null if none corresponds * @return The associated window, null if none corresponds
*/ */
virtual GHOST_IWindow* getWindowAssociatedWithOSWindow(void* osWindow); virtual GHOST_IWindow *getWindowAssociatedWithOSWindow(void *osWindow);
/** /**
* Return true if any windows has a modified status * Return true if any windows has a modified status
@@ -150,16 +150,16 @@ public:
protected: protected:
/** The list of windows managed */ /** The list of windows managed */
std::vector<GHOST_IWindow*> m_windows; std::vector<GHOST_IWindow *> m_windows;
/** Window in fullscreen state. There can be only one of this which is not in or window list. */ /** Window in fullscreen state. There can be only one of this which is not in or window list. */
GHOST_IWindow* m_fullScreenWindow; GHOST_IWindow *m_fullScreenWindow;
/** The active window. */ /** The active window. */
GHOST_IWindow* m_activeWindow; GHOST_IWindow *m_activeWindow;
/** Window that was active before entering fullscreen state. */ /** Window that was active before entering fullscreen state. */
GHOST_IWindow* m_activeWindowBeforeFullScreen; GHOST_IWindow *m_activeWindowBeforeFullScreen;
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC
public: public:

View File

@@ -41,20 +41,20 @@ public:
const GHOST_TabletData* GetTabletData() { return NULL; } const GHOST_TabletData* GetTabletData() { return NULL; }
GHOST_WindowNULL( GHOST_WindowNULL(
GHOST_SystemNULL *system, GHOST_SystemNULL *system,
const STR_String& title, const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 left,
GHOST_TInt32 top, GHOST_TInt32 top,
GHOST_TUns32 width, GHOST_TUns32 width,
GHOST_TUns32 height, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TWindowState state,
const GHOST_TEmbedderWindowID parentWindow, const GHOST_TEmbedderWindowID parentWindow,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
const bool stereoVisual, const bool stereoVisual,
const GHOST_TUns16 numOfAASamples const GHOST_TUns16 numOfAASamples
) : ) :
GHOST_Window(width,height,state,type,stereoVisual,numOfAASamples), GHOST_Window(width, height, state, type, stereoVisual, numOfAASamples),
m_system (system) m_system(system)
{ {
setTitle(title); setTitle(title);
} }
@@ -87,8 +87,8 @@ protected:
GHOST_TSuccess setOrder(GHOST_TWindowOrder order) { return GHOST_kSuccess; } GHOST_TSuccess setOrder(GHOST_TWindowOrder order) { return GHOST_kSuccess; }
private : private:
GHOST_SystemNULL * m_system; GHOST_SystemNULL *m_system;
}; };

View File

@@ -44,17 +44,19 @@ class STR_String;
class GHOST_WindowSDL : public GHOST_Window class GHOST_WindowSDL : public GHOST_Window
{ {
private : private:
GHOST_SystemSDL * m_system; GHOST_SystemSDL *m_system;
bool m_invalid_window; bool m_invalid_window;
SDL_Window * m_sdl_win; SDL_Window *m_sdl_win;
SDL_GLContext m_sdl_glcontext; SDL_GLContext m_sdl_glcontext;
SDL_Cursor * m_sdl_custom_cursor; SDL_Cursor *m_sdl_custom_cursor;
public: public:
const GHOST_TabletData* GetTabletData() { return NULL; } const GHOST_TabletData *GetTabletData() {
return NULL;
}
GHOST_WindowSDL(GHOST_SystemSDL *system, GHOST_WindowSDL(GHOST_SystemSDL *system,
const STR_String& title, const STR_String& title,
@@ -158,7 +160,11 @@ protected:
GHOST_TWindowState GHOST_TWindowState
getState() const; getState() const;
GHOST_TSuccess setOrder(GHOST_TWindowOrder order) { return GHOST_kSuccess; } // TODO GHOST_TSuccess setOrder(GHOST_TWindowOrder order)
{
// TODO
return GHOST_kSuccess;
}
}; };

View File

@@ -46,18 +46,18 @@
#include <wintab.h> #include <wintab.h>
#define PACKETDATA (PK_BUTTONS | PK_NORMAL_PRESSURE | PK_ORIENTATION | PK_CURSOR) #define PACKETDATA (PK_BUTTONS | PK_NORMAL_PRESSURE | PK_ORIENTATION | PK_CURSOR)
#define PACKETMODE PK_BUTTONS #define PACKETMODE PK_BUTTONS
#include <pktdef.h> #include <pktdef.h>
class GHOST_SystemWin32; class GHOST_SystemWin32;
class GHOST_DropTargetWin32; class GHOST_DropTargetWin32;
// typedefs for WinTab functions to allow dynamic loading // typedefs for WinTab functions to allow dynamic loading
typedef UINT (API * GHOST_WIN32_WTInfo) ( UINT, UINT, LPVOID ); typedef UINT (API * GHOST_WIN32_WTInfo)(UINT, UINT, LPVOID);
typedef HCTX (API * GHOST_WIN32_WTOpen) (HWND, LPLOGCONTEXTA, BOOL); typedef HCTX (API * GHOST_WIN32_WTOpen)(HWND, LPLOGCONTEXTA, BOOL);
typedef BOOL (API * GHOST_WIN32_WTClose) (HCTX); typedef BOOL (API * GHOST_WIN32_WTClose)(HCTX);
typedef BOOL (API * GHOST_WIN32_WTPacket) (HCTX, UINT, LPVOID); typedef BOOL (API * GHOST_WIN32_WTPacket)(HCTX, UINT, LPVOID);
/** /**
* GHOST window on M$ Windows OSs. * GHOST window on M$ Windows OSs.
@@ -81,20 +81,20 @@ public:
* @param numOfAASamples Number of samples used for AA (zero if no AA) * @param numOfAASamples Number of samples used for AA (zero if no AA)
*/ */
GHOST_WindowWin32( GHOST_WindowWin32(
GHOST_SystemWin32 * system, GHOST_SystemWin32 *system,
const STR_String& title, const STR_String& title,
GHOST_TInt32 left, GHOST_TInt32 left,
GHOST_TInt32 top, GHOST_TInt32 top,
GHOST_TUns32 width, GHOST_TUns32 width,
GHOST_TUns32 height, GHOST_TUns32 height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone, GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
const bool stereoVisual = false, const bool stereoVisual = false,
const GHOST_TUns16 numOfAASamples = 0, const GHOST_TUns16 numOfAASamples = 0,
GHOST_TEmbedderWindowID parentWindowHwnd=0, GHOST_TEmbedderWindowID parentWindowHwnd = 0,
GHOST_TSuccess msEnabled = GHOST_kFailure, GHOST_TSuccess msEnabled = GHOST_kFailure,
int msPixelFormat = 0 int msPixelFormat = 0
); );
/** /**
* Destructor. * Destructor.
@@ -113,7 +113,7 @@ public:
* Returns indication as to whether the window is valid. * Returns indication as to whether the window is valid.
* @return The validity of the window. * @return The validity of the window.
*/ */
virtual bool getValid() const; virtual bool getValid() const;
/** /**
* Access to the handle of the window. * Access to the handle of the window.
@@ -138,33 +138,33 @@ public:
* 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. * @param bounds The bounding rectangle of the window.
*/ */
virtual void getWindowBounds(GHOST_Rect& bounds) const; virtual void getWindowBounds(GHOST_Rect& bounds) const;
/** /**
* Returns the client rectangle dimensions. * Returns the client rectangle dimensions.
* The left and top members of the rectangle are always zero. * The left and top members of the rectangle are always zero.
* @param bounds The bounding rectangle of the cleient area of the window. * @param bounds The bounding rectangle of the cleient area of the window.
*/ */
virtual void getClientBounds(GHOST_Rect& bounds) const; virtual void getClientBounds(GHOST_Rect& bounds) const;
/** /**
* Resizes client rectangle width. * Resizes client rectangle width.
* @param width The new width of the client area of the window. * @param width The new width of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width); virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width);
/** /**
* Resizes client rectangle height. * Resizes client rectangle height.
* @param height The new height of the client area of the window. * @param height The new height of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height); virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height);
/** /**
* Resizes client rectangle. * Resizes client rectangle.
* @param width The new width of the client area of the window. * @param width The new width of the client area of the window.
* @param height The new height of the client area of the window. * @param height The new height of the client area of the window.
*/ */
virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height); virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height);
/** /**
* Returns the state of the window (normal, minimized, maximized). * Returns the state of the window (normal, minimized, maximized).
@@ -179,7 +179,7 @@ public:
* @param outX The x-coordinate in the client rectangle. * @param outX The x-coordinate in the client rectangle.
* @param outY The y-coordinate in the client rectangle. * @param outY The y-coordinate in the client rectangle.
*/ */
virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const; virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
/** /**
* Converts a point in screen coordinates to client rectangle coordinates * Converts a point in screen coordinates to client rectangle coordinates
@@ -188,7 +188,7 @@ public:
* @param outX The x-coordinate on the screen. * @param outX The x-coordinate on the screen.
* @param outY The y-coordinate on the screen. * @param outY The y-coordinate on the screen.
*/ */
virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const; virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const;
/** /**
* Sets the state of the window (normal, minimized, maximized). * Sets the state of the window (normal, minimized, maximized).
@@ -222,7 +222,7 @@ public:
virtual GHOST_TSuccess invalidate(); virtual GHOST_TSuccess invalidate();
/** /**
* Sets the progress bar value displayed in the window/application icon * Sets the progress bar value displayed in the window/application icon
* @param progress The progress % * @param progress The progress %
*/ */
virtual GHOST_TSuccess setProgressBar(float progress); virtual GHOST_TSuccess setProgressBar(float progress);
@@ -236,7 +236,9 @@ public:
* Returns the name of the window class. * Returns the name of the window class.
* @return The name of the window class. * @return The name of the window class.
*/ */
static wchar_t* getWindowClassName() { return s_windowClassName; } static wchar_t *getWindowClassName() {
return s_windowClassName;
}
/** /**
* Register a mouse click event (should be called * Register a mouse click event (should be called
@@ -264,8 +266,10 @@ public:
*/ */
void loadCursor(bool visible, GHOST_TStandardCursor cursorShape) const; void loadCursor(bool visible, GHOST_TStandardCursor cursorShape) const;
const GHOST_TabletData* GetTabletData() const GHOST_TabletData *GetTabletData()
{ return m_tabletData; } {
return m_tabletData;
}
void processWin32TabletInitEvent(); void processWin32TabletInitEvent();
void processWin32TabletEvent(WPARAM wParam, LPARAM lParam); void processWin32TabletEvent(WPARAM wParam, LPARAM lParam);
@@ -314,20 +318,20 @@ protected:
int hotX, int hotY); int hotX, int hotY);
virtual GHOST_TSuccess setWindowCustomCursorShape( virtual GHOST_TSuccess setWindowCustomCursorShape(
GHOST_TUns8 *bitmap, GHOST_TUns8 *bitmap,
GHOST_TUns8 *mask, GHOST_TUns8 *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,
int hotY, int hotY,
int fg_color, int fg_color,
int bg_color int bg_color
); );
/** Pointer to system */ /** Pointer to system */
GHOST_SystemWin32 * m_system; GHOST_SystemWin32 *m_system;
/** Pointer to COM IDropTarget implementor */ /** Pointer to COM IDropTarget implementor */
GHOST_DropTargetWin32 * m_dropTarget; GHOST_DropTargetWin32 *m_dropTarget;
/** Window handle. */ /** Window handle. */
HWND m_hWnd; HWND m_hWnd;
/** Device context handle. */ /** Device context handle. */
@@ -349,16 +353,16 @@ protected:
HCURSOR m_customCursor; HCURSOR m_customCursor;
/** ITaskbarList3 structure for progress bar*/ /** ITaskbarList3 structure for progress bar*/
ITaskbarList3 * m_Bar; ITaskbarList3 *m_Bar;
static wchar_t* s_windowClassName; static wchar_t *s_windowClassName;
static const int s_maxTitleLength; static const int s_maxTitleLength;
/** WinTab dll handle */ /** WinTab dll handle */
HMODULE m_wintab; HMODULE m_wintab;
/** Tablet data for GHOST */ /** Tablet data for GHOST */
GHOST_TabletData* m_tabletData; GHOST_TabletData *m_tabletData;
/** Stores the Tablet context if detected Tablet features using WinTab.dll */ /** Stores the Tablet context if detected Tablet features using WinTab.dll */
HCTX m_tablet; HCTX m_tablet;