Blender V2.61 - r43446
Defines | Functions | Variables

library.c File Reference

#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <assert.h>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_brush_types.h"
#include "DNA_camera_types.h"
#include "DNA_group_types.h"
#include "DNA_ipo_types.h"
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
#include "DNA_lattice_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meta_types.h"
#include "DNA_nla_types.h"
#include "DNA_node_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_speaker_types.h"
#include "DNA_sound_types.h"
#include "DNA_text_types.h"
#include "DNA_vfont_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_world_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_movieclip_types.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
#include "BLI_utildefines.h"
#include "BLI_bpath.h"
#include "BKE_animsys.h"
#include "BKE_camera.h"
#include "BKE_context.h"
#include "BKE_lamp.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_global.h"
#include "BKE_sound.h"
#include "BKE_object.h"
#include "BKE_screen.h"
#include "BKE_mesh.h"
#include "BKE_material.h"
#include "BKE_curve.h"
#include "BKE_mball.h"
#include "BKE_text.h"
#include "BKE_texture.h"
#include "BKE_scene.h"
#include "BKE_icons.h"
#include "BKE_image.h"
#include "BKE_ipo.h"
#include "BKE_key.h"
#include "BKE_world.h"
#include "BKE_font.h"
#include "BKE_group.h"
#include "BKE_lattice.h"
#include "BKE_armature.h"
#include "BKE_action.h"
#include "BKE_node.h"
#include "BKE_brush.h"
#include "BKE_idprop.h"
#include "BKE_particle.h"
#include "BKE_gpencil.h"
#include "BKE_fcurve.h"
#include "BKE_speaker.h"
#include "BKE_utildefines.h"
#include "BKE_movieclip.h"
#include "RNA_access.h"

Go to the source code of this file.

Defines

#define MAX_IDPUP   60
#define GS(a)   (*((short *)(a)))
#define IDPUP_NO_VIEWER   1
#define LIBTAG(a)   if(a && a->id.lib) {a->id.flag &=~LIB_INDIRECT; a->id.flag |= LIB_EXTERN;}

Functions

void BKE_id_lib_local_paths (Main *bmain, Library *lib, ID *id)
void id_lib_extern (ID *id)
void id_us_plus (ID *id)
void id_us_min (ID *id)
int id_make_local (ID *id, int test)
int id_copy (ID *id, ID **newid, int test)
int id_unlink (ID *id, int test)
int id_single_user (bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
ListBasewhich_libbase (Main *mainlib, short type)
void flag_listbase_ids (ListBase *lb, short flag, short value)
void flag_all_listbases_ids (short flag, short value)
void recalc_all_library_objects (Main *main)
int set_listbasepointers (Main *main, ListBase **lb)
static IDalloc_libblock_notest (short type)
void * alloc_libblock (ListBase *lb, short type, const char *name)
static void id_copy_animdata (ID *id, const short do_action)
void copy_libblock_data (ID *id, const ID *id_from, const short do_action)
void * copy_libblock (ID *id)
static void free_library (Library *UNUSED(lib))
void set_free_windowmanager_cb (void(*func)(bContext *C, wmWindowManager *))
static void animdata_dtar_clear_cb (ID *UNUSED(id), AnimData *adt, void *userdata)
void free_libblock (ListBase *lb, void *idv)
void free_libblock_us (ListBase *lb, void *idv)
void free_main (Main *mainvar)
IDfind_id (const char *type, const char *name)
static void get_flags_for_id (ID *id, char *buf)
static void IDnames_to_dyn_pupstring (DynStr *pupds, ListBase *lb, ID *link, short *nr, int hideflag)
void IDnames_to_pupstring (const char **str, const char *title, const char *extraops, ListBase *lb, ID *link, short *nr)
void IMAnames_to_pupstring (const char **str, const char *title, const char *extraops, ListBase *lb, ID *link, short *nr)
static void sort_alpha_id (ListBase *lb, ID *id)
static IDis_dupid (ListBase *lb, ID *id, const char *name)
static int check_for_dupid (ListBase *lb, ID *id, char *name)
int new_id (ListBase *lb, ID *id, const char *tname)
void id_clear_lib_data (Main *bmain, ID *id)
void clear_id_newpoins (void)
static void lib_indirect_test_id (ID *id, Library *lib)
void tag_main_lb (ListBase *lb, const short tag)
void tag_main_idcode (struct Main *mainvar, const short type, const short tag)
void tag_main (struct Main *mainvar, const short tag)
void BKE_library_make_local (Main *bmain, Library *lib, int untagged_only)
void test_idbutton (char *name)
void text_idbutton (struct ID *id, char *text)
void rename_id (ID *id, const char *name)
void name_uiprefix_id (char *name, ID *id)
void BKE_library_filepath_set (Library *lib, const char *filepath)

Variables

static void(* free_windowmanager_cb )(bContext *, wmWindowManager *) = NULL

Detailed Description

Definition in file library.c.


Define Documentation

#define GS (   a)    (*((short *)(a)))
#define IDPUP_NO_VIEWER   1

Definition at line 979 of file library.c.

Referenced by IDnames_to_dyn_pupstring(), and IMAnames_to_pupstring().

#define LIBTAG (   a)    if(a && a->id.lib) {a->id.flag &=~LIB_INDIRECT; a->id.flag |= LIB_EXTERN;}

Definition at line 1308 of file library.c.

Referenced by lib_indirect_test_id().

#define MAX_IDPUP   60

Definition at line 123 of file library.c.

Referenced by IDnames_to_dyn_pupstring().


Function Documentation

void* alloc_libblock ( ListBase lb,
short  type,
const char *  name 
)
static ID* alloc_libblock_notest ( short  type) [static]
static void animdata_dtar_clear_cb ( ID UNUSEDid,
AnimData adt,
void *  userdata 
) [static]
void BKE_id_lib_local_paths ( Main bmain,
Library lib,
ID id 
)
void BKE_library_filepath_set ( Library lib,
const char *  filepath 
)

Definition at line 1500 of file library.c.

References BLI_path_abs(), BLI_strncpy(), Library::filepath, G, Library::name, and Library::parent.

Referenced by bpath_traverse_id(), and namebutton_cb().

void BKE_library_make_local ( Main bmain,
Library lib,
int  untagged_only 
)
static int check_for_dupid ( ListBase lb,
ID id,
char *  name 
) [static]
void clear_id_newpoins ( void  )
void* copy_libblock ( ID id)
void copy_libblock_data ( ID id,
const ID id_from,
const short  do_action 
)

Definition at line 718 of file library.c.

References id_copy_animdata(), IDP_CopyProperty(), and ID::properties.

ID* find_id ( const char *  type,
const char *  name 
) [read]
void flag_all_listbases_ids ( short  flag,
short  value 
)

Definition at line 508 of file library.c.

References flag_listbase_ids(), G, MAX_LIBARRAY, and set_listbasepointers().

Referenced by bpy_lib_exit(), and wm_link_append_exec().

void flag_listbase_ids ( ListBase lb,
short  flag,
short  value 
)

Definition at line 496 of file library.c.

References ListBase::first, MDeformVert::flag, ID::flag, and ID::next.

Referenced by flag_all_listbases_ids().

void free_libblock ( ListBase lb,
void *  idv 
)
void free_libblock_us ( ListBase lb,
void *  idv 
)
static void free_library ( Library UNUSEDlib) [static]

Definition at line 755 of file library.c.

Referenced by free_libblock().

void free_main ( Main mainvar)
static void get_flags_for_id ( ID id,
char *  buf 
) [static]

Definition at line 953 of file library.c.

References GS, ID_MA, ID_TE, ID::lib, LIB_FAKEUSER, ID::name, and ID::us.

Referenced by IDnames_to_dyn_pupstring().

void id_clear_lib_data ( Main bmain,
ID id 
)
int id_copy ( ID id,
ID **  newid,
int  test 
)
static void id_copy_animdata ( ID id,
const short  do_action 
) [static]

Definition at line 707 of file library.c.

References IdAdtTemplate::adt, BKE_animdata_from_id(), and BKE_copy_animdata().

Referenced by copy_libblock_data().

void id_lib_extern ( ID id)
int id_make_local ( ID id,
int  test 
)
int id_single_user ( bContext C,
ID id,
PointerRNA ptr,
PropertyRNA prop 
)
int id_unlink ( ID id,
int  test 
)
void id_us_min ( ID id)
void id_us_plus ( ID id)
static void IDnames_to_dyn_pupstring ( DynStr pupds,
ListBase lb,
ID link,
short *  nr,
int  hideflag 
) [static]
void IDnames_to_pupstring ( const char **  str,
const char *  title,
const char *  extraops,
ListBase lb,
ID link,
short *  nr 
)
void IMAnames_to_pupstring ( const char **  str,
const char *  title,
const char *  extraops,
ListBase lb,
ID link,
short *  nr 
)
static ID* is_dupid ( ListBase lb,
ID id,
const char *  name 
) [static]

Definition at line 1107 of file library.c.

References ListBase::first, ID::lib, ID::name, ID::next, and NULL.

Referenced by check_for_dupid().

static void lib_indirect_test_id ( ID id,
Library lib 
) [static]
void name_uiprefix_id ( char *  name,
ID id 
)

Definition at line 1491 of file library.c.

References LIB_FAKEUSER, and ID::name.

Referenced by id_search_cb(), and rna_search_cb().

int new_id ( ListBase lb,
ID id,
const char *  tname 
)
void recalc_all_library_objects ( Main main)
void rename_id ( ID id,
const char *  name 
)
void set_free_windowmanager_cb ( void(*)(bContext *C, wmWindowManager *)  func)

Definition at line 762 of file library.c.

References free_windowmanager_cb.

int set_listbasepointers ( Main main,
ListBase **  lb 
)
static void sort_alpha_id ( ListBase lb,
ID id 
) [static]
void tag_main ( struct Main mainvar,
const short  tag 
)
void tag_main_idcode ( struct Main mainvar,
const short  type,
const short  tag 
)

Definition at line 1368 of file library.c.

References tag_main_lb(), and which_libbase().

void tag_main_lb ( ListBase lb,
const short  tag 
)

Definition at line 1353 of file library.c.

References ListBase::first, ID::flag, LIB_DOIT, and ID::next.

Referenced by tag_main(), and tag_main_idcode().

void test_idbutton ( char *  name)

Definition at line 1443 of file library.c.

References BLI_findstring(), G, GS, new_id(), NULL, sort_alpha_id(), and which_libbase().

Referenced by namebutton_cb().

void text_idbutton ( struct ID id,
char *  text 
)

Definition at line 1459 of file library.c.

References GS, ID_MA, ID_SCE, ID_SCR, and ID::name.

ListBase* which_libbase ( Main mainlib,
short  type 
) [read]

Variable Documentation

void(* free_windowmanager_cb)(bContext *, wmWindowManager *) = NULL [static]

Definition at line 760 of file library.c.

Referenced by free_libblock(), and set_free_windowmanager_cb().