Cleanup: use consistent terms in capability flags
Consistently use terms "cursor" & "clipboard" as a prefix so they auto-complete more usefully. Previously both ordering was used.
This commit is contained in:
@@ -926,7 +926,7 @@ extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
|
||||
/**
|
||||
* Return the data from the clipboard
|
||||
* \param selection: Boolean to return the selection instead.
|
||||
* The capability flag: #GHOST_kCapabilityPrimaryClipboard can be used to check for supported.
|
||||
* The capability flag: #GHOST_kCapabilityClipboardPrimary can be used to check for supported.
|
||||
* \return clipboard data
|
||||
*/
|
||||
extern char *GHOST_getClipboard(bool selection);
|
||||
|
||||
@@ -452,7 +452,7 @@ class GHOST_ISystem {
|
||||
* Return the clipboard buffer or null.
|
||||
*
|
||||
* \param selection: Use the "primary" selection.
|
||||
* Check the #GHOST_kCapabilityPrimaryClipboard for backends that support this.
|
||||
* Check the #GHOST_kCapabilityClipboardPrimary for backends that support this.
|
||||
* \return Returns the clipboard data as a null terminated string or null when unavailable.
|
||||
*/
|
||||
virtual char *getClipboard(bool selection) const = 0;
|
||||
|
||||
@@ -99,7 +99,7 @@ typedef enum {
|
||||
* Set when a separate primary clipboard is supported.
|
||||
* This is a convention for X11/WAYLAND, select text & MMB to paste (without an explicit copy).
|
||||
*/
|
||||
GHOST_kCapabilityPrimaryClipboard = (1 << 2),
|
||||
GHOST_kCapabilityClipboardPrimary = (1 << 2),
|
||||
/**
|
||||
* Support for reading the front-buffer.
|
||||
*/
|
||||
@@ -107,7 +107,7 @@ typedef enum {
|
||||
/**
|
||||
* Set when there is support for system clipboard copy/paste.
|
||||
*/
|
||||
GHOST_kCapabilityClipboardImages = (1 << 4),
|
||||
GHOST_kCapabilityClipboardImage = (1 << 4),
|
||||
/**
|
||||
* Support for sampling a color outside of the Blender windows.
|
||||
*/
|
||||
@@ -132,7 +132,7 @@ typedef enum {
|
||||
* Support for creation of RGBA mouse cursors. This flag is likely
|
||||
* to be temporary as our intention is to implement on all platforms.
|
||||
*/
|
||||
GHOST_kCapabilityRGBACursors = (1 << 10),
|
||||
GHOST_kCapabilityCursorRGBA = (1 << 10),
|
||||
|
||||
} GHOST_TCapabilityFlag;
|
||||
|
||||
@@ -142,11 +142,10 @@ typedef enum {
|
||||
*/
|
||||
#define GHOST_CAPABILITY_FLAG_ALL \
|
||||
(GHOST_kCapabilityCursorWarp | GHOST_kCapabilityWindowPosition | \
|
||||
GHOST_kCapabilityPrimaryClipboard | GHOST_kCapabilityGPUReadFrontBuffer | \
|
||||
GHOST_kCapabilityClipboardImages | GHOST_kCapabilityDesktopSample | \
|
||||
GHOST_kCapabilityInputIME | GHOST_kCapabilityTrackpadPhysicalDirection | \
|
||||
GHOST_kCapabilityWindowDecorationStyles | GHOST_kCapabilityKeyboardHyperKey | \
|
||||
GHOST_kCapabilityRGBACursors)
|
||||
GHOST_kCapabilityClipboardPrimary | GHOST_kCapabilityGPUReadFrontBuffer | \
|
||||
GHOST_kCapabilityClipboardImage | GHOST_kCapabilityDesktopSample | GHOST_kCapabilityInputIME | \
|
||||
GHOST_kCapabilityTrackpadPhysicalDirection | GHOST_kCapabilityWindowDecorationStyles | \
|
||||
GHOST_kCapabilityKeyboardHyperKey | GHOST_kCapabilityCursorRGBA)
|
||||
|
||||
/* Xtilt and Ytilt represent how much the pen is tilted away from
|
||||
* vertically upright in either the X or Y direction, with X and Y the
|
||||
|
||||
@@ -974,12 +974,12 @@ GHOST_TCapabilityFlag GHOST_SystemCocoa::getCapabilities() const
|
||||
/* NOTE: order the following flags as they they're declared in the source. */
|
||||
~(
|
||||
/* Cocoa has no support for a primary selection clipboard. */
|
||||
GHOST_kCapabilityPrimaryClipboard |
|
||||
GHOST_kCapabilityClipboardPrimary |
|
||||
/* Cocoa doesn't define a Hyper modifier key,
|
||||
* it's possible another modifier could be optionally used in it's place. */
|
||||
GHOST_kCapabilityKeyboardHyperKey |
|
||||
/* No support yet for RGBA mouse cursors. */
|
||||
GHOST_kCapabilityRGBACursors));
|
||||
GHOST_kCapabilityCursorRGBA));
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------
|
||||
|
||||
@@ -62,9 +62,9 @@ class GHOST_SystemHeadless : public GHOST_System {
|
||||
/* Wrap. */
|
||||
GHOST_kCapabilityCursorWarp |
|
||||
/* Wrap. */
|
||||
GHOST_kCapabilityPrimaryClipboard |
|
||||
GHOST_kCapabilityClipboardPrimary |
|
||||
/* Wrap. */
|
||||
GHOST_kCapabilityClipboardImages |
|
||||
GHOST_kCapabilityClipboardImage |
|
||||
/* Wrap. */
|
||||
GHOST_kCapabilityDesktopSample |
|
||||
/* Wrap. */
|
||||
@@ -74,7 +74,7 @@ class GHOST_SystemHeadless : public GHOST_System {
|
||||
/* Wrap. */
|
||||
GHOST_kCapabilityKeyboardHyperKey |
|
||||
/* Wrap. */
|
||||
GHOST_kCapabilityRGBACursors)
|
||||
GHOST_kCapabilityCursorRGBA)
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
@@ -787,9 +787,9 @@ GHOST_TCapabilityFlag GHOST_SystemSDL::getCapabilities() const
|
||||
/* NOTE: order the following flags as they they're declared in the source. */
|
||||
~(
|
||||
/* This SDL back-end has not yet implemented primary clipboard. */
|
||||
GHOST_kCapabilityPrimaryClipboard |
|
||||
GHOST_kCapabilityClipboardPrimary |
|
||||
/* This SDL back-end has not yet implemented image copy/paste. */
|
||||
GHOST_kCapabilityClipboardImages |
|
||||
GHOST_kCapabilityClipboardImage |
|
||||
/* This SDL back-end has not yet implemented color sampling the desktop. */
|
||||
GHOST_kCapabilityDesktopSample |
|
||||
/* No support yet for IME input methods. */
|
||||
@@ -799,7 +799,7 @@ GHOST_TCapabilityFlag GHOST_SystemSDL::getCapabilities() const
|
||||
/* No support for a Hyper modifier key. */
|
||||
GHOST_kCapabilityKeyboardHyperKey |
|
||||
/* No support yet for RGBA mouse cursors. */
|
||||
GHOST_kCapabilityRGBACursors));
|
||||
GHOST_kCapabilityCursorRGBA));
|
||||
}
|
||||
|
||||
char *GHOST_SystemSDL::getClipboard(bool /*selection*/) const
|
||||
|
||||
@@ -613,7 +613,7 @@ GHOST_TCapabilityFlag GHOST_SystemWin32::getCapabilities() const
|
||||
/* NOTE: order the following flags as they they're declared in the source. */
|
||||
~(
|
||||
/* WIN32 has no support for a primary selection clipboard. */
|
||||
GHOST_kCapabilityPrimaryClipboard |
|
||||
GHOST_kCapabilityClipboardPrimary |
|
||||
/* WIN32 doesn't define a Hyper modifier key,
|
||||
* it's possible another modifier could be optionally used in it's place. */
|
||||
GHOST_kCapabilityKeyboardHyperKey));
|
||||
|
||||
@@ -1823,13 +1823,13 @@ GHOST_TCapabilityFlag GHOST_SystemX11::getCapabilities() const
|
||||
/* NOTE: order the following flags as they they're declared in the source. */
|
||||
~(
|
||||
/* No support yet for image copy/paste. */
|
||||
GHOST_kCapabilityClipboardImages |
|
||||
GHOST_kCapabilityClipboardImage |
|
||||
/* No support yet for IME input methods. */
|
||||
GHOST_kCapabilityInputIME |
|
||||
/* No support for window decoration styles. */
|
||||
GHOST_kCapabilityWindowDecorationStyles |
|
||||
/* No support yet for RGBA mouse cursors. */
|
||||
GHOST_kCapabilityRGBACursors));
|
||||
GHOST_kCapabilityCursorRGBA));
|
||||
}
|
||||
|
||||
void GHOST_SystemX11::addDirtyWindow(GHOST_WindowX11 *bad_wind)
|
||||
|
||||
@@ -464,7 +464,7 @@ static void font_select_update_primary_clipboard(Object *obedit)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((WM_capabilities_flag() & WM_CAPABILITY_PRIMARY_CLIPBOARD) == 0) {
|
||||
if ((WM_capabilities_flag() & WM_CAPABILITY_CLIPBOARD_PRIMARY) == 0) {
|
||||
return;
|
||||
}
|
||||
char *buf = font_select_to_buffer(obedit);
|
||||
|
||||
@@ -90,7 +90,7 @@ static char *console_select_to_buffer(SpaceConsole *sc)
|
||||
|
||||
static void console_select_update_primary_clipboard(SpaceConsole *sc)
|
||||
{
|
||||
if ((WM_capabilities_flag() & WM_CAPABILITY_PRIMARY_CLIPBOARD) == 0) {
|
||||
if ((WM_capabilities_flag() & WM_CAPABILITY_CLIPBOARD_PRIMARY) == 0) {
|
||||
return;
|
||||
}
|
||||
if (sc->sel_start == sc->sel_end) {
|
||||
|
||||
@@ -226,7 +226,7 @@ BLI_INLINE int space_text_pixel_x_to_column(const SpaceText *st, const int x)
|
||||
|
||||
static void text_select_update_primary_clipboard(const Text *text)
|
||||
{
|
||||
if ((WM_capabilities_flag() & WM_CAPABILITY_PRIMARY_CLIPBOARD) == 0) {
|
||||
if ((WM_capabilities_flag() & WM_CAPABILITY_CLIPBOARD_PRIMARY) == 0) {
|
||||
return;
|
||||
}
|
||||
if (!txt_has_sel(text)) {
|
||||
|
||||
@@ -627,9 +627,9 @@ static PyObject *bpy_wm_capabilities(PyObject *self)
|
||||
|
||||
SetFlagItem(CURSOR_WARP);
|
||||
SetFlagItem(WINDOW_POSITION);
|
||||
SetFlagItem(PRIMARY_CLIPBOARD);
|
||||
SetFlagItem(CLIPBOARD_PRIMARY);
|
||||
SetFlagItem(GPU_FRONT_BUFFER_READ);
|
||||
SetFlagItem(CLIPBOARD_IMAGES);
|
||||
SetFlagItem(CLIPBOARD_IMAGE);
|
||||
SetFlagItem(DESKTOP_SAMPLE);
|
||||
SetFlagItem(INPUT_IME);
|
||||
SetFlagItem(TRACKPAD_PHYSICAL_DIRECTION);
|
||||
|
||||
@@ -184,13 +184,13 @@ enum eWM_CapabilitiesFlag {
|
||||
* The windowing system supports a separate primary clipboard
|
||||
* (typically set when interactively selecting text).
|
||||
*/
|
||||
WM_CAPABILITY_PRIMARY_CLIPBOARD = (1 << 2),
|
||||
WM_CAPABILITY_CLIPBOARD_PRIMARY = (1 << 2),
|
||||
/**
|
||||
* 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),
|
||||
WM_CAPABILITY_CLIPBOARD_IMAGE = (1 << 4),
|
||||
/** Ability to sample a color outside of Blender windows. */
|
||||
WM_CAPABILITY_DESKTOP_SAMPLE = (1 << 5),
|
||||
/** Support for IME input methods. */
|
||||
@@ -202,7 +202,7 @@ enum eWM_CapabilitiesFlag {
|
||||
/** Support for the "Hyper" modifier key. */
|
||||
WM_CAPABILITY_KEYBOARD_HYPER_KEY = (1 << 9),
|
||||
/** Support for RGBA Cursors. */
|
||||
WM_CAPABILITY_RGBA_CURSORS = (1 << 10),
|
||||
WM_CAPABILITY_CURSOR_RGBA = (1 << 10),
|
||||
/** The initial value, indicates the value needs to be set by inspecting GHOST. */
|
||||
WM_CAPABILITY_INITIALIZED = (1u << 31),
|
||||
};
|
||||
@@ -1872,7 +1872,7 @@ void WM_job_main_thread_lock_release(wmJob *wm_job);
|
||||
|
||||
/**
|
||||
* Return text from the clipboard.
|
||||
* \param selection: Use the "primary" clipboard, see: #WM_CAPABILITY_PRIMARY_CLIPBOARD.
|
||||
* \param selection: Use the "primary" clipboard, see: #WM_CAPABILITY_CLIPBOARD_PRIMARY.
|
||||
* \param ensure_utf8: Ensure the resulting string does not contain invalid UTF8 encoding.
|
||||
*/
|
||||
char *WM_clipboard_text_get(bool selection, bool ensure_utf8, int *r_len);
|
||||
|
||||
@@ -225,7 +225,7 @@ static bool window_set_custom_cursor(wmWindow *win, const BCursor &cursor)
|
||||
const bool use_only_1bpp_cursors = false;
|
||||
|
||||
const bool use_rgba = !use_only_1bpp_cursors &&
|
||||
(WM_capabilities_flag() & WM_CAPABILITY_RGBA_CURSORS);
|
||||
(WM_capabilities_flag() & WM_CAPABILITY_CURSOR_RGBA);
|
||||
|
||||
const int max_size = use_rgba ? 128 : 32;
|
||||
const int size = std::min(cursor_size(), max_size);
|
||||
|
||||
@@ -261,7 +261,7 @@ static void wm_software_cursor_draw_bitmap(const int event_xy[2],
|
||||
*
|
||||
* NOTE: *technically* if a window spans two output of different scales,
|
||||
* we should scale to the output. This use case is currently not accounted for. */
|
||||
const int scale = (WM_capabilities_flag() & WM_CAPABILITY_RGBA_CURSORS) ?
|
||||
const int scale = (WM_capabilities_flag() & WM_CAPABILITY_CURSOR_RGBA) ?
|
||||
1 :
|
||||
std::max(1, round_fl_to_int(system_scale));
|
||||
|
||||
|
||||
@@ -2209,14 +2209,14 @@ eWM_CapabilitiesFlag WM_capabilities_flag()
|
||||
if (ghost_flag & GHOST_kCapabilityWindowPosition) {
|
||||
flag |= WM_CAPABILITY_WINDOW_POSITION;
|
||||
}
|
||||
if (ghost_flag & GHOST_kCapabilityPrimaryClipboard) {
|
||||
flag |= WM_CAPABILITY_PRIMARY_CLIPBOARD;
|
||||
if (ghost_flag & GHOST_kCapabilityClipboardPrimary) {
|
||||
flag |= WM_CAPABILITY_CLIPBOARD_PRIMARY;
|
||||
}
|
||||
if (ghost_flag & GHOST_kCapabilityGPUReadFrontBuffer) {
|
||||
flag |= WM_CAPABILITY_GPU_FRONT_BUFFER_READ;
|
||||
}
|
||||
if (ghost_flag & GHOST_kCapabilityClipboardImages) {
|
||||
flag |= WM_CAPABILITY_CLIPBOARD_IMAGES;
|
||||
if (ghost_flag & GHOST_kCapabilityClipboardImage) {
|
||||
flag |= WM_CAPABILITY_CLIPBOARD_IMAGE;
|
||||
}
|
||||
if (ghost_flag & GHOST_kCapabilityDesktopSample) {
|
||||
flag |= WM_CAPABILITY_DESKTOP_SAMPLE;
|
||||
@@ -2233,8 +2233,8 @@ eWM_CapabilitiesFlag WM_capabilities_flag()
|
||||
if (ghost_flag & GHOST_kCapabilityKeyboardHyperKey) {
|
||||
flag |= WM_CAPABILITY_KEYBOARD_HYPER_KEY;
|
||||
}
|
||||
if (ghost_flag & GHOST_kCapabilityRGBACursors) {
|
||||
flag |= WM_CAPABILITY_RGBA_CURSORS;
|
||||
if (ghost_flag & GHOST_kCapabilityCursorRGBA) {
|
||||
flag |= WM_CAPABILITY_CURSOR_RGBA;
|
||||
}
|
||||
|
||||
return flag;
|
||||
|
||||
Reference in New Issue
Block a user