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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
50 GHOST_DECLARE_HANDLE(GHOST_SystemHandle);
51 GHOST_DECLARE_HANDLE(GHOST_TimerTaskHandle);
52 GHOST_DECLARE_HANDLE(GHOST_WindowHandle);
53 GHOST_DECLARE_HANDLE(GHOST_EventHandle);
54 GHOST_DECLARE_HANDLE(GHOST_RectangleHandle);
55 GHOST_DECLARE_HANDLE(GHOST_EventConsumerHandle);
59 * Definition of a callback routine that receives events.
60 * @param event The event received.
61 * @param userdata The callback's user data, supplied to GHOST_CreateSystem.
63 typedef int (*GHOST_EventCallbackProcPtr)(GHOST_EventHandle event, GHOST_TUserDataPtr userdata);
67 * Creates the one and only system.
68 * @return a handle to the system.
70 extern GHOST_SystemHandle GHOST_CreateSystem(void);
73 * Disposes the one and only system.
74 * @param systemhandle The handle to the system
75 * @return An indication of success.
77 extern GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle);
81 * Creates an event consumer object
82 * @param eventCallback The event callback routine.
83 * @param userdata Pointer to user data returned to the callback routine.
85 extern GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr userdata);
88 * Disposes an event consumer object
89 * @param consumerhandle Handle to the event consumer.
90 * @return An indication of success.
92 extern GHOST_TSuccess GHOST_DisposeEventConsumer(GHOST_EventConsumerHandle consumerhandle);
96 * Returns the system time.
97 * Returns the number of milliseconds since the start of the system process.
98 * Based on ANSI clock() routine.
99 * @param systemhandle The handle to the system
100 * @return The number of milliseconds.
102 extern GHOST_TUns64 GHOST_GetMilliSeconds(GHOST_SystemHandle systemhandle);
106 * Note that, on most operating systems, messages need to be processed in order
107 * for the timer callbacks to be invoked.
108 * @param systemhandle The handle to the system
109 * @param delay The time to wait for the first call to the timerProc (in milliseconds)
110 * @param interval The interval between calls to the timerProc (in milliseconds)
111 * @param timerProc The callback invoked when the interval expires,
112 * @param userData Placeholder for user data.
113 * @return A timer task (0 if timer task installation failed).
115 extern GHOST_TimerTaskHandle GHOST_InstallTimer(GHOST_SystemHandle systemhandle,
117 GHOST_TUns64 interval,
118 GHOST_TimerProcPtr timerProc,
119 GHOST_TUserDataPtr userData);
123 * @param systemhandle The handle to the system
124 * @param timerTask Timer task to be removed.
125 * @return Indication of success.
127 extern GHOST_TSuccess GHOST_RemoveTimer(GHOST_SystemHandle systemhandle,
128 GHOST_TimerTaskHandle timertaskhandle);
130 /***************************************************************************************
131 ** Display/window management functionality
132 ***************************************************************************************/
135 * Returns the number of displays on this system.
136 * @param systemhandle The handle to the system
137 * @return The number of displays.
139 extern GHOST_TUns8 GHOST_GetNumDisplays(GHOST_SystemHandle systemhandle);
142 * Returns the dimensions of the main display on this system.
143 * @param systemhandle The handle to the system
144 * @param width A pointer the width gets put in
145 * @param height A pointer the height gets put in
148 extern void GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle,
150 GHOST_TUns32* height);
153 * Create a new window.
154 * The new window is added to the list of windows managed.
155 * Never explicitly delete the window, use disposeWindow() instead.
156 * @param systemhandle The handle to the system
157 * @param title The name of the window (displayed in the title bar of the window if the OS supports it).
158 * @param left The coordinate of the left edge of the window.
159 * @param top The coordinate of the top edge of the window.
160 * @param width The width the window.
161 * @param height The height the window.
162 * @param state The state of the window when opened.
163 * @param type The type of drawing context installed in this window.
164 * @param stereoVisual Stereo visual for quad buffered stereo.
165 * @param numOfAASamples Number of samples used for AA (zero if no AA)
166 * @return A handle to the new window ( == NULL if creation failed).
168 extern GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle,
174 GHOST_TWindowState state,
175 GHOST_TDrawingContextType type,
176 const int stereoVisual,
177 const GHOST_TUns16 numOfAASamples);
180 * Returns the window user data.
181 * @param windowhandle The handle to the window
182 * @return The window user data.
184 extern GHOST_TUserDataPtr GHOST_GetWindowUserData(GHOST_WindowHandle windowhandle);
187 * Changes the window user data.
188 * @param windowhandle The handle to the window
189 * @param data The window user data.
191 extern void GHOST_SetWindowUserData(GHOST_WindowHandle windowhandle,
192 GHOST_TUserDataPtr userdata);
196 * @param systemhandle The handle to the system
197 * @param window Handle to the window to be disposed.
198 * @return Indication of success.
200 extern GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle,
201 GHOST_WindowHandle windowhandle);
204 * Returns whether a window is valid.
205 * @param systemhandle The handle to the system
206 * @param window Handle to the window to be checked.
207 * @return Indication of validity.
209 extern int GHOST_ValidWindow(GHOST_SystemHandle systemhandle,
210 GHOST_WindowHandle windowhandle);
213 * Begins full screen mode.
214 * @param systemhandle The handle to the system
215 * @param setting The new setting of the display.
216 * @return A handle to the window displayed in full screen.
217 * This window is invalid after full screen has been ended.
219 extern GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle,
220 GHOST_DisplaySetting* setting,
221 const int stereoVisual);
224 * Ends full screen mode.
225 * @param systemhandle The handle to the system
226 * @return Indication of success.
228 extern GHOST_TSuccess GHOST_EndFullScreen(GHOST_SystemHandle systemhandle);
231 * Returns current full screen mode status.
232 * @param systemhandle The handle to the system
233 * @return The current status.
235 extern int GHOST_GetFullScreen(GHOST_SystemHandle systemhandle);
237 /***************************************************************************************
238 ** Event management functionality
239 ***************************************************************************************/
242 * Retrieves events from the system and stores them in the queue.
243 * @param systemhandle The handle to the system
244 * @param waitForEvent Boolean to indicate that ProcessEvents should
245 * wait (block) until the next event before returning.
246 * @return Indication of the presence of events.
248 extern int GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, int waitForEvent);
251 * Retrieves events from the queue and send them to the event consumers.
252 * @param systemhandle The handle to the system
253 * @return Indication of the presence of events.
255 extern int GHOST_DispatchEvents(GHOST_SystemHandle systemhandle);
258 * Adds the given event consumer to our list.
259 * @param systemhandle The handle to the system
260 * @param consumerhandle The event consumer to add.
261 * @return Indication of success.
263 extern GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle,
264 GHOST_EventConsumerHandle consumerhandle);
266 /***************************************************************************************
267 ** Progress bar functionality
268 ***************************************************************************************/
271 * Sets the progress bar value displayed in the window/application icon
272 * @param windowhandle The handle to the window
273 * @param progress The progress % (0.0 to 1.0)
275 extern GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle, float progress);
278 * Hides the progress bar in the icon
279 * @param windowhandle The handle to the window
281 extern GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle);
284 /***************************************************************************************
285 ** N-degree of freedom device management functionality
286 ***************************************************************************************/
289 * Open N-degree of freedom devices
291 extern int GHOST_OpenNDOF(GHOST_SystemHandle systemhandle,
292 GHOST_WindowHandle windowhandle,
293 GHOST_NDOFLibraryInit_fp setNdofLibraryInit,
294 GHOST_NDOFLibraryShutdown_fp setNdofLibraryShutdown,
295 GHOST_NDOFDeviceOpen_fp setNdofDeviceOpen
298 /***************************************************************************************
299 ** Cursor management functionality
300 ***************************************************************************************/
303 * Returns the current cursor shape.
304 * @param windowhandle The handle to the window
305 * @return The current cursor shape.
307 extern GHOST_TStandardCursor GHOST_GetCursorShape(GHOST_WindowHandle windowhandle);
310 * Set the shape of the cursor.
311 * @param windowhandle The handle to the window
312 * @param cursor The new cursor shape type id.
313 * @return Indication of success.
315 extern GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle,
316 GHOST_TStandardCursor cursorshape);
319 * Set the shape of the cursor to a custom cursor.
320 * @param windowhandle The handle to the window
321 * @param bitmap The bitmap data for the cursor.
322 * @param mask The mask data for the cursor.
323 * @param hotX The X coordinate of the cursor hotspot.
324 * @param hotY The Y coordinate of the cursor hotspot.
325 * @return Indication of success.
327 extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle,
328 GHOST_TUns8 bitmap[16][2],
329 GHOST_TUns8 mask[16][2],
333 * Set the shape of the cursor to a custom cursor of specified size.
334 * @param windowhandle The handle to the window
335 * @param bitmap The bitmap data for the cursor.
336 * @param mask The mask data for the cursor.
337 * @parm sizex, sizey The size of the cursor
338 * @param hotX The X coordinate of the cursor hotspot.
339 * @param hotY The Y coordinate of the cursor hotspot.
340 * @param fg_color, bg_color Colors of the cursor
341 * @return Indication of success.
343 extern GHOST_TSuccess GHOST_SetCustomCursorShapeEx(GHOST_WindowHandle windowhandle,
346 int sizex, int sizey,
348 int fg_color, int bg_color );
351 * Returns the visibility state of the cursor.
352 * @param windowhandle The handle to the window
353 * @return The visibility state of the cursor.
355 extern int GHOST_GetCursorVisibility(GHOST_WindowHandle windowhandle);
358 * Shows or hides the cursor.
359 * @param windowhandle The handle to the window
360 * @param visible The new visibility state of the cursor.
361 * @return Indication of success.
363 extern GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle,
367 * Returns the current location of the cursor (location in screen coordinates)
368 * @param systemhandle The handle to the system
369 * @param x The x-coordinate of the cursor.
370 * @param y The y-coordinate of the cursor.
371 * @return Indication of success.
373 extern GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle,
378 * Updates the location of the cursor (location in screen coordinates).
379 * Not all operating systems allow the cursor to be moved (without the input device being moved).
380 * @param systemhandle The handle to the system
381 * @param x The x-coordinate of the cursor.
382 * @param y The y-coordinate of the cursor.
383 * @return Indication of success.
385 extern GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
390 * Grabs the cursor for a modal operation, to keep receiving
391 * events when the mouse is outside the window. X11 only, others
392 * do this automatically.
393 * @param windowhandle The handle to the window
394 * @param mode The new grab state of the cursor.
395 * @param bounds The grab ragion (optional) - left,top,right,bottom
396 * @return Indication of success.
398 extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
399 GHOST_TGrabCursorMode mode,
402 /***************************************************************************************
403 ** Access to mouse button and keyboard states.
404 ***************************************************************************************/
407 * Returns the state of a modifier key (ouside the message queue).
408 * @param systemhandle The handle to the system
409 * @param mask The modifier key state to retrieve.
410 * @param isDown Pointer to return modifier state in.
411 * @return Indication of success.
413 extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
414 GHOST_TModifierKeyMask mask,
418 * Returns the state of a mouse button (ouside the message queue).
419 * @param systemhandle The handle to the system
420 * @param mask The button state to retrieve.
421 * @param isDown Pointer to return button state in.
422 * @return Indication of success.
424 extern GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
425 GHOST_TButtonMask mask,
429 /***************************************************************************************
430 ** Drag'n'drop operations
431 ***************************************************************************************/
434 * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
436 extern void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, GHOST_TInt8 canAccept);
440 * Returns the event type.
441 * @param eventhandle The handle to the event
442 * @return The event type.
444 extern GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle);
447 * Returns the time this event was generated.
448 * @param eventhandle The handle to the event
449 * @return The event generation time.
451 extern GHOST_TUns64 GHOST_GetEventTime(GHOST_EventHandle eventhandle);
454 * Returns the window this event was generated on,
455 * or NULL if it is a 'system' event.
456 * @param eventhandle The handle to the event
457 * @return The generating window.
459 extern GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle);
462 * Returns the event data.
463 * @param eventhandle The handle to the event
464 * @return The event data.
466 extern GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle);
469 * Returns the timer callback.
470 * @param timertaskhandle The handle to the timertask
471 * @return The timer callback.
473 extern GHOST_TimerProcPtr GHOST_GetTimerProc(GHOST_TimerTaskHandle timertaskhandle);
476 * Changes the timer callback.
477 * @param timertaskhandle The handle to the timertask
478 * @param timerProc The timer callback.
480 extern void GHOST_SetTimerProc(GHOST_TimerTaskHandle timertaskhandle,
481 GHOST_TimerProcPtr timerProc);
484 * Returns the timer user data.
485 * @param timertaskhandle The handle to the timertask
486 * @return The timer user data.
488 extern GHOST_TUserDataPtr GHOST_GetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle);
491 * Changes the time user data.
492 * @param timertaskhandle The handle to the timertask
493 * @param data The timer user data.
495 extern void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle,
496 GHOST_TUserDataPtr userData);
499 * Returns indication as to whether the window is valid.
500 * @param windowhandle The handle to the window
501 * @return The validity of the window.
503 extern int GHOST_GetValid(GHOST_WindowHandle windowhandle) ;
506 * Returns the type of drawing context used in this window.
507 * @param windowhandle The handle to the window
508 * @return The current type of drawing context.
510 extern GHOST_TDrawingContextType GHOST_GetDrawingContextType(GHOST_WindowHandle windowhandle);
513 * Tries to install a rendering context in this window.
514 * @param windowhandle The handle to the window
515 * @param type The type of rendering context installed.
516 * @return Indication as to whether installation has succeeded.
518 extern GHOST_TSuccess GHOST_SetDrawingContextType(GHOST_WindowHandle windowhandle,
519 GHOST_TDrawingContextType type);
522 * Sets the title displayed in the title bar.
523 * @param windowhandle The handle to the window
524 * @param title The title to display in the title bar.
526 extern void GHOST_SetTitle(GHOST_WindowHandle windowhandle,
530 * Returns the title displayed in the title bar. The title
531 * should be free'd with free().
533 * @param windowhandle The handle to the window
534 * @return The title, free with free().
536 extern char* GHOST_GetTitle(GHOST_WindowHandle windowhandle);
539 * Returns the window rectangle dimensions.
540 * These are screen coordinates.
541 * @param windowhandle The handle to the window
542 * @return A handle to the bounding rectangle of the window.
544 extern GHOST_RectangleHandle GHOST_GetWindowBounds(GHOST_WindowHandle windowhandle);
547 * Returns the client rectangle dimensions.
548 * The left and top members of the rectangle are always zero.
549 * @param windowhandle The handle to the window
550 * @return A handle to the bounding rectangle of the window.
552 extern GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle);
555 * Disposes a rectangle object
556 * @param rectanglehandle Handle to the rectangle.
558 void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle);
561 * Resizes client rectangle width.
562 * @param windowhandle The handle to the window
563 * @param width The new width of the client area of the window.
564 * @return Indication of success.
566 extern GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle,
570 * Resizes client rectangle height.
571 * @param windowhandle The handle to the window
572 * @param height The new height of the client area of the window.
573 * @return Indication of success.
575 extern GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle,
576 GHOST_TUns32 height);
579 * Resizes client rectangle.
580 * @param windowhandle The handle to the window
581 * @param width The new width of the client area of the window.
582 * @param height The new height of the client area of the window.
583 * @return Indication of success.
585 extern GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
587 GHOST_TUns32 height);
590 * Converts a point in screen coordinates to client rectangle coordinates
591 * @param windowhandle The handle to the window
592 * @param inX The x-coordinate on the screen.
593 * @param inY The y-coordinate on the screen.
594 * @param outX The x-coordinate in the client rectangle.
595 * @param outY The y-coordinate in the client rectangle.
597 extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
601 GHOST_TInt32* outY) ;
604 * Converts a point in screen coordinates to client rectangle coordinates
605 * @param windowhandle The handle to the window
606 * @param inX The x-coordinate in the client rectangle.
607 * @param inY The y-coordinate in the client rectangle.
608 * @param outX The x-coordinate on the screen.
609 * @param outY The y-coordinate on the screen.
611 extern void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle,
618 * Returns the state of the window (normal, minimized, maximized).
619 * @param windowhandle The handle to the window
620 * @return The state of the window.
622 extern GHOST_TWindowState GHOST_GetWindowState(GHOST_WindowHandle windowhandle);
625 * Sets the state of the window (normal, minimized, maximized).
626 * @param windowhandle The handle to the window
627 * @param state The state of the window.
628 * @return Indication of success.
630 extern GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle,
631 GHOST_TWindowState state);
635 * Sets the window "modified" status, indicating unsaved changes
636 * @param windowhandle The handle to the window
637 * @param isUnsavedChanges Unsaved changes or not
638 * @return Indication of success.
640 extern GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle,
641 GHOST_TUns8 isUnsavedChanges);
644 * Sets the order of the window (bottom, top).
645 * @param windowhandle The handle to the window
646 * @param order The order of the window.
647 * @return Indication of success.
649 extern GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle,
650 GHOST_TWindowOrder order);
653 * Swaps front and back buffers of a window.
654 * @param windowhandle The handle to the window
655 * @return An intean success indicator.
657 extern GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle);
660 * Activates the drawing context of this window.
661 * @param windowhandle The handle to the window
662 * @return An intean success indicator.
664 extern GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle);
667 * Invalidates the contents of this window.
668 * @param windowhandle The handle to the window
669 * @return Indication of success.
671 extern GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle windowhandle);
674 * Returns the status of the tablet
675 * @param windowhandle The handle to the window
676 * @return Status of tablet
678 extern const GHOST_TabletData *GHOST_GetTabletData(GHOST_WindowHandle windowhandle);
681 * Access to rectangle width.
682 * @param rectanglehandle The handle to the rectangle
683 * @return width of the rectangle
685 extern GHOST_TInt32 GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle);
688 * Access to rectangle height.
689 * @param rectanglehandle The handle to the rectangle
690 * @return height of the rectangle
692 extern GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle);
695 * Gets all members of the rectangle.
696 * @param rectanglehandle The handle to the rectangle
697 * @param l Pointer to return left coordinate in.
698 * @param t Pointer to return top coordinate in.
699 * @param r Pointer to return right coordinate in.
700 * @param b Pointer to return bottom coordinate in.
702 extern void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle,
709 * Sets all members of the rectangle.
710 * @param rectanglehandle The handle to the rectangle
711 * @param l requested left coordinate of the rectangle
712 * @param t requested top coordinate of the rectangle
713 * @param r requested right coordinate of the rectangle
714 * @param b requested bottom coordinate of the rectangle
716 extern void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle,
723 * Returns whether this rectangle is empty.
724 * Empty rectangles are rectangles that have width==0 and/or height==0.
725 * @param rectanglehandle The handle to the rectangle
726 * @return intean value (true == empty rectangle)
728 extern GHOST_TSuccess GHOST_IsEmptyRectangle(GHOST_RectangleHandle rectanglehandle);
731 * Returns whether this rectangle is valid.
732 * Valid rectangles are rectangles that have m_l <= m_r and m_t <= m_b. Thus, emapty rectangles are valid.
733 * @param rectanglehandle The handle to the rectangle
734 * @return intean value (true==valid rectangle)
736 extern GHOST_TSuccess GHOST_IsValidRectangle(GHOST_RectangleHandle rectanglehandle);
739 * Grows (or shrinks the rectangle).
740 * The method avoids negative insets making the rectangle invalid
741 * @param rectanglehandle The handle to the rectangle
742 * @param i The amount of offset given to each extreme (negative values shrink the rectangle).
744 extern void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle,
748 * Does a union of the rectangle given and this rectangle.
749 * The result is stored in this rectangle.
750 * @param rectanglehandle The handle to the rectangle
751 * @param r The rectangle that is input for the union operation.
753 extern void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle,
754 GHOST_RectangleHandle anotherrectanglehandle);
757 * Grows the rectangle to included a point.
758 * @param rectanglehandle The handle to the rectangle
759 * @param x The x-coordinate of the point.
760 * @param y The y-coordinate of the point.
762 extern void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle,
767 * Returns whether the point is inside this rectangle.
768 * Point on the boundary is considered inside.
769 * @param rectanglehandle The handle to the rectangle
770 * @param x x-coordinate of point to test.
771 * @param y y-coordinate of point to test.
772 * @return intean value (true if point is inside).
774 extern GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehandle,
779 * Returns whether the rectangle is inside this rectangle.
780 * @param rectanglehandle The handle to the rectangle
781 * @param r rectangle to test.
782 * @return visibility (not, partially or fully visible).
784 extern GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rectanglehandle,
785 GHOST_RectangleHandle anotherrectanglehandle);
788 * Sets rectangle members.
789 * Sets rectangle members such that it is centered at the given location.
790 * @param rectanglehandle The handle to the rectangle
791 * @param cx requested center x-coordinate of the rectangle
792 * @param cy requested center y-coordinate of the rectangle
794 extern void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle,
799 * Sets rectangle members.
800 * Sets rectangle members such that it is centered at the given location,
801 * with the width requested.
802 * @param rectanglehandle The handle to the rectangle
803 * @param cx requested center x-coordinate of the rectangle
804 * @param cy requested center y-coordinate of the rectangle
805 * @param w requested width of the rectangle
806 * @param h requested height of the rectangle
808 extern void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle,
816 * Updates the rectangle given such that it will fit within this one.
817 * This can result in an empty rectangle.
818 * @param rectanglehandle The handle to the rectangle
819 * @param r the rectangle to clip
820 * @return whether clipping has occurred
822 extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
823 GHOST_RectangleHandle anotherrectanglehandle);
826 * Return the data from the clipboad
827 * @param return the selection instead, X11 only feature
828 * @return clipboard data
830 extern GHOST_TUns8* GHOST_getClipboard(int selection);
833 * Put data to the Clipboard
834 * @param set the selection instead, X11 only feature
836 extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection);