clipboard refactoring
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
5c386e7665
commit
b641a03bae
12 changed files with 116 additions and 73 deletions
|
|
@ -362,10 +362,11 @@ MWDECL void MwGetScreenSize(MwWidget handle, MwRect* rect);
|
|||
MWDECL int MwGetCoordinateType(MwWidget handle);
|
||||
|
||||
/*!
|
||||
* @brief Queue to get clipboard content
|
||||
* @brief Queue to get clipboard content.
|
||||
* @param handle Widget
|
||||
* @param clipboard_type The Clipboard Type to get. See MwClipboardType. This is ignored on backends that aren't X11/Wayland, so if you're unsure, just use MwClipboardMain
|
||||
*/
|
||||
MWDECL void MwGetClipboard(MwWidget handle);
|
||||
MWDECL void MwGetClipboard(MwWidget handle, int clipboard_type);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,8 +234,8 @@ MWDECL void (*MwLLEndStateChange)(MwLL handle);
|
|||
MWDECL void (*MwLLFocus)(MwLL handle);
|
||||
MWDECL void (*MwLLGrabPointer)(MwLL handle, int toggle);
|
||||
|
||||
MWDECL void (*MwLLSetClipboard)(MwLL handle, const char* text);
|
||||
MWDECL void (*MwLLGetClipboard)(MwLL handle);
|
||||
MWDECL void (*MwLLSetClipboard)(MwLL handle, const char* text, int clipboard_type);
|
||||
MWDECL void (*MwLLGetClipboard)(MwLL handle, int clipboard_type);
|
||||
|
||||
MWDECL void (*MwLLGetCursorCoord)(MwLL handle, MwPoint* point);
|
||||
MWDECL void (*MwLLGetScreenSize)(MwLL handle, MwRect* rect);
|
||||
|
|
|
|||
|
|
@ -439,7 +439,7 @@ struct _MwLLWayland {
|
|||
/* clipboard related stuff.
|
||||
* Note that unlike most interfaces, we don't keep zwp_primary_selection stuff in a wayland_protocol_t because we use wl_data_device as a fallback and want to have it share memory space.*/
|
||||
|
||||
union {
|
||||
struct {
|
||||
struct wl_data_device_manager* wl;
|
||||
struct zwp_primary_selection_device_manager_v1* zwp;
|
||||
} clipboard_manager;
|
||||
|
|
@ -451,7 +451,8 @@ struct _MwLLWayland {
|
|||
MwBool supports_zwp;
|
||||
|
||||
uint32_t clipboard_serial;
|
||||
wl_clipboard_device_context_t** clipboard_devices;
|
||||
wl_clipboard_device_context_t** clipboard_devices_wl;
|
||||
wl_clipboard_device_context_t** clipboard_devices_zwp;
|
||||
|
||||
struct wl_pointer* pointer;
|
||||
MwU32 pointer_serial;
|
||||
|
|
|
|||
|
|
@ -239,4 +239,12 @@ enum MwCoordinateType {
|
|||
MwCoordinatesLocal,
|
||||
};
|
||||
|
||||
/* The clipboard type that MwGetClipboard should return */
|
||||
enum MwClipboardType {
|
||||
/* the clipboard that is present on every platform that supports it */
|
||||
MwClipboardMain = 0,
|
||||
/* the "primary" clipboard that Wayland stores to emulate X11's behavior. */
|
||||
MwClipboardPrimary,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue