Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesdna/DNA_space_types.h
| Show First 20 Lines • Show All 584 Lines • ▼ Show 20 Lines | typedef struct FileSelectParams { | ||||
| char pad_c1[2]; | char pad_c1[2]; | ||||
| char file[256]; /* file */ | char file[256]; /* file */ | ||||
| char renamefile[256]; | char renamefile[256]; | ||||
| char renameedit[256]; /* annoying but the first is only used for initialization */ | char renameedit[256]; /* annoying but the first is only used for initialization */ | ||||
| char filter_glob[64]; /* list of filetypes to filter */ | char filter_glob[64]; /* list of filetypes to filter */ | ||||
| char filter_search[64]; /* text items' name must match to be shown. */ | char filter_search[64]; /* text items' name must match to be shown. */ | ||||
| int filter_id; /* same as filter, but for ID types (aka library groups). */ | |||||
| int active_file; /* active file used for keyboard navigation */ | int active_file; /* active file used for keyboard navigation */ | ||||
| int highlight_file; /* file under cursor */ | int highlight_file; /* file under cursor */ | ||||
| int sel_first; | int sel_first; | ||||
| int sel_last; | int sel_last; | ||||
| unsigned short thumbnail_size; | unsigned short thumbnail_size; | ||||
| short pad; | short pad; | ||||
| /* short */ | /* short */ | ||||
| short type; /* XXXXX for now store type here, should be moved to the operator */ | short type; /* XXXXX for now store type here, should be moved to the operator */ | ||||
| short flag; /* settings for filter, hiding dots files,... */ | short flag; /* settings for filter, hiding dots files,... */ | ||||
| short sort; /* sort order */ | short sort; /* sort order */ | ||||
| short display; /* display mode flag */ | short display; /* display mode flag */ | ||||
| short filter; /* filter when (flags & FILE_FILTER) is true */ | int filter; /* filter when (flags & FILE_FILTER) is true */ | ||||
| short recursion_level; /* max number of levels in dirtree to show at once, 0 to disable recursion. */ | |||||
| /* XXX --- still unused -- */ | /* XXX --- still unused -- */ | ||||
| short f_fp; /* show font preview */ | short f_fp; /* show font preview */ | ||||
| char fp_str[8]; /* string to use for font preview */ | char fp_str[8]; /* string to use for font preview */ | ||||
| /* XXX --- end unused -- */ | /* XXX --- end unused -- */ | ||||
| } FileSelectParams; | } FileSelectParams; | ||||
| Show All 15 Lines | typedef struct SpaceFile { | ||||
| /* operator that is invoking fileselect | /* operator that is invoking fileselect | ||||
| * op->exec() will be called on the 'Load' button. | * op->exec() will be called on the 'Load' button. | ||||
| * if operator provides op->cancel(), then this will be invoked | * if operator provides op->cancel(), then this will be invoked | ||||
| * on the cancel button. | * on the cancel button. | ||||
| */ | */ | ||||
| struct wmOperator *op; | struct wmOperator *op; | ||||
| struct wmTimer *smoothscroll_timer; | struct wmTimer *smoothscroll_timer; | ||||
| struct wmTimer *previews_timer; | |||||
| struct FileLayout *layout; | struct FileLayout *layout; | ||||
| short recentnr, bookmarknr; | short recentnr, bookmarknr; | ||||
| short systemnr, system_bookmarknr; | short systemnr, system_bookmarknr; | ||||
| } SpaceFile; | } SpaceFile; | ||||
| /* FSMenuEntry's without paths indicate seperators */ | /* FSMenuEntry's without paths indicate seperators */ | ||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
| /* FILE_ATCURSOR = (1 << 6), */ /* deprecated */ | /* FILE_ATCURSOR = (1 << 6), */ /* deprecated */ | ||||
| FILE_DIRSEL_ONLY = (1 << 7), | FILE_DIRSEL_ONLY = (1 << 7), | ||||
| FILE_FILTER = (1 << 8), | FILE_FILTER = (1 << 8), | ||||
| FILE_BOOKMARKS = (1 << 9), | FILE_BOOKMARKS = (1 << 9), | ||||
| FILE_GROUP_INSTANCE = (1 << 10), | FILE_GROUP_INSTANCE = (1 << 10), | ||||
| } eFileSel_Params_Flag; | } eFileSel_Params_Flag; | ||||
| /* files in filesel list: file types */ | /* files in filesel list: file types | ||||
| * Note we could use mere values (instead of bitflags) for file types themselves, | |||||
| * but since we do not lack of bytes currently... | |||||
| */ | |||||
| typedef enum eFileSel_File_Types { | typedef enum eFileSel_File_Types { | ||||
| FILE_TYPE_BLENDER = (1 << 2), | FILE_TYPE_BLENDER = (1 << 2), | ||||
| FILE_TYPE_BLENDER_BACKUP = (1 << 3), | FILE_TYPE_BLENDER_BACKUP = (1 << 3), | ||||
| FILE_TYPE_IMAGE = (1 << 4), | FILE_TYPE_IMAGE = (1 << 4), | ||||
| FILE_TYPE_MOVIE = (1 << 5), | FILE_TYPE_MOVIE = (1 << 5), | ||||
| FILE_TYPE_PYSCRIPT = (1 << 6), | FILE_TYPE_PYSCRIPT = (1 << 6), | ||||
| FILE_TYPE_FTFONT = (1 << 7), | FILE_TYPE_FTFONT = (1 << 7), | ||||
| FILE_TYPE_SOUND = (1 << 8), | FILE_TYPE_SOUND = (1 << 8), | ||||
| FILE_TYPE_TEXT = (1 << 9), | FILE_TYPE_TEXT = (1 << 9), | ||||
| /* 1 << 10 was FILE_TYPE_MOVIE_ICON, got rid of this so free slot for future type... */ | /* 1 << 10 was FILE_TYPE_MOVIE_ICON, got rid of this so free slot for future type... */ | ||||
| FILE_TYPE_FOLDER = (1 << 11), /* represents folders for filtering */ | FILE_TYPE_FOLDER = (1 << 11), /* represents folders for filtering */ | ||||
| FILE_TYPE_BTX = (1 << 12), | FILE_TYPE_BTX = (1 << 12), | ||||
| FILE_TYPE_COLLADA = (1 << 13), | FILE_TYPE_COLLADA = (1 << 13), | ||||
| FILE_TYPE_OPERATOR = (1 << 14), /* from filter_glob operator property */ | FILE_TYPE_OPERATOR = (1 << 14), /* from filter_glob operator property */ | ||||
| FILE_TYPE_APPLICATIONBUNDLE = (1 << 15), | FILE_TYPE_APPLICATIONBUNDLE = (1 << 15), | ||||
| FILE_TYPE_DIR = (1 << 30), /* An FS directory (i.e. S_ISDIR on its path is true). */ | |||||
| FILE_TYPE_BLENDERLIB = (1 << 31), | |||||
| } eFileSel_File_Types; | } eFileSel_File_Types; | ||||
| /* Selection Flags in filesel: struct direntry, unsigned char selflag */ | /* Selection Flags in filesel: struct direntry, unsigned char selflag */ | ||||
| typedef enum eDirEntry_SelectFlag { | typedef enum eDirEntry_SelectFlag { | ||||
| /* FILE_SEL_ACTIVE = (1 << 1), */ /* UNUSED */ | /* FILE_SEL_ACTIVE = (1 << 1), */ /* UNUSED */ | ||||
| FILE_SEL_HIGHLIGHTED = (1 << 2), | FILE_SEL_HIGHLIGHTED = (1 << 2), | ||||
| FILE_SEL_SELECTED = (1 << 3), | FILE_SEL_SELECTED = (1 << 3), | ||||
| FILE_SEL_EDITING = (1 << 4), | FILE_SEL_EDITING = (1 << 4), | ||||
| } eDirEntry_SelectFlag; | } eDirEntry_SelectFlag; | ||||
| #define FILE_LIST_MAX_RECURSION 4 | |||||
| /* ***** Related to file browser, but never saved in DNA, only here to help with RNA. ***** */ | |||||
| /* About Unique identifier. | |||||
| * Stored in a CustomProps once imported. | |||||
| * Each engine is free to use it as it likes - it will be the only thing passed to it by blender to identify | |||||
| * asset/variant/version (concatenating the three into a single 48 bytes one). | |||||
| * Assumed to be 128bits, handled as four integers due to lack of real bytes proptype in RNA :|. | |||||
| */ | |||||
| #define ASSET_UUID_LENGTH 16 | |||||
| /* Used to communicate with asset engines outside of 'import' context. */ | |||||
| typedef struct AssetUUID { | |||||
| int uuid_asset[4]; | |||||
| int uuid_variant[4]; | |||||
| int uuid_revision[4]; | |||||
| } AssetUUID; | |||||
| typedef struct AssetUUIDList { | |||||
| AssetUUID *uuids; | |||||
| int nbr_uuids, pad; | |||||
| } AssetUUIDList; | |||||
| /* Container for a revision, only relevant in asset context. */ | |||||
| typedef struct FileDirEntryRevision { | |||||
| struct FileDirEntryRevision *next, *prev; | |||||
| int uuid[4]; | |||||
| char *comment; | |||||
| uint64_t size; | |||||
| int64_t time; | |||||
| /* Temp caching of UI-generated strings... */ | |||||
| char size_str[16]; | |||||
| char time_str[8]; | |||||
| char date_str[16]; | |||||
| } FileDirEntryRevision; | |||||
| /* Container for a variant, only relevant in asset context. | |||||
| * In case there are no variants, a single one shall exist, with NULL name/description. */ | |||||
| typedef struct FileDirEntryVariant { | |||||
| struct FileDirEntryVariant *next, *prev; | |||||
| int uuid[4]; | |||||
| char *name; | |||||
| char *description; | |||||
| ListBase revisions; | |||||
| int nbr_revisions; | |||||
| int act_revision; | |||||
| } FileDirEntryVariant; | |||||
| /* Container for mere direntry, with additional asset-related data. */ | |||||
| typedef struct FileDirEntry { | |||||
| struct FileDirEntry *next, *prev; | |||||
| int uuid[4]; | |||||
| char *name; | |||||
| char *description; | |||||
| /* Either point to active variant/revision if available, or own entry (in mere filebrowser case). */ | |||||
| FileDirEntryRevision *entry; | |||||
| int typeflag; /* eFileSel_File_Types */ | |||||
| int blentype; /* ID type, in case typeflag has FILE_TYPE_BLENDERLIB set. */ | |||||
| char *relpath; | |||||
| void *poin; /* TODO: make this a real ID pointer? */ | |||||
| struct ImBuf *image; | |||||
| /* Tags are for info only, most of filtering is done in asset engine. */ | |||||
| char **tags; | |||||
| int nbr_tags; | |||||
| short status; | |||||
| short flags; | |||||
| ListBase variants; | |||||
| int nbr_variants; | |||||
| int act_variant; | |||||
| } FileDirEntry; | |||||
| /* Array of direntries. */ | |||||
| /* This struct is used in various, different contexts. | |||||
| * In Filebrowser UI, it stores the total number of available entries, the number of visible (filtered) entries, | |||||
| * and a subset of those in 'entries' ListBase, from idx_start (included) to idx_end (excluded). | |||||
| * In AssetEngine context (i.e. outside of 'browsing' context), entries contain all needed data, there is no filtering, | |||||
| * so nbr_entries_filtered, entry_idx_start and entry_idx_end should all be set to -1. | |||||
| */ | |||||
| typedef struct FileDirEntryArr { | |||||
| ListBase entries; | |||||
| int nbr_entries; | |||||
| int nbr_entries_filtered; | |||||
| int entry_idx_start, entry_idx_end; | |||||
| char root[1024]; /* FILE_MAX */ | |||||
| } FileDirEntryArr; | |||||
| /* FileDirEntry.status */ | |||||
| enum { | |||||
| ASSET_STATUS_LOCAL = 1 << 0, /* If active uuid is available localy/immediately. */ | |||||
| ASSET_STATUS_LATEST = 1 << 1, /* If active uuid is latest available version. */ | |||||
| }; | |||||
| /* FileDirEntry.flags */ | |||||
| enum { | |||||
| FILE_ENTRY_INVALID_PREVIEW = 1 << 0, /* The preview for this entry could not be generated. */ | |||||
| }; | |||||
| /* Image/UV Editor ======================================== */ | /* Image/UV Editor ======================================== */ | ||||
| /* Image/UV Editor */ | /* Image/UV Editor */ | ||||
| typedef struct SpaceImage { | typedef struct SpaceImage { | ||||
| SpaceLink *next, *prev; | SpaceLink *next, *prev; | ||||
| ListBase regionbase; /* storage of regions for inactive spaces */ | ListBase regionbase; /* storage of regions for inactive spaces */ | ||||
| int spacetype; | int spacetype; | ||||
| ▲ Show 20 Lines • Show All 487 Lines • Show Last 20 Lines | |||||