Refactor: UTF-8 Character Defines #109163
44
source/blender/blenlib/BLI_string_utf8_symbols.h
Normal file
44
source/blender/blenlib/BLI_string_utf8_symbols.h
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/* SPDX-FileCopyrightText: 2023 Blender Foundation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
/** \file
|
||||||
|
* \ingroup bli
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Unicode characters as UTF-8 strings. Last portion should include the official assigned name.
|
||||||
|
* Please do not add defines here that are not actually in use. */
|
||||||
|
|
||||||
|
#define BLI_STR_UTF8_MULTIPLICATION_SIGN u8"\u00D7" /* × */
|
||||||
|
#define BLI_STR_UTF8_EM_DASH u8"\u2014" /* — */
|
||||||
|
#define BLI_STR_UTF8_BULLET u8"\u2022" /* • */
|
||||||
|
#define BLI_STR_UTF8_HORIZONTAL_ELLIPSIS u8"\u2026" /* … */
|
||||||
|
#define BLI_STR_UTF8_LEFTWARDS_ARROW u8"\u2190" /* ← */
|
||||||
|
#define BLI_STR_UTF8_UPWARDS_ARROW u8"\u2191" /* ↑ */
|
||||||
|
#define BLI_STR_UTF8_RIGHTWARDS_ARROW u8"\u2192" /* → */
|
||||||
|
#define BLI_STR_UTF8_DOWNWARDS_ARROW u8"\u2193" /* ↓ */
|
||||||
|
#define BLI_STR_UTF8_UPWARDS_WHITE_ARROW u8"\u21E7" /* ⇧ */
|
||||||
|
#define BLI_STR_UTF8_UP_ARROWHEAD u8"\u2303" /* ⌃ */
|
||||||
|
#define BLI_STR_UTF8_PLACE_OF_INTEREST_SIGN u8"\u2318" /* ⌘ */
|
||||||
|
#define BLI_STR_UTF8_OPTION_KEY u8"\u2325" /* ⌥ */
|
||||||
|
#define BLI_STR_UTF8_ERASE_TO_THE_LEFT u8"\u232B" /* ⌫ */
|
||||||
|
#define BLI_STR_UTF8_BROKEN_CIRCLE_WITH_NORTHWEST_ARROW u8"\u238B" /* ⎋ */
|
||||||
|
#define BLI_STR_UTF8_RETURN_SYMBOL u8"\u23CE" /* ⏎ */
|
||||||
|
#define BLI_STR_UTF8_BLACK_RIGHT_POINTING_DOUBLE_TRIANGLE_WITH_VERTICAL_BAR u8"\u23ED" /* ⏭ */
|
||||||
|
#define BLI_STR_UTF8_BLACK_LEFT_POINTING_DOUBLE_TRIANGLE_WITH_VERTICAL_BAR u8"\u23EE" /* ⏮ */
|
||||||
|
#define BLI_STR_UTF8_BLACK_RIGHT_POINTING_TRIANGLE_WITH_DOUBLE_VERTICAL_BAR u8"\u23EF" /* ⏯ */
|
||||||
|
#define BLI_STR_UTF8_BLACK_SQUARE_FOR_STOP u8"\u23F9" /* ⏹ */
|
||||||
|
#define BLI_STR_UTF8_OPEN_BOX u8"\u2423" /* ␣ */
|
||||||
|
#define BLI_STR_UTF8_BLACK_RIGHT_POINTING_SMALL_TRIANGLE u8"\u25B8" /* ▸ */
|
||||||
|
#define BLI_STR_UTF8_HORIZONTAL_TAB_KEY u8"\u2B7E" /* ⭾ */
|
||||||
|
#define BLI_STR_UTF8_BLACK_DIAMOND_MINUS_WHITE_X u8"\u2756" /* ❖ */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
@ -354,6 +354,7 @@ set(SRC
|
|||||||
BLI_string_ref.hh
|
BLI_string_ref.hh
|
||||||
BLI_string_search.h
|
BLI_string_search.h
|
||||||
BLI_string_utf8.h
|
BLI_string_utf8.h
|
||||||
|
BLI_string_utf8_symbols.h
|
||||||
BLI_string_utils.h
|
BLI_string_utils.h
|
||||||
BLI_sub_frame.hh
|
BLI_sub_frame.hh
|
||||||
BLI_sys_types.h
|
BLI_sys_types.h
|
||||||
|
@ -10,10 +10,11 @@
|
|||||||
#include "BLI_string_ref.hh"
|
#include "BLI_string_ref.hh"
|
||||||
#include "BLI_string_search.h"
|
#include "BLI_string_search.h"
|
||||||
#include "BLI_string_utf8.h"
|
#include "BLI_string_utf8.h"
|
||||||
|
#include "BLI_string_utf8_symbols.h"
|
||||||
#include "BLI_timeit.hh"
|
#include "BLI_timeit.hh"
|
||||||
|
|
||||||
/* Right arrow, keep in sync with #UI_MENU_ARROW_SEP in `UI_interface.h`. */
|
/* Right arrow, keep in sync with #UI_MENU_ARROW_SEP in `UI_interface.h`. */
|
||||||
#define UI_MENU_ARROW_SEP "\xe2\x96\xb8"
|
#define UI_MENU_ARROW_SEP BLI_STR_UTF8_BLACK_RIGHT_POINTING_SMALL_TRIANGLE
|
||||||
#define UI_MENU_ARROW_SEP_UNICODE 0x25b8
|
#define UI_MENU_ARROW_SEP_UNICODE 0x25b8
|
||||||
|
|
||||||
namespace blender::string_search {
|
namespace blender::string_search {
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "BLI_compiler_attrs.h"
|
#include "BLI_compiler_attrs.h"
|
||||||
|
#include "BLI_string_utf8_symbols.h"
|
||||||
#include "BLI_sys_types.h" /* size_t */
|
#include "BLI_sys_types.h" /* size_t */
|
||||||
#include "BLI_utildefines.h"
|
#include "BLI_utildefines.h"
|
||||||
#include "UI_interface_icons.h"
|
#include "UI_interface_icons.h"
|
||||||
@ -87,7 +88,7 @@ typedef struct uiViewItemHandle uiViewItemHandle;
|
|||||||
|
|
||||||
/* Separator for text in search menus (right pointing arrow).
|
/* Separator for text in search menus (right pointing arrow).
|
||||||
* keep in sync with `string_search.cc`. */
|
* keep in sync with `string_search.cc`. */
|
||||||
#define UI_MENU_ARROW_SEP "\xe2\x96\xb8"
|
#define UI_MENU_ARROW_SEP BLI_STR_UTF8_BLACK_RIGHT_POINTING_SMALL_TRIANGLE
|
||||||
|
|
||||||
/* names */
|
/* names */
|
||||||
#define UI_MAX_DRAW_STR 400
|
#define UI_MAX_DRAW_STR 400
|
||||||
|
@ -79,12 +79,12 @@ void icon_draw_rect_input(
|
|||||||
icon_draw_rect_input_text(&rect, color, str, event_type > EVT_F9KEY ? 8.5f : 11.5f, 0.0f);
|
icon_draw_rect_input_text(&rect, color, str, event_type > EVT_F9KEY ? 8.5f : 11.5f, 0.0f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_LEFTSHIFTKEY) { /* Right Shift has already been converted to left. */
|
else if (event_type == EVT_LEFTSHIFTKEY) { /* Right Shift has already been converted to left. */
|
||||||
const char str[] = {0xe2, 0x87, 0xa7, 0x0};
|
const char str[] = BLI_STR_UTF8_UPWARDS_WHITE_ARROW;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
|
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_LEFTCTRLKEY) { /* Right Shift has already been converted to left. */
|
else if (event_type == EVT_LEFTCTRLKEY) { /* Right Shift has already been converted to left. */
|
||||||
if (platform == MACOS) {
|
if (platform == MACOS) {
|
||||||
const char str[] = {0xe2, 0x8c, 0x83, 0x0};
|
const char str[] = BLI_STR_UTF8_UP_ARROWHEAD;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 21.0f, -8.0f);
|
icon_draw_rect_input_text(&rect, color, str, 21.0f, -8.0f);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -93,7 +93,7 @@ void icon_draw_rect_input(
|
|||||||
}
|
}
|
||||||
else if (event_type == EVT_LEFTALTKEY) { /* Right Alt has already been converted to left. */
|
else if (event_type == EVT_LEFTALTKEY) { /* Right Alt has already been converted to left. */
|
||||||
if (platform == MACOS) {
|
if (platform == MACOS) {
|
||||||
const char str[] = {0xe2, 0x8c, 0xa5, 0x0};
|
const char str[] = BLI_STR_UTF8_OPTION_KEY;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 13.0f, 0.0f);
|
icon_draw_rect_input_text(&rect, color, str, 13.0f, 0.0f);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -102,11 +102,11 @@ void icon_draw_rect_input(
|
|||||||
}
|
}
|
||||||
else if (event_type == EVT_OSKEY) {
|
else if (event_type == EVT_OSKEY) {
|
||||||
if (platform == MACOS) {
|
if (platform == MACOS) {
|
||||||
const char str[] = {0xe2, 0x8c, 0x98, 0x0};
|
const char str[] = BLI_STR_UTF8_PLACE_OF_INTEREST_SIGN;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
|
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
|
||||||
}
|
}
|
||||||
else if (platform == MSWIN) {
|
else if (platform == MSWIN) {
|
||||||
const char str[] = {0xe2, 0x9d, 0x96, 0x0};
|
const char str[] = BLI_STR_UTF8_BLACK_DIAMOND_MINUS_WHITE_X;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
|
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -117,7 +117,7 @@ void icon_draw_rect_input(
|
|||||||
icon_draw_rect_input_text(&rect, color, "Del", 9.0f, 0.0f);
|
icon_draw_rect_input_text(&rect, color, "Del", 9.0f, 0.0f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_TABKEY) {
|
else if (event_type == EVT_TABKEY) {
|
||||||
const char str[] = {0xe2, 0xad, 0xbe, 0x0};
|
const char str[] = BLI_STR_UTF8_HORIZONTAL_TAB_KEY;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 18.0f, -1.5f);
|
icon_draw_rect_input_text(&rect, color, str, 18.0f, -1.5f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_HOMEKEY) {
|
else if (event_type == EVT_HOMEKEY) {
|
||||||
@ -127,12 +127,12 @@ void icon_draw_rect_input(
|
|||||||
icon_draw_rect_input_text(&rect, color, "End", 8.0f, 0.0f);
|
icon_draw_rect_input_text(&rect, color, "End", 8.0f, 0.0f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_RETKEY) {
|
else if (event_type == EVT_RETKEY) {
|
||||||
const char str[] = {0xe2, 0x8f, 0x8e, 0x0};
|
const char str[] = BLI_STR_UTF8_RETURN_SYMBOL;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 17.0f, -1.0f);
|
icon_draw_rect_input_text(&rect, color, str, 17.0f, -1.0f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_ESCKEY) {
|
else if (event_type == EVT_ESCKEY) {
|
||||||
if (platform == MACOS) {
|
if (platform == MACOS) {
|
||||||
const char str[] = {0xe2, 0x8e, 0x8b, 0x0};
|
const char str[] = BLI_STR_UTF8_BROKEN_CIRCLE_WITH_NORTHWEST_ARROW;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 21.0f, -1.0f);
|
icon_draw_rect_input_text(&rect, color, str, 21.0f, -1.0f);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -140,31 +140,31 @@ void icon_draw_rect_input(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_PAGEUPKEY) {
|
else if (event_type == EVT_PAGEUPKEY) {
|
||||||
const char str[] = {'P', 0xe2, 0x86, 0x91, 0x0};
|
const char str[] = "P" BLI_STR_UTF8_UPWARDS_ARROW;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 12.0f, 0.0f);
|
icon_draw_rect_input_text(&rect, color, str, 12.0f, 0.0f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_PAGEDOWNKEY) {
|
else if (event_type == EVT_PAGEDOWNKEY) {
|
||||||
const char str[] = {'P', 0xe2, 0x86, 0x93, 0x0};
|
const char str[] = "P" BLI_STR_UTF8_DOWNWARDS_ARROW;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 12.0f, 0.0f);
|
icon_draw_rect_input_text(&rect, color, str, 12.0f, 0.0f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_LEFTARROWKEY) {
|
else if (event_type == EVT_LEFTARROWKEY) {
|
||||||
const char str[] = {0xe2, 0x86, 0x90, 0x0};
|
const char str[] = BLI_STR_UTF8_LEFTWARDS_ARROW;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 18.0f, -1.5f);
|
icon_draw_rect_input_text(&rect, color, str, 18.0f, -1.5f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_UPARROWKEY) {
|
else if (event_type == EVT_UPARROWKEY) {
|
||||||
const char str[] = {0xe2, 0x86, 0x91, 0x0};
|
const char str[] = BLI_STR_UTF8_UPWARDS_ARROW;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
|
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_RIGHTARROWKEY) {
|
else if (event_type == EVT_RIGHTARROWKEY) {
|
||||||
const char str[] = {0xe2, 0x86, 0x92, 0x0};
|
const char str[] = BLI_STR_UTF8_RIGHTWARDS_ARROW;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 18.0f, -1.5f);
|
icon_draw_rect_input_text(&rect, color, str, 18.0f, -1.5f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_DOWNARROWKEY) {
|
else if (event_type == EVT_DOWNARROWKEY) {
|
||||||
const char str[] = {0xe2, 0x86, 0x93, 0x0};
|
const char str[] = BLI_STR_UTF8_DOWNWARDS_ARROW;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
|
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
|
||||||
}
|
}
|
||||||
else if (event_type == EVT_SPACEKEY) {
|
else if (event_type == EVT_SPACEKEY) {
|
||||||
const char str[] = {0xe2, 0x90, 0xa3, 0x0};
|
const char str[] = BLI_STR_UTF8_OPEN_BOX;
|
||||||
icon_draw_rect_input_text(&rect, color, str, 20.0f, 2.0f);
|
icon_draw_rect_input_text(&rect, color, str, 20.0f, 2.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1538,8 +1538,7 @@ float UI_text_clip_middle_ex(const uiFontStyle *fstyle,
|
|||||||
float strwidth = BLF_width(fstyle->uifont_id, str, max_len);
|
float strwidth = BLF_width(fstyle->uifont_id, str, max_len);
|
||||||
|
|
||||||
if ((okwidth > 0.0f) && (strwidth > okwidth)) {
|
if ((okwidth > 0.0f) && (strwidth > okwidth)) {
|
||||||
/* Ellipsis. Some compilers complain with real literal string. */
|
const char sep[] = BLI_STR_UTF8_HORIZONTAL_ELLIPSIS;
|
||||||
const char sep[] = {0xe2, 0x80, 0xA6, 0x0};
|
|
||||||
const int sep_len = sizeof(sep) - 1;
|
const int sep_len = sizeof(sep) - 1;
|
||||||
const float sep_strwidth = BLF_width(fstyle->uifont_id, sep, sep_len + 1);
|
const float sep_strwidth = BLF_width(fstyle->uifont_id, sep, sep_len + 1);
|
||||||
|
|
||||||
|
@ -2741,9 +2741,9 @@ void SEQUENCER_OT_swap_data(wmOperatorType *ot)
|
|||||||
* \{ */
|
* \{ */
|
||||||
|
|
||||||
static const EnumPropertyItem prop_change_effect_input_types[] = {
|
static const EnumPropertyItem prop_change_effect_input_types[] = {
|
||||||
{0, "A_B", 0, "A -> B", ""},
|
{0, "A_B", 0, "A " BLI_STR_UTF8_RIGHTWARDS_ARROW " B", ""},
|
||||||
{1, "B_C", 0, "B -> C", ""},
|
{1, "B_C", 0, "B " BLI_STR_UTF8_RIGHTWARDS_ARROW " C", ""},
|
||||||
{2, "A_C", 0, "A -> C", ""},
|
{2, "A_C", 0, "A " BLI_STR_UTF8_RIGHTWARDS_ARROW " C", ""},
|
||||||
{0, nullptr, 0, nullptr, nullptr},
|
{0, nullptr, 0, nullptr, nullptr},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "DNA_userdef_types.h"
|
#include "DNA_userdef_types.h"
|
||||||
#include "DNA_windowmanager_types.h"
|
#include "DNA_windowmanager_types.h"
|
||||||
|
|
||||||
|
#include "BLI_string_utf8_symbols.h"
|
||||||
#include "BLI_utildefines.h"
|
#include "BLI_utildefines.h"
|
||||||
|
|
||||||
#include "BLT_translation.h"
|
#include "BLT_translation.h"
|
||||||
@ -248,10 +249,10 @@ const EnumPropertyItem rna_enum_event_type_items[] = {
|
|||||||
{EVT_EQUALKEY, "EQUAL", 0, "=", ""},
|
{EVT_EQUALKEY, "EQUAL", 0, "=", ""},
|
||||||
{EVT_LEFTBRACKETKEY, "LEFT_BRACKET", 0, "[", ""},
|
{EVT_LEFTBRACKETKEY, "LEFT_BRACKET", 0, "[", ""},
|
||||||
{EVT_RIGHTBRACKETKEY, "RIGHT_BRACKET", 0, "]", ""},
|
{EVT_RIGHTBRACKETKEY, "RIGHT_BRACKET", 0, "]", ""},
|
||||||
{EVT_LEFTARROWKEY, "LEFT_ARROW", 0, "Left Arrow", "←"},
|
{EVT_LEFTARROWKEY, "LEFT_ARROW", 0, "Left Arrow", BLI_STR_UTF8_LEFTWARDS_ARROW},
|
||||||
{EVT_DOWNARROWKEY, "DOWN_ARROW", 0, "Down Arrow", "↓"},
|
{EVT_DOWNARROWKEY, "DOWN_ARROW", 0, "Down Arrow", BLI_STR_UTF8_DOWNWARDS_ARROW},
|
||||||
{EVT_RIGHTARROWKEY, "RIGHT_ARROW", 0, "Right Arrow", "→"},
|
{EVT_RIGHTARROWKEY, "RIGHT_ARROW", 0, "Right Arrow", BLI_STR_UTF8_RIGHTWARDS_ARROW},
|
||||||
{EVT_UPARROWKEY, "UP_ARROW", 0, "Up Arrow", "↑"},
|
{EVT_UPARROWKEY, "UP_ARROW", 0, "Up Arrow", BLI_STR_UTF8_UPWARDS_ARROW},
|
||||||
{EVT_PAD2, "NUMPAD_2", 0, "Numpad 2", "Pad2"},
|
{EVT_PAD2, "NUMPAD_2", 0, "Numpad 2", "Pad2"},
|
||||||
{EVT_PAD4, "NUMPAD_4", 0, "Numpad 4", "Pad4"},
|
{EVT_PAD4, "NUMPAD_4", 0, "Numpad 4", "Pad4"},
|
||||||
{EVT_PAD6, "NUMPAD_6", 0, "Numpad 6", "Pad6"},
|
{EVT_PAD6, "NUMPAD_6", 0, "Numpad 6", "Pad6"},
|
||||||
@ -299,10 +300,22 @@ const EnumPropertyItem rna_enum_event_type_items[] = {
|
|||||||
{EVT_PAGEDOWNKEY, "PAGE_DOWN", 0, "Page Down", "PgDown"},
|
{EVT_PAGEDOWNKEY, "PAGE_DOWN", 0, "Page Down", "PgDown"},
|
||||||
{EVT_ENDKEY, "END", 0, "End", ""},
|
{EVT_ENDKEY, "END", 0, "End", ""},
|
||||||
RNA_ENUM_ITEM_SEPR,
|
RNA_ENUM_ITEM_SEPR,
|
||||||
{EVT_MEDIAPLAY, "MEDIA_PLAY", 0, "Media Play/Pause", ">/||"},
|
{EVT_MEDIAPLAY,
|
||||||
{EVT_MEDIASTOP, "MEDIA_STOP", 0, "Media Stop", "Stop"},
|
"MEDIA_PLAY",
|
||||||
{EVT_MEDIAFIRST, "MEDIA_FIRST", 0, "Media First", "|<<"},
|
0,
|
||||||
{EVT_MEDIALAST, "MEDIA_LAST", 0, "Media Last", ">>|"},
|
"Media Play/Pause",
|
||||||
|
BLI_STR_UTF8_BLACK_RIGHT_POINTING_TRIANGLE_WITH_DOUBLE_VERTICAL_BAR},
|
||||||
|
{EVT_MEDIASTOP, "MEDIA_STOP", 0, "Media Stop", BLI_STR_UTF8_BLACK_SQUARE_FOR_STOP},
|
||||||
|
{EVT_MEDIAFIRST,
|
||||||
|
"MEDIA_FIRST",
|
||||||
|
0,
|
||||||
|
"Media First",
|
||||||
|
BLI_STR_UTF8_BLACK_LEFT_POINTING_DOUBLE_TRIANGLE_WITH_VERTICAL_BAR},
|
||||||
|
{EVT_MEDIALAST,
|
||||||
|
"MEDIA_LAST",
|
||||||
|
0,
|
||||||
|
"Media Last",
|
||||||
|
BLI_STR_UTF8_BLACK_RIGHT_POINTING_DOUBLE_TRIANGLE_WITH_VERTICAL_BAR},
|
||||||
RNA_ENUM_ITEM_SEPR,
|
RNA_ENUM_ITEM_SEPR,
|
||||||
{KM_TEXTINPUT, "TEXTINPUT", 0, "Text Input", "TxtIn"},
|
{KM_TEXTINPUT, "TEXTINPUT", 0, "Text Input", "TxtIn"},
|
||||||
RNA_ENUM_ITEM_SEPR,
|
RNA_ENUM_ITEM_SEPR,
|
||||||
@ -321,10 +334,18 @@ const EnumPropertyItem rna_enum_event_type_items[] = {
|
|||||||
{NDOF_BUTTON_MENU, "NDOF_BUTTON_MENU", 0, "NDOF Menu", "NdofMenu"},
|
{NDOF_BUTTON_MENU, "NDOF_BUTTON_MENU", 0, "NDOF Menu", "NdofMenu"},
|
||||||
{NDOF_BUTTON_FIT, "NDOF_BUTTON_FIT", 0, "NDOF Fit", "NdofFit"},
|
{NDOF_BUTTON_FIT, "NDOF_BUTTON_FIT", 0, "NDOF Fit", "NdofFit"},
|
||||||
/* view buttons */
|
/* view buttons */
|
||||||
{NDOF_BUTTON_TOP, "NDOF_BUTTON_TOP", 0, "NDOF Top", "Ndof↑"},
|
{NDOF_BUTTON_TOP, "NDOF_BUTTON_TOP", 0, "NDOF Top", "Ndof" BLI_STR_UTF8_UPWARDS_ARROW},
|
||||||
{NDOF_BUTTON_BOTTOM, "NDOF_BUTTON_BOTTOM", 0, "NDOF Bottom", "Ndof↓"},
|
{NDOF_BUTTON_BOTTOM,
|
||||||
{NDOF_BUTTON_LEFT, "NDOF_BUTTON_LEFT", 0, "NDOF Left", "Ndof←"},
|
"NDOF_BUTTON_BOTTOM",
|
||||||
{NDOF_BUTTON_RIGHT, "NDOF_BUTTON_RIGHT", 0, "NDOF Right", "Ndof→"},
|
0,
|
||||||
|
"NDOF Bottom",
|
||||||
|
"Ndof" BLI_STR_UTF8_DOWNWARDS_ARROW},
|
||||||
|
{NDOF_BUTTON_LEFT, "NDOF_BUTTON_LEFT", 0, "NDOF Left", "Ndof" BLI_STR_UTF8_LEFTWARDS_ARROW},
|
||||||
|
{NDOF_BUTTON_RIGHT,
|
||||||
|
"NDOF_BUTTON_RIGHT",
|
||||||
|
0,
|
||||||
|
"NDOF Right",
|
||||||
|
"Ndof" BLI_STR_UTF8_RIGHTWARDS_ARROW},
|
||||||
{NDOF_BUTTON_FRONT, "NDOF_BUTTON_FRONT", 0, "NDOF Front", "NdofFront"},
|
{NDOF_BUTTON_FRONT, "NDOF_BUTTON_FRONT", 0, "NDOF Front", "NdofFront"},
|
||||||
{NDOF_BUTTON_BACK, "NDOF_BUTTON_BACK", 0, "NDOF Back", "NdofBack"},
|
{NDOF_BUTTON_BACK, "NDOF_BUTTON_BACK", 0, "NDOF Back", "NdofBack"},
|
||||||
/* more views */
|
/* more views */
|
||||||
|
@ -1072,7 +1072,7 @@ const char *WM_key_event_string(const short type, const bool compact)
|
|||||||
case EVT_LEFTSHIFTKEY:
|
case EVT_LEFTSHIFTKEY:
|
||||||
case EVT_RIGHTSHIFTKEY: {
|
case EVT_RIGHTSHIFTKEY: {
|
||||||
if (platform == MACOS) {
|
if (platform == MACOS) {
|
||||||
single_glyph = "\xe2\x87\xa7";
|
single_glyph = BLI_STR_UTF8_UPWARDS_WHITE_ARROW;
|
||||||
}
|
}
|
||||||
return key_event_glyph_or_text(
|
return key_event_glyph_or_text(
|
||||||
font_id, CTX_IFACE_(BLT_I18NCONTEXT_ID_WINDOWMANAGER, "Shift"), single_glyph);
|
font_id, CTX_IFACE_(BLT_I18NCONTEXT_ID_WINDOWMANAGER, "Shift"), single_glyph);
|
||||||
@ -1080,48 +1080,50 @@ const char *WM_key_event_string(const short type, const bool compact)
|
|||||||
case EVT_LEFTCTRLKEY:
|
case EVT_LEFTCTRLKEY:
|
||||||
case EVT_RIGHTCTRLKEY:
|
case EVT_RIGHTCTRLKEY:
|
||||||
if (platform == MACOS) {
|
if (platform == MACOS) {
|
||||||
return key_event_glyph_or_text(font_id, "^", "\xe2\x8c\x83");
|
return key_event_glyph_or_text(font_id, "^", BLI_STR_UTF8_UP_ARROWHEAD);
|
||||||
}
|
}
|
||||||
return IFACE_("Ctrl");
|
return IFACE_("Ctrl");
|
||||||
case EVT_LEFTALTKEY:
|
case EVT_LEFTALTKEY:
|
||||||
case EVT_RIGHTALTKEY: {
|
case EVT_RIGHTALTKEY: {
|
||||||
if (platform == MACOS) {
|
if (platform == MACOS) {
|
||||||
/* Option symbol on Mac keyboard. */
|
/* Option symbol on Mac keyboard. */
|
||||||
single_glyph = "\xe2\x8c\xa5";
|
single_glyph = BLI_STR_UTF8_OPTION_KEY;
|
||||||
}
|
}
|
||||||
return key_event_glyph_or_text(font_id, IFACE_("Alt"), single_glyph);
|
return key_event_glyph_or_text(font_id, IFACE_("Alt"), single_glyph);
|
||||||
}
|
}
|
||||||
case EVT_OSKEY: {
|
case EVT_OSKEY: {
|
||||||
if (platform == MACOS) {
|
if (platform == MACOS) {
|
||||||
return key_event_glyph_or_text(font_id, IFACE_("Cmd"), "\xe2\x8c\x98");
|
return key_event_glyph_or_text(
|
||||||
|
font_id, IFACE_("Cmd"), BLI_STR_UTF8_PLACE_OF_INTEREST_SIGN);
|
||||||
}
|
}
|
||||||
if (platform == MSWIN) {
|
if (platform == MSWIN) {
|
||||||
return key_event_glyph_or_text(font_id, IFACE_("Win"), "\xe2\x9d\x96");
|
return key_event_glyph_or_text(
|
||||||
|
font_id, IFACE_("Win"), BLI_STR_UTF8_BLACK_DIAMOND_MINUS_WHITE_X);
|
||||||
}
|
}
|
||||||
return IFACE_("OS");
|
return IFACE_("OS");
|
||||||
} break;
|
} break;
|
||||||
case EVT_TABKEY:
|
case EVT_TABKEY:
|
||||||
return key_event_glyph_or_text(
|
return key_event_glyph_or_text(
|
||||||
font_id, CTX_N_(BLT_I18NCONTEXT_UI_EVENTS, "Tab"), "\xe2\xad\xbe");
|
font_id, CTX_N_(BLT_I18NCONTEXT_UI_EVENTS, "Tab"), BLI_STR_UTF8_HORIZONTAL_TAB_KEY);
|
||||||
case EVT_BACKSPACEKEY:
|
case EVT_BACKSPACEKEY:
|
||||||
return key_event_glyph_or_text(font_id, IFACE_("Bksp"), "\xe2\x8c\xab");
|
return key_event_glyph_or_text(font_id, IFACE_("Bksp"), BLI_STR_UTF8_ERASE_TO_THE_LEFT);
|
||||||
case EVT_ESCKEY:
|
case EVT_ESCKEY:
|
||||||
if (platform == MACOS) {
|
if (platform == MACOS) {
|
||||||
single_glyph = "\xe2\x8e\x8b";
|
single_glyph = BLI_STR_UTF8_BROKEN_CIRCLE_WITH_NORTHWEST_ARROW;
|
||||||
}
|
}
|
||||||
return key_event_glyph_or_text(font_id, IFACE_("Esc"), single_glyph);
|
return key_event_glyph_or_text(font_id, IFACE_("Esc"), single_glyph);
|
||||||
case EVT_RETKEY:
|
case EVT_RETKEY:
|
||||||
return key_event_glyph_or_text(font_id, IFACE_("Enter"), "\xe2\x86\xb5");
|
return key_event_glyph_or_text(font_id, IFACE_("Enter"), BLI_STR_UTF8_RETURN_SYMBOL);
|
||||||
case EVT_SPACEKEY:
|
case EVT_SPACEKEY:
|
||||||
return key_event_glyph_or_text(font_id, IFACE_("Space"), "\xe2\x90\xa3");
|
return key_event_glyph_or_text(font_id, IFACE_("Space"), BLI_STR_UTF8_OPEN_BOX);
|
||||||
case EVT_LEFTARROWKEY:
|
case EVT_LEFTARROWKEY:
|
||||||
return key_event_glyph_or_text(font_id, IFACE_("Left"), "\xe2\x86\x90");
|
return key_event_glyph_or_text(font_id, IFACE_("Left"), BLI_STR_UTF8_LEFTWARDS_ARROW);
|
||||||
case EVT_UPARROWKEY:
|
case EVT_UPARROWKEY:
|
||||||
return key_event_glyph_or_text(font_id, IFACE_("Up"), "\xe2\x86\x91");
|
return key_event_glyph_or_text(font_id, IFACE_("Up"), BLI_STR_UTF8_UPWARDS_ARROW);
|
||||||
case EVT_RIGHTARROWKEY:
|
case EVT_RIGHTARROWKEY:
|
||||||
return key_event_glyph_or_text(font_id, IFACE_("Right"), "\xe2\x86\x92");
|
return key_event_glyph_or_text(font_id, IFACE_("Right"), BLI_STR_UTF8_RIGHTWARDS_ARROW);
|
||||||
case EVT_DOWNARROWKEY:
|
case EVT_DOWNARROWKEY:
|
||||||
return key_event_glyph_or_text(font_id, IFACE_("Down"), "\xe2\x86\x93");
|
return key_event_glyph_or_text(font_id, IFACE_("Down"), BLI_STR_UTF8_DOWNWARDS_ARROW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user