Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_text/space_text.c
| Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | |||||
| static void text_keymap(struct wmKeyConfig *keyconf) | static void text_keymap(struct wmKeyConfig *keyconf) | ||||
| { | { | ||||
| WM_keymap_ensure(keyconf, "Text Generic", SPACE_TEXT, 0); | WM_keymap_ensure(keyconf, "Text Generic", SPACE_TEXT, 0); | ||||
| WM_keymap_ensure(keyconf, "Text", SPACE_TEXT, 0); | WM_keymap_ensure(keyconf, "Text", SPACE_TEXT, 0); | ||||
| } | } | ||||
| const char *text_context_dir[] = {"edit_text", NULL}; | const char *text_context_dir[] = {"edit_text", NULL}; | ||||
| static int text_context(const bContext *C, const char *member, bContextDataResult *result) | static int /*eContextResult*/ text_context(const bContext *C, | ||||
| const char *member, | |||||
| bContextDataResult *result) | |||||
| { | { | ||||
| SpaceText *st = CTX_wm_space_text(C); | SpaceText *st = CTX_wm_space_text(C); | ||||
| if (CTX_data_dir(member)) { | if (CTX_data_dir(member)) { | ||||
| CTX_data_dir_set(result, text_context_dir); | CTX_data_dir_set(result, text_context_dir); | ||||
| return 1; | return CTX_RESULT_OK; | ||||
| } | } | ||||
| if (CTX_data_equals(member, "edit_text")) { | if (CTX_data_equals(member, "edit_text")) { | ||||
| if (st->text != NULL) { | if (st->text != NULL) { | ||||
| CTX_data_id_pointer_set(result, &st->text->id); | CTX_data_id_pointer_set(result, &st->text->id); | ||||
| } | } | ||||
| return 1; | return CTX_RESULT_OK; | ||||
| } | } | ||||
| return 0; | return CTX_RESULT_MEMBER_NOT_FOUND; | ||||
| } | } | ||||
| /********************* main region ********************/ | /********************* main region ********************/ | ||||
| /* add handlers, stuff you only do once or on area/region changes */ | /* add handlers, stuff you only do once or on area/region changes */ | ||||
| static void text_main_region_init(wmWindowManager *wm, ARegion *region) | static void text_main_region_init(wmWindowManager *wm, ARegion *region) | ||||
| { | { | ||||
| wmKeyMap *keymap; | wmKeyMap *keymap; | ||||
| ▲ Show 20 Lines • Show All 231 Lines • Show Last 20 Lines | |||||