UI: Capabilities Flag for Clipboard Image copy/paste
This adds an WM_capabilities_flag to indicate that a platform implements support for copying and pasting images using a shared clipboard. Pull Request: https://projects.blender.org/blender/blender/pulls/106990
This commit is contained in:
parent
254d148458
commit
de7e3454fb
|
@ -102,6 +102,10 @@ typedef enum {
|
|||
* Support for reading the front-buffer.
|
||||
*/
|
||||
GHOST_kCapabilityGPUReadFrontBuffer = (1 << 3),
|
||||
/**
|
||||
* Set when there is support for system clipboard copy/paste.
|
||||
*/
|
||||
GHOST_kCapabilityClipboardImages = (1 << 4),
|
||||
} GHOST_TCapabilityFlag;
|
||||
|
||||
/**
|
||||
|
|
|
@ -903,7 +903,9 @@ GHOST_TCapabilityFlag GHOST_SystemCocoa::getCapabilities() const
|
|||
return GHOST_TCapabilityFlag(GHOST_CAPABILITY_FLAG_ALL &
|
||||
~(
|
||||
/* Cocoa has no support for a primary selection clipboard. */
|
||||
GHOST_kCapabilityPrimaryClipboard));
|
||||
GHOST_kCapabilityPrimaryClipboard |
|
||||
/* This Cocoa back-end has not yet implemented image copy/paste. */
|
||||
GHOST_kCapabilityClipboardImages));
|
||||
}
|
||||
|
||||
#pragma mark Event handlers
|
||||
|
|
|
@ -47,7 +47,8 @@ class GHOST_SystemHeadless : public GHOST_System {
|
|||
return GHOST_TCapabilityFlag(GHOST_CAPABILITY_FLAG_ALL &
|
||||
/* No windowing functionality supported. */
|
||||
~(GHOST_kCapabilityWindowPosition | GHOST_kCapabilityCursorWarp |
|
||||
GHOST_kCapabilityPrimaryClipboard));
|
||||
GHOST_kCapabilityPrimaryClipboard |
|
||||
GHOST_kCapabilityClipboardImages));
|
||||
}
|
||||
char *getClipboard(bool /*selection*/) const override
|
||||
{
|
||||
|
|
|
@ -757,7 +757,9 @@ GHOST_TCapabilityFlag GHOST_SystemSDL::getCapabilities() const
|
|||
GHOST_CAPABILITY_FLAG_ALL &
|
||||
~(
|
||||
/* This SDL back-end has not yet implemented primary clipboard. */
|
||||
GHOST_kCapabilityPrimaryClipboard));
|
||||
GHOST_kCapabilityPrimaryClipboard |
|
||||
/* This SDL back-end has not yet implemented image copy/paste. */
|
||||
GHOST_kCapabilityClipboardImages));
|
||||
}
|
||||
|
||||
char *GHOST_SystemSDL::getClipboard(bool /*selection*/) const
|
||||
|
|
|
@ -6765,7 +6765,9 @@ GHOST_TCapabilityFlag GHOST_SystemWayland::getCapabilities() const
|
|||
GHOST_kCapabilityCursorWarp |
|
||||
/* Some drivers don't support front-buffer reading, see: #98462 & #106264.
|
||||
* We could inspect the graphics card driver - for now just disable on WAYLAND. */
|
||||
GHOST_kCapabilityGPUReadFrontBuffer));
|
||||
GHOST_kCapabilityGPUReadFrontBuffer |
|
||||
/* This WAYLAND back-end has not yet implemented image copy/paste. */
|
||||
GHOST_kCapabilityClipboardImages));
|
||||
}
|
||||
|
||||
bool GHOST_SystemWayland::cursor_grab_use_software_display_get(const GHOST_TGrabCursorMode mode)
|
||||
|
|
|
@ -1742,7 +1742,10 @@ GHOST_TSuccess GHOST_SystemX11::setCursorPosition(int32_t x, int32_t y)
|
|||
|
||||
GHOST_TCapabilityFlag GHOST_SystemX11::getCapabilities() const
|
||||
{
|
||||
return GHOST_TCapabilityFlag(GHOST_CAPABILITY_FLAG_ALL);
|
||||
return GHOST_TCapabilityFlag(GHOST_CAPABILITY_FLAG_ALL &
|
||||
~(
|
||||
/* No support yet for image copy/paste. */
|
||||
GHOST_kCapabilityClipboardImages));
|
||||
}
|
||||
|
||||
void GHOST_SystemX11::addDirtyWindow(GHOST_WindowX11 *bad_wind)
|
||||
|
|
|
@ -138,6 +138,8 @@ typedef enum eWM_CapabilitiesFlag {
|
|||
* Reading from the back-buffer is supported.
|
||||
*/
|
||||
WM_CAPABILITY_GPU_FRONT_BUFFER_READ = (1 << 3),
|
||||
/** Ability to copy/paste system clipboard images. */
|
||||
WM_CAPABILITY_CLIPBOARD_IMAGES = (1 << 4),
|
||||
} eWM_CapabilitiesFlag;
|
||||
|
||||
eWM_CapabilitiesFlag WM_capabilities_flag(void);
|
||||
|
|
|
@ -1852,6 +1852,9 @@ eWM_CapabilitiesFlag WM_capabilities_flag(void)
|
|||
if (ghost_flag & GHOST_kCapabilityGPUReadFrontBuffer) {
|
||||
flag |= WM_CAPABILITY_GPU_FRONT_BUFFER_READ;
|
||||
}
|
||||
if (ghost_flag & GHOST_kCapabilityClipboardImages) {
|
||||
flag |= WM_CAPABILITY_CLIPBOARD_IMAGES;
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue