|
LMMS
|
Macros | |
| #define | PUGL_NUM_CURSORS ((unsigned)PUGL_CURSOR_ANTI_DIAGONAL + 1u) |
| The number of PuglCursor values. | |
Enumerations | |
| enum | PuglCursor { PUGL_CURSOR_ARROW , PUGL_CURSOR_CARET , PUGL_CURSOR_CROSSHAIR , PUGL_CURSOR_HAND , PUGL_CURSOR_NO , PUGL_CURSOR_LEFT_RIGHT , PUGL_CURSOR_UP_DOWN , PUGL_CURSOR_DIAGONAL , PUGL_CURSOR_ANTI_DIAGONAL } |
Functions for interacting with the user and window system.
| #define PUGL_NUM_CURSORS ((unsigned)PUGL_CURSOR_ANTI_DIAGONAL + 1u) |
The number of PuglCursor values.
| enum PuglCursor |
A mouse cursor type.
This is a portable subset of mouse cursors that exist on X11, MacOS, and Windows.
| PUGL_API PuglStatus puglAcceptOffer | ( | PuglView * | view, |
| const PuglDataOfferEvent * | offer, | ||
| uint32_t | typeIndex ) |
Accept data offered from a clipboard.
To accept data, this must be called while handling a PUGL_DATA_OFFER event. Doing so will request the data from the source as the specified type. When the data is available, a PUGL_DATA event will be sent to the view which can then retrieve the data with puglGetClipboard().
| View | The view. |
| offer | The data offer event. |
| typeIndex | The index of the type that the view will accept. This is the typeIndex argument to the call of puglGetClipboardType() that returned the accepted type. |
Get the clipboard contents.
This gets the system clipboard contents, which may have been set with puglSetClipboard() or copied from another application.
| View | The view. | |
| typeIndex | Index of the data type to get the item as. | |
| [out] | len | Set to the length of the data in bytes. |
Return the identifier of a type available in a clipboard.
This is usually a MIME type, but may also be another platform-specific type identifier. Applications must ignore any type they do not recognize.
Returns null if typeIndex is out of bounds according to puglGetNumClipboardTypes().
Return the number of types available for the data in a clipboard.
Returns zero if the clipboard is empty.
| PUGL_API PuglStatus puglGrabFocus | ( | PuglView * | view | ) |
Grab the keyboard input focus.
Note that this will fail if the view is not mapped and so should not, for example, be called immediately after puglShow().
Return whether View has the keyboard input focus.
| PUGL_API PuglStatus puglPaste | ( | PuglView * | view | ) |
Request data from the general copy/paste clipboard.
A PUGL_DATA_OFFER event will be sent if data is available.
| PUGL_API PuglStatus puglRequestAttention | ( | PuglView * | view | ) |
Request user attention.
This hints to the system that the window or application requires attention from the user. The exact effect depends on the platform, but is usually something like a flashing task bar entry or bouncing application icon.
| PUGL_API PuglStatus puglSendEvent | ( | PuglView * | view, |
| const PuglEvent * | event ) |
Send an event to a view via the window system.
If supported, the event will be delivered to the view via the event loop like other events. Note that this function only works for certain event types.
Currently, only PUGL_CLIENT events are supported on all platforms.
X11: A PUGL_EXPOSE event can be sent, which is similar to calling puglPostRedisplayRect(), but will always send a message to the X server, even when called in an event handler.
| PUGL_API PuglStatus puglSetClipboard | ( | PuglView * | view, |
| const char * | type, | ||
| const void * | data, | ||
| size_t | len ) |
Set the clipboard contents.
This sets the system clipboard contents, which can be retrieved with puglGetClipboard() or pasted into other applications.
| PUGL_API PuglStatus puglSetCursor | ( | PuglView * | view, |
| PuglCursor | cursor ) |
Set the mouse cursor.
This changes the system cursor that is displayed when the pointer is inside the view. May fail if setting the cursor is not supported on this system, for example if compiled on X11 without Xcursor support.
| PUGL_API PuglStatus puglStartTimer | ( | PuglView * | view, |
| uintptr_t | id, | ||
| double | timeout ) |
Activate a repeating timer event.
This starts a timer which will send a PuglTimerEvent to View every timeout seconds. This can be used to perform some action in a view at a regular interval with relatively low frequency. Note that the frequency of timer events may be limited by how often puglUpdate() is called.
If the given timer already exists, it is replaced.
| View | The view to begin sending PUGL_TIMER events to. |
| id | The identifier for this timer. This is an application-specific ID that should be a low number, typically the value of a constant or enum that starts from 0. There is a platform-specific limit to the number of supported timers, and overhead associated with each, so applications should create only a few timers and perform several tasks in one if necessary. |
| timeout | The period, in seconds, of this timer. This is not guaranteed to have a resolution better than 10ms (the maximum timer resolution on Windows) and may be rounded up if it is too short. On X11 and MacOS, a resolution of about 1ms can usually be relied on. |
| PUGL_API PuglStatus puglStopTimer | ( | PuglView * | view, |
| uintptr_t | id ) |
Stop an active timer.
| View | The view that the timer is set for. |
| id | The ID previously passed to puglStartTimer(). |