Also use const char in many other parts of blenders code.
Currently this gives warnings for setting operator id, label and description since these are an exception and allocated beforehand.
extern "C" {
#endif
-struct bArmature *add_armature(char *name);
+struct bArmature *add_armature(const char *name);
struct bArmature *get_armature(struct Object *ob);
void free_bonelist (struct ListBase *lb);
void free_armature(struct bArmature *arm);
#define BLENDER_MINVERSION 250
#define BLENDER_MINSUBVERSION 0
-int BKE_read_file(struct bContext *C, char *dir, struct ReportList *reports);
+int BKE_read_file(struct bContext *C, const char *filepath, struct ReportList *reports);
int BKE_read_file_from_memory(struct bContext *C, char* filebuf, int filelength, struct ReportList *reports);
int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile, struct ReportList *reports);
int blender_test_break(void);
/* global undo */
-extern void BKE_write_undo(struct bContext *C, char *name);
+extern void BKE_write_undo(struct bContext *C, const char *name);
extern void BKE_undo_step(struct bContext *C, int step);
extern void BKE_undo_name(struct bContext *C, const char *name);
extern void BKE_reset_undo(void);
/* Stored Context */
-bContextStore *CTX_store_add(ListBase *contexts, char *name, PointerRNA *ptr);
+bContextStore *CTX_store_add(ListBase *contexts, const char *name, PointerRNA *ptr);
void CTX_store_set(bContext *C, bContextStore *store);
bContextStore *CTX_store_copy(bContextStore *store);
void CTX_store_free(bContextStore *store);
void unlink_curve( struct Curve *cu);
void free_curve( struct Curve *cu);
void BKE_free_editfont(struct Curve *cu);
-struct Curve *add_curve(char *name, int type);
+struct Curve *add_curve(const char *name, int type);
struct Curve *copy_curve( struct Curve *cu);
void make_local_curve( struct Curve *cu);
short curve_type( struct Curve *cu);
* returns the layer data */
void *CustomData_duplicate_referenced_layer(struct CustomData *data, int type);
void *CustomData_duplicate_referenced_layer_named(struct CustomData *data,
- int type, char *name);
+ int type, const char *name);
/* set the CD_FLAG_NOCOPY flag in custom data layers where the mask is
* zero for the layer type, so only layer types specified by the mask
void *CustomData_get_layer(const struct CustomData *data, int type);
void *CustomData_get_layer_n(const struct CustomData *data, int type, int n);
void *CustomData_get_layer_named(const struct CustomData *data, int type,
- char *name);
+ const char *name);
int CustomData_get_layer_index(const struct CustomData *data, int type);
-int CustomData_get_named_layer_index(const struct CustomData *data, int type, char *name);
+int CustomData_get_named_layer_index(const struct CustomData *data, int type, const char *name);
int CustomData_get_active_layer_index(const struct CustomData *data, int type);
int CustomData_get_render_layer_index(const struct CustomData *data, int type);
int CustomData_get_clone_layer_index(const struct CustomData *data, int type);
* @retval 1 The file was read succesfully.
* @attention Used in filesel.c
*/
-int BKE_read_exotic(struct Scene *scene, char *name);
+int BKE_read_exotic(struct Scene *scene, const char *name);
void write_dxf(struct Scene *scene, char *str);
void write_stl(struct Scene *scene, char *str);
void free_vfont(struct VFont *sc);
void free_ttfont(void);
struct VFont *get_builtin_font(void);
-struct VFont *load_vfont(char *name);
+struct VFont *load_vfont(const char *name);
struct TmpFont *vfont_find_tmpfont(struct VFont *vfont);
struct chartrans *BKE_text_to_curve(struct Scene *scene, struct Object *ob, int mode);
void free_group_objects(struct Group *group);
void unlink_group(struct Group *group);
-struct Group *add_group(char *name);
+struct Group *add_group(const char *name);
struct Group *copy_group(struct Group *group);
int add_to_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
int rem_from_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base);
void BKE_stamp_info(struct Scene *scene, struct ImBuf *ibuf);
void BKE_stamp_buf(struct Scene *scene, unsigned char *rect, float *rectf, int width, int height, int channels);
-int BKE_write_ibuf(struct Scene *scene, struct ImBuf *ibuf, char *name, int imtype, int subimtype, int quality);
+int BKE_write_ibuf(struct Scene *scene, struct ImBuf *ibuf, const char *name, int imtype, int subimtype, int quality);
void BKE_makepicstring(char *string, const char *base, int frame, int imtype, const short use_ext, const short use_frames);
int BKE_add_image_extension(char *string, int imtype);
int BKE_ftype_to_imtype(int ftype);
struct Image *BKE_add_image_file(const char *name);
/* adds image, adds ibuf, generates color or pattern */
-struct Image *BKE_add_image_size(unsigned int width, unsigned int height, char *name, int depth, int floatbuf, short uvtestgrid, float color[4]);
+struct Image *BKE_add_image_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4]);
/* adds image from imbuf, owns imbuf */
struct Image *BKE_add_image_imbuf(struct ImBuf *ibuf);
float *do_ob_key(struct Scene *scene, struct Object *ob);
struct Key *ob_get_key(struct Object *ob);
-struct KeyBlock *add_keyblock(struct Key *key, char *name);
+struct KeyBlock *add_keyblock(struct Key *key, const char *name);
struct KeyBlock *ob_get_keyblock(struct Object *ob);
struct KeyBlock *ob_get_reference_keyblock(struct Object *ob);
struct KeyBlock *key_get_keyblock(struct Key *key, int index);
struct MDeformVert;
void resizelattice(struct Lattice *lt, int u, int v, int w, struct Object *ltOb);
-struct Lattice *add_lattice(char *name);
+struct Lattice *add_lattice(const char *name);
struct Lattice *copy_lattice(struct Lattice *lt);
void free_lattice(struct Lattice *lt);
void make_local_lattice(struct Lattice *lt);
void test_idbutton(char *name);
void text_idbutton(struct ID *id, char *text);
void all_local(struct Library *lib, int untagged_only);
-struct ID *find_id(char *type, char *name);
+struct ID *find_id(char *type, const char *name);
void clear_id_newpoins(void);
void IDnames_to_pupstring(char **str, char *title, char *extraops, struct ListBase *lb,struct ID* link, short *nr);
void free_material(struct Material *sc);
void test_object_materials(struct ID *id);
void init_material(struct Material *ma);
-struct Material *add_material(char *name);
+struct Material *add_material(const char *name);
struct Material *copy_material(struct Material *ma);
struct Material *give_node_material(struct Material *ma); /* returns node material or self */
void make_local_material(struct Material *ma);
void unlink_mball(struct MetaBall *mb);
void free_mball(struct MetaBall *mb);
-struct MetaBall *add_mball(char *name);
+struct MetaBall *add_mball(const char *name);
struct MetaBall *copy_mball(struct MetaBall *mb);
void make_local_mball(struct MetaBall *mb);
struct MetaElem *add_metaball_element(struct MetaBall *mb, const int type);
void unlink_mesh(struct Mesh *me);
void free_mesh(struct Mesh *me);
-struct Mesh *add_mesh(char *name);
+struct Mesh *add_mesh(const char *name);
struct Mesh *copy_mesh(struct Mesh *me);
void mesh_update_customdata_pointers(struct Mesh *me);
void make_local_tface(struct Mesh *me);
void unlink_object(struct Object *ob);
int exist_object(struct Object *obtest);
-void *add_camera(char *name);
+void *add_camera(const char *name);
struct Camera *copy_camera(struct Camera *cam);
void make_local_camera(struct Camera *cam);
float dof_camera(struct Object *ob);
-void *add_lamp(char *name);
+void *add_lamp(const char *name);
struct Lamp *copy_lamp(struct Lamp *la);
void make_local_lamp(struct Lamp *la);
void free_camera(struct Camera *ca);
void free_lamp(struct Lamp *la);
-struct Object *add_only_object(int type, char *name);
+struct Object *add_only_object(int type, const char *name);
struct Object *add_object(struct Scene *scene, int type);
struct Object *copy_object(struct Object *ob);
int object_insert_ptcache(struct Object *ob);
// void object_delete_ptcache(struct Object *ob, int index);
-struct KeyBlock *object_insert_shape_key(struct Scene *scene, struct Object *ob, char *name, int from_mix);
+struct KeyBlock *object_insert_shape_key(struct Scene *scene, struct Object *ob, const char *name, int from_mix);
void object_camera_matrix(
struct RenderData *rd, struct Object *camera, int winx, int winy, short field_second,
struct VFont;
/* pack */
-struct PackedFile *newPackedFile(struct ReportList *reports, char *filename);
+struct PackedFile *newPackedFile(struct ReportList *reports, const char *filename);
struct PackedFile *newPackedFileMemory(void *mem, int memlen);
void packAll(struct Main *bmain, struct ReportList *reports);
void psys_particle_on_emitter(struct ParticleSystemModifierData *psmd, int distr, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor);
struct ParticleSystemModifierData *psys_get_modifier(struct Object *ob, struct ParticleSystem *psys);
-struct ModifierData *object_add_particle_system(struct Scene *scene, struct Object *ob, char *name);
+struct ModifierData *object_add_particle_system(struct Scene *scene, struct Object *ob, const char *name);
void object_remove_particle_system(struct Scene *scene, struct Object *ob);
-struct ParticleSettings *psys_new_settings(char *name, struct Main *main);
+struct ParticleSettings *psys_new_settings(const char *name, struct Main *main);
struct ParticleSettings *psys_copy_settings(struct ParticleSettings *part);
void make_local_particlesettings(struct ParticleSettings *part);
void free_qtcodecdata(struct QuicktimeCodecData *acd);
void free_scene(struct Scene *sce);
-struct Scene *add_scene(char *name);
+struct Scene *add_scene(const char *name);
struct Base *object_in_scene(struct Object *ob, struct Scene *sce);
void set_scene_bg(struct Main *bmain, struct Scene *sce);
void free_text (struct Text *text);
void txt_set_undostate (int u);
int txt_get_undostate (void);
-struct Text* add_empty_text (char *name);
+struct Text* add_empty_text (const char *name);
int reopen_text (struct Text *text);
-struct Text* add_text (char *file, const char *relpath);
+struct Text* add_text (const char *file, const char *relpath);
struct Text* copy_text (struct Text *ta);
void unlink_text (struct Main *bmain, struct Text *text);
void clear_text(struct Text *text);
-void write_text(struct Text *text, char *str);
+void write_text(struct Text *text, const char *str);
char* txt_to_buf (struct Text *text);
void txt_clean_text (struct Text *text);
struct World;
void free_world(struct World *sc);
-struct World *add_world(char *name);
+struct World *add_world(const char *name);
struct World *copy_world(struct World *wrld);
void make_local_world(struct World *wrld);
/* **************** Generic Functions, data level *************** */
-bArmature *add_armature(char *name)
+bArmature *add_armature(const char *name)
{
bArmature *arm;
/* context matching */
/* handle no-ui case */
-static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename)
+static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filename)
{
bScreen *curscreen= NULL;
Scene *curscene= NULL;
2: OK, and with new user settings
*/
-int BKE_read_file(bContext *C, char *dir, ReportList *reports)
+int BKE_read_file(bContext *C, const char *dir, ReportList *reports)
{
BlendFileData *bfd;
int retval= 1;
}
/* name can be a dynamic string */
-void BKE_write_undo(bContext *C, char *name)
+void BKE_write_undo(bContext *C, const char *name)
{
uintptr_t maxmem, totmem, memused;
int nr, success;
/* store */
-bContextStore *CTX_store_add(ListBase *contexts, char *name, PointerRNA *ptr)
+bContextStore *CTX_store_add(ListBase *contexts, const char *name, PointerRNA *ptr)
{
bContextStoreEntry *entry;
bContextStore *ctx, *lastctx;
if(cu->tb) MEM_freeN(cu->tb);
}
-Curve *add_curve(char *name, int type)
+Curve *add_curve(const char *name, int type)
{
Curve *cu;
return -1;
}
-int CustomData_get_named_layer_index(const CustomData *data, int type, char *name)
+int CustomData_get_named_layer_index(const CustomData *data, int type, const char *name)
{
int i;
}
void *CustomData_duplicate_referenced_layer_named(struct CustomData *data,
- int type, char *name)
+ int type, const char *name)
{
CustomDataLayer *layer;
int layer_index;
}
void *CustomData_get_layer_named(const struct CustomData *data, int type,
- char *name)
+ const char *name)
{
int layer_index = CustomData_get_named_layer_index(data, type, name);
if(layer_index < 0) return NULL;
#include "zlib.h"
-static int is_dxf(char *str);
-static void dxf_read(Scene *scene, char *filename);
-static int is_stl(char *str);
+static int is_dxf(const char *str);
+static void dxf_read(Scene *scene, const char *filename);
+static int is_stl(const char *str);
-static int is_stl_ascii(char *str)
+static int is_stl_ascii(const char *str)
{
FILE *fpSTL;
char buffer[1000];
return 1;
}
-static int is_stl(char *str)
+static int is_stl(const char *str)
{
int i;
i = strlen(str) - 3;
}
}
-static void read_stl_mesh_binary(Scene *scene, char *str)
+static void read_stl_mesh_binary(Scene *scene, const char *str)
{
FILE *fpSTL;
Object *ob;
STLBAILOUT("Bad vertex!"); \
++totvert; \
}
-static void read_stl_mesh_ascii(Scene *scene, char *str)
+static void read_stl_mesh_ascii(Scene *scene, const char *str)
{
FILE *fpSTL;
char buffer[2048], *cp;
/* ************************************************************ */
-int BKE_read_exotic(Scene *scene, char *name)
+int BKE_read_exotic(Scene *scene, const char *name)
{
int len;
gzFile gzfile;
static short error_exit=0;
static short hasbumped=0;
-static int is_dxf(char *str)
+static int is_dxf(const char *str)
{
dxf_line=0;
hasbumped=1;
}
-static void dxf_read(Scene *scene, char *filename)
+static void dxf_read(Scene *scene, const char *filename)
{
Mesh *lastMe = G.main->mesh.last;
return vfont->data;
}
-VFont *load_vfont(char *name)
+VFont *load_vfont(const char *name)
{
char filename[FILE_MAXFILE];
VFont *vfont= NULL;
group->id.us= 0;
}
-Group *add_group(char *name)
+Group *add_group(const char *name)
{
Group *group;
return ima;
}
-static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, char *name, int depth, int floatbuf, short uvtestgrid, float color[4])
+static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4])
{
ImBuf *ibuf;
unsigned char *rect= NULL;
}
/* adds new image block, creates ImBuf and initializes color */
-Image *BKE_add_image_size(unsigned int width, unsigned int height, char *name, int depth, int floatbuf, short uvtestgrid, float color[4])
+Image *BKE_add_image_size(unsigned int width, unsigned int height, const char *name, int depth, int floatbuf, short uvtestgrid, float color[4])
{
/* on save, type is changed to FILE in editsima.c */
Image *ima= image_alloc(name, IMA_SRC_GENERATED, IMA_TYPE_UV_TEST);
if (stamp_data.rendertime[0]) IMB_metadata_change_field (ibuf, "RenderTime", stamp_data.rendertime);
}
-int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, char *name, int imtype, int subimtype, int quality)
+int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, const char *name, int imtype, int subimtype, int quality)
{
int ok;
(void)subimtype; /* quies unused warnings */
return NULL;
}
-KeyBlock *add_keyblock(Key *key, char *name)
+KeyBlock *add_keyblock(Key *key, const char *name)
{
KeyBlock *kb;
float curpos= -0.1;
MEM_freeN(vertexCos);
}
-Lattice *add_lattice(char *name)
+Lattice *add_lattice(const char *name)
{
Lattice *lt;
/* ***************** ID ************************ */
-ID *find_id(char *type, char *name) /* type: "OB" or "MA" etc */
+ID *find_id(char *type, const char *name) /* type: "OB" or "MA" etc */
{
ListBase *lb= which_libbase(G.main, GS(type));
return BLI_findstring(lb, name, offsetof(ID, name) + 2);
* Check to see if there is an ID with the same name as 'name'.
* Returns the ID if so, if not, returns NULL
*/
-static ID *is_dupid(ListBase *lb, ID *id, char *name)
+static ID *is_dupid(ListBase *lb, ID *id, const char *name)
{
ID *idtest=NULL;
ma->preview = NULL;
}
-Material *add_material(char *name)
+Material *add_material(const char *name)
{
Material *ma;
if(mb->disp.first) freedisplist(&mb->disp);
}
-MetaBall *add_mball(char *name)
+MetaBall *add_mball(const char *name)
{
MetaBall *mb;
MEM_freeN (dvert);
}
-Mesh *add_mesh(char *name)
+Mesh *add_mesh(const char *name)
{
Mesh *me;
return 0;
}
-void *add_camera(char *name)
+void *add_camera(const char *name)
{
Camera *cam;
return cam->YF_dofdist;
}
-void *add_lamp(char *name)
+void *add_lamp(const char *name)
{
Lamp *la;
}
/* more general add: creates minimum required data, but without vertices etc. */
-Object *add_only_object(int type, char *name)
+Object *add_only_object(int type, const char *name)
{
Object *ob;
/* shape key utility function */
/************************* Mesh ************************/
-static KeyBlock *insert_meshkey(Scene *scene, Object *ob, char *name, int from_mix)
+static KeyBlock *insert_meshkey(Scene *scene, Object *ob, const char *name, int from_mix)
{
Mesh *me= ob->data;
Key *key= me->key;
return kb;
}
/************************* Lattice ************************/
-static KeyBlock *insert_lattkey(Scene *scene, Object *ob, char *name, int from_mix)
+static KeyBlock *insert_lattkey(Scene *scene, Object *ob, const char *name, int from_mix)
{
Lattice *lt= ob->data;
Key *key= lt->key;
return kb;
}
/************************* Curve ************************/
-static KeyBlock *insert_curvekey(Scene *scene, Object *ob, char *name, int from_mix)
+static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, int from_mix)
{
Curve *cu= ob->data;
Key *key= cu->key;
return kb;
}
-KeyBlock *object_insert_shape_key(Scene *scene, Object *ob, char *name, int from_mix)
+KeyBlock *object_insert_shape_key(Scene *scene, Object *ob, const char *name, int from_mix)
{
if(ob->type==OB_MESH) return insert_meshkey(scene, ob, name, from_mix);
else if ELEM(ob->type, OB_CURVE, OB_SURF)return insert_curvekey(scene, ob, name, from_mix);
return pf;
}
-PackedFile *newPackedFile(ReportList *reports, char *filename)
+PackedFile *newPackedFile(ReportList *reports, const char *filename)
{
PackedFile *pf = NULL;
int file, filelen;
/************************************************/
/* ParticleSettings handling */
/************************************************/
-ModifierData *object_add_particle_system(Scene *scene, Object *ob, char *name)
+ModifierData *object_add_particle_system(Scene *scene, Object *ob, const char *name)
{
ParticleSystem *psys;
ModifierData *md;
}
-ParticleSettings *psys_new_settings(char *name, Main *main)
+ParticleSettings *psys_new_settings(const char *name, Main *main)
{
ParticleSettings *part;
sound_destroy_scene(sce);
}
-Scene *add_scene(char *name)
+Scene *add_scene(const char *name)
{
Main *bmain= G.main;
Scene *sce;
#endif
}
-Text *add_empty_text(char *name)
+Text *add_empty_text(const char *name)
{
Main *bmain= G.main;
Text *ta;
return 1;
}
-Text *add_text(char *file, const char *relpath)
+Text *add_text(const char *file, const char *relpath)
{
Main *bmain= G.main;
FILE *fp;
txt_make_dirty(text);
}
-void write_text(Text *text, char *str) /* called directly from rna */
+void write_text(Text *text, const char *str) /* called directly from rna */
{
int oldstate;
}
-World *add_world(char *name)
+World *add_world(const char *name)
{
Main *bmain= G.main;
World *wrld;
* indicating the cause of the failure.
* @return The data of the file.
*/
-BlendFileData* BLO_read_from_file (char *file, struct ReportList *reports);
+BlendFileData* BLO_read_from_file(const char *file, struct ReportList *reports);
/**
* Open a blender file from memory. The function
/**********/
-BlendFileData *BLO_read_from_file(char *file, ReportList *reports)
+BlendFileData *BLO_read_from_file(const char *file, ReportList *reports)
{
BlendFileData *bfd = NULL;
FileData *fd;
/* cannot be called with relative paths anymore! */
/* on each new library added, it now checks for the current FileData and expands relativeness */
-FileData *blo_openblenderfile(char *name, ReportList *reports)
+FileData *blo_openblenderfile(const char *name, ReportList *reports)
{
gzFile gzfile;
errno= 0;
BlendFileData *blo_read_file_internal(FileData *fd, const char *filename);
-FileData *blo_openblenderfile(char *name, struct ReportList *reports);
+FileData *blo_openblenderfile(const char *name, struct ReportList *reports);
FileData *blo_openblendermemory(void *buffer, int buffersize, struct ReportList *reports);
FileData *blo_openblendermemfile(struct MemFile *memfile, struct ReportList *reports);
/* Menu of All Keying Sets ----------------------------- */
/* Create (and show) a menu containing all the Keying Sets which can be used in the current context */
-void ANIM_keying_sets_menu_setup (bContext *C, char title[], char op_name[])
+void ANIM_keying_sets_menu_setup (bContext *C, const char title[], const char op_name[])
{
Scene *scene= CTX_data_scene(C);
KeyingSet *ks;
}
/* and this is all the undo system needs to know */
-void undo_push_armature(bContext *C, char *name)
+void undo_push_armature(bContext *C, const char *name)
{
// XXX solve getdata()
undo_editmode_push(C, name, get_armature_edit, free_undoBones, undoBones_to_editBones, editBones_to_undoBones, NULL);
/* *************** Adding stuff in editmode *************** */
/* default bone add, returns it selected, but without tail set */
-EditBone *ED_armature_edit_bone_add(bArmature *arm, char *name)
+EditBone *ED_armature_edit_bone_add(bArmature *arm, const char *name)
{
EditBone *bone= MEM_callocN(sizeof(EditBone), "eBone");
}
/* and this is all the undo system needs to know */
-void undo_push_curve(bContext *C, char *name)
+void undo_push_curve(bContext *C, const char *name)
{
undo_editmode_push(C, name, get_data, free_undoCurve, undoCurve_to_editCurve, editCurve_to_undoCurve, NULL);
}
}
/* and this is all the undo system needs to know */
-void undo_push_font(bContext *C, char *name)
+void undo_push_font(bContext *C, const char *name)
{
undo_editmode_push(C, name, get_undoFont, free_undoFont, undoFont_to_editFont, editFont_to_undoFont, NULL);
}
void ED_armature_validate_active(struct bArmature *arm);
void add_primitive_bone(struct Scene *scene, struct View3D *v3d, struct RegionView3D *rv3d);
-struct EditBone *ED_armature_edit_bone_add(struct bArmature *arm, char *name);
+struct EditBone *ED_armature_edit_bone_add(struct bArmature *arm, const char *name);
void ED_armature_edit_bone_remove(struct bArmature *arm, EditBone *exBone);
void transform_armature_mirror_update(struct Object *obedit);
void unique_editbone_name(struct ListBase *ebones, char *name, EditBone *bone); /* if bone is already in list, pass it as param to ignore it */
void ED_armature_bone_rename(struct bArmature *arm, char *oldnamep, char *newnamep);
-void undo_push_armature(struct bContext *C, char *name);
+void undo_push_armature(struct bContext *C, const char *name);
/* poseobject.c */
struct Object *ED_object_pose_armature(struct Object *ob);
void CU_select_swap(struct Object *obedit);
-void undo_push_curve (struct bContext *C, char *name);
+void undo_push_curve (struct bContext *C, const char *name);
ListBase *curve_get_editcurve(struct Object *ob);
void load_editNurb (struct Object *obedit);
int join_curve_exec (struct bContext *C, struct wmOperator *op);
/* editfont.h */
-void undo_push_font (struct bContext *C, char *name);
+void undo_push_font (struct bContext *C, const char *name);
void make_editText (struct Object *obedit);
void load_editText (struct Object *obedit);
void free_editText (struct Object *obedit);
/* info_stats.c */
void ED_info_stats_clear(struct Scene *scene);
-char *ED_info_stats_string(struct Scene *scene);
+const char *ED_info_stats_string(struct Scene *scene);
#endif /* ED_INFO_H */
struct KeyingSet *ANIM_get_keyingset_for_autokeying(struct Scene *scene, const char *tranformKSName);
/* Create (and show) a menu containing all the Keying Sets which can be used in the current context */
-void ANIM_keying_sets_menu_setup(struct bContext *C, char title[], char op_name[]);
+void ANIM_keying_sets_menu_setup(struct bContext *C, const char title[], const char op_name[]);
/* Check if KeyingSet can be used in the current context */
short ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks);
void make_editMball(struct Object *obedit);
void load_editMball(struct Object *obedit);
-void undo_push_mball(struct bContext *C, char *name);
+void undo_push_mball(struct bContext *C, const char *name);
int EM_texFaceCheck(struct EditMesh *em);
int EM_vertColorCheck(struct EditMesh *em);
-void undo_push_mesh(struct bContext *C, char *name);
+void undo_push_mesh(struct bContext *C, const char *name);
/* editmesh_lib.c */
#define WEIGHT_SUBTRACT 3
struct bDeformGroup *ED_vgroup_add(struct Object *ob);
-struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, char *name);
+struct bDeformGroup *ED_vgroup_add_name(struct Object *ob, const char *name);
void ED_vgroup_select_by_name(struct Object *ob, char *name);
void ED_vgroup_data_create(struct ID *id);
int ED_vgroup_give_array(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot);
/* object_lattice.c */
int mouse_lattice(struct bContext *C, short mval[2], int extend);
-void undo_push_lattice(struct bContext *C, char *name);
+void undo_push_lattice(struct bContext *C, const char *name);
/* object_lattice.c */
MODIFIER_APPLY_SHAPE,
} eModifier_Apply_Mode;
-struct ModifierData *ED_object_modifier_add(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, char *name, int type);
+struct ModifierData *ED_object_modifier_add(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, const char *name, int type);
int ED_object_modifier_remove(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, struct ModifierData *md);
int ED_object_modifier_move_down(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
int ED_object_modifier_move_up(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
void PE_deselect_all_visible(struct PTCacheEdit *edit);
/* undo */
-void PE_undo_push(struct Scene *scene, char *str);
+void PE_undo_push(struct Scene *scene, const char *str);
void PE_undo_step(struct Scene *scene, int step);
void PE_undo(struct Scene *scene);
void PE_redo(struct Scene *scene);
void ED_area_tag_redraw_regiontype(ScrArea *sa, int type);
void ED_area_tag_refresh(ScrArea *sa);
void ED_area_do_refresh(struct bContext *C, ScrArea *sa);
-void ED_area_headerprint(ScrArea *sa, char *str);
+void ED_area_headerprint(ScrArea *sa, const char *str);
void ED_area_newspace(struct bContext *C, ScrArea *sa, int type);
void ED_area_prevspace(struct bContext *C, ScrArea *sa);
void ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2);
/* ************** Undo ************************ */
/* undo.c */
-void ED_undo_push (struct bContext *C, char *str);
+void ED_undo_push (struct bContext *C, const char *str);
void ED_undo_push_op (struct bContext *C, struct wmOperator *op);
void ED_undo_pop_op (struct bContext *C, struct wmOperator *op);
void ED_undo_pop (struct bContext *C);
void ED_OT_redo (struct wmOperatorType *ot);
/* undo_editmode.c */
-void undo_editmode_push(struct bContext *C, char *name,
+void undo_editmode_push(struct bContext *C, const char *name,
void * (*getdata)(struct bContext *C),
void (*freedata)(void *),
void (*to_editmode)(void *, void *),
void uiPupMenuEnd(struct bContext *C, struct uiPopupMenu *head);
struct uiLayout *uiPupMenuLayout(uiPopupMenu *head);
-void uiPupMenuOkee(struct bContext *C, char *opname, char *str, ...);
+void uiPupMenuOkee(struct bContext *C, const char *opname, char *str, ...);
void uiPupMenuSaveOver(struct bContext *C, struct wmOperator *op, char *filename);
void uiPupMenuNotice(struct bContext *C, char *str, ...);
void uiPupMenuError(struct bContext *C, char *str, ...);
typedef uiBlock* (*uiBlockCreateFunc)(struct bContext *C, struct ARegion *ar, void *arg1);
void uiPupBlock(struct bContext *C, uiBlockCreateFunc func, void *arg);
-void uiPupBlockO(struct bContext *C, uiBlockCreateFunc func, void *arg, char *opname, int opcontext);
+void uiPupBlockO(struct bContext *C, uiBlockCreateFunc func, void *arg, const char *opname, int opcontext);
void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, int opcontext);
void uiPupBlockClose(struct bContext *C, uiBlock *block);
void uiEndBlock(const struct bContext *C, uiBlock *block);
void uiDrawBlock(const struct bContext *C, struct uiBlock *block);
-uiBlock *uiGetBlock(char *name, struct ARegion *ar);
+uiBlock *uiGetBlock(const char *name, struct ARegion *ar);
void uiBlockSetEmboss(uiBlock *block, char dt);
* - O: operator */
uiBut *uiDefBut(uiBlock *block,
- int type, int retval, char *str,
+ int type, int retval, const char *str,
short x1, short y1,
short x2, short y2,
void *poin,
float min, float max,
float a1, float a2, char *tip);
-uiBut *uiDefButF(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefButF(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
uiBut *uiDefButI(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip);
uiBut *uiDefButC(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefButR(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefButO(uiBlock *block, int type, char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, char *tip);
-uiBut *uiDefButTextO(uiBlock *block, int type, char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, char *tip);
+uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip);
uiBut *uiDefIconBut(uiBlock *block,
int type, int retval, int icon,
uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefIconButO(uiBlock *block, int type, char *opname, int opcontext, int icon, short x1, short y1, short x2, short y2, char *tip);
+uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, short x1, short y1, short x2, short y2, char *tip);
uiBut *uiDefIconTextBut(uiBlock *block,
- int type, int retval, int icon, char *str,
+ int type, int retval, int icon, const char *str,
short x1, short y1,
short x2, short y2,
void *poin,
float min, float max,
float a1, float a2, char *tip);
-uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip);
-uiBut *uiDefIconTextButO(uiBlock *block, int type, char *opname, int opcontext, int icon, char *str, short x1, short y1, short x2, short y2, char *tip);
+uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip);
+uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, short x1, short y1, short x2, short y2, char *tip);
/* for passing inputs to ButO buttons */
struct PointerRNA *uiButGetOperatorPtrRNA(uiBut *but);
typedef void (*uiButHandleRenameFunc)(struct bContext *C, void *arg, char *origstr);
typedef void (*uiButHandleNFunc)(struct bContext *C, void *argN, void *arg2);
typedef void (*uiButCompleteFunc)(struct bContext *C, char *str, void *arg);
-typedef void (*uiButSearchFunc)(const struct bContext *C, void *arg, char *str, uiSearchItems *items);
+typedef void (*uiButSearchFunc)(const struct bContext *C, void *arg, const char *str, uiSearchItems *items);
typedef void (*uiBlockHandleFunc)(struct bContext *C, void *arg, int event);
/* use inside searchfunc to add items */
uiBlock *uiLayoutGetBlock(uiLayout *layout);
void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void *argv);
-void uiLayoutSetContextPointer(uiLayout *layout, char *name, struct PointerRNA *ptr);
-char *uiLayoutIntrospect(uiLayout *layout); // XXX - testing
+void uiLayoutSetContextPointer(uiLayout *layout, const char *name, struct PointerRNA *ptr);
+const char *uiLayoutIntrospect(uiLayout *layout); // XXX - testing
void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext);
void uiLayoutSetActive(uiLayout *layout, int active);
/* templates */
void uiTemplateHeader(uiLayout *layout, struct bContext *C, int menus);
void uiTemplateDopeSheetFilter(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr);
-void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname,
- char *newop, char *openop, char *unlinkop);
-void uiTemplateIDBrowse(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname,
- char *newop, char *openop, char *unlinkop);
-void uiTemplateIDPreview(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname,
- char *newop, char *openop, char *unlinkop, int rows, int cols);
-void uiTemplateAnyID(uiLayout *layout, struct PointerRNA *ptr, char *propname,
- char *proptypename, char *text);
-void uiTemplatePathBuilder(uiLayout *layout, struct PointerRNA *ptr, char *propname,
- struct PointerRNA *root_ptr, char *text);
+void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname,
+ const char *newop, const char *openop, const char *unlinkop);
+void uiTemplateIDBrowse(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname,
+ const char *newop, const char *openop, const char *unlinkop);
+void uiTemplateIDPreview(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname,
+ const char *newop, const char *openop, const char *unlinkop, int rows, int cols);
+void uiTemplateAnyID(uiLayout *layout, struct PointerRNA *ptr, const char *propname,
+ const char *proptypename, const char *text);
+void uiTemplatePathBuilder(uiLayout *layout, struct PointerRNA *ptr, const char *propname,
+ struct PointerRNA *root_ptr, const char *text);
uiLayout *uiTemplateModifier(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr);
uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr);
void uiTemplatePreview(uiLayout *layout, struct ID *id, struct ID *parent, struct MTex *slot);
-void uiTemplateColorRamp(uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand);
-void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, char *propname);
-void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, char *propname);
-void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, char *propname);
-void uiTemplateCurveMapping(uiLayout *layout, struct PointerRNA *ptr, char *propname, int type, int levels, int brush);
-void uiTemplateColorWheel(uiLayout *layout, struct PointerRNA *ptr, char *propname, int value_slider, int lock, int lock_luminosity, int cubic);
-void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, char *propname,
- PointerRNA *used_ptr, char *used_propname, int active_layer);
-void uiTemplateImage(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *userptr, int compact);
+void uiTemplateColorRamp(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int expand);
+void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
+void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
+void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
+void uiTemplateCurveMapping(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int type, int levels, int brush);
+void uiTemplateColorWheel(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int value_slider, int lock, int lock_luminosity, int cubic);
+void uiTemplateLayers(uiLayout *layout, struct PointerRNA *ptr, const char *propname,
+ PointerRNA *used_ptr, const char *used_propname, int active_layer);
+void uiTemplateImage(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *userptr, int compact);
void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser);
void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C);
void uiTemplateOperatorSearch(uiLayout *layout);
void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex);
void uiTemplateReportsBanner(uiLayout *layout, struct bContext *C);
-void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *activeptr, char *activeprop, int rows, int maxrows, int type);
+void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, struct PointerRNA *activeptr, const char *activeprop, int rows, int maxrows, int type);
/* items */
-void uiItemO(uiLayout *layout, char *name, int icon, char *opname);
-void uiItemEnumO(uiLayout *layout, char *opname, char *name, int icon, char *propname, int value);
-void uiItemEnumO_string(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value);
-void uiItemsEnumO(uiLayout *layout, char *opname, char *propname);
-void uiItemBooleanO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value);
-void uiItemIntO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value);
-void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *propname, float value);
-void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value);
-PointerRNA uiItemFullO(uiLayout *layout, char *idname, char *name, int icon, struct IDProperty *properties, int context, int flag);
-
-void uiItemR(uiLayout *layout, struct PointerRNA *ptr, char *propname, int flag, char *name, int icon);
-void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, char *name, int icon);
-void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int value);
-void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *value, char *name, int icon);
-void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname);
-void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname, char *name, int icon);
-void uiItemsFullEnumO(uiLayout *layout, char *opname, char *propname, struct IDProperty *properties, int context, int flag);
-
-void uiItemL(uiLayout *layout, char *name, int icon); /* label */
+void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname);
+void uiItemEnumO(uiLayout *layout, const char *opname, char *name, int icon, const char *propname, int value);
+void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, char *value);
+void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname);
+void uiItemBooleanO(uiLayout *layout, char *name, int icon, const char *opname, const char *propname, int value);
+void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value);
+void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, float value);
+void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, char *value);
+PointerRNA uiItemFullO(uiLayout *layout, const char *idname, const char *name, int icon, struct IDProperty *properties, int context, int flag);
+
+void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon);
+void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon);
+void uiItemEnumR(uiLayout *layout, const char *name, int icon, struct PointerRNA *ptr, const char *propname, int value);
+void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *value, const char *name, int icon);
+void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname);
+void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, struct PointerRNA *searchptr, const char *searchpropname, const char *name, int icon);
+void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname, struct IDProperty *properties, int context, int flag);
+
+void uiItemL(uiLayout *layout, const char *name, int icon); /* label */
void uiItemLDrag(uiLayout *layout, struct PointerRNA *ptr, char *name, int icon); /* label icon for dragging */
-void uiItemM(uiLayout *layout, struct bContext *C, char *menuname, char *name, int icon); /* menu */
+void uiItemM(uiLayout *layout, struct bContext *C, const char *menuname, const char *name, int icon); /* menu */
void uiItemV(uiLayout *layout, char *name, int icon, int argval); /* value */
void uiItemS(uiLayout *layout); /* separator */
-void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func, void *arg);
-void uiItemMenuEnumO(uiLayout *layout, char *opname, char *propname, char *name, int icon);
-void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *name, int icon);
+void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg);
+void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname, const char *name, int icon);
+void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name, int icon);
/* UI Operators */
void UI_buttons_operatortypes(void);
void uiStyleFontDraw(struct uiFontStyle *fs, struct rcti *rect, char *str);
void uiStyleFontDrawRotated(struct uiFontStyle *fs, struct rcti *rect, char *str);
-int UI_GetStringWidth(char *str); // XXX temp
-void UI_DrawString(float x, float y, char *str); // XXX temp
+int UI_GetStringWidth(const char *str); // XXX temp
+void UI_DrawString(float x, float y, const char *str); // XXX temp
#endif /* UI_INTERFACE_H */
return block;
}
-uiBlock *uiGetBlock(char *name, ARegion *ar)
+uiBlock *uiGetBlock(const char *name, ARegion *ar)
{
uiBlock *block= ar->uiblocks.first;
all greater values will be clamped to 4.
*/
-static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
{
uiBut *but;
short slen;
return but;
}
-uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip)
+static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip)
{
uiBut *but;
PropertyRNA *prop;
but->a1= ui_get_but_step_unit(but, but->a1);
if(freestr)
- MEM_freeN(str);
+ MEM_freeN((void *)str);
return but;
}
-uiBut *ui_def_but_operator(uiBlock *block, int type, char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, char *tip)
+static uiBut *ui_def_but_operator(uiBlock *block, int type, const char *opname, int opcontext, const char *str, short x1, short y1, short x2, short y2, const char *tip)
{
uiBut *but;
wmOperatorType *ot;
return but;
}
-uiBut *ui_def_but_operator_text(uiBlock *block, int type, char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+static uiBut *ui_def_but_operator_text(uiBlock *block, int type, const char *opname, int opcontext, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip)
{
uiBut *but;
wmOperatorType *ot;
return but;
}
-uiBut *uiDefBut(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefBut(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
{
uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
{
return uiDefButBit(block, type|CHA, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
}
-uiBut *uiDefButR(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip)
{
uiBut *but;
return but;
}
-uiBut *uiDefButO(uiBlock *block, int type, char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, char *tip)
+uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, char *tip)
{
uiBut *but;
return but;
}
-uiBut *uiDefButTextO(uiBlock *block, int type, char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
{
uiBut *but= ui_def_but_operator_text(block, type, opname, opcontext, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
return but;
}
-uiBut *uiDefIconButO(uiBlock *block, int type, char *opname, int opcontext, int icon, short x1, short y1, short x2, short y2, char *tip)
+uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, short x1, short y1, short x2, short y2, char *tip)
{
uiBut *but;
}
/* Button containing both string label and icon */
-uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
{
uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip);
return but;
}
-static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
+static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
{
int bitIdx= findBitIndex(bit);
if (bitIdx==-1) {
}
}
-uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
{
return uiDefIconTextBut(block, type|FLO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
}
-uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip)
{
return uiDefIconTextButBit(block, type|FLO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
}
-uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
{
return uiDefIconTextBut(block, type|INT, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
}
-uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip)
{
return uiDefIconTextButBit(block, type|INT, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
}
-uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
{
return uiDefIconTextBut(block, type|SHO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
}
-uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip)
{
return uiDefIconTextButBit(block, type|SHO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
}
-uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
{
return uiDefIconTextBut(block, type|CHA, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
}
-uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip)
{
return uiDefIconTextButBit(block, type|CHA, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip);
}
-uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip)
+uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip)
{
uiBut *but;
return but;
}
-uiBut *uiDefIconTextButO(uiBlock *block, int type, char *opname, int opcontext, int icon, char *str, short x1, short y1, short x2, short y2, char *tip)
+uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, short x1, short y1, short x2, short y2, char *tip)
{
uiBut *but;
{
Scene *scene= CTX_data_scene(C);
uiAfterFunc *after;
- char *str= NULL;
+ const char *str= NULL;
if(but->flag & UI_BUT_UNDO) {
/* define which string to use for undo */
uiPopupMenu *pup;
uiLayout *layout;
int length;
- char *name;
+ const char *name;
if((but->rnapoin.data && but->rnaprop)==0 && but->optype==NULL)
return 0;
uiLink *link;
short linkto[2];
- char *tip, *lockstr;
+ const char *tip, *lockstr;
BIFIconID icon;
char lock;
/************************** Item ***************************/
-static char *ui_item_name_add_colon(char *name, char namestr[UI_MAX_NAME_STR])
+static const char *ui_item_name_add_colon(const char *name, char namestr[UI_MAX_NAME_STR])
{
int len= strlen(name);
}
/* estimated size of text + icon */
-static int ui_text_icon_width(uiLayout *layout, char *name, int icon, int compact)
+static int ui_text_icon_width(uiLayout *layout, const char *name, int icon, int compact)
{
int variable = ui_layout_vary_direction(layout) == UI_ITEM_VARY_X;
}
/* create buttons for an item with an RNA array */
-static void ui_item_array(uiLayout *layout, uiBlock *block, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int len, int x, int y, int w, int h, int expand, int slider, int toggle, int icon_only)
+static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int len, int x, int y, int w, int h, int expand, int slider, int toggle, int icon_only)
{
uiStyle *style= layout->root->style;
uiBut *but;
uiBlockSetCurLayout(block, layout);
}
-static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, char *uiname, int h, int icon_only)
+static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, const char *uiname, int h, int icon_only)
{
uiBut *but;
EnumPropertyItem *item;
}
/* create label + button for RNA property */
-static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int x, int y, int w, int h, int flag)
+static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, const char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int x, int y, int w, int h, int flag)
{
uiLayout *sub;
uiBut *but=NULL;
/********************* Button Items *************************/
/* disabled item */
-static void ui_item_disabled(uiLayout *layout, char *name)
+static void ui_item_disabled(uiLayout *layout, const char *name)
{
uiBlock *block= layout->root->block;
uiBut *but;
}
/* operator items */
-PointerRNA uiItemFullO(uiLayout *layout, char *idname, char *name, int icon, IDProperty *properties, int context, int flag)
+PointerRNA uiItemFullO(uiLayout *layout, const char *idname, const char *name, int icon, IDProperty *properties, int context, int flag)
{
uiBlock *block= layout->root->block;
wmOperatorType *ot= WM_operatortype_find(idname, 0);
return PointerRNA_NULL;
}
-static char *ui_menu_enumpropname(uiLayout *layout, char *opname, char *propname, int retval)
+static char *ui_menu_enumpropname(uiLayout *layout, const char *opname, const char *propname, int retval)
{
wmOperatorType *ot= WM_operatortype_find(opname, 0);
PointerRNA ptr;
return "";
}
-void uiItemEnumO(uiLayout *layout, char *opname, char *name, int icon, char *propname, int value)
+void uiItemEnumO(uiLayout *layout, const char *opname, char *name, int icon, const char *propname, int value)
{
PointerRNA ptr;
uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
-void uiItemsFullEnumO(uiLayout *layout, char *opname, char *propname, IDProperty *properties, int context, int flag)
+void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname, IDProperty *properties, int context, int flag)
{
wmOperatorType *ot= WM_operatortype_find(opname, 0);
PointerRNA ptr;
}
}
-void uiItemsEnumO(uiLayout *layout, char *opname, char *propname)
+void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname)
{
uiItemsFullEnumO(layout, opname, propname, NULL, layout->root->opcontext, 0);
}
/* for use in cases where we have */
-void uiItemEnumO_string(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value_str)
+void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, char *value_str)
{
PointerRNA ptr;
uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
-void uiItemBooleanO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value)
+void uiItemBooleanO(uiLayout *layout, char *name, int icon, const char *opname, const char *propname, int value)
{
PointerRNA ptr;
uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
-void uiItemIntO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value)
+void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value)
{
PointerRNA ptr;
uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
-void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *propname, float value)
+void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, float value)
{
PointerRNA ptr;
uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
-void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value)
+void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, char *value)
{
PointerRNA ptr;
uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0);
}
-void uiItemO(uiLayout *layout, char *name, int icon, char *opname)
+void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
{
uiItemFullO(layout, opname, name, icon, NULL, layout->root->opcontext, 0);
}
/* RNA property items */
-static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int icon_only, int *r_w, int *r_h)
+static void ui_item_rna_size(uiLayout *layout, const char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int icon_only, int *r_w, int *r_h)
{
PropertyType type;
PropertySubType subtype;
*r_h= h;
}
-void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index, int value, int flag, char *name, int icon)
+void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index, int value, int flag, const char *name, int icon)
{
uiBlock *block= layout->root->block;
uiBut *but;
uiBlockSetEmboss(block, UI_EMBOSS);
}
-void uiItemR(uiLayout *layout, PointerRNA *ptr, char *propname, int flag, char *name, int icon)
+void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
uiItemFullR(layout, ptr, prop, RNA_NO_INDEX, 0, flag, name, icon);
}
-void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int value)
+void uiItemEnumR(uiLayout *layout, const char *name, int icon, struct PointerRNA *ptr, const char *propname, int value)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, value, 0, name, icon);
}
-void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *value, char *name, int icon)
+void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *value, const char *name, int icon)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
EnumPropertyItem *item;
MEM_freeN(item);
}
-void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname)
+void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname)
{
PropertyRNA *prop;
uiBlock *block= layout->root->block;
return 0;
}
-static void rna_search_cb(const struct bContext *C, void *arg_but, char *str, uiSearchItems *items)
+static void rna_search_cb(const struct bContext *C, void *arg_but, const char *str, uiSearchItems *items)
{
uiBut *but= arg_but;
char *name;
}
}
-void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname, char *name, int icon)
+void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, struct PointerRNA *searchptr, const char *searchpropname, const char *name, int icon)
{
PropertyRNA *prop, *searchprop;
PropertyType type;
mt->draw(C, &menu);
}
-static void ui_item_menu(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func, void *arg, void *argN)
+static void ui_item_menu(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg, void *argN)
{
uiBlock *block= layout->root->block;
uiBut *but;
}
}
-void uiItemM(uiLayout *layout, bContext *UNUSED(C), char *menuname, char *name, int icon)
+void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const char *name, int icon)
{
MenuType *mt;
}
/* label item */
-static uiBut *uiItemL_(uiLayout *layout, char *name, int icon)
+static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon)
{
uiBlock *block= layout->root->block;
uiBut *but;
w= ui_text_icon_width(layout, name, icon, 0);
if(icon && strcmp(name, "") != 0)
- but= uiDefIconTextBut(block, LABEL, 0, icon, (char*)name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ but= uiDefIconTextBut(block, LABEL, 0, icon, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
else if(icon)
but= uiDefIconBut(block, LABEL, 0, icon, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
else
- but= uiDefBut(block, LABEL, 0, (char*)name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ but= uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
return but;
}
-void uiItemL(uiLayout *layout, char *name, int icon)
+void uiItemL(uiLayout *layout, const char *name, int icon)
{
uiItemL_(layout, name, icon);
}
}
/* level items */
-void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func, void *arg)
+void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg)
{
if(!func)
return;
typedef struct MenuItemLevel {
int opcontext;
- char *opname;
- char *propname;
+ const char *opname;
+ const char *propname;
PointerRNA rnapoin;
} MenuItemLevel;
uiItemsEnumO(layout, lvl->opname, lvl->propname);
}
-void uiItemMenuEnumO(uiLayout *layout, char *opname, char *propname, char *name, int icon)
+void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname, const char *name, int icon)
{
wmOperatorType *ot= WM_operatortype_find(opname, 0);
MenuItemLevel *lvl;
uiItemsEnumR(layout, &lvl->rnapoin, lvl->propname);
}
-void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname, char *name, int icon)
+void uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name, int icon)
{
MenuItemLevel *lvl;
PropertyRNA *prop;
}
}
-void uiLayoutSetContextPointer(uiLayout *layout, char *name, PointerRNA *ptr)
+void uiLayoutSetContextPointer(uiLayout *layout, const char *name, PointerRNA *ptr)
{
uiBlock *block= layout->root->block;
layout->context= CTX_store_add(&block->contexts, name, ptr);
}
static char *str = NULL; // XXX, constant re-freeing, far from ideal.
-char *uiLayoutIntrospect(uiLayout *layout)
+const char *uiLayoutIntrospect(uiLayout *layout)
{
DynStr *ds= BLI_dynstr_new();
WM_operator_free(opv);
}
-static void vconfirm_opname(bContext *C, char *opname, char *title, char *itemfmt, va_list ap)
+static void vconfirm_opname(bContext *C, const char *opname, char *title, char *itemfmt, va_list ap)
{
uiPopupBlockHandle *handle;
char *s, buf[512];
handle= ui_popup_menu_create(C, NULL, NULL, NULL, NULL, buf);
handle->popup_func= operator_name_cb;
- handle->popup_arg= opname;
+ handle->popup_arg= (void *)opname;
}
static void confirm_operator(bContext *C, wmOperator *op, char *title, char *item)
handle->cancel_func= confirm_cancel_operator;
}
-void uiPupMenuOkee(bContext *C, char *opname, char *str, ...)
+void uiPupMenuOkee(bContext *C, const char *opname, char *str, ...)
{
va_list ap;
char titlestr[256];
/*************************** Popup Block API **************************/
-void uiPupBlockO(bContext *C, uiBlockCreateFunc func, void *arg, char *opname, int opcontext)
+void uiPupBlockO(bContext *C, uiBlockCreateFunc func, void *arg, const char *opname, int opcontext)
{
wmWindow *window= CTX_wm_window(C);
uiPopupBlockHandle *handle;
/* ************** helpers ************************ */
/* temporarily, does widget font */
-int UI_GetStringWidth(char *str)
+int UI_GetStringWidth(const char *str)
{
uiStyle *style= U.uistyles.first;
uiFontStyle *fstyle= &style->widget;
}
/* temporarily, does widget font */
-void UI_DrawString(float x, float y, char *str)
+void UI_DrawString(float x, float y, const char *str)
{
uiStyle *style= U.uistyles.first;
}
/* ID Search browse menu, do the search */
-static void id_search_cb(const bContext *C, void *arg_template, char *str, uiSearchItems *items)
+static void id_search_cb(const bContext *C, void *arg_template, const char *str, uiSearchItems *items)
{
TemplateID *template= (TemplateID*)arg_template;
ListBase *lb= template->idlb;
}
}
-static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, int flag, char *newop, char *openop, char *unlinkop)
+static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, StructRNA *type, int flag, const char *newop, const char *openop, const char *unlinkop)
{
uiBut *but;
uiBlock *block;
uiBlockEndAlign(block);
}
-static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop, int flag, int prv_rows, int prv_cols)
+static void ui_template_id(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int flag, int prv_rows, int prv_cols)
{
TemplateID *template;
PropertyRNA *prop;
MEM_freeN(template);
}
-void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop)
+void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop)
{
ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_DELETE, 0, 0);
}
-void uiTemplateIDBrowse(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop)
+void uiTemplateIDBrowse(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop)
{
ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE|UI_ID_RENAME, 0, 0);
}
-void uiTemplateIDPreview(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop, int rows, int cols)
+void uiTemplateIDPreview(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int rows, int cols)
{
ui_template_id(layout, C, ptr, propname, newop, openop, unlinkop, UI_ID_BROWSE|UI_ID_RENAME|UI_ID_DELETE|UI_ID_PREVIEWS, rows, cols);
}
* - propname: property identifier for property that ID-pointer gets stored to
* - proptypename: property identifier for property used to determine the type of ID-pointer that can be used
*/
-void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, char *propname, char *proptypename, char *text)
+void uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *proptypename, const char *text)
{
PropertyRNA *propID, *propType;
uiLayout *row;
* - propname: property identifier for property that path gets stored to
* - root_ptr: struct that path gets built from
*/
-void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, char *propname, PointerRNA *UNUSED(root_ptr), char *text)
+void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *UNUSED(root_ptr), const char *text)
{
PropertyRNA *propPath;
uiLayout *row;
colorband_buttons_large(layout, block, coba, 0, 0, cb);
}
-void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, char *propname, int expand)
+void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, const char *propname, int expand)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
PointerRNA cptr;
/********************* Histogram Template ************************/
-void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, char *propname)
+void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
PointerRNA cptr;
/********************* Waveform Template ************************/
-void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, char *propname)
+void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
PointerRNA cptr;
/********************* Vectorscope Template ************************/
-void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, char *propname)
+void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propname)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
PointerRNA cptr;
uiBlockSetNFunc(block, NULL, NULL, NULL);
}
-void uiTemplateCurveMapping(uiLayout *layout, PointerRNA *ptr, char *propname, int type, int levels, int brush)
+void uiTemplateCurveMapping(uiLayout *layout, PointerRNA *ptr, const char *propname, int type, int levels, int brush)
{
RNAUpdateCb *cb;
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
#define WHEEL_SIZE 100
-void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, char *propname, int value_slider, int lock, int lock_luminosity, int cubic)
+void uiTemplateColorWheel(uiLayout *layout, PointerRNA *ptr, const char *propname, int value_slider, int lock, int lock_luminosity, int cubic)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
uiBlock *block= uiLayoutGetBlock(layout);
// - for now, grouping of layers is determined by dividing up the length of
// the array of layer bitflags
-void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname,
- PointerRNA *used_ptr, char *used_propname, int active_layer)
+void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname,
+ PointerRNA *used_ptr, const char *used_propname, int active_layer)
{
uiLayout *uRow, *uCol;
PropertyRNA *prop, *used_prop= NULL;
return rnaicon;
}
-static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *itemptr, int i, int rnaicon, PointerRNA *activeptr, char *activepropname)
+static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *itemptr, int i, int rnaicon, PointerRNA *activeptr, const char *activepropname)
{
Object *ob;
uiBlock *block= uiLayoutGetBlock(layout);
MEM_freeN(namebuf);
}
-void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, PointerRNA *activeptr, char *activepropname, int rows, int maxrows, int listtype)
+void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, PointerRNA *activeptr, const char *activepropname, int rows, int maxrows, int listtype)
{
//Scene *scene= CTX_data_scene(C);
PropertyRNA *prop= NULL, *activeprop;
WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL);
}
-static void operator_search_cb(const bContext *C, void *UNUSED(arg), char *str, uiSearchItems *items)
+static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
{
wmOperatorType *ot = WM_operatortype_first();
}
/* and this is all the undo system needs to know */
-void undo_push_mesh(bContext *C, char *name)
+void undo_push_mesh(bContext *C, const char *name)
{
undo_editmode_push(C, name, getEditMesh, free_undoMesh, undoMesh_to_editMesh, editMesh_to_undoMesh, NULL);
}
}
/* this is undo system for MetaBalls */
-void undo_push_mball(bContext *C, char *name)
+void undo_push_mball(bContext *C, const char *name)
{
undo_editmode_push(C, name, get_data, free_undoMball, undoMball_to_editMball, editMball_to_undoMball, NULL);
}
}
/* and this is all the undo system needs to know */
-void undo_push_lattice(bContext *C, char *name)
+void undo_push_lattice(bContext *C, const char *name)
{
undo_editmode_push(C, name, get_editlatt, free_undoLatt, undoLatt_to_editLatt, editLatt_to_undoLatt, validate_undoLatt);
}
/******************************** API ****************************/
-ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *scene, Object *ob, char *name, int type)
+ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *scene, Object *ob, const char *name, int type)
{
ModifierData *md=NULL, *new_md=NULL;
ModifierTypeInfo *mti = modifierType_getInfo(type);
return NULL;
}
-bDeformGroup *ED_vgroup_add_name(Object *ob, char *name)
+bDeformGroup *ED_vgroup_add_name(Object *ob, const char *name)
{
bDeformGroup *defgroup;
}
}
-void PE_undo_push(Scene *scene, char *str)
+void PE_undo_push(Scene *scene, const char *str)
{
PTCacheEdit *edit= PE_get_current(scene, OBACT);
PTCacheUndo *undo;
/* *************************************************************** */
/* use NULL to disable it */
-void ED_area_headerprint(ScrArea *sa, char *str)
+void ED_area_headerprint(ScrArea *sa, const char *str)
{
ARegion *ar;
RNA_property_update(C, &cb->ptr, cb->prop);
}
-void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, PointerRNA *userptr, int compact)
+void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, PointerRNA *userptr, int compact)
{
PropertyRNA *prop;
PointerRNA imaptr;
BLI_strncpy(kmi->idname, ot->idname, OP_MAX_TYPENAME);
}
-static void operator_search_cb(const struct bContext *UNUSED(C), void *UNUSED(arg_kmi), char *str, uiSearchItems *items)
+static void operator_search_cb(const struct bContext *UNUSED(C), void *UNUSED(arg_kmi), const char *str, uiSearchItems *items)
{
wmOperatorType *ot = WM_operatortype_first();
}
-static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), char *str, uiSearchItems *items)
+static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
{
wmOperatorType *ot = WM_operatortype_first();
Add this in your local code:
-void undo_editmode_push(bContext *C, char *name,
+void undo_editmode_push(bContext *C, const char *name,
void * (*getdata)(bContext *C), // use context to retrieve current editdata
void (*freedata)(void *), // pointer to function freeing data
void (*to_editmode)(void *, void *), // data to editmode conversion
}
/* name can be a dynamic string */
-void undo_editmode_push(bContext *C, char *name,
+void undo_editmode_push(bContext *C, const char *name,
void * (*getdata)(bContext *C),
void (*freedata)(void *),
void (*to_editmode)(void *, void *),
/* ***************** generic undo system ********************* */
-void ED_undo_push(bContext *C, char *str)
+void ED_undo_push(bContext *C, const char *str)
{
wmWindowManager *wm= CTX_wm_manager(C);
Object *obedit= CTX_data_edit_object(C);
*
* @attention Defined in writeimage.c
*/
-short IMB_saveiff(struct ImBuf *ibuf, char *filepath, int flags);
+short IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags);
/**
* Encodes a png image from an ImBuf
#include "imbuf.h"
-short IMB_saveiff(struct ImBuf *ibuf, char *name, int flags)
+short IMB_saveiff(struct ImBuf *ibuf, const char *name, int flags)
{
ImFileType *type;
if(ibuf->rect==NULL && ibuf->rect_float)
IMB_rect_from_float(ibuf);
}
-
- return type->save(ibuf, name, flags);
+ /* TODO. have const char for image write funcs */
+ return type->save(ibuf, (char *)name, flags);
}
}
case PROP_FLOAT:
return "float";
case PROP_STRING:
- return "char*";
+ if(prop->flag & PROP_THICK_WRAP) {
+ return "char*";
+ }
+ else {
+ return "const char*";
+ }
default:
return NULL;
}
iter->valid= (internal->link != NULL);
}
-static bActionGroup *rna_Action_groups_new(bAction *act, char name[])
+static bActionGroup *rna_Action_groups_new(bAction *act, const char name[])
{
return action_groups_add_new(act, name);
}
MEM_freeN(agrp);
}
-static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, char *data_path, int index, char *group)
+static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, const char *data_path, int index, const char *group)
{
if(group && group[0]=='\0') group= NULL;
}
}
-static TimeMarker *rna_Action_pose_markers_new(bAction *act, ReportList *reports, char name[])
+static TimeMarker *rna_Action_pose_markers_new(bAction *act, ReportList *reports, const char name[])
{
TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
marker->flag= 1;
static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *reports,
- ID *id, char rna_path[], int index, int group_method, char group_name[])
+ ID *id, const char rna_path[], int index, int group_method, const char group_name[])
{
KS_Path *ksp = NULL;
short flag = 0;
}
}
-EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, char *name)
+EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const char *name)
{
if(arm->edbo==NULL) {
BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone.", arm->id.name+2);
#include "MEM_guardedalloc.h"
-static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports, char *path, Scene *scene)
+static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports, const char *path, Scene *scene)
{
ImBuf *ibuf;
#include "ED_screen.h"
-Tex *rna_Main_add_texture(Main *bmain, char *name)
+Tex *rna_Main_add_texture(Main *bmain, const char *name)
{
return add_texture(name);
}
-Camera *rna_Main_cameras_new(Main *bmain, char* name)
+Camera *rna_Main_cameras_new(Main *bmain, const char *name)
{
ID *id= add_camera(name);
id->us--;
/* XXX python now has invalid pointer? */
}
-Scene *rna_Main_scenes_new(Main *bmain, char* name)
+Scene *rna_Main_scenes_new(Main *bmain, const char *name)
{
return add_scene(name);
}
unlink_scene(bmain, scene, newscene);
}
-Object *rna_Main_objects_new(Main *bmain, ReportList *reports, char* name, ID *data)
+Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char *name, ID *data)
{
Object *ob;
int type= OB_EMPTY;
}
}
-struct Material *rna_Main_materials_new(Main *bmain, char* name)
+struct Material *rna_Main_materials_new(Main *bmain, const char *name)
{
ID *id= (ID *)add_material(name);
id->us--;
/* XXX python now has invalid pointer? */
}
-Mesh *rna_Main_meshes_new(Main *bmain, char* name)
+Mesh *rna_Main_meshes_new(Main *bmain, const char *name)
{
Mesh *me= add_mesh(name);
me->id.us--;
/* XXX python now has invalid pointer? */
}
-Lamp *rna_Main_lamps_new(Main *bmain, char* name)
+Lamp *rna_Main_lamps_new(Main *bmain, const char *name)
{
Lamp *lamp= add_lamp(name);
lamp->id.us--;
/* XXX python now has invalid pointer? */
}
-Image *rna_Main_images_new(Main *bmain, char* name, int width, int height, int alpha, int float_buffer)
+Image *rna_Main_images_new(Main *bmain, const char *name, int width, int height, int alpha, int float_buffer)
{
float color[4]= {0.0, 0.0, 0.0, 1.0};
Image *image= BKE_add_image_size(width, height, name, alpha ? 32:24, float_buffer, 0, color);
image->id.us--;
return image;
}
-Image *rna_Main_images_load(Main *bmain, ReportList *reports, char *filepath)
+Image *rna_Main_images_load(Main *bmain, ReportList *reports, const char *filepath)
{
Image *ima;
/* XXX python now has invalid pointer? */
}
-Lattice *rna_Main_lattices_new(Main *bmain, char* name)
+Lattice *rna_Main_lattices_new(Main *bmain, const char *name)
{
Lattice *lt= add_lattice(name);
lt->id.us--;
BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d.", lt->id.name+2, ID_REAL_USERS(lt));
}
-Curve *rna_Main_curves_new(Main *bmain, char* name, int type)
+Curve *rna_Main_curves_new(Main *bmain, const char *name, int type)
{
Curve *cu= add_curve(name, type);
cu->id.us--;
BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d.", cu->id.name+2, ID_REAL_USERS(cu));
}
-MetaBall *rna_Main_metaballs_new(Main *bmain, char* name)
+MetaBall *rna_Main_metaballs_new(Main *bmain, const char *name)
{
MetaBall *mb= add_mball(name);
mb->id.us--;
BKE_reportf(reports, RPT_ERROR, "MetaBall \"%s\" must have zero users to be removed, found %d.", mb->id.name+2, ID_REAL_USERS(mb));
}
-VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, char *filepath)
+VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepath)
{
VFont *font;
/* XXX python now has invalid pointer? */
}
-Tex *rna_Main_textures_new(Main *bmain, char* name, int type)
+Tex *rna_Main_textures_new(Main *bmain, const char *name, int type)
{
Tex *tex= add_texture(name);
tex_set_type(tex, type);
BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d.", tex->id.name+2, ID_REAL_USERS(tex));
}
-Brush *rna_Main_brushes_new(Main *bmain, char* name)
+Brush *rna_Main_brushes_new(Main *bmain, const char *name)
{
Brush *brush = add_brush(name);
brush->id.us--;
BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d.", brush->id.name+2, ID_REAL_USERS(brush));
}
-World *rna_Main_worlds_new(Main *bmain, char* name)
+World *rna_Main_worlds_new(Main *bmain, const char *name)
{
World *world = add_world(name);
world->id.us--;
BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d.", world->id.name+2, ID_REAL_USERS(world));
}
-Group *rna_Main_groups_new(Main *bmain, char* name)
+Group *rna_Main_groups_new(Main *bmain, const char *name)
{
return add_group(name);
}
/* XXX python now has invalid pointer? */
}
-Text *rna_Main_texts_new(Main *bmain, char* name)
+Text *rna_Main_texts_new(Main *bmain, const char *name)
{
return add_empty_text(name);
}
/* XXX python now has invalid pointer? */
}
-Text *rna_Main_texts_load(Main *bmain, ReportList *reports, char* filepath)
+Text *rna_Main_texts_load(Main *bmain, ReportList *reports, const char *filepath)
{
Text *txt;
return txt;
}
-bArmature *rna_Main_armatures_new(Main *bmain, char* name)
+bArmature *rna_Main_armatures_new(Main *bmain, const char *name)
{
bArmature *arm= add_armature(name);
arm->id.us--;
/* XXX python now has invalid pointer? */
}
-bAction *rna_Main_actions_new(Main *bmain, char* name)
+bAction *rna_Main_actions_new(Main *bmain, const char *name)
{
bAction *act= add_empty_action(name);
act->id.us--;
/* XXX python now has invalid pointer? */
}
-ParticleSettings *rna_Main_particles_new(Main *bmain, char* name)
+ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name)
{
ParticleSettings *part = psys_new_settings(name, bmain);
part->id.us--;
return me->edit_mesh ? me->edit_mesh->totfacesel : 0;
}
-static CustomDataLayer *rna_Mesh_vertex_color_new(struct Mesh *me, struct bContext *C, char *name)
+static CustomDataLayer *rna_Mesh_vertex_color_new(struct Mesh *me, struct bContext *C, const char *name)
{
CustomData *fdata;
CustomDataLayer *cdl= NULL;
return cdl;
}
-static CustomDataLayer *rna_Mesh_uv_texture_new(struct Mesh *me, struct bContext *C, char *name)
+static CustomDataLayer *rna_Mesh_uv_texture_new(struct Mesh *me, struct bContext *C, const char *name)
{
CustomData *fdata;
CustomDataLayer *cdl= NULL;
WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, object);
}
-static ModifierData *rna_Object_modifier_new(Object *object, bContext *C, ReportList *reports, char *name, int type)
+static ModifierData *rna_Object_modifier_new(Object *object, bContext *C, ReportList *reports, const char *name, int type)
{
return ED_object_modifier_add(reports, CTX_data_main(C), CTX_data_scene(C), object, name, type);
}
DAG_id_flush_update(&ob->id, flag);
}
-static PointerRNA rna_Object_add_shape_key(Object *ob, bContext *C, ReportList *reports, char *name, int from_mix)
+static PointerRNA rna_Object_add_shape_key(Object *ob, bContext *C, ReportList *reports, const char *name, int from_mix)
{
Scene *scene= CTX_data_scene(C);
KeyBlock *kb= NULL;
}
-static TimeMarker *rna_TimeLine_add(Scene *scene, char name[])
+static TimeMarker *rna_TimeLine_add(Scene *scene, const char name[])
{
TimeMarker *marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
marker->flag= SELECT;
MEM_freeN(marker);
}
-static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, char name[])
+static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, const char name[])
{
KeyingSet *ks= NULL;
#ifdef RNA_RUNTIME
-static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, char *propname, char *name, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int emboss, int index)
+static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, int icon, int expand, int slider, int toggle, int icon_only, int event, int full_event, int emboss, int index)
{
PropertyRNA *prop= RNA_struct_find_property(ptr, propname);
int flag= 0;
uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon);
}
-static PointerRNA rna_uiItemO(uiLayout *layout, char *opname, char *name, int icon, int emboss)
+static PointerRNA rna_uiItemO(uiLayout *layout, const char *opname, const char *name, int icon, int emboss)
{
int flag= UI_ITEM_O_RETURN_PROPS;
flag |= (emboss)? 0: UI_ITEM_R_NO_BG;
#ifdef WITH_PYTHON
static void rna_Operator_unregister(const bContext *C, StructRNA *type)
{
- char *idname;
+ const char *idname;
wmOperatorType *ot= RNA_struct_blender_type_get(type);
if(!ot)
idname= ot->idname;
WM_operatortype_remove(ot->idname);
- MEM_freeN(idname);
+ MEM_freeN((void *)idname);
/* not to be confused with the RNA_struct_free that WM_operatortype_remove calls, they are 2 different srna's */
RNA_struct_free(&BLENDER_RNA, type);
return (op->type && op->type->ext.srna)? op->type->ext.srna: &RNA_Macro;
}
-static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
+static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
{
// wmWindowManager *wm = CTX_wm_manager(C);
int modifier= 0;
return WM_keymap_add_item(km, idname, type, value, modifier, keymodifier);
}
-static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, bContext *C, ReportList *reports, char* propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
+static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, bContext *C, ReportList *reports, const char *propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
{
wmWindowManager *wm = CTX_wm_manager(C);
int modifier= 0;
return WM_modalkeymap_add_item(km, type, value, modifier, keymodifier, propvalue);
}
-static wmKeyMap *rna_keymap_new(wmKeyConfig *keyconf, char *idname, int spaceid, int regionid, int modal)
+static wmKeyMap *rna_keymap_new(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid, int modal)
{
if (modal == 0) {
return WM_keymap_find(keyconf, idname, spaceid, regionid);
}
}
-static wmKeyMap *rna_keymap_find(wmKeyConfig *keyconf, char *idname, int spaceid, int regionid)
+static wmKeyMap *rna_keymap_find(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
{
return WM_keymap_list_find(&keyconf->keymaps, idname, spaceid, regionid);
}
-static wmKeyMap *rna_keymap_find_modal(wmKeyConfig *keyconf, char *idname)
+static wmKeyMap *rna_keymap_find_modal(wmKeyConfig *keyconf, const char *idname)
{
wmOperatorType *ot = WM_operatortype_find(idname, 0);
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER);
RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER);
prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->description");
RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->idname");
RNA_def_property_string_maxlength(prop, OP_MAX_TYPENAME); /* else it uses the pointer size! */
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER);
RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER);
prop= RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->description");
RNA_def_property_string_maxlength(prop, 1024); /* else it uses the pointer size! */
+ // RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
prop= RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
WM_keymap_restore_item_to_default(C, km, kmi);
}
-static void rna_Operator_report(wmOperator *op, int type, char *msg)
+static void rna_Operator_report(wmOperator *op, int type, const char *msg)
{
BKE_report(op->reports, type, msg);
}
int BPY_eval_string(struct bContext *C, const char *expr);
/* format importer hook */
- int BPY_call_importloader( char *name );
+ int BPY_call_importloader(const char *name);
//
// void BPY_spacescript_do_pywin_draw( struct SpaceScript *sc );
// void BPY_spacescript_do_pywin_event( struct SpaceScript *sc,
/* python, will come back */
//void BPY_run_python_script() {}
//void BPY_start_python() {}
-void BPY_call_importloader() {}
+void BPY_call_importloader(const char *filepath) {(void)filepath;}
//void BPY_free_compiled_text() {}
void BPY_pyconstraint_eval() {}
void BPY_pyconstraint_target() {}
int totface, totvert, totstrand, tothalo, totlamp, totpart;
short curfield, curblur, curpart, partsdone, convertdone;
double starttime, lastframetime;
- char *infostr, *statstr, scenename[32];
+ const char *infostr, *statstr;
+ char scenename[32];
} RenderStats;
ListBase fullresult;
} RenderEngine;
-void RE_layer_load_from_file(RenderLayer *layer, struct ReportList *reports, char *filename);
-void RE_result_load_from_file(RenderResult *result, struct ReportList *reports, char *filename);
+void RE_layer_load_from_file(RenderLayer *layer, struct ReportList *reports, const char *filename);
+void RE_result_load_from_file(RenderResult *result, struct ReportList *reports, const char *filename);
struct RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int w, int h);
void RE_engine_update_result(RenderEngine *engine, struct RenderResult *result);
void RE_engine_end_result(RenderEngine *engine, struct RenderResult *result);
int RE_engine_test_break(RenderEngine *engine);
-void RE_engine_update_stats(RenderEngine *engine, char *stats, char *info);
+void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char *info);
void RE_engines_init(void);
void RE_engines_exit(void);
}
/* called for reading temp files, and for external engines */
-static int read_render_result_from_file(char *filename, RenderResult *rr)
+static int read_render_result_from_file(const char *filename, RenderResult *rr)
{
RenderLayer *rl;
RenderPass *rpass;
return re->test_break(re->tbh);
}
-void RE_engine_update_stats(RenderEngine *engine, char *stats, char *info)
+void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char *info)
{
Render *re= engine->re;
/* loads in image into a result, size must match
* x/y offsets are only used on a partial copy when dimensions dont match */
-void RE_layer_load_from_file(RenderLayer *layer, ReportList *reports, char *filename)
+void RE_layer_load_from_file(RenderLayer *layer, ReportList *reports, const char *filename)
{
ImBuf *ibuf = IMB_loadiffname(filename, IB_rect);
}
}
-void RE_result_load_from_file(RenderResult *result, ReportList *reports, char *filename)
+void RE_result_load_from_file(RenderResult *result, ReportList *reports, const char *filename)
{
if(!read_render_result_from_file(filename, result)) {
BKE_reportf(reports, RPT_ERROR, "RE_result_rect_from_file: failed to load '%s'\n", filename);
/* files */
int WM_read_homefile (struct bContext *C, struct wmOperator *op);
int WM_write_homefile (struct bContext *C, struct wmOperator *op);
-void WM_read_file (struct bContext *C, char *name, struct ReportList *reports);
+void WM_read_file (struct bContext *C, const char *name, struct ReportList *reports);
int WM_write_file (struct bContext *C, const char *target, int fileflags, struct ReportList *reports, int copy);
void WM_read_autosavefile(struct bContext *C);
void WM_autosave_init (struct wmWindowManager *wm);
void WM_cursor_warp (struct wmWindow *win, int x, int y);
/* keyconfig and keymap */
-wmKeyConfig *WM_keyconfig_new (struct wmWindowManager *wm, char *idname);
-wmKeyConfig *WM_keyconfig_new_user(struct wmWindowManager *wm, char *idname);
+wmKeyConfig *WM_keyconfig_new (struct wmWindowManager *wm, const char *idname);
+wmKeyConfig *WM_keyconfig_new_user(struct wmWindowManager *wm, const char *idname);
void WM_keyconfig_remove (struct wmWindowManager *wm, struct wmKeyConfig *keyconf);
void WM_keyconfig_free (struct wmKeyConfig *keyconf);
void WM_keyconfig_userdef(void);
wmKeyMapItem *WM_keymap_verify_item(struct wmKeyMap *keymap, char *idname, int type,
int val, int modifier, int keymodifier);
-wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, char *idname, int type,
+wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, const char *idname, int type,
int val, int modifier, int keymodifier);
wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, char *idname, int type,
int val, int modifier, int keymodifier);
void WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi);
char *WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, int len);
-wmKeyMap *WM_keymap_list_find(ListBase *lb, char *idname, int spaceid, int regionid);
-wmKeyMap *WM_keymap_find(struct wmKeyConfig *keyconf, char *idname, int spaceid, int regionid);
-wmKeyMap *WM_keymap_find_all(const struct bContext *C, char *idname, int spaceid, int regionid);
+wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid);
+wmKeyMap *WM_keymap_find(struct wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid);
+wmKeyMap *WM_keymap_find_all(const struct bContext *C, const char *idname, int spaceid, int regionid);
wmKeyMap *WM_keymap_active(struct wmWindowManager *wm, struct wmKeyMap *keymap);
-wmKeyMap *WM_keymap_guess_opname(const struct bContext *C, char *opname);
+wmKeyMap *WM_keymap_guess_opname(const struct bContext *C, const char *opname);
int WM_keymap_user_init(struct wmWindowManager *wm, struct wmKeyMap *keymap);
wmKeyMap *WM_keymap_copy_to_user(struct wmKeyMap *keymap);
void WM_keymap_restore_to_default(struct wmKeyMap *keymap);
int WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2);
int WM_userdef_event_map(int kmitype);
-wmKeyMap *WM_modalkeymap_add(struct wmKeyConfig *keyconf, char *idname, struct EnumPropertyItem *items);
-wmKeyMap *WM_modalkeymap_get(struct wmKeyConfig *keyconf, char *idname);
+wmKeyMap *WM_modalkeymap_add(struct wmKeyConfig *keyconf, const char *idname, struct EnumPropertyItem *items);
+wmKeyMap *WM_modalkeymap_get(struct wmKeyConfig *keyconf, const char *idname);
wmKeyMapItem *WM_modalkeymap_add_item(struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, int value);
-void WM_modalkeymap_assign(struct wmKeyMap *km, char *opname);
+void WM_modalkeymap_assign(struct wmKeyMap *km, const char *opname);
const char *WM_key_event_string(short type);
int WM_key_event_operator_id(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, int hotkey, struct wmKeyMap **keymap_r);
void WM_operatortype_append_macro_ptr (void (*opfunc)(struct wmOperatorType*, void *), void *userdata);
int WM_operatortype_remove(const char *idname);
-struct wmOperatorType *WM_operatortype_append_macro(char *idname, char *name, int flag);
+struct wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, int flag);
struct wmOperatorTypeMacro *WM_operatortype_macro_define(struct wmOperatorType *ot, const char *idname);
typedef struct wmOperatorType {
struct wmOperatorType *next, *prev;
- char *name; /* text for ui, undo */
- char *idname; /* unique identifier */
- char *description; /* tooltips and python docs */
+ const char *name; /* text for ui, undo */
+ const char *idname; /* unique identifier */
+ const char *description; /* tooltips and python docs */
/* this callback executes the operator without any interactive input,
* parameters may be provided through operator properties. cannot use
}
-static char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag, wmEvent *event)
+static const char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag, wmEvent *event)
{
wmEventHandler *handler= handlers->first;
for(; handler; handler= handler->next) {
}
/* return active operator name when mouse is in box */
-static char *wm_dropbox_active(bContext *C, wmDrag *drag, wmEvent *event)
+static const char *wm_dropbox_active(bContext *C, wmDrag *drag, wmEvent *event)
{
wmWindow *win= CTX_wm_window(C);
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= CTX_wm_region(C);
- char *name;
+ const char *name;
name= dropbox_active(C, &win->handlers, drag, event);
if(name) return name;
strcpy(drag->opname, "Paste name");
}
else {
- char *opname= wm_dropbox_active(C, drag, event);
+ const char *opname= wm_dropbox_active(C, drag, event);
if(opname) {
BLI_strncpy(drag->opname, opname, FILE_MAX);
if(U.tempdir[0]) BLI_where_is_temp(btempdir, 1);
}
-void WM_read_file(bContext *C, char *name, ReportList *reports)
+void WM_read_file(bContext *C, const char *name, ReportList *reports)
{
int retval;
keymap_properties_set(kmi);
}
-wmKeyConfig *WM_keyconfig_new(wmWindowManager *wm, char *idname)
+wmKeyConfig *WM_keyconfig_new(wmWindowManager *wm, const char *idname)
{
wmKeyConfig *keyconf;
return keyconf;
}
-wmKeyConfig *WM_keyconfig_new_user(wmWindowManager *wm, char *idname)
+wmKeyConfig *WM_keyconfig_new_user(wmWindowManager *wm, const char *idname)
{
wmKeyConfig *keyconf = WM_keyconfig_new(wm, idname);
}
/* always add item */
-wmKeyMapItem *WM_keymap_add_item(wmKeyMap *keymap, char *idname, int type, int val, int modifier, int keymodifier)
+wmKeyMapItem *WM_keymap_add_item(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier)
{
wmKeyMapItem *kmi= MEM_callocN(sizeof(wmKeyMapItem), "keymap entry");
space/region ids are same as DNA_space_types.h */
/* gets free'd in wm.c */
-wmKeyMap *WM_keymap_list_find(ListBase *lb, char *idname, int spaceid, int regionid)
+wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid)
{
wmKeyMap *km;
return NULL;
}
-wmKeyMap *WM_keymap_find(wmKeyConfig *keyconf, char *idname, int spaceid, int regionid)
+wmKeyMap *WM_keymap_find(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
{
wmKeyMap *km= WM_keymap_list_find(&keyconf->keymaps, idname, spaceid, regionid);
return km;
}
-wmKeyMap *WM_keymap_find_all(const bContext *C, char *idname, int spaceid, int regionid)
+wmKeyMap *WM_keymap_find_all(const bContext *C, const char *idname, int spaceid, int regionid)
{
wmWindowManager *wm = CTX_wm_manager(C);
wmKeyConfig *keyconf;
/* modal maps get linked to a running operator, and filter the keys before sending to modal() callback */
-wmKeyMap *WM_modalkeymap_add(wmKeyConfig *keyconf, char *idname, EnumPropertyItem *items)
+wmKeyMap *WM_modalkeymap_add(wmKeyConfig *keyconf, const char *idname, EnumPropertyItem *items)
{
wmKeyMap *km= WM_keymap_find(keyconf, idname, 0, 0);
km->flag |= KEYMAP_MODAL;
return km;
}
-wmKeyMap *WM_modalkeymap_get(wmKeyConfig *keyconf, char *idname)
+wmKeyMap *WM_modalkeymap_get(wmKeyConfig *keyconf, const char *idname)
{
wmKeyMap *km;
return kmi;
}
-void WM_modalkeymap_assign(wmKeyMap *km, char *opname)
+void WM_modalkeymap_assign(wmKeyMap *km, const char *opname)
{
wmOperatorType *ot= WM_operatortype_find(opname, 0);
/* Guess an appropriate keymap from the operator name */
/* Needs to be kept up to date with Keymap and Operator naming */
-wmKeyMap *WM_keymap_guess_opname(const bContext *C, char *opname)
+wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
{
wmKeyMap *km=NULL;
SpaceLink *sl = CTX_wm_space_data(C);
}
/* Names have to be static for now */
-wmOperatorType *WM_operatortype_append_macro(char *idname, char *name, int flag)
+wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, int flag)
{
wmOperatorType *ot;
/* generic enum search invoke popup */
-static void operator_enum_search_cb(const struct bContext *C, void *arg_ot, char *str, uiSearchItems *items)
+static void operator_enum_search_cb(const struct bContext *C, void *arg_ot, const char *str, uiSearchItems *items)
{
wmOperatorType *ot = (wmOperatorType *)arg_ot;
PropertyRNA *prop= ot->prop;
WM_operator_name_call(C, ot->idname, WM_OP_INVOKE_DEFAULT, NULL);
}
-static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), char *str, uiSearchItems *items)
+static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
{
wmOperatorType *ot = WM_operatortype_first();
wm_operatortype_free_macro(ot);
if(ot->ext.srna) /* python operator, allocs own string */
- MEM_freeN(ot->idname);
+ MEM_freeN((void *)ot->idname);
}
BLI_freelistN(&global_ops);