Compare commits

...

1 Commits

Author SHA1 Message Date
Nicholas Rishel
a5ab9062cb Replace Ghost integral types with standard fixed width integers.
Also replace integer with bool in Ghost API when only used as boolean, and replace uint8* with char* in Ghost API when variable is a string.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11617
2021-07-05 10:10:20 -07:00
92 changed files with 896 additions and 1071 deletions

View File

@@ -96,7 +96,7 @@ extern GHOST_TSuccess GHOST_DisposeEventConsumer(GHOST_EventConsumerHandle consu
* \param systemhandle: The handle to the system. * \param systemhandle: The handle to the system.
* \return The number of milliseconds. * \return The number of milliseconds.
*/ */
extern GHOST_TUns64 GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle); extern uint64_t GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle);
/** /**
* Installs a timer. * Installs a timer.
@@ -110,8 +110,8 @@ 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, uint64_t delay,
GHOST_TUns64 interval, uint64_t interval,
GHOST_TimerProcPtr timerProc, GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData); GHOST_TUserDataPtr userData);
@@ -133,7 +133,7 @@ extern GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle,
* \param systemhandle: The handle to the system. * \param systemhandle: The handle to the system.
* \return The number of displays. * \return The number of displays.
*/ */
extern GHOST_TUns8 GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle); extern uint8_t GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle);
/** /**
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
@@ -142,8 +142,8 @@ extern GHOST_TUns8 GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle);
* \param height: A pointer the height gets put in. * \param height: A pointer the height gets put in.
*/ */
extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle, extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
GHOST_TUns32 *width, uint32_t *width,
GHOST_TUns32 *height); uint32_t *height);
/** /**
* Returns the dimensions of all displays combine * Returns the dimensions of all displays combine
@@ -154,8 +154,8 @@ extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
* \param height: A pointer the height gets put in. * \param height: A pointer the height gets put in.
*/ */
extern void GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle, extern void GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle,
GHOST_TUns32 *width, uint32_t *width,
GHOST_TUns32 *height); uint32_t *height);
/** /**
* Create a new window. * Create a new window.
@@ -178,10 +178,10 @@ extern void GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle,
extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle, extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
GHOST_WindowHandle parent_windowhandle, GHOST_WindowHandle parent_windowhandle,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
bool is_dialog, bool is_dialog,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
@@ -360,13 +360,13 @@ extern GHOST_TSuccess GHOST_HasCursorShape(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, uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,
int hotY, int hotY,
GHOST_TUns8 canInvertColor); bool canInvertColor);
/** /**
* Returns the visibility state of the cursor. * Returns the visibility state of the cursor.
@@ -391,8 +391,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, int32_t *x,
GHOST_TInt32 *y); int32_t *y);
/** /**
* Updates the location of the cursor (location in screen coordinates). * Updates the location of the cursor (location in screen coordinates).
@@ -403,8 +403,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, int32_t x,
GHOST_TInt32 y); int32_t y);
/** /**
* Grabs the cursor for a modal operation, to keep receiving * Grabs the cursor for a modal operation, to keep receiving
@@ -467,7 +467,7 @@ extern void GHOST_setNDOFDeadZone(float deadzone);
/** /**
* 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
*/ */
extern void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, GHOST_TInt8 canAccept); extern void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, bool canAccept);
/** /**
* Returns the event type. * Returns the event type.
@@ -481,7 +481,7 @@ extern GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle);
* \param eventhandle: The handle to the event. * \param eventhandle: The handle to the event.
* \return The event generation time. * \return The event generation time.
*/ */
extern GHOST_TUns64 GHOST_GetEventTime(GHOST_EventHandle eventhandle); extern uint64_t GHOST_GetEventTime(GHOST_EventHandle eventhandle);
/** /**
* Returns the window this event was generated on, * Returns the window this event was generated on,
@@ -595,7 +595,7 @@ void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle);
* \param width: The new width of the client area of the window. * \param width: The new width of the client area of the window.
* \return Indication of success. * \return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle, GHOST_TUns32 width); extern GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle, uint32_t width);
/** /**
* Resizes client rectangle height. * Resizes client rectangle height.
@@ -603,7 +603,7 @@ extern GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle, GHOS
* \param height: The new height of the client area of the window. * \param height: The new height of the client area of the window.
* \return Indication of success. * \return Indication of success.
*/ */
extern GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle, GHOST_TUns32 height); extern GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle, uint32_t height);
/** /**
* Resizes client rectangle. * Resizes client rectangle.
@@ -613,8 +613,8 @@ extern GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle, GHO
* \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, uint32_t width,
GHOST_TUns32 height); uint32_t height);
/** /**
* Converts a point in screen coordinates to client rectangle coordinates * Converts a point in screen coordinates to client rectangle coordinates
@@ -624,11 +624,8 @@ extern GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
* \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.
*/ */
extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle, extern void GHOST_ScreenToClient(
GHOST_TInt32 inX, GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY);
GHOST_TInt32 inY,
GHOST_TInt32 *outX,
GHOST_TInt32 *outY);
/** /**
* Converts a point in screen coordinates to client rectangle coordinates * Converts a point in screen coordinates to client rectangle coordinates
@@ -638,11 +635,8 @@ extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
* \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.
*/ */
extern void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle, extern void GHOST_ClientToScreen(
GHOST_TInt32 inX, GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY);
GHOST_TInt32 inY,
GHOST_TInt32 *outX,
GHOST_TInt32 *outY);
/** /**
* Returns the state of the window (normal, minimized, maximized). * Returns the state of the window (normal, minimized, maximized).
@@ -667,7 +661,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); bool isUnsavedChanges);
/** /**
* Sets the order of the window (bottom, top). * Sets the order of the window (bottom, top).
@@ -758,14 +752,14 @@ extern void GHOST_SetTabletAPI(GHOST_SystemHandle systemhandle, GHOST_TTabletAPI
* \param rectanglehandle: The handle to the rectangle. * \param rectanglehandle: The handle to the rectangle.
* \return width of the rectangle * \return width of the rectangle
*/ */
extern GHOST_TInt32 GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle); extern int32_t GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle);
/** /**
* Access to rectangle height. * Access to rectangle height.
* \param rectanglehandle: The handle to the rectangle. * \param rectanglehandle: The handle to the rectangle.
* \return height of the rectangle * \return height of the rectangle
*/ */
extern GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle); extern int32_t GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle);
/** /**
* Gets all members of the rectangle. * Gets all members of the rectangle.
@@ -775,11 +769,8 @@ extern GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehand
* \param r: Pointer to return right coordinate in. * \param r: Pointer to return right coordinate in.
* \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_TInt32 *l, GHOST_RectangleHandle rectanglehandle, int32_t *l, int32_t *t, int32_t *r, int32_t *b);
GHOST_TInt32 *t,
GHOST_TInt32 *r,
GHOST_TInt32 *b);
/** /**
* Sets all members of the rectangle. * Sets all members of the rectangle.
@@ -789,11 +780,8 @@ extern void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle,
* \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.
*/ */
extern void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle, extern void GHOST_SetRectangle(
GHOST_TInt32 l, GHOST_RectangleHandle rectanglehandle, int32_t l, int32_t t, int32_t r, int32_t b);
GHOST_TInt32 t,
GHOST_TInt32 r,
GHOST_TInt32 b);
/** /**
* Returns whether this rectangle is empty. * Returns whether this rectangle is empty.
@@ -818,7 +806,7 @@ extern GHOST_TSuccess GHOST_IsValidRectangle(GHOST_RectangleHandle rectanglehand
* \param rectanglehandle: The handle to the rectangle. * \param rectanglehandle: The handle to the rectangle.
* \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, GHOST_TInt32 i); extern void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle, int32_t i);
/** /**
* Does a union of the rectangle given and this rectangle. * Does a union of the rectangle given and this rectangle.
@@ -835,9 +823,7 @@ extern void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle,
* \param x: The x-coordinate of the point. * \param x: The x-coordinate of the point.
* \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, int32_t x, int32_t y);
GHOST_TInt32 x,
GHOST_TInt32 y);
/** /**
* Returns whether the point is inside this rectangle. * Returns whether the point is inside this rectangle.
@@ -848,8 +834,8 @@ extern void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle,
* \return Success value (true if point is inside). * \return Success 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, int32_t x,
GHOST_TInt32 y); int32_t y);
/** /**
* Returns whether the rectangle is inside this rectangle. * Returns whether the rectangle is inside this rectangle.
@@ -868,8 +854,8 @@ extern GHOST_TVisibility GHOST_GetRectangleVisibility(
* \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, int32_t cx,
GHOST_TInt32 cy); int32_t cy);
/** /**
* Sets rectangle members. * Sets rectangle members.
@@ -881,11 +867,8 @@ extern void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle,
* \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.
*/ */
extern void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle, extern void GHOST_SetRectangleCenter(
GHOST_TInt32 cx, GHOST_RectangleHandle rectanglehandle, int32_t cx, int32_t cy, int32_t w, int32_t h);
GHOST_TInt32 cy,
GHOST_TInt32 w,
GHOST_TInt32 h);
/** /**
* Clips a rectangle. * Clips a rectangle.
@@ -903,14 +886,14 @@ extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
* \param selection: Boolean to return the selection instead, X11 only feature. * \param selection: Boolean to return the selection instead, X11 only feature.
* \return clipboard data * \return clipboard data
*/ */
extern GHOST_TUns8 *GHOST_getClipboard(int selection); extern char *GHOST_getClipboard(bool selection);
/** /**
* Put data to the Clipboard * Put data to the Clipboard
* \param buffer: the string buffer to set. * \param buffer: the string buffer to set.
* \param selection: Set the selection instead, X11 only feature. * \param selection: Set the selection instead, X11 only feature.
*/ */
extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection); extern void GHOST_putClipboard(char *buffer, bool selection);
/** /**
* Toggles console * Toggles console
@@ -942,7 +925,7 @@ extern float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle);
/** /**
* Returns the suggested DPI for this window. * Returns the suggested DPI for this window.
*/ */
extern GHOST_TUns16 GHOST_GetDPIHint(GHOST_WindowHandle windowhandle); extern uint16_t GHOST_GetDPIHint(GHOST_WindowHandle windowhandle);
/** /**
* Enable IME attached to the given window, i.e. allows user-input * Enable IME attached to the given window, i.e. allows user-input
@@ -956,12 +939,8 @@ extern GHOST_TUns16 GHOST_GetDPIHint(GHOST_WindowHandle windowhandle);
* - true: Start a new composition. * - true: Start a new composition.
* - false: Move the IME windows to the given position without finishing it. * - false: Move the IME windows to the given position without finishing it.
*/ */
extern void GHOST_BeginIME(GHOST_WindowHandle windowhandle, extern void GHOST_BeginIME(
GHOST_TInt32 x, GHOST_WindowHandle windowhandle, int32_t x, int32_t y, int32_t w, int32_t h, bool complete);
GHOST_TInt32 y,
GHOST_TInt32 w,
GHOST_TInt32 h,
int complete);
/** /**
* Disable the IME attached to the given window, i.e. prohibits any user-input * Disable the IME attached to the given window, i.e. prohibits any user-input
* events from being dispatched to the IME. * events from being dispatched to the IME.
@@ -1076,7 +1055,7 @@ void GHOST_XrDestroyActionSet(GHOST_XrContextHandle xr_context, const char *acti
*/ */
int GHOST_XrCreateActions(GHOST_XrContextHandle xr_context, int GHOST_XrCreateActions(GHOST_XrContextHandle xr_context,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const GHOST_XrActionInfo *infos); const GHOST_XrActionInfo *infos);
/** /**
@@ -1084,7 +1063,7 @@ int GHOST_XrCreateActions(GHOST_XrContextHandle xr_context,
*/ */
void GHOST_XrDestroyActions(GHOST_XrContextHandle xr_context, void GHOST_XrDestroyActions(GHOST_XrContextHandle xr_context,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const char *const *action_names); const char *const *action_names);
/** /**
@@ -1092,7 +1071,7 @@ void GHOST_XrDestroyActions(GHOST_XrContextHandle xr_context,
*/ */
int GHOST_XrCreateActionSpaces(GHOST_XrContextHandle xr_context, int GHOST_XrCreateActionSpaces(GHOST_XrContextHandle xr_context,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const GHOST_XrActionSpaceInfo *infos); const GHOST_XrActionSpaceInfo *infos);
/** /**
@@ -1100,7 +1079,7 @@ int GHOST_XrCreateActionSpaces(GHOST_XrContextHandle xr_context,
*/ */
void GHOST_XrDestroyActionSpaces(GHOST_XrContextHandle xr_context, void GHOST_XrDestroyActionSpaces(GHOST_XrContextHandle xr_context,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const GHOST_XrActionSpaceInfo *infos); const GHOST_XrActionSpaceInfo *infos);
/** /**
@@ -1108,7 +1087,7 @@ void GHOST_XrDestroyActionSpaces(GHOST_XrContextHandle xr_context,
*/ */
int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_context, int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_context,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const GHOST_XrActionProfileInfo *infos); const GHOST_XrActionProfileInfo *infos);
/** /**
@@ -1116,7 +1095,7 @@ int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_context,
*/ */
void GHOST_XrDestroyActionBindings(GHOST_XrContextHandle xr_context, void GHOST_XrDestroyActionBindings(GHOST_XrContextHandle xr_context,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const GHOST_XrActionProfileInfo *infos); const GHOST_XrActionProfileInfo *infos);
/** /**
@@ -1138,7 +1117,7 @@ int GHOST_XrSyncActions(GHOST_XrContextHandle xr_context, const char *action_set
int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_context, int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_context,
const char *action_set_name, const char *action_set_name,
const char *action_name, const char *action_name,
const GHOST_TInt64 *duration, const int64_t *duration,
const float *frequency, const float *frequency,
const float *amplitude); const float *amplitude);

View File

@@ -58,7 +58,7 @@ class GHOST_IEvent {
* Returns the time this event was generated. * Returns the time this event was generated.
* \return The event generation time. * \return The event generation time.
*/ */
virtual GHOST_TUns64 getTime() = 0; virtual uint64_t getTime() = 0;
/** /**
* Returns the window this event was generated on, * Returns the window this event was generated on,

View File

@@ -177,7 +177,7 @@ class GHOST_ISystem {
* Based on ANSI clock() routine. * Based on ANSI clock() routine.
* \return The number of milliseconds. * \return The number of milliseconds.
*/ */
virtual GHOST_TUns64 getMilliSeconds() const = 0; virtual uint64_t getMilliSeconds() const = 0;
/** /**
* Installs a timer. * Installs a timer.
@@ -189,8 +189,8 @@ class GHOST_ISystem {
* \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(uint64_t delay,
GHOST_TUns64 interval, uint64_t interval,
GHOST_TimerProcPtr timerProc, GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData = NULL) = 0; GHOST_TUserDataPtr userData = NULL) = 0;
@@ -209,19 +209,19 @@ class GHOST_ISystem {
* 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 uint8_t getNumDisplays() const = 0;
/** /**
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
* \return The dimension of the main display. * \return The dimension of the main display.
*/ */
virtual void getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const = 0; virtual void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const = 0;
/** /**
* Returns the combine dimensions of all monitors. * Returns the combine dimensions of all monitors.
* \return The dimension of the workspace. * \return The dimension of the workspace.
*/ */
virtual void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const = 0; virtual void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const = 0;
/** /**
* Create a new window. * Create a new window.
@@ -242,10 +242,10 @@ class GHOST_ISystem {
* \return The new window (or 0 if creation failed). * \return The new window (or 0 if creation failed).
*/ */
virtual GHOST_IWindow *createWindow(const char *title, virtual GHOST_IWindow *createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,
@@ -365,7 +365,7 @@ class GHOST_ISystem {
* \param y: The y-coordinate of the cursor. * \param y: The y-coordinate of the cursor.
* \return Indication of success. * \return Indication of success.
*/ */
virtual GHOST_TSuccess getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const = 0; virtual GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const = 0;
/** /**
* Updates the location of the cursor (location in screen coordinates). * Updates the location of the cursor (location in screen coordinates).
@@ -374,7 +374,7 @@ class GHOST_ISystem {
* \param y: The y-coordinate of the cursor. * \param y: The y-coordinate of the cursor.
* \return Indication of success. * \return Indication of success.
*/ */
virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) = 0; virtual GHOST_TSuccess setCursorPosition(int32_t x, int32_t y) = 0;
/*************************************************************************************** /***************************************************************************************
* Access to mouse button and keyboard states. * Access to mouse button and keyboard states.
@@ -431,12 +431,12 @@ class GHOST_ISystem {
* \return "unsigned char" from X11 XA_CUT_BUFFER0 buffer * \return "unsigned char" from X11 XA_CUT_BUFFER0 buffer
* *
*/ */
virtual GHOST_TUns8 *getClipboard(bool selection) const = 0; virtual char *getClipboard(bool selection) const = 0;
/** /**
* Put data to the Clipboard * Put data to the Clipboard
*/ */
virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0; virtual void putClipboard(char *buffer, bool selection) const = 0;
/*************************************************************************************** /***************************************************************************************
* System Message Box. * System Message Box.

View File

@@ -68,26 +68,26 @@ class GHOST_ISystemPaths {
* "unpack and run" path, then look for properly installed path, including versioning. * "unpack and run" path, then look for properly installed path, 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(int version, const char *versionstr) const = 0; virtual const char *getSystemDir(int version, const char *versionstr) const = 0;
/** /**
* Determine the base dir in which user configuration is stored, including versioning. * Determine the base dir in which user configuration is stored, 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(int version, const char *versionstr) const = 0; virtual const char *getUserDir(int version, const char *versionstr) const = 0;
/** /**
* Determine a special ("well known") and easy to reach user directory. * Determine a special ("well known") and easy to reach user directory.
* \return Unsigned char string pointing to user dir (eg `~/Documents/`). * \return Unsigned char string pointing to user dir (eg `~/Documents/`).
*/ */
virtual const GHOST_TUns8 *getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const = 0; virtual const char *getUserSpecialDir(GHOST_TUserSpecialDirTypes type) 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 char *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

View File

@@ -108,20 +108,20 @@ class GHOST_IWindow {
* 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(uint32_t 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(uint32_t 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(uint32_t width, uint32_t height) = 0;
/** /**
* Converts a point in screen coordinates to client rectangle coordinates * Converts a point in screen coordinates to client rectangle coordinates
@@ -130,10 +130,7 @@ class GHOST_IWindow {
* \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, virtual void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const = 0;
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
@@ -142,10 +139,7 @@ class GHOST_IWindow {
* \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, virtual void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const = 0;
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
@@ -290,8 +284,8 @@ class GHOST_IWindow {
* \param hotY: The Y coordinate of the cursor hot-spot. * \param hotY: The Y coordinate of the cursor hot-spot.
* \return Indication of success. * \return Indication of success.
*/ */
virtual GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 *bitmap, virtual GHOST_TSuccess setCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,
@@ -319,7 +313,7 @@ class GHOST_IWindow {
virtual GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode /*mode*/, virtual GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode /*mode*/,
GHOST_TAxisFlag /*wrap_axis*/, GHOST_TAxisFlag /*wrap_axis*/,
GHOST_Rect * /*bounds*/, GHOST_Rect * /*bounds*/,
GHOST_TInt32 /*mouse_ungrab_xy*/[2]) int32_t /*mouse_ungrab_xy*/[2])
{ {
return GHOST_kSuccess; return GHOST_kSuccess;
} }
@@ -334,7 +328,7 @@ class GHOST_IWindow {
* Returns the recommended DPI for this window. * Returns the recommended DPI for this window.
* \return The recommended DPI for this window. * \return The recommended DPI for this window.
*/ */
virtual GHOST_TUns16 getDPIHint() = 0; virtual uint16_t getDPIHint() = 0;
#ifdef WITH_INPUT_IME #ifdef WITH_INPUT_IME
/** /**
@@ -348,8 +342,7 @@ class GHOST_IWindow {
* - true: Start a new composition * - true: Start a new composition
* - false: Move the IME windows to the given position without finishing it. * - false: Move the IME windows to the given position without finishing it.
*/ */
virtual void beginIME( virtual void beginIME(int32_t x, int32_t y, int32_t w, int32_t h, bool completed) = 0;
GHOST_TInt32 x, GHOST_TInt32 y, GHOST_TInt32 w, GHOST_TInt32 h, int completed) = 0;
/** /**
* Disable the IME attached to the given window, i.e. prohibits any user-input * Disable the IME attached to the given window, i.e. prohibits any user-input

View File

@@ -48,25 +48,25 @@ extern GHOST_TSuccess GHOST_DisposeSystemPaths(void);
* "unpack and run" path, then look for properly installed path, including versioning. * "unpack and run" path, then look for properly installed path, 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(int version, const char *versionstr); extern const char *GHOST_getSystemDir(int version, const char *versionstr);
/** /**
* Determine the base dir in which user configuration is stored, including versioning. * Determine the base dir in which user configuration is stored, 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(int version, const char *versionstr); extern const char *GHOST_getUserDir(int version, const char *versionstr);
/** /**
* Determine a special ("well known") and easy to reach user directory. * Determine a special ("well known") and easy to reach user directory.
* \return Unsigned char string pointing to user dir (eg `~/Documents/`). * \return Unsigned char string pointing to user dir (eg `~/Documents/`).
*/ */
extern const GHOST_TUns8 *GHOST_getUserSpecialDir(GHOST_TUserSpecialDirTypes type); extern const char *GHOST_getUserSpecialDir(GHOST_TUserSpecialDirTypes type);
/** /**
* 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 char *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

View File

@@ -42,7 +42,7 @@ class GHOST_Rect {
* \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(int32_t l = 0, int32_t t = 0, int32_t r = 0, int32_t 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)
{ {
} }
@@ -58,13 +58,13 @@ class GHOST_Rect {
* Access to rectangle width. * Access to rectangle width.
* \return width of the rectangle. * \return width of the rectangle.
*/ */
virtual inline GHOST_TInt32 getWidth() const; virtual inline int32_t getWidth() const;
/** /**
* Access to rectangle height. * Access to rectangle height.
* \return height of the rectangle. * \return height of the rectangle.
*/ */
virtual inline GHOST_TInt32 getHeight() const; virtual inline int32_t getHeight() const;
/** /**
* Sets all members of the rectangle. * Sets all members of the rectangle.
@@ -73,7 +73,7 @@ class GHOST_Rect {
* \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.
*/ */
virtual inline void set(GHOST_TInt32 l, GHOST_TInt32 t, GHOST_TInt32 r, GHOST_TInt32 b); virtual inline void set(int32_t l, int32_t t, int32_t r, int32_t b);
/** /**
* Returns whether this rectangle is empty. * Returns whether this rectangle is empty.
@@ -95,7 +95,7 @@ class GHOST_Rect {
* The method avoids negative insets making the rectangle invalid * The method avoids negative insets making the rectangle invalid
* \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).
*/ */
virtual void inset(GHOST_TInt32 i); virtual void inset(int32_t i);
/** /**
* Does a union of the rectangle given and this rectangle. * Does a union of the rectangle given and this rectangle.
@@ -109,17 +109,14 @@ class GHOST_Rect {
* \param x: The x-coordinate of the point. * \param x: The x-coordinate of the point.
* \param y: The y-coordinate of the point. * \param y: The y-coordinate of the point.
*/ */
virtual inline void unionPoint(GHOST_TInt32 x, GHOST_TInt32 y); virtual inline void unionPoint(int32_t x, int32_t y);
/** /**
* Grows the rectangle to included a point. * Grows the rectangle to included a point.
* \param x: The x-coordinate of the point. * \param x: The x-coordinate of the point.
* \param y: The y-coordinate of the point. * \param y: The y-coordinate of the point.
*/ */
virtual inline void wrapPoint(GHOST_TInt32 &x, virtual inline void wrapPoint(int32_t &x, int32_t &y, int32_t ofs, GHOST_TAxisFlag axis);
GHOST_TInt32 &y,
GHOST_TInt32 ofs,
GHOST_TAxisFlag axis);
/** /**
* Returns whether the point is inside this rectangle. * Returns whether the point is inside this rectangle.
@@ -128,7 +125,7 @@ class GHOST_Rect {
* \param y: y-coordinate of point to test. * \param y: y-coordinate of point to test.
* \return boolean value (true if point is inside). * \return boolean value (true if point is inside).
*/ */
virtual inline bool isInside(GHOST_TInt32 x, GHOST_TInt32 y) const; virtual inline bool isInside(int32_t x, int32_t y) const;
/** /**
* Returns whether the rectangle is inside this rectangle. * Returns whether the rectangle is inside this rectangle.
@@ -143,7 +140,7 @@ class GHOST_Rect {
* \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(int32_t cx, int32_t cy);
/** /**
* Sets rectangle members. * Sets rectangle members.
@@ -154,7 +151,7 @@ class GHOST_Rect {
* \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(int32_t cx, int32_t cy, int32_t w, int32_t h);
/** /**
* Clips a rectangle. * Clips a rectangle.
@@ -166,30 +163,30 @@ class GHOST_Rect {
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; int32_t m_l;
/** Top coordinate of the rectangle */ /** Top coordinate of the rectangle */
GHOST_TInt32 m_t; int32_t m_t;
/** Right coordinate of the rectangle */ /** Right coordinate of the rectangle */
GHOST_TInt32 m_r; int32_t m_r;
/** Bottom coordinate of the rectangle */ /** Bottom coordinate of the rectangle */
GHOST_TInt32 m_b; int32_t m_b;
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_Rect") MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_Rect")
#endif #endif
}; };
inline GHOST_TInt32 GHOST_Rect::getWidth() const inline int32_t GHOST_Rect::getWidth() const
{ {
return m_r - m_l; return m_r - m_l;
} }
inline GHOST_TInt32 GHOST_Rect::getHeight() const inline int32_t GHOST_Rect::getHeight() const
{ {
return m_b - m_t; return m_b - m_t;
} }
inline void GHOST_Rect::set(GHOST_TInt32 l, GHOST_TInt32 t, GHOST_TInt32 r, GHOST_TInt32 b) inline void GHOST_Rect::set(int32_t l, int32_t t, int32_t r, int32_t b)
{ {
m_l = l; m_l = l;
m_t = t; m_t = t;
@@ -219,7 +216,7 @@ inline void GHOST_Rect::unionRect(const GHOST_Rect &r)
m_b = r.m_b; m_b = r.m_b;
} }
inline void GHOST_Rect::unionPoint(GHOST_TInt32 x, GHOST_TInt32 y) inline void GHOST_Rect::unionPoint(int32_t x, int32_t y)
{ {
if (x < m_l) if (x < m_l)
m_l = x; m_l = x;
@@ -231,13 +228,10 @@ inline void GHOST_Rect::unionPoint(GHOST_TInt32 x, GHOST_TInt32 y)
m_b = y; m_b = y;
} }
inline void GHOST_Rect::wrapPoint(GHOST_TInt32 &x, inline void GHOST_Rect::wrapPoint(int32_t &x, int32_t &y, int32_t ofs, GHOST_TAxisFlag axis)
GHOST_TInt32 &y,
GHOST_TInt32 ofs,
GHOST_TAxisFlag axis)
{ {
GHOST_TInt32 w = getWidth(); int32_t w = getWidth();
GHOST_TInt32 h = getHeight(); int32_t 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) {
@@ -258,7 +252,7 @@ inline void GHOST_Rect::wrapPoint(GHOST_TInt32 &x,
} }
} }
inline bool GHOST_Rect::isInside(GHOST_TInt32 x, GHOST_TInt32 y) const inline bool GHOST_Rect::isInside(int32_t x, int32_t y) const
{ {
return (x >= m_l) && (x <= m_r) && (y >= m_t) && (y <= m_b); return (x >= m_l) && (x <= m_r) && (y >= m_t) && (y <= m_b);
} }

View File

@@ -23,6 +23,8 @@
#pragma once #pragma once
#include <stdint.h>
#ifdef WITH_CXX_GUARDEDALLOC #ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h" # include "MEM_guardedalloc.h"
#endif #endif
@@ -56,13 +58,6 @@ GHOST_DECLARE_HANDLE(GHOST_EventConsumerHandle);
GHOST_DECLARE_HANDLE(GHOST_ContextHandle); GHOST_DECLARE_HANDLE(GHOST_ContextHandle);
GHOST_DECLARE_HANDLE(GHOST_XrContextHandle); GHOST_DECLARE_HANDLE(GHOST_XrContextHandle);
typedef char GHOST_TInt8;
typedef unsigned char GHOST_TUns8;
typedef short GHOST_TInt16;
typedef unsigned short GHOST_TUns16;
typedef int GHOST_TInt32;
typedef unsigned int GHOST_TUns32;
typedef struct { typedef struct {
int flags; int flags;
} GHOST_GLSettings; } GHOST_GLSettings;
@@ -78,14 +73,6 @@ typedef enum GHOST_DialogOptions {
GHOST_DialogError = (1 << 1), GHOST_DialogError = (1 << 1),
} GHOST_DialogOptions; } GHOST_DialogOptions;
#ifdef _MSC_VER
typedef __int64 GHOST_TInt64;
typedef unsigned __int64 GHOST_TUns64;
#else
typedef long long GHOST_TInt64;
typedef unsigned long long GHOST_TUns64;
#endif
typedef void *GHOST_TUserDataPtr; typedef void *GHOST_TUserDataPtr;
typedef enum { GHOST_kFailure = 0, GHOST_kSuccess } GHOST_TSuccess; typedef enum { GHOST_kFailure = 0, GHOST_kSuccess } GHOST_TSuccess;
@@ -436,9 +423,9 @@ typedef void *GHOST_TEventDataPtr;
typedef struct { typedef struct {
/** The x-coordinate of the cursor position. */ /** The x-coordinate of the cursor position. */
GHOST_TInt32 x; int32_t x;
/** The y-coordinate of the cursor position. */ /** The y-coordinate of the cursor position. */
GHOST_TInt32 y; int32_t y;
/** Associated tablet data. */ /** Associated tablet data. */
GHOST_TabletData tablet; GHOST_TabletData tablet;
} GHOST_TEventCursorData; } GHOST_TEventCursorData;
@@ -452,7 +439,7 @@ typedef struct {
typedef struct { typedef struct {
/** Displacement of a mouse wheel. */ /** Displacement of a mouse wheel. */
GHOST_TInt32 z; int32_t z;
} GHOST_TEventWheelData; } GHOST_TEventWheelData;
typedef enum { typedef enum {
@@ -468,13 +455,13 @@ typedef struct {
/** The event subtype */ /** The event subtype */
GHOST_TTrackpadEventSubTypes subtype; GHOST_TTrackpadEventSubTypes subtype;
/** The x-location of the trackpad event */ /** The x-location of the trackpad event */
GHOST_TInt32 x; int32_t x;
/** The y-location of the trackpad event */ /** The y-location of the trackpad event */
GHOST_TInt32 y; int32_t y;
/** The x-delta or value of the trackpad event */ /** The x-delta or value of the trackpad event */
GHOST_TInt32 deltaX; int32_t deltaX;
/** The y-delta (currently only for scroll subtype) of the trackpad event */ /** The y-delta (currently only for scroll subtype) of the trackpad event */
GHOST_TInt32 deltaY; int32_t deltaY;
/** The delta is inverted from the device due to system preferences. */ /** The delta is inverted from the device due to system preferences. */
char isDirectionInverted; char isDirectionInverted;
} GHOST_TEventTrackpadData; } GHOST_TEventTrackpadData;
@@ -488,9 +475,9 @@ typedef enum {
typedef struct { typedef struct {
/** The x-coordinate of the cursor position. */ /** The x-coordinate of the cursor position. */
GHOST_TInt32 x; int32_t x;
/** The y-coordinate of the cursor position. */ /** The y-coordinate of the cursor position. */
GHOST_TInt32 y; int32_t y;
/** The dropped item type */ /** The dropped item type */
GHOST_TDragnDropTypes dataType; GHOST_TDragnDropTypes dataType;
/** The "dropped content" */ /** The "dropped content" */
@@ -515,7 +502,7 @@ typedef struct {
typedef struct { typedef struct {
int count; int count;
GHOST_TUns8 **strings; uint8_t **strings;
} GHOST_TStringArray; } GHOST_TStringArray;
typedef enum { typedef enum {
@@ -587,13 +574,13 @@ typedef enum {
typedef struct { typedef struct {
/** Number of pixels on a line. */ /** Number of pixels on a line. */
GHOST_TUns32 xPixels; uint32_t xPixels;
/** Number of lines. */ /** Number of lines. */
GHOST_TUns32 yPixels; uint32_t yPixels;
/** Number of bits per pixel. */ /** Number of bits per pixel. */
GHOST_TUns32 bpp; uint32_t bpp;
/** Refresh rate (in Hertz). */ /** Refresh rate (in Hertz). */
GHOST_TUns32 frequency; uint32_t frequency;
} GHOST_DisplaySetting; } GHOST_DisplaySetting;
#ifdef _WIN32 #ifdef _WIN32
@@ -613,10 +600,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, uint64_t 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, uint64_t time);
#endif #endif
#ifdef WITH_XR_OPENXR #ifdef WITH_XR_OPENXR
@@ -724,7 +711,7 @@ typedef enum GHOST_XrActionType {
typedef struct GHOST_XrActionInfo { typedef struct GHOST_XrActionInfo {
const char *name; const char *name;
GHOST_XrActionType type; GHOST_XrActionType type;
GHOST_TUns32 count_subaction_paths; uint32_t count_subaction_paths;
const char **subaction_paths; const char **subaction_paths;
/** States for each subaction path. */ /** States for each subaction path. */
void *states; void *states;
@@ -735,7 +722,7 @@ typedef struct GHOST_XrActionInfo {
typedef struct GHOST_XrActionSpaceInfo { typedef struct GHOST_XrActionSpaceInfo {
const char *action_name; const char *action_name;
GHOST_TUns32 count_subaction_paths; uint32_t count_subaction_paths;
const char **subaction_paths; const char **subaction_paths;
/** Poses for each subaction path. */ /** Poses for each subaction path. */
const GHOST_XrPose *poses; const GHOST_XrPose *poses;
@@ -743,14 +730,14 @@ typedef struct GHOST_XrActionSpaceInfo {
typedef struct GHOST_XrActionBindingInfo { typedef struct GHOST_XrActionBindingInfo {
const char *action_name; const char *action_name;
GHOST_TUns32 count_interaction_paths; uint32_t count_interaction_paths;
/** Interaction path: User (sub-action) path + component path. */ /** Interaction path: User (sub-action) path + component path. */
const char **interaction_paths; const char **interaction_paths;
} GHOST_XrActionBindingInfo; } GHOST_XrActionBindingInfo;
typedef struct GHOST_XrActionProfileInfo { typedef struct GHOST_XrActionProfileInfo {
const char *profile_path; const char *profile_path;
GHOST_TUns32 count_bindings; uint32_t count_bindings;
const GHOST_XrActionBindingInfo *bindings; const GHOST_XrActionBindingInfo *bindings;
} GHOST_XrActionProfileInfo; } GHOST_XrActionProfileInfo;

View File

@@ -57,7 +57,7 @@ struct GHOST_Buttons {
*/ */
void clear(); void clear();
GHOST_TUns8 m_ButtonLeft : 1; uint8_t m_ButtonLeft : 1;
GHOST_TUns8 m_ButtonMiddle : 1; uint8_t m_ButtonMiddle : 1;
GHOST_TUns8 m_ButtonRight : 1; uint8_t m_ButtonRight : 1;
}; };

View File

@@ -84,7 +84,7 @@ GHOST_TSuccess GHOST_DisposeEventConsumer(GHOST_EventConsumerHandle consumerhand
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TUns64 GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle) uint64_t GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle)
{ {
GHOST_ISystem *system = (GHOST_ISystem *)systemhandle; GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
@@ -92,8 +92,8 @@ GHOST_TUns64 GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle)
} }
GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle, GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle,
GHOST_TUns64 delay, uint64_t delay,
GHOST_TUns64 interval, uint64_t interval,
GHOST_TimerProcPtr timerproc, GHOST_TimerProcPtr timerproc,
GHOST_TUserDataPtr userdata) GHOST_TUserDataPtr userdata)
{ {
@@ -111,7 +111,7 @@ GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle,
return system->removeTimer(timertask); return system->removeTimer(timertask);
} }
GHOST_TUns8 GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle) uint8_t GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle)
{ {
GHOST_ISystem *system = (GHOST_ISystem *)systemhandle; GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
@@ -119,8 +119,8 @@ GHOST_TUns8 GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle)
} }
void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle, void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
GHOST_TUns32 *width, uint32_t *width,
GHOST_TUns32 *height) uint32_t *height)
{ {
GHOST_ISystem *system = (GHOST_ISystem *)systemhandle; GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
@@ -128,8 +128,8 @@ void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
} }
void GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle, void GHOST_GetAllDisplayDimensions(GHOST_SystemHandle systemhandle,
GHOST_TUns32 *width, uint32_t *width,
GHOST_TUns32 *height) uint32_t *height)
{ {
GHOST_ISystem *system = (GHOST_ISystem *)systemhandle; GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
@@ -156,10 +156,10 @@ GHOST_TSuccess GHOST_DisposeOpenGLContext(GHOST_SystemHandle systemhandle,
GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
GHOST_WindowHandle parent_windowhandle, GHOST_WindowHandle parent_windowhandle,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
bool is_dialog, bool is_dialog,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
@@ -317,13 +317,13 @@ GHOST_TSuccess GHOST_HasCursorShape(GHOST_WindowHandle windowhandle,
} }
GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle, GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle,
GHOST_TUns8 *bitmap, uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,
int hotY, int hotY,
GHOST_TUns8 canInvertColor) bool canInvertColor)
{ {
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
@@ -344,18 +344,14 @@ GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle, int vi
return window->setCursorVisibility(visible ? true : false); return window->setCursorVisibility(visible ? true : false);
} }
GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle, GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle, int32_t *x, int32_t *y)
GHOST_TInt32 *x,
GHOST_TInt32 *y)
{ {
GHOST_ISystem *system = (GHOST_ISystem *)systemhandle; GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
return system->getCursorPosition(*x, *y); return system->getCursorPosition(*x, *y);
} }
GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle, GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle, int32_t x, int32_t y)
GHOST_TInt32 x,
GHOST_TInt32 y)
{ {
GHOST_ISystem *system = (GHOST_ISystem *)systemhandle; GHOST_ISystem *system = (GHOST_ISystem *)systemhandle;
@@ -370,7 +366,7 @@ GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
{ {
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
GHOST_Rect bounds_rect; GHOST_Rect bounds_rect;
GHOST_TInt32 mouse_xy[2]; int32_t mouse_xy[2];
if (bounds) { if (bounds) {
bounds_rect = GHOST_Rect(bounds[0], bounds[1], bounds[2], bounds[3]); bounds_rect = GHOST_Rect(bounds[0], bounds[1], bounds[2], bounds[3]);
@@ -420,7 +416,7 @@ void GHOST_setNDOFDeadZone(float deadzone)
} }
#endif #endif
void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, GHOST_TInt8 canAccept) void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, bool canAccept)
{ {
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
@@ -434,7 +430,7 @@ GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
return event->getType(); return event->getType();
} }
GHOST_TUns64 GHOST_GetEventTime(GHOST_EventHandle eventhandle) uint64_t GHOST_GetEventTime(GHOST_EventHandle eventhandle)
{ {
GHOST_IEvent *event = (GHOST_IEvent *)eventhandle; GHOST_IEvent *event = (GHOST_IEvent *)eventhandle;
@@ -555,14 +551,14 @@ void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle)
delete (GHOST_Rect *)rectanglehandle; delete (GHOST_Rect *)rectanglehandle;
} }
GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle, GHOST_TUns32 width) GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle, uint32_t width)
{ {
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
return window->setClientWidth(width); return window->setClientWidth(width);
} }
GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle, GHOST_TUns32 height) GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle, uint32_t height)
{ {
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
@@ -570,30 +566,24 @@ GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle, GHOST_TUns
} }
GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle, GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height) uint32_t height)
{ {
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
return window->setClientSize(width, height); return window->setClientSize(width, height);
} }
void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle, void GHOST_ScreenToClient(
GHOST_TInt32 inX, GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
GHOST_TInt32 inY,
GHOST_TInt32 *outX,
GHOST_TInt32 *outY)
{ {
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
window->screenToClient(inX, inY, *outX, *outY); window->screenToClient(inX, inY, *outX, *outY);
} }
void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle, void GHOST_ClientToScreen(
GHOST_TInt32 inX, GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
GHOST_TInt32 inY,
GHOST_TInt32 *outX,
GHOST_TInt32 *outY)
{ {
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
@@ -614,8 +604,7 @@ GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle, GHOST_TWind
return window->setState(state); return window->setState(state);
} }
GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle, GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle, bool isUnsavedChanges)
GHOST_TUns8 isUnsavedChanges)
{ {
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
@@ -703,21 +692,18 @@ void GHOST_SetTabletAPI(GHOST_SystemHandle systemhandle, GHOST_TTabletAPI api)
system->setTabletAPI(api); system->setTabletAPI(api);
} }
GHOST_TInt32 GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle) int32_t GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle)
{ {
return ((GHOST_Rect *)rectanglehandle)->getWidth(); return ((GHOST_Rect *)rectanglehandle)->getWidth();
} }
GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle) int32_t GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle)
{ {
return ((GHOST_Rect *)rectanglehandle)->getHeight(); return ((GHOST_Rect *)rectanglehandle)->getHeight();
} }
void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle, void GHOST_GetRectangle(
GHOST_TInt32 *l, GHOST_RectangleHandle rectanglehandle, int32_t *l, int32_t *t, int32_t *r, int32_t *b)
GHOST_TInt32 *t,
GHOST_TInt32 *r,
GHOST_TInt32 *b)
{ {
GHOST_Rect *rect = (GHOST_Rect *)rectanglehandle; GHOST_Rect *rect = (GHOST_Rect *)rectanglehandle;
@@ -727,11 +713,8 @@ void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle,
*b = rect->m_b; *b = rect->m_b;
} }
void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle, void GHOST_SetRectangle(
GHOST_TInt32 l, GHOST_RectangleHandle rectanglehandle, int32_t l, int32_t t, int32_t r, int32_t b)
GHOST_TInt32 t,
GHOST_TInt32 r,
GHOST_TInt32 b)
{ {
((GHOST_Rect *)rectanglehandle)->set(l, t, r, b); ((GHOST_Rect *)rectanglehandle)->set(l, t, r, b);
} }
@@ -756,7 +739,7 @@ GHOST_TSuccess GHOST_IsValidRectangle(GHOST_RectangleHandle rectanglehandle)
return result; return result;
} }
void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle, GHOST_TInt32 i) void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle, int32_t i)
{ {
((GHOST_Rect *)rectanglehandle)->inset(i); ((GHOST_Rect *)rectanglehandle)->inset(i);
} }
@@ -767,16 +750,12 @@ void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle,
((GHOST_Rect *)rectanglehandle)->unionRect(*(GHOST_Rect *)anotherrectanglehandle); ((GHOST_Rect *)rectanglehandle)->unionRect(*(GHOST_Rect *)anotherrectanglehandle);
} }
void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle, void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle, int32_t x, int32_t y)
GHOST_TInt32 x,
GHOST_TInt32 y)
{ {
((GHOST_Rect *)rectanglehandle)->unionPoint(x, y); ((GHOST_Rect *)rectanglehandle)->unionPoint(x, y);
} }
GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehandle, GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehandle, int32_t x, int32_t y)
GHOST_TInt32 x,
GHOST_TInt32 y)
{ {
GHOST_TSuccess result = GHOST_kFailure; GHOST_TSuccess result = GHOST_kFailure;
@@ -796,18 +775,13 @@ GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rectangleha
return visible; return visible;
} }
void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle, void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle, int32_t cx, int32_t cy)
GHOST_TInt32 cx,
GHOST_TInt32 cy)
{ {
((GHOST_Rect *)rectanglehandle)->setCenter(cx, cy); ((GHOST_Rect *)rectanglehandle)->setCenter(cx, cy);
} }
void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle, void GHOST_SetRectangleCenter(
GHOST_TInt32 cx, GHOST_RectangleHandle rectanglehandle, int32_t cx, int32_t cy, int32_t w, int32_t h)
GHOST_TInt32 cy,
GHOST_TInt32 w,
GHOST_TInt32 h)
{ {
((GHOST_Rect *)rectanglehandle)->setCenter(cx, cy, w, h); ((GHOST_Rect *)rectanglehandle)->setCenter(cx, cy, w, h);
} }
@@ -823,13 +797,13 @@ GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
return result; return result;
} }
GHOST_TUns8 *GHOST_getClipboard(int selection) char *GHOST_getClipboard(bool selection)
{ {
GHOST_ISystem *system = GHOST_ISystem::getSystem(); GHOST_ISystem *system = GHOST_ISystem::getSystem();
return system->getClipboard(selection); return system->getClipboard(selection);
} }
void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection) void GHOST_putClipboard(char *buffer, bool selection)
{ {
GHOST_ISystem *system = GHOST_ISystem::getSystem(); GHOST_ISystem *system = GHOST_ISystem::getSystem();
system->putClipboard(buffer, selection); system->putClipboard(buffer, selection);
@@ -861,7 +835,7 @@ float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
return 1.0f; return 1.0f;
} }
GHOST_TUns16 GHOST_GetDPIHint(GHOST_WindowHandle windowhandle) uint16_t GHOST_GetDPIHint(GHOST_WindowHandle windowhandle)
{ {
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
return window->getDPIHint(); return window->getDPIHint();
@@ -869,12 +843,8 @@ GHOST_TUns16 GHOST_GetDPIHint(GHOST_WindowHandle windowhandle)
#ifdef WITH_INPUT_IME #ifdef WITH_INPUT_IME
void GHOST_BeginIME(GHOST_WindowHandle windowhandle, void GHOST_BeginIME(
GHOST_TInt32 x, GHOST_WindowHandle windowhandle, int32_t x, int32_t y, int32_t w, int32_t h, bool complete)
GHOST_TInt32 y,
GHOST_TInt32 w,
GHOST_TInt32 h,
int complete)
{ {
GHOST_IWindow *window = (GHOST_IWindow *)windowhandle; GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
window->beginIME(x, y, w, h, complete); window->beginIME(x, y, w, h, complete);
@@ -972,7 +942,7 @@ void GHOST_XrDestroyActionSet(GHOST_XrContextHandle xr_contexthandle, const char
int GHOST_XrCreateActions(GHOST_XrContextHandle xr_contexthandle, int GHOST_XrCreateActions(GHOST_XrContextHandle xr_contexthandle,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const GHOST_XrActionInfo *infos) const GHOST_XrActionInfo *infos)
{ {
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle; GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
@@ -983,7 +953,7 @@ int GHOST_XrCreateActions(GHOST_XrContextHandle xr_contexthandle,
void GHOST_XrDestroyActions(GHOST_XrContextHandle xr_contexthandle, void GHOST_XrDestroyActions(GHOST_XrContextHandle xr_contexthandle,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const char *const *action_names) const char *const *action_names)
{ {
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle; GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
@@ -993,7 +963,7 @@ void GHOST_XrDestroyActions(GHOST_XrContextHandle xr_contexthandle,
int GHOST_XrCreateActionSpaces(GHOST_XrContextHandle xr_contexthandle, int GHOST_XrCreateActionSpaces(GHOST_XrContextHandle xr_contexthandle,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const GHOST_XrActionSpaceInfo *infos) const GHOST_XrActionSpaceInfo *infos)
{ {
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle; GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
@@ -1005,7 +975,7 @@ int GHOST_XrCreateActionSpaces(GHOST_XrContextHandle xr_contexthandle,
void GHOST_XrDestroyActionSpaces(GHOST_XrContextHandle xr_contexthandle, void GHOST_XrDestroyActionSpaces(GHOST_XrContextHandle xr_contexthandle,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const GHOST_XrActionSpaceInfo *infos) const GHOST_XrActionSpaceInfo *infos)
{ {
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle; GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
@@ -1015,7 +985,7 @@ void GHOST_XrDestroyActionSpaces(GHOST_XrContextHandle xr_contexthandle,
int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_contexthandle, int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_contexthandle,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const GHOST_XrActionProfileInfo *infos) const GHOST_XrActionProfileInfo *infos)
{ {
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle; GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
@@ -1027,7 +997,7 @@ int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_contexthandle,
void GHOST_XrDestroyActionBindings(GHOST_XrContextHandle xr_contexthandle, void GHOST_XrDestroyActionBindings(GHOST_XrContextHandle xr_contexthandle,
const char *action_set_name, const char *action_set_name,
GHOST_TUns32 count, uint32_t count,
const GHOST_XrActionProfileInfo *infos) const GHOST_XrActionProfileInfo *infos)
{ {
GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle; GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
@@ -1054,7 +1024,7 @@ int GHOST_XrSyncActions(GHOST_XrContextHandle xr_contexthandle, const char *acti
int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_contexthandle, int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_contexthandle,
const char *action_set_name, const char *action_set_name,
const char *action_name, const char *action_name,
const GHOST_TInt64 *duration, const int64_t *duration,
const float *frequency, const float *frequency,
const float *amplitude) const float *amplitude)
{ {

View File

@@ -49,20 +49,20 @@ GHOST_TSuccess GHOST_DisplayManager::initialize(void)
return success; return success;
} }
GHOST_TSuccess GHOST_DisplayManager::getNumDisplays(GHOST_TUns8 & /*numDisplays*/) const GHOST_TSuccess GHOST_DisplayManager::getNumDisplays(uint8_t & /*numDisplays*/) const
{ {
// Don't know if we have a display... // Don't know if we have a display...
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TSuccess GHOST_DisplayManager::getNumDisplaySettings(GHOST_TUns8 display, GHOST_TSuccess GHOST_DisplayManager::getNumDisplaySettings(uint8_t display,
GHOST_TInt32 &numSettings) const int32_t &numSettings) const
{ {
GHOST_TSuccess success; GHOST_TSuccess success;
GHOST_ASSERT(m_settingsInitialized, GHOST_ASSERT(m_settingsInitialized,
"GHOST_DisplayManager::getNumDisplaySettings(): m_settingsInitialized=false"); "GHOST_DisplayManager::getNumDisplaySettings(): m_settingsInitialized=false");
GHOST_TUns8 numDisplays; uint8_t numDisplays;
success = getNumDisplays(numDisplays); success = getNumDisplays(numDisplays);
if (success == GHOST_kSuccess) { if (success == GHOST_kSuccess) {
if (display < numDisplays) { if (display < numDisplays) {
@@ -75,18 +75,18 @@ GHOST_TSuccess GHOST_DisplayManager::getNumDisplaySettings(GHOST_TUns8 display,
return success; return success;
} }
GHOST_TSuccess GHOST_DisplayManager::getDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess GHOST_DisplayManager::getDisplaySetting(uint8_t display,
GHOST_TInt32 index, int32_t index,
GHOST_DisplaySetting &setting) const GHOST_DisplaySetting &setting) const
{ {
GHOST_TSuccess success; GHOST_TSuccess success;
GHOST_ASSERT(m_settingsInitialized, GHOST_ASSERT(m_settingsInitialized,
"GHOST_DisplayManager::getNumDisplaySettings(): m_settingsInitialized=false"); "GHOST_DisplayManager::getNumDisplaySettings(): m_settingsInitialized=false");
GHOST_TUns8 numDisplays; uint8_t numDisplays;
success = getNumDisplays(numDisplays); success = getNumDisplays(numDisplays);
if (success == GHOST_kSuccess) { if (success == GHOST_kSuccess) {
if (display < numDisplays && ((GHOST_TUns8)index < m_settings[display].size())) { if (display < numDisplays && ((uint8_t)index < m_settings[display].size())) {
setting = m_settings[display][index]; setting = m_settings[display][index];
} }
else { else {
@@ -97,18 +97,18 @@ GHOST_TSuccess GHOST_DisplayManager::getDisplaySetting(GHOST_TUns8 display,
} }
GHOST_TSuccess GHOST_DisplayManager::getCurrentDisplaySetting( GHOST_TSuccess GHOST_DisplayManager::getCurrentDisplaySetting(
GHOST_TUns8 /*display*/, GHOST_DisplaySetting & /*setting*/) const uint8_t /*display*/, GHOST_DisplaySetting & /*setting*/) const
{ {
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TSuccess GHOST_DisplayManager::setCurrentDisplaySetting( GHOST_TSuccess GHOST_DisplayManager::setCurrentDisplaySetting(
GHOST_TUns8 /*display*/, const GHOST_DisplaySetting & /*setting*/) uint8_t /*display*/, const GHOST_DisplaySetting & /*setting*/)
{ {
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TSuccess GHOST_DisplayManager::findMatch(GHOST_TUns8 display, GHOST_TSuccess GHOST_DisplayManager::findMatch(uint8_t display,
const GHOST_DisplaySetting &setting, const GHOST_DisplaySetting &setting,
GHOST_DisplaySetting &match) const GHOST_DisplaySetting &match) const
{ {
@@ -157,17 +157,16 @@ GHOST_TSuccess GHOST_DisplayManager::findMatch(GHOST_TUns8 display,
GHOST_TSuccess GHOST_DisplayManager::initializeSettings(void) GHOST_TSuccess GHOST_DisplayManager::initializeSettings(void)
{ {
GHOST_TUns8 numDisplays; uint8_t numDisplays;
GHOST_TSuccess success = getNumDisplays(numDisplays); GHOST_TSuccess success = getNumDisplays(numDisplays);
if (success == GHOST_kSuccess) { if (success == GHOST_kSuccess) {
for (GHOST_TUns8 display = 0; (display < numDisplays) && (success == GHOST_kSuccess); for (uint8_t display = 0; (display < numDisplays) && (success == GHOST_kSuccess); display++) {
display++) {
GHOST_DisplaySettings displaySettings; GHOST_DisplaySettings displaySettings;
m_settings.push_back(displaySettings); m_settings.push_back(displaySettings);
GHOST_TInt32 numSettings; int32_t numSettings;
success = getNumDisplaySettings(display, numSettings); success = getNumDisplaySettings(display, numSettings);
if (success == GHOST_kSuccess) { if (success == GHOST_kSuccess) {
GHOST_TInt32 index; int32_t index;
GHOST_DisplaySetting setting; GHOST_DisplaySetting setting;
for (index = 0; (index < numSettings) && (success == GHOST_kSuccess); index++) { for (index = 0; (index < numSettings) && (success == GHOST_kSuccess); index++) {
success = getDisplaySetting(display, index, setting); success = getDisplaySetting(display, index, setting);

View File

@@ -55,7 +55,7 @@ class GHOST_DisplayManager {
* \param numDisplays: The number of displays on this system. * \param numDisplays: The number of displays on this system.
* \return Indication of success. * \return Indication of success.
*/ */
virtual GHOST_TSuccess getNumDisplays(GHOST_TUns8 &numDisplays) const; virtual GHOST_TSuccess getNumDisplays(uint8_t &numDisplays) const;
/** /**
* Returns the number of display settings for this display device. * Returns the number of display settings for this display device.
@@ -63,8 +63,7 @@ class GHOST_DisplayManager {
* \param numSettings: The number of settings of the display device with this index. * \param numSettings: The number of settings of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
virtual GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, virtual GHOST_TSuccess getNumDisplaySettings(uint8_t display, int32_t &numSettings) const;
GHOST_TInt32 &numSettings) const;
/** /**
* Returns the current setting for this display device. * Returns the current setting for this display device.
@@ -73,8 +72,8 @@ class GHOST_DisplayManager {
* \param setting: The setting of the display device with this index. * \param setting: The setting of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
virtual GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display, virtual GHOST_TSuccess getDisplaySetting(uint8_t display,
GHOST_TInt32 index, int32_t index,
GHOST_DisplaySetting &setting) const; GHOST_DisplaySetting &setting) const;
/** /**
@@ -83,7 +82,7 @@ class GHOST_DisplayManager {
* \param setting: The current setting of the display device with this index. * \param setting: The current setting of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
virtual GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display, virtual GHOST_TSuccess getCurrentDisplaySetting(uint8_t display,
GHOST_DisplaySetting &setting) const; GHOST_DisplaySetting &setting) const;
/** /**
@@ -94,7 +93,7 @@ class GHOST_DisplayManager {
* \param setting: The setting of the display device to be matched and activated. * \param setting: The setting of the display device to be matched and activated.
* \return Indication of success. * \return Indication of success.
*/ */
virtual GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display, virtual GHOST_TSuccess setCurrentDisplaySetting(uint8_t display,
const GHOST_DisplaySetting &setting); const GHOST_DisplaySetting &setting);
protected: protected:
@@ -107,7 +106,7 @@ class GHOST_DisplayManager {
* \param match: The optimal display setting. * \param match: The optimal display setting.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess findMatch(GHOST_TUns8 display, GHOST_TSuccess findMatch(uint8_t display,
const GHOST_DisplaySetting &setting, const GHOST_DisplaySetting &setting,
GHOST_DisplaySetting &match) const; GHOST_DisplaySetting &match) const;

View File

@@ -46,7 +46,7 @@ class GHOST_DisplayManagerCocoa : public GHOST_DisplayManager {
* \param numDisplays: The number of displays on this system. * \param numDisplays: The number of displays on this system.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getNumDisplays(GHOST_TUns8 &numDisplays) const; GHOST_TSuccess getNumDisplays(uint8_t &numDisplays) const;
/** /**
* Returns the number of display settings for this display device. * Returns the number of display settings for this display device.
@@ -54,7 +54,7 @@ class GHOST_DisplayManagerCocoa : public GHOST_DisplayManager {
* \param numSetting: The number of settings of the display device with this index. * \param numSetting: The number of settings of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32 &numSettings) const; GHOST_TSuccess getNumDisplaySettings(uint8_t display, int32_t &numSettings) const;
/** /**
* Returns the current setting for this display device. * Returns the current setting for this display device.
@@ -63,8 +63,8 @@ class GHOST_DisplayManagerCocoa : public GHOST_DisplayManager {
* \param setting: The setting of the display device with this index. * \param setting: The setting of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess getDisplaySetting(uint8_t display,
GHOST_TInt32 index, int32_t index,
GHOST_DisplaySetting &setting) const; GHOST_DisplaySetting &setting) const;
/** /**
@@ -73,8 +73,7 @@ class GHOST_DisplayManagerCocoa : public GHOST_DisplayManager {
* \param setting: The current setting of the display device with this index. * \param setting: The current setting of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess getCurrentDisplaySetting(uint8_t display, GHOST_DisplaySetting &setting) const;
GHOST_DisplaySetting &setting) const;
/** /**
* Changes the current setting for this display device. * Changes the current setting for this display device.
@@ -82,8 +81,7 @@ class GHOST_DisplayManagerCocoa : public GHOST_DisplayManager {
* \param setting: The current setting of the display device with this index. * \param setting: The current setting of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess setCurrentDisplaySetting(uint8_t display, const GHOST_DisplaySetting &setting);
const GHOST_DisplaySetting &setting);
protected: protected:
// Do not cache values as OS X supports screen hot plug // Do not cache values as OS X supports screen hot plug

View File

@@ -29,26 +29,26 @@ GHOST_DisplayManagerCocoa::GHOST_DisplayManagerCocoa(void)
{ {
} }
GHOST_TSuccess GHOST_DisplayManagerCocoa::getNumDisplays(GHOST_TUns8 &numDisplays) const GHOST_TSuccess GHOST_DisplayManagerCocoa::getNumDisplays(uint8_t &numDisplays) const
{ {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
numDisplays = (GHOST_TUns8)[[NSScreen screens] count]; numDisplays = (uint8_t)[[NSScreen screens] count];
[pool drain]; [pool drain];
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_DisplayManagerCocoa::getNumDisplaySettings(GHOST_TUns8 display, GHOST_TSuccess GHOST_DisplayManagerCocoa::getNumDisplaySettings(uint8_t display,
GHOST_TInt32 &numSettings) const int32_t &numSettings) const
{ {
numSettings = (GHOST_TInt32)3; // Width, Height, BitsPerPixel numSettings = (int32_t)3; // Width, Height, BitsPerPixel
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_DisplayManagerCocoa::getDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess GHOST_DisplayManagerCocoa::getDisplaySetting(uint8_t display,
GHOST_TInt32 index, int32_t index,
GHOST_DisplaySetting &setting) const GHOST_DisplaySetting &setting) const
{ {
NSScreen *askedDisplay; NSScreen *askedDisplay;
@@ -86,7 +86,7 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::getDisplaySetting(GHOST_TUns8 display,
} }
GHOST_TSuccess GHOST_DisplayManagerCocoa::getCurrentDisplaySetting( GHOST_TSuccess GHOST_DisplayManagerCocoa::getCurrentDisplaySetting(
GHOST_TUns8 display, GHOST_DisplaySetting &setting) const uint8_t display, GHOST_DisplaySetting &setting) const
{ {
NSScreen *askedDisplay; NSScreen *askedDisplay;
@@ -127,7 +127,7 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::getCurrentDisplaySetting(
} }
GHOST_TSuccess GHOST_DisplayManagerCocoa::setCurrentDisplaySetting( GHOST_TSuccess GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(
GHOST_TUns8 display, const GHOST_DisplaySetting &setting) uint8_t display, const GHOST_DisplaySetting &setting)
{ {
GHOST_ASSERT( GHOST_ASSERT(
(display == kMainDisplay), (display == kMainDisplay),

View File

@@ -31,25 +31,25 @@ class GHOST_DisplayManagerNULL : public GHOST_DisplayManager {
GHOST_DisplayManagerNULL(GHOST_SystemNULL *system) : GHOST_DisplayManager(), m_system(system) GHOST_DisplayManagerNULL(GHOST_SystemNULL *system) : GHOST_DisplayManager(), m_system(system)
{ /* nop */ { /* nop */
} }
GHOST_TSuccess getNumDisplays(GHOST_TUns8 &numDisplays) const GHOST_TSuccess getNumDisplays(uint8_t &numDisplays) const
{ {
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32 &numSettings) const GHOST_TSuccess getNumDisplaySettings(uint8_t display, int32_t &numSettings) const
{ {
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess getDisplaySetting(uint8_t display,
GHOST_TInt32 index, int32_t index,
GHOST_DisplaySetting &setting) const GHOST_DisplaySetting &setting) const
{ {
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display, GHOST_DisplaySetting &setting) const GHOST_TSuccess getCurrentDisplaySetting(uint8_t display, GHOST_DisplaySetting &setting) const
{ {
return getDisplaySetting(display, GHOST_TInt32(0), setting); return getDisplaySetting(display, int32_t(0), setting);
} }
GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display, const GHOST_DisplaySetting &setting) GHOST_TSuccess setCurrentDisplaySetting(uint8_t display, const GHOST_DisplaySetting &setting)
{ {
return GHOST_kSuccess; return GHOST_kSuccess;
} }

View File

@@ -33,14 +33,14 @@ GHOST_DisplayManagerSDL::GHOST_DisplayManagerSDL(GHOST_SystemSDL *system)
memset(&m_mode, 0, sizeof(m_mode)); memset(&m_mode, 0, sizeof(m_mode));
} }
GHOST_TSuccess GHOST_DisplayManagerSDL::getNumDisplays(GHOST_TUns8 &numDisplays) const GHOST_TSuccess GHOST_DisplayManagerSDL::getNumDisplays(uint8_t &numDisplays) const
{ {
numDisplays = SDL_GetNumVideoDisplays(); numDisplays = SDL_GetNumVideoDisplays();
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_DisplayManagerSDL::getNumDisplaySettings(GHOST_TUns8 display, GHOST_TSuccess GHOST_DisplayManagerSDL::getNumDisplaySettings(uint8_t display,
GHOST_TInt32 &numSettings) const int32_t &numSettings) const
{ {
GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n"); GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n");
@@ -66,8 +66,8 @@ static void ghost_mode_to_sdl(const GHOST_DisplaySetting &setting, SDL_DisplayMo
mode->refresh_rate = setting.frequency; mode->refresh_rate = setting.frequency;
} }
GHOST_TSuccess GHOST_DisplayManagerSDL::getDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess GHOST_DisplayManagerSDL::getDisplaySetting(uint8_t display,
GHOST_TInt32 index, int32_t index,
GHOST_DisplaySetting &setting) const GHOST_DisplaySetting &setting) const
{ {
GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n"); GHOST_ASSERT(display < 1, "Only single display systems are currently supported.\n");
@@ -81,7 +81,7 @@ GHOST_TSuccess GHOST_DisplayManagerSDL::getDisplaySetting(GHOST_TUns8 display,
} }
GHOST_TSuccess GHOST_DisplayManagerSDL::getCurrentDisplaySetting( GHOST_TSuccess GHOST_DisplayManagerSDL::getCurrentDisplaySetting(
GHOST_TUns8 display, GHOST_DisplaySetting &setting) const uint8_t display, GHOST_DisplaySetting &setting) const
{ {
SDL_DisplayMode mode; SDL_DisplayMode mode;
SDL_GetCurrentDisplayMode(display, &mode); SDL_GetCurrentDisplayMode(display, &mode);
@@ -98,7 +98,7 @@ GHOST_TSuccess GHOST_DisplayManagerSDL::getCurrentDisplayModeSDL(SDL_DisplayMode
} }
GHOST_TSuccess GHOST_DisplayManagerSDL::setCurrentDisplaySetting( GHOST_TSuccess GHOST_DisplayManagerSDL::setCurrentDisplaySetting(
GHOST_TUns8 display, const GHOST_DisplaySetting &setting) uint8_t display, const GHOST_DisplaySetting &setting)
{ {
/* /*
* Mode switching code ported from Quake 2 version 3.21 and bzflag version * Mode switching code ported from Quake 2 version 3.21 and bzflag version

View File

@@ -37,21 +37,19 @@ class GHOST_DisplayManagerSDL : public GHOST_DisplayManager {
public: public:
GHOST_DisplayManagerSDL(GHOST_SystemSDL *system); GHOST_DisplayManagerSDL(GHOST_SystemSDL *system);
GHOST_TSuccess getNumDisplays(GHOST_TUns8 &numDisplays) const; GHOST_TSuccess getNumDisplays(uint8_t &numDisplays) const;
GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32 &numSettings) const; GHOST_TSuccess getNumDisplaySettings(uint8_t display, int32_t &numSettings) const;
GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess getDisplaySetting(uint8_t display,
GHOST_TInt32 index, int32_t index,
GHOST_DisplaySetting &setting) const; GHOST_DisplaySetting &setting) const;
GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess getCurrentDisplaySetting(uint8_t display, GHOST_DisplaySetting &setting) const;
GHOST_DisplaySetting &setting) const;
GHOST_TSuccess getCurrentDisplayModeSDL(SDL_DisplayMode &mode) const; GHOST_TSuccess getCurrentDisplayModeSDL(SDL_DisplayMode &mode) const;
GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess setCurrentDisplaySetting(uint8_t display, const GHOST_DisplaySetting &setting);
const GHOST_DisplaySetting &setting);
private: private:
GHOST_SystemSDL *m_system; GHOST_SystemSDL *m_system;

View File

@@ -35,7 +35,7 @@ GHOST_DisplayManagerWin32::GHOST_DisplayManagerWin32(void)
{ {
} }
GHOST_TSuccess GHOST_DisplayManagerWin32::getNumDisplays(GHOST_TUns8 &numDisplays) const GHOST_TSuccess GHOST_DisplayManagerWin32::getNumDisplays(uint8_t &numDisplays) const
{ {
numDisplays = ::GetSystemMetrics(SM_CMONITORS); numDisplays = ::GetSystemMetrics(SM_CMONITORS);
return numDisplays > 0 ? GHOST_kSuccess : GHOST_kFailure; return numDisplays > 0 ? GHOST_kSuccess : GHOST_kFailure;
@@ -54,8 +54,8 @@ static BOOL get_dd(DWORD d, DISPLAY_DEVICE *dd)
* the information that was cached the last time the function was called with iModeNum * the information that was cached the last time the function was called with iModeNum
* set to zero. * set to zero.
*/ */
GHOST_TSuccess GHOST_DisplayManagerWin32::getNumDisplaySettings(GHOST_TUns8 display, GHOST_TSuccess GHOST_DisplayManagerWin32::getNumDisplaySettings(uint8_t display,
GHOST_TInt32 &numSettings) const int32_t &numSettings) const
{ {
DISPLAY_DEVICE display_device; DISPLAY_DEVICE display_device;
if (!get_dd(display, &display_device)) if (!get_dd(display, &display_device))
@@ -69,8 +69,8 @@ GHOST_TSuccess GHOST_DisplayManagerWin32::getNumDisplaySettings(GHOST_TUns8 disp
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_DisplayManagerWin32::getDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess GHOST_DisplayManagerWin32::getDisplaySetting(uint8_t display,
GHOST_TInt32 index, int32_t index,
GHOST_DisplaySetting &setting) const GHOST_DisplaySetting &setting) const
{ {
DISPLAY_DEVICE display_device; DISPLAY_DEVICE display_device;
@@ -111,13 +111,13 @@ GHOST_TSuccess GHOST_DisplayManagerWin32::getDisplaySetting(GHOST_TUns8 display,
} }
GHOST_TSuccess GHOST_DisplayManagerWin32::getCurrentDisplaySetting( GHOST_TSuccess GHOST_DisplayManagerWin32::getCurrentDisplaySetting(
GHOST_TUns8 display, GHOST_DisplaySetting &setting) const uint8_t display, GHOST_DisplaySetting &setting) const
{ {
return getDisplaySetting(display, ENUM_CURRENT_SETTINGS, setting); return getDisplaySetting(display, ENUM_CURRENT_SETTINGS, setting);
} }
GHOST_TSuccess GHOST_DisplayManagerWin32::setCurrentDisplaySetting( GHOST_TSuccess GHOST_DisplayManagerWin32::setCurrentDisplaySetting(
GHOST_TUns8 display, const GHOST_DisplaySetting &setting) uint8_t display, const GHOST_DisplaySetting &setting)
{ {
DISPLAY_DEVICE display_device; DISPLAY_DEVICE display_device;
if (!get_dd(display, &display_device)) if (!get_dd(display, &display_device))

View File

@@ -45,7 +45,7 @@ class GHOST_DisplayManagerWin32 : public GHOST_DisplayManager {
* \param numDisplays: The number of displays on this system. * \param numDisplays: The number of displays on this system.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getNumDisplays(GHOST_TUns8 &numDisplays) const; GHOST_TSuccess getNumDisplays(uint8_t &numDisplays) const;
/** /**
* Returns the number of display settings for this display device. * Returns the number of display settings for this display device.
@@ -53,7 +53,7 @@ class GHOST_DisplayManagerWin32 : public GHOST_DisplayManager {
* \param numSetting: The number of settings of the display device with this index. * \param numSetting: The number of settings of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32 &numSettings) const; GHOST_TSuccess getNumDisplaySettings(uint8_t display, int32_t &numSettings) const;
/** /**
* Returns the current setting for this display device. * Returns the current setting for this display device.
@@ -62,8 +62,8 @@ class GHOST_DisplayManagerWin32 : public GHOST_DisplayManager {
* \param setting: The setting of the display device with this index. * \param setting: The setting of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess getDisplaySetting(uint8_t display,
GHOST_TInt32 index, int32_t index,
GHOST_DisplaySetting &setting) const; GHOST_DisplaySetting &setting) const;
/** /**
@@ -72,8 +72,7 @@ class GHOST_DisplayManagerWin32 : public GHOST_DisplayManager {
* \param setting: The current setting of the display device with this index. * \param setting: The current setting of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess getCurrentDisplaySetting(uint8_t display, GHOST_DisplaySetting &setting) const;
GHOST_DisplaySetting &setting) const;
/** /**
* Changes the current setting for this display device. * Changes the current setting for this display device.
@@ -81,8 +80,7 @@ class GHOST_DisplayManagerWin32 : public GHOST_DisplayManager {
* \param setting: The current setting of the display device with this index. * \param setting: The current setting of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess setCurrentDisplaySetting(uint8_t display, const GHOST_DisplaySetting &setting);
const GHOST_DisplaySetting &setting);
protected: protected:
}; };

View File

@@ -40,14 +40,14 @@ GHOST_DisplayManagerX11::GHOST_DisplayManagerX11(GHOST_SystemX11 *system)
/* nothing to do. */ /* nothing to do. */
} }
GHOST_TSuccess GHOST_DisplayManagerX11::getNumDisplays(GHOST_TUns8 &numDisplays) const GHOST_TSuccess GHOST_DisplayManagerX11::getNumDisplays(uint8_t &numDisplays) const
{ {
numDisplays = m_system->getNumDisplays(); numDisplays = m_system->getNumDisplays();
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_DisplayManagerX11::getNumDisplaySettings(GHOST_TUns8 display, GHOST_TSuccess GHOST_DisplayManagerX11::getNumDisplaySettings(uint8_t display,
GHOST_TInt32 &numSettings) const int32_t &numSettings) const
{ {
#ifdef WITH_X11_XF86VMODE #ifdef WITH_X11_XF86VMODE
int majorVersion, minorVersion; int majorVersion, minorVersion;
@@ -88,8 +88,8 @@ static int calculate_rate(XF86VidModeModeInfo *info)
} }
#endif #endif
GHOST_TSuccess GHOST_DisplayManagerX11::getDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess GHOST_DisplayManagerX11::getDisplaySetting(uint8_t display,
GHOST_TInt32 index, int32_t index,
GHOST_DisplaySetting &setting) const GHOST_DisplaySetting &setting) const
{ {
Display *dpy = m_system->getXDisplay(); Display *dpy = m_system->getXDisplay();
@@ -140,7 +140,7 @@ GHOST_TSuccess GHOST_DisplayManagerX11::getDisplaySetting(GHOST_TUns8 display,
} }
GHOST_TSuccess GHOST_DisplayManagerX11::getCurrentDisplaySetting( GHOST_TSuccess GHOST_DisplayManagerX11::getCurrentDisplaySetting(
GHOST_TUns8 display, GHOST_DisplaySetting &setting) const uint8_t display, GHOST_DisplaySetting &setting) const
{ {
/* According to the xf86vidmodegetallmodelines man page, /* According to the xf86vidmodegetallmodelines man page,
* "The first element of the array corresponds to the current video mode." * "The first element of the array corresponds to the current video mode."
@@ -149,7 +149,7 @@ GHOST_TSuccess GHOST_DisplayManagerX11::getCurrentDisplaySetting(
} }
GHOST_TSuccess GHOST_DisplayManagerX11::setCurrentDisplaySetting( GHOST_TSuccess GHOST_DisplayManagerX11::setCurrentDisplaySetting(
GHOST_TUns8 /*display*/, const GHOST_DisplaySetting &setting) uint8_t /*display*/, const GHOST_DisplaySetting &setting)
{ {
#ifdef WITH_X11_XF86VMODE #ifdef WITH_X11_XF86VMODE
/* Mode switching code ported from SDL: /* Mode switching code ported from SDL:

View File

@@ -43,7 +43,7 @@ class GHOST_DisplayManagerX11 : public GHOST_DisplayManager {
* \param numDisplays: The number of displays on this system. * \param numDisplays: The number of displays on this system.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getNumDisplays(GHOST_TUns8 &numDisplays) const; GHOST_TSuccess getNumDisplays(uint8_t &numDisplays) const;
/** /**
* Returns the number of display settings for this display device. * Returns the number of display settings for this display device.
@@ -51,7 +51,7 @@ class GHOST_DisplayManagerX11 : public GHOST_DisplayManager {
* \param numSetting: The number of settings of the display device with this index. * \param numSetting: The number of settings of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32 &numSettings) const; GHOST_TSuccess getNumDisplaySettings(uint8_t display, int32_t &numSettings) const;
/** /**
* Returns the current setting for this display device. * Returns the current setting for this display device.
@@ -60,8 +60,8 @@ class GHOST_DisplayManagerX11 : public GHOST_DisplayManager {
* \param setting: The setting of the display device with this index. * \param setting: The setting of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess getDisplaySetting(uint8_t display,
GHOST_TInt32 index, int32_t index,
GHOST_DisplaySetting &setting) const; GHOST_DisplaySetting &setting) const;
/** /**
@@ -70,8 +70,7 @@ class GHOST_DisplayManagerX11 : public GHOST_DisplayManager {
* \param setting: The current setting of the display device with this index. * \param setting: The current setting of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess getCurrentDisplaySetting(uint8_t display, GHOST_DisplaySetting &setting) const;
GHOST_DisplaySetting &setting) const;
/** /**
* Changes the current setting for this display device. * Changes the current setting for this display device.
@@ -79,8 +78,7 @@ class GHOST_DisplayManagerX11 : public GHOST_DisplayManager {
* \param setting: The current setting of the display device with this index. * \param setting: The current setting of the display device with this index.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display, GHOST_TSuccess setCurrentDisplaySetting(uint8_t display, const GHOST_DisplaySetting &setting);
const GHOST_DisplaySetting &setting);
private: private:
GHOST_SystemX11 *m_system; GHOST_SystemX11 *m_system;

View File

@@ -242,7 +242,7 @@ void *GHOST_DropTargetWin32::getDropDataAsFilenames(IDataObject *pDataObject)
strArray = (GHOST_TStringArray *)::malloc(sizeof(GHOST_TStringArray)); strArray = (GHOST_TStringArray *)::malloc(sizeof(GHOST_TStringArray));
strArray->count = 0; strArray->count = 0;
strArray->strings = (GHOST_TUns8 **)::malloc(totfiles * sizeof(GHOST_TUns8 *)); strArray->strings = (uint8_t **)::malloc(totfiles * sizeof(uint8_t *));
for (UINT nfile = 0; nfile < totfiles; nfile++) { for (UINT nfile = 0; nfile < totfiles; nfile++) {
if (::DragQueryFileW(hdrop, nfile, fpath, MAX_PATH) > 0) { if (::DragQueryFileW(hdrop, nfile, fpath, MAX_PATH) > 0) {
@@ -251,7 +251,7 @@ void *GHOST_DropTargetWin32::getDropDataAsFilenames(IDataObject *pDataObject)
} }
// Just ignore paths that could not be converted verbatim. // Just ignore paths that could not be converted verbatim.
strArray->strings[nvalid] = (GHOST_TUns8 *)temp_path; strArray->strings[nvalid] = (uint8_t *)temp_path;
strArray->count = nvalid + 1; strArray->count = nvalid + 1;
nvalid++; nvalid++;
} }

View File

@@ -216,7 +216,7 @@ void *GHOST_DropTargetX11::getURIListGhostData(unsigned char *dropBuffer, int dr
strArray = (GHOST_TStringArray *)malloc(sizeof(GHOST_TStringArray)); strArray = (GHOST_TStringArray *)malloc(sizeof(GHOST_TStringArray));
strArray->count = 0; strArray->count = 0;
strArray->strings = (GHOST_TUns8 **)malloc(totPaths * sizeof(GHOST_TUns8 *)); strArray->strings = (uint8_t **)malloc(totPaths * sizeof(uint8_t *));
curLength = 0; curLength = 0;
for (int i = 0; i <= dropBufferSize; i++) { for (int i = 0; i <= dropBufferSize; i++) {
@@ -230,7 +230,7 @@ void *GHOST_DropTargetX11::getURIListGhostData(unsigned char *dropBuffer, int dr
decodedPath = FileUrlDecode(curPath); decodedPath = FileUrlDecode(curPath);
if (decodedPath) { if (decodedPath) {
strArray->strings[strArray->count] = (GHOST_TUns8 *)decodedPath; strArray->strings[strArray->count] = (uint8_t *)decodedPath;
strArray->count++; strArray->count++;
} }

View File

@@ -37,7 +37,7 @@ class GHOST_Event : public GHOST_IEvent {
* \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(uint64_t msec, GHOST_TEventType type, GHOST_IWindow *window)
: m_type(type), m_time(msec), m_window(window), m_data(NULL) : m_type(type), m_time(msec), m_window(window), m_data(NULL)
{ {
} }
@@ -55,7 +55,7 @@ class GHOST_Event : public GHOST_IEvent {
* Returns the time this event was generated. * Returns the time this event was generated.
* \return The event generation time. * \return The event generation time.
*/ */
GHOST_TUns64 getTime() uint64_t getTime()
{ {
return m_time; return m_time;
} }
@@ -83,7 +83,7 @@ class GHOST_Event : public GHOST_IEvent {
/** Type of this event. */ /** Type of this event. */
GHOST_TEventType m_type; GHOST_TEventType m_type;
/** The time this event was generated. */ /** The time this event was generated. */
GHOST_TUns64 m_time; uint64_t 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. */

View File

@@ -40,7 +40,7 @@ class GHOST_EventButton : public GHOST_Event {
* \param button: The state of the buttons were at the time of the event. * \param button: The state of the buttons were at the time of the event.
* \param tablet: The tablet data associated with this event. * \param tablet: The tablet data associated with this event.
*/ */
GHOST_EventButton(GHOST_TUns64 time, GHOST_EventButton(uint64_t time,
GHOST_TEventType type, GHOST_TEventType type,
GHOST_IWindow *window, GHOST_IWindow *window,
GHOST_TButtonMask button, GHOST_TButtonMask button,

View File

@@ -39,11 +39,11 @@ class GHOST_EventCursor : public GHOST_Event {
* \param y: The y-coordinate of the location the cursor was at the time of the event. * \param y: The y-coordinate of the location the cursor was at the time of the event.
* \param tablet: The tablet data associated with this event. * \param tablet: The tablet data associated with this event.
*/ */
GHOST_EventCursor(GHOST_TUns64 msec, GHOST_EventCursor(uint64_t msec,
GHOST_TEventType type, GHOST_TEventType type,
GHOST_IWindow *window, GHOST_IWindow *window,
GHOST_TInt32 x, int32_t x,
GHOST_TInt32 y, int32_t y,
const GHOST_TabletData &tablet) const GHOST_TabletData &tablet)
: GHOST_Event(msec, type, window), m_cursorEventData({x, y, tablet}) : GHOST_Event(msec, type, window), m_cursorEventData({x, y, tablet})
{ {

View File

@@ -72,7 +72,7 @@ class GHOST_EventDragnDrop : public GHOST_Event {
* \param y: The y-coordinate of the location the cursor was at the time of the event. * \param y: The y-coordinate of the location the cursor was at the time of the event.
* \param data: The "content" dropped in the window. * \param data: The "content" dropped in the window.
*/ */
GHOST_EventDragnDrop(GHOST_TUns64 time, GHOST_EventDragnDrop(uint64_t time,
GHOST_TEventType type, GHOST_TEventType type,
GHOST_TDragnDropTypes dataType, GHOST_TDragnDropTypes dataType,
GHOST_IWindow *window, GHOST_IWindow *window,

View File

@@ -39,11 +39,8 @@ class GHOST_EventKey : public GHOST_Event {
* \param type: The type of key event. * \param type: The type of key event.
* \param key: The key code of the key. * \param key: The key code of the key.
*/ */
GHOST_EventKey(GHOST_TUns64 msec, GHOST_EventKey(
GHOST_TEventType type, uint64_t msec, GHOST_TEventType type, GHOST_IWindow *window, GHOST_TKey key, bool is_repeat)
GHOST_IWindow *window,
GHOST_TKey key,
bool is_repeat)
: GHOST_Event(msec, type, window) : GHOST_Event(msec, type, window)
{ {
m_keyEventData.key = key; m_keyEventData.key = key;
@@ -60,7 +57,7 @@ class GHOST_EventKey : public GHOST_Event {
* \param key: The key code of the key. * \param key: The key code of the key.
* \param ascii: The ascii code for the key event. * \param ascii: The ascii code for the key event.
*/ */
GHOST_EventKey(GHOST_TUns64 msec, GHOST_EventKey(uint64_t msec,
GHOST_TEventType type, GHOST_TEventType type,
GHOST_IWindow *window, GHOST_IWindow *window,
GHOST_TKey key, GHOST_TKey key,

View File

@@ -46,14 +46,14 @@ GHOST_EventManager::~GHOST_EventManager()
} }
} }
GHOST_TUns32 GHOST_EventManager::getNumEvents() uint32_t GHOST_EventManager::getNumEvents()
{ {
return (GHOST_TUns32)m_events.size(); return (uint32_t)m_events.size();
} }
GHOST_TUns32 GHOST_EventManager::getNumEvents(GHOST_TEventType type) uint32_t GHOST_EventManager::getNumEvents(GHOST_TEventType type)
{ {
GHOST_TUns32 numEvents = 0; uint32_t numEvents = 0;
TEventStack::iterator p; TEventStack::iterator p;
for (p = m_events.begin(); p != m_events.end(); ++p) { for (p = m_events.begin(); p != m_events.end(); ++p) {
if ((*p)->getType() == type) { if ((*p)->getType() == type) {

View File

@@ -53,14 +53,14 @@ class GHOST_EventManager {
* 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.
*/ */
GHOST_TUns32 getNumEvents(); uint32_t 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.
*/ */
GHOST_TUns32 getNumEvents(GHOST_TEventType type); uint32_t getNumEvents(GHOST_TEventType type);
/** /**
* Pushes an event on the stack. * Pushes an event on the stack.

View File

@@ -31,7 +31,7 @@ class GHOST_EventNDOFMotion : public GHOST_Event {
GHOST_TEventNDOFMotionData m_axisData; GHOST_TEventNDOFMotionData m_axisData;
public: public:
GHOST_EventNDOFMotion(GHOST_TUns64 time, GHOST_IWindow *window) GHOST_EventNDOFMotion(uint64_t time, GHOST_IWindow *window)
: GHOST_Event(time, GHOST_kEventNDOFMotion, window) : GHOST_Event(time, GHOST_kEventNDOFMotion, window)
{ {
m_data = &m_axisData; m_data = &m_axisData;
@@ -43,7 +43,7 @@ class GHOST_EventNDOFButton : public GHOST_Event {
GHOST_TEventNDOFButtonData m_buttonData; GHOST_TEventNDOFButtonData m_buttonData;
public: public:
GHOST_EventNDOFButton(GHOST_TUns64 time, GHOST_IWindow *window) GHOST_EventNDOFButton(uint64_t time, GHOST_IWindow *window)
: GHOST_Event(time, GHOST_kEventNDOFButton, window) : GHOST_Event(time, GHOST_kEventNDOFButton, window)
{ {
m_data = &m_buttonData; m_data = &m_buttonData;

View File

@@ -39,7 +39,7 @@ bool GHOST_EventPrinter::processEvent(GHOST_IEvent *event)
if (event->getType() == GHOST_kEventWindowUpdate) if (event->getType() == GHOST_kEventWindowUpdate)
return false; return false;
std::cout << "GHOST_EventPrinter::processEvent, time: " << (GHOST_TInt32)event->getTime() std::cout << "GHOST_EventPrinter::processEvent, time: " << (int32_t)event->getTime()
<< ", type: "; << ", type: ";
switch (event->getType()) { switch (event->getType()) {
case GHOST_kEventUnknown: case GHOST_kEventUnknown:

View File

@@ -38,7 +38,7 @@ class GHOST_EventString : public GHOST_Event {
* \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 (un-formatted) data associated with the event. * \param data_ptr: Pointer to the (un-formatted) data associated with the event.
*/ */
GHOST_EventString(GHOST_TUns64 msec, GHOST_EventString(uint64_t msec,
GHOST_TEventType type, GHOST_TEventType type,
GHOST_IWindow *window, GHOST_IWindow *window,
GHOST_TEventDataPtr data_ptr) GHOST_TEventDataPtr data_ptr)

View File

@@ -39,13 +39,13 @@ class GHOST_EventTrackpad : public GHOST_Event {
* \param x: The x-delta of the pan event. * \param x: The x-delta of the pan event.
* \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(uint64_t msec,
GHOST_IWindow *window, GHOST_IWindow *window,
GHOST_TTrackpadEventSubTypes subtype, GHOST_TTrackpadEventSubTypes subtype,
GHOST_TInt32 x, int32_t x,
GHOST_TInt32 y, int32_t y,
GHOST_TInt32 deltaX, int32_t deltaX,
GHOST_TInt32 deltaY, int32_t deltaY,
bool isDirectionInverted) bool isDirectionInverted)
: GHOST_Event(msec, GHOST_kEventTrackpad, window) : GHOST_Event(msec, GHOST_kEventTrackpad, window)
{ {

View File

@@ -39,7 +39,7 @@ class GHOST_EventWheel : public GHOST_Event {
* \param window: The window of this event. * \param window: The window 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(uint64_t msec, GHOST_IWindow *window, int32_t z)
: GHOST_Event(msec, GHOST_kEventWheel, window) : GHOST_Event(msec, GHOST_kEventWheel, window)
{ {
m_wheelEventData.z = z; m_wheelEventData.z = z;

View File

@@ -44,7 +44,7 @@ class GHOST_EventIME : public GHOST_Event {
* \param type: The type of key event. * \param type: The type of key event.
* \param key: The key code of the key. * \param key: The key code of the key.
*/ */
GHOST_EventIME(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow *window, void *customdata) GHOST_EventIME(uint64_t msec, GHOST_TEventType type, GHOST_IWindow *window, void *customdata)
: GHOST_Event(msec, type, window) : GHOST_Event(msec, type, window)
{ {
this->m_data = customdata; this->m_data = customdata;

View File

@@ -72,17 +72,17 @@ struct GHOST_ModifierKeys {
bool equals(const GHOST_ModifierKeys &keys) const; bool equals(const GHOST_ModifierKeys &keys) const;
/** Bitfield that stores the appropriate key state. */ /** Bitfield that stores the appropriate key state. */
GHOST_TUns8 m_LeftShift : 1; uint8_t m_LeftShift : 1;
/** Bitfield that stores the appropriate key state. */ /** Bitfield that stores the appropriate key state. */
GHOST_TUns8 m_RightShift : 1; uint8_t m_RightShift : 1;
/** Bitfield that stores the appropriate key state. */ /** Bitfield that stores the appropriate key state. */
GHOST_TUns8 m_LeftAlt : 1; uint8_t m_LeftAlt : 1;
/** Bitfield that stores the appropriate key state. */ /** Bitfield that stores the appropriate key state. */
GHOST_TUns8 m_RightAlt : 1; uint8_t m_RightAlt : 1;
/** Bitfield that stores the appropriate key state. */ /** Bitfield that stores the appropriate key state. */
GHOST_TUns8 m_LeftControl : 1; uint8_t m_LeftControl : 1;
/** Bitfield that stores the appropriate key state. */ /** Bitfield that stores the appropriate key state. */
GHOST_TUns8 m_RightControl : 1; uint8_t m_RightControl : 1;
/** Bitfield that stores the appropriate key state. */ /** Bitfield that stores the appropriate key state. */
GHOST_TUns8 m_OS : 1; uint8_t m_OS : 1;
}; };

View File

@@ -279,14 +279,14 @@ bool GHOST_NDOFManager::setDevice(unsigned short vendor_id, unsigned short produ
return m_deviceType != NDOF_UnknownDevice; return m_deviceType != NDOF_UnknownDevice;
} }
void GHOST_NDOFManager::updateTranslation(const int t[3], GHOST_TUns64 time) void GHOST_NDOFManager::updateTranslation(const int t[3], uint64_t time)
{ {
memcpy(m_translation, t, sizeof(m_translation)); memcpy(m_translation, t, sizeof(m_translation));
m_motionTime = time; m_motionTime = time;
m_motionEventPending = true; m_motionEventPending = true;
} }
void GHOST_NDOFManager::updateRotation(const int r[3], GHOST_TUns64 time) void GHOST_NDOFManager::updateRotation(const int r[3], uint64_t time)
{ {
memcpy(m_rotation, r, sizeof(m_rotation)); memcpy(m_rotation, r, sizeof(m_rotation));
m_motionTime = time; m_motionTime = time;
@@ -295,7 +295,7 @@ void GHOST_NDOFManager::updateRotation(const int r[3], GHOST_TUns64 time)
void GHOST_NDOFManager::sendButtonEvent(NDOF_ButtonT button, void GHOST_NDOFManager::sendButtonEvent(NDOF_ButtonT button,
bool press, bool press,
GHOST_TUns64 time, uint64_t time,
GHOST_IWindow *window) GHOST_IWindow *window)
{ {
GHOST_ASSERT(button > NDOF_BUTTON_NONE && button < NDOF_BUTTON_LAST, GHOST_ASSERT(button > NDOF_BUTTON_NONE && button < NDOF_BUTTON_LAST,
@@ -316,7 +316,7 @@ void GHOST_NDOFManager::sendButtonEvent(NDOF_ButtonT button,
void GHOST_NDOFManager::sendKeyEvent(GHOST_TKey key, void GHOST_NDOFManager::sendKeyEvent(GHOST_TKey key,
bool press, bool press,
GHOST_TUns64 time, uint64_t time,
GHOST_IWindow *window) GHOST_IWindow *window)
{ {
GHOST_TEventType type = press ? GHOST_kEventKeyDown : GHOST_kEventKeyUp; GHOST_TEventType type = press ? GHOST_kEventKeyDown : GHOST_kEventKeyUp;
@@ -329,7 +329,7 @@ void GHOST_NDOFManager::sendKeyEvent(GHOST_TKey key,
m_system.pushEvent(event); m_system.pushEvent(event);
} }
void GHOST_NDOFManager::updateButton(int button_number, bool press, GHOST_TUns64 time) void GHOST_NDOFManager::updateButton(int button_number, bool press, uint64_t time)
{ {
GHOST_IWindow *window = m_system.getWindowManager()->getActiveWindow(); GHOST_IWindow *window = m_system.getWindowManager()->getActiveWindow();
@@ -371,7 +371,7 @@ void GHOST_NDOFManager::updateButton(int button_number, bool press, GHOST_TUns64
} }
} }
void GHOST_NDOFManager::updateButtons(int button_bits, GHOST_TUns64 time) void GHOST_NDOFManager::updateButtons(int button_bits, uint64_t time)
{ {
button_bits &= m_buttonMask; // discard any "garbage" bits button_bits &= m_buttonMask; // discard any "garbage" bits

View File

@@ -130,13 +130,13 @@ class GHOST_NDOFManager {
// rotations are + when CCW, - when CW // rotations are + when CCW, - when CW
// each platform is responsible for getting axis data into this form // each platform is responsible for getting axis data into this form
// these values should not be scaled (just shuffled or flipped) // these values should not be scaled (just shuffled or flipped)
void updateTranslation(const int t[3], GHOST_TUns64 time); void updateTranslation(const int t[3], uint64_t time);
void updateRotation(const int r[3], GHOST_TUns64 time); void updateRotation(const int r[3], uint64_t time);
// the latest raw button data from the device // the latest raw button data from the device
// use HID button encoding (not NDOF_ButtonT) // use HID button encoding (not NDOF_ButtonT)
void updateButton(int button_number, bool press, GHOST_TUns64 time); void updateButton(int button_number, bool press, uint64_t time);
void updateButtons(int button_bits, GHOST_TUns64 time); void updateButtons(int button_bits, uint64_t time);
// NDOFButton events are sent immediately // NDOFButton events are sent immediately
// processes and sends most recent raw data as an NDOFMotion event // processes and sends most recent raw data as an NDOFMotion event
@@ -147,8 +147,8 @@ class GHOST_NDOFManager {
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, uint64_t time, GHOST_IWindow *);
void sendKeyEvent(GHOST_TKey, bool press, GHOST_TUns64 time, GHOST_IWindow *); void sendKeyEvent(GHOST_TKey, bool press, uint64_t time, GHOST_IWindow *);
NDOF_DeviceT m_deviceType; NDOF_DeviceT m_deviceType;
int m_buttonCount; int m_buttonCount;
@@ -159,8 +159,8 @@ class GHOST_NDOFManager {
int m_rotation[3]; int m_rotation[3];
int m_buttons; // bit field int m_buttons; // bit field
GHOST_TUns64 m_motionTime; // in milliseconds uint64_t m_motionTime; // in milliseconds
GHOST_TUns64 m_prevMotionTime; // time of most recent Motion event sent uint64_t m_prevMotionTime; // time of most recent Motion event sent
GHOST_TProgress m_motionState; GHOST_TProgress m_motionState;
bool m_motionEventPending; bool m_motionEventPending;

View File

@@ -195,7 +195,7 @@ static void DeviceEvent(uint32_t unused, uint32_t msg_type, void *msg_arg)
// device state is broadcast to all clients; only react if sent to us // device state is broadcast to all clients; only react if sent to us
if (s->client == clientID) { if (s->client == clientID) {
// TODO: is s->time compatible with GHOST timestamps? if so use that instead. // TODO: is s->time compatible with GHOST timestamps? if so use that instead.
GHOST_TUns64 now = ghost_system->getMilliSeconds(); uint64_t now = ghost_system->getMilliSeconds();
switch (s->command) { switch (s->command) {
case kConnexionCmdHandleAxis: { case kConnexionCmdHandleAxis: {

View File

@@ -97,7 +97,7 @@ bool GHOST_NDOFManagerUnix::processEvents()
switch (e.type) { switch (e.type) {
case SPNAV_EVENT_MOTION: { case SPNAV_EVENT_MOTION: {
/* convert to blender view coords */ /* convert to blender view coords */
GHOST_TUns64 now = m_system.getMilliSeconds(); uint64_t now = m_system.getMilliSeconds();
const int t[3] = {(int)e.motion.x, (int)e.motion.y, (int)-e.motion.z}; const int t[3] = {(int)e.motion.x, (int)e.motion.y, (int)-e.motion.z};
const int r[3] = {(int)-e.motion.rx, (int)-e.motion.ry, (int)e.motion.rz}; const int r[3] = {(int)-e.motion.rx, (int)-e.motion.ry, (int)e.motion.rz};
@@ -109,7 +109,7 @@ bool GHOST_NDOFManagerUnix::processEvents()
break; break;
} }
case SPNAV_EVENT_BUTTON: case SPNAV_EVENT_BUTTON:
GHOST_TUns64 now = m_system.getMilliSeconds(); uint64_t now = m_system.getMilliSeconds();
updateButton(e.button.bnum, e.button.press, now); updateButton(e.button.bnum, e.button.press, now);
break; break;
} }
@@ -118,7 +118,7 @@ bool GHOST_NDOFManagerUnix::processEvents()
#ifdef USE_FINISH_GLITCH_WORKAROUND #ifdef USE_FINISH_GLITCH_WORKAROUND
if (motion_test_prev == true && motion_test == false) { if (motion_test_prev == true && motion_test == false) {
GHOST_TUns64 now = m_system.getMilliSeconds(); uint64_t now = m_system.getMilliSeconds();
const int v[3] = {0, 0, 0}; const int v[3] = {0, 0, 0};
updateTranslation(v, now); updateTranslation(v, now);

View File

@@ -38,25 +38,25 @@ GHOST_TSuccess GHOST_DisposeSystemPaths(void)
return GHOST_ISystemPaths::dispose(); return GHOST_ISystemPaths::dispose();
} }
const GHOST_TUns8 *GHOST_getSystemDir(int version, const char *versionstr) const char *GHOST_getSystemDir(int version, const char *versionstr)
{ {
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get(); GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
return systemPaths ? systemPaths->getSystemDir(version, versionstr) : NULL; return systemPaths ? systemPaths->getSystemDir(version, versionstr) : NULL;
} }
const GHOST_TUns8 *GHOST_getUserDir(int version, const char *versionstr) const char *GHOST_getUserDir(int version, const char *versionstr)
{ {
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get(); GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
return systemPaths ? systemPaths->getUserDir(version, versionstr) : NULL; /* shouldn't be NULL */ return systemPaths ? systemPaths->getUserDir(version, versionstr) : NULL; /* shouldn't be NULL */
} }
const GHOST_TUns8 *GHOST_getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const char *GHOST_getUserSpecialDir(GHOST_TUserSpecialDirTypes type)
{ {
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get(); GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
return systemPaths ? systemPaths->getUserSpecialDir(type) : NULL; /* shouldn't be NULL */ return systemPaths ? systemPaths->getUserSpecialDir(type) : NULL; /* shouldn't be NULL */
} }
const GHOST_TUns8 *GHOST_getBinaryDir() const char *GHOST_getBinaryDir()
{ {
GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get(); GHOST_ISystemPaths *systemPaths = GHOST_ISystemPaths::get();
return systemPaths ? systemPaths->getBinaryDir() : NULL; /* shouldn't be NULL */ return systemPaths ? systemPaths->getBinaryDir() : NULL; /* shouldn't be NULL */

View File

@@ -23,7 +23,7 @@
#include "GHOST_Rect.h" #include "GHOST_Rect.h"
void GHOST_Rect::inset(GHOST_TInt32 i) void GHOST_Rect::inset(int32_t i)
{ {
if (i > 0) { if (i > 0) {
// Grow the rectangle // Grow the rectangle
@@ -34,7 +34,7 @@ void GHOST_Rect::inset(GHOST_TInt32 i)
} }
else if (i < 0) { else if (i < 0) {
// Shrink the rectangle, check for insets larger than half the size // Shrink the rectangle, check for insets larger than half the size
GHOST_TInt32 i2 = i * 2; int32_t i2 = i * 2;
if (getWidth() > i2) { if (getWidth() > i2) {
m_l += i; m_l += i;
m_r -= i; m_r -= i;
@@ -82,9 +82,9 @@ GHOST_TVisibility GHOST_Rect::getVisibility(GHOST_Rect &r) const
return v; return v;
} }
void GHOST_Rect::setCenter(GHOST_TInt32 cx, GHOST_TInt32 cy) void GHOST_Rect::setCenter(int32_t cx, int32_t cy)
{ {
GHOST_TInt32 offset = cx - (m_l + (m_r - m_l) / 2); int32_t offset = cx - (m_l + (m_r - m_l) / 2);
m_l += offset; m_l += offset;
m_r += offset; m_r += offset;
offset = cy - (m_t + (m_b - m_t) / 2); offset = cy - (m_t + (m_b - m_t) / 2);
@@ -92,7 +92,7 @@ void GHOST_Rect::setCenter(GHOST_TInt32 cx, GHOST_TInt32 cy)
m_b += offset; m_b += offset;
} }
void GHOST_Rect::setCenter(GHOST_TInt32 cx, GHOST_TInt32 cy, GHOST_TInt32 w, GHOST_TInt32 h) void GHOST_Rect::setCenter(int32_t cx, int32_t cy, int32_t w, int32_t h)
{ {
long w_2, h_2; long w_2, h_2;

View File

@@ -56,19 +56,19 @@ GHOST_System::~GHOST_System()
exit(); exit();
} }
GHOST_TUns64 GHOST_System::getMilliSeconds() const uint64_t GHOST_System::getMilliSeconds() const
{ {
return std::chrono::duration_cast<std::chrono::milliseconds>( return std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now().time_since_epoch()) std::chrono::steady_clock::now().time_since_epoch())
.count(); .count();
} }
GHOST_ITimerTask *GHOST_System::installTimer(GHOST_TUns64 delay, GHOST_ITimerTask *GHOST_System::installTimer(uint64_t delay,
GHOST_TUns64 interval, uint64_t interval,
GHOST_TimerProcPtr timerProc, GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData) GHOST_TUserDataPtr userData)
{ {
GHOST_TUns64 millis = getMilliSeconds(); uint64_t millis = getMilliSeconds();
GHOST_TimerTask *timer = new GHOST_TimerTask(millis + delay, interval, timerProc, userData); GHOST_TimerTask *timer = new GHOST_TimerTask(millis + delay, interval, timerProc, userData);
if (timer) { if (timer) {
if (m_timerManager->addTimer(timer) == GHOST_kSuccess) { if (m_timerManager->addTimer(timer) == GHOST_kSuccess) {

View File

@@ -75,7 +75,7 @@ class GHOST_System : public GHOST_ISystem {
* Based on ANSI clock() routine. * Based on ANSI clock() routine.
* \return The number of milliseconds. * \return The number of milliseconds.
*/ */
virtual GHOST_TUns64 getMilliSeconds() const; virtual uint64_t getMilliSeconds() const;
/** /**
* Installs a timer. * Installs a timer.
@@ -89,8 +89,8 @@ class GHOST_System : public GHOST_ISystem {
* \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).
*/ */
GHOST_ITimerTask *installTimer(GHOST_TUns64 delay, GHOST_ITimerTask *installTimer(uint64_t delay,
GHOST_TUns64 interval, uint64_t interval,
GHOST_TimerProcPtr timerProc, GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData = NULL); GHOST_TUserDataPtr userData = NULL);
@@ -210,8 +210,8 @@ class GHOST_System : public GHOST_ISystem {
/** /**
* Inherited from GHOST_ISystem but left pure virtual * Inherited from GHOST_ISystem but left pure virtual
* <pre> * <pre>
* GHOST_TSuccess getCursorPosition(GHOST_TInt32& x, GHOST_TInt32& y) const = 0; * GHOST_TSuccess getCursorPosition(int32_t& x, int32_t& y) const = 0;
* GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) * GHOST_TSuccess setCursorPosition(int32_t x, int32_t y)
* </pre> * </pre>
*/ */
@@ -308,14 +308,14 @@ class GHOST_System : public GHOST_ISystem {
* \return Returns the clipboard data * \return Returns the clipboard data
* *
*/ */
virtual GHOST_TUns8 *getClipboard(bool selection) const = 0; virtual char *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(char *buffer, bool selection) const = 0;
/** /**
* Show a system message box * Show a system message box

View File

@@ -59,7 +59,7 @@ class GHOST_SystemCocoa : public GHOST_System {
* Based on ANSI clock() routine. * Based on ANSI clock() routine.
* \return The number of milliseconds. * \return The number of milliseconds.
*/ */
GHOST_TUns64 getMilliSeconds() const; uint64_t getMilliSeconds() const;
/*************************************************************************************** /***************************************************************************************
* Display/window management functionality * Display/window management functionality
@@ -69,18 +69,18 @@ class GHOST_SystemCocoa : public GHOST_System {
* 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.
*/ */
GHOST_TUns8 getNumDisplays() const; uint8_t getNumDisplays() const;
/** /**
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
* \return The dimension of the main display. * \return The dimension of the main display.
*/ */
void getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const; void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const;
/** Returns the combine dimensions of all monitors. /** Returns the combine dimensions of all monitors.
* \return The dimension of the workspace. * \return The dimension of the workspace.
*/ */
void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const; void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const;
/** /**
* Create a new window. * Create a new window.
@@ -100,10 +100,10 @@ class GHOST_SystemCocoa : public GHOST_System {
* \return The new window (or 0 if creation failed). * \return The new window (or 0 if creation failed).
*/ */
GHOST_IWindow *createWindow(const char *title, GHOST_IWindow *createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,
@@ -175,7 +175,7 @@ class GHOST_SystemCocoa : public GHOST_System {
* \param y: The y-coordinate of the cursor. * \param y: The y-coordinate of the cursor.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const; GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const;
/** /**
* Updates the location of the cursor (location in screen coordinates). * Updates the location of the cursor (location in screen coordinates).
@@ -183,7 +183,7 @@ class GHOST_SystemCocoa : public GHOST_System {
* \param y: The y-coordinate of the cursor. * \param y: The y-coordinate of the cursor.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y); GHOST_TSuccess setCursorPosition(int32_t x, int32_t y);
/*************************************************************************************** /***************************************************************************************
* Access to mouse button and keyboard states. * Access to mouse button and keyboard states.
@@ -208,14 +208,14 @@ class GHOST_SystemCocoa : public GHOST_System {
* \param selection: Indicate which buffer to return. * \param selection: Indicate which buffer to return.
* \return Returns the selected buffer * \return Returns the selected buffer
*/ */
GHOST_TUns8 *getClipboard(bool selection) const; char *getClipboard(bool selection) const;
/** /**
* Puts buffer to system clipboard * Puts buffer to system clipboard
* \param buffer: The buffer to be copied. * \param buffer: The buffer to be copied.
* \param selection: Indicates which buffer to copy too, only used on X11. * \param selection: Indicates which buffer to copy too, only used on X11.
*/ */
void putClipboard(GHOST_TInt8 *buffer, bool selection) const; void putClipboard(char *buffer, bool selection) const;
/** /**
* Handles a window event. Called by GHOST_WindowCocoa window delegate * Handles a window event. Called by GHOST_WindowCocoa window delegate
@@ -288,10 +288,10 @@ class GHOST_SystemCocoa : public GHOST_System {
* \param y: The y-coordinate of the cursor. * \param y: The y-coordinate of the cursor.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess setMouseCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y); GHOST_TSuccess setMouseCursorPosition(int32_t x, int32_t y);
/** Start time at initialization. */ /** Start time at initialization. */
GHOST_TUns64 m_start_time; uint64_t m_start_time;
/** Event has been processed directly by Cocoa (or NDOF manager) /** Event has been processed directly by Cocoa (or NDOF manager)
* and has sent a ghost event to be dispatched */ * and has sent a ghost event to be dispatched */
@@ -302,7 +302,7 @@ class GHOST_SystemCocoa : public GHOST_System {
bool m_needDelayedApplicationBecomeActiveEventProcessing; bool m_needDelayedApplicationBecomeActiveEventProcessing;
/** State of the modifiers. */ /** State of the modifiers. */
GHOST_TUns32 m_modifierMask; uint32_t m_modifierMask;
/** Ignores window size messages (when window is dragged). */ /** Ignores window size messages (when window is dragged). */
bool m_ignoreWindowSizedMessages; bool m_ignoreWindowSizedMessages;

View File

@@ -655,7 +655,7 @@ GHOST_TSuccess GHOST_SystemCocoa::init()
#pragma mark window management #pragma mark window management
GHOST_TUns64 GHOST_SystemCocoa::getMilliSeconds() const uint64_t GHOST_SystemCocoa::getMilliSeconds() const
{ {
// Cocoa equivalent exists in 10.6 ([[NSProcessInfo processInfo] systemUptime]) // Cocoa equivalent exists in 10.6 ([[NSProcessInfo processInfo] systemUptime])
struct timeval currentTime; struct timeval currentTime;
@@ -667,7 +667,7 @@ GHOST_TUns64 GHOST_SystemCocoa::getMilliSeconds() const
return ((currentTime.tv_sec * 1000) + (currentTime.tv_usec / 1000) - m_start_time); return ((currentTime.tv_sec * 1000) + (currentTime.tv_usec / 1000) - m_start_time);
} }
GHOST_TUns8 GHOST_SystemCocoa::getNumDisplays() const uint8_t GHOST_SystemCocoa::getNumDisplays() const
{ {
// Note that OS X supports monitor hot plug // Note that OS X supports monitor hot plug
// We do not support multiple monitors at the moment // We do not support multiple monitors at the moment
@@ -676,7 +676,7 @@ GHOST_TUns8 GHOST_SystemCocoa::getNumDisplays() const
} }
} }
void GHOST_SystemCocoa::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void GHOST_SystemCocoa::getMainDisplayDimensions(uint32_t &width, uint32_t &height) const
{ {
@autoreleasepool { @autoreleasepool {
// Get visible frame, that is frame excluding dock and top menu bar // Get visible frame, that is frame excluding dock and top menu bar
@@ -693,17 +693,17 @@ void GHOST_SystemCocoa::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns
} }
} }
void GHOST_SystemCocoa::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void GHOST_SystemCocoa::getAllDisplayDimensions(uint32_t &width, uint32_t &height) const
{ {
/* TODO! */ /* TODO! */
getMainDisplayDimensions(width, height); getMainDisplayDimensions(width, height);
} }
GHOST_IWindow *GHOST_SystemCocoa::createWindow(const char *title, GHOST_IWindow *GHOST_SystemCocoa::createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,
@@ -721,7 +721,7 @@ GHOST_IWindow *GHOST_SystemCocoa::createWindow(const char *title,
styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
NSWindowStyleMaskMiniaturizable)]; NSWindowStyleMaskMiniaturizable)];
GHOST_TInt32 bottom = (contentRect.size.height - 1) - height - top; int32_t bottom = (contentRect.size.height - 1) - height - top;
// Ensures window top left is inside this available rect // Ensures window top left is inside this available rect
left = left > contentRect.origin.x ? left : contentRect.origin.x; left = left > contentRect.origin.x ? left : contentRect.origin.x;
@@ -791,20 +791,20 @@ GHOST_TSuccess GHOST_SystemCocoa::disposeContext(GHOST_IContext *context)
/** /**
* \note : returns coordinates in Cocoa screen coordinates * \note : returns coordinates in Cocoa screen coordinates
*/ */
GHOST_TSuccess GHOST_SystemCocoa::getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const GHOST_TSuccess GHOST_SystemCocoa::getCursorPosition(int32_t &x, int32_t &y) const
{ {
NSPoint mouseLoc = [NSEvent mouseLocation]; NSPoint mouseLoc = [NSEvent mouseLocation];
// Returns the mouse location in screen coordinates // Returns the mouse location in screen coordinates
x = (GHOST_TInt32)mouseLoc.x; x = (int32_t)mouseLoc.x;
y = (GHOST_TInt32)mouseLoc.y; y = (int32_t)mouseLoc.y;
return GHOST_kSuccess; return GHOST_kSuccess;
} }
/** /**
* \note : expect Cocoa screen coordinates * \note : expect Cocoa screen coordinates
*/ */
GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(int32_t x, int32_t y)
{ {
GHOST_WindowCocoa *window = (GHOST_WindowCocoa *)m_windowManager->getActiveWindow(); GHOST_WindowCocoa *window = (GHOST_WindowCocoa *)m_windowManager->getActiveWindow();
if (!window) if (!window)
@@ -824,7 +824,7 @@ GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_SystemCocoa::setMouseCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) GHOST_TSuccess GHOST_SystemCocoa::setMouseCursorPosition(int32_t x, int32_t y)
{ {
float xf = (float)x, yf = (float)y; float xf = (float)x, yf = (float)y;
GHOST_WindowCocoa *window = (GHOST_WindowCocoa *)m_windowManager->getActiveWindow(); GHOST_WindowCocoa *window = (GHOST_WindowCocoa *)m_windowManager->getActiveWindow();
@@ -897,7 +897,7 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
GHOST_TimerManager* timerMgr = getTimerManager(); GHOST_TimerManager* timerMgr = getTimerManager();
if (waitForEvent) { if (waitForEvent) {
GHOST_TUns64 next = timerMgr->nextFireTime(); uint64_t next = timerMgr->nextFireTime();
double timeOut; double timeOut;
if (next == GHOST_kFireTimeNever) { if (next == GHOST_kFireTimeNever) {
@@ -1132,7 +1132,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
break; break;
case GHOST_kEventDraggingDropDone: { case GHOST_kEventDraggingDropDone: {
GHOST_TUns8 *temp_buff; uint8_t *temp_buff;
GHOST_TStringArray *strArray; GHOST_TStringArray *strArray;
NSArray *droppedArray; NSArray *droppedArray;
size_t pastedTextSize; size_t pastedTextSize;
@@ -1157,13 +1157,13 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
return GHOST_kFailure; return GHOST_kFailure;
} }
strArray->strings = (GHOST_TUns8 **)malloc(strArray->count * sizeof(GHOST_TUns8 *)); strArray->strings = (uint8_t **)malloc(strArray->count * sizeof(uint8_t *));
for (i = 0; i < strArray->count; i++) { for (i = 0; i < strArray->count; i++) {
droppedStr = [droppedArray objectAtIndex:i]; droppedStr = [droppedArray objectAtIndex:i];
pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
temp_buff = (GHOST_TUns8 *)malloc(pastedTextSize + 1); temp_buff = (uint8_t *)malloc(pastedTextSize + 1);
if (!temp_buff) { if (!temp_buff) {
strArray->count = i; strArray->count = i;
@@ -1185,7 +1185,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
droppedStr = (NSString *)data; droppedStr = (NSString *)data;
pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; pastedTextSize = [droppedStr lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
temp_buff = (GHOST_TUns8 *)malloc(pastedTextSize + 1); temp_buff = (uint8_t *)malloc(pastedTextSize + 1);
if (temp_buff == NULL) { if (temp_buff == NULL) {
return GHOST_kFailure; return GHOST_kFailure;
@@ -1204,9 +1204,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
NSImage *droppedImg = (NSImage *)data; NSImage *droppedImg = (NSImage *)data;
NSSize imgSize = [droppedImg size]; NSSize imgSize = [droppedImg size];
ImBuf *ibuf = NULL; ImBuf *ibuf = NULL;
GHOST_TUns8 *rasterRGB = NULL; uint8_t *rasterRGB = NULL;
GHOST_TUns8 *rasterRGBA = NULL; uint8_t *rasterRGBA = NULL;
GHOST_TUns8 *toIBuf = NULL; uint8_t *toIBuf = NULL;
int x, y, to_i, from_i; int x, y, to_i, from_i;
NSBitmapImageRep *blBitmapFormatImageRGB, *blBitmapFormatImageRGBA, *bitmapImage = nil; NSBitmapImageRep *blBitmapFormatImageRGB, *blBitmapFormatImageRGBA, *bitmapImage = nil;
NSEnumerator *enumerator; NSEnumerator *enumerator;
@@ -1232,8 +1232,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
if (([bitmapImage bitsPerPixel] == 32) && (([bitmapImage bitmapFormat] & 0x5) == 0) && if (([bitmapImage bitsPerPixel] == 32) && (([bitmapImage bitmapFormat] & 0x5) == 0) &&
![bitmapImage isPlanar]) { ![bitmapImage isPlanar]) {
/* Try a fast copy if the image is a meshed RGBA 32bit bitmap. */ /* Try a fast copy if the image is a meshed RGBA 32bit bitmap. */
toIBuf = (GHOST_TUns8 *)ibuf->rect; toIBuf = (uint8_t *)ibuf->rect;
rasterRGB = (GHOST_TUns8 *)[bitmapImage bitmapData]; rasterRGB = (uint8_t *)[bitmapImage bitmapData];
for (y = 0; y < imgSize.height; y++) { for (y = 0; y < imgSize.height; y++) {
to_i = (imgSize.height - y - 1) * imgSize.width; to_i = (imgSize.height - y - 1) * imgSize.width;
from_i = y * imgSize.width; from_i = y * imgSize.width;
@@ -1270,7 +1270,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
[bitmapImage draw]; [bitmapImage draw];
[NSGraphicsContext restoreGraphicsState]; [NSGraphicsContext restoreGraphicsState];
rasterRGB = (GHOST_TUns8 *)[blBitmapFormatImageRGB bitmapData]; rasterRGB = (uint8_t *)[blBitmapFormatImageRGB bitmapData];
if (rasterRGB == NULL) { if (rasterRGB == NULL) {
[bitmapImage release]; [bitmapImage release];
[blBitmapFormatImageRGB release]; [blBitmapFormatImageRGB release];
@@ -1299,7 +1299,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
[bitmapImage draw]; [bitmapImage draw];
[NSGraphicsContext restoreGraphicsState]; [NSGraphicsContext restoreGraphicsState];
rasterRGBA = (GHOST_TUns8 *)[blBitmapFormatImageRGBA bitmapData]; rasterRGBA = (uint8_t *)[blBitmapFormatImageRGBA bitmapData];
if (rasterRGBA == NULL) { if (rasterRGBA == NULL) {
[bitmapImage release]; [bitmapImage release];
[blBitmapFormatImageRGB release]; [blBitmapFormatImageRGB release];
@@ -1309,7 +1309,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType
} }
/* Copy the image to ibuf, flipping it vertically. */ /* Copy the image to ibuf, flipping it vertically. */
toIBuf = (GHOST_TUns8 *)ibuf->rect; toIBuf = (uint8_t *)ibuf->rect;
for (y = 0; y < imgSize.height; y++) { for (y = 0; y < imgSize.height; y++) {
for (x = 0; x < imgSize.width; x++) { for (x = 0; x < imgSize.width; x++) {
to_i = (imgSize.height - y - 1) * imgSize.width + x; to_i = (imgSize.height - y - 1) * imgSize.width + x;
@@ -1563,7 +1563,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
switch (grab_mode) { switch (grab_mode) {
case GHOST_kGrabHide: // Cursor hidden grab operation : no cursor move case GHOST_kGrabHide: // Cursor hidden grab operation : no cursor move
{ {
GHOST_TInt32 x_warp, y_warp, x_accum, y_accum, x, y; int32_t x_warp, y_warp, x_accum, y_accum, x, y;
window->getCursorGrabInitPos(x_warp, y_warp); window->getCursorGrabInitPos(x_warp, y_warp);
window->screenToClientIntern(x_warp, y_warp, x_warp, y_warp); window->screenToClientIntern(x_warp, y_warp, x_warp, y_warp);
@@ -1593,8 +1593,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
} }
NSPoint mousePos = [event locationInWindow]; NSPoint mousePos = [event locationInWindow];
GHOST_TInt32 x_mouse = mousePos.x; int32_t x_mouse = mousePos.x;
GHOST_TInt32 y_mouse = mousePos.y; int32_t y_mouse = mousePos.y;
GHOST_Rect bounds, windowBounds, correctedBounds; GHOST_Rect bounds, windowBounds, correctedBounds;
/* fallback to window bounds */ /* fallback to window bounds */
@@ -1610,19 +1610,19 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
correctedBounds.m_t = (windowBounds.m_b - windowBounds.m_t) - correctedBounds.m_t; correctedBounds.m_t = (windowBounds.m_b - windowBounds.m_t) - correctedBounds.m_t;
// Get accumulation from previous mouse warps // Get accumulation from previous mouse warps
GHOST_TInt32 x_accum, y_accum; int32_t x_accum, y_accum;
window->getCursorGrabAccum(x_accum, y_accum); window->getCursorGrabAccum(x_accum, y_accum);
// Warp mouse cursor if needed // Warp mouse cursor if needed
GHOST_TInt32 warped_x_mouse = x_mouse; int32_t warped_x_mouse = x_mouse;
GHOST_TInt32 warped_y_mouse = y_mouse; int32_t warped_y_mouse = y_mouse;
correctedBounds.wrapPoint( correctedBounds.wrapPoint(
warped_x_mouse, warped_y_mouse, 4, window->getCursorGrabAxis()); warped_x_mouse, warped_y_mouse, 4, window->getCursorGrabAxis());
// Set new cursor position // Set new cursor position
if (x_mouse != warped_x_mouse || y_mouse != warped_y_mouse) { if (x_mouse != warped_x_mouse || y_mouse != warped_y_mouse) {
GHOST_TInt32 warped_x, warped_y; int32_t warped_x, warped_y;
window->clientToScreenIntern(warped_x_mouse, warped_y_mouse, warped_x, warped_y); window->clientToScreenIntern(warped_x_mouse, warped_y_mouse, warped_x, warped_y);
setMouseCursorPosition(warped_x, warped_y); /* wrap */ setMouseCursorPosition(warped_x, warped_y); /* wrap */
window->setCursorGrabAccum(x_accum + (x_mouse - warped_x_mouse), window->setCursorGrabAccum(x_accum + (x_mouse - warped_x_mouse),
@@ -1633,7 +1633,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
} }
// Generate event // Generate event
GHOST_TInt32 x, y; int32_t x, y;
window->clientToScreenIntern(x_mouse + x_accum, y_mouse + y_accum, x, y); window->clientToScreenIntern(x_mouse + x_accum, y_mouse + y_accum, x, y);
pushEvent(new GHOST_EventCursor([event timestamp] * 1000, pushEvent(new GHOST_EventCursor([event timestamp] * 1000,
GHOST_kEventCursorMove, GHOST_kEventCursorMove,
@@ -1646,7 +1646,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
default: { default: {
// Normal cursor operation: send mouse position in window // Normal cursor operation: send mouse position in window
NSPoint mousePos = [event locationInWindow]; NSPoint mousePos = [event locationInWindow];
GHOST_TInt32 x, y; int32_t x, y;
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
pushEvent(new GHOST_EventCursor([event timestamp] * 1000, pushEvent(new GHOST_EventCursor([event timestamp] * 1000,
@@ -1690,7 +1690,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
/* Standard scroll-wheel case, if no swiping happened, /* Standard scroll-wheel case, if no swiping happened,
* and no momentum (kinetic scroll) works. */ * and no momentum (kinetic scroll) works. */
if (!m_multiTouchScroll && momentumPhase == NSEventPhaseNone) { if (!m_multiTouchScroll && momentumPhase == NSEventPhaseNone) {
GHOST_TInt32 delta; int32_t delta;
double deltaF = [event deltaY]; double deltaF = [event deltaY];
@@ -1704,7 +1704,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
} }
else { else {
NSPoint mousePos = [event locationInWindow]; NSPoint mousePos = [event locationInWindow];
GHOST_TInt32 x, y; int32_t x, y;
double dx; double dx;
double dy; double dy;
@@ -1734,7 +1734,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
case NSEventTypeMagnify: { case NSEventTypeMagnify: {
NSPoint mousePos = [event locationInWindow]; NSPoint mousePos = [event locationInWindow];
GHOST_TInt32 x, y; int32_t x, y;
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000,
window, window,
@@ -1748,7 +1748,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
case NSEventTypeSmartMagnify: { case NSEventTypeSmartMagnify: {
NSPoint mousePos = [event locationInWindow]; NSPoint mousePos = [event locationInWindow];
GHOST_TInt32 x, y; int32_t x, y;
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
pushEvent(new GHOST_EventTrackpad( pushEvent(new GHOST_EventTrackpad(
[event timestamp] * 1000, window, GHOST_kTrackpadEventSmartMagnify, x, y, 0, 0, false)); [event timestamp] * 1000, window, GHOST_kTrackpadEventSmartMagnify, x, y, 0, 0, false));
@@ -1756,7 +1756,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
case NSEventTypeRotate: { case NSEventTypeRotate: {
NSPoint mousePos = [event locationInWindow]; NSPoint mousePos = [event locationInWindow];
GHOST_TInt32 x, y; int32_t x, y;
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y); window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000, pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000,
window, window,
@@ -1933,9 +1933,9 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
#pragma mark Clipboard get/set #pragma mark Clipboard get/set
GHOST_TUns8 *GHOST_SystemCocoa::getClipboard(bool selection) const char *GHOST_SystemCocoa::getClipboard(bool selection) const
{ {
GHOST_TUns8 *temp_buff; char *temp_buff;
size_t pastedTextSize; size_t pastedTextSize;
@autoreleasepool { @autoreleasepool {
@@ -1950,14 +1950,13 @@ GHOST_TUns8 *GHOST_SystemCocoa::getClipboard(bool selection) const
pastedTextSize = [textPasted lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; pastedTextSize = [textPasted lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
temp_buff = (GHOST_TUns8 *)malloc(pastedTextSize + 1); temp_buff = (char *)malloc(pastedTextSize + 1);
if (temp_buff == NULL) { if (temp_buff == NULL) {
return NULL; return NULL;
} }
strncpy( strncpy(temp_buff, [textPasted cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
(char *)temp_buff, [textPasted cStringUsingEncoding:NSUTF8StringEncoding], pastedTextSize);
temp_buff[pastedTextSize] = '\0'; temp_buff[pastedTextSize] = '\0';
@@ -1970,7 +1969,7 @@ GHOST_TUns8 *GHOST_SystemCocoa::getClipboard(bool selection) const
} }
} }
void GHOST_SystemCocoa::putClipboard(GHOST_TInt8 *buffer, bool selection) const void GHOST_SystemCocoa::putClipboard(char *buffer, bool selection) const
{ {
if (selection) if (selection)
return; // for copying the selection, used on X11 return; // for copying the selection, used on X11

View File

@@ -52,33 +52,33 @@ class GHOST_SystemNULL : public GHOST_System {
{ {
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TUns8 *getClipboard(bool selection) const char *getClipboard(bool selection) const
{ {
return NULL; return NULL;
} }
void putClipboard(GHOST_TInt8 *buffer, bool selection) const void putClipboard(char *buffer, bool selection) const
{ /* nop */ { /* nop */
} }
GHOST_TUns64 getMilliSeconds() const uint64_t getMilliSeconds() const
{ {
return 0; return 0;
} }
GHOST_TUns8 getNumDisplays() const uint8_t getNumDisplays() const
{ {
return GHOST_TUns8(1); return uint8_t(1);
} }
GHOST_TSuccess getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const
{ {
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) GHOST_TSuccess setCursorPosition(int32_t x, int32_t y)
{ {
return GHOST_kFailure; return GHOST_kFailure;
} }
void getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const
{ /* nop */ { /* nop */
} }
void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const
{ /* nop */ { /* nop */
} }
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings) GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings)
@@ -106,10 +106,10 @@ class GHOST_SystemNULL : public GHOST_System {
} }
GHOST_IWindow *createWindow(const char *title, GHOST_IWindow *createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,

View File

@@ -49,20 +49,20 @@ class GHOST_SystemPaths : public GHOST_ISystemPaths {
* "unpack and run" path, then look for properly installed path, including versioning. * "unpack and run" path, then look for properly installed path, 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(int version, const char *versionstr) const = 0; virtual const char *getSystemDir(int version, const char *versionstr) const = 0;
/** /**
* Determine the base dir in which user configuration is stored, including versioning. * Determine the base dir in which user configuration is stored, 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(int version, const char *versionstr) const = 0; virtual const char *getUserDir(int version, const char *versionstr) 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 char *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

View File

@@ -46,26 +46,26 @@ class GHOST_SystemPathsCocoa : public GHOST_SystemPaths {
* "unpack and run" path, then look for properly installed path, including versioning. * "unpack and run" path, then look for properly installed path, 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/).
*/ */
const GHOST_TUns8 *getSystemDir(int version, const char *versionstr) const; const char *getSystemDir(int version, const char *versionstr) const;
/** /**
* Determine the base dir in which user configuration is stored, including versioning. * Determine the base dir in which user configuration is stored, 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/).
*/ */
const GHOST_TUns8 *getUserDir(int version, const char *versionstr) const; const char *getUserDir(int version, const char *versionstr) const;
/** /**
* Determine a special ("well known") and easy to reach user directory. * Determine a special ("well known") and easy to reach user directory.
* \return Unsigned char string pointing to user dir (eg `~/Documents/`). * \return Unsigned char string pointing to user dir (eg `~/Documents/`).
*/ */
const GHOST_TUns8 *getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const; const char *getUserSpecialDir(GHOST_TUserSpecialDirTypes type) 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 char *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

@@ -36,7 +36,7 @@ GHOST_SystemPathsCocoa::~GHOST_SystemPathsCocoa()
#pragma mark Base directories retrieval #pragma mark Base directories retrieval
const GHOST_TUns8 *GHOST_SystemPathsCocoa::getSystemDir(int, const char *versionstr) const const char *GHOST_SystemPathsCocoa::getSystemDir(int, const char *versionstr) const
{ {
static char tempPath[512] = ""; static char tempPath[512] = "";
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -60,10 +60,10 @@ const GHOST_TUns8 *GHOST_SystemPathsCocoa::getSystemDir(int, const char *version
versionstr); versionstr);
[pool drain]; [pool drain];
return (GHOST_TUns8 *)tempPath; return tempPath;
} }
const GHOST_TUns8 *GHOST_SystemPathsCocoa::getUserDir(int, const char *versionstr) const const char *GHOST_SystemPathsCocoa::getUserDir(int, const char *versionstr) const
{ {
static char tempPath[512] = ""; static char tempPath[512] = "";
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -87,10 +87,10 @@ const GHOST_TUns8 *GHOST_SystemPathsCocoa::getUserDir(int, const char *versionst
versionstr); versionstr);
[pool drain]; [pool drain];
return (GHOST_TUns8 *)tempPath; return tempPath;
} }
const GHOST_TUns8 *GHOST_SystemPathsCocoa::getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const const char *GHOST_SystemPathsCocoa::getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const
{ {
static char tempPath[512] = ""; static char tempPath[512] = "";
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -138,12 +138,12 @@ const GHOST_TUns8 *GHOST_SystemPathsCocoa::getUserSpecialDir(GHOST_TUserSpecialD
(char *)tempPath, [basePath cStringUsingEncoding:NSASCIIStringEncoding], sizeof(tempPath)); (char *)tempPath, [basePath cStringUsingEncoding:NSASCIIStringEncoding], sizeof(tempPath));
[pool drain]; [pool drain];
return (GHOST_TUns8 *)tempPath; return tempPath;
} }
const GHOST_TUns8 *GHOST_SystemPathsCocoa::getBinaryDir() const const char *GHOST_SystemPathsCocoa::getBinaryDir() const
{ {
static GHOST_TUns8 tempPath[512] = ""; static char tempPath[512] = "";
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *basePath; NSString *basePath;

View File

@@ -55,18 +55,18 @@ GHOST_SystemPathsUnix::~GHOST_SystemPathsUnix()
{ {
} }
const GHOST_TUns8 *GHOST_SystemPathsUnix::getSystemDir(int, const char *versionstr) const const char *GHOST_SystemPathsUnix::getSystemDir(int, const char *versionstr) const
{ {
/* no prefix assumes a portable build which only uses bundled scripts */ /* no prefix assumes a portable build which only uses bundled scripts */
if (static_path) { if (static_path) {
static string system_path = string(static_path) + "/blender/" + versionstr; static string system_path = string(static_path) + "/blender/" + versionstr;
return (GHOST_TUns8 *)system_path.c_str(); return system_path.c_str();
} }
return NULL; return NULL;
} }
const GHOST_TUns8 *GHOST_SystemPathsUnix::getUserDir(int version, const char *versionstr) const const char *GHOST_SystemPathsUnix::getUserDir(int version, const char *versionstr) const
{ {
static string user_path = ""; static string user_path = "";
static int last_version = 0; static int last_version = 0;
@@ -86,7 +86,7 @@ const GHOST_TUns8 *GHOST_SystemPathsUnix::getUserDir(int version, const char *ve
return NULL; return NULL;
} }
} }
return (GHOST_TUns8 *)user_path.c_str(); return user_path.c_str();
} }
else { else {
if (user_path.empty() || last_version != version) { if (user_path.empty() || last_version != version) {
@@ -107,11 +107,11 @@ const GHOST_TUns8 *GHOST_SystemPathsUnix::getUserDir(int version, const char *ve
} }
} }
return (const GHOST_TUns8 *)user_path.c_str(); return user_path.c_str();
} }
} }
const GHOST_TUns8 *GHOST_SystemPathsUnix::getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const const char *GHOST_SystemPathsUnix::getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const
{ {
const char *type_str; const char *type_str;
@@ -164,10 +164,10 @@ const GHOST_TUns8 *GHOST_SystemPathsUnix::getUserSpecialDir(GHOST_TUserSpecialDi
} }
path = path_stream.str(); path = path_stream.str();
return path[0] ? (const GHOST_TUns8 *)path.c_str() : NULL; return path[0] ? path.c_str() : NULL;
} }
const GHOST_TUns8 *GHOST_SystemPathsUnix::getBinaryDir() const const char *GHOST_SystemPathsUnix::getBinaryDir() const
{ {
return NULL; return NULL;
} }

View File

@@ -44,26 +44,26 @@ class GHOST_SystemPathsUnix : public GHOST_SystemPaths {
* "unpack and run" path, then look for properly installed path, including versioning. * "unpack and run" path, then look for properly installed path, 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/`).
*/ */
const GHOST_TUns8 *getSystemDir(int version, const char *versionstr) const; const char *getSystemDir(int version, const char *versionstr) const;
/** /**
* Determine the base dir in which user configuration is stored, including versioning. * Determine the base dir in which user configuration is stored, 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 `~/.config/.blender/`). * \return Unsigned char string pointing to user dir (eg `~/.config/.blender/`).
*/ */
const GHOST_TUns8 *getUserDir(int version, const char *versionstr) const; const char *getUserDir(int version, const char *versionstr) const;
/** /**
* Determine a special ("well known") and easy to reach user directory. * Determine a special ("well known") and easy to reach user directory.
* \return Unsigned char string pointing to user dir (eg `~/Documents/`). * \return Unsigned char string pointing to user dir (eg `~/Documents/`).
*/ */
const GHOST_TUns8 *getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const; const char *getUserSpecialDir(GHOST_TUserSpecialDirTypes type) 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 char *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

@@ -38,7 +38,7 @@ GHOST_SystemPathsWin32::~GHOST_SystemPathsWin32()
{ {
} }
const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const const char *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const
{ {
/* 1 utf-16 might translate into 3 utf-8. 2 utf-16 translates into 4 utf-8. */ /* 1 utf-16 might translate into 3 utf-8. 2 utf-16 translates into 4 utf-8. */
static char knownpath[MAX_PATH * 3 + 128] = {0}; static char knownpath[MAX_PATH * 3 + 128] = {0};
@@ -52,13 +52,13 @@ const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *version
CoTaskMemFree(knownpath_16); CoTaskMemFree(knownpath_16);
strcat(knownpath, "\\Blender Foundation\\Blender\\"); strcat(knownpath, "\\Blender Foundation\\Blender\\");
strcat(knownpath, versionstr); strcat(knownpath, versionstr);
return (GHOST_TUns8 *)knownpath; return knownpath;
} }
return NULL; return NULL;
} }
const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserDir(int, const char *versionstr) const const char *GHOST_SystemPathsWin32::getUserDir(int, const char *versionstr) const
{ {
static char knownpath[MAX_PATH * 3 + 128] = {0}; static char knownpath[MAX_PATH * 3 + 128] = {0};
PWSTR knownpath_16 = NULL; PWSTR knownpath_16 = NULL;
@@ -71,13 +71,13 @@ const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserDir(int, const char *versionst
CoTaskMemFree(knownpath_16); CoTaskMemFree(knownpath_16);
strcat(knownpath, "\\Blender Foundation\\Blender\\"); strcat(knownpath, "\\Blender Foundation\\Blender\\");
strcat(knownpath, versionstr); strcat(knownpath, versionstr);
return (GHOST_TUns8 *)knownpath; return knownpath;
} }
return NULL; return NULL;
} }
const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const const char *GHOST_SystemPathsWin32::getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const
{ {
GUID folderid; GUID folderid;
@@ -114,21 +114,21 @@ const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserSpecialDir(GHOST_TUserSpecialD
if (hResult == S_OK) { if (hResult == S_OK) {
conv_utf_16_to_8(knownpath_16, knownpath, MAX_PATH * 3); conv_utf_16_to_8(knownpath_16, knownpath, MAX_PATH * 3);
CoTaskMemFree(knownpath_16); CoTaskMemFree(knownpath_16);
return (GHOST_TUns8 *)knownpath; return knownpath;
} }
CoTaskMemFree(knownpath_16); CoTaskMemFree(knownpath_16);
return NULL; return NULL;
} }
const GHOST_TUns8 *GHOST_SystemPathsWin32::getBinaryDir() const const char *GHOST_SystemPathsWin32::getBinaryDir() const
{ {
static char fullname[MAX_PATH * 3] = {0}; static char fullname[MAX_PATH * 3] = {0};
wchar_t fullname_16[MAX_PATH * 3]; wchar_t fullname_16[MAX_PATH * 3];
if (GetModuleFileNameW(0, fullname_16, MAX_PATH)) { if (GetModuleFileNameW(0, fullname_16, MAX_PATH)) {
conv_utf_16_to_8(fullname_16, fullname, MAX_PATH * 3); conv_utf_16_to_8(fullname_16, fullname, MAX_PATH * 3);
return (GHOST_TUns8 *)fullname; return fullname;
} }
return NULL; return NULL;

View File

@@ -53,26 +53,26 @@ class GHOST_SystemPathsWin32 : public GHOST_SystemPaths {
* "unpack and run" path, then look for properly installed path, including versioning. * "unpack and run" path, then look for properly installed path, 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(int version, const char *versionstr) const; const char *getSystemDir(int version, const char *versionstr) const;
/** /**
* Determine the base dir in which user configuration is stored, including versioning. * Determine the base dir in which user configuration is stored, 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(int version, const char *versionstr) const; const char *getUserDir(int version, const char *versionstr) const;
/** /**
* Determine a special ("well known") and easy to reach user directory. * Determine a special ("well known") and easy to reach user directory.
* \return Unsigned char string pointing to user dir (eg `~/Documents/`). * \return Unsigned char string pointing to user dir (eg `~/Documents/`).
*/ */
const GHOST_TUns8 *getUserSpecialDir(GHOST_TUserSpecialDirTypes type) const; const char *getUserSpecialDir(GHOST_TUserSpecialDirTypes type) 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 char *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

@@ -50,10 +50,10 @@ GHOST_SystemSDL::~GHOST_SystemSDL()
} }
GHOST_IWindow *GHOST_SystemSDL::createWindow(const char *title, GHOST_IWindow *GHOST_SystemSDL::createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,
@@ -118,7 +118,7 @@ GHOST_TSuccess GHOST_SystemSDL::init()
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
* \return The dimension of the main display. * \return The dimension of the main display.
*/ */
void GHOST_SystemSDL::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void GHOST_SystemSDL::getAllDisplayDimensions(uint32_t &width, uint32_t &height) const
{ {
SDL_DisplayMode mode; SDL_DisplayMode mode;
SDL_GetDesktopDisplayMode(0, &mode); /* NOTE: always 0 display. */ SDL_GetDesktopDisplayMode(0, &mode); /* NOTE: always 0 display. */
@@ -126,7 +126,7 @@ void GHOST_SystemSDL::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32
height = mode.h; height = mode.h;
} }
void GHOST_SystemSDL::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void GHOST_SystemSDL::getMainDisplayDimensions(uint32_t &width, uint32_t &height) const
{ {
SDL_DisplayMode mode; SDL_DisplayMode mode;
SDL_GetCurrentDisplayMode(0, &mode); /* NOTE: always 0 display. */ SDL_GetCurrentDisplayMode(0, &mode); /* NOTE: always 0 display. */
@@ -134,7 +134,7 @@ void GHOST_SystemSDL::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32
height = mode.h; height = mode.h;
} }
GHOST_TUns8 GHOST_SystemSDL::getNumDisplays() const uint8_t GHOST_SystemSDL::getNumDisplays() const
{ {
return SDL_GetNumVideoDisplays(); return SDL_GetNumVideoDisplays();
} }
@@ -356,15 +356,15 @@ void GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
int x_win, y_win; int x_win, y_win;
SDL_GetWindowPosition(sdl_win, &x_win, &y_win); SDL_GetWindowPosition(sdl_win, &x_win, &y_win);
GHOST_TInt32 x_root = sdl_sub_evt.x + x_win; int32_t x_root = sdl_sub_evt.x + x_win;
GHOST_TInt32 y_root = sdl_sub_evt.y + y_win; int32_t y_root = sdl_sub_evt.y + y_win;
#if 0 #if 0
if (window->getCursorGrabMode() != GHOST_kGrabDisable && if (window->getCursorGrabMode() != GHOST_kGrabDisable &&
window->getCursorGrabMode() != GHOST_kGrabNormal) { window->getCursorGrabMode() != GHOST_kGrabNormal) {
GHOST_TInt32 x_new = x_root; int32_t x_new = x_root;
GHOST_TInt32 y_new = y_root; int32_t y_new = y_root;
GHOST_TInt32 x_accum, y_accum; int32_t x_accum, y_accum;
GHOST_Rect bounds; GHOST_Rect bounds;
/* fallback to window bounds */ /* fallback to window bounds */
@@ -611,7 +611,7 @@ void GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
} }
} }
GHOST_TSuccess GHOST_SystemSDL::getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const GHOST_TSuccess GHOST_SystemSDL::getCursorPosition(int32_t &x, int32_t &y) const
{ {
int x_win, y_win; int x_win, y_win;
SDL_Window *win = SDL_GetMouseFocus(); SDL_Window *win = SDL_GetMouseFocus();
@@ -625,7 +625,7 @@ GHOST_TSuccess GHOST_SystemSDL::getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_SystemSDL::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) GHOST_TSuccess GHOST_SystemSDL::setCursorPosition(int32_t x, int32_t y)
{ {
int x_win, y_win; int x_win, y_win;
SDL_Window *win = SDL_GetMouseFocus(); SDL_Window *win = SDL_GetMouseFocus();
@@ -668,14 +668,14 @@ bool GHOST_SystemSDL::processEvents(bool waitForEvent)
GHOST_TimerManager *timerMgr = getTimerManager(); GHOST_TimerManager *timerMgr = getTimerManager();
if (waitForEvent && m_dirty_windows.empty() && !SDL_HasEvents(SDL_FIRSTEVENT, SDL_LASTEVENT)) { if (waitForEvent && m_dirty_windows.empty() && !SDL_HasEvents(SDL_FIRSTEVENT, SDL_LASTEVENT)) {
GHOST_TUns64 next = timerMgr->nextFireTime(); uint64_t next = timerMgr->nextFireTime();
if (next == GHOST_kFireTimeNever) { if (next == GHOST_kFireTimeNever) {
SDL_WaitEventTimeout(NULL, -1); SDL_WaitEventTimeout(NULL, -1);
// SleepTillEvent(m_display, -1); // SleepTillEvent(m_display, -1);
} }
else { else {
GHOST_TInt64 maxSleep = next - getMilliSeconds(); int64_t maxSleep = next - getMilliSeconds();
if (maxSleep >= 0) { if (maxSleep >= 0) {
SDL_WaitEventTimeout(NULL, next - getMilliSeconds()); SDL_WaitEventTimeout(NULL, next - getMilliSeconds());
@@ -743,17 +743,17 @@ GHOST_TSuccess GHOST_SystemSDL::getButtons(GHOST_Buttons &buttons) const
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TUns8 *GHOST_SystemSDL::getClipboard(bool selection) const char *GHOST_SystemSDL::getClipboard(bool selection) const
{ {
return (GHOST_TUns8 *)SDL_GetClipboardText(); return (char *)SDL_GetClipboardText();
} }
void GHOST_SystemSDL::putClipboard(GHOST_TInt8 *buffer, bool selection) const void GHOST_SystemSDL::putClipboard(char *buffer, bool selection) const
{ {
SDL_SetClipboardText(buffer); SDL_SetClipboardText(buffer);
} }
GHOST_TUns64 GHOST_SystemSDL::getMilliSeconds() uint64_t GHOST_SystemSDL::getMilliSeconds()
{ {
return GHOST_TUns64(SDL_GetTicks()); /* NOTE: 32 -> 64bits. */ return uint64_t(SDL_GetTicks()); /* NOTE: 32 -> 64bits. */
} }

View File

@@ -56,21 +56,21 @@ class GHOST_SystemSDL : public GHOST_System {
GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const; GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const;
GHOST_TUns8 *getClipboard(bool selection) const; char *getClipboard(bool selection) const;
void putClipboard(GHOST_TInt8 *buffer, bool selection) const; void putClipboard(char *buffer, bool selection) const;
GHOST_TUns64 getMilliSeconds(); uint64_t getMilliSeconds();
GHOST_TUns8 getNumDisplays() const; uint8_t getNumDisplays() const;
GHOST_TSuccess getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const; GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const;
GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y); GHOST_TSuccess setCursorPosition(int32_t x, int32_t y);
void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const; void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const;
void getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const; void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const;
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings); GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings);
@@ -80,10 +80,10 @@ class GHOST_SystemSDL : public GHOST_System {
GHOST_TSuccess init(); GHOST_TSuccess init();
GHOST_IWindow *createWindow(const char *title, GHOST_IWindow *createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,

View File

@@ -468,7 +468,7 @@ static const zwp_relative_pointer_v1_listener relative_pointer_listener = {
static void dnd_events(const input_t *const input, const GHOST_TEventType event) static void dnd_events(const input_t *const input, const GHOST_TEventType event)
{ {
const GHOST_TUns64 time = input->system->getMilliSeconds(); const uint64_t time = input->system->getMilliSeconds();
GHOST_IWindow *const window = static_cast<GHOST_WindowWayland *>( GHOST_IWindow *const window = static_cast<GHOST_WindowWayland *>(
wl_surface_get_user_data(input->focus_pointer)); wl_surface_get_user_data(input->focus_pointer));
for (const std::string &type : mime_preference_order) { for (const std::string &type : mime_preference_order) {
@@ -718,10 +718,9 @@ static void data_device_drop(void *data, struct wl_data_device * /*wl_data_devic
GHOST_TStringArray *flist = static_cast<GHOST_TStringArray *>( GHOST_TStringArray *flist = static_cast<GHOST_TStringArray *>(
malloc(sizeof(GHOST_TStringArray))); malloc(sizeof(GHOST_TStringArray)));
flist->count = int(uris.size()); flist->count = int(uris.size());
flist->strings = static_cast<GHOST_TUns8 **>(malloc(uris.size() * sizeof(GHOST_TUns8 *))); flist->strings = static_cast<uint8_t **>(malloc(uris.size() * sizeof(uint8_t *)));
for (size_t i = 0; i < uris.size(); i++) { for (size_t i = 0; i < uris.size(); i++) {
flist->strings[i] = static_cast<GHOST_TUns8 *>( flist->strings[i] = static_cast<uint8_t *>(malloc((uris[i].size() + 1) * sizeof(uint8_t)));
malloc((uris[i].size() + 1) * sizeof(GHOST_TUns8)));
memcpy(flist->strings[i], uris[i].data(), uris[i].size() + 1); memcpy(flist->strings[i], uris[i].data(), uris[i].size() + 1);
} }
GHOST_IWindow *win = static_cast<GHOST_WindowWayland *>( GHOST_IWindow *win = static_cast<GHOST_WindowWayland *>(
@@ -1171,7 +1170,7 @@ static void keyboard_key(void *data,
.key_data = key_data, .key_data = key_data,
}); });
auto cb = [](GHOST_ITimerTask *task, GHOST_TUns64 /*time*/) { auto cb = [](GHOST_ITimerTask *task, uint64_t /*time*/) {
struct key_repeat_payload_t *payload = static_cast<key_repeat_payload_t *>( struct key_repeat_payload_t *payload = static_cast<key_repeat_payload_t *>(
task->getUserData()); task->getUserData());
payload->system->pushEvent(new GHOST_EventKey(payload->system->getMilliSeconds(), payload->system->pushEvent(new GHOST_EventKey(payload->system->getMilliSeconds(),
@@ -1511,14 +1510,14 @@ GHOST_TSuccess GHOST_SystemWayland::getButtons(GHOST_Buttons &buttons) const
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TUns8 *GHOST_SystemWayland::getClipboard(bool /*selection*/) const char *GHOST_SystemWayland::getClipboard(bool /*selection*/) const
{ {
GHOST_TUns8 *clipboard = static_cast<GHOST_TUns8 *>(malloc((selection.size() + 1))); char *clipboard = static_cast<char *>(malloc((selection.size() + 1)));
memcpy(clipboard, selection.data(), selection.size() + 1); memcpy(clipboard, selection.data(), selection.size() + 1);
return clipboard; return clipboard;
} }
void GHOST_SystemWayland::putClipboard(GHOST_TInt8 *buffer, bool /*selection*/) const void GHOST_SystemWayland::putClipboard(char *buffer, bool /*selection*/) const
{ {
if (!d->data_device_manager || d->inputs.empty()) { if (!d->data_device_manager || d->inputs.empty()) {
return; return;
@@ -1545,12 +1544,12 @@ void GHOST_SystemWayland::putClipboard(GHOST_TInt8 *buffer, bool /*selection*/)
} }
} }
GHOST_TUns8 GHOST_SystemWayland::getNumDisplays() const uint8_t GHOST_SystemWayland::getNumDisplays() const
{ {
return d ? GHOST_TUns8(d->outputs.size()) : 0; return d ? uint8_t(d->outputs.size()) : 0;
} }
GHOST_TSuccess GHOST_SystemWayland::getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const GHOST_TSuccess GHOST_SystemWayland::getCursorPosition(int32_t &x, int32_t &y) const
{ {
if (!d->inputs.empty() && (d->inputs[0]->focus_pointer != nullptr)) { if (!d->inputs.empty() && (d->inputs[0]->focus_pointer != nullptr)) {
x = d->inputs[0]->x; x = d->inputs[0]->x;
@@ -1562,12 +1561,12 @@ GHOST_TSuccess GHOST_SystemWayland::getCursorPosition(GHOST_TInt32 &x, GHOST_TIn
} }
} }
GHOST_TSuccess GHOST_SystemWayland::setCursorPosition(GHOST_TInt32 /*x*/, GHOST_TInt32 /*y*/) GHOST_TSuccess GHOST_SystemWayland::setCursorPosition(int32_t /*x*/, int32_t /*y*/)
{ {
return GHOST_kFailure; return GHOST_kFailure;
} }
void GHOST_SystemWayland::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void GHOST_SystemWayland::getMainDisplayDimensions(uint32_t &width, uint32_t &height) const
{ {
if (getNumDisplays() > 0) { if (getNumDisplays() > 0) {
/* We assume first output as main. */ /* We assume first output as main. */
@@ -1576,7 +1575,7 @@ void GHOST_SystemWayland::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TU
} }
} }
void GHOST_SystemWayland::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void GHOST_SystemWayland::getAllDisplayDimensions(uint32_t &width, uint32_t &height) const
{ {
getMainDisplayDimensions(width, height); getMainDisplayDimensions(width, height);
} }
@@ -1640,10 +1639,10 @@ GHOST_TSuccess GHOST_SystemWayland::disposeContext(GHOST_IContext *context)
} }
GHOST_IWindow *GHOST_SystemWayland::createWindow(const char *title, GHOST_IWindow *GHOST_SystemWayland::createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,
@@ -1780,8 +1779,8 @@ GHOST_TSuccess GHOST_SystemWayland::hasCursorShape(GHOST_TStandardCursor cursorS
return GHOST_TSuccess(cursors.count(cursorShape) && !cursors.at(cursorShape).empty()); return GHOST_TSuccess(cursors.count(cursorShape) && !cursors.at(cursorShape).empty());
} }
GHOST_TSuccess GHOST_SystemWayland::setCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess GHOST_SystemWayland::setCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,

View File

@@ -59,29 +59,29 @@ class GHOST_SystemWayland : public GHOST_System {
GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const override; GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const override;
GHOST_TUns8 *getClipboard(bool selection) const override; char *getClipboard(bool selection) const override;
void putClipboard(GHOST_TInt8 *buffer, bool selection) const override; void putClipboard(char *buffer, bool selection) const override;
GHOST_TUns8 getNumDisplays() const override; uint8_t getNumDisplays() const override;
GHOST_TSuccess getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const override; GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const override;
GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) override; GHOST_TSuccess setCursorPosition(int32_t x, int32_t y) override;
void getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const override; void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const override;
void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const override; void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const override;
GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings) override; GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings) override;
GHOST_TSuccess disposeContext(GHOST_IContext *context) override; GHOST_TSuccess disposeContext(GHOST_IContext *context) override;
GHOST_IWindow *createWindow(const char *title, GHOST_IWindow *createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,
@@ -107,8 +107,8 @@ class GHOST_SystemWayland : public GHOST_System {
GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor cursorShape); GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor cursorShape);
GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess setCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,

View File

@@ -169,21 +169,21 @@ GHOST_SystemWin32::~GHOST_SystemWin32()
toggleConsole(1); toggleConsole(1);
} }
GHOST_TUns64 GHOST_SystemWin32::performanceCounterToMillis(__int64 perf_ticks) const uint64_t GHOST_SystemWin32::performanceCounterToMillis(__int64 perf_ticks) const
{ {
// Calculate the time passed since system initialization. // Calculate the time passed since system initialization.
__int64 delta = (perf_ticks - m_start) * 1000; __int64 delta = (perf_ticks - m_start) * 1000;
GHOST_TUns64 t = (GHOST_TUns64)(delta / m_freq); uint64_t t = (uint64_t)(delta / m_freq);
return t; return t;
} }
GHOST_TUns64 GHOST_SystemWin32::tickCountToMillis(__int64 ticks) const uint64_t GHOST_SystemWin32::tickCountToMillis(__int64 ticks) const
{ {
return ticks - m_lfstart; return ticks - m_lfstart;
} }
GHOST_TUns64 GHOST_SystemWin32::getMilliSeconds() const uint64_t GHOST_SystemWin32::getMilliSeconds() const
{ {
// Hardware does not support high resolution timers. We will use GetTickCount instead then. // Hardware does not support high resolution timers. We will use GetTickCount instead then.
if (!m_hasPerformanceCounter) { if (!m_hasPerformanceCounter) {
@@ -197,31 +197,31 @@ GHOST_TUns64 GHOST_SystemWin32::getMilliSeconds() const
return performanceCounterToMillis(count); return performanceCounterToMillis(count);
} }
GHOST_TUns8 GHOST_SystemWin32::getNumDisplays() const uint8_t GHOST_SystemWin32::getNumDisplays() const
{ {
GHOST_ASSERT(m_displayManager, "GHOST_SystemWin32::getNumDisplays(): m_displayManager==0\n"); GHOST_ASSERT(m_displayManager, "GHOST_SystemWin32::getNumDisplays(): m_displayManager==0\n");
GHOST_TUns8 numDisplays; uint8_t numDisplays;
m_displayManager->getNumDisplays(numDisplays); m_displayManager->getNumDisplays(numDisplays);
return numDisplays; return numDisplays;
} }
void GHOST_SystemWin32::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void GHOST_SystemWin32::getMainDisplayDimensions(uint32_t &width, uint32_t &height) const
{ {
width = ::GetSystemMetrics(SM_CXSCREEN); width = ::GetSystemMetrics(SM_CXSCREEN);
height = ::GetSystemMetrics(SM_CYSCREEN); height = ::GetSystemMetrics(SM_CYSCREEN);
} }
void GHOST_SystemWin32::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void GHOST_SystemWin32::getAllDisplayDimensions(uint32_t &width, uint32_t &height) const
{ {
width = ::GetSystemMetrics(SM_CXVIRTUALSCREEN); width = ::GetSystemMetrics(SM_CXVIRTUALSCREEN);
height = ::GetSystemMetrics(SM_CYVIRTUALSCREEN); height = ::GetSystemMetrics(SM_CYVIRTUALSCREEN);
} }
GHOST_IWindow *GHOST_SystemWin32::createWindow(const char *title, GHOST_IWindow *GHOST_SystemWin32::createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,
@@ -410,8 +410,8 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
#if 1 #if 1
::Sleep(1); ::Sleep(1);
#else #else
GHOST_TUns64 next = timerMgr->nextFireTime(); uint64_t next = timerMgr->nextFireTime();
GHOST_TInt64 maxSleep = next - getMilliSeconds(); int64_t maxSleep = next - getMilliSeconds();
if (next == GHOST_kFireTimeNever) { if (next == GHOST_kFireTimeNever) {
::WaitMessage(); ::WaitMessage();
@@ -448,7 +448,7 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
return hasEventHandled; return hasEventHandled;
} }
GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(int32_t &x, int32_t &y) const
{ {
POINT point; POINT point;
if (::GetCursorPos(&point)) { if (::GetCursorPos(&point)) {
@@ -459,7 +459,7 @@ GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(GHOST_TInt32 &x, GHOST_TInt3
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(int32_t x, int32_t y)
{ {
if (!::GetActiveWindow()) if (!::GetActiveWindow())
return GHOST_kFailure; return GHOST_kFailure;
@@ -1029,7 +1029,7 @@ void GHOST_SystemWin32::processPointerEvent(
case WM_POINTERUPDATE: case WM_POINTERUPDATE:
/* Coalesced pointer events are reverse chronological order, reorder chronologically. /* Coalesced pointer events are reverse chronological order, reorder chronologically.
* Only contiguous move events are coalesced. */ * Only contiguous move events are coalesced. */
for (GHOST_TUns32 i = pointerInfo.size(); i-- > 0;) { for (uint32_t i = pointerInfo.size(); i-- > 0;) {
system->pushEvent(new GHOST_EventCursor(pointerInfo[i].time, system->pushEvent(new GHOST_EventCursor(pointerInfo[i].time,
GHOST_kEventCursorMove, GHOST_kEventCursorMove,
window, window,
@@ -1079,7 +1079,7 @@ void GHOST_SystemWin32::processPointerEvent(
GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *window) GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *window)
{ {
GHOST_TInt32 x_screen, y_screen; int32_t x_screen, y_screen;
GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem(); GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem();
if (window->getTabletData().Active != GHOST_kTabletModeNone) { if (window->getTabletData().Active != GHOST_kTabletModeNone) {
@@ -1090,9 +1090,9 @@ GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *wind
system->getCursorPosition(x_screen, y_screen); system->getCursorPosition(x_screen, y_screen);
if (window->getCursorGrabModeIsWarp()) { if (window->getCursorGrabModeIsWarp()) {
GHOST_TInt32 x_new = x_screen; int32_t x_new = x_screen;
GHOST_TInt32 y_new = y_screen; int32_t y_new = y_screen;
GHOST_TInt32 x_accum, y_accum; int32_t x_accum, y_accum;
GHOST_Rect bounds; GHOST_Rect bounds;
/* Fallback to window bounds. */ /* Fallback to window bounds. */
@@ -1322,7 +1322,7 @@ void GHOST_SystemWin32::processMinMaxInfo(MINMAXINFO *minmax)
bool GHOST_SystemWin32::processNDOF(RAWINPUT const &raw) bool GHOST_SystemWin32::processNDOF(RAWINPUT const &raw)
{ {
bool eventSent = false; bool eventSent = false;
GHOST_TUns64 now = getMilliSeconds(); uint64_t now = getMilliSeconds();
static bool firstEvent = true; static bool firstEvent = true;
if (firstEvent) { // determine exactly which device is plugged in if (firstEvent) { // determine exactly which device is plugged in
@@ -1627,7 +1627,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
processPointerEvent(msg, window, wParam, lParam, eventHandled); processPointerEvent(msg, window, wParam, lParam, eventHandled);
break; break;
case WM_POINTERLEAVE: { case WM_POINTERLEAVE: {
GHOST_TUns32 pointerId = GET_POINTERID_WPARAM(wParam); uint32_t pointerId = GET_POINTERID_WPARAM(wParam);
POINTER_INFO pointerInfo; POINTER_INFO pointerInfo;
if (!GetPointerInfo(pointerId, &pointerInfo)) { if (!GetPointerInfo(pointerId, &pointerInfo)) {
break; break;
@@ -2002,7 +2002,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
return lResult; return lResult;
} }
GHOST_TUns8 *GHOST_SystemWin32::getClipboard(bool selection) const char *GHOST_SystemWin32::getClipboard(bool selection) const
{ {
char *temp_buff; char *temp_buff;
@@ -2026,7 +2026,7 @@ GHOST_TUns8 *GHOST_SystemWin32::getClipboard(bool selection) const
GlobalUnlock(hData); GlobalUnlock(hData);
CloseClipboard(); CloseClipboard();
return (GHOST_TUns8 *)temp_buff; return temp_buff;
} }
else if (IsClipboardFormatAvailable(CF_TEXT) && OpenClipboard(NULL)) { else if (IsClipboardFormatAvailable(CF_TEXT) && OpenClipboard(NULL)) {
char *buffer; char *buffer;
@@ -2052,14 +2052,14 @@ GHOST_TUns8 *GHOST_SystemWin32::getClipboard(bool selection) const
GlobalUnlock(hData); GlobalUnlock(hData);
CloseClipboard(); CloseClipboard();
return (GHOST_TUns8 *)temp_buff; return temp_buff;
} }
else { else {
return NULL; return NULL;
} }
} }
void GHOST_SystemWin32::putClipboard(GHOST_TInt8 *buffer, bool selection) const void GHOST_SystemWin32::putClipboard(char *buffer, bool selection) const
{ {
if (selection) { if (selection) {
return; return;

View File

@@ -69,14 +69,14 @@ class GHOST_SystemWin32 : public GHOST_System {
* system process. * system process.
* \return The number of milliseconds since the start of the system process. * \return The number of milliseconds since the start of the system process.
*/ */
GHOST_TUns64 performanceCounterToMillis(__int64 perf_ticks) const; uint64_t performanceCounterToMillis(__int64 perf_ticks) const;
/** /**
* This method converts system ticks into milliseconds since the start of the * This method converts system ticks into milliseconds since the start of the
* system process. * system process.
* \return The number of milliseconds since the start of the system process. * \return The number of milliseconds since the start of the system process.
*/ */
GHOST_TUns64 tickCountToMillis(__int64 ticks) const; uint64_t tickCountToMillis(__int64 ticks) const;
/** /**
* Returns the system time. * Returns the system time.
@@ -84,7 +84,7 @@ class GHOST_SystemWin32 : public GHOST_System {
* This overloaded method uses the high frequency timer if available. * This overloaded method uses the high frequency timer if available.
* \return The number of milliseconds. * \return The number of milliseconds.
*/ */
GHOST_TUns64 getMilliSeconds() const; uint64_t getMilliSeconds() const;
/*************************************************************************************** /***************************************************************************************
** Display/window management functionality ** Display/window management functionality
@@ -94,19 +94,19 @@ class GHOST_SystemWin32 : public GHOST_System {
* 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.
*/ */
GHOST_TUns8 getNumDisplays() const; uint8_t getNumDisplays() const;
/** /**
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
* \return The dimension of the main display. * \return The dimension of the main display.
*/ */
void getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const; void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const;
/** /**
* Returns the dimensions of all displays on this system. * Returns the dimensions of all displays on this system.
* \return The dimension of the main display. * \return The dimension of the main display.
*/ */
void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const; void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const;
/** /**
* Create a new window. * Create a new window.
@@ -126,10 +126,10 @@ class GHOST_SystemWin32 : public GHOST_System {
* \return The new window (or 0 if creation failed). * \return The new window (or 0 if creation failed).
*/ */
GHOST_IWindow *createWindow(const char *title, GHOST_IWindow *createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,
@@ -189,7 +189,7 @@ class GHOST_SystemWin32 : public GHOST_System {
* \param y: The y-coordinate of the cursor. * \param y: The y-coordinate of the cursor.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const; GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const;
/** /**
* Updates the location of the cursor (location in screen coordinates). * Updates the location of the cursor (location in screen coordinates).
@@ -197,7 +197,7 @@ class GHOST_SystemWin32 : public GHOST_System {
* \param y: The y-coordinate of the cursor. * \param y: The y-coordinate of the cursor.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y); GHOST_TSuccess setCursorPosition(int32_t x, int32_t y);
/*************************************************************************************** /***************************************************************************************
** Access to mouse button and keyboard states. ** Access to mouse button and keyboard states.
@@ -222,14 +222,14 @@ class GHOST_SystemWin32 : public GHOST_System {
* \param selection: Used by X11 only. * \param selection: Used by X11 only.
* \return Returns the Clipboard. * \return Returns the Clipboard.
*/ */
GHOST_TUns8 *getClipboard(bool selection) const; char *getClipboard(bool selection) const;
/** /**
* Puts buffer to system clipboard. * Puts buffer to system clipboard.
* \param selection: Used by X11 only. * \param selection: Used by X11 only.
* \return No return. * \return No return.
*/ */
void putClipboard(GHOST_TInt8 *buffer, bool selection) const; void putClipboard(char *buffer, bool selection) const;
/** /**
* Show a system message box * Show a system message box

View File

@@ -186,7 +186,7 @@ GHOST_SystemX11::GHOST_SystemX11() : GHOST_System(), m_xkb_descr(NULL), m_start_
} }
/* Taking care not to overflow the `tv.tv_sec * 1000`. */ /* Taking care not to overflow the `tv.tv_sec * 1000`. */
m_start_time = GHOST_TUns64(tv.tv_sec) * 1000 + tv.tv_usec / 1000; m_start_time = uint64_t(tv.tv_sec) * 1000 + tv.tv_usec / 1000;
/* Use detectable auto-repeat, mac and windows also do this. */ /* Use detectable auto-repeat, mac and windows also do this. */
int use_xkb; int use_xkb;
@@ -279,7 +279,7 @@ GHOST_TSuccess GHOST_SystemX11::init()
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TUns64 GHOST_SystemX11::getMilliSeconds() const uint64_t GHOST_SystemX11::getMilliSeconds() const
{ {
timeval tv; timeval tv;
if (gettimeofday(&tv, NULL) == -1) { if (gettimeofday(&tv, NULL) == -1) {
@@ -287,19 +287,19 @@ GHOST_TUns64 GHOST_SystemX11::getMilliSeconds() const
} }
/* Taking care not to overflow the tv.tv_sec * 1000 */ /* Taking care not to overflow the tv.tv_sec * 1000 */
return GHOST_TUns64(tv.tv_sec) * 1000 + tv.tv_usec / 1000 - m_start_time; return uint64_t(tv.tv_sec) * 1000 + tv.tv_usec / 1000 - m_start_time;
} }
GHOST_TUns8 GHOST_SystemX11::getNumDisplays() const uint8_t GHOST_SystemX11::getNumDisplays() const
{ {
return GHOST_TUns8(1); return uint8_t(1);
} }
/** /**
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
* \return The dimension of the main display. * \return The dimension of the main display.
*/ */
void GHOST_SystemX11::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void GHOST_SystemX11::getMainDisplayDimensions(uint32_t &width, uint32_t &height) const
{ {
if (m_display) { if (m_display) {
/* NOTE(campbell): for this to work as documented, /* NOTE(campbell): for this to work as documented,
@@ -313,7 +313,7 @@ void GHOST_SystemX11::getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
* \return The dimension of the main display. * \return The dimension of the main display.
*/ */
void GHOST_SystemX11::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const void GHOST_SystemX11::getAllDisplayDimensions(uint32_t &width, uint32_t &height) const
{ {
if (m_display) { if (m_display) {
width = DisplayWidth(m_display, DefaultScreen(m_display)); width = DisplayWidth(m_display, DefaultScreen(m_display));
@@ -339,10 +339,10 @@ void GHOST_SystemX11::getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32
* \return The new window (or 0 if creation failed). * \return The new window (or 0 if creation failed).
*/ */
GHOST_IWindow *GHOST_SystemX11::createWindow(const char *title, GHOST_IWindow *GHOST_SystemX11::createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,
@@ -570,7 +570,7 @@ GHOST_WindowX11 *GHOST_SystemX11::findGhostWindow(Window xwind) const
return NULL; return NULL;
} }
static void SleepTillEvent(Display *display, GHOST_TInt64 maxSleep) static void SleepTillEvent(Display *display, int64_t maxSleep)
{ {
int fd = ConnectionNumber(display); int fd = ConnectionNumber(display);
fd_set fds; fd_set fds;
@@ -649,13 +649,13 @@ bool GHOST_SystemX11::processEvents(bool waitForEvent)
GHOST_TimerManager *timerMgr = getTimerManager(); GHOST_TimerManager *timerMgr = getTimerManager();
if (waitForEvent && m_dirty_windows.empty() && !XPending(m_display)) { if (waitForEvent && m_dirty_windows.empty() && !XPending(m_display)) {
GHOST_TUns64 next = timerMgr->nextFireTime(); uint64_t next = timerMgr->nextFireTime();
if (next == GHOST_kFireTimeNever) { if (next == GHOST_kFireTimeNever) {
SleepTillEvent(m_display, -1); SleepTillEvent(m_display, -1);
} }
else { else {
GHOST_TInt64 maxSleep = next - getMilliSeconds(); int64_t maxSleep = next - getMilliSeconds();
if (maxSleep >= 0) if (maxSleep >= 0)
SleepTillEvent(m_display, next - getMilliSeconds()); SleepTillEvent(m_display, next - getMilliSeconds());
@@ -965,9 +965,9 @@ void GHOST_SystemX11::processEvent(XEvent *xe)
bool is_tablet = window->GetTabletData().Active != GHOST_kTabletModeNone; bool is_tablet = window->GetTabletData().Active != GHOST_kTabletModeNone;
if (is_tablet == false && window->getCursorGrabModeIsWarp()) { if (is_tablet == false && window->getCursorGrabModeIsWarp()) {
GHOST_TInt32 x_new = xme.x_root; int32_t x_new = xme.x_root;
GHOST_TInt32 y_new = xme.y_root; int32_t y_new = xme.y_root;
GHOST_TInt32 x_accum, y_accum; int32_t x_accum, y_accum;
GHOST_Rect bounds; GHOST_Rect bounds;
/* fallback to window bounds */ /* fallback to window bounds */
@@ -1638,8 +1638,8 @@ GHOST_TSuccess GHOST_SystemX11::getButtons(GHOST_Buttons &buttons) const
} }
static GHOST_TSuccess getCursorPosition_impl(Display *display, static GHOST_TSuccess getCursorPosition_impl(Display *display,
GHOST_TInt32 &x, int32_t &x,
GHOST_TInt32 &y, int32_t &y,
Window *child_return) Window *child_return)
{ {
int rx, ry, wx, wy; int rx, ry, wx, wy;
@@ -1664,13 +1664,13 @@ static GHOST_TSuccess getCursorPosition_impl(Display *display,
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_SystemX11::getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const GHOST_TSuccess GHOST_SystemX11::getCursorPosition(int32_t &x, int32_t &y) const
{ {
Window child_return; Window child_return;
return getCursorPosition_impl(m_display, x, y, &child_return); return getCursorPosition_impl(m_display, x, y, &child_return);
} }
GHOST_TSuccess GHOST_SystemX11::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) GHOST_TSuccess GHOST_SystemX11::setCursorPosition(int32_t x, int32_t y)
{ {
/* This is a brute force move in screen coordinates /* This is a brute force move in screen coordinates
@@ -2136,14 +2136,14 @@ void GHOST_SystemX11::getClipboard_xcout(const XEvent *evt,
return; return;
} }
GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const char *GHOST_SystemX11::getClipboard(bool selection) const
{ {
Atom sseln; Atom sseln;
Atom target = m_atom.UTF8_STRING; Atom target = m_atom.UTF8_STRING;
Window owner; Window owner;
/* from xclip.c doOut() v0.11 */ /* from xclip.c doOut() v0.11 */
unsigned char *sel_buf; char *sel_buf;
unsigned long sel_len = 0; unsigned long sel_len = 0;
XEvent evt; XEvent evt;
unsigned int context = XCLIB_XCOUT_NONE; unsigned int context = XCLIB_XCOUT_NONE;
@@ -2162,13 +2162,13 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
owner = XGetSelectionOwner(m_display, sseln); owner = XGetSelectionOwner(m_display, sseln);
if (owner == win) { if (owner == win) {
if (sseln == m_atom.CLIPBOARD) { if (sseln == m_atom.CLIPBOARD) {
sel_buf = (unsigned char *)malloc(strlen(txt_cut_buffer) + 1); sel_buf = (char *)malloc(strlen(txt_cut_buffer) + 1);
strcpy((char *)sel_buf, txt_cut_buffer); strcpy(sel_buf, txt_cut_buffer);
return sel_buf; return sel_buf;
} }
else { else {
sel_buf = (unsigned char *)malloc(strlen(txt_select_buffer) + 1); sel_buf = (char *)malloc(strlen(txt_select_buffer) + 1);
strcpy((char *)sel_buf, txt_select_buffer); strcpy(sel_buf, txt_select_buffer);
return sel_buf; return sel_buf;
} }
} }
@@ -2187,7 +2187,7 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
} }
/* fetch the selection, or part of it */ /* fetch the selection, or part of it */
getClipboard_xcout(&evt, sseln, target, &sel_buf, &sel_len, &context); getClipboard_xcout(&evt, sseln, target, (unsigned char **)&sel_buf, &sel_len, &context);
if (restore_this_event) { if (restore_this_event) {
restore_events.push_back(evt); restore_events.push_back(evt);
@@ -2228,8 +2228,8 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
if (sel_len) { if (sel_len) {
/* Only print the buffer out, and free it, if it's not empty. */ /* Only print the buffer out, and free it, if it's not empty. */
unsigned char *tmp_data = (unsigned char *)malloc(sel_len + 1); char *tmp_data = (char *)malloc(sel_len + 1);
memcpy((char *)tmp_data, (char *)sel_buf, sel_len); memcpy(tmp_data, (char *)sel_buf, sel_len);
tmp_data[sel_len] = '\0'; tmp_data[sel_len] = '\0';
if (sseln == m_atom.STRING) if (sseln == m_atom.STRING)
@@ -2242,7 +2242,7 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
return NULL; return NULL;
} }
void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const void GHOST_SystemX11::putClipboard(char *buffer, bool selection) const
{ {
Window m_window, owner; Window m_window, owner;

View File

@@ -98,25 +98,25 @@ class GHOST_SystemX11 : public GHOST_System {
* Returns the number of milliseconds since the start of the system process. * Returns the number of milliseconds since the start of the system process.
* \return The number of milliseconds. * \return The number of milliseconds.
*/ */
GHOST_TUns64 getMilliSeconds() const; uint64_t getMilliSeconds() const;
/** /**
* 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.
*/ */
GHOST_TUns8 getNumDisplays() const; uint8_t getNumDisplays() const;
/** /**
* Returns the dimensions of the main display on this system. * Returns the dimensions of the main display on this system.
* \return The dimension of the main display. * \return The dimension of the main display.
*/ */
void getMainDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const; void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const;
/** /**
* Returns the dimensions of all displays on this system. * Returns the dimensions of all displays on this system.
* \return The dimension of the main display. * \return The dimension of the main display.
*/ */
void getAllDisplayDimensions(GHOST_TUns32 &width, GHOST_TUns32 &height) const; void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const;
/** /**
* Create a new window. * Create a new window.
@@ -136,10 +136,10 @@ class GHOST_SystemX11 : public GHOST_System {
* \return The new window (or 0 if creation failed). * \return The new window (or 0 if creation failed).
*/ */
GHOST_IWindow *createWindow(const char *title, GHOST_IWindow *createWindow(const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings, GHOST_GLSettings glSettings,
@@ -168,9 +168,9 @@ class GHOST_SystemX11 : public GHOST_System {
*/ */
bool processEvents(bool waitForEvent); bool processEvents(bool waitForEvent);
GHOST_TSuccess getCursorPosition(GHOST_TInt32 &x, GHOST_TInt32 &y) const; GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const;
GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y); GHOST_TSuccess setCursorPosition(int32_t x, int32_t y);
/** /**
* Returns the state of all modifier keys. * Returns the state of all modifier keys.
@@ -222,14 +222,14 @@ class GHOST_SystemX11 : public GHOST_System {
* \param selection: Get selection, X11 only feature. * \param selection: Get selection, X11 only feature.
* \return Returns the Clipboard indicated by Flag. * \return Returns the Clipboard indicated by Flag.
*/ */
GHOST_TUns8 *getClipboard(bool selection) const; char *getClipboard(bool selection) const;
/** /**
* Puts buffer to system clipboard * Puts buffer to system clipboard
* \param buffer: The buffer to copy to the clipboard. * \param buffer: The buffer to copy to the clipboard.
* \param selection: Set the selection into the clipboard, X11 only feature. * \param selection: Set the selection into the clipboard, X11 only feature.
*/ */
void putClipboard(GHOST_TInt8 *buffer, bool selection) const; void putClipboard(char *buffer, bool selection) const;
/** /**
* Show a system message box * Show a system message box
@@ -351,7 +351,7 @@ class GHOST_SystemX11 : public GHOST_System {
std::vector<GHOST_WindowX11 *> m_dirty_windows; std::vector<GHOST_WindowX11 *> m_dirty_windows;
/** Start time at initialization. */ /** Start time at initialization. */
GHOST_TUns64 m_start_time; uint64_t m_start_time;
/** A vector of keyboard key masks. */ /** A vector of keyboard key masks. */
char m_keyboard_vector[32]; char m_keyboard_vector[32];

View File

@@ -40,9 +40,9 @@ GHOST_TimerManager::~GHOST_TimerManager()
disposeTimers(); disposeTimers();
} }
GHOST_TUns32 GHOST_TimerManager::getNumTimers() uint32_t GHOST_TimerManager::getNumTimers()
{ {
return (GHOST_TUns32)m_timers.size(); return (uint32_t)m_timers.size();
} }
bool GHOST_TimerManager::getTimerFound(GHOST_TimerTask *timer) bool GHOST_TimerManager::getTimerFound(GHOST_TimerTask *timer)
@@ -81,13 +81,13 @@ GHOST_TSuccess GHOST_TimerManager::removeTimer(GHOST_TimerTask *timer)
return success; return success;
} }
GHOST_TUns64 GHOST_TimerManager::nextFireTime() uint64_t GHOST_TimerManager::nextFireTime()
{ {
GHOST_TUns64 smallest = GHOST_kFireTimeNever; uint64_t smallest = GHOST_kFireTimeNever;
TTimerVector::iterator iter; TTimerVector::iterator iter;
for (iter = m_timers.begin(); iter != m_timers.end(); ++iter) { for (iter = m_timers.begin(); iter != m_timers.end(); ++iter) {
GHOST_TUns64 next = (*iter)->getNext(); uint64_t next = (*iter)->getNext();
if (next < smallest) if (next < smallest)
smallest = next; smallest = next;
@@ -96,7 +96,7 @@ GHOST_TUns64 GHOST_TimerManager::nextFireTime()
return smallest; return smallest;
} }
bool GHOST_TimerManager::fireTimers(GHOST_TUns64 time) bool GHOST_TimerManager::fireTimers(uint64_t time)
{ {
TTimerVector::iterator iter; TTimerVector::iterator iter;
bool anyProcessed = false; bool anyProcessed = false;
@@ -109,20 +109,20 @@ bool GHOST_TimerManager::fireTimers(GHOST_TUns64 time)
return anyProcessed; return anyProcessed;
} }
bool GHOST_TimerManager::fireTimer(GHOST_TUns64 time, GHOST_TimerTask *task) bool GHOST_TimerManager::fireTimer(uint64_t time, GHOST_TimerTask *task)
{ {
GHOST_TUns64 next = task->getNext(); uint64_t next = task->getNext();
// Check if the timer should be fired // Check if the timer should be fired
if (time > next) { if (time > next) {
// Fire the timer // Fire the timer
GHOST_TimerProcPtr timerProc = task->getTimerProc(); GHOST_TimerProcPtr timerProc = task->getTimerProc();
GHOST_TUns64 start = task->getStart(); uint64_t start = task->getStart();
timerProc(task, time - start); timerProc(task, time - start);
// Update the time at which we will fire it again // Update the time at which we will fire it again
GHOST_TUns64 interval = task->getInterval(); uint64_t interval = task->getInterval();
GHOST_TUns64 numCalls = (next - start) / interval; uint64_t numCalls = (next - start) / interval;
numCalls++; numCalls++;
next = start + numCalls * interval; next = start + numCalls * interval;
task->setNext(next); task->setNext(next);

View File

@@ -51,7 +51,7 @@ class GHOST_TimerManager {
* 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.
*/ */
GHOST_TUns32 getNumTimers(); uint32_t getNumTimers();
/** /**
* Returns whether this timer task ins in our list. * Returns whether this timer task ins in our list.
@@ -80,14 +80,14 @@ class GHOST_TimerManager {
* \return The soonest time the next timer would fire, * \return The soonest time the next timer would fire,
* or GHOST_kFireTimeNever if no timers exist. * or GHOST_kFireTimeNever if no timers exist.
*/ */
GHOST_TUns64 nextFireTime(); uint64_t nextFireTime();
/** /**
* Checks all timer tasks to see if they are expired and fires them if needed. * Checks all timer tasks to see if they are expired and fires them if needed.
* \param time: The current time. * \param time: The current time.
* \return True if any timers were fired. * \return True if any timers were fired.
*/ */
bool fireTimers(GHOST_TUns64 time); bool fireTimers(uint64_t time);
/** /**
* Checks this timer task to see if they are expired and fires them if needed. * Checks this timer task to see if they are expired and fires them if needed.
@@ -95,7 +95,7 @@ class GHOST_TimerManager {
* \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.
*/ */
bool fireTimer(GHOST_TUns64 time, GHOST_TimerTask *task); bool fireTimer(uint64_t time, GHOST_TimerTask *task);
protected: protected:
/** /**

View File

@@ -38,8 +38,8 @@ class GHOST_TimerTask : public GHOST_ITimerTask {
* \param timerProc: The callback invoked when the interval expires. * \param timerProc: The callback invoked when the interval expires.
* \param userData: The timer user data. * \param userData: The timer user data.
*/ */
GHOST_TimerTask(GHOST_TUns64 start, GHOST_TimerTask(uint64_t start,
GHOST_TUns64 interval, uint64_t interval,
GHOST_TimerProcPtr timerProc, GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData = NULL) GHOST_TUserDataPtr userData = NULL)
: m_start(start), : m_start(start),
@@ -55,7 +55,7 @@ class GHOST_TimerTask : public GHOST_ITimerTask {
* Returns the timer start time. * Returns the timer start time.
* \return The timer start time. * \return The timer start time.
*/ */
inline GHOST_TUns64 getStart() const inline uint64_t getStart() const
{ {
return m_start; return m_start;
} }
@@ -64,7 +64,7 @@ class GHOST_TimerTask : public GHOST_ITimerTask {
* Changes the timer start time. * Changes the timer start time.
* \param start: The timer start time. * \param start: The timer start time.
*/ */
void setStart(GHOST_TUns64 start) void setStart(uint64_t start)
{ {
m_start = start; m_start = start;
} }
@@ -73,7 +73,7 @@ class GHOST_TimerTask : public GHOST_ITimerTask {
* Returns the timer interval. * Returns the timer interval.
* \return The timer interval. * \return The timer interval.
*/ */
inline GHOST_TUns64 getInterval() const inline uint64_t getInterval() const
{ {
return m_interval; return m_interval;
} }
@@ -82,7 +82,7 @@ class GHOST_TimerTask : public GHOST_ITimerTask {
* Changes the timer interval. * Changes the timer interval.
* \param interval: The timer interval. * \param interval: The timer interval.
*/ */
void setInterval(GHOST_TUns64 interval) void setInterval(uint64_t interval)
{ {
m_interval = interval; m_interval = interval;
} }
@@ -91,7 +91,7 @@ class GHOST_TimerTask : public GHOST_ITimerTask {
* Returns the time the timerProc will be called. * Returns the time the timerProc will be called.
* \return The time the timerProc will be called. * \return The time the timerProc will be called.
*/ */
inline GHOST_TUns64 getNext() const inline uint64_t getNext() const
{ {
return m_next; return m_next;
} }
@@ -100,7 +100,7 @@ class GHOST_TimerTask : public GHOST_ITimerTask {
* Changes the time the timerProc will be called. * Changes the time the timerProc will be called.
* \param next: The time the timerProc will be called. * \param next: The time the timerProc will be called.
*/ */
void setNext(GHOST_TUns64 next) void setNext(uint64_t next)
{ {
m_next = next; m_next = next;
} }
@@ -145,7 +145,7 @@ class GHOST_TimerTask : public GHOST_ITimerTask {
* Returns the auxiliary storage room. * Returns the auxiliary storage room.
* \return The auxiliary storage room. * \return The auxiliary storage room.
*/ */
inline GHOST_TUns32 getAuxData() const inline uint32_t getAuxData() const
{ {
return m_auxData; return m_auxData;
} }
@@ -154,20 +154,20 @@ class GHOST_TimerTask : public GHOST_ITimerTask {
* Changes the auxiliary storage room. * Changes the auxiliary storage room.
* \param auxData: The auxiliary storage room. * \param auxData: The auxiliary storage room.
*/ */
void setAuxData(GHOST_TUns32 auxData) void setAuxData(uint32_t auxData)
{ {
m_auxData = auxData; m_auxData = auxData;
} }
protected: protected:
/** The time the timer task was started. */ /** The time the timer task was started. */
GHOST_TUns64 m_start; uint64_t m_start;
/** The interval between calls. */ /** The interval between calls. */
GHOST_TUns64 m_interval; uint64_t m_interval;
/** The time the timerProc will be called. */ /** The time the timerProc will be called. */
GHOST_TUns64 m_next; uint64_t m_next;
/** The callback invoked when the timer expires. */ /** The callback invoked when the timer expires. */
GHOST_TimerProcPtr m_timerProc; GHOST_TimerProcPtr m_timerProc;
@@ -176,5 +176,5 @@ class GHOST_TimerTask : public GHOST_ITimerTask {
GHOST_TUserDataPtr m_userData; GHOST_TUserDataPtr m_userData;
/** Auxiliary storage room. */ /** Auxiliary storage room. */
GHOST_TUns32 m_auxData; uint32_t m_auxData;
}; };

View File

@@ -31,8 +31,8 @@
#include <assert.h> #include <assert.h>
GHOST_Window::GHOST_Window(GHOST_TUns32 width, GHOST_Window::GHOST_Window(uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
const bool wantStereoVisual, const bool wantStereoVisual,
const bool /*exclusive*/) const bool /*exclusive*/)
@@ -143,7 +143,7 @@ GHOST_TSuccess GHOST_Window::setCursorVisibility(bool visible)
GHOST_TSuccess GHOST_Window::setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_TSuccess GHOST_Window::setCursorGrab(GHOST_TGrabCursorMode mode,
GHOST_TAxisFlag wrap_axis, GHOST_TAxisFlag wrap_axis,
GHOST_Rect *bounds, GHOST_Rect *bounds,
GHOST_TInt32 mouse_ungrab_xy[2]) int32_t mouse_ungrab_xy[2])
{ {
if (m_cursorGrab == mode) if (m_cursorGrab == mode)
return GHOST_kSuccess; return GHOST_kSuccess;
@@ -192,13 +192,8 @@ GHOST_TSuccess GHOST_Window::setCursorShape(GHOST_TStandardCursor cursorShape)
} }
} }
GHOST_TSuccess GHOST_Window::setCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess GHOST_Window::setCustomCursorShape(
GHOST_TUns8 *mask, uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
int sizex,
int sizey,
int hotX,
int hotY,
bool canInvertColor)
{ {
if (setWindowCustomCursorShape(bitmap, mask, sizex, sizey, hotX, hotY, canInvertColor)) { if (setWindowCustomCursorShape(bitmap, mask, sizex, sizey, hotX, hotY, canInvertColor)) {
m_cursorShape = GHOST_kStandardCursorCustom; m_cursorShape = GHOST_kStandardCursorCustom;

View File

@@ -48,8 +48,8 @@ class GHOST_Window : public GHOST_IWindow {
* \param stereoVisual: Stereo visual for quad buffered stereo. * \param stereoVisual: Stereo visual for quad buffered stereo.
* \param exclusive: Use to show the window ontop and ignore others (used full-screen). * \param exclusive: Use to show the window ontop and ignore others (used full-screen).
*/ */
GHOST_Window(GHOST_TUns32 width, GHOST_Window(uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
const bool wantStereoVisual = false, const bool wantStereoVisual = false,
const bool exclusive = false); const bool exclusive = false);
@@ -62,13 +62,13 @@ class GHOST_Window : public GHOST_IWindow {
* virtual std::string getTitle() const = 0; * virtual std::string getTitle() const = 0;
* virtual void getWindowBounds(GHOST_Rect& bounds) const = 0; * virtual void getWindowBounds(GHOST_Rect& bounds) const = 0;
* virtual void getClientBounds(GHOST_Rect& bounds) const = 0; * virtual void getClientBounds(GHOST_Rect& bounds) const = 0;
* virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width) = 0; * virtual GHOST_TSuccess setClientWidth(uint32_t width) = 0;
* virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height) = 0; * virtual GHOST_TSuccess setClientHeight(uint32_t height) = 0;
* virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) = 0; * virtual GHOST_TSuccess setClientSize(uint32_t width, uint32_t height) = 0;
* virtual void screenToClient( * virtual void screenToClient(
* GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0; * int32_t inX, int32_t inY, int32_t& outX, int32_t& outY) const = 0;
* virtual void clientToScreen( * virtual void clientToScreen(
* GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0; * int32_t inX, int32_t inY, int32_t& outX, int32_t& outY) const = 0;
* virtual GHOST_TWindowState getState() const = 0; * virtual GHOST_TWindowState getState() const = 0;
* virtual GHOST_TSuccess setState(GHOST_TWindowState state) = 0; * virtual GHOST_TSuccess setState(GHOST_TWindowState state) = 0;
* virtual GHOST_TSuccess setOrder(GHOST_TWindowOrder order) = 0; * virtual GHOST_TSuccess setOrder(GHOST_TWindowOrder order) = 0;
@@ -126,8 +126,8 @@ class GHOST_Window : public GHOST_IWindow {
* \param hotY: The Y coordinate of the cursor hot-spot. * \param hotY: The Y coordinate of the cursor hot-spot.
* \return Indication of success. * \return Indication of success.
*/ */
GHOST_TSuccess setCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess setCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,
@@ -142,9 +142,9 @@ class GHOST_Window : public GHOST_IWindow {
inline GHOST_TGrabCursorMode getCursorGrabMode() const; inline GHOST_TGrabCursorMode getCursorGrabMode() const;
inline bool getCursorGrabModeIsWarp() const; inline bool getCursorGrabModeIsWarp() const;
inline GHOST_TAxisFlag getCursorGrabAxis() const; inline GHOST_TAxisFlag getCursorGrabAxis() const;
inline void getCursorGrabInitPos(GHOST_TInt32 &x, GHOST_TInt32 &y) const; inline void getCursorGrabInitPos(int32_t &x, int32_t &y) const;
inline void getCursorGrabAccum(GHOST_TInt32 &x, GHOST_TInt32 &y) const; inline void getCursorGrabAccum(int32_t &x, int32_t &y) const;
inline void setCursorGrabAccum(GHOST_TInt32 x, GHOST_TInt32 y); inline void setCursorGrabAccum(int32_t x, int32_t y);
/** /**
* Shows or hides the cursor. * Shows or hides the cursor.
@@ -161,7 +161,7 @@ class GHOST_Window : public GHOST_IWindow {
GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode mode,
GHOST_TAxisFlag wrap_axis, GHOST_TAxisFlag wrap_axis,
GHOST_Rect *bounds, GHOST_Rect *bounds,
GHOST_TInt32 mouse_ungrab_xy[2]); int32_t mouse_ungrab_xy[2]);
/** /**
* Gets the cursor grab region, if unset the window is used. * Gets the cursor grab region, if unset the window is used.
@@ -292,14 +292,13 @@ class GHOST_Window : public GHOST_IWindow {
* Returns the recommended DPI for this window. * Returns the recommended DPI for this window.
* \return The recommended DPI for this window. * \return The recommended DPI for this window.
*/ */
virtual inline GHOST_TUns16 getDPIHint() virtual inline uint16_t getDPIHint()
{ {
return 96; return 96;
} }
#ifdef WITH_INPUT_IME #ifdef WITH_INPUT_IME
virtual void beginIME( virtual void beginIME(int32_t x, int32_t y, int32_t w, int32_t h, bool completed)
GHOST_TInt32 x, GHOST_TInt32 y, GHOST_TInt32 w, GHOST_TInt32 h, int completed)
{ {
/* do nothing temporarily if not in windows */ /* do nothing temporarily if not in windows */
} }
@@ -343,8 +342,8 @@ class GHOST_Window : public GHOST_IWindow {
* Sets the cursor shape on the window using * Sets the cursor shape on the window using
* native window system calls. * native window system calls.
*/ */
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, virtual GHOST_TSuccess setWindowCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int szx, int szx,
int szy, int szy,
int hotX, int hotX,
@@ -369,10 +368,10 @@ class GHOST_Window : public GHOST_IWindow {
GHOST_TAxisFlag m_cursorGrabAxis; GHOST_TAxisFlag m_cursorGrabAxis;
/** Initial grab location. */ /** Initial grab location. */
GHOST_TInt32 m_cursorGrabInitPos[2]; int32_t m_cursorGrabInitPos[2];
/** Accumulated offset from m_cursorGrabInitPos. */ /** Accumulated offset from m_cursorGrabInitPos. */
GHOST_TInt32 m_cursorGrabAccumPos[2]; int32_t m_cursorGrabAccumPos[2];
/** Wrap the cursor within this region. */ /** Wrap the cursor within this region. */
GHOST_Rect m_cursorGrabBounds; GHOST_Rect m_cursorGrabBounds;
@@ -396,9 +395,9 @@ class GHOST_Window : public GHOST_IWindow {
bool m_wantStereoVisual; bool m_wantStereoVisual;
/** Full-screen width */ /** Full-screen width */
GHOST_TUns32 m_fullScreenWidth; uint32_t m_fullScreenWidth;
/** Full-screen height */ /** Full-screen height */
GHOST_TUns32 m_fullScreenHeight; uint32_t m_fullScreenHeight;
/* OSX only, retina screens */ /* OSX only, retina screens */
float m_nativePixelSize; float m_nativePixelSize;
@@ -432,19 +431,19 @@ inline GHOST_TAxisFlag GHOST_Window::getCursorGrabAxis() const
return m_cursorGrabAxis; return m_cursorGrabAxis;
} }
inline void GHOST_Window::getCursorGrabInitPos(GHOST_TInt32 &x, GHOST_TInt32 &y) const inline void GHOST_Window::getCursorGrabInitPos(int32_t &x, int32_t &y) const
{ {
x = m_cursorGrabInitPos[0]; x = m_cursorGrabInitPos[0];
y = m_cursorGrabInitPos[1]; y = m_cursorGrabInitPos[1];
} }
inline void GHOST_Window::getCursorGrabAccum(GHOST_TInt32 &x, GHOST_TInt32 &y) const inline void GHOST_Window::getCursorGrabAccum(int32_t &x, int32_t &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(int32_t x, int32_t y)
{ {
m_cursorGrabAccumPos[0] = x; m_cursorGrabAccumPos[0] = x;
m_cursorGrabAccumPos[1] = y; m_cursorGrabAccumPos[1] = y;

View File

@@ -57,10 +57,10 @@ class GHOST_WindowCocoa : public GHOST_Window {
*/ */
GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa, GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 bottom, int32_t bottom,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t 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,
@@ -116,20 +116,20 @@ class GHOST_WindowCocoa : public GHOST_Window {
* 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.
*/ */
GHOST_TSuccess setClientWidth(GHOST_TUns32 width); GHOST_TSuccess setClientWidth(uint32_t 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.
*/ */
GHOST_TSuccess setClientHeight(GHOST_TUns32 height); GHOST_TSuccess setClientHeight(uint32_t 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.
*/ */
GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height); GHOST_TSuccess setClientSize(uint32_t width, uint32_t height);
/** /**
* Returns the state of the window (normal, minimized, maximized). * Returns the state of the window (normal, minimized, maximized).
@@ -151,10 +151,7 @@ class GHOST_WindowCocoa : public GHOST_Window {
* \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.
*/ */
void screenToClient(GHOST_TInt32 inX, void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
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,10 +160,7 @@ class GHOST_WindowCocoa : public GHOST_Window {
* \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.
*/ */
void clientToScreen(GHOST_TInt32 inX, void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
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
@@ -176,10 +170,7 @@ class GHOST_WindowCocoa : public GHOST_Window {
* \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.
*/ */
void clientToScreenIntern(GHOST_TInt32 inX, void clientToScreenIntern(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
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,
@@ -189,10 +180,7 @@ class GHOST_WindowCocoa : public GHOST_Window {
* \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.
*/ */
void screenToClientIntern(GHOST_TInt32 inX, void screenToClientIntern(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const;
/** /**
* Gets the screen the window is displayed in * Gets the screen the window is displayed in
@@ -299,8 +287,8 @@ class GHOST_WindowCocoa : public GHOST_Window {
* Sets the cursor shape on the window using * Sets the cursor shape on the window using
* native window system calls. * native window system calls.
*/ */
GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess setWindowCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,

View File

@@ -284,10 +284,10 @@
GHOST_WindowCocoa::GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa, GHOST_WindowCocoa::GHOST_WindowCocoa(GHOST_SystemCocoa *systemCocoa,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 bottom, int32_t bottom,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
const bool stereoVisual, const bool stereoVisual,
@@ -570,13 +570,13 @@ void GHOST_WindowCocoa::getClientBounds(GHOST_Rect &bounds) const
[pool drain]; [pool drain];
} }
GHOST_TSuccess GHOST_WindowCocoa::setClientWidth(GHOST_TUns32 width) GHOST_TSuccess GHOST_WindowCocoa::setClientWidth(uint32_t width)
{ {
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientWidth(): window invalid"); GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientWidth(): window invalid");
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
GHOST_Rect cBnds, wBnds; GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds); getClientBounds(cBnds);
if (((GHOST_TUns32)cBnds.getWidth()) != width) { if (((uint32_t)cBnds.getWidth()) != width) {
NSSize size; NSSize size;
size.width = width; size.width = width;
size.height = cBnds.getHeight(); size.height = cBnds.getHeight();
@@ -586,13 +586,13 @@ GHOST_TSuccess GHOST_WindowCocoa::setClientWidth(GHOST_TUns32 width)
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_WindowCocoa::setClientHeight(GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowCocoa::setClientHeight(uint32_t height)
{ {
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientHeight(): window invalid"); GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientHeight(): window invalid");
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
GHOST_Rect cBnds, wBnds; GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds); getClientBounds(cBnds);
if (((GHOST_TUns32)cBnds.getHeight()) != height) { if (((uint32_t)cBnds.getHeight()) != height) {
NSSize size; NSSize size;
size.width = cBnds.getWidth(); size.width = cBnds.getWidth();
size.height = height; size.height = height;
@@ -602,14 +602,13 @@ GHOST_TSuccess GHOST_WindowCocoa::setClientHeight(GHOST_TUns32 height)
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_WindowCocoa::setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowCocoa::setClientSize(uint32_t width, uint32_t height)
{ {
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientSize(): window invalid"); GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setClientSize(): window invalid");
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
GHOST_Rect cBnds, wBnds; GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds); getClientBounds(cBnds);
if ((((GHOST_TUns32)cBnds.getWidth()) != width) || if ((((uint32_t)cBnds.getWidth()) != width) || (((uint32_t)cBnds.getHeight()) != height)) {
(((GHOST_TUns32)cBnds.getHeight()) != height)) {
NSSize size; NSSize size;
size.width = width; size.width = width;
size.height = height; size.height = height;
@@ -654,10 +653,10 @@ GHOST_TWindowState GHOST_WindowCocoa::getState() const
return state; return state;
} }
void GHOST_WindowCocoa::screenToClient(GHOST_TInt32 inX, void GHOST_WindowCocoa::screenToClient(int32_t inX,
GHOST_TInt32 inY, int32_t inY,
GHOST_TInt32 &outX, int32_t &outX,
GHOST_TInt32 &outY) const int32_t &outY) const
{ {
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::screenToClient(): window invalid"); GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::screenToClient(): window invalid");
@@ -669,10 +668,10 @@ void GHOST_WindowCocoa::screenToClient(GHOST_TInt32 inX,
outY = (cBnds.getHeight() - 1) - outY; outY = (cBnds.getHeight() - 1) - outY;
} }
void GHOST_WindowCocoa::clientToScreen(GHOST_TInt32 inX, void GHOST_WindowCocoa::clientToScreen(int32_t inX,
GHOST_TInt32 inY, int32_t inY,
GHOST_TInt32 &outX, int32_t &outX,
GHOST_TInt32 &outY) const int32_t &outY) const
{ {
GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::clientToScreen(): window invalid"); GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::clientToScreen(): window invalid");
@@ -684,10 +683,10 @@ void GHOST_WindowCocoa::clientToScreen(GHOST_TInt32 inX,
clientToScreenIntern(inX, inY, outX, outY); clientToScreenIntern(inX, inY, outX, outY);
} }
void GHOST_WindowCocoa::screenToClientIntern(GHOST_TInt32 inX, void GHOST_WindowCocoa::screenToClientIntern(int32_t inX,
GHOST_TInt32 inY, int32_t inY,
GHOST_TInt32 &outX, int32_t &outX,
GHOST_TInt32 &outY) const int32_t &outY) const
{ {
NSRect screenCoord; NSRect screenCoord;
NSRect baseCoord; NSRect baseCoord;
@@ -701,10 +700,10 @@ void GHOST_WindowCocoa::screenToClientIntern(GHOST_TInt32 inX,
outY = baseCoord.origin.y; outY = baseCoord.origin.y;
} }
void GHOST_WindowCocoa::clientToScreenIntern(GHOST_TInt32 inX, void GHOST_WindowCocoa::clientToScreenIntern(int32_t inX,
GHOST_TInt32 inY, int32_t inY,
GHOST_TInt32 &outX, int32_t &outX,
GHOST_TInt32 &outY) const int32_t &outY) const
{ {
NSRect screenCoord; NSRect screenCoord;
NSRect baseCoord; NSRect baseCoord;
@@ -1127,9 +1126,9 @@ GHOST_TSuccess GHOST_WindowCocoa::hasCursorShape(GHOST_TStandardCursor shape)
return success; return success;
} }
/* Reverse the bits in a GHOST_TUns8 */ /* Reverse the bits in a uint8_t */
#if 0 #if 0
static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch) static uint8_t uns8ReverseBits(uint8_t ch)
{ {
ch= ((ch >> 1) & 0x55) | ((ch << 1) & 0xAA); ch= ((ch >> 1) & 0x55) | ((ch << 1) & 0xAA);
ch= ((ch >> 2) & 0x33) | ((ch << 2) & 0xCC); ch= ((ch >> 2) & 0x33) | ((ch << 2) & 0xCC);
@@ -1138,8 +1137,8 @@ static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
} }
#endif #endif
/** Reverse the bits in a GHOST_TUns16 */ /** Reverse the bits in a uint16_t */
static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt) static uint16_t uns16ReverseBits(uint16_t shrt)
{ {
shrt = ((shrt >> 1) & 0x5555) | ((shrt << 1) & 0xAAAA); shrt = ((shrt >> 1) & 0x5555) | ((shrt << 1) & 0xAAAA);
shrt = ((shrt >> 2) & 0x3333) | ((shrt << 2) & 0xCCCC); shrt = ((shrt >> 2) & 0x3333) | ((shrt << 2) & 0xCCCC);
@@ -1148,20 +1147,15 @@ static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
return shrt; return shrt;
} }
GHOST_TSuccess GHOST_WindowCocoa::setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess GHOST_WindowCocoa::setWindowCustomCursorShape(
GHOST_TUns8 *mask, uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
int sizex,
int sizey,
int hotX,
int hotY,
bool canInvertColor)
{ {
int y, nbUns16; int y, nbUns16;
NSPoint hotSpotPoint; NSPoint hotSpotPoint;
NSBitmapImageRep *cursorImageRep; NSBitmapImageRep *cursorImageRep;
NSImage *cursorImage; NSImage *cursorImage;
NSSize imSize; NSSize imSize;
GHOST_TUns16 *cursorBitmap; uint16_t *cursorBitmap;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -1182,7 +1176,7 @@ GHOST_TSuccess GHOST_WindowCocoa::setWindowCustomCursorShape(GHOST_TUns8 *bitmap
bytesPerRow:(sizex / 8 + (sizex % 8 > 0 ? 1 : 0)) bytesPerRow:(sizex / 8 + (sizex % 8 > 0 ? 1 : 0))
bitsPerPixel:1]; bitsPerPixel:1];
cursorBitmap = (GHOST_TUns16 *)[cursorImageRep bitmapData]; cursorBitmap = (uint16_t *)[cursorImageRep bitmapData];
nbUns16 = [cursorImageRep bytesPerPlane] / 2; nbUns16 = [cursorImageRep bytesPerPlane] / 2;
for (y = 0; y < nbUns16; y++) { for (y = 0; y < nbUns16; y++) {

View File

@@ -36,10 +36,10 @@ class GHOST_WindowNULL : public GHOST_Window {
GHOST_WindowNULL(GHOST_SystemNULL *system, GHOST_WindowNULL(GHOST_SystemNULL *system,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
const GHOST_IWindow *parentWindow, const GHOST_IWindow *parentWindow,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
@@ -66,8 +66,8 @@ class GHOST_WindowNULL : public GHOST_Window {
{ {
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess setWindowCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,
@@ -95,30 +95,24 @@ class GHOST_WindowNULL : public GHOST_Window {
void getClientBounds(GHOST_Rect &bounds) const void getClientBounds(GHOST_Rect &bounds) const
{ /* nothing */ { /* nothing */
} }
GHOST_TSuccess setClientWidth(GHOST_TUns32 width) GHOST_TSuccess setClientWidth(uint32_t width)
{ {
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TSuccess setClientHeight(GHOST_TUns32 height) GHOST_TSuccess setClientHeight(uint32_t height)
{ {
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) GHOST_TSuccess setClientSize(uint32_t width, uint32_t height)
{ {
return GHOST_kFailure; return GHOST_kFailure;
} }
void screenToClient(GHOST_TInt32 inX, void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const
{ {
outX = inX; outX = inX;
outY = inY; outY = inY;
} }
void clientToScreen(GHOST_TInt32 inX, void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const
{ {
outX = inX; outX = inX;
outY = inY; outY = inY;

View File

@@ -28,10 +28,10 @@
GHOST_WindowSDL::GHOST_WindowSDL(GHOST_SystemSDL *system, GHOST_WindowSDL::GHOST_WindowSDL(GHOST_SystemSDL *system,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
const bool stereoVisual, const bool stereoVisual,
@@ -175,7 +175,7 @@ void GHOST_WindowSDL::getClientBounds(GHOST_Rect &bounds) const
bounds.m_b = y + h; bounds.m_b = y + h;
} }
GHOST_TSuccess GHOST_WindowSDL::setClientWidth(GHOST_TUns32 width) GHOST_TSuccess GHOST_WindowSDL::setClientWidth(uint32_t width)
{ {
int height; int height;
SDL_GetWindowSize(m_sdl_win, NULL, &height); SDL_GetWindowSize(m_sdl_win, NULL, &height);
@@ -183,7 +183,7 @@ GHOST_TSuccess GHOST_WindowSDL::setClientWidth(GHOST_TUns32 width)
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_WindowSDL::setClientHeight(GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowSDL::setClientHeight(uint32_t height)
{ {
int width; int width;
SDL_GetWindowSize(m_sdl_win, &width, NULL); SDL_GetWindowSize(m_sdl_win, &width, NULL);
@@ -191,16 +191,13 @@ GHOST_TSuccess GHOST_WindowSDL::setClientHeight(GHOST_TUns32 height)
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_WindowSDL::setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowSDL::setClientSize(uint32_t width, uint32_t height)
{ {
SDL_SetWindowSize(m_sdl_win, width, height); SDL_SetWindowSize(m_sdl_win, width, height);
return GHOST_kSuccess; return GHOST_kSuccess;
} }
void GHOST_WindowSDL::screenToClient(GHOST_TInt32 inX, void GHOST_WindowSDL::screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const
{ {
/* XXXSDL_WEAK_ABS_COORDS */ /* XXXSDL_WEAK_ABS_COORDS */
int x_win, y_win; int x_win, y_win;
@@ -209,10 +206,7 @@ void GHOST_WindowSDL::screenToClient(GHOST_TInt32 inX,
outX = inX - x_win; outX = inX - x_win;
outY = inY - y_win; outY = inY - y_win;
} }
void GHOST_WindowSDL::clientToScreen(GHOST_TInt32 inX, void GHOST_WindowSDL::clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const
{ {
/* XXXSDL_WEAK_ABS_COORDS */ /* XXXSDL_WEAK_ABS_COORDS */
int x_win, y_win; int x_win, y_win;
@@ -622,13 +616,8 @@ GHOST_TSuccess GHOST_WindowSDL::hasCursorShape(GHOST_TStandardCursor shape)
return (getStandardCursorShape(shape)) ? GHOST_kSuccess : GHOST_kFailure; return (getStandardCursorShape(shape)) ? GHOST_kSuccess : GHOST_kFailure;
} }
GHOST_TSuccess GHOST_WindowSDL::setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess GHOST_WindowSDL::setWindowCustomCursorShape(
GHOST_TUns8 *mask, uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
int sizex,
int sizey,
int hotX,
int hotY,
bool canInvertColor)
{ {
if (m_sdl_custom_cursor) { if (m_sdl_custom_cursor) {
SDL_FreeCursor(m_sdl_custom_cursor); SDL_FreeCursor(m_sdl_custom_cursor);
@@ -647,7 +636,7 @@ GHOST_TSuccess GHOST_WindowSDL::setWindowCursorVisibility(bool visible)
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TUns16 GHOST_WindowSDL::getDPIHint() uint16_t GHOST_WindowSDL::getDPIHint()
{ {
int displayIndex = SDL_GetWindowDisplayIndex(m_sdl_win); int displayIndex = SDL_GetWindowDisplayIndex(m_sdl_win);
if (displayIndex < 0) { if (displayIndex < 0) {

View File

@@ -48,10 +48,10 @@ class GHOST_WindowSDL : public GHOST_Window {
public: public:
GHOST_WindowSDL(GHOST_SystemSDL *system, GHOST_WindowSDL(GHOST_SystemSDL *system,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t 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,
@@ -95,8 +95,8 @@ class GHOST_WindowSDL : public GHOST_Window {
GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape); GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape);
GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor shape); GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor shape);
GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess setWindowCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,
@@ -109,21 +109,15 @@ class GHOST_WindowSDL : public GHOST_Window {
std::string getTitle() const; std::string getTitle() const;
GHOST_TSuccess setClientWidth(GHOST_TUns32 width); GHOST_TSuccess setClientWidth(uint32_t width);
GHOST_TSuccess setClientHeight(GHOST_TUns32 height); GHOST_TSuccess setClientHeight(uint32_t height);
GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height); GHOST_TSuccess setClientSize(uint32_t width, uint32_t height);
void screenToClient(GHOST_TInt32 inX, void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const;
void clientToScreen(GHOST_TInt32 inX, void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const;
GHOST_TSuccess setState(GHOST_TWindowState state); GHOST_TSuccess setState(GHOST_TWindowState state);
@@ -146,5 +140,5 @@ class GHOST_WindowSDL : public GHOST_Window {
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TUns16 getDPIHint(); uint16_t getDPIHint();
}; };

View File

@@ -36,7 +36,7 @@ struct window_t {
wl_surface *surface; wl_surface *surface;
// outputs on which the window is currently shown on // outputs on which the window is currently shown on
std::unordered_set<const output_t *> outputs; std::unordered_set<const output_t *> outputs;
GHOST_TUns16 dpi = 0; uint16_t dpi = 0;
int scale = 1; int scale = 1;
struct xdg_surface *xdg_surface; struct xdg_surface *xdg_surface;
struct xdg_toplevel *xdg_toplevel; struct xdg_toplevel *xdg_toplevel;
@@ -205,10 +205,10 @@ GHOST_TSuccess GHOST_WindowWayland::hasCursorShape(GHOST_TStandardCursor cursorS
GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system, GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system,
const char *title, const char *title,
GHOST_TInt32 /*left*/, int32_t /*left*/,
GHOST_TInt32 /*top*/, int32_t /*top*/,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
const GHOST_IWindow *parentWindow, const GHOST_IWindow *parentWindow,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
@@ -344,13 +344,8 @@ GHOST_TSuccess GHOST_WindowWayland::setWindowCursorShape(GHOST_TStandardCursor s
return ok; return ok;
} }
GHOST_TSuccess GHOST_WindowWayland::setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess GHOST_WindowWayland::setWindowCustomCursorShape(
GHOST_TUns8 *mask, uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
int sizex,
int sizey,
int hotX,
int hotY,
bool canInvertColor)
{ {
return m_system->setCustomCursorShape(bitmap, mask, sizex, sizey, hotX, hotY, canInvertColor); return m_system->setCustomCursorShape(bitmap, mask, sizex, sizey, hotX, hotY, canInvertColor);
} }
@@ -377,35 +372,35 @@ void GHOST_WindowWayland::getClientBounds(GHOST_Rect &bounds) const
bounds.set(0, 0, w->width, w->height); bounds.set(0, 0, w->width, w->height);
} }
GHOST_TSuccess GHOST_WindowWayland::setClientWidth(GHOST_TUns32 width) GHOST_TSuccess GHOST_WindowWayland::setClientWidth(uint32_t width)
{ {
return setClientSize(width, GHOST_TUns32(w->height)); return setClientSize(width, uint32_t(w->height));
} }
GHOST_TSuccess GHOST_WindowWayland::setClientHeight(GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowWayland::setClientHeight(uint32_t height)
{ {
return setClientSize(GHOST_TUns32(w->width), height); return setClientSize(uint32_t(w->width), height);
} }
GHOST_TSuccess GHOST_WindowWayland::setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowWayland::setClientSize(uint32_t width, uint32_t height)
{ {
wl_egl_window_resize(w->egl_window, int(width), int(height), 0, 0); wl_egl_window_resize(w->egl_window, int(width), int(height), 0, 0);
return GHOST_kSuccess; return GHOST_kSuccess;
} }
void GHOST_WindowWayland::screenToClient(GHOST_TInt32 inX, void GHOST_WindowWayland::screenToClient(int32_t inX,
GHOST_TInt32 inY, int32_t inY,
GHOST_TInt32 &outX, int32_t &outX,
GHOST_TInt32 &outY) const int32_t &outY) const
{ {
outX = inX; outX = inX;
outY = inY; outY = inY;
} }
void GHOST_WindowWayland::clientToScreen(GHOST_TInt32 inX, void GHOST_WindowWayland::clientToScreen(int32_t inX,
GHOST_TInt32 inY, int32_t inY,
GHOST_TInt32 &outX, int32_t &outX,
GHOST_TInt32 &outY) const int32_t &outY) const
{ {
outX = inX; outX = inX;
outY = inY; outY = inY;
@@ -426,7 +421,7 @@ GHOST_WindowWayland::~GHOST_WindowWayland()
delete w; delete w;
} }
GHOST_TUns16 GHOST_WindowWayland::getDPIHint() uint16_t GHOST_WindowWayland::getDPIHint()
{ {
return w->dpi; return w->dpi;
} }

View File

@@ -39,10 +39,10 @@ class GHOST_WindowWayland : public GHOST_Window {
GHOST_WindowWayland(GHOST_SystemWayland *system, GHOST_WindowWayland(GHOST_SystemWayland *system,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
const GHOST_IWindow *parentWindow, const GHOST_IWindow *parentWindow,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
@@ -52,7 +52,7 @@ class GHOST_WindowWayland : public GHOST_Window {
~GHOST_WindowWayland() override; ~GHOST_WindowWayland() override;
GHOST_TUns16 getDPIHint() override; uint16_t getDPIHint() override;
GHOST_TSuccess close(); GHOST_TSuccess close();
@@ -77,8 +77,8 @@ class GHOST_WindowWayland : public GHOST_Window {
GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape) override; GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape) override;
GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess setWindowCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,
@@ -93,21 +93,15 @@ class GHOST_WindowWayland : public GHOST_Window {
void getClientBounds(GHOST_Rect &bounds) const override; void getClientBounds(GHOST_Rect &bounds) const override;
GHOST_TSuccess setClientWidth(GHOST_TUns32 width) override; GHOST_TSuccess setClientWidth(uint32_t width) override;
GHOST_TSuccess setClientHeight(GHOST_TUns32 height) override; GHOST_TSuccess setClientHeight(uint32_t height) override;
GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) override; GHOST_TSuccess setClientSize(uint32_t width, uint32_t height) override;
void screenToClient(GHOST_TInt32 inX, void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override;
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const override;
void clientToScreen(GHOST_TInt32 inX, void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override;
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const override;
GHOST_TSuccess setWindowCursorVisibility(bool visible) override; GHOST_TSuccess setWindowCursorVisibility(bool visible) override;

View File

@@ -56,10 +56,10 @@ __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system, GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
bool wantStereoVisual, bool wantStereoVisual,
@@ -354,12 +354,12 @@ void GHOST_WindowWin32::getClientBounds(GHOST_Rect &bounds) const
} }
} }
GHOST_TSuccess GHOST_WindowWin32::setClientWidth(GHOST_TUns32 width) GHOST_TSuccess GHOST_WindowWin32::setClientWidth(uint32_t width)
{ {
GHOST_TSuccess success; GHOST_TSuccess success;
GHOST_Rect cBnds, wBnds; GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds); getClientBounds(cBnds);
if (cBnds.getWidth() != (GHOST_TInt32)width) { if (cBnds.getWidth() != (int32_t)width) {
getWindowBounds(wBnds); getWindowBounds(wBnds);
int cx = wBnds.getWidth() + width - cBnds.getWidth(); int cx = wBnds.getWidth() + width - cBnds.getWidth();
int cy = wBnds.getHeight(); int cy = wBnds.getHeight();
@@ -373,12 +373,12 @@ GHOST_TSuccess GHOST_WindowWin32::setClientWidth(GHOST_TUns32 width)
return success; return success;
} }
GHOST_TSuccess GHOST_WindowWin32::setClientHeight(GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowWin32::setClientHeight(uint32_t height)
{ {
GHOST_TSuccess success; GHOST_TSuccess success;
GHOST_Rect cBnds, wBnds; GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds); getClientBounds(cBnds);
if (cBnds.getHeight() != (GHOST_TInt32)height) { if (cBnds.getHeight() != (int32_t)height) {
getWindowBounds(wBnds); getWindowBounds(wBnds);
int cx = wBnds.getWidth(); int cx = wBnds.getWidth();
int cy = wBnds.getHeight() + height - cBnds.getHeight(); int cy = wBnds.getHeight() + height - cBnds.getHeight();
@@ -392,12 +392,12 @@ GHOST_TSuccess GHOST_WindowWin32::setClientHeight(GHOST_TUns32 height)
return success; return success;
} }
GHOST_TSuccess GHOST_WindowWin32::setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowWin32::setClientSize(uint32_t width, uint32_t height)
{ {
GHOST_TSuccess success; GHOST_TSuccess success;
GHOST_Rect cBnds, wBnds; GHOST_Rect cBnds, wBnds;
getClientBounds(cBnds); getClientBounds(cBnds);
if ((cBnds.getWidth() != (GHOST_TInt32)width) || (cBnds.getHeight() != (GHOST_TInt32)height)) { if ((cBnds.getWidth() != (int32_t)width) || (cBnds.getHeight() != (int32_t)height)) {
getWindowBounds(wBnds); getWindowBounds(wBnds);
int cx = wBnds.getWidth() + width - cBnds.getWidth(); int cx = wBnds.getWidth() + width - cBnds.getWidth();
int cy = wBnds.getHeight() + height - cBnds.getHeight(); int cy = wBnds.getHeight() + height - cBnds.getHeight();
@@ -423,10 +423,10 @@ GHOST_TWindowState GHOST_WindowWin32::getState() const
return GHOST_kWindowStateNormal; return GHOST_kWindowStateNormal;
} }
void GHOST_WindowWin32::screenToClient(GHOST_TInt32 inX, void GHOST_WindowWin32::screenToClient(int32_t inX,
GHOST_TInt32 inY, int32_t inY,
GHOST_TInt32 &outX, int32_t &outX,
GHOST_TInt32 &outY) const int32_t &outY) const
{ {
POINT point = {inX, inY}; POINT point = {inX, inY};
::ScreenToClient(m_hWnd, &point); ::ScreenToClient(m_hWnd, &point);
@@ -434,10 +434,10 @@ void GHOST_WindowWin32::screenToClient(GHOST_TInt32 inX,
outY = point.y; outY = point.y;
} }
void GHOST_WindowWin32::clientToScreen(GHOST_TInt32 inX, void GHOST_WindowWin32::clientToScreen(int32_t inX,
GHOST_TInt32 inY, int32_t inY,
GHOST_TInt32 &outX, int32_t &outX,
GHOST_TInt32 &outY) const int32_t &outY) const
{ {
POINT point = {inX, inY}; POINT point = {inX, inY};
::ClientToScreen(m_hWnd, &point); ::ClientToScreen(m_hWnd, &point);
@@ -666,7 +666,7 @@ HCURSOR GHOST_WindowWin32::getStandardCursor(GHOST_TStandardCursor shape) const
// Convert GHOST cursor to Windows OEM cursor // Convert GHOST cursor to Windows OEM cursor
HANDLE cursor = NULL; HANDLE cursor = NULL;
HMODULE module = ::GetModuleHandle(0); HMODULE module = ::GetModuleHandle(0);
GHOST_TUns32 flags = LR_SHARED | LR_DEFAULTSIZE; uint32_t flags = LR_SHARED | LR_DEFAULTSIZE;
int cx = 0, cy = 0; int cx = 0, cy = 0;
switch (shape) { switch (shape) {
@@ -835,7 +835,7 @@ GHOST_TSuccess GHOST_WindowWin32::setWindowCursorGrab(GHOST_TGrabCursorMode mode
/* use to generate a mouse move event, otherwise the last event /* use to generate a mouse move event, otherwise the last event
* blender gets can be outside the screen causing menus not to show * blender gets can be outside the screen causing menus not to show
* properly unless the user moves the mouse */ * properly unless the user moves the mouse */
GHOST_TInt32 pos[2]; int32_t pos[2];
m_system->getCursorPosition(pos[0], pos[1]); m_system->getCursorPosition(pos[0], pos[1]);
m_system->setCursorPosition(pos[0], pos[1]); m_system->setCursorPosition(pos[0], pos[1]);
} }
@@ -867,10 +867,10 @@ GHOST_TSuccess GHOST_WindowWin32::hasCursorShape(GHOST_TStandardCursor cursorSha
GHOST_TSuccess GHOST_WindowWin32::getPointerInfo( GHOST_TSuccess GHOST_WindowWin32::getPointerInfo(
std::vector<GHOST_PointerInfoWin32> &outPointerInfo, WPARAM wParam, LPARAM lParam) std::vector<GHOST_PointerInfoWin32> &outPointerInfo, WPARAM wParam, LPARAM lParam)
{ {
GHOST_TInt32 pointerId = GET_POINTERID_WPARAM(wParam); int32_t pointerId = GET_POINTERID_WPARAM(wParam);
GHOST_TInt32 isPrimary = IS_POINTER_PRIMARY_WPARAM(wParam); int32_t isPrimary = IS_POINTER_PRIMARY_WPARAM(wParam);
GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)GHOST_System::getSystem(); GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)GHOST_System::getSystem();
GHOST_TUns32 outCount = 0; uint32_t outCount = 0;
if (!(GetPointerPenInfoHistory(pointerId, &outCount, NULL))) { if (!(GetPointerPenInfoHistory(pointerId, &outCount, NULL))) {
return GHOST_kFailure; return GHOST_kFailure;
@@ -883,7 +883,7 @@ GHOST_TSuccess GHOST_WindowWin32::getPointerInfo(
return GHOST_kFailure; return GHOST_kFailure;
} }
for (GHOST_TUns32 i = 0; i < outCount; i++) { for (uint32_t i = 0; i < outCount; i++) {
POINTER_INFO pointerApiInfo = pointerPenInfo[i].pointerInfo; POINTER_INFO pointerApiInfo = pointerPenInfo[i].pointerInfo;
// Obtain the basic information from the event // Obtain the basic information from the event
outPointerInfo[i].pointerId = pointerId; outPointerInfo[i].pointerId = pointerId;
@@ -964,7 +964,7 @@ void GHOST_WindowWin32::loadWintab(bool enable)
/* Focus Wintab if cursor is inside this window. This ensures Wintab is enabled when the /* Focus Wintab if cursor is inside this window. This ensures Wintab is enabled when the
* tablet is used to change the Tablet API. */ * tablet is used to change the Tablet API. */
GHOST_TInt32 x, y; int32_t x, y;
if (m_system->getCursorPosition(x, y)) { if (m_system->getCursorPosition(x, y)) {
GHOST_Rect rect; GHOST_Rect rect;
getClientBounds(rect); getClientBounds(rect);
@@ -1012,7 +1012,7 @@ GHOST_TabletData GHOST_WindowWin32::getTabletData()
} }
} }
GHOST_TUns16 GHOST_WindowWin32::getDPIHint() uint16_t GHOST_WindowWin32::getDPIHint()
{ {
if (m_user32) { if (m_user32) {
GHOST_WIN32_GetDpiForWindow fpGetDpiForWindow = (GHOST_WIN32_GetDpiForWindow)::GetProcAddress( GHOST_WIN32_GetDpiForWindow fpGetDpiForWindow = (GHOST_WIN32_GetDpiForWindow)::GetProcAddress(
@@ -1026,8 +1026,8 @@ GHOST_TUns16 GHOST_WindowWin32::getDPIHint()
return USER_DEFAULT_SCREEN_DPI; return USER_DEFAULT_SCREEN_DPI;
} }
/** Reverse the bits in a GHOST_TUns8 */ /** Reverse the bits in a uint8_t */
static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch) static uint8_t uns8ReverseBits(uint8_t ch)
{ {
ch = ((ch >> 1) & 0x55) | ((ch << 1) & 0xAA); ch = ((ch >> 1) & 0x55) | ((ch << 1) & 0xAA);
ch = ((ch >> 2) & 0x33) | ((ch << 2) & 0xCC); ch = ((ch >> 2) & 0x33) | ((ch << 2) & 0xCC);
@@ -1036,8 +1036,8 @@ static GHOST_TUns8 uns8ReverseBits(GHOST_TUns8 ch)
} }
#if 0 /* UNUSED */ #if 0 /* UNUSED */
/** Reverse the bits in a GHOST_TUns16 */ /** Reverse the bits in a uint16_t */
static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt) static uint16_t uns16ReverseBits(uint16_t shrt)
{ {
shrt = ((shrt >> 1) & 0x5555) | ((shrt << 1) & 0xAAAA); shrt = ((shrt >> 1) & 0x5555) | ((shrt << 1) & 0xAAAA);
shrt = ((shrt >> 2) & 0x3333) | ((shrt << 2) & 0xCCCC); shrt = ((shrt >> 2) & 0x3333) | ((shrt << 2) & 0xCCCC);
@@ -1047,17 +1047,12 @@ static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
} }
#endif #endif
GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(
GHOST_TUns8 *mask, uint8_t *bitmap, uint8_t *mask, int sizeX, int sizeY, int hotX, int hotY, bool canInvertColor)
int sizeX,
int sizeY,
int hotX,
int hotY,
bool canInvertColor)
{ {
GHOST_TUns32 andData[32]; uint32_t andData[32];
GHOST_TUns32 xorData[32]; uint32_t xorData[32];
GHOST_TUns32 fullBitRow, fullMaskRow; uint32_t fullBitRow, fullMaskRow;
int x, y, cols; int x, y, cols;
cols = sizeX / 8; /* Number of whole bytes per row (width of bitmap/mask). */ cols = sizeX / 8; /* Number of whole bytes per row (width of bitmap/mask). */
@@ -1115,10 +1110,9 @@ GHOST_TSuccess GHOST_WindowWin32::endProgressBar()
} }
#ifdef WITH_INPUT_IME #ifdef WITH_INPUT_IME
void GHOST_WindowWin32::beginIME( void GHOST_WindowWin32::beginIME(int32_t x, int32_t y, int32_t w, int32_t h, bool completed)
GHOST_TInt32 x, GHOST_TInt32 y, GHOST_TInt32 w, GHOST_TInt32 h, int completed)
{ {
m_imeInput.BeginIME(m_hWnd, GHOST_Rect(x, y - h, x, y), (bool)completed); m_imeInput.BeginIME(m_hWnd, GHOST_Rect(x, y - h, x, y), completed);
} }
void GHOST_WindowWin32::endIME() void GHOST_WindowWin32::endIME()

View File

@@ -47,11 +47,11 @@ typedef BOOL(API *GHOST_WIN32_AdjustWindowRectExForDpi)(
LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle, UINT dpi); LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle, UINT dpi);
struct GHOST_PointerInfoWin32 { struct GHOST_PointerInfoWin32 {
GHOST_TInt32 pointerId; int32_t pointerId;
GHOST_TInt32 isPrimary; int32_t isPrimary;
GHOST_TButtonMask buttonMask; GHOST_TButtonMask buttonMask;
POINT pixelLocation; POINT pixelLocation;
GHOST_TUns64 time; uint64_t time;
GHOST_TabletData tabletData; GHOST_TabletData tabletData;
}; };
@@ -83,10 +83,10 @@ class GHOST_WindowWin32 : public GHOST_Window {
*/ */
GHOST_WindowWin32(GHOST_SystemWin32 *system, GHOST_WindowWin32(GHOST_SystemWin32 *system,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone, GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
bool wantStereoVisual = false, bool wantStereoVisual = false,
@@ -152,20 +152,20 @@ class GHOST_WindowWin32 : public GHOST_Window {
* 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.
*/ */
GHOST_TSuccess setClientWidth(GHOST_TUns32 width); GHOST_TSuccess setClientWidth(uint32_t 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.
*/ */
GHOST_TSuccess setClientHeight(GHOST_TUns32 height); GHOST_TSuccess setClientHeight(uint32_t 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.
*/ */
GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height); GHOST_TSuccess setClientSize(uint32_t width, uint32_t height);
/** /**
* Returns the state of the window (normal, minimized, maximized). * Returns the state of the window (normal, minimized, maximized).
@@ -180,10 +180,7 @@ class GHOST_WindowWin32 : public GHOST_Window {
* \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.
*/ */
void screenToClient(GHOST_TInt32 inX, void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
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
@@ -192,10 +189,7 @@ class GHOST_WindowWin32 : public GHOST_Window {
* \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.
*/ */
void clientToScreen(GHOST_TInt32 inX, void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
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).
@@ -309,7 +303,7 @@ class GHOST_WindowWin32 : public GHOST_Window {
return GHOST_kFailure; return GHOST_kFailure;
} }
GHOST_TUns16 getDPIHint() override; uint16_t getDPIHint() override;
/** True if the mouse is either over or captured by the window. */ /** True if the mouse is either over or captured by the window. */
bool m_mousePresent; bool m_mousePresent;
@@ -323,7 +317,7 @@ class GHOST_WindowWin32 : public GHOST_Window {
return &m_imeInput; return &m_imeInput;
} }
void beginIME(GHOST_TInt32 x, GHOST_TInt32 y, GHOST_TInt32 w, GHOST_TInt32 h, int completed); void beginIME(int32_t x, int32_t y, int32_t w, int32_t h, bool completed);
void endIME(); void endIME();
#endif /* WITH_INPUT_IME */ #endif /* WITH_INPUT_IME */
@@ -359,8 +353,8 @@ class GHOST_WindowWin32 : public GHOST_Window {
* Sets the cursor shape on the window using * Sets the cursor shape on the window using
* native window system calls. * native window system calls.
*/ */
GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess setWindowCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,

View File

@@ -213,10 +213,10 @@ static XVisualInfo *x11_visualinfo_from_glx(Display *display,
GHOST_WindowX11::GHOST_WindowX11(GHOST_SystemX11 *system, GHOST_WindowX11::GHOST_WindowX11(GHOST_SystemX11 *system,
Display *display, Display *display,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_WindowX11 *parentWindow, GHOST_WindowX11 *parentWindow,
GHOST_TDrawingContextType type, GHOST_TDrawingContextType type,
@@ -622,7 +622,7 @@ void GHOST_WindowX11::getClientBounds(GHOST_Rect &bounds) const
Window root_return; Window root_return;
int x_return, y_return; int x_return, y_return;
unsigned int w_return, h_return, border_w_return, depth_return; unsigned int w_return, h_return, border_w_return, depth_return;
GHOST_TInt32 screen_x, screen_y; int32_t screen_x, screen_y;
XGetGeometry(m_display, XGetGeometry(m_display,
m_window, m_window,
@@ -642,7 +642,7 @@ void GHOST_WindowX11::getClientBounds(GHOST_Rect &bounds) const
bounds.m_b = bounds.m_t + h_return; bounds.m_b = bounds.m_t + h_return;
} }
GHOST_TSuccess GHOST_WindowX11::setClientWidth(GHOST_TUns32 width) GHOST_TSuccess GHOST_WindowX11::setClientWidth(uint32_t width)
{ {
XWindowChanges values; XWindowChanges values;
unsigned int value_mask = CWWidth; unsigned int value_mask = CWWidth;
@@ -652,7 +652,7 @@ GHOST_TSuccess GHOST_WindowX11::setClientWidth(GHOST_TUns32 width)
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_WindowX11::setClientHeight(GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowX11::setClientHeight(uint32_t height)
{ {
XWindowChanges values; XWindowChanges values;
unsigned int value_mask = CWHeight; unsigned int value_mask = CWHeight;
@@ -661,7 +661,7 @@ GHOST_TSuccess GHOST_WindowX11::setClientHeight(GHOST_TUns32 height)
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TSuccess GHOST_WindowX11::setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) GHOST_TSuccess GHOST_WindowX11::setClientSize(uint32_t width, uint32_t height)
{ {
XWindowChanges values; XWindowChanges values;
unsigned int value_mask = CWWidth | CWHeight; unsigned int value_mask = CWWidth | CWHeight;
@@ -671,10 +671,7 @@ GHOST_TSuccess GHOST_WindowX11::setClientSize(GHOST_TUns32 width, GHOST_TUns32 h
return GHOST_kSuccess; return GHOST_kSuccess;
} }
void GHOST_WindowX11::screenToClient(GHOST_TInt32 inX, void GHOST_WindowX11::screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const
{ {
/* This is correct! */ /* This is correct! */
@@ -687,10 +684,7 @@ void GHOST_WindowX11::screenToClient(GHOST_TInt32 inX,
outY = ay; outY = ay;
} }
void GHOST_WindowX11::clientToScreen(GHOST_TInt32 inX, void GHOST_WindowX11::clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const
{ {
int ax, ay; int ax, ay;
Window temp; Window temp;
@@ -1590,8 +1584,8 @@ GHOST_TSuccess GHOST_WindowX11::hasCursorShape(GHOST_TStandardCursor shape)
return getStandardCursor(shape, xcursor); return getStandardCursor(shape, xcursor);
} }
GHOST_TSuccess GHOST_WindowX11::setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess GHOST_WindowX11::setWindowCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,
@@ -1679,7 +1673,7 @@ GHOST_TSuccess GHOST_WindowX11::endFullScreen() const
return GHOST_kSuccess; return GHOST_kSuccess;
} }
GHOST_TUns16 GHOST_WindowX11::getDPIHint() uint16_t GHOST_WindowX11::getDPIHint()
{ {
/* Try to read DPI setting set using xrdb */ /* Try to read DPI setting set using xrdb */
char *resMan = XResourceManagerString(m_display); char *resMan = XResourceManagerString(m_display);

View File

@@ -68,10 +68,10 @@ class GHOST_WindowX11 : public GHOST_Window {
GHOST_WindowX11(GHOST_SystemX11 *system, GHOST_WindowX11(GHOST_SystemX11 *system,
Display *display, Display *display,
const char *title, const char *title,
GHOST_TInt32 left, int32_t left,
GHOST_TInt32 top, int32_t top,
GHOST_TUns32 width, uint32_t width,
GHOST_TUns32 height, uint32_t height,
GHOST_TWindowState state, GHOST_TWindowState state,
GHOST_WindowX11 *parentWindow, GHOST_WindowX11 *parentWindow,
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone, GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
@@ -93,21 +93,15 @@ class GHOST_WindowX11 : public GHOST_Window {
bool isDialog() const; bool isDialog() const;
GHOST_TSuccess setClientWidth(GHOST_TUns32 width); GHOST_TSuccess setClientWidth(uint32_t width);
GHOST_TSuccess setClientHeight(GHOST_TUns32 height); GHOST_TSuccess setClientHeight(uint32_t height);
GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height); GHOST_TSuccess setClientSize(uint32_t width, uint32_t height);
void screenToClient(GHOST_TInt32 inX, void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const;
void clientToScreen(GHOST_TInt32 inX, void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const;
GHOST_TInt32 inY,
GHOST_TInt32 &outX,
GHOST_TInt32 &outY) const;
GHOST_TWindowState getState() const; GHOST_TWindowState getState() const;
@@ -182,7 +176,7 @@ class GHOST_WindowX11 : public GHOST_Window {
GHOST_TSuccess setDialogHints(GHOST_WindowX11 *parentWindow); GHOST_TSuccess setDialogHints(GHOST_WindowX11 *parentWindow);
GHOST_TUns16 getDPIHint(); uint16_t getDPIHint();
protected: protected:
/** /**
@@ -216,8 +210,8 @@ class GHOST_WindowX11 : public GHOST_Window {
* Sets the cursor shape on the window using * Sets the cursor shape on the window using
* native window system calls (Arbitrary size/color). * native window system calls (Arbitrary size/color).
*/ */
GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TSuccess setWindowCustomCursorShape(uint8_t *bitmap,
GHOST_TUns8 *mask, uint8_t *mask,
int sizex, int sizex,
int sizey, int sizey,
int hotX, int hotX,

View File

@@ -56,10 +56,10 @@ typedef std::unique_ptr<std::remove_pointer_t<HMODULE>, decltype(&::FreeLibrary)
typedef std::unique_ptr<std::remove_pointer_t<HCTX>, GHOST_WIN32_WTClose> unique_hctx; typedef std::unique_ptr<std::remove_pointer_t<HCTX>, GHOST_WIN32_WTClose> unique_hctx;
struct GHOST_WintabInfoWin32 { struct GHOST_WintabInfoWin32 {
GHOST_TInt32 x, y; int32_t x, y;
GHOST_TEventType type; GHOST_TEventType type;
GHOST_TButtonMask button; GHOST_TButtonMask button;
GHOST_TUns64 time; uint64_t time;
GHOST_TabletData tabletData; GHOST_TabletData tabletData;
}; };
@@ -178,7 +178,7 @@ class GHOST_Wintab {
bool m_focused = false; bool m_focused = false;
/** Pressed button map. */ /** Pressed button map. */
GHOST_TUns8 m_buttons = 0; uint8_t m_buttons = 0;
/** Range of a coordinate space. */ /** Range of a coordinate space. */
struct Range { struct Range {

View File

@@ -329,7 +329,7 @@ void GHOST_XrAction::updateState(XrSession session,
void GHOST_XrAction::applyHapticFeedback(XrSession session, void GHOST_XrAction::applyHapticFeedback(XrSession session,
const char *action_name, const char *action_name,
const GHOST_TInt64 &duration, const int64_t &duration,
const float &frequency, const float &frequency,
const float &amplitude) const float &amplitude)
{ {

View File

@@ -91,7 +91,7 @@ class GHOST_XrAction {
const XrTime &predicted_display_time); const XrTime &predicted_display_time);
void applyHapticFeedback(XrSession session, void applyHapticFeedback(XrSession session,
const char *action_name, const char *action_name,
const GHOST_TInt64 &duration, const int64_t &duration,
const float &frequency, const float &frequency,
const float &amplitude); const float &amplitude);
void stopHapticFeedback(XrSession session, const char *action_name); void stopHapticFeedback(XrSession session, const char *action_name);

View File

@@ -772,7 +772,7 @@ bool GHOST_XrSession::syncActions(const char *action_set_name)
bool GHOST_XrSession::applyHapticAction(const char *action_set_name, bool GHOST_XrSession::applyHapticAction(const char *action_set_name,
const char *action_name, const char *action_name,
const GHOST_TInt64 &duration, const int64_t &duration,
const float &frequency, const float &frequency,
const float &amplitude) const float &amplitude)
{ {

View File

@@ -81,7 +81,7 @@ class GHOST_XrSession {
bool syncActions(const char *action_set_name = nullptr); bool syncActions(const char *action_set_name = nullptr);
bool applyHapticAction(const char *action_set_name, bool applyHapticAction(const char *action_set_name,
const char *action_name, const char *action_name,
const GHOST_TInt64 &duration, const int64_t &duration,
const float &frequency, const float &frequency,
const float &amplitude); const float &amplitude);
void stopHapticAction(const char *action_set_name, const char *action_name); void stopHapticAction(const char *action_set_name, const char *action_name);

View File

@@ -46,7 +46,7 @@
# include <GL/gl.h> # include <GL/gl.h>
#endif /* defined(WIN32) || defined(__APPLE__) */ #endif /* defined(WIN32) || defined(__APPLE__) */
static void gearsTimerProc(GHOST_TimerTaskHandle task, GHOST_TUns64 time); static void gearsTimerProc(GHOST_TimerTaskHandle task, uint64_t time);
int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData); int processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData);
static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
@@ -60,7 +60,7 @@ static GHOST_WindowHandle sFullScreenWindow = NULL;
static GHOST_TimerTaskHandle sTestTimer; static GHOST_TimerTaskHandle sTestTimer;
static GHOST_TimerTaskHandle sGearsTimer; static GHOST_TimerTaskHandle sGearsTimer;
static void testTimerProc(GHOST_TimerTaskHandle task, GHOST_TUns64 time) static void testTimerProc(GHOST_TimerTaskHandle task, uint64_t time)
{ {
printf("timer1, time=%d\n", (int)time); printf("timer1, time=%d\n", (int)time);
} }
@@ -501,7 +501,7 @@ int main(int argc, char **argv)
return 0; return 0;
} }
static void gearsTimerProc(GHOST_TimerTaskHandle hTask, GHOST_TUns64 time) static void gearsTimerProc(GHOST_TimerTaskHandle hTask, uint64_t time)
{ {
GHOST_WindowHandle hWindow = NULL; GHOST_WindowHandle hWindow = NULL;
fAngle += 2.0; fAngle += 2.0;

View File

@@ -54,7 +54,7 @@
static bool nVidiaWindows; // very dirty but hey, it's for testing only static bool nVidiaWindows; // very dirty but hey, it's for testing only
static void gearsTimerProc(GHOST_ITimerTask *task, GHOST_TUns64 time); static void gearsTimerProc(GHOST_ITimerTask *task, uint64_t time);
static class Application *fApp; static class Application *fApp;
static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
@@ -71,7 +71,7 @@ void StereoProjection(float left,
float dist, float dist,
float eye); float eye);
static void testTimerProc(GHOST_ITimerTask * /*task*/, GHOST_TUns64 time) static void testTimerProc(GHOST_ITimerTask * /*task*/, uint64_t time)
{ {
std::cout << "timer1, time=" << (int)time << "\n"; std::cout << "timer1, time=" << (int)time << "\n";
} }
@@ -731,7 +731,7 @@ int main(int /*argc*/, char ** /*argv*/)
return 0; return 0;
} }
static void gearsTimerProc(GHOST_ITimerTask *task, GHOST_TUns64 /*time*/) static void gearsTimerProc(GHOST_ITimerTask *task, uint64_t /*time*/)
{ {
fAngle += 2.0; fAngle += 2.0;
view_roty += 1.0; view_roty += 1.0;

View File

@@ -203,7 +203,7 @@ static char *keytype_to_string(GHOST_TKey key)
void event_to_buf(GHOST_EventHandle evt, char buf[128]) void event_to_buf(GHOST_EventHandle evt, char buf[128])
{ {
GHOST_TEventType type = GHOST_GetEventType(evt); GHOST_TEventType type = GHOST_GetEventType(evt);
double time = (double)((GHOST_TInt64)GHOST_GetEventTime(evt)) / 1000; double time = (double)((int64_t)GHOST_GetEventTime(evt)) / 1000;
GHOST_WindowHandle win = GHOST_GetEventWindow(evt); GHOST_WindowHandle win = GHOST_GetEventWindow(evt);
void *data = GHOST_GetEventData(evt); void *data = GHOST_GetEventData(evt);
char *pos = buf; char *pos = buf;

View File

@@ -302,12 +302,12 @@ static void mainwindow_handle(void *priv, GHOST_EventHandle evt)
/**/ /**/
static void mainwindow_timer_proc(GHOST_TimerTaskHandle task, GHOST_TUns64 time) static void mainwindow_timer_proc(GHOST_TimerTaskHandle task, uint64_t time)
{ {
MainWindow *mw = GHOST_GetTimerTaskUserData(task); MainWindow *mw = GHOST_GetTimerTaskUserData(task);
char buf[64]; char buf[64];
sprintf(buf, "timer: %6.2f", (double)((GHOST_TInt64)time) / 1000); sprintf(buf, "timer: %6.2f", (double)((int64_t)time) / 1000);
mainwindow_log(mw, buf); mainwindow_log(mw, buf);
} }
@@ -570,7 +570,7 @@ LoggerWindow *loggerwindow_new(MultiTestApp *app)
{ {
GHOST_GLSettings glSettings = {0}; GHOST_GLSettings glSettings = {0};
GHOST_SystemHandle sys = multitestapp_get_system(app); GHOST_SystemHandle sys = multitestapp_get_system(app);
GHOST_TUns32 screensize[2]; uint32_t screensize[2];
GHOST_WindowHandle win; GHOST_WindowHandle win;
GHOST_GetMainDisplayDimensions(sys, &screensize[0], &screensize[1]); GHOST_GetMainDisplayDimensions(sys, &screensize[0], &screensize[1]);
@@ -701,11 +701,11 @@ static void extrawindow_do_key(ExtraWindow *ew, GHOST_TKey key, int press)
} }
} }
static void extrawindow_spin_cursor(ExtraWindow *ew, GHOST_TUns64 time) static void extrawindow_spin_cursor(ExtraWindow *ew, uint64_t time)
{ {
GHOST_TUns8 bitmap[16][2]; uint8_t bitmap[16][2];
GHOST_TUns8 mask[16][2]; uint8_t mask[16][2];
double ftime = (double)((GHOST_TInt64)time) / 1000; double ftime = (double)((int64_t)time) / 1000;
float angle = fmod(ftime, 1.0) * 3.1415 * 2; float angle = fmod(ftime, 1.0) * 3.1415 * 2;
int i; int i;

View File

@@ -191,8 +191,7 @@ bool BKE_appdir_folder_documents(char *dir)
{ {
dir[0] = '\0'; dir[0] = '\0';
const char *documents_path = (const char *)GHOST_getUserSpecialDir( const char *documents_path = GHOST_getUserSpecialDir(GHOST_kUserSpecialDirDocuments);
GHOST_kUserSpecialDirDocuments);
/* Usual case: Ghost gave us the documents path. We're done here. */ /* Usual case: Ghost gave us the documents path. We're done here. */
if (documents_path && BLI_is_dir(documents_path)) { if (documents_path && BLI_is_dir(documents_path)) {
@@ -462,7 +461,7 @@ static bool get_path_user_ex(char *targetpath,
} }
user_path[0] = '\0'; user_path[0] = '\0';
user_base_path = (const char *)GHOST_getUserDir(version, blender_version_decimal(version)); user_base_path = GHOST_getUserDir(version, blender_version_decimal(version));
if (user_base_path) { if (user_base_path) {
BLI_strncpy(user_path, user_base_path, FILE_MAX); BLI_strncpy(user_path, user_base_path, FILE_MAX);
} }
@@ -522,7 +521,7 @@ static bool get_path_system_ex(char *targetpath,
} }
system_path[0] = '\0'; system_path[0] = '\0';
system_base_path = (const char *)GHOST_getSystemDir(version, blender_version_decimal(version)); system_base_path = GHOST_getSystemDir(version, blender_version_decimal(version));
if (system_base_path) { if (system_base_path) {
BLI_strncpy(system_path, system_base_path, FILE_MAX); BLI_strncpy(system_path, system_base_path, FILE_MAX);
} }

View File

@@ -124,14 +124,14 @@ static void window_set_custom_cursor(
wmWindow *win, const uchar mask[16][2], const uchar bitmap[16][2], int hotx, int hoty) wmWindow *win, const uchar mask[16][2], const uchar bitmap[16][2], int hotx, int hoty)
{ {
GHOST_SetCustomCursorShape( GHOST_SetCustomCursorShape(
win->ghostwin, (GHOST_TUns8 *)bitmap, (GHOST_TUns8 *)mask, 16, 16, hotx, hoty, true); win->ghostwin, (uint8_t *)bitmap, (uint8_t *)mask, 16, 16, hotx, hoty, true);
} }
static void window_set_custom_cursor_ex(wmWindow *win, BCursor *cursor) static void window_set_custom_cursor_ex(wmWindow *win, BCursor *cursor)
{ {
GHOST_SetCustomCursorShape(win->ghostwin, GHOST_SetCustomCursorShape(win->ghostwin,
(GHOST_TUns8 *)cursor->bitmap, (uint8_t *)cursor->bitmap,
(GHOST_TUns8 *)cursor->mask, (uint8_t *)cursor->mask,
16, 16,
16, 16,
cursor->hotx, cursor->hotx,

View File

@@ -1357,7 +1357,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void)
static void playanim_window_open(const char *title, int posx, int posy, int sizex, int sizey) static void playanim_window_open(const char *title, int posx, int posy, int sizex, int sizey)
{ {
GHOST_GLSettings glsettings = {0}; GHOST_GLSettings glsettings = {0};
GHOST_TUns32 scr_w, scr_h; uint32_t scr_w, scr_h;
GHOST_GetMainDisplayDimensions(g_WS.ghost_system, &scr_w, &scr_h); GHOST_GetMainDisplayDimensions(g_WS.ghost_system, &scr_w, &scr_h);
@@ -1405,7 +1405,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
{ {
struct ImBuf *ibuf = NULL; struct ImBuf *ibuf = NULL;
static char filepath[FILE_MAX]; /* abused to return dropped file path */ static char filepath[FILE_MAX]; /* abused to return dropped file path */
GHOST_TUns32 maxwinx, maxwiny; uint32_t maxwinx, maxwiny;
int i; int i;
/* This was done to disambiguate the name for use under c++. */ /* This was done to disambiguate the name for use under c++. */
int start_x = 0, start_y = 0; int start_x = 0, start_y = 0;

View File

@@ -462,7 +462,7 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win)
/* Informs GHOST of unsaved changes, to set window modified visual indicator (macOS) /* Informs GHOST of unsaved changes, to set window modified visual indicator (macOS)
* and to give hint of unsaved changes for a user warning mechanism in case of OS application * and to give hint of unsaved changes for a user warning mechanism in case of OS application
* terminate request (e.g. OS Shortcut Alt+F4, Command+Q, (...), or session end). */ * terminate request (e.g. OS Shortcut Alt+F4, Command+Q, (...), or session end). */
GHOST_SetWindowModifiedState(win->ghostwin, (GHOST_TUns8)!wm->file_saved); GHOST_SetWindowModifiedState(win->ghostwin, (bool)!wm->file_saved);
} }
} }
@@ -1722,7 +1722,7 @@ static char *wm_clipboard_text_get_ex(bool selection, int *r_len, bool firstline
return NULL; return NULL;
} }
char *buf = (char *)GHOST_getClipboard(selection); char *buf = GHOST_getClipboard(selection);
if (!buf) { if (!buf) {
*r_len = 0; *r_len = 0;
return NULL; return NULL;
@@ -1809,10 +1809,10 @@ void WM_clipboard_text_set(const char *buf, bool selection)
} }
*p2 = '\0'; *p2 = '\0';
GHOST_putClipboard((GHOST_TInt8 *)newbuf, selection); GHOST_putClipboard(newbuf, selection);
MEM_freeN(newbuf); MEM_freeN(newbuf);
#else #else
GHOST_putClipboard((GHOST_TInt8 *)buf, selection); GHOST_putClipboard(buf, selection);
#endif #endif
} }
} }