3 * ***** BEGIN GPL LICENSE BLOCK *****
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
20 * All rights reserved.
22 * The Original Code is: all of this file.
24 * Contributor(s): none yet.
26 * ***** END GPL LICENSE BLOCK *****
30 * GHOST C-API function and type declarations.
31 * The C-API wraps the C++ objects with the
37 #include "GHOST_Types.h"
44 * Creates a "handle" for a C++ GHOST object.
45 * A handle is just an opaque pointer to an empty struct.
46 * In the API the pointer is casted to the actual C++ class.
47 * @param name Name of the handle to create.
49 #define GHOST_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
51 GHOST_DECLARE_HANDLE(GHOST_SystemHandle);
52 GHOST_DECLARE_HANDLE(GHOST_TimerTaskHandle);
53 GHOST_DECLARE_HANDLE(GHOST_WindowHandle);
54 GHOST_DECLARE_HANDLE(GHOST_EventHandle);
55 GHOST_DECLARE_HANDLE(GHOST_RectangleHandle);
56 GHOST_DECLARE_HANDLE(GHOST_EventConsumerHandle);
60 * Definition of a callback routine that receives events.
61 * @param event The event received.
62 * @param userdata The callback's user data, supplied to GHOST_CreateSystem.
64 typedef int (*GHOST_EventCallbackProcPtr)(GHOST_EventHandle event, GHOST_TUserDataPtr userdata);
68 * Creates the one and only system.
69 * @return a handle to the system.
71 extern GHOST_SystemHandle GHOST_CreateSystem(void);
74 * Disposes the one and only system.
75 * @param systemhandle The handle to the system
76 * @return An indication of success.
78 extern GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle);
82 * Creates an event consumer object
83 * @param eventCallback The event callback routine.
84 * @param userdata Pointer to user data returned to the callback routine.
86 extern GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr userdata);
89 * Disposes an event consumer object
90 * @param consumerhandle Handle to the event consumer.
91 * @return An indication of success.
93 extern GHOST_TSuccess GHOST_DisposeEventConsumer(GHOST_EventConsumerHandle consumerhandle);
97 * Returns the system time.
98 * Returns the number of milliseconds since the start of the system process.
99 * Based on ANSI clock() routine.
100 * @param systemhandle The handle to the system
101 * @return The number of milliseconds.
103 extern GHOST_TUns64 GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle);
107 * Note that, on most operating systems, messages need to be processed in order
108 * for the timer callbacks to be invoked.
109 * @param systemhandle The handle to the system
110 * @param delay The time to wait for the first call to the timerProc (in milliseconds)
111 * @param interval The interval between calls to the timerProc (in milliseconds)
112 * @param timerProc The callback invoked when the interval expires,
113 * @param userData Placeholder for user data.
114 * @return A timer task (0 if timer task installation failed).
116 extern GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle,
118 GHOST_TUns64 interval,
119 GHOST_TimerProcPtr timerProc,
120 GHOST_TUserDataPtr userData);
124 * @param systemhandle The handle to the system
125 * @param timerTask Timer task to be removed.
126 * @return Indication of success.
128 extern GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle,
129 GHOST_TimerTaskHandle timertaskhandle);
131 /***************************************************************************************
132 ** Display/window management functionality
133 ***************************************************************************************/
136 * Returns the number of displays on this system.
137 * @param systemhandle The handle to the system
138 * @return The number of displays.
140 extern GHOST_TUns8 GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle);
143 * Returns the dimensions of the main display on this system.
144 * @param systemhandle The handle to the system
145 * @param width A pointer the width gets put in
146 * @param height A pointer the height gets put in
149 extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
151 GHOST_TUns32* height);
154 * Create a new window.
155 * The new window is added to the list of windows managed.
156 * Never explicitly delete the window, use disposeWindow() instead.
157 * @param systemhandle The handle to the system
158 * @param title The name of the window (displayed in the title bar of the window if the OS supports it).
159 * @param left The coordinate of the left edge of the window.
160 * @param top The coordinate of the top edge of the window.
161 * @param width The width the window.
162 * @param height The height the window.
163 * @param state The state of the window when opened.
164 * @param type The type of drawing context installed in this window.
165 * @return A handle to the new window ( == NULL if creation failed).
167 extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
173 GHOST_TWindowState state,
174 GHOST_TDrawingContextType type,
175 const int stereoVisual);
178 * Returns the window user data.
179 * @param windowhandle The handle to the window
180 * @return The window user data.
182 extern GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle);
185 * Changes the window user data.
186 * @param windowhandle The handle to the window
187 * @param data The window user data.
189 extern void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle,
190 GHOST_TUserDataPtr userdata);
194 * @param systemhandle The handle to the system
195 * @param window Handle to the window to be disposed.
196 * @return Indication of success.
198 extern GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle,
199 GHOST_WindowHandle windowhandle);
202 * Returns whether a window is valid.
203 * @param systemhandle The handle to the system
204 * @param window Handle to the window to be checked.
205 * @return Indication of validity.
207 extern int GHOST_ValidWindow(GHOST_SystemHandle systemhandle,
208 GHOST_WindowHandle windowhandle);
211 * Begins full screen mode.
212 * @param systemhandle The handle to the system
213 * @param setting The new setting of the display.
214 * @return A handle to the window displayed in full screen.
215 * This window is invalid after full screen has been ended.
217 extern GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle,
218 GHOST_DisplaySetting* setting,
219 const int stereoVisual);
222 * Ends full screen mode.
223 * @param systemhandle The handle to the system
224 * @return Indication of success.
226 extern GHOST_TSuccess GHOST_EndFullScreen(GHOST_SystemHandle systemhandle);
229 * Returns current full screen mode status.
230 * @param systemhandle The handle to the system
231 * @return The current status.
233 extern int GHOST_GetFullScreen(GHOST_SystemHandle systemhandle);
235 /***************************************************************************************
236 ** Event management functionality
237 ***************************************************************************************/
240 * Retrieves events from the system and stores them in the queue.
241 * @param systemhandle The handle to the system
242 * @param waitForEvent Boolean to indicate that ProcessEvents should
243 * wait (block) until the next event before returning.
244 * @return Indication of the presence of events.
246 extern int GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, int waitForEvent);
249 * Retrieves events from the queue and send them to the event consumers.
250 * @param systemhandle The handle to the system
251 * @return Indication of the presence of events.
253 extern int GHOST_DispatchEvents(GHOST_SystemHandle systemhandle);
256 * Adds the given event consumer to our list.
257 * @param systemhandle The handle to the system
258 * @param consumerhandle The event consumer to add.
259 * @return Indication of success.
261 extern GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle,
262 GHOST_EventConsumerHandle consumerhandle);
265 /***************************************************************************************
266 ** N-degree of freedom device management functionality
267 ***************************************************************************************/
270 * Open N-degree of freedom devices
272 extern int GHOST_OpenNDOF(GHOST_SystemHandle systemhandle,
273 GHOST_WindowHandle windowhandle,
274 GHOST_NDOFLibraryInit_fp setNdofLibraryInit,
275 GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
276 GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen
279 /***************************************************************************************
280 ** Cursor management functionality
281 ***************************************************************************************/
284 * Returns the current cursor shape.
285 * @param windowhandle The handle to the window
286 * @return The current cursor shape.
288 extern GHOST_TStandardCursor GHOST_GetCursorShape(GHOST_WindowHandle windowhandle);
291 * Set the shape of the cursor.
292 * @param windowhandle The handle to the window
293 * @param cursor The new cursor shape type id.
294 * @return Indication of success.
296 extern GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle,
297 GHOST_TStandardCursor cursorshape);
300 * Set the shape of the cursor to a custom cursor.
301 * @param windowhandle The handle to the window
302 * @param bitmap The bitmap data for the cursor.
303 * @param mask The mask data for the cursor.
304 * @param hotX The X coordinate of the cursor hotspot.
305 * @param hotY The Y coordinate of the cursor hotspot.
306 * @return Indication of success.
308 extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle,
309 GHOST_TUns8 bitmap[16][2],
310 GHOST_TUns8 mask[16][2],
314 * Set the shape of the cursor to a custom cursor of specified size.
315 * @param windowhandle The handle to the window
316 * @param bitmap The bitmap data for the cursor.
317 * @param mask The mask data for the cursor.
318 * @parm sizex, sizey The size of the cursor
319 * @param hotX The X coordinate of the cursor hotspot.
320 * @param hotY The Y coordinate of the cursor hotspot.
321 * @param fg_color, bg_color Colors of the cursor
322 * @return Indication of success.
324 extern GHOST_TSuccess GHOST_SetCustomCursorShapeEx(GHOST_WindowHandle windowhandle,
327 int sizex, int sizey,
329 int fg_color, int bg_color );
332 * Returns the visibility state of the cursor.
333 * @param windowhandle The handle to the window
334 * @return The visibility state of the cursor.
336 extern int GHOST_GetCursorVisibility(GHOST_WindowHandle windowhandle);
339 * Shows or hides the cursor.
340 * @param windowhandle The handle to the window
341 * @param visible The new visibility state of the cursor.
342 * @return Indication of success.
344 extern GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle,
348 * Returns the current location of the cursor (location in screen coordinates)
349 * @param systemhandle The handle to the system
350 * @param x The x-coordinate of the cursor.
351 * @param y The y-coordinate of the cursor.
352 * @return Indication of success.
354 extern GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle,
359 * Updates the location of the cursor (location in screen coordinates).
360 * Not all operating systems allow the cursor to be moved (without the input device being moved).
361 * @param systemhandle The handle to the system
362 * @param x The x-coordinate of the cursor.
363 * @param y The y-coordinate of the cursor.
364 * @return Indication of success.
366 extern GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
371 * Grabs the cursor for a modal operation, to keep receiving
372 * events when the mouse is outside the window. X11 only, others
373 * do this automatically.
374 * @param windowhandle The handle to the window
375 * @param grab The new grab state of the cursor.
376 * @return Indication of success.
378 extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
381 /***************************************************************************************
382 ** Access to mouse button and keyboard states.
383 ***************************************************************************************/
386 * Returns the state of a modifier key (ouside the message queue).
387 * @param systemhandle The handle to the system
388 * @param mask The modifier key state to retrieve.
389 * @param isDown Pointer to return modifier state in.
390 * @return Indication of success.
392 extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
393 GHOST_TModifierKeyMask mask,
397 * Returns the state of a mouse button (ouside the message queue).
398 * @param systemhandle The handle to the system
399 * @param mask The button state to retrieve.
400 * @param isDown Pointer to return button state in.
401 * @return Indication of success.
403 extern GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
404 GHOST_TButtonMask mask,
408 * Returns the event type.
409 * @param eventhandle The handle to the event
410 * @return The event type.
412 extern GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle);
415 * Returns the time this event was generated.
416 * @param eventhandle The handle to the event
417 * @return The event generation time.
419 extern GHOST_TUns64 GHOST_GetEventTime(GHOST_EventHandle eventhandle);
422 * Returns the window this event was generated on,
423 * or NULL if it is a 'system' event.
424 * @param eventhandle The handle to the event
425 * @return The generating window.
427 extern GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle);
430 * Returns the event data.
431 * @param eventhandle The handle to the event
432 * @return The event data.
434 extern GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle);
437 * Returns the timer callback.
438 * @param timertaskhandle The handle to the timertask
439 * @return The timer callback.
441 extern GHOST_TimerProcPtr GHOST_GetTimerProc(GHOST_TimerTaskHandle timertaskhandle);
444 * Changes the timer callback.
445 * @param timertaskhandle The handle to the timertask
446 * @param timerProc The timer callback.
448 extern void GHOST_SetTimerProc(GHOST_TimerTaskHandle timertaskhandle,
449 GHOST_TimerProcPtr timerProc);
452 * Returns the timer user data.
453 * @param timertaskhandle The handle to the timertask
454 * @return The timer user data.
456 extern GHOST_TUserDataPtr GHOST_GetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle);
459 * Changes the time user data.
460 * @param timertaskhandle The handle to the timertask
461 * @param data The timer user data.
463 extern void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle,
464 GHOST_TUserDataPtr userData);
467 * Returns indication as to whether the window is valid.
468 * @param windowhandle The handle to the window
469 * @return The validity of the window.
471 extern int GHOST_GetValid(GHOST_WindowHandle windowhandle) ;
474 * Returns the type of drawing context used in this window.
475 * @param windowhandle The handle to the window
476 * @return The current type of drawing context.
478 extern GHOST_TDrawingContextType GHOST_GetDrawingContextType(GHOST_WindowHandle windowhandle);
481 * Tries to install a rendering context in this window.
482 * @param windowhandle The handle to the window
483 * @param type The type of rendering context installed.
484 * @return Indication as to whether installation has succeeded.
486 extern GHOST_TSuccess GHOST_SetDrawingContextType(GHOST_WindowHandle windowhandle,
487 GHOST_TDrawingContextType type);
490 * Sets the title displayed in the title bar.
491 * @param windowhandle The handle to the window
492 * @param title The title to display in the title bar.
494 extern void GHOST_SetTitle(GHOST_WindowHandle windowhandle,
498 * Returns the title displayed in the title bar. The title
499 * should be free'd with free().
501 * @param windowhandle The handle to the window
502 * @return The title, free with free().
504 extern char* GHOST_GetTitle(GHOST_WindowHandle windowhandle);
507 * Returns the window rectangle dimensions.
508 * These are screen coordinates.
509 * @param windowhandle The handle to the window
510 * @return A handle to the bounding rectangle of the window.
512 extern GHOST_RectangleHandle GHOST_GetWindowBounds(GHOST_WindowHandle windowhandle);
515 * Returns the client rectangle dimensions.
516 * The left and top members of the rectangle are always zero.
517 * @param windowhandle The handle to the window
518 * @return A handle to the bounding rectangle of the window.
520 extern GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle);
523 * Disposes a rectangle object
524 * @param rectanglehandle Handle to the rectangle.
526 void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle);
529 * Resizes client rectangle width.
530 * @param windowhandle The handle to the window
531 * @param width The new width of the client area of the window.
532 * @return Indication of success.
534 extern GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle,
538 * Resizes client rectangle height.
539 * @param windowhandle The handle to the window
540 * @param height The new height of the client area of the window.
541 * @return Indication of success.
543 extern GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle,
544 GHOST_TUns32 height);
547 * Resizes client rectangle.
548 * @param windowhandle The handle to the window
549 * @param width The new width of the client area of the window.
550 * @param height The new height of the client area of the window.
551 * @return Indication of success.
553 extern GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
555 GHOST_TUns32 height);
558 * Converts a point in screen coordinates to client rectangle coordinates
559 * @param windowhandle The handle to the window
560 * @param inX The x-coordinate on the screen.
561 * @param inY The y-coordinate on the screen.
562 * @param outX The x-coordinate in the client rectangle.
563 * @param outY The y-coordinate in the client rectangle.
565 extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
569 GHOST_TInt32* outY) ;
572 * Converts a point in screen coordinates to client rectangle coordinates
573 * @param windowhandle The handle to the window
574 * @param inX The x-coordinate in the client rectangle.
575 * @param inY The y-coordinate in the client rectangle.
576 * @param outX The x-coordinate on the screen.
577 * @param outY The y-coordinate on the screen.
579 extern void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle,
586 * Returns the state of the window (normal, minimized, maximized).
587 * @param windowhandle The handle to the window
588 * @return The state of the window.
590 extern GHOST_TWindowState GHOST_GetWindowState(GHOST_WindowHandle windowhandle);
593 * Sets the state of the window (normal, minimized, maximized).
594 * @param windowhandle The handle to the window
595 * @param state The state of the window.
596 * @return Indication of success.
598 extern GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle,
599 GHOST_TWindowState state);
602 * Sets the order of the window (bottom, top).
603 * @param windowhandle The handle to the window
604 * @param order The order of the window.
605 * @return Indication of success.
607 extern GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle,
608 GHOST_TWindowOrder order);
611 * Swaps front and back buffers of a window.
612 * @param windowhandle The handle to the window
613 * @return An intean success indicator.
615 extern GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle);
618 * Activates the drawing context of this window.
619 * @param windowhandle The handle to the window
620 * @return An intean success indicator.
622 extern GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle);
625 * Invalidates the contents of this window.
626 * @param windowhandle The handle to the window
627 * @return Indication of success.
629 extern GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle windowhandle);
632 * Returns the status of the tablet
633 * @param windowhandle The handle to the window
634 * @return Status of tablet
636 extern const GHOST_TabletData *GHOST_GetTabletData(GHOST_WindowHandle windowhandle);
639 * Access to rectangle width.
640 * @param rectanglehandle The handle to the rectangle
641 * @return width of the rectangle
643 extern GHOST_TInt32 GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle);
646 * Access to rectangle height.
647 * @param rectanglehandle The handle to the rectangle
648 * @return height of the rectangle
650 extern GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle);
653 * Gets all members of the rectangle.
654 * @param rectanglehandle The handle to the rectangle
655 * @param l Pointer to return left coordinate in.
656 * @param t Pointer to return top coordinate in.
657 * @param r Pointer to return right coordinate in.
658 * @param b Pointer to return bottom coordinate in.
660 extern void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle,
667 * Sets all members of the rectangle.
668 * @param rectanglehandle The handle to the rectangle
669 * @param l requested left coordinate of the rectangle
670 * @param t requested top coordinate of the rectangle
671 * @param r requested right coordinate of the rectangle
672 * @param b requested bottom coordinate of the rectangle
674 extern void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle,
681 * Returns whether this rectangle is empty.
682 * Empty rectangles are rectangles that have width==0 and/or height==0.
683 * @param rectanglehandle The handle to the rectangle
684 * @return intean value (true == empty rectangle)
686 extern GHOST_TSuccess GHOST_IsEmptyRectangle(GHOST_RectangleHandle rectanglehandle);
689 * Returns whether this rectangle is valid.
690 * Valid rectangles are rectangles that have m_l <= m_r and m_t <= m_b. Thus, emapty rectangles are valid.
691 * @param rectanglehandle The handle to the rectangle
692 * @return intean value (true==valid rectangle)
694 extern GHOST_TSuccess GHOST_IsValidRectangle(GHOST_RectangleHandle rectanglehandle);
697 * Grows (or shrinks the rectangle).
698 * The method avoids negative insets making the rectangle invalid
699 * @param rectanglehandle The handle to the rectangle
700 * @param i The amount of offset given to each extreme (negative values shrink the rectangle).
702 extern void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle,
706 * Does a union of the rectangle given and this rectangle.
707 * The result is stored in this rectangle.
708 * @param rectanglehandle The handle to the rectangle
709 * @param r The rectangle that is input for the union operation.
711 extern void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle,
712 GHOST_RectangleHandle anotherrectanglehandle);
715 * Grows the rectangle to included a point.
716 * @param rectanglehandle The handle to the rectangle
717 * @param x The x-coordinate of the point.
718 * @param y The y-coordinate of the point.
720 extern void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle,
725 * Returns whether the point is inside this rectangle.
726 * Point on the boundary is considered inside.
727 * @param rectanglehandle The handle to the rectangle
728 * @param x x-coordinate of point to test.
729 * @param y y-coordinate of point to test.
730 * @return intean value (true if point is inside).
732 extern GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehandle,
737 * Returns whether the rectangle is inside this rectangle.
738 * @param rectanglehandle The handle to the rectangle
739 * @param r rectangle to test.
740 * @return visibility (not, partially or fully visible).
742 extern GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rectanglehandle,
743 GHOST_RectangleHandle anotherrectanglehandle);
746 * Sets rectangle members.
747 * Sets rectangle members such that it is centered at the given location.
748 * @param rectanglehandle The handle to the rectangle
749 * @param cx requested center x-coordinate of the rectangle
750 * @param cy requested center y-coordinate of the rectangle
752 extern void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle,
757 * Sets rectangle members.
758 * Sets rectangle members such that it is centered at the given location,
759 * with the width requested.
760 * @param rectanglehandle The handle to the rectangle
761 * @param cx requested center x-coordinate of the rectangle
762 * @param cy requested center y-coordinate of the rectangle
763 * @param w requested width of the rectangle
764 * @param h requested height of the rectangle
766 extern void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle,
774 * Updates the rectangle given such that it will fit within this one.
775 * This can result in an empty rectangle.
776 * @param rectanglehandle The handle to the rectangle
777 * @param r the rectangle to clip
778 * @return whether clipping has occurred
780 extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
781 GHOST_RectangleHandle anotherrectanglehandle);
784 * Return the data from the clipboad
785 * @param return the selection instead, X11 only feature
786 * @return clipboard data
788 extern GHOST_TUns8* GHOST_getClipboard(int selection);
791 * Put data to the Clipboard
792 * @param set the selection instead, X11 only feature
794 extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection);