Cleanup: move unneeded struct out of DNA.
The real reason is that there is a conflict between Carbon header defining a "Collection" struct, and this works around it.
This commit is contained in:
@@ -113,6 +113,17 @@ void ED_file_change_dir(struct bContext *C);
|
||||
|
||||
/* File menu stuff */
|
||||
|
||||
/* FSMenuEntry's without paths indicate separators */
|
||||
typedef struct FSMenuEntry {
|
||||
struct FSMenuEntry *next;
|
||||
|
||||
char *path;
|
||||
char name[256]; /* FILE_MAXFILE */
|
||||
short save;
|
||||
short valid;
|
||||
short pad[2];
|
||||
} FSMenuEntry;
|
||||
|
||||
typedef enum FSMenuCategory {
|
||||
FS_CATEGORY_SYSTEM,
|
||||
FS_CATEGORY_SYSTEM_BOOKMARKS,
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
|
||||
#include "BKE_appdir.h"
|
||||
|
||||
#include "DNA_space_types.h"
|
||||
|
||||
#include "ED_fileselect.h"
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
@@ -666,17 +666,6 @@ typedef struct SpaceFile {
|
||||
short systemnr, system_bookmarknr;
|
||||
} SpaceFile;
|
||||
|
||||
/* FSMenuEntry's without paths indicate separators */
|
||||
typedef struct FSMenuEntry {
|
||||
struct FSMenuEntry *next;
|
||||
|
||||
char *path;
|
||||
char name[256]; /* FILE_MAXFILE */
|
||||
short save;
|
||||
short valid;
|
||||
short pad[2];
|
||||
} FSMenuEntry;
|
||||
|
||||
/* FileSelectParams.display */
|
||||
enum eFileDisplayType {
|
||||
FILE_DEFAULTDISPLAY = 0,
|
||||
|
||||
@@ -1661,6 +1661,18 @@ static int rna_FileBrowser_FSMenuEntry_name_get_editable(PointerRNA *ptr, const
|
||||
return fsm->save ? PROP_EDITABLE : 0;
|
||||
}
|
||||
|
||||
static int rna_FileBrowser_FSMenuEntry_use_save_get(PointerRNA *ptr)
|
||||
{
|
||||
FSMenuEntry *fsm = ptr->data;
|
||||
return fsm->save;
|
||||
}
|
||||
|
||||
static int rna_FileBrowser_FSMenuEntry_is_valid_get(PointerRNA *ptr)
|
||||
{
|
||||
FSMenuEntry *fsm = ptr->data;
|
||||
return fsm->valid;
|
||||
}
|
||||
|
||||
static void rna_FileBrowser_FSMenu_next(CollectionPropertyIterator *iter)
|
||||
{
|
||||
ListBaseIterator *internal = &iter->internal.listbase;
|
||||
@@ -4039,14 +4051,12 @@ static void rna_def_filemenu_entry(BlenderRNA *brna)
|
||||
RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters");
|
||||
|
||||
prop = RNA_def_property(srna, "path", PROP_STRING, PROP_FILEPATH);
|
||||
RNA_def_property_string_sdna(prop, NULL, "path");
|
||||
RNA_def_property_string_funcs(prop, "rna_FileBrowser_FSMenuEntry_path_get",
|
||||
"rna_FileBrowser_FSMenuEntry_path_length",
|
||||
"rna_FileBrowser_FSMenuEntry_path_set");
|
||||
RNA_def_property_ui_text(prop, "Path", "");
|
||||
|
||||
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_string_sdna(prop, NULL, "name");
|
||||
RNA_def_property_string_funcs(prop, "rna_FileBrowser_FSMenuEntry_name_get",
|
||||
"rna_FileBrowser_FSMenuEntry_name_length",
|
||||
"rna_FileBrowser_FSMenuEntry_name_set");
|
||||
@@ -4055,12 +4065,12 @@ static void rna_def_filemenu_entry(BlenderRNA *brna)
|
||||
RNA_def_struct_name_property(srna, prop);
|
||||
|
||||
prop = RNA_def_property(srna, "use_save", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "save", 1);
|
||||
RNA_def_property_boolean_funcs(prop, "rna_FileBrowser_FSMenuEntry_use_save_get", NULL);
|
||||
RNA_def_property_ui_text(prop, "Save", "Whether this path is saved in bookmarks, or generated from OS");
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
|
||||
prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "valid", 1);
|
||||
RNA_def_property_boolean_funcs(prop, "rna_FileBrowser_FSMenuEntry_is_valid_get", NULL);
|
||||
RNA_def_property_ui_text(prop, "Valid", "Whether this path is currently reachable");
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user