Blender V4.3
GHOST_C-api.h File Reference

GHOST C-API function and type declarations. More...

#include "GHOST_Types.h"
#include <stdbool.h>

Go to the source code of this file.

Typedefs

typedef bool(* GHOST_EventCallbackProcPtr) (GHOST_EventHandle event, GHOST_TUserDataPtr user_data)
 

Functions

GHOST_SystemHandle GHOST_CreateSystem (void)
 
GHOST_SystemHandle GHOST_CreateSystemBackground (void)
 
void GHOST_SystemInitDebug (GHOST_SystemHandle systemhandle, GHOST_Debug debug)
 
const char * GHOST_SystemBackend (void)
 
GHOST_TSuccess GHOST_DisposeSystem (GHOST_SystemHandle systemhandle)
 
void GHOST_ShowMessageBox (GHOST_SystemHandle systemhandle, const char *title, const char *message, const char *help_label, const char *continue_label, const char *link, GHOST_DialogOptions dialog_options)
 
GHOST_EventConsumerHandle GHOST_CreateEventConsumer (GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr user_data)
 
GHOST_TSuccess GHOST_DisposeEventConsumer (GHOST_EventConsumerHandle consumerhandle)
 
uint64_t GHOST_GetMilliSeconds (GHOST_SystemHandle systemhandle)
 
GHOST_TimerTaskHandle GHOST_InstallTimer (GHOST_SystemHandle systemhandle, uint64_t delay, uint64_t interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr user_data)
 
GHOST_TSuccess GHOST_RemoveTimer (GHOST_SystemHandle systemhandle, GHOST_TimerTaskHandle timertaskhandle)
 
uint8_t GHOST_GetNumDisplays (GHOST_SystemHandle systemhandle)
 
GHOST_TSuccess GHOST_GetMainDisplayDimensions (GHOST_SystemHandle systemhandle, uint32_t *r_width, uint32_t *r_height)
 
GHOST_TSuccess GHOST_GetAllDisplayDimensions (GHOST_SystemHandle systemhandle, uint32_t *r_width, uint32_t *r_height)
 
GHOST_WindowHandle GHOST_CreateWindow (GHOST_SystemHandle systemhandle, GHOST_WindowHandle parent_windowhandle, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, bool is_dialog, GHOST_GPUSettings gpuSettings)
 
GHOST_ContextHandle GHOST_CreateGPUContext (GHOST_SystemHandle systemhandle, GHOST_GPUSettings gpuSettings)
 
GHOST_TSuccess GHOST_DisposeGPUContext (GHOST_SystemHandle systemhandle, GHOST_ContextHandle contexthandle)
 
GHOST_TUserDataPtr GHOST_GetWindowUserData (GHOST_WindowHandle windowhandle)
 
void GHOST_SetWindowUserData (GHOST_WindowHandle windowhandle, GHOST_TUserDataPtr user_data)
 
bool GHOST_IsDialogWindow (GHOST_WindowHandle windowhandle)
 
GHOST_TSuccess GHOST_DisposeWindow (GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
 
bool GHOST_ValidWindow (GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
 
GHOST_WindowHandle GHOST_BeginFullScreen (GHOST_SystemHandle systemhandle, const GHOST_DisplaySetting *setting, const bool stereoVisual)
 
GHOST_TSuccess GHOST_EndFullScreen (GHOST_SystemHandle systemhandle)
 
bool GHOST_GetFullScreen (GHOST_SystemHandle systemhandle)
 
GHOST_WindowHandle GHOST_GetWindowUnderCursor (GHOST_SystemHandle systemhandle, int32_t x, int32_t y)
 
bool GHOST_ProcessEvents (GHOST_SystemHandle systemhandle, bool waitForEvent)
 
void GHOST_DispatchEvents (GHOST_SystemHandle systemhandle)
 
GHOST_TSuccess GHOST_AddEventConsumer (GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
 
GHOST_TSuccess GHOST_RemoveEventConsumer (GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
 
GHOST_TSuccess GHOST_SetProgressBar (GHOST_WindowHandle windowhandle, float progress)
 
GHOST_TSuccess GHOST_EndProgressBar (GHOST_WindowHandle windowhandle)
 
GHOST_TStandardCursor GHOST_GetCursorShape (GHOST_WindowHandle windowhandle)
 
GHOST_TSuccess GHOST_SetCursorShape (GHOST_WindowHandle windowhandle, GHOST_TStandardCursor cursorshape)
 
GHOST_TSuccess GHOST_HasCursorShape (GHOST_WindowHandle windowhandle, GHOST_TStandardCursor cursorshape)
 
GHOST_TSuccess GHOST_SetCustomCursorShape (GHOST_WindowHandle windowhandle, uint8_t *bitmap, uint8_t *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
 
GHOST_TSuccess GHOST_GetCursorBitmap (GHOST_WindowHandle windowhandle, GHOST_CursorBitmapRef *bitmap)
 
bool GHOST_GetCursorVisibility (GHOST_WindowHandle windowhandle)
 
GHOST_TSuccess GHOST_SetCursorVisibility (GHOST_WindowHandle windowhandle, bool visible)
 
GHOST_TSuccess GHOST_GetCursorPosition (const GHOST_SystemHandle systemhandle, const GHOST_WindowHandle windowhandle, int32_t *x, int32_t *y)
 
GHOST_TSuccess GHOST_SetCursorPosition (GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle, int32_t x, int32_t y)
 
void GHOST_GetCursorGrabState (GHOST_WindowHandle windowhandle, GHOST_TGrabCursorMode *r_mode, GHOST_TAxisFlag *r_axis_flag, int r_bounds[4], bool *r_use_software_cursor)
 
GHOST_TSuccess GHOST_SetCursorGrab (GHOST_WindowHandle windowhandle, GHOST_TGrabCursorMode mode, GHOST_TAxisFlag wrap_axis, const int bounds[4], const int mouse_ungrab_xy[2])
 
GHOST_TSuccess GHOST_GetModifierKeyState (GHOST_SystemHandle systemhandle, GHOST_TModifierKey mask, bool *r_is_down)
 
GHOST_TSuccess GHOST_GetButtonState (GHOST_SystemHandle systemhandle, GHOST_TButton mask, bool *r_is_down)
 
void GHOST_setAcceptDragOperation (GHOST_WindowHandle windowhandle, bool can_accept)
 
GHOST_TEventType GHOST_GetEventType (GHOST_EventHandle eventhandle)
 
uint64_t GHOST_GetEventTime (GHOST_EventHandle eventhandle)
 
GHOST_WindowHandle GHOST_GetEventWindow (GHOST_EventHandle eventhandle)
 
GHOST_TEventDataPtr GHOST_GetEventData (GHOST_EventHandle eventhandle)
 
GHOST_TimerProcPtr GHOST_GetTimerProc (GHOST_TimerTaskHandle timertaskhandle)
 
void GHOST_SetTimerProc (GHOST_TimerTaskHandle timertaskhandle, GHOST_TimerProcPtr timerProc)
 
GHOST_TUserDataPtr GHOST_GetTimerTaskUserData (GHOST_TimerTaskHandle timertaskhandle)
 
void GHOST_SetTimerTaskUserData (GHOST_TimerTaskHandle timertaskhandle, GHOST_TUserDataPtr user_data)
 
bool GHOST_GetValid (GHOST_WindowHandle windowhandle)
 
GHOST_TDrawingContextType GHOST_GetDrawingContextType (GHOST_WindowHandle windowhandle)
 
GHOST_TSuccess GHOST_SetDrawingContextType (GHOST_WindowHandle windowhandle, GHOST_TDrawingContextType type)
 
GHOST_ContextHandle GHOST_GetDrawingContext (GHOST_WindowHandle windowhandle)
 
void GHOST_SetTitle (GHOST_WindowHandle windowhandle, const char *title)
 
char * GHOST_GetTitle (GHOST_WindowHandle windowhandle)
 
GHOST_TSuccess GHOST_SetPath (GHOST_WindowHandle windowhandle, const char *filepath)
 
GHOST_RectangleHandle GHOST_GetWindowBounds (GHOST_WindowHandle windowhandle)
 
GHOST_RectangleHandle GHOST_GetClientBounds (GHOST_WindowHandle windowhandle)
 
void GHOST_DisposeRectangle (GHOST_RectangleHandle rectanglehandle)
 
GHOST_TSuccess GHOST_SetClientWidth (GHOST_WindowHandle windowhandle, uint32_t width)
 
GHOST_TSuccess GHOST_SetClientHeight (GHOST_WindowHandle windowhandle, uint32_t height)
 
GHOST_TSuccess GHOST_SetClientSize (GHOST_WindowHandle windowhandle, uint32_t width, uint32_t height)
 
void GHOST_ScreenToClient (GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
 
void GHOST_ClientToScreen (GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
 
GHOST_TWindowState GHOST_GetWindowState (GHOST_WindowHandle windowhandle)
 
GHOST_TSuccess GHOST_SetWindowState (GHOST_WindowHandle windowhandle, GHOST_TWindowState state)
 
GHOST_TSuccess GHOST_SetWindowModifiedState (GHOST_WindowHandle windowhandle, bool isUnsavedChanges)
 
GHOST_TSuccess GHOST_SetWindowOrder (GHOST_WindowHandle windowhandle, GHOST_TWindowOrder order)
 
GHOST_TSuccess GHOST_SwapWindowBuffers (GHOST_WindowHandle windowhandle)
 
GHOST_TSuccess GHOST_SetSwapInterval (GHOST_WindowHandle windowhandle, int interval)
 
GHOST_TSuccess GHOST_GetSwapInterval (GHOST_WindowHandle windowhandle, int *r_interval)
 
GHOST_TSuccess GHOST_ActivateWindowDrawingContext (GHOST_WindowHandle windowhandle)
 
GHOST_TSuccess GHOST_InvalidateWindow (GHOST_WindowHandle windowhandle)
 
GHOST_TSuccess GHOST_ActivateGPUContext (GHOST_ContextHandle contexthandle)
 
GHOST_TSuccess GHOST_ReleaseGPUContext (GHOST_ContextHandle contexthandle)
 
unsigned int GHOST_GetContextDefaultGPUFramebuffer (GHOST_ContextHandle contexthandle)
 
unsigned int GHOST_GetDefaultGPUFramebuffer (GHOST_WindowHandle windowhandle)
 
void GHOST_SetMultitouchGestures (GHOST_SystemHandle systemhandle, const bool use)
 
void GHOST_SetTabletAPI (GHOST_SystemHandle systemhandle, GHOST_TTabletAPI api)
 
GHOST_TSuccess GHOST_GetPixelAtCursor (float r_color[3])
 
int32_t GHOST_GetWidthRectangle (GHOST_RectangleHandle rectanglehandle)
 
int32_t GHOST_GetHeightRectangle (GHOST_RectangleHandle rectanglehandle)
 
void GHOST_GetRectangle (GHOST_RectangleHandle rectanglehandle, int32_t *l, int32_t *t, int32_t *r, int32_t *b)
 
void GHOST_SetRectangle (GHOST_RectangleHandle rectanglehandle, int32_t l, int32_t t, int32_t r, int32_t b)
 
GHOST_TSuccess GHOST_IsEmptyRectangle (GHOST_RectangleHandle rectanglehandle)
 
GHOST_TSuccess GHOST_IsValidRectangle (GHOST_RectangleHandle rectanglehandle)
 
void GHOST_InsetRectangle (GHOST_RectangleHandle rectanglehandle, int32_t i)
 
void GHOST_UnionRectangle (GHOST_RectangleHandle rectanglehandle, GHOST_RectangleHandle anotherrectanglehandle)
 
void GHOST_UnionPointRectangle (GHOST_RectangleHandle rectanglehandle, int32_t x, int32_t y)
 
GHOST_TSuccess GHOST_IsInsideRectangle (GHOST_RectangleHandle rectanglehandle, int32_t x, int32_t y)
 
GHOST_TVisibility GHOST_GetRectangleVisibility (GHOST_RectangleHandle rectanglehandle, GHOST_RectangleHandle anotherrectanglehandle)
 
void GHOST_SetCenterRectangle (GHOST_RectangleHandle rectanglehandle, int32_t cx, int32_t cy)
 
void GHOST_SetRectangleCenter (GHOST_RectangleHandle rectanglehandle, int32_t cx, int32_t cy, int32_t w, int32_t h)
 
GHOST_TSuccess GHOST_ClipRectangle (GHOST_RectangleHandle rectanglehandle, GHOST_RectangleHandle anotherrectanglehandle)
 
char * GHOST_getClipboard (bool selection)
 
void GHOST_putClipboard (const char *buffer, bool selection)
 
GHOST_TSuccess GHOST_hasClipboardImage (void)
 
uintGHOST_getClipboardImage (int *r_width, int *r_height)
 
GHOST_TSuccess GHOST_putClipboardImage (uint *rgba, int width, int height)
 
bool GHOST_setConsoleWindowState (GHOST_TConsoleWindowState action)
 
bool GHOST_UseNativePixels (void)
 
GHOST_TCapabilityFlag GHOST_GetCapabilities (void)
 
void GHOST_SetBacktraceHandler (GHOST_TBacktraceFn backtrace_fn)
 
void GHOST_UseWindowFocus (bool use_focus)
 
void GHOST_SetAutoFocus (bool auto_focus)
 
float GHOST_GetNativePixelSize (GHOST_WindowHandle windowhandle)
 
uint16_t GHOST_GetDPIHint (GHOST_WindowHandle windowhandle)
 
void GHOST_BeginIME (GHOST_WindowHandle windowhandle, int32_t x, int32_t y, int32_t w, int32_t h, bool complete)
 
void GHOST_EndIME (GHOST_WindowHandle windowhandle)
 

Detailed Description

GHOST C-API function and type declarations.

Definition in file GHOST_C-api.h.

Typedef Documentation

◆ GHOST_EventCallbackProcPtr

typedef bool(* GHOST_EventCallbackProcPtr) (GHOST_EventHandle event, GHOST_TUserDataPtr user_data)

Definition of a callback routine that receives events.

Parameters
eventThe event received.
user_dataThe callback's user data, supplied to GHOST_CreateSystem.

Definition at line 24 of file GHOST_C-api.h.

Function Documentation

◆ GHOST_ActivateGPUContext()

GHOST_TSuccess GHOST_ActivateGPUContext ( GHOST_ContextHandle contexthandle)
extern

Activates the drawing context of this context.

Parameters
contexthandleThe handle to the context.
Returns
A success indicator.

Definition at line 733 of file GHOST_C-api.cc.

References GHOST_IContext::activateDrawingContext(), GHOST_kFailure, and GHOST_PRINTF.

Referenced by blender::gpu::shader_builder::ShaderBuilder::init_context(), blender::gpu::GPUTest::SetUp(), and WM_system_gpu_context_activate().

◆ GHOST_ActivateWindowDrawingContext()

GHOST_TSuccess GHOST_ActivateWindowDrawingContext ( GHOST_WindowHandle windowhandle)
extern

◆ GHOST_AddEventConsumer()

GHOST_TSuccess GHOST_AddEventConsumer ( GHOST_SystemHandle systemhandle,
GHOST_EventConsumerHandle consumerhandle )
extern

Adds the given event consumer to our list.

Parameters
systemhandleThe handle to the system.
consumerhandleThe event consumer to add.
Returns
Indication of success.

Definition at line 280 of file GHOST_C-api.cc.

References GHOST_ISystem::addEventConsumer().

Referenced by main(), multitestapp_new(), wm_ghost_init(), and wm_main_playanim_intern().

◆ GHOST_BeginFullScreen()

GHOST_WindowHandle GHOST_BeginFullScreen ( GHOST_SystemHandle systemhandle,
const GHOST_DisplaySetting * setting,
const bool stereoVisual )
extern

Begins full screen mode.

Parameters
systemhandleThe handle to the system.
settingThe new setting of the display.
stereoVisualOption for stereo display.
Returns
A handle to the window displayed in full screen. This window is invalid after full screen has been ended.

Definition at line 222 of file GHOST_C-api.cc.

References GHOST_ISystem::beginFullScreen().

Referenced by processEvent().

◆ GHOST_BeginIME()

void GHOST_BeginIME ( GHOST_WindowHandle windowhandle,
int32_t x,
int32_t y,
int32_t w,
int32_t h,
bool complete )
extern

Enable IME attached to the given window, i.e. allows user-input events to be dispatched to the IME.

Parameters
windowhandleWindow handle of the caller.
xRequested x-coordinate of the rectangle.
yRequested y-coordinate of the rectangle.
wRequested width of the rectangle.
hRequested height of the rectangle.
completeWhether or not to complete the ongoing composition.
  • true: Start a new composition.
  • false: Move the IME windows to the given position without finishing it.

◆ GHOST_ClientToScreen()

void GHOST_ClientToScreen ( GHOST_WindowHandle windowhandle,
int32_t inX,
int32_t inY,
int32_t * outX,
int32_t * outY )
extern

Converts a point in client rectangle coordinates to screen coordinates.

Parameters
windowhandleThe handle to the window.
inXThe x-coordinate in the client rectangle.
inYThe y-coordinate in the client rectangle.
outXThe x-coordinate on the screen.
outYThe y-coordinate on the screen.

Definition at line 669 of file GHOST_C-api.cc.

References GHOST_IWindow::clientToScreen().

Referenced by wm_cursor_position_to_ghost_screen_coords().

◆ GHOST_ClipRectangle()

GHOST_TSuccess GHOST_ClipRectangle ( GHOST_RectangleHandle rectanglehandle,
GHOST_RectangleHandle anotherrectanglehandle )
extern

Clips a rectangle. Updates the rectangle given such that it will fit within this one. This can result in an empty rectangle.

Parameters
rectanglehandleThe handle to the rectangle.
anotherrectanglehandleThe rectangle to clip.
Returns
Whether clipping has occurred

Definition at line 883 of file GHOST_C-api.cc.

References GHOST_kFailure, GHOST_kSuccess, and result.

◆ GHOST_CreateEventConsumer()

GHOST_EventConsumerHandle GHOST_CreateEventConsumer ( GHOST_EventCallbackProcPtr eventCallback,
GHOST_TUserDataPtr user_data )
extern

Creates an event consumer object

Parameters
eventCallbackThe event callback routine.
user_dataPointer to user data returned to the callback routine.

Definition at line 75 of file GHOST_C-api.cc.

Referenced by main(), multitestapp_new(), wm_ghost_init(), and wm_main_playanim_intern().

◆ GHOST_CreateGPUContext()

GHOST_ContextHandle GHOST_CreateGPUContext ( GHOST_SystemHandle systemhandle,
GHOST_GPUSettings gpuSettings )
extern

Create a new off-screen context. Never explicitly delete the context, use #disposeContext() instead.

Parameters
systemhandleThe handle to the system.
gpuSettingsMisc GPU options.
Returns
A handle to the new context ( == nullptr if creation failed).

Definition at line 143 of file GHOST_C-api.cc.

References GHOST_ISystem::createOffscreenContext().

Referenced by blender::gpu::MTLParallelShaderCompiler::create_compile_threads(), blender::gpu::shader_builder::ShaderBuilder::init_context(), blender::gpu::GPUTest::SetUp(), and WM_system_gpu_context_create().

◆ GHOST_CreateSystem()

GHOST_SystemHandle GHOST_CreateSystem ( void )
extern

Creates the one and only system.

Returns
a handle to the system.

Definition at line 26 of file GHOST_C-api.cc.

References GHOST_ISystem::createSystem(), and GHOST_ISystem::getSystem().

Referenced by main(), multitestapp_new(), blender::gpu::GPUTest::SetUp(), wm_ghost_init(), and wm_main_playanim_intern().

◆ GHOST_CreateSystemBackground()

GHOST_SystemHandle GHOST_CreateSystemBackground ( void )
extern

◆ GHOST_CreateWindow()

GHOST_WindowHandle GHOST_CreateWindow ( GHOST_SystemHandle systemhandle,
GHOST_WindowHandle parent_windowhandle,
const char * title,
int32_t left,
int32_t top,
uint32_t width,
uint32_t height,
GHOST_TWindowState state,
bool is_dialog,
GHOST_GPUSettings gpuSettings )
extern

Create a new window. The new window is added to the list of windows managed. Never explicitly delete the window, use disposeWindow() instead.

Parameters
systemhandleThe handle to the system.
parent_windowhandleHandle of parent (or owner) window, or nullptr
titleThe name of the window. (displayed in the title bar of the window if the OS supports it).
leftThe coordinate of the left edge of the window.
topThe coordinate of the top edge of the window.
widthThe width the window.
heightThe height the window.
stateThe state of the window when opened.
is_dialogStay on top of parent window, no icon in taskbar, can't be minimized.
gpuSettingsMisc GPU options.
Returns
A handle to the new window ( == nullptr if creation failed).

Definition at line 160 of file GHOST_C-api.cc.

References GHOST_ISystem::createWindow(), and state.

Referenced by extrawindow_new(), loggerwindow_new(), main(), mainwindow_new(), playanim_window_open(), and wm_window_ghostwindow_add().

◆ GHOST_DispatchEvents()

void GHOST_DispatchEvents ( GHOST_SystemHandle systemhandle)
extern

Retrieves events from the queue and send them to the event consumers.

Parameters
systemhandleThe handle to the system.

Definition at line 273 of file GHOST_C-api.cc.

References GHOST_ISystem::dispatchEvents().

Referenced by build_pict_list_from_image_sequence(), main(), multitestapp_run(), wm_main_playanim_intern(), and wm_window_events_process().

◆ GHOST_DisposeEventConsumer()

GHOST_TSuccess GHOST_DisposeEventConsumer ( GHOST_EventConsumerHandle consumerhandle)
extern

Disposes an event consumer object

Parameters
consumerhandleHandle to the event consumer.
Returns
An indication of success.

Definition at line 81 of file GHOST_C-api.cc.

References GHOST_kSuccess.

Referenced by wm_main_playanim_intern().

◆ GHOST_DisposeGPUContext()

GHOST_TSuccess GHOST_DisposeGPUContext ( GHOST_SystemHandle systemhandle,
GHOST_ContextHandle contexthandle )
extern

Dispose of a context.

Parameters
systemhandleThe handle to the system.
contexthandleHandle to the context to be disposed.
Returns
Indication of success.

Definition at line 151 of file GHOST_C-api.cc.

References GHOST_ISystem::disposeContext().

Referenced by blender::gpu::shader_builder::ShaderBuilder::exit_context(), blender::gpu::GPUTest::TearDown(), and WM_system_gpu_context_dispose().

◆ GHOST_DisposeRectangle()

void GHOST_DisposeRectangle ( GHOST_RectangleHandle rectanglehandle)

Disposes a rectangle object.

Parameters
rectanglehandleHandle to the rectangle.

Definition at line 633 of file GHOST_C-api.cc.

Referenced by blender::gpu::GLContext::activate(), blender::gpu::GLContext::GLContext(), playanim_window_size_get(), setViewPortGL(), and wm_window_update_size_position().

◆ GHOST_DisposeSystem()

GHOST_TSuccess GHOST_DisposeSystem ( GHOST_SystemHandle systemhandle)
extern

Disposes the one and only system.

Parameters
systemhandleThe handle to the system.
Returns
An indication of success.

Definition at line 49 of file GHOST_C-api.cc.

References GHOST_ISystem::disposeSystem().

Referenced by blender::gpu::shader_builder::ShaderBuilder::exit_system(), blender::gpu::shader_builder::ShaderBuilder::init_context(), main(), multitestapp_free(), blender::gpu::GPUTest::TearDown(), wm_ghost_exit(), and wm_main_playanim_intern().

◆ GHOST_DisposeWindow()

GHOST_TSuccess GHOST_DisposeWindow ( GHOST_SystemHandle systemhandle,
GHOST_WindowHandle windowhandle )
extern

Dispose a window.

Parameters
systemhandleThe handle to the system.
windowhandleHandle to the window to be disposed.
Returns
Indication of success.

Definition at line 205 of file GHOST_C-api.cc.

References GHOST_ISystem::disposeWindow().

Referenced by extrawindow_free(), loggerwindow_free(), main(), mainwindow_free(), processEvent(), wm_ghostwindow_destroy(), and wm_main_playanim_intern().

◆ GHOST_EndFullScreen()

GHOST_TSuccess GHOST_EndFullScreen ( GHOST_SystemHandle systemhandle)
extern

Ends full screen mode.

Parameters
systemhandleThe handle to the system.
Returns
Indication of success.

Definition at line 242 of file GHOST_C-api.cc.

References GHOST_ISystem::endFullScreen().

Referenced by processEvent().

◆ GHOST_EndIME()

void GHOST_EndIME ( GHOST_WindowHandle windowhandle)
extern

Disable the IME attached to the given window, i.e. prohibits any user-input events from being dispatched to the IME.

Parameters
windowhandleThe window handle of the caller.

◆ GHOST_EndProgressBar()

GHOST_TSuccess GHOST_EndProgressBar ( GHOST_WindowHandle windowhandle)
extern

Hides the progress bar in the icon

Parameters
windowhandleThe handle to the window.

Definition at line 303 of file GHOST_C-api.cc.

References GHOST_IWindow::endProgressBar().

Referenced by WM_progress_clear().

◆ GHOST_GetAllDisplayDimensions()

GHOST_TSuccess GHOST_GetAllDisplayDimensions ( GHOST_SystemHandle systemhandle,
uint32_t * r_width,
uint32_t * r_height )
extern

Returns the dimensions of all displays combine (the current workspace). No need to worry about overlapping monitors.

Parameters
systemhandleThe handle to the system.
r_widthA pointer the width gets put in.
r_heightA pointer the height gets put in.
Returns
success.

Definition at line 132 of file GHOST_C-api.cc.

References GHOST_ISystem::getAllDisplayDimensions(), GHOST_kFailure, and GHOST_kSuccess.

Referenced by wm_get_desktopsize().

◆ GHOST_GetButtonState()

GHOST_TSuccess GHOST_GetButtonState ( GHOST_SystemHandle systemhandle,
GHOST_TButton mask,
bool * r_is_down )
extern

Returns the state of a mouse button (outside the message queue).

Parameters
systemhandleThe handle to the system.
maskThe button state to retrieve.
isDownPointer to return button state in.
Returns
Indication of success.

Definition at line 466 of file GHOST_C-api.cc.

References GHOST_ISystem::getButtonState(), and result.

◆ GHOST_GetCapabilities()

GHOST_TCapabilityFlag GHOST_GetCapabilities ( void )
extern

Return features which are supported by the GHOST back-end.

Definition at line 936 of file GHOST_C-api.cc.

References GHOST_ISystem::getCapabilities(), and GHOST_ISystem::getSystem().

Referenced by playanim_window_open(), and WM_capabilities_flag().

◆ GHOST_GetClientBounds()

GHOST_RectangleHandle GHOST_GetClientBounds ( GHOST_WindowHandle windowhandle)
extern

Returns the client rectangle dimensions. The left and top members of the rectangle are always zero.

Parameters
windowhandleThe handle to the window.
Returns
A handle to the bounding rectangle of the window.

Definition at line 622 of file GHOST_C-api.cc.

References GHOST_IWindow::getClientBounds().

Referenced by blender::gpu::GLContext::activate(), extrawindow_do_reshape(), blender::gpu::GLContext::GLContext(), loggerwindow_do_reshape(), mainwindow_do_reshape(), playanim_window_size_get(), setViewPortGL(), and wm_window_update_size_position().

◆ GHOST_getClipboard()

char * GHOST_getClipboard ( bool selection)
extern

Return the data from the clipboard

Parameters
selectionBoolean to return the selection instead, X11 only feature.
Returns
clipboard data

Definition at line 894 of file GHOST_C-api.cc.

References GHOST_ISystem::getClipboard(), and GHOST_ISystem::getSystem().

Referenced by wm_clipboard_text_get_impl().

◆ GHOST_getClipboardImage()

uint * GHOST_getClipboardImage ( int * r_width,
int * r_height )
extern

Get image data from the Clipboard

Parameters
r_widththe returned image width in pixels.
r_heightthe returned image height in pixels.
Returns
pointer uint array in RGBA byte order. Caller must free.

Definition at line 912 of file GHOST_C-api.cc.

References GHOST_ISystem::getClipboardImage(), and GHOST_ISystem::getSystem().

Referenced by WM_clipboard_image_get().

◆ GHOST_GetContextDefaultGPUFramebuffer()

unsigned int GHOST_GetContextDefaultGPUFramebuffer ( GHOST_ContextHandle contexthandle)
extern

Get the GPU frame-buffer handle that serves as a default frame-buffer.

Definition at line 750 of file GHOST_C-api.cc.

References GHOST_IContext::getDefaultFramebuffer().

◆ GHOST_GetCursorBitmap()

GHOST_TSuccess GHOST_GetCursorBitmap ( GHOST_WindowHandle windowhandle,
GHOST_CursorBitmapRef * bitmap )
extern

Definition at line 347 of file GHOST_C-api.cc.

References GHOST_IWindow::getCursorBitmap().

Referenced by wm_software_cursor_draw().

◆ GHOST_GetCursorGrabState()

void GHOST_GetCursorGrabState ( GHOST_WindowHandle windowhandle,
GHOST_TGrabCursorMode * r_mode,
GHOST_TAxisFlag * r_axis_flag,
int r_bounds[4],
bool * r_use_software_cursor )

◆ GHOST_GetCursorPosition()

GHOST_TSuccess GHOST_GetCursorPosition ( const GHOST_SystemHandle systemhandle,
const GHOST_WindowHandle windowhandle,
int32_t * x,
int32_t * y )

Returns the current location of the cursor (location in client relative coordinates)

Parameters
systemhandleThe handle to the system.
xThe x-coordinate of the cursor.
yThe y-coordinate of the cursor.
Returns
Indication of success.

Definition at line 391 of file GHOST_C-api.cc.

References GHOST_ISystem::getCursorPositionClientRelative().

Referenced by ghost_event_proc(), and wm_cursor_position_get().

◆ GHOST_GetCursorShape()

GHOST_TStandardCursor GHOST_GetCursorShape ( GHOST_WindowHandle windowhandle)
extern

Returns the current cursor shape.

Parameters
windowhandleThe handle to the window.
Returns
The current cursor shape.

Definition at line 310 of file GHOST_C-api.cc.

References GHOST_IWindow::getCursorShape().

◆ GHOST_GetCursorVisibility()

bool GHOST_GetCursorVisibility ( GHOST_WindowHandle windowhandle)
extern

Returns the visibility state of the cursor.

Parameters
windowhandleThe handle to the window.
Returns
The visibility state of the cursor.

Definition at line 355 of file GHOST_C-api.cc.

References GHOST_IWindow::getCursorVisibility().

Referenced by processEvent(), and wm_software_cursor_needed_for_window().

◆ GHOST_GetDefaultGPUFramebuffer()

unsigned int GHOST_GetDefaultGPUFramebuffer ( GHOST_WindowHandle windowhandle)
extern

Get the GPU frame-buffer handle that serves as a default frame-buffer.

Definition at line 757 of file GHOST_C-api.cc.

References GHOST_IWindow::getDefaultFramebuffer().

Referenced by blender::gpu::GLContext::GLContext().

◆ GHOST_GetDPIHint()

uint16_t GHOST_GetDPIHint ( GHOST_WindowHandle windowhandle)
extern

Returns the suggested DPI for this window.

Definition at line 968 of file GHOST_C-api.cc.

References GHOST_IWindow::getDPIHint().

Referenced by playanim_window_font_scale_from_dpi(), and WM_window_set_dpi().

◆ GHOST_GetDrawingContext()

GHOST_ContextHandle GHOST_GetDrawingContext ( GHOST_WindowHandle windowhandle)
extern

Returns the drawing context used in the this window.

Parameters
windowhandleThe handle to the window.
Returns
The window drawing context.

Definition at line 574 of file GHOST_C-api.cc.

References GHOST_IWindow::getDrawingContext().

Referenced by blender::gpu::VKBackend::context_alloc().

◆ GHOST_GetDrawingContextType()

GHOST_TDrawingContextType GHOST_GetDrawingContextType ( GHOST_WindowHandle windowhandle)
extern

Returns the type of drawing context used in this window.

Parameters
windowhandleThe handle to the window.
Returns
The current type of drawing context.

Definition at line 559 of file GHOST_C-api.cc.

References GHOST_IWindow::getDrawingContextType().

◆ GHOST_GetEventData()

GHOST_TEventDataPtr GHOST_GetEventData ( GHOST_EventHandle eventhandle)
extern

Returns the event data.

Parameters
eventhandleThe handle to the event.
Returns
The event data.

Definition at line 516 of file GHOST_C-api.cc.

References GHOST_IEvent::getData().

Referenced by event_to_buf(), extrawindow_handle(), ghost_event_proc(), ghost_event_proc(), loggerwindow_handle(), mainwindow_handle(), and processEvent().

◆ GHOST_GetEventTime()

uint64_t GHOST_GetEventTime ( GHOST_EventHandle eventhandle)
extern

Returns the time this event was generated.

Parameters
eventhandleThe handle to the event.
Returns
The event generation time.

Definition at line 502 of file GHOST_C-api.cc.

References GHOST_IEvent::getTime().

Referenced by event_to_buf(), extrawindow_handle(), ghost_event_proc(), and ghost_event_proc_timestamp_warning().

◆ GHOST_GetEventType()

GHOST_TEventType GHOST_GetEventType ( GHOST_EventHandle eventhandle)
extern

Returns the event type.

Parameters
eventhandleThe handle to the event.
Returns
The event type.

Definition at line 495 of file GHOST_C-api.cc.

References GHOST_IEvent::getType().

Referenced by event_to_buf(), extrawindow_handle(), ghost_event_proc(), ghost_event_proc(), ghost_event_proc_timestamp_warning(), loggerwindow_handle(), mainwindow_handle(), multitest_event_handler(), and processEvent().

◆ GHOST_GetEventWindow()

GHOST_WindowHandle GHOST_GetEventWindow ( GHOST_EventHandle eventhandle)
extern

Returns the window this event was generated on, or nullptr if it is a 'system' event.

Parameters
eventhandleThe handle to the event.
Returns
The generating window.

Definition at line 509 of file GHOST_C-api.cc.

References GHOST_IEvent::getWindow().

Referenced by event_to_buf(), ghost_event_proc(), multitest_event_handler(), and processEvent().

◆ GHOST_GetFullScreen()

bool GHOST_GetFullScreen ( GHOST_SystemHandle systemhandle)
extern

Returns current full screen mode status.

Parameters
systemhandleThe handle to the system.
Returns
The current status.

Definition at line 249 of file GHOST_C-api.cc.

References GHOST_ISystem::getFullScreen().

Referenced by gearsTimerProc(), and processEvent().

◆ GHOST_GetHeightRectangle()

int32_t GHOST_GetHeightRectangle ( GHOST_RectangleHandle rectanglehandle)
extern

Access to rectangle height.

Parameters
rectanglehandleThe handle to the rectangle.
Returns
height of the rectangle

Definition at line 794 of file GHOST_C-api.cc.

Referenced by blender::gpu::GLContext::activate(), extrawindow_do_reshape(), blender::gpu::GLContext::GLContext(), loggerwindow_do_reshape(), mainwindow_do_reshape(), playanim_window_size_get(), and setViewPortGL().

◆ GHOST_GetMainDisplayDimensions()

GHOST_TSuccess GHOST_GetMainDisplayDimensions ( GHOST_SystemHandle systemhandle,
uint32_t * r_width,
uint32_t * r_height )
extern

Returns the dimensions of the main display on this system.

Parameters
systemhandleThe handle to the system.
r_widthA pointer the width gets put in.
r_heightA pointer the height gets put in.
Returns
success.

Definition at line 121 of file GHOST_C-api.cc.

References GHOST_ISystem::getMainDisplayDimensions(), GHOST_kFailure, and GHOST_kSuccess.

Referenced by loggerwindow_new(), playanim_window_open(), and wm_get_screensize().

◆ GHOST_GetMilliSeconds()

uint64_t GHOST_GetMilliSeconds ( GHOST_SystemHandle systemhandle)
extern

Returns the system time. Returns the number of milliseconds since the start of the system.

Parameters
systemhandleThe handle to the system.
Returns
The number of milliseconds.

Definition at line 87 of file GHOST_C-api.cc.

References GHOST_ISystem::getMilliSeconds().

Referenced by ghost_event_proc_timestamp_warning().

◆ GHOST_GetModifierKeyState()

GHOST_TSuccess GHOST_GetModifierKeyState ( GHOST_SystemHandle systemhandle,
GHOST_TModifierKey mask,
bool * r_is_down )
extern

Returns the state of a modifier key (outside the message queue).

Parameters
systemhandleThe handle to the system.
maskThe modifier key state to retrieve.
isDownPointer to return modifier state in.
Returns
Indication of success.

Definition at line 452 of file GHOST_C-api.cc.

References GHOST_ISystem::getModifierKeyState(), and result.

Referenced by playanim_event_qual_update(), and wm_ghost_modifier_query().

◆ GHOST_GetNativePixelSize()

◆ GHOST_GetNumDisplays()

uint8_t GHOST_GetNumDisplays ( GHOST_SystemHandle systemhandle)
extern

Returns the number of displays on this system.

Parameters
systemhandleThe handle to the system.
Returns
The number of displays.

Definition at line 114 of file GHOST_C-api.cc.

References GHOST_ISystem::getNumDisplays().

◆ GHOST_GetPixelAtCursor()

GHOST_TSuccess GHOST_GetPixelAtCursor ( float r_color[3])
extern

Get the color of the pixel at the current mouse cursor location

Parameters
r_colorreturned sRGB float colors
Returns
Success value (true == successful and supported by platform)

Definition at line 783 of file GHOST_C-api.cc.

References GHOST_ISystem::getPixelAtCursor(), and GHOST_ISystem::getSystem().

Referenced by WM_desktop_cursor_sample_read().

◆ GHOST_GetRectangle()

void GHOST_GetRectangle ( GHOST_RectangleHandle rectanglehandle,
int32_t * l,
int32_t * t,
int32_t * r,
int32_t * b )
extern

Gets all members of the rectangle.

Parameters
rectanglehandleThe handle to the rectangle.
lPointer to return left coordinate in.
tPointer to return top coordinate in.
rPointer to return right coordinate in.
bPointer to return bottom coordinate in.

Definition at line 799 of file GHOST_C-api.cc.

References b, l, GHOST_Rect::m_b, GHOST_Rect::m_l, GHOST_Rect::m_r, and GHOST_Rect::m_t.

Referenced by wm_window_update_size_position().

◆ GHOST_GetRectangleVisibility()

GHOST_TVisibility GHOST_GetRectangleVisibility ( GHOST_RectangleHandle rectanglehandle,
GHOST_RectangleHandle anotherrectanglehandle )
extern

Returns whether the rectangle is inside this rectangle.

Parameters
rectanglehandleThe handle to the rectangle.
anotherrectanglehandleThe rectangle to test.
Returns
visibility (not, partially or fully visible).

Definition at line 862 of file GHOST_C-api.cc.

References GHOST_kNotVisible.

◆ GHOST_GetSwapInterval()

GHOST_TSuccess GHOST_GetSwapInterval ( GHOST_WindowHandle windowhandle,
int * r_interval )
extern

Gets the current swap interval for #swapBuffers.

Parameters
windowhandleThe handle to the window
r_intervalpointer to location to return swap interval (left untouched if there is an error)
Returns
A boolean success indicator of if swap interval was successfully read.

Definition at line 719 of file GHOST_C-api.cc.

References GHOST_IWindow::getSwapInterval().

Referenced by wm_window_get_swap_interval().

◆ GHOST_GetTimerProc()

GHOST_TimerProcPtr GHOST_GetTimerProc ( GHOST_TimerTaskHandle timertaskhandle)
extern

Returns the timer callback.

Parameters
timertaskhandleThe handle to the timer-task.
Returns
The timer callback.

Definition at line 523 of file GHOST_C-api.cc.

References GHOST_ITimerTask::getTimerProc().

◆ GHOST_GetTimerTaskUserData()

GHOST_TUserDataPtr GHOST_GetTimerTaskUserData ( GHOST_TimerTaskHandle timertaskhandle)
extern

Returns the timer user data.

Parameters
timertaskhandleThe handle to the timer-task.
Returns
The timer user data.

Definition at line 537 of file GHOST_C-api.cc.

References GHOST_ITimerTask::getUserData().

Referenced by gearsTimerProc(), and mainwindow_timer_proc().

◆ GHOST_GetTitle()

char * GHOST_GetTitle ( GHOST_WindowHandle windowhandle)
extern

Returns the title displayed in the title bar. The title must be freed with free().

Parameters
windowhandleThe handle to the window.
Returns
The title, free with free().

Definition at line 587 of file GHOST_C-api.cc.

References GHOST_IWindow::getTitle().

Referenced by event_to_buf(), and processEvent().

◆ GHOST_GetValid()

bool GHOST_GetValid ( GHOST_WindowHandle windowhandle)
extern

Returns indication as to whether the window is valid.

Parameters
windowhandleThe handle to the window.
Returns
The validity of the window.

Definition at line 552 of file GHOST_C-api.cc.

References GHOST_IWindow::getValid().

◆ GHOST_GetWidthRectangle()

int32_t GHOST_GetWidthRectangle ( GHOST_RectangleHandle rectanglehandle)
extern

Access to rectangle width.

Parameters
rectanglehandleThe handle to the rectangle.
Returns
width of the rectangle

Definition at line 789 of file GHOST_C-api.cc.

Referenced by blender::gpu::GLContext::activate(), extrawindow_do_reshape(), blender::gpu::GLContext::GLContext(), loggerwindow_do_reshape(), mainwindow_do_reshape(), playanim_window_size_get(), and setViewPortGL().

◆ GHOST_GetWindowBounds()

GHOST_RectangleHandle GHOST_GetWindowBounds ( GHOST_WindowHandle windowhandle)
extern

Returns the window rectangle dimensions. These are screen coordinates.

Parameters
windowhandleThe handle to the window.
Returns
A handle to the bounding rectangle of the window.

Definition at line 611 of file GHOST_C-api.cc.

References GHOST_IWindow::getWindowBounds().

◆ GHOST_GetWindowState()

GHOST_TWindowState GHOST_GetWindowState ( GHOST_WindowHandle windowhandle)
extern

Returns the state of the window (normal, minimized, maximized).

Parameters
windowhandleThe handle to the window.
Returns
The state of the window.

Definition at line 677 of file GHOST_C-api.cc.

References GHOST_IWindow::getState().

Referenced by ghost_event_proc(), wm_draw_update(), WM_stereo3d_enabled(), wm_window_fullscreen_toggle_exec(), wm_window_ghostwindow_add(), and wm_window_raise().

◆ GHOST_GetWindowUnderCursor()

GHOST_WindowHandle GHOST_GetWindowUnderCursor ( GHOST_SystemHandle systemhandle,
int32_t x,
int32_t y )
extern

Get the Window under the cursor. Although coordinates of the mouse are supplied, platform- specific implementations are free to ignore these and query the mouse location themselves, due to them possibly being incorrect under certain conditions, for example when using multiple monitors that vary in scale and/or DPI.

Parameters
xThe x-coordinate of the cursor.
yThe y-coordinate of the cursor.
Returns
The window under the cursor or nullptr in none.

Definition at line 256 of file GHOST_C-api.cc.

References GHOST_ISystem::getWindowUnderCursor().

Referenced by WM_window_find_under_cursor().

◆ GHOST_GetWindowUserData()

GHOST_TUserDataPtr GHOST_GetWindowUserData ( GHOST_WindowHandle windowhandle)
extern

Returns the window user data.

Parameters
windowhandleThe handle to the window.
Returns
The window user data.

Definition at line 185 of file GHOST_C-api.cc.

References GHOST_IWindow::getUserData().

Referenced by extrawindow_free(), ghost_event_proc(), loggerwindow_free(), mainwindow_free(), multitest_event_handler(), and WM_window_find_under_cursor().

◆ GHOST_hasClipboardImage()

GHOST_TSuccess GHOST_hasClipboardImage ( void )
extern

Returns GHOST_kSuccess if the clipboard contains an image.

Definition at line 906 of file GHOST_C-api.cc.

References GHOST_ISystem::getSystem(), and GHOST_ISystem::hasClipboardImage().

Referenced by WM_clipboard_image_available().

◆ GHOST_HasCursorShape()

GHOST_TSuccess GHOST_HasCursorShape ( GHOST_WindowHandle windowhandle,
GHOST_TStandardCursor cursorshape )
extern

Test if the standard cursor shape is supported by current platform.

Returns
Indication of success.

Definition at line 325 of file GHOST_C-api.cc.

References GHOST_IWindow::hasCursorShape().

Referenced by WM_cursor_set().

◆ GHOST_InsetRectangle()

void GHOST_InsetRectangle ( GHOST_RectangleHandle rectanglehandle,
int32_t i )
extern

Grows (or shrinks the rectangle). The method avoids negative insets making the rectangle invalid

Parameters
rectanglehandleThe handle to the rectangle.
iThe amount of offset given to each extreme (negative values shrink the rectangle).

Definition at line 836 of file GHOST_C-api.cc.

◆ GHOST_InstallTimer()

GHOST_TimerTaskHandle GHOST_InstallTimer ( GHOST_SystemHandle systemhandle,
uint64_t delay,
uint64_t interval,
GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr user_data )
extern

Installs a timer. Note that, on most operating systems, messages need to be processed in order for the timer callbacks to be invoked.

Parameters
systemhandleThe handle to the system.
delayThe time to wait for the first call to the timerProc (in milliseconds).
intervalThe interval between calls to the timerProc (in milliseconds).
timerProcThe callback invoked when the interval expires.
userDataPlaceholder for user data.
Returns
A timer task (0 if timer task installation failed).

Definition at line 94 of file GHOST_C-api.cc.

References GHOST_ISystem::installTimer().

Referenced by main(), mainwindow_new(), and processEvent().

◆ GHOST_InvalidateWindow()

GHOST_TSuccess GHOST_InvalidateWindow ( GHOST_WindowHandle windowhandle)
extern

Invalidates the contents of this window.

Parameters
windowhandleThe handle to the window.
Returns
Indication of success.

Definition at line 764 of file GHOST_C-api.cc.

References GHOST_IWindow::invalidate().

Referenced by gearsTimerProc(), loggerwindow_do_button(), loggerwindow_do_move(), loggerwindow_log(), mainwindow_do_button(), mainwindow_do_key(), and mainwindow_do_move().

◆ GHOST_IsDialogWindow()

bool GHOST_IsDialogWindow ( GHOST_WindowHandle windowhandle)
extern

Definition at line 198 of file GHOST_C-api.cc.

References GHOST_IWindow::isDialog().

Referenced by wm_window_copy().

◆ GHOST_IsEmptyRectangle()

GHOST_TSuccess GHOST_IsEmptyRectangle ( GHOST_RectangleHandle rectanglehandle)
extern

Returns whether this rectangle is empty. Empty rectangles are rectangles that have width==0 and/or height==0.

Parameters
rectanglehandleThe handle to the rectangle.
Returns
Success value (true == empty rectangle)

Definition at line 816 of file GHOST_C-api.cc.

References GHOST_kFailure, GHOST_kSuccess, and result.

◆ GHOST_IsInsideRectangle()

GHOST_TSuccess GHOST_IsInsideRectangle ( GHOST_RectangleHandle rectanglehandle,
int32_t x,
int32_t y )
extern

Returns whether the point is inside this rectangle. Point on the boundary is considered inside.

Parameters
rectanglehandleThe handle to the rectangle.
xx-coordinate of point to test.
yy-coordinate of point to test.
Returns
Success value (true if point is inside).

Definition at line 852 of file GHOST_C-api.cc.

References GHOST_kFailure, GHOST_kSuccess, isInside(), and result.

◆ GHOST_IsValidRectangle()

GHOST_TSuccess GHOST_IsValidRectangle ( GHOST_RectangleHandle rectanglehandle)
extern

Returns whether this rectangle is valid. Valid rectangles are rectangles that have m_l <= m_r and m_t <= m_b. Thus, empty rectangles are valid.

Parameters
rectanglehandleThe handle to the rectangle.
Returns
Success value (true == valid rectangle)

Definition at line 826 of file GHOST_C-api.cc.

References GHOST_kFailure, GHOST_kSuccess, and result.

◆ GHOST_ProcessEvents()

bool GHOST_ProcessEvents ( GHOST_SystemHandle systemhandle,
bool waitForEvent )
extern

Retrieves events from the system and stores them in the queue.

Parameters
systemhandleThe handle to the system.
waitForEventBoolean to indicate that #ProcessEvents should. wait (block) until the next event before returning.
Returns
Indication of the presence of events.

Definition at line 266 of file GHOST_C-api.cc.

References GHOST_ISystem::processEvents().

Referenced by build_pict_list_from_image_sequence(), main(), multitestapp_run(), wm_main_playanim_intern(), and wm_window_events_process().

◆ GHOST_putClipboard()

void GHOST_putClipboard ( const char * buffer,
bool selection )
extern

Put data to the Clipboard

Parameters
bufferthe string buffer to set.
selectionSet the selection instead, X11 only feature.

Definition at line 900 of file GHOST_C-api.cc.

References GHOST_ISystem::getSystem(), and GHOST_ISystem::putClipboard().

Referenced by wm_clipboard_text_set_impl().

◆ GHOST_putClipboardImage()

GHOST_TSuccess GHOST_putClipboardImage ( uint * rgba,
int width,
int height )
extern

Put image data to the Clipboard

Parameters
rgbauint array in RGBA byte order.
widththe image width in pixels.
heightthe image height in pixels.

Definition at line 918 of file GHOST_C-api.cc.

References GHOST_ISystem::getSystem(), and GHOST_ISystem::putClipboardImage().

Referenced by WM_clipboard_image_set().

◆ GHOST_ReleaseGPUContext()

GHOST_TSuccess GHOST_ReleaseGPUContext ( GHOST_ContextHandle contexthandle)
extern

Release the drawing context bound to this thread.

Parameters
contexthandleThe handle to the context.
Returns
A success indicator.

Definition at line 743 of file GHOST_C-api.cc.

References GHOST_IContext::releaseDrawingContext().

Referenced by WM_system_gpu_context_release().

◆ GHOST_RemoveEventConsumer()

GHOST_TSuccess GHOST_RemoveEventConsumer ( GHOST_SystemHandle systemhandle,
GHOST_EventConsumerHandle consumerhandle )
extern

Remove the given event consumer to our list.

Parameters
systemhandleThe handle to the system.
consumerhandleThe event consumer to remove.
Returns
Indication of success.

Definition at line 288 of file GHOST_C-api.cc.

References GHOST_ISystem::removeEventConsumer().

Referenced by wm_main_playanim_intern().

◆ GHOST_RemoveTimer()

GHOST_TSuccess GHOST_RemoveTimer ( GHOST_SystemHandle systemhandle,
GHOST_TimerTaskHandle timertaskhandle )
extern

Removes a timer.

Parameters
systemhandleThe handle to the system.
timertaskhandleTimer task to be removed.
Returns
Indication of success.

Definition at line 105 of file GHOST_C-api.cc.

References GHOST_ISystem::removeTimer().

Referenced by processEvent().

◆ GHOST_ScreenToClient()

void GHOST_ScreenToClient ( GHOST_WindowHandle windowhandle,
int32_t inX,
int32_t inY,
int32_t * outX,
int32_t * outY )
extern

Converts a point in screen coordinates to client rectangle coordinates

Parameters
windowhandleThe handle to the window.
inXThe x-coordinate on the screen.
inYThe y-coordinate on the screen.
outXThe x-coordinate in the client rectangle.
outYThe y-coordinate in the client rectangle.

Definition at line 661 of file GHOST_C-api.cc.

References GHOST_IWindow::screenToClient().

Referenced by ghost_event_proc(), loggerwindow_handle(), mainwindow_handle(), and wm_cursor_position_from_ghost_screen_coords().

◆ GHOST_setAcceptDragOperation()

void GHOST_setAcceptDragOperation ( GHOST_WindowHandle windowhandle,
bool can_accept )
extern

Tells if the ongoing drag & drop object can be accepted upon mouse drop.

Definition at line 488 of file GHOST_C-api.cc.

References GHOST_IWindow::setAcceptDragOperation().

◆ GHOST_SetAutoFocus()

void GHOST_SetAutoFocus ( bool auto_focus)
extern

Focus and raise windows on mouse hover.

Definition at line 953 of file GHOST_C-api.cc.

References GHOST_ISystem::getSystem(), and GHOST_ISystem::setAutoFocus().

Referenced by ui_textedit_begin(), and ui_textedit_end().

◆ GHOST_SetBacktraceHandler()

void GHOST_SetBacktraceHandler ( GHOST_TBacktraceFn backtrace_fn)
extern

Assign the callback which generates a back-trace (may be nullptr).

Definition at line 942 of file GHOST_C-api.cc.

References GHOST_ISystem::setBacktraceFn().

Referenced by wm_ghost_init(), wm_ghost_init_background(), and wm_main_playanim_intern().

◆ GHOST_SetCenterRectangle()

void GHOST_SetCenterRectangle ( GHOST_RectangleHandle rectanglehandle,
int32_t cx,
int32_t cy )
extern

Sets rectangle members. Sets rectangle members such that it is centered at the given location.

Parameters
rectanglehandleThe handle to the rectangle.
cxRequested center x-coordinate of the rectangle.
cyRequested center y-coordinate of the rectangle.

Definition at line 872 of file GHOST_C-api.cc.

◆ GHOST_SetClientHeight()

GHOST_TSuccess GHOST_SetClientHeight ( GHOST_WindowHandle windowhandle,
uint32_t height )
extern

Resizes client rectangle height.

Parameters
windowhandleThe handle to the window.
heightThe new height of the client area of the window.
Returns
Indication of success.

Definition at line 645 of file GHOST_C-api.cc.

References GHOST_IWindow::setClientHeight().

◆ GHOST_SetClientSize()

GHOST_TSuccess GHOST_SetClientSize ( GHOST_WindowHandle windowhandle,
uint32_t width,
uint32_t height )
extern

Resizes client rectangle.

Parameters
windowhandleThe handle to the window.
widthThe new width of the client area of the window.
heightThe new height of the client area of the window.
Returns
Indication of success.

Definition at line 652 of file GHOST_C-api.cc.

References GHOST_IWindow::setClientSize().

Referenced by playanim_window_zoom(), and wm_window_set_size().

◆ GHOST_SetClientWidth()

GHOST_TSuccess GHOST_SetClientWidth ( GHOST_WindowHandle windowhandle,
uint32_t width )
extern

Resizes client rectangle width.

Parameters
windowhandleThe handle to the window.
widthThe new width of the client area of the window.
Returns
Indication of success.

Definition at line 638 of file GHOST_C-api.cc.

References GHOST_IWindow::setClientWidth().

◆ GHOST_setConsoleWindowState()

bool GHOST_setConsoleWindowState ( GHOST_TConsoleWindowState action)
extern

Set the Console State

Parameters
actionconsole state
Returns
current status (1 -visible, 0 - hidden)

Definition at line 924 of file GHOST_C-api.cc.

References GHOST_ISystem::getSystem(), and GHOST_ISystem::setConsoleWindowState().

Referenced by WM_init().

◆ GHOST_SetCursorGrab()

GHOST_TSuccess GHOST_SetCursorGrab ( GHOST_WindowHandle windowhandle,
GHOST_TGrabCursorMode mode,
GHOST_TAxisFlag wrap_axis,
const int bounds[4],
const int mouse_ungrab_xy[2] )
extern

Grabs the cursor for a modal operation, to keep receiving events when the mouse is outside the window. X11 only, others do this automatically.

Parameters
windowhandleThe handle to the window.
modeThe new grab state of the cursor.
boundsThe grab region (optional) - left,top,right,bottom.
mouse_ungrab_xyXY for new mouse location (optional).
Returns
Indication of success.

Definition at line 413 of file GHOST_C-api.cc.

References bounds(), and GHOST_IWindow::setCursorGrab().

Referenced by WM_cursor_grab_disable(), and WM_cursor_grab_enable().

◆ GHOST_SetCursorPosition()

GHOST_TSuccess GHOST_SetCursorPosition ( GHOST_SystemHandle systemhandle,
GHOST_WindowHandle windowhandle,
int32_t x,
int32_t y )

Updates the location of the cursor (location in client relative coordinates). Not all operating systems allow the cursor to be moved (without the input device being moved).

Parameters
systemhandleThe handle to the system.
xThe x-coordinate of the cursor.
yThe y-coordinate of the cursor.
Returns
Indication of success.

Definition at line 402 of file GHOST_C-api.cc.

References GHOST_ISystem::setCursorPositionClientRelative().

Referenced by WM_cursor_warp().

◆ GHOST_SetCursorShape()

GHOST_TSuccess GHOST_SetCursorShape ( GHOST_WindowHandle windowhandle,
GHOST_TStandardCursor cursorshape )
extern

Set the shape of the cursor. If the shape is not supported by the platform, it will use the default cursor instead.

Parameters
windowhandleThe handle to the window.
cursorshapeThe new cursor shape type id.
Returns
Indication of success.

Definition at line 317 of file GHOST_C-api.cc.

References GHOST_IWindow::setCursorShape().

Referenced by loggerwindow_do_button(), mainwindow_do_key(), processEvent(), and WM_cursor_set().

◆ GHOST_SetCursorVisibility()

GHOST_TSuccess GHOST_SetCursorVisibility ( GHOST_WindowHandle windowhandle,
bool visible )
extern

Shows or hides the cursor.

Parameters
windowhandleThe handle to the window.
visibleThe new visibility state of the cursor.
Returns
Indication of success.

Definition at line 362 of file GHOST_C-api.cc.

References GHOST_IWindow::setCursorVisibility().

Referenced by mainwindow_do_key(), processEvent(), and WM_cursor_set().

◆ GHOST_SetCustomCursorShape()

GHOST_TSuccess GHOST_SetCustomCursorShape ( GHOST_WindowHandle windowhandle,
uint8_t * bitmap,
uint8_t * mask,
int sizex,
int sizey,
int hotX,
int hotY,
bool canInvertColor )
extern

Set the shape of the cursor to a custom cursor of specified size.

Parameters
windowhandleThe handle to the window.
bitmapThe bitmap data for the cursor.
maskThe mask data for the cursor.
sizexThe width of the cursor.
sizeyThe height of the cursor.
hotXThe X coordinate of the cursor hot-spot.
hotYThe Y coordinate of the cursor hot-spot.
canInvertColorLet macOS invert cursor color to match platform convention.
Returns
Indication of success.

Definition at line 333 of file GHOST_C-api.cc.

References GHOST_IWindow::setCustomCursorShape().

Referenced by extrawindow_spin_cursor(), window_set_custom_cursor(), and window_set_custom_cursor_ex().

◆ GHOST_SetDrawingContextType()

GHOST_TSuccess GHOST_SetDrawingContextType ( GHOST_WindowHandle windowhandle,
GHOST_TDrawingContextType type )
extern

Tries to install a rendering context in this window.

Parameters
windowhandleThe handle to the window.
typeThe type of rendering context installed.
Returns
Indication as to whether installation has succeeded.

Definition at line 566 of file GHOST_C-api.cc.

References GHOST_IWindow::setDrawingContextType().

◆ GHOST_SetMultitouchGestures()

void GHOST_SetMultitouchGestures ( GHOST_SystemHandle systemhandle,
const bool use )
extern

Use multi-touch gestures if supported.

Parameters
systemhandleThe handle to the system.
useEnable or disable.

Definition at line 771 of file GHOST_C-api.cc.

References GHOST_ISystem::setMultitouchGestures().

Referenced by WM_init_input_devices().

◆ GHOST_SetPath()

GHOST_TSuccess GHOST_SetPath ( GHOST_WindowHandle windowhandle,
const char * filepath )
extern

Sets the file name represented by this window.

Parameters
filepathThe file directory.
Returns
Indication if the backend implements file associated with window.

Definition at line 604 of file GHOST_C-api.cc.

References GHOST_IWindow::setPath().

Referenced by WM_window_title().

◆ GHOST_SetProgressBar()

GHOST_TSuccess GHOST_SetProgressBar ( GHOST_WindowHandle windowhandle,
float progress )
extern

Sets the progress bar value displayed in the window/application icon

Parameters
windowhandleThe handle to the window.
progressThe progress percentage (0.0 to 1.0).

Definition at line 296 of file GHOST_C-api.cc.

References GHOST_IWindow::setProgressBar().

Referenced by WM_progress_set().

◆ GHOST_SetRectangle()

void GHOST_SetRectangle ( GHOST_RectangleHandle rectanglehandle,
int32_t l,
int32_t t,
int32_t r,
int32_t b )
extern

Sets all members of the rectangle.

Parameters
rectanglehandleThe handle to the rectangle.
lrequested left coordinate of the rectangle.
trequested top coordinate of the rectangle.
rrequested right coordinate of the rectangle.
brequested bottom coordinate of the rectangle.

Definition at line 810 of file GHOST_C-api.cc.

References b, and l.

◆ GHOST_SetRectangleCenter()

void GHOST_SetRectangleCenter ( GHOST_RectangleHandle rectanglehandle,
int32_t cx,
int32_t cy,
int32_t w,
int32_t h )
extern

Sets rectangle members. Sets rectangle members such that it is centered at the given location, with the width requested.

Parameters
rectanglehandleThe handle to the rectangle.
cxrequested center x-coordinate of the rectangle.
cyrequested center y-coordinate of the rectangle.
wrequested width of the rectangle.
hrequested height of the rectangle.

Definition at line 877 of file GHOST_C-api.cc.

References w().

◆ GHOST_SetSwapInterval()

GHOST_TSuccess GHOST_SetSwapInterval ( GHOST_WindowHandle windowhandle,
int interval )
extern

Sets the swap interval for #swapBuffers.

Parameters
intervalThe swap interval to use.
Returns
A boolean success indicator.

Definition at line 712 of file GHOST_C-api.cc.

References GHOST_IWindow::setSwapInterval().

Referenced by wm_window_set_swap_interval().

◆ GHOST_SetTabletAPI()

void GHOST_SetTabletAPI ( GHOST_SystemHandle systemhandle,
GHOST_TTabletAPI api )
extern

Set which tablet API to use. Only affects Windows, other platforms have a single API.

Parameters
systemhandleThe handle to the system.
apiEnum indicating which API to use.

Definition at line 777 of file GHOST_C-api.cc.

References GHOST_ISystem::setTabletAPI().

Referenced by WM_init_input_devices().

◆ GHOST_SetTimerProc()

void GHOST_SetTimerProc ( GHOST_TimerTaskHandle timertaskhandle,
GHOST_TimerProcPtr timerProc )
extern

Changes the timer callback.

Parameters
timertaskhandleThe handle to the timer-task.
timerProcThe timer callback.

Definition at line 530 of file GHOST_C-api.cc.

References GHOST_ITimerTask::setTimerProc().

◆ GHOST_SetTimerTaskUserData()

void GHOST_SetTimerTaskUserData ( GHOST_TimerTaskHandle timertaskhandle,
GHOST_TUserDataPtr user_data )
extern

Changes the time user data.

Parameters
timertaskhandleThe handle to the timer-task.
user_dataThe timer user data.

Definition at line 544 of file GHOST_C-api.cc.

References GHOST_ITimerTask::setUserData().

◆ GHOST_SetTitle()

void GHOST_SetTitle ( GHOST_WindowHandle windowhandle,
const char * title )
extern

Sets the title displayed in the title bar.

Parameters
windowhandleThe handle to the window.
titleThe title to display in the title bar.

Definition at line 580 of file GHOST_C-api.cc.

References GHOST_IWindow::setTitle().

Referenced by processEvent(), and WM_window_title().

◆ GHOST_SetWindowModifiedState()

GHOST_TSuccess GHOST_SetWindowModifiedState ( GHOST_WindowHandle windowhandle,
bool isUnsavedChanges )
extern

Sets the window "modified" status, indicating unsaved changes.

Parameters
windowhandleThe handle to the window.
isUnsavedChangesUnsaved changes or not.
Returns
Indication of success.

Definition at line 691 of file GHOST_C-api.cc.

References GHOST_IWindow::setModifiedState().

Referenced by WM_window_title().

◆ GHOST_SetWindowOrder()

GHOST_TSuccess GHOST_SetWindowOrder ( GHOST_WindowHandle windowhandle,
GHOST_TWindowOrder order )
extern

Sets the order of the window (bottom, top).

Parameters
windowhandleThe handle to the window.
orderThe order of the window.
Returns
Indication of success.

Definition at line 698 of file GHOST_C-api.cc.

References GHOST_IWindow::setOrder().

Referenced by mainwindow_do_key(), wm_window_lower(), and wm_window_raise().

◆ GHOST_SetWindowState()

GHOST_TSuccess GHOST_SetWindowState ( GHOST_WindowHandle windowhandle,
GHOST_TWindowState state )
extern

Sets the state of the window (normal, minimized, maximized).

Parameters
windowhandleThe handle to the window.
stateThe state of the window.
Returns
Indication of success.

Definition at line 684 of file GHOST_C-api.cc.

References GHOST_IWindow::setState(), and state.

Referenced by wm_window_fullscreen_toggle_exec(), wm_window_ghostwindow_add(), and wm_window_raise().

◆ GHOST_SetWindowUserData()

void GHOST_SetWindowUserData ( GHOST_WindowHandle windowhandle,
GHOST_TUserDataPtr user_data )
extern

Changes the window user data.

Parameters
windowhandleThe handle to the window.
user_dataThe window user data.

Definition at line 191 of file GHOST_C-api.cc.

References GHOST_IWindow::setUserData().

Referenced by extrawindow_new(), loggerwindow_new(), mainwindow_new(), wm_file_read_setup_wm_substitute_old_window(), and wm_window_ghostwindow_add().

◆ GHOST_ShowMessageBox()

void GHOST_ShowMessageBox ( GHOST_SystemHandle systemhandle,
const char * title,
const char * message,
const char * help_label,
const char * continue_label,
const char * link,
GHOST_DialogOptions dialog_options )
extern

Show a system message box to the user

Parameters
systemhandleThe handle to the system.
titleTitle of the message box.
messageMessage of the message box.
help_labelText to show on the help button that opens a link.
continue_labelText to show on the ok button that continues.
linkOptional (hyper)link to a web-page to show when pressing help.
dialog_optionsOptions to configure the message box.

Definition at line 63 of file GHOST_C-api.cc.

References GHOST_ISystem::showMessageBox().

Referenced by WM_ghost_show_message_box().

◆ GHOST_SwapWindowBuffers()

GHOST_TSuccess GHOST_SwapWindowBuffers ( GHOST_WindowHandle windowhandle)
extern

Swaps front and back buffers of a window.

Parameters
windowhandleThe handle to the window.
Returns
A success indicator.

Definition at line 705 of file GHOST_C-api.cc.

References GHOST_IWindow::swapBuffers().

Referenced by extrawindow_do_draw(), loggerwindow_do_draw(), mainwindow_do_draw(), playanim_toscreen_ex(), processEvent(), wm_main_playanim_intern(), and wm_window_swap_buffers().

◆ GHOST_SystemBackend()

const char * GHOST_SystemBackend ( void )
extern

Definition at line 57 of file GHOST_C-api.cc.

References GHOST_ISystem::getSystemBackend().

Referenced by wm_ghost_init().

◆ GHOST_SystemInitDebug()

void GHOST_SystemInitDebug ( GHOST_SystemHandle systemhandle,
GHOST_Debug debug )
extern

Specifies whether debug messages are to be enabled for the specific system handle.

Parameters
systemhandleThe handle to the system.
debugFlag for systems to debug.

Definition at line 42 of file GHOST_C-api.cc.

References GHOST_ISystem::initDebug().

Referenced by wm_ghost_init(), and wm_ghost_init_background().

◆ GHOST_UnionPointRectangle()

void GHOST_UnionPointRectangle ( GHOST_RectangleHandle rectanglehandle,
int32_t x,
int32_t y )
extern

Grows the rectangle to included a point.

Parameters
rectanglehandleThe handle to the rectangle.
xThe x-coordinate of the point.
yThe y-coordinate of the point.

Definition at line 847 of file GHOST_C-api.cc.

◆ GHOST_UnionRectangle()

void GHOST_UnionRectangle ( GHOST_RectangleHandle rectanglehandle,
GHOST_RectangleHandle anotherrectanglehandle )
extern

Does a union of the rectangle given and this rectangle. The result is stored in this rectangle.

Parameters
rectanglehandleThe handle to the rectangle.
anotherrectanglehandleThe rectangle that is input for the union operation.

Definition at line 841 of file GHOST_C-api.cc.

◆ GHOST_UseNativePixels()

bool GHOST_UseNativePixels ( void )
extern

Use native pixel size (MacBook pro 'retina'), if supported.

Definition at line 930 of file GHOST_C-api.cc.

References GHOST_ISystem::getSystem(), and GHOST_ISystem::useNativePixel().

Referenced by wm_ghost_init(), and wm_main_playanim_intern().

◆ GHOST_UseWindowFocus()

void GHOST_UseWindowFocus ( bool use_focus)
extern

Focus window after opening, or put them in the background.

Definition at line 947 of file GHOST_C-api.cc.

References GHOST_ISystem::getSystem(), and GHOST_ISystem::useWindowFocus().

Referenced by wm_ghost_init().

◆ GHOST_ValidWindow()

bool GHOST_ValidWindow ( GHOST_SystemHandle systemhandle,
GHOST_WindowHandle windowhandle )
extern

Returns whether a window is valid.

Parameters
systemhandleThe handle to the system.
windowhandleHandle to the window to be checked.
Returns
Indication of validity.

Definition at line 214 of file GHOST_C-api.cc.

References GHOST_ISystem::validWindow().

Referenced by gearsTimerProc(), ghost_event_proc(), main(), multitest_event_handler(), and processEvent().