Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_context.h
| Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
| /* Structs */ | /* Structs */ | ||||
| struct bContext; | struct bContext; | ||||
| typedef struct bContext bContext; | typedef struct bContext bContext; | ||||
| struct bContextDataResult; | struct bContextDataResult; | ||||
| typedef struct bContextDataResult bContextDataResult; | typedef struct bContextDataResult bContextDataResult; | ||||
| typedef int (*bContextDataCallback)(const bContext *C, | /* Result of context lookups. | ||||
| * The specific values are important, and used implicitly in ctx_data_get(). Some functions also | |||||
| * still accept/return `int` instead, to ensure that the compiler uses the correct storage size | |||||
| * when mixing C/C++ code. */ | |||||
| typedef enum eContextResult { | |||||
| /* The context member was found, and its data is available. */ | |||||
| CTX_RESULT_OK = 1, | |||||
| /* The context member was not found. */ | |||||
| CTX_RESULT_MEMBER_NOT_FOUND = 0, | |||||
| /* The context member was found, but its data is not available. | |||||
| * For example, "active_bone" is a valid context member, but has not data in Object mode. */ | |||||
| CTX_RESULT_NO_DATA = -1, | |||||
| } eContextResult; | |||||
| /* Function mapping a context member name to its value. */ | |||||
| typedef int /*eContextResult*/ (*bContextDataCallback)(const bContext *C, | |||||
| const char *member, | const char *member, | ||||
| bContextDataResult *result); | bContextDataResult *result); | ||||
| typedef struct bContextStoreEntry { | typedef struct bContextStoreEntry { | ||||
| struct bContextStoreEntry *next, *prev; | struct bContextStoreEntry *next, *prev; | ||||
| char name[128]; | char name[128]; | ||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| } bContextStoreEntry; | } bContextStoreEntry; | ||||
| ▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | PointerRNA CTX_data_pointer_get_type_silent(const bContext *C, | ||||
| const char *member, | const char *member, | ||||
| StructRNA *type); | StructRNA *type); | ||||
| ListBase CTX_data_collection_get(const bContext *C, const char *member); | ListBase CTX_data_collection_get(const bContext *C, const char *member); | ||||
| ListBase CTX_data_dir_get_ex(const bContext *C, | ListBase CTX_data_dir_get_ex(const bContext *C, | ||||
| const bool use_store, | const bool use_store, | ||||
| const bool use_rna, | const bool use_rna, | ||||
| const bool use_all); | const bool use_all); | ||||
| ListBase CTX_data_dir_get(const bContext *C); | ListBase CTX_data_dir_get(const bContext *C); | ||||
| int CTX_data_get( | int /*eContextResult*/ CTX_data_get( | ||||
| const bContext *C, const char *member, PointerRNA *r_ptr, ListBase *r_lb, short *r_type); | const bContext *C, const char *member, PointerRNA *r_ptr, ListBase *r_lb, short *r_type); | ||||
| void CTX_data_id_pointer_set(bContextDataResult *result, struct ID *id); | void CTX_data_id_pointer_set(bContextDataResult *result, struct ID *id); | ||||
| void CTX_data_pointer_set(bContextDataResult *result, struct ID *id, StructRNA *type, void *data); | void CTX_data_pointer_set(bContextDataResult *result, struct ID *id, StructRNA *type, void *data); | ||||
| void CTX_data_id_list_add(bContextDataResult *result, struct ID *id); | void CTX_data_id_list_add(bContextDataResult *result, struct ID *id); | ||||
| void CTX_data_list_add(bContextDataResult *result, struct ID *id, StructRNA *type, void *data); | void CTX_data_list_add(bContextDataResult *result, struct ID *id, StructRNA *type, void *data); | ||||
| ▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines | |||||