Blender V2.61 - r43446
|
#include <stddef.h>
#include <string.h>
#include <errno.h>
#include "zlib.h"
#include <unistd.h>
#include "MEM_guardedalloc.h"
#include "MEM_CacheLimiterC-Api.h"
#include "BLI_blenlib.h"
#include "BLI_linklist.h"
#include "BLI_utildefines.h"
#include "BLI_callbacks.h"
#include "BLF_translation.h"
#include "DNA_anim_types.h"
#include "DNA_ipo_types.h"
#include "DNA_object_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_windowmanager_types.h"
#include "BKE_blender.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_DerivedMesh.h"
#include "BKE_font.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_packedFile.h"
#include "BKE_report.h"
#include "BKE_sound.h"
#include "BKE_texture.h"
#include "BLO_readfile.h"
#include "BLO_writefile.h"
#include "RNA_access.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_thumbs.h"
#include "ED_datafiles.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "ED_view3d.h"
#include "ED_util.h"
#include "RE_pipeline.h"
#include "GHOST_C-api.h"
#include "GHOST_Path-api.h"
#include "UI_interface.h"
#include "GPU_draw.h"
#include "WM_api.h"
#include "WM_types.h"
#include "wm.h"
#include "wm_files.h"
#include "wm_window.h"
#include "wm_event_system.h"
Go to the source code of this file.
Definition in file wm_files.c.
#define BKE_READ_EXOTIC_FAIL_FORMAT -2 |
Definition at line 302 of file wm_files.c.
Referenced by wm_read_exotic(), and WM_read_file().
#define BKE_READ_EXOTIC_FAIL_OPEN -1 |
Definition at line 303 of file wm_files.c.
Referenced by wm_read_exotic(), and WM_read_file().
#define BKE_READ_EXOTIC_FAIL_PATH -3 |
Definition at line 301 of file wm_files.c.
Referenced by wm_read_exotic(), and WM_read_file().
#define BKE_READ_EXOTIC_OK_BLEND 0 |
Definition at line 304 of file wm_files.c.
Referenced by wm_read_exotic(), and WM_read_file().
#define BKE_READ_EXOTIC_OK_OTHER 1 |
Definition at line 305 of file wm_files.c.
Referenced by WM_read_file().
Definition at line 648 of file wm_files.c.
References BLEN_THUMB_SIZE, Scene::camera, ED_view3d_draw_offscreen_imbuf_simple(), G, IB_rect, IMB_overlayblend_thumb(), IMB_scaleImBuf(), MEM_mallocN(), NULL, OB_SOLID, Scene::r, ImBuf::rect, ImBuf::x, RenderData::xasp, RenderData::xsch, ImBuf::y, RenderData::yasp, and RenderData::ysch.
Referenced by WM_write_file().
void wm_autosave_delete | ( | void | ) |
Definition at line 918 of file wm_files.c.
References BLI_delete(), BLI_exists(), BLI_make_file_string(), BLI_rename(), BLI_temporary_dir(), FILE_MAX, str, U, UserDef::uiflag, USER_GLOBALUNDO, and wm_autosave_location().
Referenced by WM_exit_ext().
void WM_autosave_init | ( | wmWindowManager * | wm | ) |
Definition at line 871 of file wm_files.c.
References wmWindowManager::autosavetimer, UserDef::flag, NULL, UserDef::savetime, TIMERAUTOSAVE, U, USER_AUTOSAVE, wm_autosave_timer_ended(), and WM_event_add_timer().
Referenced by WM_check().
void wm_autosave_location | ( | char * | filepath | ) |
Definition at line 843 of file wm_files.c.
References abs(), BLENDER_USER_AUTOSAVE, BLI_exists(), BLI_get_folder_create(), BLI_make_file_string(), BLI_snprintf(), BLI_temporary_dir(), and NULL.
Referenced by wm_autosave_delete(), wm_autosave_read(), wm_autosave_timer(), and wm_recover_auto_save_invoke().
void wm_autosave_read | ( | bContext * | C, |
ReportList * | reports | ||
) |
Definition at line 934 of file wm_files.c.
References FILE_MAX, wm_autosave_location(), and WM_read_file().
void wm_autosave_timer | ( | const bContext * | C, |
wmWindowManager * | wm, | ||
wmTimer * | UNUSEDwt | ||
) |
Definition at line 879 of file wm_files.c.
References wmWindowManager::autosavetimer, BLO_write_file(), CTX_data_main(), FILE_MAX, RecentFile::filepath, ListBase::first, G, G_FILE_AUTOPLAY, G_FILE_COMPRESS, G_FILE_HISTORY, G_FILE_LOCK, G_FILE_SIGN, wmWindow::modalhandlers, wmEventHandler::next, wmWindow::next, NULL, wmEventHandler::op, UserDef::savetime, TIMERAUTOSAVE, U, wmWindowManager::windows, wm_autosave_location(), WM_event_add_timer(), and WM_event_remove_timer().
Referenced by wm_window_timer().
void wm_autosave_timer_ended | ( | wmWindowManager * | wm | ) |
Definition at line 910 of file wm_files.c.
References wmWindowManager::autosavetimer, NULL, and WM_event_remove_timer().
Referenced by WM_autosave_init(), and wm_close_and_free().
static void wm_init_userdef | ( | bContext * | C | ) | [static] |
Definition at line 277 of file wm_files.c.
References BLI_init_temporary_dir(), CTX_data_main(), UserDef::flag, G, G_FILE_NO_UI, G_SCRIPT_AUTOEXEC, G_SCRIPT_OVERRIDE_PREF, MEM_CacheLimiter_set_maximum(), UserDef::memcachelimit, sound_init(), UserDef::tempdir, U, UI_init_userdef(), USER_FILENOUI, and USER_SCRIPT_AUTOEXEC_DISABLE.
Referenced by WM_read_file(), and WM_read_homefile().
static int wm_read_exotic | ( | Scene * | UNUSEDscene, |
const char * | name | ||
) | [static] |
Definition at line 308 of file wm_files.c.
References BKE_READ_EXOTIC_FAIL_FORMAT, BKE_READ_EXOTIC_FAIL_OPEN, BKE_READ_EXOTIC_FAIL_PATH, BKE_READ_EXOTIC_OK_BLEND, ELEM, len(), NULL, and strlen().
Referenced by WM_read_file().
void WM_read_file | ( | bContext * | C, |
const char * | filepath, | ||
ReportList * | reports | ||
) |
Definition at line 353 of file wm_files.c.
References BKE_READ_EXOTIC_FAIL_FORMAT, BKE_READ_EXOTIC_FAIL_OPEN, BKE_READ_EXOTIC_FAIL_PATH, BKE_READ_EXOTIC_OK_BLEND, BKE_READ_EXOTIC_OK_OTHER, BKE_read_file(), BKE_READ_FILE_FAIL, BKE_READ_FILE_OK_USERPREFS, BKE_reportf(), BKE_reset_undo(), BKE_write_undo(), BLI_assert, BLI_CB_EVT_LOAD_POST, BLI_CB_EVT_LOAD_PRE, BLI_exec_cb(), BLI_findstring(), BPY_app_handlers_reset(), BPY_driver_reset(), BPY_modules_load_user(), CTX_data_main(), CTX_data_scene(), CTX_wm_manager(), CTX_wm_window_set(), DAG_on_visible_update(), ED_editors_init(), RenderData::engine, FALSE, G, G_SCRIPT_AUTOEXEC, G_SCRIPT_OVERRIDE_PREF, Scene::id, IFACE_, ID::name, NC_WM, ND_FILEREAD, ID::next, NULL, Scene::r, R_engines, RPT_ERROR, RPT_WARNING, TRUE, WM_check(), WM_cursor_wait(), WM_event_add_notifier(), wm_init_userdef(), wm_read_exotic(), wm_window_match_do(), wm_window_match_init(), and write_history().
Referenced by load_file(), wm_autosave_read(), wm_open_mainfile_exec(), wm_recover_auto_save_exec(), and wm_recover_last_session_exec().
void WM_read_history | ( | void | ) |
Definition at line 565 of file wm_files.c.
References BLENDER_HISTORY_FILE, BLENDER_USER_CONFIG, BLI_addtail(), BLI_exists(), BLI_file_free_lines(), BLI_file_read_as_lines(), BLI_get_folder(), BLI_make_file_string(), BLI_strdup(), FILE_MAX, RecentFile::filepath, G, MEM_mallocN(), LinkNode::next, NULL, UserDef::recent_files, and U.
Referenced by WM_init().
int WM_read_homefile | ( | bContext * | C, |
ReportList * | UNUSEDreports, | ||
short | from_memory | ||
) |
Definition at line 464 of file wm_files.c.
References BKE_read_file(), BKE_READ_FILE_FAIL, BKE_read_file_from_memory(), BKE_reset_undo(), BKE_write_undo(), BLENDER_STARTUP_FILE, BLENDER_USER_CONFIG, BLI_exists(), BLI_get_folder(), BLI_make_file_string(), BPY_app_handlers_reset(), BPY_driver_reset(), BPY_modules_load_user(), BPY_string_exec(), CTX_data_main(), CTX_py_init_get(), CTX_wm_window_set(), DAG_on_visible_update(), datatoc_startup_blend, datatoc_startup_blend_size, ED_editors_init(), FALSE, FILE_MAX, ListBase::first, UserDef::flag, free_ttfont(), G, G_FILE_AUTOPLAY, G_FILE_NO_UI, G_FILE_RELATIVE_REMAP, GPU_default_lights(), NC_WM, ND_FILEREAD, NULL, STRINGIFY, UserDef::themes, TRUE, U, USER_SCRIPT_AUTOEXEC_DISABLE, WM_check(), wm_clear_default_size(), WM_event_add_notifier(), wm_init_userdef(), wm_window_match_do(), and wm_window_match_init().
Referenced by WM_init(), and WM_read_homefile_exec().
int WM_read_homefile_exec | ( | bContext * | C, |
wmOperator * | op | ||
) |
Definition at line 559 of file wm_files.c.
References wmOperatorType::idname, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, wmOperator::type, and WM_read_homefile().
Referenced by WM_OT_read_factory_settings(), and WM_OT_read_homefile().
Definition at line 182 of file wm_files.c.
References wmWindow::active, wmWindowManager::addonconf, BLI_strncpy(), CTX_wm_screen(), wmWindowManager::defaultconf, ED_screen_duplicate(), ED_screens_initialize(), wmWindow::eventstate, ListBase::first, G, G_FILE_NO_UI, GHOST_SetWindowUserData(), wmWindow::ghostwin, bScreen::id, wmWindowManager::id, wmWindowManager::initialized, wmWindowManager::keyconfigs, ListBase::last, ID::name, wmWindow::next, ID::next, NULL, wmWindow::posx, wmWindow::posy, wmWindow::screen, wmWindow::screenname, wmWindow::sizex, wmWindow::sizey, wmWindowManager::userconf, wmWindowManager::winactive, wmWindowManager::windows, wmWindow::winid, bScreen::winid, wm_add_default(), and wm_close_and_free_all().
Referenced by WM_read_file(), and WM_read_homefile().
Definition at line 129 of file wm_files.c.
References BLI_remlink(), BLI_strncpy(), CTX_wm_window(), CTX_wm_window_set(), ED_editors_exit(), ED_screen_exit(), ListBase::first, G, G_FILE_NO_UI, wmWindow::handlers, bScreen::id, wmWindowManager::id, MAX_ID_NAME, wmWindow::modalhandlers, ID::name, wmWindow::next, ID::next, NULL, wmWindow::screen, wmWindow::screenname, wmWindowManager::winactive, wmWindowManager::windows, WM_event_remove_handlers(), and WM_jobs_stop_all().
Referenced by WM_read_file(), and WM_read_homefile().
int WM_write_file | ( | bContext * | C, |
const char * | target, | ||
int | fileflags, | ||
ReportList * | reports, | ||
int | copy | ||
) |
Definition at line 711 of file wm_files.c.
References BKE_report(), BKE_reportf(), blend_file_thumb(), BLI_CB_EVT_SAVE_POST, BLI_CB_EVT_SAVE_PRE, BLI_exec_cb(), BLI_path_cmp, BLI_replace_extension(), BLI_strncpy(), BLO_write_file(), CTX_data_main(), CTX_data_scene(), ED_object_exit_editmode(), ED_sculpt_force_update(), EM_DO_UNDO, FILE_MAX, RecentFile::filepath, Library::filepath, UserDef::flag, G, G_AUTOPACK, G_FILE_AUTOPLAY, G_FILE_COMPRESS, G_FILE_HISTORY, Library::id, IMB_freeImBuf(), IMB_thumb_create(), len(), MEM_freeN(), ID::next, NULL, packAll(), RPT_ERROR, strlen(), THB_NORMAL, THB_SOURCE_BLEND, U, USER_SAVE_PREVIEWS, WM_cursor_wait(), and write_history().
Referenced by wm_save_as_mainfile_exec().
int WM_write_homefile | ( | bContext * | C, |
wmOperator * | op | ||
) |
Definition at line 809 of file wm_files.c.
References BLENDER_STARTUP_FILE, BLENDER_USER_CONFIG, BLI_get_folder_create(), BLI_make_file_string(), BLO_write_file(), CTX_data_main(), CTX_wm_manager(), CTX_wm_window(), FILE_MAX, RecentFile::filepath, G, G_FILE_AUTOPLAY, G_FILE_COMPRESS, G_FILE_HISTORY, G_FILE_LOCK, G_FILE_SIGN, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, wmWindow::screen, bScreen::temp, WM_keyconfig_update(), and wm_window_close().
Referenced by WM_OT_save_homefile().
int write_crash_blend | ( | void | ) |
Definition at line 694 of file wm_files.c.
References BLI_replace_extension(), BLI_strncpy(), BLO_write_file(), FILE_MAX, G, G_FILE_HISTORY, and NULL.
static void write_history | ( | void | ) | [static] |
Definition at line 597 of file wm_files.c.
References BLENDER_HISTORY_FILE, BLENDER_USER_CONFIG, BLI_addhead(), BLI_freelinkN(), BLI_get_folder_create(), BLI_make_file_string(), BLI_path_cmp, BLI_strdup(), FILE_MAX, RecentFile::filepath, G, GHOST_addToSystemRecentFiles(), i, MEM_freeN(), MEM_mallocN(), RecentFile::next, NULL, UserDef::recent_files, and U.
Referenced by WM_read_file(), and WM_write_file().