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 *****
31 * \brief GHOST C-API function and type declarations.
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);
267 * Remove the given event consumer to our list.
268 * @param systemhandle The handle to the system
269 * @param consumerhandle The event consumer to remove.
270 * @return Indication of success.
272 extern GHOST_TSuccess GHOST_RemoveEventConsumer(GHOST_SystemHandle systemhandle,
273 GHOST_EventConsumerHandle consumerhandle);
275 /***************************************************************************************
276 ** Progress bar functionality
277 ***************************************************************************************/
280 * Sets the progress bar value displayed in the window/application icon
281 * @param windowhandle The handle to the window
282 * @param progress The progress % (0.0 to 1.0)
284 extern GHOST_TSuccess GHOST_SetProgressBar(GHOST_WindowHandle windowhandle, float progress);
287 * Hides the progress bar in the icon
288 * @param windowhandle The handle to the window
290 extern GHOST_TSuccess GHOST_EndProgressBar(GHOST_WindowHandle windowhandle);
292 /***************************************************************************************
293 ** Cursor management functionality
294 ***************************************************************************************/
297 * Returns the current cursor shape.
298 * @param windowhandle The handle to the window
299 * @return The current cursor shape.
301 extern GHOST_TStandardCursor GHOST_GetCursorShape(GHOST_WindowHandle windowhandle);
304 * Set the shape of the cursor.
305 * @param windowhandle The handle to the window
306 * @param cursor The new cursor shape type id.
307 * @return Indication of success.
309 extern GHOST_TSuccess GHOST_SetCursorShape(GHOST_WindowHandle windowhandle,
310 GHOST_TStandardCursor cursorshape);
313 * Set the shape of the cursor to a custom cursor.
314 * @param windowhandle The handle to the window
315 * @param bitmap The bitmap data for the cursor.
316 * @param mask The mask data for the cursor.
317 * @param hotX The X coordinate of the cursor hotspot.
318 * @param hotY The Y coordinate of the cursor hotspot.
319 * @return Indication of success.
321 extern GHOST_TSuccess GHOST_SetCustomCursorShape(GHOST_WindowHandle windowhandle,
322 GHOST_TUns8 bitmap[16][2],
323 GHOST_TUns8 mask[16][2],
327 * Set the shape of the cursor to a custom cursor of specified size.
328 * @param windowhandle The handle to the window
329 * @param bitmap The bitmap data for the cursor.
330 * @param mask The mask data for the cursor.
331 * @parm sizex, sizey The size of the cursor
332 * @param hotX The X coordinate of the cursor hotspot.
333 * @param hotY The Y coordinate of the cursor hotspot.
334 * @param fg_color, bg_color Colors of the cursor
335 * @return Indication of success.
337 extern GHOST_TSuccess GHOST_SetCustomCursorShapeEx(GHOST_WindowHandle windowhandle,
340 int sizex, int sizey,
342 int fg_color, int bg_color );
345 * Returns the visibility state of the cursor.
346 * @param windowhandle The handle to the window
347 * @return The visibility state of the cursor.
349 extern int GHOST_GetCursorVisibility(GHOST_WindowHandle windowhandle);
352 * Shows or hides the cursor.
353 * @param windowhandle The handle to the window
354 * @param visible The new visibility state of the cursor.
355 * @return Indication of success.
357 extern GHOST_TSuccess GHOST_SetCursorVisibility(GHOST_WindowHandle windowhandle,
361 * Returns the current location of the cursor (location in screen coordinates)
362 * @param systemhandle The handle to the system
363 * @param x The x-coordinate of the cursor.
364 * @param y The y-coordinate of the cursor.
365 * @return Indication of success.
367 extern GHOST_TSuccess GHOST_GetCursorPosition(GHOST_SystemHandle systemhandle,
372 * Updates the location of the cursor (location in screen coordinates).
373 * Not all operating systems allow the cursor to be moved (without the input device being moved).
374 * @param systemhandle The handle to the system
375 * @param x The x-coordinate of the cursor.
376 * @param y The y-coordinate of the cursor.
377 * @return Indication of success.
379 extern GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
384 * Grabs the cursor for a modal operation, to keep receiving
385 * events when the mouse is outside the window. X11 only, others
386 * do this automatically.
387 * @param windowhandle The handle to the window
388 * @param mode The new grab state of the cursor.
389 * @param bounds The grab ragion (optional) - left,top,right,bottom
390 * @return Indication of success.
392 extern GHOST_TSuccess GHOST_SetCursorGrab(GHOST_WindowHandle windowhandle,
393 GHOST_TGrabCursorMode mode,
396 /***************************************************************************************
397 ** Access to mouse button and keyboard states.
398 ***************************************************************************************/
401 * Returns the state of a modifier key (ouside the message queue).
402 * @param systemhandle The handle to the system
403 * @param mask The modifier key state to retrieve.
404 * @param isDown Pointer to return modifier state in.
405 * @return Indication of success.
407 extern GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
408 GHOST_TModifierKeyMask mask,
412 * Returns the state of a mouse button (ouside the message queue).
413 * @param systemhandle The handle to the system
414 * @param mask The button state to retrieve.
415 * @param isDown Pointer to return button state in.
416 * @return Indication of success.
418 extern GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
419 GHOST_TButtonMask mask,
423 /***************************************************************************************
424 ** Drag'n'drop operations
425 ***************************************************************************************/
428 * Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
430 extern void GHOST_setAcceptDragOperation(GHOST_WindowHandle windowhandle, GHOST_TInt8 canAccept);
434 * Returns the event type.
435 * @param eventhandle The handle to the event
436 * @return The event type.
438 extern GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle);
441 * Returns the time this event was generated.
442 * @param eventhandle The handle to the event
443 * @return The event generation time.
445 extern GHOST_TUns64 GHOST_GetEventTime(GHOST_EventHandle eventhandle);
448 * Returns the window this event was generated on,
449 * or NULL if it is a 'system' event.
450 * @param eventhandle The handle to the event
451 * @return The generating window.
453 extern GHOST_WindowHandle GHOST_GetEventWindow(GHOST_EventHandle eventhandle);
456 * Returns the event data.
457 * @param eventhandle The handle to the event
458 * @return The event data.
460 extern GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle);
463 * Returns the timer callback.
464 * @param timertaskhandle The handle to the timertask
465 * @return The timer callback.
467 extern GHOST_TimerProcPtr GHOST_GetTimerProc(GHOST_TimerTaskHandle timertaskhandle);
470 * Changes the timer callback.
471 * @param timertaskhandle The handle to the timertask
472 * @param timerProc The timer callback.
474 extern void GHOST_SetTimerProc(GHOST_TimerTaskHandle timertaskhandle,
475 GHOST_TimerProcPtr timerProc);
478 * Returns the timer user data.
479 * @param timertaskhandle The handle to the timertask
480 * @return The timer user data.
482 extern GHOST_TUserDataPtr GHOST_GetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle);
485 * Changes the time user data.
486 * @param timertaskhandle The handle to the timertask
487 * @param data The timer user data.
489 extern void GHOST_SetTimerTaskUserData(GHOST_TimerTaskHandle timertaskhandle,
490 GHOST_TUserDataPtr userData);
493 * Returns indication as to whether the window is valid.
494 * @param windowhandle The handle to the window
495 * @return The validity of the window.
497 extern int GHOST_GetValid(GHOST_WindowHandle windowhandle) ;
500 * Returns the type of drawing context used in this window.
501 * @param windowhandle The handle to the window
502 * @return The current type of drawing context.
504 extern GHOST_TDrawingContextType GHOST_GetDrawingContextType(GHOST_WindowHandle windowhandle);
507 * Tries to install a rendering context in this window.
508 * @param windowhandle The handle to the window
509 * @param type The type of rendering context installed.
510 * @return Indication as to whether installation has succeeded.
512 extern GHOST_TSuccess GHOST_SetDrawingContextType(GHOST_WindowHandle windowhandle,
513 GHOST_TDrawingContextType type);
516 * Sets the title displayed in the title bar.
517 * @param windowhandle The handle to the window
518 * @param title The title to display in the title bar.
520 extern void GHOST_SetTitle(GHOST_WindowHandle windowhandle,
524 * Returns the title displayed in the title bar. The title
525 * should be free'd with free().
527 * @param windowhandle The handle to the window
528 * @return The title, free with free().
530 extern char* GHOST_GetTitle(GHOST_WindowHandle windowhandle);
533 * Returns the window rectangle dimensions.
534 * These are screen coordinates.
535 * @param windowhandle The handle to the window
536 * @return A handle to the bounding rectangle of the window.
538 extern GHOST_RectangleHandle GHOST_GetWindowBounds(GHOST_WindowHandle windowhandle);
541 * Returns the client rectangle dimensions.
542 * The left and top members of the rectangle are always zero.
543 * @param windowhandle The handle to the window
544 * @return A handle to the bounding rectangle of the window.
546 extern GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle);
549 * Disposes a rectangle object
550 * @param rectanglehandle Handle to the rectangle.
552 void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle);
555 * Resizes client rectangle width.
556 * @param windowhandle The handle to the window
557 * @param width The new width of the client area of the window.
558 * @return Indication of success.
560 extern GHOST_TSuccess GHOST_SetClientWidth(GHOST_WindowHandle windowhandle,
564 * Resizes client rectangle height.
565 * @param windowhandle The handle to the window
566 * @param height The new height of the client area of the window.
567 * @return Indication of success.
569 extern GHOST_TSuccess GHOST_SetClientHeight(GHOST_WindowHandle windowhandle,
570 GHOST_TUns32 height);
573 * Resizes client rectangle.
574 * @param windowhandle The handle to the window
575 * @param width The new width of the client area of the window.
576 * @param height The new height of the client area of the window.
577 * @return Indication of success.
579 extern GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle,
581 GHOST_TUns32 height);
584 * Converts a point in screen coordinates to client rectangle coordinates
585 * @param windowhandle The handle to the window
586 * @param inX The x-coordinate on the screen.
587 * @param inY The y-coordinate on the screen.
588 * @param outX The x-coordinate in the client rectangle.
589 * @param outY The y-coordinate in the client rectangle.
591 extern void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle,
595 GHOST_TInt32* outY) ;
598 * Converts a point in screen coordinates to client rectangle coordinates
599 * @param windowhandle The handle to the window
600 * @param inX The x-coordinate in the client rectangle.
601 * @param inY The y-coordinate in the client rectangle.
602 * @param outX The x-coordinate on the screen.
603 * @param outY The y-coordinate on the screen.
605 extern void GHOST_ClientToScreen(GHOST_WindowHandle windowhandle,
612 * Returns the state of the window (normal, minimized, maximized).
613 * @param windowhandle The handle to the window
614 * @return The state of the window.
616 extern GHOST_TWindowState GHOST_GetWindowState(GHOST_WindowHandle windowhandle);
619 * Sets the state of the window (normal, minimized, maximized).
620 * @param windowhandle The handle to the window
621 * @param state The state of the window.
622 * @return Indication of success.
624 extern GHOST_TSuccess GHOST_SetWindowState(GHOST_WindowHandle windowhandle,
625 GHOST_TWindowState state);
629 * Sets the window "modified" status, indicating unsaved changes
630 * @param windowhandle The handle to the window
631 * @param isUnsavedChanges Unsaved changes or not
632 * @return Indication of success.
634 extern GHOST_TSuccess GHOST_SetWindowModifiedState(GHOST_WindowHandle windowhandle,
635 GHOST_TUns8 isUnsavedChanges);
638 * Sets the order of the window (bottom, top).
639 * @param windowhandle The handle to the window
640 * @param order The order of the window.
641 * @return Indication of success.
643 extern GHOST_TSuccess GHOST_SetWindowOrder(GHOST_WindowHandle windowhandle,
644 GHOST_TWindowOrder order);
647 * Swaps front and back buffers of a window.
648 * @param windowhandle The handle to the window
649 * @return An intean success indicator.
651 extern GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle);
654 * Activates the drawing context of this window.
655 * @param windowhandle The handle to the window
656 * @return An intean success indicator.
658 extern GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle);
661 * Invalidates the contents of this window.
662 * @param windowhandle The handle to the window
663 * @return Indication of success.
665 extern GHOST_TSuccess GHOST_InvalidateWindow(GHOST_WindowHandle windowhandle);
668 * Returns the status of the tablet
669 * @param windowhandle The handle to the window
670 * @return Status of tablet
672 extern const GHOST_TabletData *GHOST_GetTabletData(GHOST_WindowHandle windowhandle);
675 * Access to rectangle width.
676 * @param rectanglehandle The handle to the rectangle
677 * @return width of the rectangle
679 extern GHOST_TInt32 GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle);
682 * Access to rectangle height.
683 * @param rectanglehandle The handle to the rectangle
684 * @return height of the rectangle
686 extern GHOST_TInt32 GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle);
689 * Gets all members of the rectangle.
690 * @param rectanglehandle The handle to the rectangle
691 * @param l Pointer to return left coordinate in.
692 * @param t Pointer to return top coordinate in.
693 * @param r Pointer to return right coordinate in.
694 * @param b Pointer to return bottom coordinate in.
696 extern void GHOST_GetRectangle(GHOST_RectangleHandle rectanglehandle,
703 * Sets all members of the rectangle.
704 * @param rectanglehandle The handle to the rectangle
705 * @param l requested left coordinate of the rectangle
706 * @param t requested top coordinate of the rectangle
707 * @param r requested right coordinate of the rectangle
708 * @param b requested bottom coordinate of the rectangle
710 extern void GHOST_SetRectangle(GHOST_RectangleHandle rectanglehandle,
717 * Returns whether this rectangle is empty.
718 * Empty rectangles are rectangles that have width==0 and/or height==0.
719 * @param rectanglehandle The handle to the rectangle
720 * @return intean value (true == empty rectangle)
722 extern GHOST_TSuccess GHOST_IsEmptyRectangle(GHOST_RectangleHandle rectanglehandle);
725 * Returns whether this rectangle is valid.
726 * Valid rectangles are rectangles that have m_l <= m_r and m_t <= m_b. Thus, emapty rectangles are valid.
727 * @param rectanglehandle The handle to the rectangle
728 * @return intean value (true==valid rectangle)
730 extern GHOST_TSuccess GHOST_IsValidRectangle(GHOST_RectangleHandle rectanglehandle);
733 * Grows (or shrinks the rectangle).
734 * The method avoids negative insets making the rectangle invalid
735 * @param rectanglehandle The handle to the rectangle
736 * @param i The amount of offset given to each extreme (negative values shrink the rectangle).
738 extern void GHOST_InsetRectangle(GHOST_RectangleHandle rectanglehandle,
742 * Does a union of the rectangle given and this rectangle.
743 * The result is stored in this rectangle.
744 * @param rectanglehandle The handle to the rectangle
745 * @param r The rectangle that is input for the union operation.
747 extern void GHOST_UnionRectangle(GHOST_RectangleHandle rectanglehandle,
748 GHOST_RectangleHandle anotherrectanglehandle);
751 * Grows the rectangle to included a point.
752 * @param rectanglehandle The handle to the rectangle
753 * @param x The x-coordinate of the point.
754 * @param y The y-coordinate of the point.
756 extern void GHOST_UnionPointRectangle(GHOST_RectangleHandle rectanglehandle,
761 * Returns whether the point is inside this rectangle.
762 * Point on the boundary is considered inside.
763 * @param rectanglehandle The handle to the rectangle
764 * @param x x-coordinate of point to test.
765 * @param y y-coordinate of point to test.
766 * @return intean value (true if point is inside).
768 extern GHOST_TSuccess GHOST_IsInsideRectangle(GHOST_RectangleHandle rectanglehandle,
773 * Returns whether the rectangle is inside this rectangle.
774 * @param rectanglehandle The handle to the rectangle
775 * @param r rectangle to test.
776 * @return visibility (not, partially or fully visible).
778 extern GHOST_TVisibility GHOST_GetRectangleVisibility(GHOST_RectangleHandle rectanglehandle,
779 GHOST_RectangleHandle anotherrectanglehandle);
782 * Sets rectangle members.
783 * Sets rectangle members such that it is centered at the given location.
784 * @param rectanglehandle The handle to the rectangle
785 * @param cx requested center x-coordinate of the rectangle
786 * @param cy requested center y-coordinate of the rectangle
788 extern void GHOST_SetCenterRectangle(GHOST_RectangleHandle rectanglehandle,
793 * Sets rectangle members.
794 * Sets rectangle members such that it is centered at the given location,
795 * with the width requested.
796 * @param rectanglehandle The handle to the rectangle
797 * @param cx requested center x-coordinate of the rectangle
798 * @param cy requested center y-coordinate of the rectangle
799 * @param w requested width of the rectangle
800 * @param h requested height of the rectangle
802 extern void GHOST_SetRectangleCenter(GHOST_RectangleHandle rectanglehandle,
810 * Updates the rectangle given such that it will fit within this one.
811 * This can result in an empty rectangle.
812 * @param rectanglehandle The handle to the rectangle
813 * @param r the rectangle to clip
814 * @return whether clipping has occurred
816 extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
817 GHOST_RectangleHandle anotherrectanglehandle);
820 * Return the data from the clipboad
821 * @param return the selection instead, X11 only feature
822 * @return clipboard data
824 extern GHOST_TUns8* GHOST_getClipboard(int selection);
827 * Put data to the Clipboard
828 * @param set the selection instead, X11 only feature
830 extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection);
839 * 3 - Hides if it runs not from command line
841 * @return current status (1 -visible, 0 - hidden)
843 extern int GHOST_toggleConsole(int action);