Blender V2.61 - r43446
|
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include "MEM_guardedalloc.h"
#include "DNA_space_types.h"
#include "BLI_blenlib.h"
#include "BLI_linklist.h"
#include "BLI_dynstr.h"
#include "fsmenu.h"
Go to the source code of this file.
Classes | |
struct | _FSMenuEntry |
struct | FSMenu |
Typedefs | |
typedef struct _FSMenuEntry | FSMenuEntry |
typedef struct FSMenu | FSMenu |
Functions | |
struct FSMenu * | fsmenu_get (void) |
static FSMenuEntry * | fsmenu_get_category (struct FSMenu *fsmenu, FSMenuCategory category) |
static void | fsmenu_set_category (struct FSMenu *fsmenu, FSMenuCategory category, FSMenuEntry *fsms) |
int | fsmenu_get_nentries (struct FSMenu *fsmenu, FSMenuCategory category) |
char * | fsmenu_get_entry (struct FSMenu *fsmenu, FSMenuCategory category, int idx) |
short | fsmenu_can_save (struct FSMenu *fsmenu, FSMenuCategory category, int idx) |
void | fsmenu_insert_entry (struct FSMenu *fsmenu, FSMenuCategory category, const char *path, int sorted, short save) |
void | fsmenu_remove_entry (struct FSMenu *fsmenu, FSMenuCategory category, int idx) |
void | fsmenu_write_file (struct FSMenu *fsmenu, const char *filename) |
void | fsmenu_read_bookmarks (struct FSMenu *fsmenu, const char *filename) |
void | fsmenu_read_system (struct FSMenu *fsmenu) |
static void | fsmenu_free_category (struct FSMenu *fsmenu, FSMenuCategory category) |
void | fsmenu_free (struct FSMenu *fsmenu) |
Variables | |
static FSMenu * | g_fsmenu = NULL |
Definition in file fsmenu.c.
typedef struct _FSMenuEntry FSMenuEntry |
short fsmenu_can_save | ( | struct FSMenu * | fsmenu, |
FSMenuCategory | category, | ||
int | index | ||
) |
Return whether the entry was created by the user and can be saved and deleted
Definition at line 152 of file fsmenu.c.
References fsmenu_get_category(), _FSMenuEntry::next, and _FSMenuEntry::save.
Referenced by file_panel_category().
void fsmenu_free | ( | struct FSMenu * | fsmenu | ) |
Free's all the memory associated with the fsmenu
Definition at line 534 of file fsmenu.c.
References FS_CATEGORY_BOOKMARKS, FS_CATEGORY_RECENT, FS_CATEGORY_SYSTEM, fsmenu_free_category(), and MEM_freeN().
Referenced by ED_file_exit().
static void fsmenu_free_category | ( | struct FSMenu * | fsmenu, |
FSMenuCategory | category | ||
) | [static] |
Definition at line 520 of file fsmenu.c.
References fsmenu_get_category(), MEM_freeN(), _FSMenuEntry::next, and _FSMenuEntry::path.
Referenced by fsmenu_free().
struct FSMenu* fsmenu_get | ( | void | ) | [read] |
Definition at line 90 of file fsmenu.c.
References g_fsmenu, and MEM_callocN().
Referenced by bookmark_add_exec(), bookmark_delete_exec(), ED_file_exit(), ED_file_init(), file_exec(), and file_panel_category().
static FSMenuEntry* fsmenu_get_category | ( | struct FSMenu * | fsmenu, |
FSMenuCategory | category | ||
) | [static] |
Definition at line 98 of file fsmenu.c.
References FS_CATEGORY_BOOKMARKS, FS_CATEGORY_RECENT, FS_CATEGORY_SYSTEM, FSMenu::fsmenu_bookmarks, FSMenu::fsmenu_recent, FSMenu::fsmenu_system, and NULL.
Referenced by fsmenu_can_save(), fsmenu_free_category(), fsmenu_get_entry(), fsmenu_get_nentries(), fsmenu_insert_entry(), fsmenu_remove_entry(), and fsmenu_write_file().
char* fsmenu_get_entry | ( | struct FSMenu * | fsmenu, |
FSMenuCategory | category, | ||
int | index | ||
) |
Returns the fsmenu entry at index (or NULL if a bad index) or a separator.
Definition at line 142 of file fsmenu.c.
References fsmenu_get_category(), _FSMenuEntry::next, NULL, and _FSMenuEntry::path.
Referenced by file_panel_category().
int fsmenu_get_nentries | ( | struct FSMenu * | fsmenu, |
FSMenuCategory | category | ||
) |
Returns the number of entries in the Fileselect Menu
Definition at line 131 of file fsmenu.c.
References fsmenu_get_category(), and _FSMenuEntry::next.
Referenced by bookmark_delete_exec(), file_panel_category(), and fsmenu_write_file().
void fsmenu_insert_entry | ( | struct FSMenu * | fsmenu, |
FSMenuCategory | category, | ||
const char * | path, | ||
int | sorted, | ||
short | save | ||
) |
Inserts a new fsmenu entry with the given path. Duplicate entries are not added.
sorted | Should entry be inserted in sorted order? |
Definition at line 162 of file fsmenu.c.
References BLI_path_cmp, BLI_strdup(), fsmenu_get_category(), fsmenu_set_category(), MEM_mallocN(), and _FSMenuEntry::next.
Referenced by bookmark_add_exec(), file_exec(), fsmenu_read_bookmarks(), and fsmenu_read_system().
void fsmenu_read_bookmarks | ( | struct FSMenu * | fsmenu, |
const char * | filename | ||
) |
reads the 'bookmarks' from the specified file
Definition at line 258 of file fsmenu.c.
References BLI_exists(), FS_CATEGORY_BOOKMARKS, FS_CATEGORY_RECENT, fsmenu_insert_entry(), len(), NULL, and strlen().
Referenced by ED_file_init().
void fsmenu_read_system | ( | struct FSMenu * | fsmenu | ) |
adds system specific directories
Definition at line 288 of file fsmenu.c.
References BLI_exists(), BLI_snprintf(), err, FILE_MAX, FILE_MAXDIR, FS_CATEGORY_BOOKMARKS, FS_CATEGORY_SYSTEM, fsmenu_insert_entry(), i, len(), NULL, and strlen().
Referenced by ED_file_init().
void fsmenu_remove_entry | ( | struct FSMenu * | fsmenu, |
FSMenuCategory | category, | ||
int | index | ||
) |
Removes the fsmenu entry at the given index.
Definition at line 203 of file fsmenu.c.
References fsmenu_get_category(), fsmenu_set_category(), MEM_freeN(), _FSMenuEntry::next, and NULL.
Referenced by bookmark_delete_exec().
static void fsmenu_set_category | ( | struct FSMenu * | fsmenu, |
FSMenuCategory | category, | ||
FSMenuEntry * | fsms | ||
) | [static] |
Definition at line 116 of file fsmenu.c.
References FS_CATEGORY_BOOKMARKS, FS_CATEGORY_RECENT, FS_CATEGORY_SYSTEM, FSMenu::fsmenu_bookmarks, FSMenu::fsmenu_recent, and FSMenu::fsmenu_system.
Referenced by fsmenu_insert_entry(), and fsmenu_remove_entry().
void fsmenu_write_file | ( | struct FSMenu * | fsmenu, |
const char * | filename | ||
) |
saves the 'bookmarks' to the specified file
Definition at line 231 of file fsmenu.c.
References FS_CATEGORY_BOOKMARKS, FS_CATEGORY_RECENT, fsmenu_get_category(), fsmenu_get_nentries(), FSMENU_RECENT_MAX, _FSMenuEntry::next, NULL, _FSMenuEntry::path, and _FSMenuEntry::save.
Referenced by bookmark_add_exec(), bookmark_delete_exec(), and file_exec().
Definition at line 88 of file fsmenu.c.
Referenced by fsmenu_get().