From 874c96a2b9b39a2518793bebaf747e955b43d435 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 20 Oct 2011 20:38:26 +0000 Subject: [PATCH 01/20] Cleaning i18n code. Previous state: Right now, there are "memories" of the "old" (less than a month!) translation way: * A few remaining calls to BLF_gettext() (only UI_translate_do_iface and UI_translate_do_tooltip should be used). * The _() macro still also calls BLF_gettext()! New state: Here are the changes made by the patch: * Removing the no more needed _() macro. * Removing most N_() and _() calls, only keeping the few needed ones (i.e. strings that are in no other way findable by xgettext and/or update_msg script). * Defining in UI_interface.h IFACE_() and TIP_() macros (resp. for UI_translate_do_iface and UI_translate_do_tooltip). * Replacing all calls to BLF_gettext by relevant IFACE_ or TIP_ one. * Replacing all calls to UI_translate_do_iface by IFACE_. * Replacing all calls to UI_translate_do_tooltip by TIP_. All this somewhat clarifies and simplifies the code. On the bf-translations scripts side, this only implies adding IFACE_ and TIP_ as detection markers for xgettext. It also allows to reduce POTFILES.in quite notably (only 20 files remaining in it). Please also have a look at those pages: * Coder POV: http://wiki.blender.org/index.php/Dev:2.5/Source/Interface/Internationalization * Translator POV: http://wiki.blender.org/index.php/Dev:2.5/Doc/How_to/Translate_Blender --- source/blender/blenfont/BLF_translation.h | 3 +- source/blender/editors/armature/poselib.c | 6 +- source/blender/editors/include/UI_interface.h | 4 + source/blender/editors/interface/interface.c | 5 +- .../editors/interface/interface_layout.c | 14 +- .../editors/interface/interface_panel.c | 6 +- .../editors/interface/interface_regions.c | 20 ++- .../editors/interface/interface_templates.c | 136 +++++++++--------- .../editors/interface/interface_utils.c | 2 +- source/blender/editors/screen/area.c | 4 +- .../editors/space_buttons/buttons_header.c | 2 +- source/blender/editors/space_file/file_draw.c | 22 +-- .../blender/editors/space_file/file_panels.c | 2 +- .../editors/space_graph/graph_buttons.c | 4 +- .../blender/editors/space_info/space_info.c | 4 +- .../blender/editors/space_nla/nla_buttons.c | 4 +- .../blender/editors/space_node/node_header.c | 56 ++++---- .../editors/space_view3d/view3d_header.c | 24 ++-- .../editors/space_view3d/view3d_toolbar.c | 2 +- .../transform/transform_orientations.c | 11 +- source/blender/makesrna/intern/rna_userdef.c | 54 +++---- source/blender/python/intern/bpy_rna.c | 2 +- .../blender/windowmanager/intern/wm_files.c | 10 +- .../windowmanager/intern/wm_operators.c | 110 +++++++------- .../blender/windowmanager/intern/wm_window.c | 6 +- 25 files changed, 244 insertions(+), 269 deletions(-) diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h index 1c36f3e1504..707cd17e0b3 100644 --- a/source/blender/blenfont/BLF_translation.h +++ b/source/blender/blenfont/BLF_translation.h @@ -60,7 +60,8 @@ void BLF_lang_encoding_name(const char *str); void BLF_lang_encoding(const char *str); -#define _(msgid) BLF_gettext(msgid) +/*#define _(msgid) BLF_gettext(msgid)*/ +/* The "translation-marker" macro. */ #define N_(msgid) msgid #endif /* BLF_TRANSLATION_H */ diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index e7c7ebf3ece..8e9f5c7543c 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -409,15 +409,15 @@ static int poselib_add_menu_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); /* add new (adds to the first unoccupied frame) */ - uiItemIntO(layout, UI_translate_do_iface(N_("Add New")), ICON_NONE, "POSELIB_OT_pose_add", "frame", poselib_get_free_index(ob->poselib)); + uiItemIntO(layout, IFACE_("Add New"), ICON_NONE, "POSELIB_OT_pose_add", "frame", poselib_get_free_index(ob->poselib)); /* check if we have any choices to add a new pose in any other way */ if ((ob->poselib) && (ob->poselib->markers.first)) { /* add new (on current frame) */ - uiItemIntO(layout, UI_translate_do_iface(N_("Add New (Current Frame)")), ICON_NONE, "POSELIB_OT_pose_add", "frame", CFRA); + uiItemIntO(layout, IFACE_("Add New (Current Frame)"), ICON_NONE, "POSELIB_OT_pose_add", "frame", CFRA); /* replace existing - submenu */ - uiItemMenuF(layout, UI_translate_do_iface(N_("Replace Existing...")), 0, poselib_add_menu_invoke__replacemenu, NULL); + uiItemMenuF(layout, IFACE_("Replace Existing..."), 0, poselib_add_menu_invoke__replacemenu, NULL); } uiPupMenuEnd(C, pup); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index a06497889d9..43f6b36f5eb 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -813,5 +813,9 @@ int UI_translate_tooltips(void); const char *UI_translate_do_iface(const char *msgid); const char *UI_translate_do_tooltip(const char *msgid); +/* Those macros should be used everywhere in UI code. */ +#define IFACE_(msgid) UI_translate_do_iface(msgid) +#define TIP_(msgid) UI_translate_do_tooltip(msgid) + #endif /* UI_INTERFACE_H */ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 16edd0a1a9e..a12d297bbb1 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2773,10 +2773,7 @@ static uiBut *ui_def_but_operator(uiBlock *block, int type, const char *opname, if ((!tip || tip[0]=='\0') && ot && ot->description) { tip= ot->description; -#ifdef WITH_INTERNATIONAL - if(UI_translate_tooltips()) - tip= BLF_gettext(tip); -#endif + tip = TIP_(tip); } but= ui_def_but(block, type, -1, str, x1, y1, x2, y2, NULL, 0, 0, 0, 0, tip); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index ba612fc8727..2f423a361b8 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -637,11 +637,7 @@ PointerRNA uiItemFullO(uiLayout *layout, const char *opname, const char *name, i } if(!name) { - name= ot->name; - -#ifdef WITH_INTERNATIONAL - name= UI_translate_do_iface(name); -#endif + name= IFACE_(ot->name); } if(layout->root->type == UI_LAYOUT_MENU && !icon) @@ -1430,11 +1426,7 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const } if(!name) { - name= mt->label; - -#ifdef WITH_INTERNATIONAL - name= UI_translate_do_iface(name); -#endif + name= IFACE_(mt->label); } if(layout->root->type == UI_LAYOUT_MENU && !icon) @@ -2808,7 +2800,7 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in empty= uiDefAutoButsRNA(layout, &ptr, check_prop, label_align) == 0; if(empty && (flag & UI_LAYOUT_OP_SHOW_EMPTY)) { - uiItemL(layout, UI_translate_do_iface(N_("No Properties")), ICON_NONE); + uiItemL(layout, IFACE_("No Properties"), ICON_NONE); } } diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index c25e7f23c04..890a2b4ee7f 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -442,11 +442,7 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r Panel *panel= block->panel; rcti hrect; int pnl_icons; - const char *activename= panel->drawname[0]?panel->drawname:panel->panelname; - -#ifdef WITH_INTERNATIONAL - activename= UI_translate_do_iface(activename); -#endif + const char *activename= IFACE_(panel->drawname[0] ? panel->drawname : panel->panelname); /* + 0.001f to avoid flirting with float inaccuracy */ if(panel->control & UI_PNL_CLOSE) pnl_icons=(panel->labelofs+2*PNL_ICON+5)/block->aspect + 0.001f; diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 028ab05464b..bc4e3cf9f13 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -349,7 +349,6 @@ static void ui_tooltip_region_free_cb(ARegion *ar) ar->regiondata= NULL; } -#define TIP_(msgid) UI_translate_do_tooltip(msgid) ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) { uiStyle *style= UI_GetStyle(); @@ -410,7 +409,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) prop= (but->opptr)? but->opptr->data: NULL; if(WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, buf, sizeof(buf))) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Shortcut: %s")), buf); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Shortcut: %s"), buf); data->color[data->totline]= 0x888888; data->totline++; } @@ -420,7 +419,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) /* full string */ ui_get_but_string(but, buf, sizeof(buf)); if(buf[0]) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Value: %s")), buf); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Value: %s"), buf); data->color[data->totline]= 0x888888; data->totline++; } @@ -432,7 +431,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) if (unit_type == PROP_UNIT_ROTATION) { if (RNA_property_type(but->rnaprop) == PROP_FLOAT) { float value= RNA_property_array_check(but->rnaprop) ? RNA_property_float_get_index(&but->rnapoin, but->rnaprop, but->rnaindex) : RNA_property_float_get(&but->rnapoin, but->rnaprop); - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Radians: %f")), value); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Radians: %f"), value); data->color[data->totline]= 0x888888; data->totline++; } @@ -441,7 +440,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) if(but->flag & UI_BUT_DRIVEN) { if(ui_but_anim_expression_get(but, buf, sizeof(buf))) { /* expression */ - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Expression: %s")), buf); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Expression: %s"), buf); data->color[data->totline]= 0x888888; data->totline++; } @@ -449,7 +448,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) /* rna info */ if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Python: %s.%s")), RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop)); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Python: %s.%s"), RNA_struct_identifier(but->rnapoin.type), RNA_property_identifier(but->rnaprop)); data->color[data->totline]= 0x888888; data->totline++; } @@ -457,7 +456,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) if(but->rnapoin.id.data) { ID *id= but->rnapoin.id.data; if(id->lib && id->lib->name) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Library: %s")), id->lib->name); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Library: %s"), id->lib->name); data->color[data->totline]= 0x888888; data->totline++; } @@ -472,7 +471,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) /* operator info */ if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Python: %s")), str); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Python: %s"), str); data->color[data->totline]= 0x888888; data->totline++; } @@ -486,7 +485,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) WM_operator_poll_context(C, but->optype, but->opcontext); poll_msg= CTX_wm_operator_poll_msg_get(C); if(poll_msg) { - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Disabled: %s")), poll_msg); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Disabled: %s"), poll_msg); data->color[data->totline]= 0x6666ff; /* alert */ data->totline++; } @@ -496,7 +495,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) if ((U.flag & USER_TOOLTIPS_PYTHON) == 0) { if(but->menu_create_func && WM_menutype_contains((MenuType *)but->poin)) { MenuType *mt= (MenuType *)but->poin; - BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_(N_("Python: %s")), mt->idname); + BLI_snprintf(data->lines[data->totline], sizeof(data->lines[0]), TIP_("Python: %s"), mt->idname); data->color[data->totline]= 0x888888; data->totline++; } @@ -615,7 +614,6 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but) return ar; } -#undef TIP_ void ui_tooltip_free(bContext *C, ARegion *ar) { diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index e264146a6e3..c6bc0f58b5b 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -357,7 +357,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str if(flag & UI_ID_PREVIEWS) { but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6, - UI_translate_do_tooltip(template_id_browse_tip(type))); + TIP_(template_id_browse_tip(type))); if(type) { but->icon= RNA_struct_ui_icon(type); if (id) but->icon = ui_id_icon_get(C, id, 1); @@ -370,7 +370,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str } else if(flag & UI_ID_BROWSE) { but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y, - UI_translate_do_tooltip(template_id_browse_tip(type))); + TIP_(template_id_browse_tip(type))); if(type) { but->icon= RNA_struct_ui_icon(type); /* default dragging of icon for id browse buttons */ @@ -396,12 +396,12 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str if(id->lib) { if(id->flag & LIB_INDIRECT) { but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, - UI_translate_do_tooltip(N_("Indirect library datablock, cannot change"))); + TIP_("Indirect library datablock, cannot change")); uiButSetFlag(but, UI_BUT_DISABLED); } else { but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, - UI_translate_do_tooltip(N_("Direct linked library datablock, click to make local"))); + TIP_("Direct linked library datablock, click to make local")); if(!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib)) uiButSetFlag(but, UI_BUT_DISABLED); } @@ -415,7 +415,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str BLI_snprintf(str, sizeof(str), "%d", id->us); but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, - UI_translate_do_tooltip(_("Display number of users of this data (click to make a single-user copy)"))); + TIP_("Display number of users of this data (click to make a single-user copy)")); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE)); if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib) || !editable) @@ -433,11 +433,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str int w= id?UI_UNIT_X: (flag & UI_ID_OPEN)? UI_UNIT_X*3: UI_UNIT_X*6; if(newop) { - but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": UI_translate_do_iface(N_("New")), 0, 0, w, UI_UNIT_Y, NULL); + but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } else { - but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": _("New"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": IFACE_("New"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } @@ -449,11 +449,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str int w= id?UI_UNIT_X: (flag & UI_ID_ADD_NEW)? UI_UNIT_X*3: UI_UNIT_X*6; if(openop) { - but= uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id)? "": UI_translate_do_iface(N_("Open")), 0, 0, w, UI_UNIT_Y, NULL); + but= uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_DEFAULT, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN)); } else { - but= uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": UI_translate_do_iface(N_("Open")), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + but= uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": IFACE_("Open"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN)); } @@ -470,7 +470,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str } else { but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, - UI_translate_do_tooltip(N_("Unlink datablock. Shift + Click to set users to zero, data will then not be saved"))); + TIP_("Unlink datablock. Shift + Click to set users to zero, data will then not be saved")); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE)); if(RNA_property_flag(template->prop) & PROP_NEVER_NULL) @@ -727,8 +727,8 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif BLI_snprintf(str, sizeof(str), "%s parent deform", md->name); uiDefBut(block, LABEL, 0, str, 0, 0, 185, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name"); - but = uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Make Real")), 0, 0, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0, - UI_translate_do_tooltip(N_("Convert virtual modifier to a real modifier"))); + but = uiDefBut(block, BUT, 0, IFACE_("Make Real"), 0, 0, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0, + TIP_("Convert virtual modifier to a real modifier")); uiButSetFunc(but, modifiers_convertToReal, ob, md); } else { @@ -765,7 +765,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif { /* -- convert to rna ? */ but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, - UI_translate_do_tooltip(N_("Apply modifier to editing cage during Editmode"))); + TIP_("Apply modifier to editing cage during Editmode")); if (index < cageIndex) uiButSetFlag(but, UI_BUT_DISABLED); uiButSetFunc(but, modifiers_setOnCage, ob, md); @@ -786,7 +786,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif /* add disabled pre-tesselated button, so users could have message for this modifiers */ but = uiDefIconButBitI(block, TOG, eModifierMode_ApplyOnSpline, 0, ICON_SURFACE_DATA, 0, 0, UI_UNIT_X-2, UI_UNIT_Y, &md->mode, 0.0, 0.0, 0.0, 0.0, - UI_translate_do_tooltip(N_("This modifier could be applied on splines' points only"))); + TIP_("This modifier could be applied on splines' points only")); uiButSetFlag(but, UI_BUT_DISABLED); } else if (mti->type != eModifierTypeType_Constructive) { /* constructive modifiers tesselates curve before applying */ @@ -836,17 +836,17 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif } else { uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT); - uiItemEnumO(row, "OBJECT_OT_modifier_apply", UI_translate_do_iface(N_("Apply")), 0, "apply_as", MODIFIER_APPLY_DATA); + uiItemEnumO(row, "OBJECT_OT_modifier_apply", IFACE_("Apply"), 0, "apply_as", MODIFIER_APPLY_DATA); if (modifier_sameTopology(md)) - uiItemEnumO(row, "OBJECT_OT_modifier_apply", UI_translate_do_iface(N_("Apply as Shape")), 0, "apply_as", MODIFIER_APPLY_SHAPE); + uiItemEnumO(row, "OBJECT_OT_modifier_apply", IFACE_("Apply as Shape"), 0, "apply_as", MODIFIER_APPLY_SHAPE); } uiBlockClearButLock(block); uiBlockSetButLock(block, ob && ob->id.lib, ERROR_LIBDATA_MESSAGE); if (!ELEM5(md->type, eModifierType_Fluidsim, eModifierType_Softbody, eModifierType_ParticleSystem, eModifierType_Cloth, eModifierType_Smoke)) - uiItemO(row, UI_translate_do_tooltip(N_("Copy")), ICON_NONE, "OBJECT_OT_modifier_copy"); + uiItemO(row, TIP_("Copy"), ICON_NONE, "OBJECT_OT_modifier_copy"); } /* result is the layout block inside the box, that we return so that modifier settings can be drawn */ @@ -1020,8 +1020,8 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) uiBlockSetEmboss(block, UI_EMBOSSN); /* draw a ghost icon (for proxy) and also a lock beside it, to show that constraint is "proxy locked" */ - uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_GHOST, xco+244, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Proxy Protected"))); - uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_LOCKED, xco+262, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Proxy Protected"))); + uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_GHOST, xco+244, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Proxy Protected")); + uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, ICON_LOCKED, xco+262, yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Proxy Protected")); uiBlockSetEmboss(block, UI_EMBOSS); } @@ -1207,14 +1207,14 @@ void uiTemplatePreview(uiLayout *layout, ID *id, int show_buttons, ID *parent, M RNA_pointer_create(id, &RNA_Texture, tex, &texture_ptr); uiLayoutRow(layout, 1); - uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Texture")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_TEXTURE, 0, 0, ""); + uiDefButS(block, ROW, B_MATPRV, IFACE_("Texture"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_TEXTURE, 0, 0, ""); if(GS(parent->name) == ID_MA) - uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Material")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); + uiDefButS(block, ROW, B_MATPRV, IFACE_("Material"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); else if(GS(parent->name) == ID_LA) - uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Lamp")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); + uiDefButS(block, ROW, B_MATPRV, IFACE_("Lamp"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); else if(GS(parent->name) == ID_WO) - uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("World")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); - uiDefButS(block, ROW, B_MATPRV, UI_translate_do_iface(N_("Both")), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_BOTH, 0, 0, ""); + uiDefButS(block, ROW, B_MATPRV, IFACE_("World"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_OTHER, 0, 0, ""); + uiDefButS(block, ROW, B_MATPRV, IFACE_("Both"), 0, 0,UI_UNIT_X*10,UI_UNIT_Y, pr_texture, 10, TEX_PR_BOTH, 0, 0, ""); /* Alpha buton for texture preview */ if(*pr_texture!=TEX_PR_OTHER) { @@ -1305,23 +1305,23 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand if(coba==NULL) return; - bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Add")), 0+xoffs,line1_y,40,UI_UNIT_Y, NULL, 0, 0, 0, 0, - UI_translate_do_tooltip(N_("Add a new color stop to the colorband"))); + bt= uiDefBut(block, BUT, 0, IFACE_("Add"), 0+xoffs,line1_y,40,UI_UNIT_Y, NULL, 0, 0, 0, 0, + TIP_("Add a new color stop to the colorband")); uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba); - bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Delete")), 45+xoffs,line1_y,45,UI_UNIT_Y, NULL, 0, 0, 0, 0, - UI_translate_do_tooltip(N_("Delete the active position"))); + bt= uiDefBut(block, BUT, 0, IFACE_("Delete"), 45+xoffs,line1_y,45,UI_UNIT_Y, NULL, 0, 0, 0, 0, + TIP_("Delete the active position")); uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba); /* XXX, todo for later - convert to operator - campbell */ - bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,line1_y,20,UI_UNIT_Y, NULL, 0, 0, 0, 0, UI_translate_do_tooltip(N_("Flip colorband"))); + bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,line1_y,20,UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Flip colorband")); uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba); - uiDefButS(block, NUM, 0, "", 120+xoffs,line1_y,80, UI_UNIT_Y, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, UI_translate_do_tooltip(N_("Choose active color stop"))); + uiDefButS(block, NUM, 0, "", 120+xoffs,line1_y,80, UI_UNIT_Y, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, TIP_("Choose active color stop")); - bt= uiDefButS(block, MENU, 0, UI_translate_do_iface(N_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4")), - 210+xoffs, line1_y, 90, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, UI_translate_do_tooltip(N_("Set interpolation between color stops"))); + bt= uiDefButS(block, MENU, 0, IFACE_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4"), + 210+xoffs, line1_y, 90, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, TIP_("Set interpolation between color stops")); uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL); uiBlockEndAlign(block); @@ -1350,13 +1350,13 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand float xs= butr->xmin; uiBlockBeginAlign(block); - bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Add")), xs,butr->ymin+UI_UNIT_Y,2.0f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, - UI_translate_do_tooltip(N_("Add a new color stop to the colorband"))); + bt= uiDefBut(block, BUT, 0, IFACE_("Add"), xs,butr->ymin+UI_UNIT_Y,2.0f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, + TIP_("Add a new color stop to the colorband")); uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba); - bt= uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Delete")), xs+2.0f*unit,butr->ymin+UI_UNIT_Y,1.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, - UI_translate_do_tooltip(N_("Delete the active position"))); + bt= uiDefBut(block, BUT, 0, IFACE_("Delete"), xs+2.0f*unit,butr->ymin+UI_UNIT_Y,1.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, + TIP_("Delete the active position")); uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba); - bt= uiDefBut(block, BUT, 0, "F", xs+3.5f*unit,butr->ymin+UI_UNIT_Y,0.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, UI_translate_do_tooltip(N_("Flip the color ramp"))); + bt= uiDefBut(block, BUT, 0, "F", xs+3.5f*unit,butr->ymin+UI_UNIT_Y,0.5f*unit,UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Flip the color ramp")); uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba); uiBlockEndAlign(block); @@ -1367,9 +1367,9 @@ static void colorband_buttons_small(uiLayout *layout, uiBlock *block, ColorBand uiItemR(layout, &ptr, "color", 0, "", ICON_NONE); } - bt= uiDefButS(block, MENU, 0, UI_translate_do_tooltip(N_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4")), + bt= uiDefButS(block, MENU, 0, TIP_("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4"), xs+10.0f*unit, butr->ymin+UI_UNIT_Y, unit*4, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, - UI_translate_do_tooltip(N_("Set interpolation between color stops"))); + TIP_("Set interpolation between color stops")); uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL); bt= uiDefBut(block, BUT_COLORBAND, 0, "", xs,butr->ymin,butr->xmax-butr->xmin,UI_UNIT_Y, coba, 0, 0, 0, 0, ""); @@ -1620,10 +1620,10 @@ static uiBlock *curvemap_clipping_func(bContext *C, struct ARegion *ar, void *cu uiButSetFunc(bt, curvemap_buttons_setclip, cumap, NULL); uiBlockBeginAlign(block); - uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Min X ")), 0,4*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, ""); - uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Min Y ")), 0,3*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, ""); - uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Max X ")), 0,2*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, ""); - uiDefButF(block, NUM, 0, UI_translate_do_iface(N_("Max Y ")), 0,UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, ""); + uiDefButF(block, NUM, 0, IFACE_("Min X "), 0,4*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, ""); + uiDefButF(block, NUM, 0, IFACE_("Min Y "), 0,3*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, ""); + uiDefButF(block, NUM, 0, IFACE_("Max X "), 0,2*UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, ""); + uiDefButF(block, NUM, 0, IFACE_("Max Y "), 0,UI_UNIT_Y,width,UI_UNIT_Y, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, ""); uiBlockSetDirection(block, UI_RIGHT); @@ -1672,12 +1672,12 @@ static uiBlock *curvemap_tools_func(bContext *C, struct ARegion *ar, void *cumap block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS); uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset View")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Vector Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Auto Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Extend Horizontal")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Extend Extrapolated")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset Curve")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset View"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Vector Handle"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Auto Handle"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Extend Horizontal"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Extend Extrapolated"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 5, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset Curve"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 50); @@ -1694,10 +1694,10 @@ static uiBlock *curvemap_brush_tools_func(bContext *C, struct ARegion *ar, void block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS); uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset View")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Vector Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Auto Handle")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, UI_translate_do_iface(N_("Reset Curve")), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset View"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Vector Handle"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Auto Handle"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset Curve"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 50); @@ -1814,24 +1814,24 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe uiBlockSetEmboss(block, UI_EMBOSSN); - bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Zoom in"))); + bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Zoom in")); uiButSetFunc(bt, curvemap_buttons_zoom_in, cumap, NULL); - bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMOUT, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Zoom out"))); + bt= uiDefIconBut(block, BUT, 0, ICON_ZOOMOUT, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Zoom out")); uiButSetFunc(bt, curvemap_buttons_zoom_out, cumap, NULL); if(brush) - bt= uiDefIconBlockBut(block, curvemap_brush_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, UI_translate_do_tooltip(N_("Tools"))); + bt= uiDefIconBlockBut(block, curvemap_brush_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, TIP_("Tools")); else - bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, UI_translate_do_tooltip(N_("Tools"))); + bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, 0, ICON_MODIFIER, 0, 0, dx, dx, TIP_("Tools")); uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL); if(cumap->flag & CUMA_DO_CLIP) icon= ICON_CLIPUV_HLT; else icon= ICON_CLIPUV_DEHLT; - bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, 0, icon, 0, 0, dx, dx, UI_translate_do_tooltip(N_("Clipping Options"))); + bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, 0, icon, 0, 0, dx, dx, TIP_("Clipping Options")); uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL); - bt= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, UI_translate_do_tooltip(N_("Delete points"))); + bt= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, dx, dx, NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete points")); uiButSetNFunc(bt, curvemap_buttons_delete, MEM_dupallocN(cb), cumap); uiBlockSetEmboss(block, UI_EMBOSS); @@ -1850,8 +1850,8 @@ static void curvemap_buttons_layout(uiLayout *layout, PointerRNA *ptr, char labe uiItemR(uiLayoutColumn(split, 0), ptr, "white_level", UI_ITEM_R_EXPAND, NULL, ICON_NONE); uiLayoutRow(layout, 0); - bt=uiDefBut(block, BUT, 0, UI_translate_do_iface(N_("Reset")), 0, 0, UI_UNIT_X*10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, - UI_translate_do_tooltip(N_("Reset Black/White point and curves"))); + bt=uiDefBut(block, BUT, 0, IFACE_("Reset"), 0, 0, UI_UNIT_X*10, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, + TIP_("Reset Black/White point and curves")); uiButSetNFunc(bt, curvemap_buttons_reset, MEM_dupallocN(cb), cumap); } @@ -2470,18 +2470,18 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C) (void)ui_abs; // UNUSED uiDefIconBut(block, BUT, handle_event, ICON_PANEL_CLOSE, - 0, UI_UNIT_Y*0.1, UI_UNIT_X*0.8, UI_UNIT_Y*0.8, NULL, 0.0f, 0.0f, 0, 0, UI_translate_do_tooltip(N_("Stop this job"))); + 0, UI_UNIT_Y*0.1, UI_UNIT_X*0.8, UI_UNIT_Y*0.8, NULL, 0.0f, 0.0f, 0, 0, TIP_("Stop this job")); uiDefBut(block, PROGRESSBAR, 0, WM_jobs_name(wm, owner), - UI_UNIT_X, 0, 100, UI_UNIT_Y, NULL, 0.0f, 0.0f, WM_jobs_progress(wm, owner), 0, UI_translate_do_tooltip(N_("Progress"))); + UI_UNIT_X, 0, 100, UI_UNIT_Y, NULL, 0.0f, 0.0f, WM_jobs_progress(wm, owner), 0, TIP_("Progress")); uiLayoutRow(layout, 0); } if(WM_jobs_test(wm, screen)) - uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_CANCEL, UI_translate_do_iface(N_("Capture")), 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, - UI_translate_do_tooltip(N_("Stop screencast"))); + uiDefIconTextBut(block, BUT, B_STOPCAST, ICON_CANCEL, IFACE_("Capture"), 0,0,85,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, + TIP_("Stop screencast")); if(screen->animtimer) - uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_CANCEL, UI_translate_do_tooltip(N_("Anim Player")), 0,0,100,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, - UI_translate_do_tooltip(N_("Stop animation playback"))); + uiDefIconTextBut(block, BUT, B_STOPANIM, ICON_CANCEL, TIP_("Anim Player"), 0,0,100,UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, + TIP_("Stop animation playback")); } /************************* Reports for Last Operator Template **************************/ @@ -2543,7 +2543,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) uiBlockSetEmboss(block, UI_EMBOSSN); if (reports->list.first != reports->list.last) - uiDefIconButO(block, BUT, "UI_OT_reports_to_textblock", WM_OP_INVOKE_REGION_WIN, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, UI_translate_do_tooltip(N_("Click to see rest of reports in textblock: 'Recent Reports'"))); + uiDefIconButO(block, BUT, "UI_OT_reports_to_textblock", WM_OP_INVOKE_REGION_WIN, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, TIP_("Click to see rest of reports in textblock: 'Recent Reports'")); else uiDefIconBut(block, LABEL, 0, icon, 2, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0f, 0.0f, 0, 0, ""); diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 206ecbad1d0..23d5e77b78d 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -117,7 +117,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind } case PROP_COLLECTION: { char text[256]; - BLI_snprintf(text, sizeof(text), UI_translate_do_iface(N_("%d items")), RNA_property_collection_length(ptr, prop)); + BLI_snprintf(text, sizeof(text), IFACE_("%d items"), RNA_property_collection_length(ptr, prop)); but= uiDefBut(block, LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL); uiButSetFlag(but, UI_BUT_DISABLED); break; diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 28f486117b7..2b007f55706 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1388,7 +1388,7 @@ static const char *editortype_pup(void) "|Python Console %x18" ); - return UI_translate_do_iface(types); + return IFACE_(types); } static void spacefunc(struct bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) @@ -1410,7 +1410,7 @@ int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco) but= uiDefIconTextButC(block, ICONTEXTROW, 0, ICON_VIEW3D, editortype_pup(), xco, yco, UI_UNIT_X+10, UI_UNIT_Y, &(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0, - UI_translate_do_tooltip(N_("Displays current editor type. Click for menu of available types"))); + TIP_("Displays current editor type. Click for menu of available types")); uiButSetFunc(but, spacefunc, NULL, NULL); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index b18b5373240..dfbb2a543cb 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -125,7 +125,7 @@ void buttons_header_buttons(const bContext *C, ARegion *ar) #define BUTTON_HEADER_CTX(_ctx, _icon, _tip) \ if(sbuts->pathflag & (1<<_ctx)) { \ - but= uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, UI_translate_do_tooltip(_tip)); \ + but= uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, _icon, xco+=BUT_UNIT_X, yco, BUT_UNIT_X, UI_UNIT_Y, &(sbuts->mainb), 0.0, (float)_ctx, 0, 0, TIP_(_tip)); \ uiButClearFlag(but, UI_BUT_UNDO); \ } \ diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 85edcce35ca..6fbfa11d0cf 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -182,7 +182,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) but = uiDefButTextO(block, TEX, "FILE_OT_directory", 0, "", min_x, line1_y, line1_w-chan_offs, btn_h, params->dir, 0.0, (float)FILE_MAX, 0, 0, - UI_translate_do_tooltip(N_("File path"))); + TIP_("File path")); uiButSetCompleteFunc(but, autocomplete_directory, NULL); uiButSetFlag(but, UI_BUT_NO_UTF8); @@ -190,7 +190,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) but = uiDefBut(block, TEX, B_FS_FILENAME, "", min_x, line2_y, line2_w-chan_offs, btn_h, params->file, 0.0, (float)FILE_MAXFILE, 0, 0, - UI_translate_do_tooltip(overwrite_alert ?N_("File name, overwrite existing") : N_("File name"))); + TIP_(overwrite_alert ?N_("File name, overwrite existing") : N_("File name"))); uiButSetCompleteFunc(but, autocomplete_file, NULL); uiButSetFlag(but, UI_BUT_NO_UTF8); @@ -208,15 +208,15 @@ void file_draw_buttons(const bContext *C, ARegion *ar) if (fnumbuttons && (params->flag & FILE_DIRSEL_ONLY) == 0) { uiBlockBeginAlign(block); but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMOUT, - min_x + line2_w + separator - chan_offs, line2_y, - btn_fn_w, btn_h, - UI_translate_do_tooltip(N_("Decrement the filename number"))); + min_x + line2_w + separator - chan_offs, line2_y, + btn_fn_w, btn_h, + TIP_("Decrement the filename number")); RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", -1); - but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN, - min_x + line2_w + separator + btn_fn_w - chan_offs, line2_y, - btn_fn_w, btn_h, - UI_translate_do_tooltip(N_("Increment the filename number"))); + but = uiDefIconButO(block, BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN, + min_x + line2_w + separator + btn_fn_w - chan_offs, line2_y, + btn_fn_w, btn_h, + TIP_("Increment the filename number")); RNA_int_set(uiButGetOperatorPtrRNA(but), "increment", 1); uiBlockEndAlign(block); } @@ -227,9 +227,9 @@ void file_draw_buttons(const bContext *C, ARegion *ar) uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, params->title, max_x - loadbutton, line1_y, loadbutton, btn_h, params->title); - uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, UI_translate_do_iface(N_("Cancel")), + uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, IFACE_("Cancel"), max_x - loadbutton, line2_y, loadbutton, btn_h, - UI_translate_do_tooltip(N_("Cancel"))); + TIP_("Cancel")); } uiEndBlock(C, block); diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 37dce293d77..fae10c0d84e 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -146,7 +146,7 @@ static void file_panel_bookmarks(const bContext *C, Panel *pa) if(sfile) { row= uiLayoutRow(pa->layout, 0); - uiItemO(row, UI_translate_do_iface(N_("Add")), ICON_ZOOMIN, "file.bookmark_add"); + uiItemO(row, IFACE_("Add"), ICON_ZOOMIN, "file.bookmark_add"); uiItemL(row, NULL, ICON_NONE); file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, &sfile->bookmarknr, ICON_BOOKMARKS, 1, 0); diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index f1593105d5b..51a24044deb 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -754,8 +754,8 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa) block= uiLayoutGetBlock(row); // XXX for now, this will be a operator button which calls a 'add modifier' operator - uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, UI_translate_do_iface(N_("Add Modifier")), 10, 0, 150, 20, - UI_translate_do_tooltip(N_("Adds a new F-Curve Modifier for the active F-Curve"))); + uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"), 10, 0, 150, 20, + TIP_("Adds a new F-Curve Modifier for the active F-Curve")); /* copy/paste (as sub-row)*/ row= uiLayoutRow(row, 1); diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 9157df6960f..bafcf36e646 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -280,7 +280,7 @@ static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu) uiItemStringO(layout, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath); } } else { - uiItemL(layout, UI_translate_do_iface(N_("No Recent Files")), ICON_NONE); + uiItemL(layout, IFACE_("No Recent Files"), ICON_NONE); } } @@ -290,7 +290,7 @@ static void recent_files_menu_register(void) mt= MEM_callocN(sizeof(MenuType), "spacetype info menu recent files"); strcpy(mt->idname, "INFO_MT_file_open_recent"); - strcpy(mt->label, _("Open Recent...")); + strcpy(mt->label, N_("Open Recent...")); mt->draw= recent_files_menu_draw; WM_menutype_add(mt); } diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 5e1f2745559..7ba33e7e57e 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -448,8 +448,8 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa) // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator // FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected) - uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, UI_translate_do_iface(N_("Add Modifier")), 10, 0, 150, 20, - UI_translate_do_tooltip(N_("Adds a new F-Modifier for the active NLA Strip"))); + uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"), 10, 0, 150, 20, + TIP_("Adds a new F-Modifier for the active NLA Strip")); /* copy/paste (as sub-row)*/ row= uiLayoutRow(row, 1); diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index 205dd6bb639..b64685e3984 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -218,7 +218,6 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass) } } -#define IFACE_(msgid) UI_translate_do_iface(msgid) static void node_menu_add(const bContext *C, Menu *menu) { SpaceNode *snode= CTX_wm_space_node(C); @@ -228,40 +227,39 @@ static void node_menu_add(const bContext *C, Menu *menu) uiLayoutSetActive(layout, 0); if(snode->treetype==NTREE_SHADER) { - uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); - uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); - uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); - uiItemMenuF(layout, IFACE_(N_("Vector")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR)); - uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); - uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); - uiItemMenuF(layout, IFACE_(N_("Dynamic")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC)); - uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); + uiItemMenuF(layout, IFACE_("Input"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); + uiItemMenuF(layout, IFACE_("Output"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); + uiItemMenuF(layout, IFACE_("Color"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); + uiItemMenuF(layout, IFACE_("Vector"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR)); + uiItemMenuF(layout, IFACE_("Convertor"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); + uiItemMenuF(layout, IFACE_("Group"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); + uiItemMenuF(layout, IFACE_("Dynamic"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC)); + uiItemMenuF(layout, IFACE_("Layout"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); } else if(snode->treetype==NTREE_COMPOSIT) { - uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); - uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); - uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); - uiItemMenuF(layout, IFACE_(N_("Vector")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR)); - uiItemMenuF(layout, IFACE_(N_("Filter")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_FILTER)); - uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); - uiItemMenuF(layout, IFACE_(N_("Matte")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_MATTE)); - uiItemMenuF(layout, IFACE_(N_("Distort")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT)); - uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); - uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); + uiItemMenuF(layout, IFACE_("Input"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); + uiItemMenuF(layout, IFACE_("Output"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); + uiItemMenuF(layout, IFACE_("Color"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); + uiItemMenuF(layout, IFACE_("Vector"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR)); + uiItemMenuF(layout, IFACE_("Filter"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_FILTER)); + uiItemMenuF(layout, IFACE_("Convertor"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); + uiItemMenuF(layout, IFACE_("Matte"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_MATTE)); + uiItemMenuF(layout, IFACE_("Distort"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT)); + uiItemMenuF(layout, IFACE_("Group"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); + uiItemMenuF(layout, IFACE_("Layout"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); } else if(snode->treetype==NTREE_TEXTURE) { - uiItemMenuF(layout, IFACE_(N_("Input")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); - uiItemMenuF(layout, IFACE_(N_("Output")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); - uiItemMenuF(layout, IFACE_(N_("Color")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); - uiItemMenuF(layout, IFACE_(N_("Patterns")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_PATTERN)); - uiItemMenuF(layout, IFACE_(N_("Textures")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE)); - uiItemMenuF(layout, IFACE_(N_("Convertor")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); - uiItemMenuF(layout, IFACE_(N_("Distort")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT)); - uiItemMenuF(layout, IFACE_(N_("Group")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); - uiItemMenuF(layout, IFACE_(N_("Layout")), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); + uiItemMenuF(layout, IFACE_("Input"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); + uiItemMenuF(layout, IFACE_("Output"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); + uiItemMenuF(layout, IFACE_("Color"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); + uiItemMenuF(layout, IFACE_("Patterns"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_PATTERN)); + uiItemMenuF(layout, IFACE_("Textures"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE)); + uiItemMenuF(layout, IFACE_("Convertor"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); + uiItemMenuF(layout, IFACE_("Distort"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT)); + uiItemMenuF(layout, IFACE_("Group"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); + uiItemMenuF(layout, IFACE_("Layout"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT)); } } -#undef IFACE_ void node_menus_register(void) { diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index fd27dc65a0e..55f49654f32 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -275,22 +275,16 @@ static int modeselect_addmode(char *str, const char *title, int id, int icon) { static char formatstr[] = "|%s %%x%d %%i%d"; - if(UI_translate_iface()) - return sprintf(str, formatstr, BLF_gettext(title), id, icon); - else - return sprintf(str, formatstr, title, id, icon); + return sprintf(str, formatstr, IFACE_(title), id, icon); } static char *view3d_modeselect_pup(Scene *scene) { Object *ob= OBACT; static char string[256]; - const char *title= N_("Mode: %t"); + const char *title= IFACE_("Mode: %t"); char *str = string; - if(U.transopts&USER_TR_IFACE) - title= BLF_gettext(title); - BLI_strncpy(str, title, sizeof(string)); str += modeselect_addmode(str, N_("Object Mode"), OB_MODE_OBJECT, ICON_OBJECT_DATA); @@ -470,7 +464,6 @@ void uiTemplateEditModeSelection(uiLayout *layout, struct bContext *C) } } -#define TIP_(msgid) UI_translate_do_tooltip(msgid) void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) { bScreen *screen= CTX_wm_screen(C); @@ -504,7 +497,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiBlockBeginAlign(block); uiDefIconTextButS(block, MENU, B_MODESELECT, object_mode_icon(v3d->modeselect), view3d_modeselect_pup(scene) , - 0,0,126 * dpi_fac, UI_UNIT_Y, &(v3d->modeselect), 0, 0, 0, 0, TIP_(N_("Mode"))); + 0,0,126 * dpi_fac, UI_UNIT_Y, &(v3d->modeselect), 0, 0, 0, 0, TIP_("Mode")); uiBlockEndAlign(block); /* Draw type */ @@ -543,11 +536,11 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) block= uiLayoutGetBlock(row); if(v3d->twflag & V3D_USE_MANIPULATOR) { - but= uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_(N_("Translate manipulator mode"))); + but= uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Translate manipulator mode")); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ - but= uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_(N_("Rotate manipulator mode"))); + but= uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Rotate manipulator mode")); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ - but= uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_(N_("Scale manipulator mode"))); + but= uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,UI_UNIT_X,UI_UNIT_Y, &v3d->twtype, 1.0, 0.0, 0, 0, TIP_("Scale manipulator mode")); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ } @@ -555,8 +548,8 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) v3d->twmode = 0; } - str_menu = BIF_menustringTransformOrientation(C, N_("Orientation")); - but= uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, TIP_(N_("Transform Orientation"))); + str_menu = BIF_menustringTransformOrientation(C, "Orientation"); + but= uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, UI_UNIT_Y, &v3d->twmode, 0, 0, 0, 0, TIP_("Transform Orientation")); uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ MEM_freeN((void *)str_menu); } @@ -576,4 +569,3 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiTemplateEditModeSelection(layout, C); } -#undef TIP_ diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index ddea89e1cdb..58058722a82 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -82,7 +82,7 @@ static void view3d_panel_operator_redo_header(const bContext *C, Panel *pa) wmOperator *op= WM_operator_last_redo(C); if(op) BLI_strncpy(pa->drawname, op->type->name, sizeof(pa->drawname)); - else BLI_strncpy(pa->drawname, N_("Operator"), sizeof(pa->drawname)); + else BLI_strncpy(pa->drawname, IFACE_("Operator"), sizeof(pa->drawname)); } static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOperator *op) diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index cd4cbc77c49..3a7fad24d6b 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -410,18 +410,15 @@ EnumPropertyItem *BIF_enumTransformOrientation(bContext *C) } const char * BIF_menustringTransformOrientation(const bContext *C, const char *title) { - const char* menu = N_("%t|Global%x0|Local%x1|Gimbal%x4|Normal%x2|View%x3"); + const char* menu = IFACE_("%t|Global%x0|Local%x1|Gimbal%x4|Normal%x2|View%x3"); ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces; TransformOrientation *ts; int i = V3D_MANIP_CUSTOM; char *str_menu, *p; - if(UI_translate_iface()) { - title= BLF_gettext(title); - menu= BLF_gettext(menu); - } - - str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * BIF_countTransformOrientation(C), UI_translate_do_tooltip(N_("UserTransSpace from matrix"))); + title = IFACE_(title); + + str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * BIF_countTransformOrientation(C), TIP_("UserTransSpace from matrix")); p = str_menu; p += sprintf(str_menu, "%s", title); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 0c3ff108c03..d579d00f6ce 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2512,36 +2512,36 @@ static void rna_def_userdef_system(BlenderRNA *brna) /* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */ static EnumPropertyItem language_items[] = { {0, "", 0, "Nearly done", ""}, - {0, "DEFAULT", 0, N_("Default (Default)"), ""}, - {1, "ENGLISH", 0, N_("English (English)"), "en_US"}, - {8, "FRENCH", 0, N_("French (Français)"), "fr_FR"}, - {9, "SPANISH", 0, N_("Spanish (Español)"), "es_ES"}, - {13, "SIMPLIFIED_CHINESE", 0, N_("Simplified Chinese (简体中文)"), "zh_CN"}, + {0, "DEFAULT", 0, "Default (Default)", ""}, + {1, "ENGLISH", 0, "English (English)", "en_US"}, + {8, "FRENCH", 0, "French (Français)", "fr_FR"}, + {9, "SPANISH", 0, "Spanish (Español)", "es_ES"}, + {13, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese (简体中文)", "zh_CN"}, {0, "", 0, "In progress", ""}, - {2, "JAPANESE", 0, N_("Japanese (日本語)"), "ja_JP"}, - {3, "DUTCH", 0, N_("Dutch (Nederlandse taal)"), "nl_NL"}, - {4, "ITALIAN", 0, N_("Italian (Italiano)"), "it_IT"}, - {5, "GERMAN", 0, N_("German (Deutsch)"), "de_DE"}, - {6, "FINNISH", 0, N_("Finnish (Suomi)"), "fi_FI"}, - {7, "SWEDISH", 0, N_("Swedish (Svenska)"), "sv_SE"}, - {10, "CATALAN", 0, N_("Catalan (Català)"), "ca_AD"}, - {11, "CZECH", 0, N_("Czech (Český)"), "cs_CZ"}, - {12, "BRAZILIAN_PORTUGUESE", 0, N_("Brazilian Portuguese (Português do Brasil)"), "pt_BR"}, - {14, "TRADITIONAL_CHINESE", 0, N_("Traditional Chinese (繁體中文)"), "zh_TW"}, - {15, "RUSSIAN", 0, N_("Russian (Русский)"), "ru_RU"}, - {16, "CROATIAN", 0, N_("Croatian (Hrvatski)"), "hr_HR"}, - {17, "SERBIAN", 0, N_("Serbian (Српском језику)"), "sr_RS"}, - {18, "UKRAINIAN", 0, N_("Ukrainian (Український)"), "uk_UA"}, - {19, "POLISH", 0, N_("Polish (Polski)"), "pl_PL"}, - {20, "ROMANIAN", 0, N_("Romanian (Român)"), "ro_RO"}, + {2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"}, + {3, "DUTCH", 0, "Dutch (Nederlandse taal)", "nl_NL"}, + {4, "ITALIAN", 0, "Italian (Italiano)", "it_IT"}, + {5, "GERMAN", 0, "German (Deutsch)", "de_DE"}, + {6, "FINNISH", 0, "Finnish (Suomi)", "fi_FI"}, + {7, "SWEDISH", 0, "Swedish (Svenska)", "sv_SE"}, + {10, "CATALAN", 0, "Catalan (Català)", "ca_AD"}, + {11, "CZECH", 0, "Czech (Český)", "cs_CZ"}, + {12, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese (Português do Brasil)", "pt_BR"}, + {14, "TRADITIONAL_CHINESE", 0, "Traditional Chinese (繁體中文)", "zh_TW"}, + {15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"}, + {16, "CROATIAN", 0, "Croatian (Hrvatski)", "hr_HR"}, + {17, "SERBIAN", 0, "Serbian (Српском језику)", "sr_RS"}, + {18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"}, + {19, "POLISH", 0, "Polish (Polski)", "pl_PL"}, + {20, "ROMANIAN", 0, "Romanian (Român)", "ro_RO"}, /* using the utf8 flipped form of Arabic (العربية) */ - {21, "ARABIC", 0, N_("Arabic (ﺔﻴﺑﺮﻌﻟﺍ)"), "ar_EG"}, - {22, "BULGARIAN", 0, N_("Bulgarian (Български)"), "bg_BG"}, - {23, "GREEK", 0, N_("Greek (Ελληνικά)"), "el_GR"}, - {24, "KOREAN", 0, N_("Korean (한국 언어)"), "ko_KR"}, - /*{25, "NEPALI", 0, N_("Nepali (नेपाली)"), "ne_NP"},*/ + {21, "ARABIC", 0, "Arabic (ﺔﻴﺑﺮﻌﻟﺍ)", "ar_EG"}, + {22, "BULGARIAN", 0, "Bulgarian (Български)", "bg_BG"}, + {23, "GREEK", 0, "Greek (Ελληνικά)", "el_GR"}, + {24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"}, + /*{25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"},*/ /* using the utf8 flipped form of Persian (فارسی) */ - {26, "PERSIAN", 0, N_("Persian (ﯽﺳﺭﺎﻓ)"), "fa_PE"}, + {26, "PERSIAN", 0, "Persian (ﯽﺳﺭﺎﻓ)", "fa_PE"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index e52df8f9320..a6306909699 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1534,7 +1534,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb param= _PyUnicode_AsString(value); #ifdef WITH_INTERNATIONAL if (subtype == PROP_TRANSLATE) { - param= UI_translate_do_iface(param); + param= IFACE_(param); } #endif // WITH_INTERNATIONAL diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index bf5b60d691f..9b2d7026a46 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -437,17 +437,17 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports) else if(retval == BKE_READ_EXOTIC_OK_OTHER) BKE_write_undo(C, "Import file"); else if(retval == BKE_READ_EXOTIC_FAIL_OPEN) { - BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("Can't read file: \"%s\", %s.")), filepath, - errno ? strerror(errno) : UI_translate_do_iface(N_("Unable to open the file"))); + BKE_reportf(reports, RPT_ERROR, IFACE_("Can't read file: \"%s\", %s."), filepath, + errno ? strerror(errno) : IFACE_("Unable to open the file")); } else if(retval == BKE_READ_EXOTIC_FAIL_FORMAT) { - BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("File format is not supported in file: \"%s\".")), filepath); + BKE_reportf(reports, RPT_ERROR, IFACE_("File format is not supported in file: \"%s\"."), filepath); } else if(retval == BKE_READ_EXOTIC_FAIL_PATH) { - BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("File path invalid: \"%s\".")), filepath); + BKE_reportf(reports, RPT_ERROR, IFACE_("File path invalid: \"%s\"."), filepath); } else { - BKE_reportf(reports, RPT_ERROR, UI_translate_do_iface(N_("Unknown error loading: \"%s\".")), filepath); + BKE_reportf(reports, RPT_ERROR, IFACE_("Unknown error loading: \"%s\"."), filepath); BLI_assert(!"invalid 'retval'"); } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 1face062e7e..7a8d69e58a5 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -156,10 +156,10 @@ void WM_operatortype_append(void (*opfunc)(wmOperatorType*)) if(ot->name==NULL) { fprintf(stderr, "ERROR: Operator %s has no name property!\n", ot->idname); - ot->name= UI_translate_do_iface(N_("Dummy Name")); + ot->name= IFACE_("Dummy Name"); } - RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:UI_translate_do_iface(N_("(undocumented operator)"))); // XXX All ops should have a description but for now allow them not to. + RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:IFACE_("(undocumented operator)")); // XXX All ops should have a description but for now allow them not to. RNA_def_struct_identifier(ot->srna, ot->idname); BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot); @@ -172,7 +172,7 @@ void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType*, void*), void *us ot= MEM_callocN(sizeof(wmOperatorType), "operatortype"); ot->srna= RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties"); opfunc(ot, userdata); - RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:UI_translate_do_iface(N_("(undocumented operator)"))); + RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description:IFACE_("(undocumented operator)")); RNA_def_struct_identifier(ot->srna, ot->idname); BLI_ghash_insert(global_ops_hash, (void *)ot->idname, ot); @@ -366,7 +366,7 @@ wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *nam ot->poll= NULL; if(!ot->description) - ot->description= UI_translate_do_iface(N_("(undocumented operator)")); + ot->description= IFACE_("(undocumented operator)"); RNA_def_struct_ui_text(ot->srna, ot->name, ot->description); // XXX All ops should have a description but for now allow them not to. RNA_def_struct_identifier(ot->srna, ot->idname); @@ -391,7 +391,7 @@ void WM_operatortype_append_macro_ptr(void (*opfunc)(wmOperatorType*, void*), vo ot->poll= NULL; if(!ot->description) - ot->description= UI_translate_do_iface(N_("(undocumented operator)")); + ot->description= IFACE_("(undocumented operator)"); opfunc(ot, userdata); @@ -788,7 +788,7 @@ int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message else properties= NULL; - pup= uiPupMenuBegin(C, UI_translate_do_iface(N_("OK?")), ICON_QUESTION); + pup= uiPupMenuBegin(C, IFACE_("OK?"), ICON_QUESTION); layout= uiPupMenuLayout(pup); uiItemFullO(layout, op->type->idname, message, ICON_NONE, properties, WM_OP_EXEC_REGION_WIN, 0); uiPupMenuEnd(C, pup); @@ -870,10 +870,10 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, void WM_operator_properties_select_all(wmOperatorType *ot) { static EnumPropertyItem select_all_actions[] = { - {SEL_TOGGLE, "TOGGLE", 0, N_("Toggle"), "Toggle selection for all elements"}, - {SEL_SELECT, "SELECT", 0, N_("Select"), "Select all elements"}, - {SEL_DESELECT, "DESELECT", 0, N_("Deselect"), "Deselect all elements"}, - {SEL_INVERT, "INVERT", 0, N_("Invert"), "Invert selection of all elements"}, + {SEL_TOGGLE, "TOGGLE", 0, "Toggle", "Toggle selection for all elements"}, + {SEL_SELECT, "SELECT", 0, "Select", "Select all elements"}, + {SEL_DESELECT, "DESELECT", 0, "Deselect", "Deselect all elements"}, + {SEL_INVERT, "INVERT", 0, "Invert", "Invert selection of all elements"}, {0, NULL, 0, NULL, NULL} }; @@ -882,25 +882,25 @@ void WM_operator_properties_select_all(wmOperatorType *ot) void WM_operator_properties_gesture_border(wmOperatorType *ot, int extend) { - RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, N_("Gesture Mode"), "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, N_("X Min"), "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, N_("X Max"), "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, N_("Y Min"), "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, N_("Y Max"), "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); if(extend) - RNA_def_boolean(ot->srna, "extend", 1, _("Extend"), _("Extend selection instead of deselecting everything first")); + RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first"); } void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor) { - RNA_def_int(ot->srna, "xstart", 0, INT_MIN, INT_MAX, N_("X Start"), "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xend", 0, INT_MIN, INT_MAX, N_("X End"), "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ystart", 0, INT_MIN, INT_MAX, N_("Y Start"), "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "yend", 0, INT_MIN, INT_MAX, N_("Y End"), "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xstart", 0, INT_MIN, INT_MAX, "X Start", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "xend", 0, INT_MIN, INT_MAX, "X End", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "ystart", 0, INT_MIN, INT_MAX, "Y Start", "", INT_MIN, INT_MAX); + RNA_def_int(ot->srna, "yend", 0, INT_MIN, INT_MAX, "Y End", "", INT_MIN, INT_MAX); if(cursor) - RNA_def_int(ot->srna, "cursor", cursor, 0, INT_MAX, N_("Cursor"), N_("Mouse cursor style to use during the modal operator"), 0, INT_MAX); + RNA_def_int(ot->srna, "cursor", cursor, 0, INT_MAX, "Cursor", "Mouse cursor style to use during the modal operator", 0, INT_MAX); } @@ -1031,7 +1031,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData) col= uiLayoutColumn(layout, FALSE); col_block= uiLayoutGetBlock(col); /* Create OK button, the callback of which will execute op */ - btn= uiDefBut(col_block, BUT, 0, UI_translate_do_iface(N_("OK")), 0, -30, 0, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); + btn= uiDefBut(col_block, BUT, 0, IFACE_("OK"), 0, -30, 0, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiButSetFunc(btn, dialog_exec_cb, data, col_block); } @@ -1282,19 +1282,19 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar split = uiLayoutSplit(layout, 0, 0); col = uiLayoutColumn(split, 0); uiItemL(col, "Links", ICON_NONE); - uiItemStringO(col, UI_translate_do_iface(N_("Donations")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment"); - uiItemStringO(col, UI_translate_do_iface(N_("Credits")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits"); - uiItemStringO(col, UI_translate_do_iface(N_("Release Log")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-260"); - uiItemStringO(col, UI_translate_do_iface(N_("Manual")), ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual"); - uiItemStringO(col, UI_translate_do_iface(N_("Blender Website")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org"); - uiItemStringO(col, UI_translate_do_iface(N_("User Community")), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community"); + uiItemStringO(col, IFACE_("Donations"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/blenderorg/blender-foundation/donation-payment"); + uiItemStringO(col, IFACE_("Credits"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/credits"); + uiItemStringO(col, IFACE_("Release Log"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/development/release-logs/blender-260"); + uiItemStringO(col, IFACE_("Manual"), ICON_URL, "WM_OT_url_open", "url", "http://wiki.blender.org/index.php/Doc:2.5/Manual"); + uiItemStringO(col, IFACE_("Blender Website"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org"); + uiItemStringO(col, IFACE_("User Community"), ICON_URL, "WM_OT_url_open", "url", "http://www.blender.org/community/user-community"); if(strcmp(STRINGIFY(BLENDER_VERSION_CYCLE), "release")==0) { BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d" STRINGIFY(BLENDER_VERSION_CHAR) "_release", BLENDER_VERSION/100, BLENDER_VERSION%100); } else { BLI_snprintf(url, sizeof(url), "http://www.blender.org/documentation/blender_python_api_%d_%d_%d", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION); } - uiItemStringO(col, UI_translate_do_iface(N_("Python API Reference")), ICON_URL, "WM_OT_url_open", "url", url); + uiItemStringO(col, IFACE_("Python API Reference"), ICON_URL, "WM_OT_url_open", "url", url); uiItemL(col, "", ICON_NONE); col = uiLayoutColumn(split, 0); @@ -1304,7 +1304,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiItemS(col); } - uiItemL(col, UI_translate_do_iface(N_("Recent")), ICON_NONE); + uiItemL(col, IFACE_("Recent"), ICON_NONE); for(recent = G.recent_files.first, i=0; (i<5) && (recent); recent = recent->next, i++) { uiItemStringO(col, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath); } @@ -3319,13 +3319,13 @@ static void redraw_timer_window_swap(bContext *C) } static EnumPropertyItem redraw_timer_type_items[] = { - {0, "DRAW", 0, N_("Draw Region"), N_("Draw Region")}, - {1, "DRAW_SWAP", 0, N_("Draw Region + Swap"), N_("Draw Region and Swap")}, - {2, "DRAW_WIN", 0, N_("Draw Window"), N_("Draw Window")}, - {3, "DRAW_WIN_SWAP", 0, N_("Draw Window + Swap"), N_("Draw Window and Swap")}, - {4, "ANIM_STEP", 0, N_("Anim Step"), N_("Animation Steps")}, - {5, "ANIM_PLAY", 0, N_("Anim Play"), N_("Animation Playback")}, - {6, "UNDO", 0, N_("Undo/Redo"), N_("Undo/Redo")}, + {0, "DRAW", 0, "Draw Region", "Draw Region"}, + {1, "DRAW_SWAP", 0, "Draw Region + Swap", "Draw Region and Swap"}, + {2, "DRAW_WIN", 0, "Draw Window", "Draw Window"}, + {3, "DRAW_WIN_SWAP", 0, "Draw Window + Swap", "Draw Window and Swap"}, + {4, "ANIM_STEP", 0, "Anim Step", "Animation Steps"}, + {5, "ANIM_PLAY", 0, "Anim Play", "Animation Playback"}, + {6, "UNDO", 0, "Undo/Redo", "Undo/Redo"}, {0, NULL, 0, NULL, NULL}}; static int redraw_timer_exec(bContext *C, wmOperator *op) @@ -3635,14 +3635,14 @@ void wm_operatortype_init(void) static void gesture_circle_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { - {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""}, - {GESTURE_MODAL_CONFIRM, "CONFIRM", 0, N_("Confirm"), ""}, - {GESTURE_MODAL_CIRCLE_ADD, "ADD", 0, N_("Add"), ""}, - {GESTURE_MODAL_CIRCLE_SUB, "SUBTRACT", 0, N_("Subtract"), ""}, + {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, + {GESTURE_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""}, + {GESTURE_MODAL_CIRCLE_ADD, "ADD", 0, "Add", ""}, + {GESTURE_MODAL_CIRCLE_SUB, "SUBTRACT", 0, "Subtract", ""}, - {GESTURE_MODAL_SELECT, "SELECT", 0, N_("Select"), ""}, - {GESTURE_MODAL_DESELECT,"DESELECT", 0, N_("DeSelect"), ""}, - {GESTURE_MODAL_NOP,"NOP", 0, N_("No Operation"), ""}, + {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""}, + {GESTURE_MODAL_DESELECT,"DESELECT", 0, "DeSelect", ""}, + {GESTURE_MODAL_NOP,"NOP", 0, "No Operation", ""}, {0, NULL, 0, NULL, NULL}}; @@ -3688,9 +3688,9 @@ static void gesture_circle_modal_keymap(wmKeyConfig *keyconf) static void gesture_straightline_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { - {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""}, - {GESTURE_MODAL_SELECT, "SELECT", 0, N_("Select"), ""}, - {GESTURE_MODAL_BEGIN, "BEGIN", 0, N_("Begin"), ""}, + {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, + {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""}, + {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""}, {0, NULL, 0, NULL, NULL}}; wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Straight Line"); @@ -3716,10 +3716,10 @@ static void gesture_straightline_modal_keymap(wmKeyConfig *keyconf) static void gesture_border_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { - {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""}, - {GESTURE_MODAL_SELECT, "SELECT", 0, N_("Select"), ""}, - {GESTURE_MODAL_DESELECT,"DESELECT", 0, N_("DeSelect"), ""}, - {GESTURE_MODAL_BEGIN, "BEGIN", 0, N_("Begin"), ""}, + {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, + {GESTURE_MODAL_SELECT, "SELECT", 0, "Select", ""}, + {GESTURE_MODAL_DESELECT,"DESELECT", 0, "DeSelect", ""}, + {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""}, {0, NULL, 0, NULL, NULL}}; wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Border"); @@ -3771,10 +3771,10 @@ static void gesture_border_modal_keymap(wmKeyConfig *keyconf) static void gesture_zoom_border_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { - {GESTURE_MODAL_CANCEL, "CANCEL", 0, N_("Cancel"), ""}, - {GESTURE_MODAL_IN, "IN", 0, N_("In"), ""}, - {GESTURE_MODAL_OUT, "OUT", 0, N_("Out"), ""}, - {GESTURE_MODAL_BEGIN, "BEGIN", 0, N_("Begin"), ""}, + {GESTURE_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, + {GESTURE_MODAL_IN, "IN", 0, "In", ""}, + {GESTURE_MODAL_OUT, "OUT", 0, "Out", ""}, + {GESTURE_MODAL_BEGIN, "BEGIN", 0, "Begin", ""}, {0, NULL, 0, NULL, NULL}}; wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Gesture Zoom Border"); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 405960d0795..38ff02b46c5 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -506,11 +506,11 @@ void WM_window_open_temp(bContext *C, rcti *position, int type) ED_screen_set(C, win->screen); if(sa->spacetype==SPACE_IMAGE) - GHOST_SetTitle(win->ghostwin, UI_translate_do_iface(N_("Blender Render"))); + GHOST_SetTitle(win->ghostwin, IFACE_("Blender Render")); else if(ELEM(sa->spacetype, SPACE_OUTLINER, SPACE_USERPREF)) - GHOST_SetTitle(win->ghostwin, UI_translate_do_iface(N_("Blender User Preferences"))); + GHOST_SetTitle(win->ghostwin, IFACE_("Blender User Preferences")); else if(sa->spacetype==SPACE_FILE) - GHOST_SetTitle(win->ghostwin, UI_translate_do_iface(N_("Blender File View"))); + GHOST_SetTitle(win->ghostwin, IFACE_("Blender File View")); else GHOST_SetTitle(win->ghostwin, "Blender"); } From 2e549e0241164baff7ba2d73aa05f4d865e20153 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Oct 2011 00:01:22 +0000 Subject: [PATCH 02/20] replace own unicode functions with versions from glib which support more unicode characters. added BLI_str_utf8_as_unicode(), BLI_str_utf8_from_unicode() --- source/blender/blenlib/BLI_string_utf8.h | 27 +- source/blender/blenlib/intern/string_utf8.c | 276 +++++++++++++------- 2 files changed, 203 insertions(+), 100 deletions(-) diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h index c3bb81dd03f..b53d9d3203b 100644 --- a/source/blender/blenlib/BLI_string_utf8.h +++ b/source/blender/blenlib/BLI_string_utf8.h @@ -33,20 +33,27 @@ extern "C" { #endif -char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy); -int BLI_utf8_invalid_byte(const char *str, int length); -int BLI_utf8_invalid_strip(char *str, int length); +char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy); +int BLI_utf8_invalid_byte(const char *str, int length); +int BLI_utf8_invalid_strip(char *str, int length); /* copied from glib */ -char *BLI_str_find_prev_char_utf8(const char *str, const char *p); -char *BLI_str_find_next_char_utf8(const char *p, const char *end); -char *BLI_str_prev_char_utf8(const char *p); +unsigned int BLI_str_utf8_as_unicode(const char *p); +unsigned int BLI_str_utf8_as_unicode_and_size(const char *p, size_t *index); +unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index); +size_t BLI_str_utf8_from_unicode(unsigned int c, char *outbuf); + +char *BLI_str_find_prev_char_utf8(const char *str, const char *p); +char *BLI_str_find_next_char_utf8(const char *p, const char *end); +char *BLI_str_prev_char_utf8(const char *p); /* wchar_t functions, copied from blenders own font.c originally */ -size_t BLI_wstrlen_utf8(const wchar_t *src); -size_t BLI_strlen_utf8(const char *strc); -size_t BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t maxcpy); -size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst, const char *src, const size_t maxcpy); +size_t BLI_wstrlen_utf8(const wchar_t *src); +size_t BLI_strlen_utf8(const char *strc); +size_t BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t maxcpy); +size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst, const char *src, const size_t maxcpy); + +#define BLI_STRING_MAX_UTF8 6 #ifdef __cplusplus } diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index f331d13e580..7dc2b2bcc52 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -34,7 +34,7 @@ #include #include -#include "BLI_string.h" +#include "BLI_string_utf8.h" /* from libswish3, originally called u8_isvalid(), * modified to return the index of the bad character (byte index not utf). @@ -189,45 +189,11 @@ char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy) /* --------------------------------------------------------------------------*/ /* wchar_t / utf8 functions */ -/* UTF-8 <-> wchar transformations */ -static size_t chtoutf8(const unsigned long c, char o[4]) -{ - // Variables and initialization -/* memset(o, 0, 4); */ - - // Create the utf-8 string - if (c < 0x80) { - o[0] = (char) c; - return 1; - } - else if (c < 0x800) { - o[0] = (0xC0 | (c>>6)); - o[1] = (0x80 | (c & 0x3f)); - return 2; - } - else if (c < 0x10000) { - o[0] = (0xe0 | (c >> 12)); - o[1] = (0x80 | (c >>6 & 0x3f)); - o[2] = (0x80 | (c & 0x3f)); - return 3; - } - else if (c < 0x200000) { - o[0] = (0xf0 | (c>>18)); - o[1] = (0x80 | (c >>12 & 0x3f)); - o[2] = (0x80 | (c >> 6 & 0x3f)); - o[3] = (0x80 | (c & 0x3f)); - return 4; - } - - /* should we assert here? */ - return 0; -} - size_t BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t maxcpy) { size_t len = 0; while(*src && len < maxcpy) { /* XXX can still run over the buffer because utf8 size isnt known :| */ - len += chtoutf8(*src++, dst+len); + len += BLI_str_utf8_from_unicode(*src++, dst+len); } dst[len]= '\0'; @@ -238,11 +204,10 @@ size_t BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t max /* wchar len in utf8 */ size_t BLI_wstrlen_utf8(const wchar_t *src) { - char ch_dummy[4]; size_t len = 0; while(*src) { - len += chtoutf8(*src++, ch_dummy); + len += BLI_str_utf8_from_unicode(*src++, NULL); } return len; @@ -272,26 +237,6 @@ size_t BLI_strlen_utf8(const char *strc) return len; } - -/* Converts Unicode to wchar - -According to RFC 3629 "UTF-8, a transformation format of ISO 10646" -(http://tools.ietf.org/html/rfc3629), the valid UTF-8 encoding are: - - Char. number range | UTF-8 octet sequence - (hexadecimal) | (binary) - --------------------+--------------------------------------------- - 0000 0000-0000 007F | 0xxxxxxx - 0000 0080-0000 07FF | 110xxxxx 10xxxxxx - 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx - 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - -If the encoding incidated by the first character is incorrect (because the -1 to 3 following characters do not match 10xxxxxx), the output is a '?' and -only a single input character is consumed. - -*/ - size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size_t maxcpy) { int len=0; @@ -299,32 +244,16 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size if(dst_w==NULL || src_c==NULL) return(0); while(*src_c && len < maxcpy) { - if ((*src_c & 0xe0) == 0xc0) { - if((src_c[1] & 0x80) && (src_c[1] & 0x40) == 0x00) { - *dst_w=((src_c[0] &0x1f)<<6) | (src_c[1]&0x3f); - src_c++; - } else { - *dst_w = '?'; - } - } else if ((*src_c & 0xf0) == 0xe0) { - if((src_c[1] & src_c[2] & 0x80) && ((src_c[1] | src_c[2]) & 0x40) == 0x00) { - *dst_w=((src_c[0] & 0x0f)<<12) | ((src_c[1]&0x3f)<<6) | (src_c[2]&0x3f); - src_c += 2; - } else { - *dst_w = '?'; - } - } else if ((*src_c & 0xf8) == 0xf0) { - if((src_c[1] & src_c[2] & src_c[3] & 0x80) && ((src_c[1] | src_c[2] | src_c[3]) & 0x40) == 0x00) { - *dst_w=((src_c[0] & 0x07)<<18) | ((src_c[1]&0x1f)<<12) | ((src_c[2]&0x3f)<<6) | (src_c[3]&0x3f); - src_c += 3; - } else { - *dst_w = '?'; - } - } else { - *dst_w=(src_c[0] & 0x7f); + size_t step= 0; + unsigned int unicode= BLI_str_utf8_as_unicode_and_size(src_c, &step); + if (unicode != (unsigned int)-1) { + *dst_w= (wchar_t)unicode; + src_c += step; + } + else { + *dst_w = '?'; + src_c= BLI_str_find_next_char_utf8(src_c, NULL); } - - src_c++; dst_w++; len++; } @@ -334,13 +263,178 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size /* end wchar_t / utf8 functions */ /* --------------------------------------------------------------------------*/ - - - - /* copied from glib */ + +/* note, glib uses unsigned int for unicode, best we do the same, + * though we dont typedef it - campbell */ + +#define UTF8_COMPUTE(Char, Mask, Len) \ + if (Char < 128) { \ + Len = 1; \ + Mask = 0x7f; \ + } \ + else if ((Char & 0xe0) == 0xc0) { \ + Len = 2; \ + Mask = 0x1f; \ + } \ + else if ((Char & 0xf0) == 0xe0) { \ + Len = 3; \ + Mask = 0x0f; \ + } \ + else if ((Char & 0xf8) == 0xf0) { \ + Len = 4; \ + Mask = 0x07; \ + } \ + else if ((Char & 0xfc) == 0xf8) { \ + Len = 5; \ + Mask = 0x03; \ + } \ + else if ((Char & 0xfe) == 0xfc) { \ + Len = 6; \ + Mask = 0x01; \ + } \ + else { \ + Len = -1; \ + } + + +#define UTF8_GET(Result, Chars, Count, Mask, Len) \ + (Result) = (Chars)[0] & (Mask); \ + for ((Count) = 1; (Count) < (Len); ++(Count)) { \ + if (((Chars)[(Count)] & 0xc0) != 0x80) { \ + (Result) = -1; \ + break; \ + } \ + (Result) <<= 6; \ + (Result) |= ((Chars)[(Count)] & 0x3f); \ + } + + +/* was g_utf8_get_char */ /** - * g_utf8_find_prev_char: + * BLI_str_utf8_as_unicode: + * @p: a pointer to Unicode character encoded as UTF-8 + * + * Converts a sequence of bytes encoded as UTF-8 to a Unicode character. + * If @p does not point to a valid UTF-8 encoded character, results are + * undefined. If you are not sure that the bytes are complete + * valid Unicode characters, you should use g_utf8_get_char_validated() + * instead. + * + * Return value: the resulting character + **/ +unsigned int BLI_str_utf8_as_unicode(const char *p) +{ + int i, mask = 0, len; + unsigned int result; + unsigned char c = (unsigned char) *p; + + UTF8_COMPUTE (c, mask, len); + if (len == -1) + return (unsigned int)-1; + UTF8_GET (result, p, i, mask, len); + + return result; +} + +/* varient that increments the length */ +unsigned int BLI_str_utf8_as_unicode_and_size(const char *p, size_t *index) +{ + int i, mask = 0, len; + unsigned int result; + unsigned char c = (unsigned char) *p; + + UTF8_COMPUTE (c, mask, len); + if (len == -1) + return (unsigned int)-1; + UTF8_GET (result, p, i, mask, len); + *index += len; + return result; +} + +/* another varient that steps over the index */ +unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index) +{ + int i, mask = 0, len; + unsigned int result; + unsigned char c; + + p += *index; + c= (unsigned char) *p; + + UTF8_COMPUTE (c, mask, len); + if (len == -1) { + /* when called with NULL end, result will never be NULL, + * checks for a NULL character */ + char *p_next= BLI_str_find_next_char_utf8(p, NULL); + /* will never return the same pointer unless '\0', + * eternal loop is prevented */ + *index += (size_t)(p_next - p); + return (unsigned int)-1; + } + UTF8_GET (result, p, i, mask, len); + *index += len; + return result; +} + +/* was g_unichar_to_utf8 */ +/** + * BLI_str_utf8_from_unicode: + * @c: a Unicode character code + * @outbuf: output buffer, must have at least 6 bytes of space. + * If %NULL, the length will be computed and returned + * and nothing will be written to @outbuf. + * + * Converts a single character to UTF-8. + * + * Return value: number of bytes written + **/ +size_t BLI_str_utf8_from_unicode(unsigned int c, char *outbuf) +{ + /* If this gets modified, also update the copy in g_string_insert_unichar() */ + unsigned int len = 0; + int first; + int i; + + if (c < 0x80) { + first = 0; + len = 1; + } + else if (c < 0x800) { + first = 0xc0; + len = 2; + } + else if (c < 0x10000) { + first = 0xe0; + len = 3; + } + else if (c < 0x200000) { + first = 0xf0; + len = 4; + } + else if (c < 0x4000000) { + first = 0xf8; + len = 5; + } + else { + first = 0xfc; + len = 6; + } + + if (outbuf) { + for (i = len - 1; i > 0; --i) { + outbuf[i] = (c & 0x3f) | 0x80; + c >>= 6; + } + outbuf[0] = c | first; + } + + return len; +} + +/* was g_utf8_find_prev_char */ +/** + * BLI_str_find_prev_char_utf8: * @str: pointer to the beginning of a UTF-8 encoded string * @p: pointer to some position within @str * @@ -364,8 +458,9 @@ char * BLI_str_find_prev_char_utf8(const char *str, const char *p) return NULL; } +/* was g_utf8_find_next_char */ /** - * g_utf8_find_next_char: + * BLI_str_find_next_char_utf8: * @p: a pointer to a position within a UTF-8 encoded string * @end: a pointer to the byte following the end of the string, * or %NULL to indicate that the string is nul-terminated. @@ -395,8 +490,9 @@ char *BLI_str_find_next_char_utf8(const char *p, const char *end) return (p == end) ? NULL : (char *)p; } +/* was g_utf8_prev_char */ /** - * g_utf8_prev_char: + * BLI_str_prev_char_utf8: * @p: a pointer to a position within a UTF-8 encoded string * * Finds the previous UTF-8 character in the string before @p. From 2d8189cec0dab3d4c9db95c03ebb4eb2de6738c4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Oct 2011 00:48:02 +0000 Subject: [PATCH 03/20] - minor edits to font drawing/utf8, was needlessly casting int/unsigned int. - also ifdef'd out more smoke function when the modifiers disabled. --- source/blender/blenfont/intern/blf_font.c | 35 +++++++++++-------- source/blender/blenfont/intern/blf_internal.h | 2 +- source/blender/blenfont/intern/blf_util.c | 6 ++-- source/blender/blenkernel/intern/smoke.c | 22 ++++++------ source/blender/blenlib/BLI_string_utf8.h | 3 +- source/blender/blenlib/intern/string_utf8.c | 8 ++--- 6 files changed, 43 insertions(+), 33 deletions(-) diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 5161761cf09..9a7fb95dd78 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -129,7 +129,7 @@ static void blf_font_ensure_ascii_table(FontBLF *font) g= (glyph_ascii_table)[c]; \ i++; \ } \ - else if ((c= blf_utf8_next((unsigned char *)(str), &(i)))) { \ + else if ((c= blf_utf8_next((str), &(i))) != BLI_UTF8_ERR) { \ if ((g= blf_glyph_search((font)->glyph_cache, c)) == NULL) { \ g= blf_glyph_add(font, FT_Get_Char_Index((font)->face, c), c); \ } \ @@ -141,15 +141,20 @@ static void blf_font_ensure_ascii_table(FontBLF *font) const FT_UInt kern_mode= (has_kerning == 0) ? 0 : \ (((_font)->flags & BLF_KERNING_DEFAULT) ? \ ft_kerning_default : FT_KERNING_UNFITTED) \ - \ #define BLF_KERNING_STEP(_font, kern_mode, g_prev, g, delta, pen_x) \ { \ if (g_prev) { \ delta.x= delta.y= 0; \ - if (FT_Get_Kerning((_font)->face, g_prev->idx, g->idx, kern_mode, &delta) == 0) \ + if (FT_Get_Kerning((_font)->face, \ + (g_prev)->idx, \ + (g)->idx, \ + kern_mode, \ + &(delta)) == 0) \ + { \ pen_x += delta.x >> 6; \ + } \ } \ } \ @@ -159,7 +164,7 @@ void blf_font_draw(FontBLF *font, const char *str, unsigned int len) GlyphBLF *g, *g_prev= NULL; FT_Vector delta; int pen_x= 0, pen_y= 0; - unsigned int i= 0; + size_t i= 0; GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table; BLF_KERNING_VARS(font, has_kerning, kern_mode); @@ -170,9 +175,9 @@ void blf_font_draw(FontBLF *font, const char *str, unsigned int len) BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table); - if (c == 0) break; - if (g == NULL) continue; - if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x); + if (c == BLI_UTF8_ERR) break; + if (g == NULL) continue; + if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x); /* do not return this loop if clipped, we want every character tested */ blf_glyph_render(font, g, (float)pen_x, (float)pen_y); @@ -214,7 +219,7 @@ void blf_font_buffer(FontBLF *font, const char *str) GlyphBLF *g, *g_prev= NULL; FT_Vector delta; int pen_x= (int)font->pos[0], pen_y= 0; - unsigned int i= 0; + size_t i= 0; GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table; /* buffer specific vars*/ @@ -235,9 +240,9 @@ void blf_font_buffer(FontBLF *font, const char *str) BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table); - if (c == 0) break; - if (g == NULL) continue; - if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x); + if (c == BLI_UTF8_ERR) break; + if (g == NULL) continue; + if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x); chx= pen_x + ((int)g->pos_x); chy= (int)font->pos[1] + g->height; @@ -340,7 +345,7 @@ void blf_font_boundbox(FontBLF *font, const char *str, rctf *box) GlyphBLF *g, *g_prev= NULL; FT_Vector delta; int pen_x= 0, pen_y= 0; - unsigned int i= 0; + size_t i= 0; GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table; rctf gbox; @@ -358,9 +363,9 @@ void blf_font_boundbox(FontBLF *font, const char *str, rctf *box) BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table); - if (c == 0) break; - if (g == NULL) continue; - if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x); + if (c == BLI_UTF8_ERR) break; + if (g == NULL) continue; + if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x); gbox.xmin= pen_x; gbox.xmax= pen_x + g->advance; diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h index ba0b9985dd4..4c830910e36 100644 --- a/source/blender/blenfont/intern/blf_internal.h +++ b/source/blender/blenfont/intern/blf_internal.h @@ -40,7 +40,7 @@ struct rctf; unsigned int blf_next_p2(unsigned int x); unsigned int blf_hash(unsigned int val); -int blf_utf8_next(unsigned char *buf, unsigned int *iindex); +unsigned int blf_utf8_next(const char *buf, size_t *iindex); char *blf_dir_search(const char *file); char *blf_dir_metrics_search(const char *filename); diff --git a/source/blender/blenfont/intern/blf_util.c b/source/blender/blenfont/intern/blf_util.c index cfe77887674..aef97b6f1cc 100644 --- a/source/blender/blenfont/intern/blf_util.c +++ b/source/blender/blenfont/intern/blf_util.c @@ -37,6 +37,8 @@ #include "blf_internal.h" +#include "BLI_string_utf8.h" + unsigned int blf_next_p2(unsigned int x) { x -= 1; @@ -72,7 +74,7 @@ unsigned int blf_hash(unsigned int val) * The original name: imlib_font_utf8_get_next * more info here: http://docs.enlightenment.org/api/imlib2/html/ */ -int blf_utf8_next(unsigned char *buf, unsigned int *iindex) +unsigned int blf_utf8_next(const char *buf, size_t *iindex) { /* Reads UTF8 bytes from 'buf', starting at 'index' and * returns the code point of the next valid code point. @@ -85,7 +87,7 @@ int blf_utf8_next(unsigned char *buf, unsigned int *iindex) d= buf[index++]; if (!d) - return 0; + return BLI_UTF8_ERR; while (buf[index] && ((buf[index] & 0xc0) == 0x80)) index++; diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 49c8831f06c..c1833b39b8b 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -131,15 +131,15 @@ struct Scene; struct DerivedMesh; struct SmokeModifierData; -// forward declerations -static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct); -void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *tris, int numfaces, int numtris, int **tridivs, float cell_len); -static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs); - #define TRI_UVOFFSET (1./4.) +#ifdef WITH_SMOKE +/* forward declerations */ +static void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *tris, int numfaces, int numtris, int **tridivs, float cell_len); +static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct); +static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs); +#else /* WITH_SMOKE */ /* Stubs to use when smoke is disabled */ -#ifndef WITH_SMOKE struct WTURBULENCE *smoke_turbulence_init(int *UNUSED(res), int UNUSED(amplify), int UNUSED(noisetype)) { return NULL; } struct FLUID_3D *smoke_init(int *UNUSED(res), float *UNUSED(p0)) { return NULL; } void smoke_free(struct FLUID_3D *UNUSED(fluid)) {} @@ -148,9 +148,9 @@ void smoke_initWaveletBlenderRNA(struct WTURBULENCE *UNUSED(wt), float *UNUSED(s void smoke_initBlenderRNA(struct FLUID_3D *UNUSED(fluid), float *UNUSED(alpha), float *UNUSED(beta), float *UNUSED(dt_factor), float *UNUSED(vorticity), int *UNUSED(border_colli)) {} long long smoke_get_mem_req(int UNUSED(xres), int UNUSED(yres), int UNUSED(zres), int UNUSED(amplify)) { return 0; } void smokeModifier_do(SmokeModifierData *UNUSED(smd), Scene *UNUSED(scene), Object *UNUSED(ob), DerivedMesh *UNUSED(dm)) {} -#endif // WITH_SMOKE - +#endif /* WITH_SMOKE */ +#ifdef WITH_SMOKE static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, DerivedMesh *dm) { if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain && !smd->domain->fluid) @@ -455,7 +455,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs) } /*! init triangle divisions */ -void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFace *faces, int numfaces, int numtris, int **tridivs, float cell_len) +static void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFace *faces, int numfaces, int numtris, int **tridivs, float cell_len) { // mTriangleDivs1.resize( faces.size() ); // mTriangleDivs2.resize( faces.size() ); @@ -554,6 +554,8 @@ void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFace *fac } } +#endif /* WITH_SMOKE */ + static void smokeModifier_freeDomain(SmokeModifierData *smd) { if(smd->domain) @@ -1659,4 +1661,4 @@ static void smoke_calc_transparency(float *result, float *input, float *p0, floa } } -#endif // WITH_SMOKE +#endif /* WITH_SMOKE */ diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h index b53d9d3203b..765ae93828e 100644 --- a/source/blender/blenlib/BLI_string_utf8.h +++ b/source/blender/blenlib/BLI_string_utf8.h @@ -53,7 +53,8 @@ size_t BLI_strlen_utf8(const char *strc); size_t BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t maxcpy); size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst, const char *src, const size_t maxcpy); -#define BLI_STRING_MAX_UTF8 6 +#define BLI_UTF8_MAX 6 +#define BLI_UTF8_ERR ((unsigned int)-1) #ifdef __cplusplus } diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 7dc2b2bcc52..25a0e67fd38 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -246,7 +246,7 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size while(*src_c && len < maxcpy) { size_t step= 0; unsigned int unicode= BLI_str_utf8_as_unicode_and_size(src_c, &step); - if (unicode != (unsigned int)-1) { + if (unicode != BLI_UTF8_ERR) { *dst_w= (wchar_t)unicode; src_c += step; } @@ -331,7 +331,7 @@ unsigned int BLI_str_utf8_as_unicode(const char *p) UTF8_COMPUTE (c, mask, len); if (len == -1) - return (unsigned int)-1; + return BLI_UTF8_ERR; UTF8_GET (result, p, i, mask, len); return result; @@ -346,7 +346,7 @@ unsigned int BLI_str_utf8_as_unicode_and_size(const char *p, size_t *index) UTF8_COMPUTE (c, mask, len); if (len == -1) - return (unsigned int)-1; + return BLI_UTF8_ERR; UTF8_GET (result, p, i, mask, len); *index += len; return result; @@ -370,7 +370,7 @@ unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index) /* will never return the same pointer unless '\0', * eternal loop is prevented */ *index += (size_t)(p_next - p); - return (unsigned int)-1; + return BLI_UTF8_ERR; } UTF8_GET (result, p, i, mask, len); *index += len; From 6912e94d06edd4c9d099fc3d248aa56ccc7460be Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Oct 2011 01:33:06 +0000 Subject: [PATCH 04/20] replace BLF's blf_utf8_next() with BLI_str_utf8_as_unicode_step(), also fixed some spelling errors. --- source/blender/blenfont/intern/blf_font.c | 2 +- source/blender/blenfont/intern/blf_internal.h | 1 - source/blender/blenfont/intern/blf_util.c | 64 ------------------- source/blender/blenkernel/intern/softbody.c | 2 +- source/blender/blenlib/PIL_time.h | 8 +-- source/blender/blenlib/intern/string_utf8.c | 34 ++++++++-- source/blender/editors/transform/transform.h | 2 +- .../gameengine/GameLogic/SCA_KeyboardSensor.h | 2 +- 8 files changed, 34 insertions(+), 81 deletions(-) diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 9a7fb95dd78..355182fb85f 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -129,7 +129,7 @@ static void blf_font_ensure_ascii_table(FontBLF *font) g= (glyph_ascii_table)[c]; \ i++; \ } \ - else if ((c= blf_utf8_next((str), &(i))) != BLI_UTF8_ERR) { \ + else if ((c= BLI_str_utf8_as_unicode_step((str), &(i))) != BLI_UTF8_ERR) { \ if ((g= blf_glyph_search((font)->glyph_cache, c)) == NULL) { \ g= blf_glyph_add(font, FT_Get_Char_Index((font)->face, c), c); \ } \ diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h index 4c830910e36..df88d0c8fea 100644 --- a/source/blender/blenfont/intern/blf_internal.h +++ b/source/blender/blenfont/intern/blf_internal.h @@ -40,7 +40,6 @@ struct rctf; unsigned int blf_next_p2(unsigned int x); unsigned int blf_hash(unsigned int val); -unsigned int blf_utf8_next(const char *buf, size_t *iindex); char *blf_dir_search(const char *file); char *blf_dir_metrics_search(const char *filename); diff --git a/source/blender/blenfont/intern/blf_util.c b/source/blender/blenfont/intern/blf_util.c index aef97b6f1cc..d51f9b8af6b 100644 --- a/source/blender/blenfont/intern/blf_util.c +++ b/source/blender/blenfont/intern/blf_util.c @@ -64,67 +64,3 @@ unsigned int blf_hash(unsigned int val) key ^= (key >> 17); return key % 257; } - -/* - * This function is from Imlib2 library (font_main.c), a - * library that does image file loading and saving as well - * as rendering, manipulation, arbitrary polygon support, etc. - * - * Copyright (C) 2000 Carsten Haitzler and various contributors - * The original name: imlib_font_utf8_get_next - * more info here: http://docs.enlightenment.org/api/imlib2/html/ - */ -unsigned int blf_utf8_next(const char *buf, size_t *iindex) -{ - /* Reads UTF8 bytes from 'buf', starting at 'index' and - * returns the code point of the next valid code point. - * 'index' is updated ready for the next call. - * - * Returns 0 to indicate an error (e.g. invalid UTF8) - */ - int index= *iindex, len, r; - unsigned char d, d2, d3, d4; - - d= buf[index++]; - if (!d) - return BLI_UTF8_ERR; - - while (buf[index] && ((buf[index] & 0xc0) == 0x80)) - index++; - - len= index - *iindex; - if (len == 1) - r= d; - else if (len == 2) { - /* 2 byte */ - d2= buf[*iindex + 1]; - r= d & 0x1f; /* copy lower 5 */ - r <<= 6; - r |= (d2 & 0x3f); /* copy lower 6 */ - } - else if (len == 3) { - /* 3 byte */ - d2= buf[*iindex + 1]; - d3= buf[*iindex + 2]; - r= d & 0x0f; /* copy lower 4 */ - r <<= 6; - r |= (d2 & 0x3f); - r <<= 6; - r |= (d3 & 0x3f); - } - else { - /* 4 byte */ - d2= buf[*iindex + 1]; - d3= buf[*iindex + 2]; - d4= buf[*iindex + 3]; - r= d & 0x0f; /* copy lower 4 */ - r <<= 6; - r |= (d2 & 0x3f); - r <<= 6; - r |= (d3 & 0x3f); - r <<= 6; - r |= (d4 & 0x3f); - } - *iindex= index; - return r; -} diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 8787ec07d9c..cd147f4dbed 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -208,7 +208,7 @@ static float sb_time_scale(Object *ob) } return (1.0f); /* - this would be frames/sec independant timing assuming 25 fps is default + this would be frames/sec independent timing assuming 25 fps is default but does not work very well with NLA return (25.0f/scene->r.frs_sec) */ diff --git a/source/blender/blenlib/PIL_time.h b/source/blender/blenlib/PIL_time.h index 82869035d50..36ea43bef2d 100644 --- a/source/blender/blenlib/PIL_time.h +++ b/source/blender/blenlib/PIL_time.h @@ -1,7 +1,5 @@ -/* - * @file PIL_time.h - * - * Platform independant time functions. +/* + * Platform independent time functions. * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -51,7 +49,7 @@ extern double PIL_check_seconds_timer (void); /** - * Platform-independant sleep function. + * Platform-independent sleep function. * @param ms Number of milliseconds to sleep */ void PIL_sleep_ms (int ms); diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 25a0e67fd38..8dc683f6e22 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -297,12 +297,12 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size Len = -1; \ } - -#define UTF8_GET(Result, Chars, Count, Mask, Len) \ +/* same as glib define but added an 'Err' arg */ +#define UTF8_GET(Result, Chars, Count, Mask, Len, Err) \ (Result) = (Chars)[0] & (Mask); \ for ((Count) = 1; (Count) < (Len); ++(Count)) { \ if (((Chars)[(Count)] & 0xc0) != 0x80) { \ - (Result) = -1; \ + (Result) = Err; \ break; \ } \ (Result) <<= 6; \ @@ -332,7 +332,7 @@ unsigned int BLI_str_utf8_as_unicode(const char *p) UTF8_COMPUTE (c, mask, len); if (len == -1) return BLI_UTF8_ERR; - UTF8_GET (result, p, i, mask, len); + UTF8_GET (result, p, i, mask, len, BLI_UTF8_ERR); return result; } @@ -347,12 +347,13 @@ unsigned int BLI_str_utf8_as_unicode_and_size(const char *p, size_t *index) UTF8_COMPUTE (c, mask, len); if (len == -1) return BLI_UTF8_ERR; - UTF8_GET (result, p, i, mask, len); + UTF8_GET (result, p, i, mask, len, BLI_UTF8_ERR); *index += len; return result; } -/* another varient that steps over the index */ +/* another varient that steps over the index, + * note, currently this also falls back to latin1 for text drawing. */ unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index) { int i, mask = 0, len; @@ -372,7 +373,26 @@ unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index) *index += (size_t)(p_next - p); return BLI_UTF8_ERR; } - UTF8_GET (result, p, i, mask, len); + + /* this is tricky since there are a few ways we can bail out of bad unicode + * values, 3 possible solutions. */ +#if 0 + UTF8_GET (result, p, i, mask, len, BLI_UTF8_ERR); +#elif 1 + /* WARNING: this is NOT part of glib, or supported by similar functions. + * this is added for text drawing because some filepaths can have latin1 + * characters */ + UTF8_GET (result, p, i, mask, len, BLI_UTF8_ERR); + if(result == BLI_UTF8_ERR) { + len= 1; + result= *p; + } + /* end warning! */ +#else + /* without a fallback like '?', text drawing will stop on this value */ + UTF8_GET (result, p, i, mask, len, '?'); +#endif + *index += len; return result; } diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 2f177239f44..7fccbcb0097 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -152,7 +152,7 @@ typedef struct TransData2D { float loc[3]; /* Location of data used to transform (x,y,0) */ float *loc2d; /* Pointer to real 2d location of data */ - float *h1, *h2; /* Pointer to handle locations, if handles aren't being moved independantly*/ + float *h1, *h2; /* Pointer to handle locations, if handles aren't being moved independently */ float ih1[2], ih2[2]; } TransData2D; diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index ee40567fce2..6df648bf2d3 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -69,7 +69,7 @@ class SCA_KeyboardSensor : public SCA_ISensor * The property that indicates whether or not to log text when in * loggin mode. If the property equals 0, no loggin is done. For * all other values, logging is active. Logging can only become - * active if there is a property to log to. Logging is independant + * active if there is a property to log to. Logging is independent * from hotkey settings. */ STR_String m_toggleprop; From 9ec0ea91f02b312ecce8c7b6754db54ce9ba8a1a Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Fri, 21 Oct 2011 01:46:03 +0000 Subject: [PATCH 05/20] Fix copyright assignment. --- source/blender/blenlib/intern/string_utf8.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 8dc683f6e22..b1ad04eb70d 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2011 Blender Foundation. + * Code from gutf8.c Copyright (C) 1999 Tom Tromey + * Copyright (C) 2000 Red Hat, Inc. * All rights reserved. * * Contributor(s): Campbell Barton. @@ -263,7 +265,7 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size /* end wchar_t / utf8 functions */ /* --------------------------------------------------------------------------*/ -/* copied from glib */ +/* copied from glib's gutf8.c */ /* note, glib uses unsigned int for unicode, best we do the same, * though we dont typedef it - campbell */ From ef218c75edf975b2f3946bd16194cc9679dd2d31 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Oct 2011 02:13:36 +0000 Subject: [PATCH 06/20] - add convenience functions BLI_split_dir_part / BLI_split_file_part, which just call BLI_split_dirfile(). - add a fixed value for bprogdir (the dir of bprogname), since it was being used for resource lookups. --- source/blender/blenkernel/intern/pointcache.c | 2 +- source/blender/blenlib/BLI_path_util.h | 2 ++ source/blender/blenlib/intern/bpath.c | 2 +- source/blender/blenlib/intern/path_util.c | 23 +++++++++++-------- source/blender/blenlib/intern/winstuff.c | 2 +- source/blender/blenloader/intern/writefile.c | 4 ++-- source/blender/collada/DocumentImporter.cpp | 2 +- source/blender/collada/ImageExporter.cpp | 2 +- source/blender/editors/space_file/filesel.c | 2 +- .../editors/space_sequencer/sequencer_add.c | 2 +- .../blender/makesrna/intern/rna_sequencer.c | 2 +- source/creator/creator.c | 4 +++- .../gameengine/GamePlayer/ghost/GPG_ghost.cpp | 2 ++ source/gameengine/Ketsji/KX_PythonInit.cpp | 4 ++-- 14 files changed, 32 insertions(+), 23 deletions(-) diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 8e5452e2704..bd5e5dc6049 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -910,7 +910,7 @@ static int ptcache_path(PTCacheID *pid, char *filename) else if (G.relbase_valid || lib) { char file[MAX_PTCACHE_PATH]; /* we dont want the dir, only the file */ - BLI_split_dirfile(blendfilename, NULL, file, 0, sizeof(file)); + BLI_split_file_part(blendfilename, file, sizeof(file)); i = strlen(file); /* remove .blend */ diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 4f7f7b482b5..9ccdc37c353 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -104,6 +104,8 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir, void BLI_make_exist(char *dir); void BLI_make_existing_file(const char *name); void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen); +void BLI_split_dir_part(const char *string, char *dir, const size_t dirlen); +void BLI_split_file_part(const char *string, char *file, const size_t filelen); void BLI_join_dirfile(char *string, const size_t maxlen, const char *dir, const char *file); char *BLI_path_basename(char *path); int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const char *base_dir, const char *src_dir, const char *dest_dir); diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 4e4f8b3cade..293f824c5fd 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -903,7 +903,7 @@ void findMissingFiles(Main *bmain, const char *str) //XXX waitcursor( 1 ); - BLI_split_dirfile(str, dirname, NULL, sizeof(dirname), 0); + BLI_split_dir_part(str, dirname, sizeof(dirname)); BLI_bpathIterator_init(&bpi, bmain, bmain->name, 0); diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 21f91ce8f14..b338bfcbc50 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -88,6 +88,7 @@ #define UNIQUE_NAME_MAX 128 extern char bprogname[]; +extern char bprogdir[]; static int add_win32_extension(char *name); static char *blender_version_decimal(const int ver); @@ -875,7 +876,6 @@ static int test_env_path(char *path, const char *envvar) static int get_path_local(char *targetpath, const char *folder_name, const char *subfolder_name, const int ver) { - char bprogdir[FILE_MAX]; char relfolder[FILE_MAX]; #ifdef PATH_DEBUG2 @@ -892,10 +892,7 @@ static int get_path_local(char *targetpath, const char *folder_name, const char else { relfolder[0]= '\0'; } - - /* use argv[0] (bprogname) to get the path to the executable */ - BLI_split_dirfile(bprogname, bprogdir, NULL, sizeof(bprogdir), 0); - + /* try EXECUTABLE_DIR/2.5x/folder_name - new default directory for local blender installed files */ if(test_path(targetpath, bprogdir, blender_version_decimal(ver), relfolder)) return 1; @@ -963,10 +960,6 @@ static int get_path_system(char *targetpath, const char *folder_name, const char * these are only used when running blender from source */ char cwd[FILE_MAX]; char relfolder[FILE_MAX]; - char bprogdir[FILE_MAX]; - - /* use argv[0] (bprogname) to get the path to the executable */ - BLI_split_dirfile(bprogname, bprogdir, NULL, sizeof(bprogdir), 0); if(folder_name) { if (subfolder_name) { @@ -1430,6 +1423,16 @@ void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t d } } +void BLI_split_dir_part(const char *string, char *dir, const size_t dirlen) +{ + BLI_split_dirfile(string, dir, NULL, dirlen, 0); +} + +void BLI_split_file_part(const char *string, char *file, const size_t filelen) +{ + BLI_split_dirfile(string, NULL, file, 0, filelen); +} + /* simple appending of filename to dir, does not check for valid path! */ void BLI_join_dirfile(char *dst, const size_t maxlen, const char *dir, const char *file) { @@ -1516,7 +1519,7 @@ int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const if (rel) rel[0]= 0; - BLI_split_dirfile(base_dir, blend_dir, NULL, sizeof(blend_dir), 0); + BLI_split_dir_part(base_dir, blend_dir, sizeof(blend_dir)); if (src_dir[0]=='\0') return 0; diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c index 9594197ef90..21ad0ff7253 100644 --- a/source/blender/blenlib/intern/winstuff.c +++ b/source/blender/blenlib/intern/winstuff.c @@ -56,7 +56,7 @@ int BLI_getInstallationDir( char * str ) { int a; GetModuleFileName(NULL,str,FILE_MAXDIR+FILE_MAXFILE); - BLI_split_dirfile(str, dir, NULL, sizeof(dir), 0); /* shouldn't be relative */ + BLI_split_dir_part(str, dir, sizeof(dir)); /* shouldn't be relative */ a = strlen(dir); if(dir[a-1] == '\\') dir[a-1]=0; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 6e9e3da3b42..c4f6e25f40b 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2678,8 +2678,8 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL if(write_flags & G_FILE_RELATIVE_REMAP) { char dir1[FILE_MAXDIR+FILE_MAXFILE]; char dir2[FILE_MAXDIR+FILE_MAXFILE]; - BLI_split_dirfile(filepath, dir1, NULL, sizeof(dir1), 0); - BLI_split_dirfile(mainvar->name, dir2, NULL, sizeof(dir2), 0); + BLI_split_dir_part(filepath, dir1, sizeof(dir1)); + BLI_split_dir_part(mainvar->name, dir2, sizeof(dir2)); /* just incase there is some subtle difference */ BLI_cleanup_dir(mainvar->name, dir1); diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 056d74aabfb..c06867ca107 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -884,7 +884,7 @@ bool DocumentImporter::writeImage( const COLLADAFW::Image* image ) char dir[FILE_MAX]; char full_path[FILE_MAX]; - BLI_split_dirfile(filename, dir, NULL, sizeof(dir), 0); + BLI_split_dir_part(filename, dir, sizeof(dir)); BLI_join_dirfile(full_path, sizeof(full_path), dir, filepath.c_str()); Image *ima = BKE_add_image_file(full_path); if (!ima) { diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp index 53c43677c18..6c7251016c3 100644 --- a/source/blender/collada/ImageExporter.cpp +++ b/source/blender/collada/ImageExporter.cpp @@ -97,7 +97,7 @@ void ImagesExporter::operator()(Material *ma, Object *ob) char src[FILE_MAX]; char dir[FILE_MAX]; - BLI_split_dirfile(this->export_settings->filepath, dir, NULL, sizeof(dir), 0); + BLI_split_dir_part(this->export_settings->filepath, dir, sizeof(dir)); BKE_rebase_path(abs, sizeof(abs), rel, sizeof(rel), G.main->name, image->name, dir); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index f36145aaba0..149d84b86cd 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -613,7 +613,7 @@ void autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v)) DIR *dir; struct dirent *de; - BLI_split_dirfile(str, dirname, NULL, sizeof(dirname), 0); + BLI_split_dir_part(str, dirname, sizeof(dirname)); dir = opendir(dirname); diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 7e4d02036ef..2b78bc3c190 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -321,7 +321,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad char dir_only[FILE_MAX]; char file_only[FILE_MAX]; - BLI_split_dirfile(seq_load.path, dir_only, NULL, sizeof(dir_only), 0); + BLI_split_dir_part(seq_load.path, dir_only, sizeof(dir_only)); RNA_BEGIN(op->ptr, itemptr, "files") { RNA_string_get(&itemptr, "name", file_only); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 9d72eeacf3e..3c2b771ae86 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -540,7 +540,7 @@ static int rna_Sequence_input_count_get(PointerRNA *ptr) static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value) { StripElem *elem= (StripElem*)(ptr->data); - BLI_split_dirfile(value, NULL, elem->name, 0, sizeof(elem->name)); + BLI_split_file_part(value, elem->name, sizeof(elem->name)); }*/ static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) diff --git a/source/creator/creator.c b/source/creator/creator.c index f6b99a9f73c..24f2d22a029 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -141,7 +141,8 @@ static int print_version(int argc, const char **argv, void *data); extern int pluginapi_force_ref(void); /* from blenpluginapi:pluginapi.c */ -char bprogname[FILE_MAX]; /* from blenpluginapi:pluginapi.c */ +char bprogname[FILE_MAX]; +char bprogdir[FILE_MAX]; char btempdir[FILE_MAX]; #define BLEND_VERSION_STRING_FMT "Blender %d.%02d (sub %d)\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION @@ -1157,6 +1158,7 @@ int main(int argc, const char **argv) // need this. BLI_where_am_i(bprogname, sizeof(bprogname), argv[0]); + BLI_split_dir_part(bprogname, bprogdir, sizeof(bprogdir)); BLI_threadapi_init(); diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index ea17b9adcfd..78ea2aac8ce 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -117,6 +117,7 @@ const int kMinWindowWidth = 100; const int kMinWindowHeight = 100; char bprogname[FILE_MAX]; +char bprogdir[FILE_MAX]; static void mem_error_cb(const char *errorStr) { @@ -380,6 +381,7 @@ int main(int argc, char** argv) #endif /* __alpha__ */ #endif /* __linux__ */ BLI_where_am_i(bprogname, sizeof(bprogname), argv[0]); + BLI_split_dir_part(bprogname, bprogdir, sizeof(bprogdir)); #ifdef __APPLE__ // Can't use Carbon right now because of double defined type ID (In Carbon.h and DNA_ID.h, sigh) /* diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index e86831b9323..c7da650f988 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -502,7 +502,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args) BLI_path_abs(cpath, gp_GamePythonPath); } else { /* Get the dir only */ - BLI_split_dirfile(gp_GamePythonPath, cpath, NULL, sizeof(cpath), 0); + BLI_split_dir_part(gp_GamePythonPath, cpath, sizeof(cpath)); } if((dp = opendir(cpath)) == NULL) { @@ -1732,7 +1732,7 @@ static void initPySysObjects__append(PyObject *sys_path, char *filename) PyObject *item; char expanded[FILE_MAXDIR + FILE_MAXFILE]; - BLI_split_dirfile(filename, expanded, NULL, sizeof(expanded), 0); /* get the dir part of filename only */ + BLI_split_dir_part(filename, expanded, sizeof(expanded)); /* get the dir part of filename only */ BLI_path_abs(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */ BLI_cleanup_file(gp_GamePythonPath, expanded); /* Dont use BLI_cleanup_dir because it adds a slash - BREAKS WIN32 ONLY */ item= PyUnicode_DecodeFSDefault(expanded); From d132b08f3394600d4b83d56d67eb2a5c2e84cf38 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Oct 2011 03:00:28 +0000 Subject: [PATCH 07/20] move fonts/ and locale/ dirs into release/datafiles, since blender wasn't finding them in their current location and so to test international characters you had to 'make install'. updated scons/cmake/translation-scripts. --- SConstruct | 50 ++++++++++++++---- build_files/scons/tools/Blender.py | 4 +- po/update_mo.py | 2 +- .../fonts/droidsans.ttf.gz | Bin source/creator/CMakeLists.txt | 12 ++--- 5 files changed, 48 insertions(+), 20 deletions(-) rename release/{bin/.blender => datafiles}/fonts/droidsans.ttf.gz (100%) diff --git a/SConstruct b/SConstruct index 738466d389e..034f7cf71e5 100644 --- a/SConstruct +++ b/SConstruct @@ -521,19 +521,19 @@ if env['OURPLATFORM']!='darwin': if not env['WITH_BF_INTERNATIONAL']: if 'locale' in dp: continue - if not env['WITH_BF_FREETYPE']: - if f.endswith('.ttf'): - continue + #~ if not env['WITH_BF_FREETYPE']: + #~ if f.endswith('.ttf'): + #~ continue - if 'locale' in dp or 'fonts' in dp: - datafileslist.append(os.path.join(dp,f)) - dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[3:])) # skip bin - datafilestargetlist.append(dir + os.sep + f) + #~ if 'locale' in dp or 'fonts' in dp: + #~ datafileslist.append(os.path.join(dp,f)) + #~ dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[3:])) # skip bin + #~ datafilestargetlist.append(dir + os.sep + f) - else: - dotblendlist.append(os.path.join(dp, f)) - dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[3:])) # skip bin - dottargetlist.append(dir + os.sep + f) + #~ else: + #~ dotblendlist.append(os.path.join(dp, f)) + #~ dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[3:])) # skip bin + #~ dottargetlist.append(dir + os.sep + f) dotblenderinstall = [] for targetdir,srcfile in zip(dottargetlist, dotblendlist): @@ -563,6 +563,34 @@ if env['OURPLATFORM']!='darwin': if len(source)==0: env.Execute(Mkdir(dir)) scriptinstall.append(env.Install(dir=dir,source=source)) + + if env['WITH_BF_INTERNATIONAL']: + internationalpaths=['release' + os.sep + 'datafiles'] + + def check_path(path, member): + return (member in path.split(os.sep)) + + for intpath in internationalpaths: + for dp, dn, df in os.walk(intpath): + if '.svn' in dn: + dn.remove('.svn') + if '_svn' in dn: + dn.remove('_svn') + + # we only care about release/datafiles/fonts, release/datafiles/locales + if check_path(dp, "fonts") or check_path(dp, "locale"): + pass + else: + continue + + dir = os.path.join(env['BF_INSTALLDIR'], VERSION) + dir += os.sep + os.path.basename(intpath) + dp[len(intpath):] + + source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")] + # To ensure empty dirs are created too + if len(source)==0: + env.Execute(Mkdir(dir)) + scriptinstall.append(env.Install(dir=dir,source=source)) #-- icons if env['OURPLATFORM']=='linux': diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index c802eee4fb6..875d8f7388b 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -561,9 +561,9 @@ def AppIt(target=None, source=None, env=None): if binary == 'blender': cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/datafiles'%(installdir, binary, VERSION) commands.getoutput(cmd) - cmd = 'cp -R %s/release/bin/.blender/locale %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION) + cmd = 'cp -R %s/release/datafiles/locale %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION) commands.getoutput(cmd) - cmd = 'cp -R %s/release/bin/.blender/fonts %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION) + cmd = 'cp -R %s/release/datafiles/fonts %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION) commands.getoutput(cmd) cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) commands.getoutput(cmd) diff --git a/po/update_mo.py b/po/update_mo.py index 33b7baaed69..a0173b2d059 100755 --- a/po/update_mo.py +++ b/po/update_mo.py @@ -30,7 +30,7 @@ import sys GETTEXT_MSGFMT_EXECUTABLE = "msgfmt" CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, ".."))) -LOCALE_DIR = os.path.join(SOURCE_DIR, "release", "bin", ".blender", "locale") +LOCALE_DIR = os.path.join(SOURCE_DIR, "release", "datafiles", "locale") DOMAIN = "blender" diff --git a/release/bin/.blender/fonts/droidsans.ttf.gz b/release/datafiles/fonts/droidsans.ttf.gz similarity index 100% rename from release/bin/.blender/fonts/droidsans.ttf.gz rename to release/datafiles/fonts/droidsans.ttf.gz diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index b4e9d4d262e..85facb55a9c 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -352,8 +352,8 @@ if(UNIX AND NOT APPLE) if(WITH_INTERNATIONAL) install( DIRECTORY - ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale - ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts + ${CMAKE_SOURCE_DIR}/release/datafiles/locale + ${CMAKE_SOURCE_DIR}/release/datafiles/fonts DESTINATION ${TARGETDIR_VER}/datafiles PATTERN ".svn" EXCLUDE ) @@ -424,8 +424,8 @@ elseif(WIN32) if(WITH_INTERNATIONAL) # same as linux!, deduplicate install( DIRECTORY - ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale - ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts + ${CMAKE_SOURCE_DIR}/release/datafiles/locale + ${CMAKE_SOURCE_DIR}/release/datafiles/fonts DESTINATION ${TARGETDIR_VER}/datafiles PATTERN ".svn" EXCLUDE ) @@ -648,8 +648,8 @@ elseif(APPLE) if(WITH_INTERNATIONAL) install( DIRECTORY - ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale - ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts + ${CMAKE_SOURCE_DIR}/release/datafiles/locale + ${CMAKE_SOURCE_DIR}/release/datafiles/fonts DESTINATION ${TARGETDIR_VER}/datafiles PATTERN ".svn" EXCLUDE ) From 78a8f8a4b12b9088eccf444fff49cd27f8bb3e4d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Oct 2011 03:16:01 +0000 Subject: [PATCH 08/20] - remove release/bin/.blender/.bfont.ttf, we have ./release/datafiles/bfont.ttf already, and its not used anymore. - removed scons WITH_BF_FREETYPE --- SConstruct | 134 +++++++++-------------- build_files/scons/config/linux-config.py | 1 - build_files/scons/tools/btools.py | 3 +- po/README.txt | 2 +- release/bin/.blender/.bfont.ttf | Bin 65932 -> 0 bytes source/creator/CMakeLists.txt | 15 --- 6 files changed, 54 insertions(+), 101 deletions(-) delete mode 100644 release/bin/.blender/.bfont.ttf diff --git a/SConstruct b/SConstruct index 034f7cf71e5..606cc33fb20 100644 --- a/SConstruct +++ b/SConstruct @@ -505,92 +505,62 @@ dottargetlist = [] scriptinstall = [] if env['OURPLATFORM']!='darwin': - for dp, dn, df in os.walk('release/bin/.blender'): - dp = os.path.normpath(dp) + dotblenderinstall = [] + for targetdir,srcfile in zip(dottargetlist, dotblendlist): + td, tf = os.path.split(targetdir) + dotblenderinstall.append(env.Install(dir=td, source=srcfile)) + for targetdir,srcfile in zip(datafilestargetlist, datafileslist): + td, tf = os.path.split(targetdir) + dotblenderinstall.append(env.Install(dir=td, source=srcfile)) + + if env['WITH_BF_PYTHON']: + #-- local/VERSION/scripts + scriptpaths=['release/scripts'] + for scriptpath in scriptpaths: + for dp, dn, df in os.walk(scriptpath): + if '.svn' in dn: + dn.remove('.svn') + if '_svn' in dn: + dn.remove('_svn') + if '__pycache__' in dn: # py3.2 cache dir + dn.remove('__pycache__') - if '.svn' in dn: - dn.remove('.svn') - if '_svn' in dn: - dn.remove('_svn') - - for f in df: - # This files aren't used anymore - if f in (".bfont.ttf", ): + dir = os.path.join(env['BF_INSTALLDIR'], VERSION) + dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):] + + source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")] + # To ensure empty dirs are created too + if len(source)==0: + env.Execute(Mkdir(dir)) + scriptinstall.append(env.Install(dir=dir,source=source)) + + if env['WITH_BF_INTERNATIONAL']: + internationalpaths=['release' + os.sep + 'datafiles'] + + def check_path(path, member): + return (member in path.split(os.sep)) + + for intpath in internationalpaths: + for dp, dn, df in os.walk(intpath): + if '.svn' in dn: + dn.remove('.svn') + if '_svn' in dn: + dn.remove('_svn') + + # we only care about release/datafiles/fonts, release/datafiles/locales + if check_path(dp, "fonts") or check_path(dp, "locale"): + pass + else: continue - - if not env['WITH_BF_INTERNATIONAL']: - if 'locale' in dp: - continue - #~ if not env['WITH_BF_FREETYPE']: - #~ if f.endswith('.ttf'): - #~ continue - #~ if 'locale' in dp or 'fonts' in dp: - #~ datafileslist.append(os.path.join(dp,f)) - #~ dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[3:])) # skip bin - #~ datafilestargetlist.append(dir + os.sep + f) + dir = os.path.join(env['BF_INSTALLDIR'], VERSION) + dir += os.sep + os.path.basename(intpath) + dp[len(intpath):] - #~ else: - #~ dotblendlist.append(os.path.join(dp, f)) - #~ dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[3:])) # skip bin - #~ dottargetlist.append(dir + os.sep + f) - - dotblenderinstall = [] - for targetdir,srcfile in zip(dottargetlist, dotblendlist): - td, tf = os.path.split(targetdir) - dotblenderinstall.append(env.Install(dir=td, source=srcfile)) - for targetdir,srcfile in zip(datafilestargetlist, datafileslist): - td, tf = os.path.split(targetdir) - dotblenderinstall.append(env.Install(dir=td, source=srcfile)) - - if env['WITH_BF_PYTHON']: - #-- local/VERSION/scripts - scriptpaths=['release/scripts'] - for scriptpath in scriptpaths: - for dp, dn, df in os.walk(scriptpath): - if '.svn' in dn: - dn.remove('.svn') - if '_svn' in dn: - dn.remove('_svn') - if '__pycache__' in dn: # py3.2 cache dir - dn.remove('__pycache__') - - dir = os.path.join(env['BF_INSTALLDIR'], VERSION) - dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):] - - source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")] - # To ensure empty dirs are created too - if len(source)==0: - env.Execute(Mkdir(dir)) - scriptinstall.append(env.Install(dir=dir,source=source)) - - if env['WITH_BF_INTERNATIONAL']: - internationalpaths=['release' + os.sep + 'datafiles'] - - def check_path(path, member): - return (member in path.split(os.sep)) - - for intpath in internationalpaths: - for dp, dn, df in os.walk(intpath): - if '.svn' in dn: - dn.remove('.svn') - if '_svn' in dn: - dn.remove('_svn') - - # we only care about release/datafiles/fonts, release/datafiles/locales - if check_path(dp, "fonts") or check_path(dp, "locale"): - pass - else: - continue - - dir = os.path.join(env['BF_INSTALLDIR'], VERSION) - dir += os.sep + os.path.basename(intpath) + dp[len(intpath):] - - source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")] - # To ensure empty dirs are created too - if len(source)==0: - env.Execute(Mkdir(dir)) - scriptinstall.append(env.Install(dir=dir,source=source)) + source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")] + # To ensure empty dirs are created too + if len(source)==0: + env.Execute(Mkdir(dir)) + scriptinstall.append(env.Install(dir=dir,source=source)) #-- icons if env['OURPLATFORM']=='linux': diff --git a/build_files/scons/config/linux-config.py b/build_files/scons/config/linux-config.py index a26748cd8dc..4bc64cb5f13 100644 --- a/build_files/scons/config/linux-config.py +++ b/build_files/scons/config/linux-config.py @@ -97,7 +97,6 @@ BF_BULLET_LIB = 'extern_bullet' BF_FREETYPE = '/usr' BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2' BF_FREETYPE_LIB = 'freetype' -#WITH_BF_FREETYPE_STATIC = True #BF_FREETYPE_LIB_STATIC = '${BF_FREETYPE}/lib/libfreetype.a' WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index fe56d40ea56..49efa598ed8 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -118,7 +118,7 @@ def validate_arguments(args, bc): 'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH', 'WITH_BF_GAMEENGINE', 'WITH_BF_BULLET', 'WITH_BF_ELTOPO', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB', 'BF_WINTAB', 'BF_WINTAB_INC', - 'WITH_BF_FREETYPE', 'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH', 'BF_FREETYPE_LIB_STATIC', 'WITH_BF_FREETYPE_STATIC', + 'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH', 'BF_FREETYPE_LIB_STATIC', 'WITH_BF_FREETYPE_STATIC', 'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH', 'WITH_BF_FFTW3', 'BF_FFTW3', 'BF_FFTW3_INC', 'BF_FFTW3_LIB', 'BF_FFTW3_LIBPATH', 'WITH_BF_STATICFFTW3', 'BF_FFTW3_LIB_STATIC', 'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC', @@ -385,7 +385,6 @@ def read_opts(env, cfg, args): (BoolVariable('WITH_BF_STATICCXX', 'static link to stdc++', False)), ('BF_CXX_LIB_STATIC', 'static library path for stdc++', ''), - (BoolVariable('WITH_BF_FREETYPE', 'Use FreeType2 if true', True)), ('BF_FREETYPE', 'Freetype base path', ''), ('BF_FREETYPE_INC', 'Freetype include path', ''), ('BF_FREETYPE_LIB', 'Freetype library', ''), diff --git a/po/README.txt b/po/README.txt index cadcb7194e8..6e634ae5ee3 100644 --- a/po/README.txt +++ b/po/README.txt @@ -16,7 +16,7 @@ This means when string "some message id" is used as operator name, tooltip, menu and so it'll be displayed on the screen as "translation for this message". Pretty simple. -This source files are pre-compiled into ../release/bin/.blender/locale//LC_MESSAGES/blender.mo, +This source files are pre-compiled into ../release/datafiles/locale//LC_MESSAGES/blender.mo, so they aren't getting compiled every time Blender is compiling to save some time and prevent failure on systems which don't have needed tools for compiling .po files. diff --git a/release/bin/.blender/.bfont.ttf b/release/bin/.blender/.bfont.ttf deleted file mode 100644 index 58cd6b5e61eff273e920942e28041f8ddcf1e1b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65932 zcmdSC33yaR)<0Zz>)zY@nsoN1vlF(2gndgBNFXdBLRb|{$O1t~ViMNKut@^41ca~) zQ2_xF5g81KJAw$z=m0v5IF5?TyfVl*%#1>E`Ty$P?kuP?@AEzX?|Ht@raQN5JzJe~ z>eQ*0P(p|UA0n}j9-EYM?BUx5gnU@tBt8%AS5MEcEGIg=C>@6H=IOH*6q~CC z{T}r<2zlZ+GYV(V?|v)FN(jCZ*RUBy`Guc8{>%qxpNoQ?Gf-g9(3fHUk@y}vV|LY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q%rUT#3vyfD(?DFLD63FAwDwlJqlvfk>X7cz_f9t$S@#*4Y3!&TdoXr>3|oS z4yxOok`(X+{2-Js!|(OOo=Abv2d8*#qRTv%bjb~Y?!|Fa9>GV7&*%3h1(ITKMMCO4 zOYEmW$q#|+&B(}rj7UcaxRey!0SQE>WWaX9&lE_74B#WsE7OH!s2HdKV;EK~ez@{| zkWivag`t5G2=~Otjh6deR zx* Date: Fri, 21 Oct 2011 04:23:26 +0000 Subject: [PATCH 09/20] cleanup scons build flags, many duplicates because because of confusion between CFLAGS/CPPFLAGS/CCFLAGS/CXXFLAGS, devs would set multiple to be on the safe side. - defines go in CPPFLAGS - C & C++ flags go in CCFLAGS - CFLAGS / CXXFLAGS are C OR C++ only. also commented intended ghost unicode/ascii usage. --- SConstruct | 15 ++--------- .../buildbot/config/user-config-i686.py | 5 ++-- .../config/user-config-player-i686.py | 5 ++-- .../config/user-config-player-x86_64.py | 5 ++-- .../buildbot/config/user-config-x86_64.py | 5 ++-- build_files/scons/config/aix4-config.py | 14 +++++----- build_files/scons/config/darwin-config.py | 26 +++++++++---------- build_files/scons/config/freebsd7-config.py | 5 ++-- build_files/scons/config/freebsd8-config.py | 5 ++-- build_files/scons/config/freebsd9-config.py | 5 ++-- build_files/scons/config/linux-config.py | 5 ++-- build_files/scons/config/linuxcross-config.py | 5 ++-- build_files/scons/config/openbsd3-config.py | 5 ++-- build_files/scons/config/sunos5-config.py | 5 ++-- .../scons/config/win32-mingw-config.py | 5 ++-- build_files/scons/config/win32-vc-config.py | 4 +-- build_files/scons/config/win64-vc-config.py | 4 +-- intern/ghost/GHOST_Types.h | 11 ++++++++ 18 files changed, 73 insertions(+), 61 deletions(-) diff --git a/SConstruct b/SConstruct index 606cc33fb20..aeaef581145 100644 --- a/SConstruct +++ b/SConstruct @@ -30,7 +30,6 @@ # Then read all SConscripts and build # # TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds. -# TODO: cleanup CCFLAGS / CPPFLAGS use, often both are set when we only need one. import platform as pltfrm @@ -210,7 +209,7 @@ opts.Update(env) if sys.platform=='win32': if bitness==64: - env.Append(CFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally + env.Append(CPPFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally if not env['BF_FANCY']: B.bc.disable() @@ -283,22 +282,17 @@ if env['OURPLATFORM']=='darwin': if env['WITH_BF_OPENMP'] == 1: if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): env['CCFLAGS'].append('/openmp') - env['CPPFLAGS'].append('/openmp') else: if env['CC'].endswith('icc'): # to be able to handle CC=/opt/bla/icc case env.Append(LINKFLAGS=['-openmp', '-static-intel']) env['CCFLAGS'].append('-openmp') - env['CPPFLAGS'].append('-openmp') else: env.Append(CCFLAGS=['-fopenmp']) - env.Append(CPPFLAGS=['-fopenmp']) if env['WITH_GHOST_COCOA'] == True: - env.Append(CFLAGS=['-DGHOST_COCOA']) - env.Append(CPPFLAGS=['-DGHOST_COCOA']) + env.Append(CPPFLAGS=['-DGHOST_COCOA']) if env['USE_QTKIT'] == True: - env.Append(CFLAGS=['-DUSE_QTKIT']) env.Append(CPPFLAGS=['-DUSE_QTKIT']) #check for additional debug libnames @@ -330,20 +324,15 @@ if 'blendernogame' in B.targets: # disable elbeem (fluidsim) compilation? if env['BF_NO_ELBEEM'] == 1: env['CPPFLAGS'].append('-DDISABLE_ELBEEM') - env['CCFLAGS'].append('-DDISABLE_ELBEEM') if btools.ENDIAN == "big": env['CPPFLAGS'].append('-D__BIG_ENDIAN__') - env['CCFLAGS'].append('-D__BIG_ENDIAN__') else: env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__') - env['CCFLAGS'].append('-D__LITTLE_ENDIAN__') - # TODO, make optional env['CPPFLAGS'].append('-DWITH_AUDASPACE') -env['CCFLAGS'].append('-DWITH_AUDASPACE') # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir B.root_build_dir = env['BF_BUILDDIR'] diff --git a/build_files/buildbot/config/user-config-i686.py b/build_files/buildbot/config/user-config-i686.py index f2197a05501..080fd8d6123 100644 --- a/build_files/buildbot/config/user-config-i686.py +++ b/build_files/buildbot/config/user-config-i686.py @@ -94,6 +94,7 @@ WITH_BF_JACK = True # Compilation and optimization BF_DEBUG = False -REL_CFLAGS = ['-O2'] -REL_CCFLAGS = ['-O2'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] +REL_CCFLAGS = ['-O2'] # C & C++ PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib32'] diff --git a/build_files/buildbot/config/user-config-player-i686.py b/build_files/buildbot/config/user-config-player-i686.py index 99671ecc072..204732376fa 100644 --- a/build_files/buildbot/config/user-config-player-i686.py +++ b/build_files/buildbot/config/user-config-player-i686.py @@ -85,6 +85,7 @@ WITH_BF_JACK = True # Compilation and optimization BF_DEBUG = False -REL_CFLAGS = ['-O2'] -REL_CCFLAGS = ['-O2'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] +REL_CCFLAGS = ['-O2'] # C & C++ PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib32'] diff --git a/build_files/buildbot/config/user-config-player-x86_64.py b/build_files/buildbot/config/user-config-player-x86_64.py index a1ca38880eb..cc0ba209a44 100644 --- a/build_files/buildbot/config/user-config-player-x86_64.py +++ b/build_files/buildbot/config/user-config-player-x86_64.py @@ -85,6 +85,7 @@ WITH_BF_JACK = True # Compilation and optimization BF_DEBUG = False -REL_CFLAGS = ['-O2'] -REL_CCFLAGS = ['-O2'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] +REL_CCFLAGS = ['-O2'] # C & C++ PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib64'] diff --git a/build_files/buildbot/config/user-config-x86_64.py b/build_files/buildbot/config/user-config-x86_64.py index 93fe3ca2e5b..4698ffdce15 100644 --- a/build_files/buildbot/config/user-config-x86_64.py +++ b/build_files/buildbot/config/user-config-x86_64.py @@ -94,6 +94,7 @@ WITH_BF_JACK = True # Compilation and optimization BF_DEBUG = False -REL_CFLAGS = ['-O2'] -REL_CCFLAGS = ['-O2'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] +REL_CCFLAGS = ['-O2'] # C & C++ PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib64'] diff --git a/build_files/scons/config/aix4-config.py b/build_files/scons/config/aix4-config.py index f8b3e750e74..618190884ac 100644 --- a/build_files/scons/config/aix4-config.py +++ b/build_files/scons/config/aix4-config.py @@ -156,15 +156,17 @@ BF_OPENGL_LIB_STATIC = '${BF_OPENGL}/libGL.a ${BF_OPENGL}/libGLU.a ${BF_OPENGL}/ CC = 'gcc' CXX = 'g++' -CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ] +CCFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing'] -CPPFLAGS = [ '-DXP_UNIX', '-DWIN32', '-DFREE_WINDOWS' ] -CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ] -REL_CFLAGS = ['-DNDEBUG', '-O2' ] +CPPFLAGS = ['-DXP_UNIX', '-DWIN32', '-DFREE_WINDOWS'] +CXXFLAGS = [] + +REL_CFLAGS = [] +REL_CXXFLAGS = [] REL_CCFLAGS = ['-DNDEBUG', '-O2' ] -C_WARN = [ '-Wall' , '-Wno-char-subscripts', '-Wdeclaration-after-statement' ] -CC_WARN = [ '-Wall' ] +C_WARN = ['-Wall' , '-Wno-char-subscripts', '-Wdeclaration-after-statement'] +CC_WARN = ['-Wall'] diff --git a/build_files/scons/config/darwin-config.py b/build_files/scons/config/darwin-config.py index 0c132041d82..deb3d01febd 100644 --- a/build_files/scons/config/darwin-config.py +++ b/build_files/scons/config/darwin-config.py @@ -306,11 +306,11 @@ if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64': else: ARCH_FLAGS = ['-m32'] -CFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS +CFLAGS = [] +CXXFLAGS = [] +CCFLAGS = ['-pipe','-funsigned-char'] -CPPFLAGS = []+ARCH_FLAGS -CCFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS -CXXFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS +CPPFLAGS = list(ARCH_FLAGS) if WITH_GHOST_COCOA: PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS @@ -336,9 +336,8 @@ else: # some flags shuffling for different OS versions if MAC_MIN_VERS == '10.3': - CFLAGS = ['-fuse-cxa-atexit']+CFLAGS - CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS - PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit']+PLATFORM_LINKFLAGS + CCFLAGS = ['-fuse-cxa-atexit'] + CFLAGS + PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit'] + PLATFORM_LINKFLAGS LLIBS.append('crt3.o') if USE_SDK: @@ -349,19 +348,18 @@ if USE_SDK: #Intel Macs are CoreDuo and Up if MACOSX_ARCHITECTURE == 'i386' or MACOSX_ARCHITECTURE == 'x86_64': - REL_CFLAGS = ['-DNDEBUG', '-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mfpmath=sse'] + REL_CFLAGS = [] + REL_CXXFLAGS = [] REL_CCFLAGS = ['-DNDEBUG', '-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mfpmath=sse'] else: - CFLAGS = CFLAGS+['-fno-strict-aliasing'] - CCFLAGS = CCFLAGS+['-fno-strict-aliasing'] - CXXFLAGS = CXXFLAGS+['-fno-strict-aliasing'] - REL_CFLAGS = ['-DNDEBUG', '-O2'] + CCFLAGS += ['-fno-strict-aliasing'] + REL_CFLAGS = [] + REL_CXXFLAGS = [] REL_CCFLAGS = ['-DNDEBUG', '-O2'] # Intel 64bit Macs are Core2Duo and up if MACOSX_ARCHITECTURE == 'x86_64': - REL_CFLAGS = REL_CFLAGS+['-march=core2','-mssse3','-with-tune=core2','-enable-threads'] - REL_CCFLAGS = REL_CCFLAGS+['-march=core2','-mssse3','-with-tune=core2','-enable-threads'] + REL_CCFLAGS += ['-march=core2','-mssse3','-with-tune=core2','-enable-threads'] CC_WARN = ['-Wall'] C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes'] diff --git a/build_files/scons/config/freebsd7-config.py b/build_files/scons/config/freebsd7-config.py index fec7531b3c7..eb7d7c9de57 100644 --- a/build_files/scons/config/freebsd7-config.py +++ b/build_files/scons/config/freebsd7-config.py @@ -172,11 +172,12 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread'] CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE'] CPPFLAGS = [] -CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE'] +CXXFLAGS = [] if WITH_BF_FFMPEG: # libavutil needs UINT64_C() CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ] -REL_CFLAGS = ['-DNDEBUG', '-O2'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] REL_CCFLAGS = ['-DNDEBUG', '-O2'] ##BF_DEPEND = True ## diff --git a/build_files/scons/config/freebsd8-config.py b/build_files/scons/config/freebsd8-config.py index eea89bf24ff..451d22455e0 100644 --- a/build_files/scons/config/freebsd8-config.py +++ b/build_files/scons/config/freebsd8-config.py @@ -172,11 +172,12 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread'] CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE'] CPPFLAGS = [] -CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE'] +CXXFLAGS = [] if WITH_BF_FFMPEG: # libavutil needs UINT64_C() CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ] -REL_CFLAGS = ['-DNDEBUG', '-O2'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] REL_CCFLAGS = ['-DNDEBUG', '-O2'] ##BF_DEPEND = True ## diff --git a/build_files/scons/config/freebsd9-config.py b/build_files/scons/config/freebsd9-config.py index a63da6e35f9..2ce6ec7ce33 100644 --- a/build_files/scons/config/freebsd9-config.py +++ b/build_files/scons/config/freebsd9-config.py @@ -170,13 +170,14 @@ WITH_BF_RAYOPTIMIZATION = True BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread'] CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE'] +CXXFLAGS = [] CPPFLAGS = [] -CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE'] if WITH_BF_FFMPEG: # libavutil needs UINT64_C() CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ] -REL_CFLAGS = ['-DNDEBUG', '-O2'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] REL_CCFLAGS = ['-DNDEBUG', '-O2'] ##BF_DEPEND = True ## diff --git a/build_files/scons/config/linux-config.py b/build_files/scons/config/linux-config.py index 4bc64cb5f13..91f86ae7e80 100644 --- a/build_files/scons/config/linux-config.py +++ b/build_files/scons/config/linux-config.py @@ -199,15 +199,16 @@ CXX = 'g++' ## CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE'] +CXXFLAGS = [] CPPFLAGS = [] -CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE'] # g++ 4.6, only needed for bullet CXXFLAGS += ['-fpermissive'] if WITH_BF_FFMPEG: # libavutil needs UINT64_C() CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ] -REL_CFLAGS = ['-DNDEBUG', '-O2'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] REL_CCFLAGS = ['-DNDEBUG', '-O2'] ##BF_DEPEND = True ## diff --git a/build_files/scons/config/linuxcross-config.py b/build_files/scons/config/linuxcross-config.py index 070e18a5af0..f6f72cd32d5 100644 --- a/build_files/scons/config/linuxcross-config.py +++ b/build_files/scons/config/linuxcross-config.py @@ -170,10 +170,11 @@ WITH_BF_RAYOPTIMIZATION = True BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse'] CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ] +CXXFLAGS = [] CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE'] -CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ] -REL_CFLAGS = ['-DNDEBUG', '-O2'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] REL_CCFLAGS = ['-DNDEBUG', '-O2'] C_WARN = ['-Wall', '-Wstrict-prototypes', '-Wno-char-subscripts', '-Wdeclaration-after-statement'] diff --git a/build_files/scons/config/openbsd3-config.py b/build_files/scons/config/openbsd3-config.py index 83c515d52f3..34e727555a3 100644 --- a/build_files/scons/config/openbsd3-config.py +++ b/build_files/scons/config/openbsd3-config.py @@ -116,8 +116,9 @@ CFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing'] CPPFLAGS = [] CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing'] -CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing'] -REL_CFLAGS = ['-DNDEBUG', '-O2'] +CXXFLAGS = [] +REL_CFLAGS = [] +REL_CXXFLAGS = [] REL_CCFLAGS = ['-DNDEBUG', '-O2'] ##BF_DEPEND = True ## diff --git a/build_files/scons/config/sunos5-config.py b/build_files/scons/config/sunos5-config.py index 0cf78c9220f..74647fccca1 100644 --- a/build_files/scons/config/sunos5-config.py +++ b/build_files/scons/config/sunos5-config.py @@ -132,8 +132,9 @@ CXX = 'g++' CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing'] CPPFLAGS = ['-DSUN_OGL_NO_VERTEX_MACROS'] -CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing'] -REL_CFLAGS = ['-DNDEBUG', '-O2'] +CXXFLAGS = [] +REL_CFLAGS = [] +REL_CXXFLAGS = [] REL_CCFLAGS = ['-DNDEBUG', '-O2'] ##BF_DEPEND = True ## diff --git a/build_files/scons/config/win32-mingw-config.py b/build_files/scons/config/win32-mingw-config.py index 167ed502bf6..f210ab436b5 100644 --- a/build_files/scons/config/win32-mingw-config.py +++ b/build_files/scons/config/win32-mingw-config.py @@ -159,10 +159,11 @@ CC = 'gcc' CXX = 'g++' CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ] +CXXFLAGS = [] CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE'] -CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ] -REL_CFLAGS = ['-DNDEBUG', '-O2'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] REL_CCFLAGS = ['-DNDEBUG', '-O2'] C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes'] diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py index 9604eb5d320..ec37b3046c8 100644 --- a/build_files/scons/config/win32-vc-config.py +++ b/build_files/scons/config/win32-vc-config.py @@ -171,9 +171,9 @@ BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE'] BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr'] CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE'] -REL_CFLAGS = ['-O2', '-DNDEBUG'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] REL_CCFLAGS = ['-O2', '-DNDEBUG'] -REL_CXXFLAGS = ['-O2', '-DNDEBUG'] C_WARN = [] CC_WARN = [] diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py index 049b7eb5d40..afa64e03e80 100644 --- a/build_files/scons/config/win64-vc-config.py +++ b/build_files/scons/config/win64-vc-config.py @@ -175,9 +175,9 @@ BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast'] BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr', '/Od'] CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE'] -REL_CFLAGS = ['-O2', '-DNDEBUG'] +REL_CFLAGS = [] +REL_CXXFLAGS = [] REL_CCFLAGS = ['-O2', '-DNDEBUG'] -REL_CXXFLAGS = ['-O2', '-DNDEBUG'] C_WARN = [] CC_WARN = [] diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index 78fc3f69c7a..2b5e96a1bf7 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -466,8 +466,19 @@ typedef struct { typedef struct { /** The key code. */ GHOST_TKey key; + + /* ascii / utf8: both should always be set when possible, + * - ascii may be '\0' however if the user presses a non ascii key + * - unicode may not be set if the system has no unicode support + * + * These values are intended to be used as follows. + * For text input use unicode when available, fallback to ascii. + * For areas where unicode is not needed, number input for example, always + * use ascii, unicode is ignored - campbell. + */ /** The ascii code for the key event ('\0' if none). */ char ascii; + /** The unicode character. if the length is 6, not NULL terminated if all 6 are set */ char utf8_buf[6]; } GHOST_TEventKeyData; From 5efcf9bd1f187740744834b5334b3daf20697cf1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Oct 2011 04:26:48 +0000 Subject: [PATCH 10/20] remove scons files for unsupported/obscure unix variants, these configs are not maintained (aix defined FREE_WINDOWS for example and nobody noticed), and CMake builds on OpenBSD/NetBSD with no manual configuration. --- build_files/scons/config/aix4-config.py | 211 -------------------- build_files/scons/config/irix6-config.py | 0 build_files/scons/config/openbsd3-config.py | 149 -------------- build_files/scons/config/sunos5-config.py | 166 --------------- 4 files changed, 526 deletions(-) delete mode 100644 build_files/scons/config/aix4-config.py delete mode 100644 build_files/scons/config/irix6-config.py delete mode 100644 build_files/scons/config/openbsd3-config.py delete mode 100644 build_files/scons/config/sunos5-config.py diff --git a/build_files/scons/config/aix4-config.py b/build_files/scons/config/aix4-config.py deleted file mode 100644 index 618190884ac..00000000000 --- a/build_files/scons/config/aix4-config.py +++ /dev/null @@ -1,211 +0,0 @@ -import os - -LCGDIR = os.getcwd()+"/../lib/aix-4.3-ppc" -LIBDIR = LCGDIR -print LCGDIR - -WITH_BF_VERSE = 'false' -BF_VERSE_INCLUDE = "#extern/verse/dist" - -BF_PYTHON = LCGDIR+'/python' -BF_PYTHON_VERSION = '3.2' -WITH_BF_STATICPYTHON = 'true' -BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}' -BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}' -BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a' -BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic'] -BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}/config/libpython${BF_PYTHON_VERSION}.a' - -WITH_BF_OPENAL = 'false' -WITH_BF_STATICOPENAL = 'false' -BF_OPENAL = LCGDIR+'/openal' -BF_OPENAL_INC = '${BF_OPENAL}/include' -BF_OPENAL_LIB = 'openal' -BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a' -BF_OPENAL_LIBPATH = LIBDIR + '/lib' - -BF_CXX = '/usr' -WITH_BF_STATICCXX = 'false' -BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' - -WITH_BF_SDL = 'false' -BF_SDL = LCGDIR+'/sdl' #$(shell sdl-config --prefix) -BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags) -BF_SDL_LIB = 'SDL audio iconv charset' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer -BF_SDL_LIBPATH = '${BF_SDL}/lib' - -WITH_BF_OPENEXR = 'false' -WITH_BF_STATICOPENEXR = 'false' -BF_OPENEXR = '/usr' -# when compiling with your own openexr lib you might need to set... -# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include' - -BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR' -BF_OPENEXR_LIB = 'Half IlmImf Iex Imath ' -BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a' -# BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib' - - -WITH_BF_DDS = 'false' - -WITH_BF_JPEG = 'false' -BF_JPEG = LCGDIR+'/jpeg' -BF_JPEG_INC = '${BF_JPEG}/include' -BF_JPEG_LIB = 'jpeg' -BF_JPEG_LIBPATH = '${BF_JPEG}/lib' - -WITH_BF_PNG = 'false' -BF_PNG = LCGDIR+"/png" -BF_PNG_INC = '${BF_PNG}/include' -BF_PNG_LIB = 'png' -BF_PNG_LIBPATH = '${BF_PNG}/lib' - -BF_TIFF = '/usr/nekoware' -BF_TIFF_INC = '${BF_TIFF}/include' - -WITH_BF_ZLIB = 'true' -BF_ZLIB = LCGDIR+"/zlib" -BF_ZLIB_INC = '${BF_ZLIB}/include' -BF_ZLIB_LIB = 'z' -BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib' - -WITH_BF_INTERNATIONAL = 'false' - -BF_GETTEXT = LCGDIR+'/gettext' -BF_GETTEXT_INC = '${BF_GETTEXT}/include' -BF_GETTEXT_LIB = 'gettextpo intl' -BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' - -WITH_BF_GAMEENGINE='false' - -WITH_BF_BULLET = 'true' -BF_BULLET = '#extern/bullet2/src' -BF_BULLET_INC = '${BF_BULLET}' -BF_BULLET_LIB = 'extern_bullet' - -#WITH_BF_NSPR = 'true' -#BF_NSPR = $(LIBDIR)/nspr -#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr -#BF_NSPR_LIB = - -# Uncomment the following line to use Mozilla inplace of netscape -#CPPFLAGS += -DMOZ_NOT_NET -# Location of MOZILLA/Netscape header files... -#BF_MOZILLA = $(LIBDIR)/mozilla -#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl -#BF_MOZILLA_LIB = -# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB -# if this is not set. -# -# Be paranoid regarding library creation (do not update archives) -#BF_PARANOID = 'true' - -# enable freetype2 support for text objects -BF_FREETYPE = LCGDIR+'/freetype' -BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2' -BF_FREETYPE_LIB = 'freetype' -BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib' - -WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME -BF_QUICKTIME = '/usr/local' -BF_QUICKTIME_INC = '${BF_QUICKTIME}/include' - -WITH_BF_ICONV = 'false' -BF_ICONV = LIBDIR + "/iconv" -BF_ICONV_INC = '${BF_ICONV}/include' -BF_ICONV_LIB = 'iconv charset' -BF_ICONV_LIBPATH = '${BF_ICONV}/lib' - -WITH_BF_BINRELOC = 'false' - -# enable ffmpeg support -WITH_BF_FFMPEG = 'false' # -DWITH_FFMPEG -# Uncomment the following two lines to use system's ffmpeg -BF_FFMPEG = LCGDIR+'/ffmpeg' -BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice faad faac vorbis x264 ogg mp3lame z' -BF_FFMPEG_INC = '${BF_FFMPEG}/include' -BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib' - -# enable ogg, vorbis and theora in ffmpeg -WITH_BF_OGG = 'false' # -DWITH_OGG -BF_OGG = '/usr' -BF_OGG_INC = '${BF_OGG}/include' -BF_OGG_LIB = 'ogg vorbis theoraenc theoradec' - -WITH_BF_OPENJPEG = 'false' -BF_OPENJPEG = '#extern/libopenjpeg' -BF_OPENJPEG_LIB = '' -BF_OPENJPEG_INC = '${BF_OPENJPEG}' -BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib' - -WITH_BF_REDCODE = 'false' -BF_REDCODE = '#extern/libredcode' -BF_REDCODE_LIB = '' -BF_REDCODE_INC = '${BF_REDCODE}/include' -BF_REDCODE_LIBPATH='${BF_REDCODE}/lib' - -# Mesa Libs should go here if your using them as well.... -WITH_BF_STATICOPENGL = 'false' -BF_OPENGL = '/usr' -BF_OPENGL_INC = '${BF_OPENGL}/include' -BF_OPENGL_LIB = 'GL GLU X11 Xi Xext' -BF_OPENGL_LIBPATH = '/usr/X11R6/lib' -BF_OPENGL_LIB_STATIC = '${BF_OPENGL}/libGL.a ${BF_OPENGL}/libGLU.a ${BF_OPENGL}/libXxf86vm.a ${BF_OPENGL}/libX11.a ${BF_OPENGL}/libXi.a ${BF_OPENGL}/libXext.a ${BF_OPENGL}/libXxf86vm.a' - - -CC = 'gcc' -CXX = 'g++' - -CCFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing'] - -CPPFLAGS = ['-DXP_UNIX', '-DWIN32', '-DFREE_WINDOWS'] -CXXFLAGS = [] - -REL_CFLAGS = [] -REL_CXXFLAGS = [] -REL_CCFLAGS = ['-DNDEBUG', '-O2' ] - -C_WARN = ['-Wall' , '-Wno-char-subscripts', '-Wdeclaration-after-statement'] -CC_WARN = ['-Wall'] - - - -##BF_DEPEND = 'true' -## -##AR = ar -##ARFLAGS = ruv -##ARFLAGSQUIET = ru -## - -##FIX_STUBS_WARNINGS = -Wno-unused - -LLIBS = 'c m dl pthread dmedia movie' -##LOPTS = --dynamic -##DYNLDFLAGS = -shared $(LDFLAGS) - -BF_PROFILE_FLAGS = ['-pg','-g'] -BF_PROFILE = 'false' - -BF_DEBUG = 'false' -BF_DEBUG_CCFLAGS = ['-g'] - -BF_BUILDDIR = '../build/aix4' -BF_INSTALLDIR='../install/aix4' -BF_DOCDIR='../install/doc' - -#Link against pthread -LDIRS = [] -LDIRS.append(BF_FREETYPE_LIBPATH) -LDIRS.append(BF_PNG_LIBPATH) -LDIRS.append(BF_ZLIB_LIBPATH) -LDIRS.append(BF_SDL_LIBPATH) -LDIRS.append(BF_OPENAL_LIBPATH) -LDIRS.append(BF_ICONV_LIBPATH) - -PLATFORM_LINKFLAGS = [] -for x in LDIRS: - PLATFORM_LINKFLAGS.append("-L"+x) - -PLATFORM_LINKFLAGS += ['-L${LCGDIR}/jpeg/lib' , '-L/usr/lib32', '-n32', '-v', '-no_prelink'] -print PLATFORM_LINKFLAGS -LINKFLAGS= PLATFORM_LINKFLAGS diff --git a/build_files/scons/config/irix6-config.py b/build_files/scons/config/irix6-config.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/build_files/scons/config/openbsd3-config.py b/build_files/scons/config/openbsd3-config.py deleted file mode 100644 index 34e727555a3..00000000000 --- a/build_files/scons/config/openbsd3-config.py +++ /dev/null @@ -1,149 +0,0 @@ -LCGDIR = '../lib/openbsd3' -LIBDIR = '${LCGDIR}' - -BF_PYTHON = '/usr/local' -BF_PYTHON_VERSION = '3.2' -BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}' -BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}' -BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' -BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}/config' - -WITH_BF_OPENAL = False -# WITH_BF_STATICOPENAL = False -#BF_OPENAL = LIBDIR + '/openal' -#BF_OPENAL_INC = '${BF_OPENAL}/include' -#BF_OPENAL_LIB = 'openal' -#BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' -#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a' - -WITH_BF_SDL = True -BF_SDL = '/usr/local' #$(shell sdl-config --prefix) -BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags) -BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer -BF_SDL_LIBPATH = '${BF_SDL}/lib' - -WITH_BF_OPENEXR = False -WITH_BF_STATICOPENEXR = False -BF_OPENEXR = '/usr/local' -BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR' -BF_OPENEXR_LIB = 'Half IlmImf Iex Imath ' -# Warning, this static lib configuration is untested! users of this OS please confirm. -BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a' - -WITH_BF_DDS = True - -WITH_BF_JPEG = True -BF_JPEG = '/usr/local' -BF_JPEG_INC = '${BF_JPEG}/include' -BF_JPEG_LIB = 'jpeg' -BF_JPEG_LIBPATH = '${BF_JPEG}/lib' - -WITH_BF_PNG = True -BF_PNG = '/usr/local' -BF_PNG_INC = '${BF_PNG}/include/libpng' -BF_PNG_LIB = 'png' -BF_PNG_LIBPATH = '${BF_PNG}/lib' - -BF_TIFF = '/usr/local' -BF_TIFF_INC = '${BF_TIFF}/include' - -WITH_BF_ZLIB = True -BF_ZLIB = '/usr/local' -BF_ZLIB_INC = '${BF_ZLIB}/include' -BF_ZLIB_LIB = 'z' - -WITH_BF_INTERNATIONAL = True - -BF_GETTEXT = '/usr/local' -BF_GETTEXT_INC = '${BF_GETTEXT}/include' -BF_GETTEXT_LIB = 'intl iconv' -BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' - -WITH_BF_GAMEENGINE=False -WITH_BF_PLAYER = False - -WITH_BF_BULLET = True -BF_BULLET = '#extern/bullet2/src' -BF_BULLET_INC = '${BF_BULLET}' -BF_BULLET_LIB = 'extern_bullet' - -#WITH_BF_NSPR = True -#BF_NSPR = $(LIBDIR)/nspr -#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr -#BF_NSPR_LIB = - -# Uncomment the following line to use Mozilla inplace of netscape -#CPPFLAGS += -DMOZ_NOT_NET -# Location of MOZILLA/Netscape header files... -#BF_MOZILLA = $(LIBDIR)/mozilla -#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl -#BF_MOZILLA_LIB = -# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB -# if this is not set. -# -# Be paranoid regarding library creation (do not update archives) -#BF_PARANOID = True - -# enable freetype2 support for text objects -BF_FREETYPE = '/usr/X11R6' -BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2' -BF_FREETYPE_LIB = 'freetype' -BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib' - -WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME - -WITH_BF_ICONV = False -BF_ICONV = LIBDIR + "/iconv" -BF_ICONV_INC = '${BF_ICONV}/include' -BF_ICONV_LIB = 'iconv' -BF_ICONV_LIBPATH = '${BF_ICONV}/lib' - -# Mesa Libs should go here if your using them as well.... -WITH_BF_STATICOPENGL = True -BF_OPENGL = '/usr/X11R6' -BF_OPENGL_INC = '${BF_OPENGL}/include' -BF_OPENGL_LIB = 'GL GLU X11 Xi' -BF_OPENGL_LIBPATH = '${BF_OPENGL}/lib' -BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a' - -## -##CC = gcc -##CCC = g++ -##ifeq ($CPU),alpha) -## CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee - -CFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing'] - -CPPFLAGS = [] -CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing'] -CXXFLAGS = [] -REL_CFLAGS = [] -REL_CXXFLAGS = [] -REL_CCFLAGS = ['-DNDEBUG', '-O2'] -##BF_DEPEND = True -## -##AR = ar -##ARFLAGS = ruv -##ARFLAGSQUIET = ru -## -CC = 'gcc' -CXX = 'g++' -C_WARN = ['-Wdeclaration-after-statement', '-Wstrict-prototypes'] - -CC_WARN = ['-Wall'] - -##FIX_STUBS_WARNINGS = -Wno-unused - -LLIBS = ['m', 'stdc++', 'pthread', 'util'] -##LOPTS = --dynamic -##DYNLDFLAGS = -shared $(LDFLAGS) - -BF_PROFILE = False -BF_PROFILE_CCFLAGS = ['-pg','-g'] -BF_PROFILE_LINKFLAGS = ['-pg'] - -BF_DEBUG = False -BF_DEBUG_CCFLAGS = ['-g', '-D_DEBUG'] - -BF_BUILDDIR='../build/openbsd3' -BF_INSTALLDIR='../install/openbsd3' diff --git a/build_files/scons/config/sunos5-config.py b/build_files/scons/config/sunos5-config.py deleted file mode 100644 index 74647fccca1..00000000000 --- a/build_files/scons/config/sunos5-config.py +++ /dev/null @@ -1,166 +0,0 @@ -LCGDIR = '../lib/sunos5' -LIBDIR = '${LCGDIR}' - -BF_PYTHON = '/usr/local' -BF_PYTHON_VERSION = '3.2' -BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}' -BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}' -BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a' -BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic'] - -WITH_BF_OPENAL = True -WITH_BF_STATICOPENAL = False -BF_OPENAL = '/usr/local' -BF_OPENAL_INC = '${BF_OPENAL}/include' -BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' -BF_OPENAL_LIB = 'openal' -# Warning, this static lib configuration is untested! users of this OS please confirm. -BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a' - -# Warning, this static lib configuration is untested! users of this OS please confirm. -BF_CXX = '/usr' -WITH_BF_STATICCXX = False -BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' - -WITH_BF_SDL = True -BF_SDL = '/usr/local' #$(shell sdl-config --prefix) -BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags) -BF_SDL_LIBPATH = '${BF_SDL}/lib' -BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer - -WITH_BF_OPENEXR = True -WITH_BF_STATICOPENEXR = False -BF_OPENEXR = '/usr/local' -BF_OPENEXR_INC = ['${BF_OPENEXR}/include', '${BF_OPENEXR}/include/OpenEXR' ] -BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib' -BF_OPENEXR_LIB = 'Half IlmImf Iex Imath ' -# Warning, this static lib configuration is untested! users of this OS please confirm. -BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a' - -WITH_BF_DDS = True - -WITH_BF_JPEG = True -BF_JPEG = '/usr/local' -BF_JPEG_INC = '${BF_JPEG}/include' -BF_JPEG_LIBPATH = '${BF_JPEG}/lib' -BF_JPEG_LIB = 'jpeg' - -WITH_BF_PNG = True -BF_PNG = '/usr/local' -BF_PNG_INC = '${BF_PNG}/include' -BF_PNG_LIBPATH = '${BF_PNG}/lib' -BF_PNG_LIB = 'png' - -BF_TIFF = '/usr/local' -BF_TIFF_INC = '${BF_TIFF}/include' - -WITH_BF_ZLIB = True -BF_ZLIB = '/usr' -BF_ZLIB_INC = '${BF_ZLIB}/include' -BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib' -BF_ZLIB_LIB = 'z' - -WITH_BF_INTERNATIONAL = True - -BF_GETTEXT = '/usr/local' -BF_GETTEXT_INC = '${BF_GETTEXT}/include' -BF_GETTEXT_LIB = 'gettextlib' -BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' - -WITH_BF_GAMEENGINE=False -WITH_BF_PLAYER = False - -WITH_BF_BULLET = True -BF_BULLET = '#extern/bullet2/src' -BF_BULLET_INC = '${BF_BULLET}' -BF_BULLET_LIB = 'extern_bullet' - -#WITH_BF_NSPR = True -#BF_NSPR = $(LIBDIR)/nspr -#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr -#BF_NSPR_LIB = - -# Uncomment the following line to use Mozilla inplace of netscape -#CPPFLAGS += -DMOZ_NOT_NET -# Location of MOZILLA/Netscape header files... -#BF_MOZILLA = $(LIBDIR)/mozilla -#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl -#BF_MOZILLA_LIB = -# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB -# if this is not set. -# -# Be paranoid regarding library creation (do not update archives) -#BF_PARANOID = True - -# enable freetype2 support for text objects -BF_FREETYPE = '/usr/local' -BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2' -BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib' -BF_FREETYPE_LIB = 'freetype' - -WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME -BF_QUICKTIME = '/usr/local' -BF_QUICKTIME_INC = '${BF_QUICKTIME}/include' - -WITH_BF_ICONV = True -BF_ICONV = "/usr" -BF_ICONV_INC = '${BF_ICONV}/include' -BF_ICONV_LIB = 'iconv' -BF_ICONV_LIBPATH = '${BF_ICONV}/lib' - -# enable ffmpeg support -WITH_BF_FFMPEG = True # -DWITH_FFMPEG -BF_FFMPEG = '/usr/local' -BF_FFMPEG_INC = '${BF_FFMPEG}/include' -BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib' -BF_FFMPEG_LIB = 'avformat avcodec avutil avdevice' - -# Mesa Libs should go here if your using them as well.... -WITH_BF_STATICOPENGL = False -BF_OPENGL = '/usr/openwin' -BF_OPENGL_INC = '${BF_OPENGL}/include' -BF_OPENGL_LIB = 'GL GLU X11 Xi' -BF_OPENGL_LIBPATH = '${BF_OPENGL}/lib' -BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a' - -## -CC = 'gcc' -CXX = 'g++' -##ifeq ($CPU),alpha) -## CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee - -CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing'] - -CPPFLAGS = ['-DSUN_OGL_NO_VERTEX_MACROS'] -CXXFLAGS = [] -REL_CFLAGS = [] -REL_CXXFLAGS = [] -REL_CCFLAGS = ['-DNDEBUG', '-O2'] -##BF_DEPEND = True -## -##AR = ar -##ARFLAGS = ruv -##ARFLAGSQUIET = ru -## -C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement'] - -CC_WARN = ['-Wall'] - -##FIX_STUBS_WARNINGS = -Wno-unused - -LLIBS = ['c', 'm', 'dl', 'pthread', 'stdc++'] -##LOPTS = --dynamic -##DYNLDFLAGS = -shared $(LDFLAGS) - -BF_PROFILE_CCFLAGS = ['-pg', '-g '] -BF_PROFILE_LINKFLAGS = ['-pg'] -BF_PROFILE = False - -BF_DEBUG = False -BF_DEBUG_CCFLAGS = ['-D_DEBUG'] - -BF_BUILDDIR = '../build/sunos5' -BF_INSTALLDIR='../install/sunos5' - - -PLATFORM_LINKFLAGS = [] From c22a1721e5064fba84a50239e62d53aaefa23d37 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 21 Oct 2011 06:36:01 +0000 Subject: [PATCH 11/20] Bugfix [#28967] Attempting to add a new pose to the Pose Library causes Blender 2.60 RC2 to crash This commit just rolls back part of r.40868, which was causing crashes when trying to treat id-property-groups as bpy.type.Property to access a special "rna_type" attribute added as part of said commit. The underlying Py-API voodoo here is far too evil (along with the myriad of ways of creating custom props) to work out an API fix for, but at least we don't get anymore crashes now. In tests here, this check even seems redundant! --- release/scripts/startup/keyingsets_builtins.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py index c7922a0dfa1..0e31601a4d7 100644 --- a/release/scripts/startup/keyingsets_builtins.py +++ b/release/scripts/startup/keyingsets_builtins.py @@ -364,12 +364,16 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo): if prop == "_RNA_UI": continue - # for now, just add all of 'em + # only do props which are marked as animatable, or those which are "numeric" types... prop_rna = type(bone).bl_rna.properties.get(prop, None) if prop_rna is None: prop_path = '["%s"]' % prop - if bone.path_resolve(prop_path, False).rna_type in prop_type_compat: - ksi.addProp(ks, bone, prop_path) + + # XXX: the check below from r.40868 causes crashes [#28967] on ID-prop groups, + # so let's just include everything (doing nothing breaks keying of Sintel face rig) + #if bone.path_resolve(prop_path, False).rna_type in prop_type_compat: + # ksi.addProp(ks, bone, prop_path) + ksi.addProp(ks, bone, prop_path) elif prop_rna.is_animatable: ksi.addProp(ks, bone, prop) From f9f5daed9bb0b1f239b3b3d3de7e6ff95b56e3d2 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 21 Oct 2011 06:45:08 +0000 Subject: [PATCH 12/20] disabling utf8 for OSX. It's not working 100% and it's breaking other things --- intern/ghost/intern/GHOST_SystemCocoa.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 1dfb8e36422..c3c0c591444 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -1706,6 +1706,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr) utf8_buf[0] = '\0'; } } + + /* XXX the above code gives us the right utf8, however if we pass it along Font Object doesn't work. + let's leave utf8 disabled for OSX before we fix that */ + utf8_buf[0] = '\0';//to be removed once things are working if ((keyCode == GHOST_kKeyQ) && (m_modifierMask & NSCommandKeyMask)) break; //Cmd-Q is directly handled by Cocoa From 04db8ad282ec305ab61245b7556e15121d9cdcc5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Oct 2011 08:16:15 +0000 Subject: [PATCH 13/20] misc cleanup - remove redundant casts - replace strcmp's with "" to just check first char. - added WM_event_print(), debug mode only to print events since the structs values are not that meaningful. - added warnings if locale/font dirs cant be found. --- source/blender/blenfont/intern/blf_lang.c | 7 +- .../blender/blenfont/intern/blf_translation.c | 12 ++- source/blender/blenkernel/intern/key.c | 8 +- .../blender/blenkernel/intern/writeffmpeg.c | 11 +-- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/blenloader/intern/writefile.c | 5 +- .../editors/interface/interface_icons.c | 3 + .../editors/interface/interface_regions.c | 2 +- source/blender/makesrna/intern/makesrna.c | 96 +++++++++---------- source/blender/makesrna/intern/rna_access.c | 20 ++-- source/blender/makesrna/intern/rna_particle.c | 2 +- source/blender/windowmanager/WM_api.h | 3 + .../windowmanager/intern/wm_event_system.c | 33 +++++++ .../windowmanager/intern/wm_operators.c | 2 +- 14 files changed, 126 insertions(+), 80 deletions(-) diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index ec9501c06a6..d5245073e59 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -103,10 +103,13 @@ void BLF_lang_init(void) BLI_strncpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT, sizeof(global_encoding_name)); - if (messagepath) + if (messagepath) { BLI_strncpy(global_messagepath, messagepath, sizeof(global_messagepath)); - else + } + else { + printf("%s: 'locale' data path for translations not found, continuing\n", __func__); global_messagepath[0]= '\0'; + } } diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c index 8c0a26df4c2..90d9c4a5981 100644 --- a/source/blender/blenfont/intern/blf_translation.c +++ b/source/blender/blenfont/intern/blf_translation.c @@ -38,6 +38,7 @@ #include "MEM_guardedalloc.h" +#include "BLI_utildefines.h" #include "BLI_path_util.h" #include "BLI_string.h" #include "BLI_path_util.h" @@ -54,11 +55,16 @@ unsigned char *BLF_get_unifont(int *unifont_size_r) { if(unifont_ttf==NULL) { char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts"); - char unifont_path[1024]; + if (fontpath) { + char unifont_path[1024]; - BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename); + BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename); - unifont_ttf= (unsigned char*)BLI_ungzip_to_mem(unifont_path, &unifont_size); + unifont_ttf= (unsigned char*)BLI_ungzip_to_mem(unifont_path, &unifont_size); + } + else { + printf("%s: 'fonts' data path not found for international font, continuing\n", __func__); + } } *unifont_size_r= unifont_size; diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index 9e48e691b87..3baf8e04b90 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -1280,9 +1280,9 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int flag= setkeys(ctime, &key->block, k, t, 0); if(flag==0) - do_key(a, a+1, tot, (char *)out, key, actkb, k, t, KEY_MODE_DUMMY); + do_key(a, a+1, tot, out, key, actkb, k, t, KEY_MODE_DUMMY); else - cp_key(a, a+1, tot, (char *)out, key, actkb, k[2], NULL, KEY_MODE_DUMMY); + cp_key(a, a+1, tot, out, key, actkb, k[2], NULL, KEY_MODE_DUMMY); } } else { @@ -1292,7 +1292,7 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int for(kb= key->block.first; kb; kb= kb->next) kb->weights= get_weights_array(ob, kb->vgroup); - do_rel_key(0, tot, tot, (char *)out, key, actkb, KEY_MODE_DUMMY); + do_rel_key(0, tot, tot, out, key, actkb, KEY_MODE_DUMMY); for(kb= key->block.first; kb; kb= kb->next) { if(kb->weights) MEM_freeN(kb->weights); @@ -1386,7 +1386,7 @@ float *do_ob_key(Scene *scene, Object *ob) if(ELEM(ob->type, OB_MESH, OB_LATTICE)) { float *weights= get_weights_array(ob, kb->vgroup); - cp_key(0, tot, tot, (char*)out, key, actkb, kb, weights, 0); + cp_key(0, tot, tot, out, key, actkb, kb, weights, 0); if(weights) MEM_freeN(weights); } diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 58a2f45e876..7b414f7746a 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -407,8 +407,7 @@ static void set_ffmpeg_properties(RenderData *rd, AVCodecContext *c, const char return; } - prop = IDP_GetPropertyFromGroup( - rd->ffcodecdata.properties, (char*) prop_name); + prop = IDP_GetPropertyFromGroup(rd->ffcodecdata.properties, prop_name); if (!prop) { return; } @@ -1025,8 +1024,7 @@ void ffmpeg_property_del(RenderData *rd, void *type, void *prop_) return; } - group = IDP_GetPropertyFromGroup( - rd->ffcodecdata.properties, (char*) type); + group = IDP_GetPropertyFromGroup(rd->ffcodecdata.properties, type); if (group && prop) { IDP_RemFromGroup(group, prop); IDP_FreeProperty(prop); @@ -1057,11 +1055,10 @@ IDProperty *ffmpeg_property_add(RenderData *rd, char * type, int opt_index, int = IDP_New(IDP_GROUP, val, "ffmpeg"); } - group = IDP_GetPropertyFromGroup( - rd->ffcodecdata.properties, (char*) type); + group = IDP_GetPropertyFromGroup(rd->ffcodecdata.properties, type); if (!group) { - group = IDP_New(IDP_GROUP, val, (char*) type); + group = IDP_New(IDP_GROUP, val, type); IDP_AddToGroup(rd->ffcodecdata.properties, group); } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 667550bcaa0..3cf19df41a8 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3112,7 +3112,7 @@ static void direct_link_pointcache(FileData *fd, PointCache *cache) pm->data[i] = newdataadr(fd, pm->data[i]); /* the cache saves non-struct data without DNA */ - if(pm->data[i] && strcmp(ptcache_data_struct[i], "")==0 && (fd->flags & FD_FLAGS_SWITCH_ENDIAN)) { + if(pm->data[i] && ptcache_data_struct[i][0]=='\0' && (fd->flags & FD_FLAGS_SWITCH_ENDIAN)) { int j, tot= (BKE_ptcache_data_size (i) * pm->totpoint)/4; /* data_size returns bytes */ int *poin= pm->data[i]; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index c4f6e25f40b..8959a1ed017 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -872,7 +872,7 @@ static void write_pointcaches(WriteData *wd, ListBase *ptcaches) for(i=0; idata[i] && pm->data_types & (1<data[i]), pm->data[i]); else writestruct(wd, DATA, ptcache_data_struct[i], pm->totpoint, pm->data[i]); @@ -880,7 +880,7 @@ static void write_pointcaches(WriteData *wd, ListBase *ptcaches) } for(; extra; extra=extra->next) { - if(strcmp(ptcache_extra_struct[extra->type], "")==0) + if(ptcache_extra_struct[extra->type][0]=='\0') continue; writestruct(wd, DATA, "PTCacheExtra", 1, extra); writestruct(wd, DATA, ptcache_extra_struct[extra->type], extra->totdata, extra->data); @@ -2699,6 +2699,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL } } + userfilename[0]= '\0'; /* ensure its initialized */ BLI_make_file_string(G.main->name, userfilename, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_STARTUP_FILE); write_user_block= (BLI_path_cmp(filepath, userfilename) == 0); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 24434465f5f..c1418c5b6e8 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -525,6 +525,9 @@ static void init_internal_icons(void) bbuf= NULL; } } + else { + printf("%s: 'icons' data path not found, continuing\n", __func__); + } } if(bbuf==NULL) bbuf = IMB_ibImageFromMemory((unsigned char*)datatoc_blenderbuttons, datatoc_blenderbuttons_size, IB_rect); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index bc4e3cf9f13..4791d2652dc 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2370,7 +2370,7 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon) pup->block= uiBeginBlock(C, NULL, "uiPupMenuBegin", UI_EMBOSSP); pup->block->flag |= UI_BLOCK_POPUP_MEMORY; - pup->block->puphash= ui_popup_menu_hash((char*)title); + pup->block->puphash= ui_popup_menu_hash(title); pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style); uiLayoutSetOperatorContext(pup->layout, WM_OP_EXEC_REGION_WIN); diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index bb4d6d3a330..871cbad6152 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -544,9 +544,9 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop; rna_print_data_get(f, dp); if(dp->dnapointerlevel == 0) - fprintf(f, " return rna_pointer_inherit_refine(ptr, &RNA_%s, &data->%s);\n", (char*)pprop->type, dp->dnaname); + fprintf(f, " return rna_pointer_inherit_refine(ptr, &RNA_%s, &data->%s);\n", (const char*)pprop->type, dp->dnaname); else - fprintf(f, " return rna_pointer_inherit_refine(ptr, &RNA_%s, data->%s);\n", (char*)pprop->type, dp->dnaname); + fprintf(f, " return rna_pointer_inherit_refine(ptr, &RNA_%s, data->%s);\n", (const char*)pprop->type, dp->dnaname); } fprintf(f, "}\n\n"); break; @@ -560,7 +560,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr if(strcmp(manualfunc, "rna_iterator_listbase_get") == 0 || strcmp(manualfunc, "rna_iterator_array_get") == 0 || strcmp(manualfunc, "rna_iterator_array_dereference_get") == 0) - fprintf(f, " return rna_pointer_inherit_refine(&iter->parent, &RNA_%s, %s(iter));\n", (cprop->item_type)? (char*)cprop->item_type: "UnknownType", manualfunc); + fprintf(f, " return rna_pointer_inherit_refine(&iter->parent, &RNA_%s, %s(iter));\n", (cprop->item_type)? (const char*)cprop->item_type: "UnknownType", manualfunc); else fprintf(f, " return %s(iter);\n", manualfunc); } @@ -707,7 +707,7 @@ static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array) fprintf(f, "value;\n"); } -static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, char *manualfunc) +static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc) { char *func; @@ -771,7 +771,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr } else { PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop; - StructRNA *type= rna_find_struct((char*)pprop->type); + StructRNA *type= rna_find_struct((const char*)pprop->type); if(type && (type->flag & STRUCT_ID)) { fprintf(f, " if(value.data)\n"); fprintf(f, " id_lib_extern((ID*)value.data);\n\n"); @@ -883,7 +883,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr return func; } -static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, char *manualfunc) +static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc) { char *func= NULL; @@ -941,7 +941,7 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA return func; } -static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, char *manualfunc) +static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc) { char *func, *getfunc; @@ -999,7 +999,7 @@ static char *rna_def_property_begin_func(FILE *f, StructRNA *srna, PropertyRNA * return func; } -static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, char *manualfunc, char *nextfunc) +static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc, const char *nextfunc) { /* note on indices, this is for external functions and ignores skipped values. * so the the index can only be checked against the length when there is no 'skip' funcion. */ @@ -1078,7 +1078,7 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property #if 0 rna_print_data_get(f, dp); - item_type= (cprop->item_type)? (char*)cprop->item_type: "UnknownType"; + item_type= (cprop->item_type)? (const char*)cprop->item_type: "UnknownType"; if(dp->dnalengthname || dp->dnalengthfixed) { if(dp->dnalengthname) @@ -1099,7 +1099,7 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property return func; } -static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, char *manualfunc) +static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc) { char *func, *getfunc; @@ -1125,7 +1125,7 @@ static char *rna_def_property_next_func(FILE *f, StructRNA *srna, PropertyRNA *p return func; } -static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, char *manualfunc) +static char *rna_def_property_end_func(FILE *f, StructRNA *srna, PropertyRNA *prop, PropertyDefRNA *dp, const char *manualfunc) { char *func; @@ -1193,12 +1193,12 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) if(!bprop->get && !bprop->set && !dp->booleanbit) rna_set_raw_property(dp, prop); - bprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)bprop->get); - bprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)bprop->set); + bprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->get); + bprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->set); } else { - bprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)bprop->getarray); - bprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)bprop->setarray); + bprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->getarray); + bprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->setarray); } break; } @@ -1209,15 +1209,15 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) if(!iprop->get && !iprop->set) rna_set_raw_property(dp, prop); - iprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)iprop->get); - iprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)iprop->set); + iprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->get); + iprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->set); } else { if(!iprop->getarray && !iprop->setarray) rna_set_raw_property(dp, prop); - iprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)iprop->getarray); - iprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)iprop->setarray); + iprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->getarray); + iprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->setarray); } break; } @@ -1228,38 +1228,38 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) if(!fprop->get && !fprop->set) rna_set_raw_property(dp, prop); - fprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)fprop->get); - fprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)fprop->set); + fprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->get); + fprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->set); } else { if(!fprop->getarray && !fprop->setarray) rna_set_raw_property(dp, prop); - fprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)fprop->getarray); - fprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)fprop->setarray); + fprop->getarray= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->getarray); + fprop->setarray= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->setarray); } break; } case PROP_ENUM: { EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; - eprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)eprop->get); - eprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)eprop->set); + eprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)eprop->get); + eprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)eprop->set); break; } case PROP_STRING: { StringPropertyRNA *sprop= (StringPropertyRNA*)prop; - sprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)sprop->get); - sprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp, (char*)sprop->length); - sprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)sprop->set); + sprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)sprop->get); + sprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)sprop->length); + sprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)sprop->set); break; } case PROP_POINTER: { PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop; - pprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)pprop->get); - pprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (char*)pprop->set); + pprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)pprop->get); + pprop->set= (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)pprop->set); if(!pprop->type) { fprintf(stderr, "rna_def_property_funcs: %s.%s, pointer must have a struct type.\n", srna->identifier, prop->identifier); DefRNA.error= 1; @@ -1268,24 +1268,24 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) } case PROP_COLLECTION: { CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; - char *nextfunc= (char*)cprop->next; + const char *nextfunc= (const char*)cprop->next; if(dp->dnatype && strcmp(dp->dnatype, "ListBase")==0); else if(dp->dnalengthname || dp->dnalengthfixed) - cprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp, (char*)cprop->length); + cprop->length= (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)cprop->length); /* test if we can allow raw array access, if it is using our standard * array get/next function, we can be sure it is an actual array */ if(cprop->next && cprop->get) - if(strcmp((char*)cprop->next, "rna_iterator_array_next") == 0 && - strcmp((char*)cprop->get, "rna_iterator_array_get") == 0) + if(strcmp((const char*)cprop->next, "rna_iterator_array_next") == 0 && + strcmp((const char*)cprop->get, "rna_iterator_array_get") == 0) prop->flag |= PROP_RAW_ARRAY; - cprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (char*)cprop->get); - cprop->begin= (void*)rna_def_property_begin_func(f, srna, prop, dp, (char*)cprop->begin); - cprop->next= (void*)rna_def_property_next_func(f, srna, prop, dp, (char*)cprop->next); - cprop->end= (void*)rna_def_property_end_func(f, srna, prop, dp, (char*)cprop->end); - cprop->lookupint= (void*)rna_def_property_lookup_int_func(f, srna, prop, dp, (char*)cprop->lookupint, nextfunc); + cprop->get= (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)cprop->get); + cprop->begin= (void*)rna_def_property_begin_func(f, srna, prop, dp, (const char*)cprop->begin); + cprop->next= (void*)rna_def_property_next_func(f, srna, prop, dp, (const char*)cprop->next); + cprop->end= (void*)rna_def_property_end_func(f, srna, prop, dp, (const char*)cprop->end); + cprop->lookupint= (void*)rna_def_property_lookup_int_func(f, srna, prop, dp, (const char*)cprop->lookupint, nextfunc); if(!(prop->flag & PROP_IDPROPERTY)) { if(!cprop->begin) { @@ -1414,7 +1414,7 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property if(prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN)) return; - if(prop->name && prop->description && strcmp(prop->description, "") != 0) + if(prop->name && prop->description && prop->description[0] != '\0') fprintf(f, "\t/* %s: %s */\n", prop->name, prop->description); else if(prop->name) fprintf(f, "\t/* %s */\n", prop->name); @@ -1468,7 +1468,7 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop; if(pprop->type) - fprintf(f, "\tinline %s %s(void);", (char*)pprop->type, rna_safe_id(prop->identifier)); + fprintf(f, "\tinline %s %s(void);", (const char*)pprop->type, rna_safe_id(prop->identifier)); else fprintf(f, "\tinline %s %s(void);", "UnknownType", rna_safe_id(prop->identifier)); break; @@ -1477,7 +1477,7 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop; if(cprop->item_type) - fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (char*)cprop->item_type, srna->identifier, rna_safe_id(prop->identifier)); + fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (const char*)cprop->item_type, srna->identifier, rna_safe_id(prop->identifier)); else fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, rna_safe_id(prop->identifier)); break; @@ -1531,7 +1531,7 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe PointerPropertyRNA *pprop= (PointerPropertyRNA*)dp->prop; if(pprop->type) - fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", (char*)pprop->type, srna->identifier, rna_safe_id(prop->identifier)); + fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", (const char*)pprop->type, srna->identifier, rna_safe_id(prop->identifier)); else fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, rna_safe_id(prop->identifier)); break; @@ -1540,7 +1540,7 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe /*CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)dp->prop; if(cprop->type) - fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (char*)cprop->type, srna->identifier, prop->identifier); + fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (const char*)cprop->type, srna->identifier, prop->identifier); else fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, prop->identifier);*/ break; @@ -1763,7 +1763,7 @@ static void rna_auto_types(void) pprop->type= (StructRNA*)rna_find_type(dp->dnatype); if(pprop->type) { - type= rna_find_struct((char*)pprop->type); + type= rna_find_struct((const char*)pprop->type); if(type && (type->flag & STRUCT_ID_REFCOUNT)) pprop->property.flag |= PROP_ID_REFCOUNT; } @@ -2214,7 +2214,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr else fprintf(f, "\t0, -1"); /* our own type - collections/arrays only */ - if(prop->srna) fprintf(f, ", &RNA_%s", (char*)prop->srna); + if(prop->srna) fprintf(f, ", &RNA_%s", (const char*)prop->srna); else fprintf(f, ", NULL"); fprintf(f, "},\n"); @@ -2273,14 +2273,14 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr case PROP_POINTER: { PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s,", rna_function_string(pprop->get), rna_function_string(pprop->set), rna_function_string(pprop->typef), rna_function_string(pprop->poll)); - if(pprop->type) fprintf(f, "&RNA_%s\n", (char*)pprop->type); + if(pprop->type) fprintf(f, "&RNA_%s\n", (const char*)pprop->type); else fprintf(f, "NULL\n"); break; } case PROP_COLLECTION: { CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), rna_function_string(cprop->next), rna_function_string(cprop->end), rna_function_string(cprop->get), rna_function_string(cprop->length), rna_function_string(cprop->lookupint), rna_function_string(cprop->lookupstring), rna_function_string(cprop->assignint)); - if(cprop->item_type) fprintf(f, "&RNA_%s\n", (char*)cprop->item_type); + if(cprop->item_type) fprintf(f, "&RNA_%s\n", (const char*)cprop->item_type); else fprintf(f, "NULL\n"); break; } diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 8047b2df226..422ee6f31dc 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1614,7 +1614,7 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) group= RNA_struct_idprops(ptr, 1); if(group) - IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier)); + IDP_AddToGroup(group, IDP_New(IDP_INT, val, prop->identifier)); } } @@ -1693,7 +1693,7 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in group= RNA_struct_idprops(ptr, 1); if(group) { - idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier); + idprop= IDP_New(IDP_ARRAY, val, prop->identifier); IDP_AddToGroup(group, idprop); memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len); } @@ -1811,7 +1811,7 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value) group= RNA_struct_idprops(ptr, 1); if(group) - IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier)); + IDP_AddToGroup(group, IDP_New(IDP_INT, val, prop->identifier)); } } @@ -1927,7 +1927,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v group= RNA_struct_idprops(ptr, 1); if(group) { - idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier); + idprop= IDP_New(IDP_ARRAY, val, prop->identifier); IDP_AddToGroup(group, idprop); memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len); } @@ -2047,7 +2047,7 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value) group= RNA_struct_idprops(ptr, 1); if(group) - IDP_AddToGroup(group, IDP_New(IDP_FLOAT, val, (char*)prop->identifier)); + IDP_AddToGroup(group, IDP_New(IDP_FLOAT, val, prop->identifier)); } } @@ -2181,7 +2181,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa group= RNA_struct_idprops(ptr, 1); if(group) { - idprop= IDP_New(IDP_ARRAY, val, (char*)prop->identifier); + idprop= IDP_New(IDP_ARRAY, val, prop->identifier); IDP_AddToGroup(group, idprop); memcpy(IDP_Array(idprop), values, sizeof(float)*idprop->len); } @@ -2328,7 +2328,7 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val BLI_assert(RNA_property_type(prop) == PROP_STRING); if((idprop=rna_idproperty_check(&prop, ptr))) - IDP_AssignString(idprop, (char*)value, RNA_property_string_maxlength(prop) - 1); + IDP_AssignString(idprop, value, RNA_property_string_maxlength(prop) - 1); else if(sprop->set) sprop->set(ptr, value); /* set function needs to clamp its self */ else if(prop->flag & PROP_EDITABLE) { @@ -2336,7 +2336,7 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val group= RNA_struct_idprops(ptr, 1); if(group) - IDP_AddToGroup(group, IDP_NewString((char*)value, (char*)prop->identifier, RNA_property_string_maxlength(prop) - 1)); + IDP_AddToGroup(group, IDP_NewString(value, prop->identifier, RNA_property_string_maxlength(prop) - 1)); } } @@ -2413,7 +2413,7 @@ void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value) group= RNA_struct_idprops(ptr, 1); if(group) - IDP_AddToGroup(group, IDP_New(IDP_INT, val, (char*)prop->identifier)); + IDP_AddToGroup(group, IDP_New(IDP_INT, val, prop->identifier)); } } @@ -2509,7 +2509,7 @@ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop) group= RNA_struct_idprops(ptr, 1); if(group) - IDP_AddToGroup(group, IDP_New(IDP_GROUP, val, (char*)prop->identifier)); + IDP_AddToGroup(group, IDP_New(IDP_GROUP, val, prop->identifier)); } else printf("%s %s.%s: only supported for id properties.\n", __func__, ptr->type->identifier, prop->identifier); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 43d5f87f0d5..a1d156a2b2a 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -820,7 +820,7 @@ static void psys_vg_name_set__internal(PointerRNA *ptr, const char *value, int i psys->vgroup[index]= 0; } else { - int vgroup_num = defgroup_name_index(ob, (char*)value); + int vgroup_num = defgroup_name_index(ob, value); if(vgroup_num == -1) return; diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 9e19a057175..34f59ce047d 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -267,6 +267,9 @@ void WM_gestures_remove(struct bContext *C); /* fileselecting support */ void WM_event_add_fileselect(struct bContext *C, struct wmOperator *op); void WM_event_fileselect_event(struct bContext *C, void *ophandle, int eventval); +#ifndef NDEBUG +void WM_event_print(struct wmEvent *event); +#endif /* drag and drop */ struct wmDrag *WM_event_start_drag(struct bContext *C, int icon, int type, void *poin, double value); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 6fd84b4c315..e73440e5eb0 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -79,6 +79,10 @@ #include "wm_event_types.h" #include "wm_draw.h" +#ifndef NDEBUG +# include "RNA_enum_types.h" +#endif + static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA *properties, ReportList *reports, short context, short poll_only); /* ************ event management ************** */ @@ -435,6 +439,35 @@ static void wm_operator_print(bContext *C, wmOperator *op) MEM_freeN(buf); } +/* for debugging only, getting inspecting events manually is tedious */ +#ifndef NDEBUG + +void WM_event_print(wmEvent *event) +{ + if(event) { + const char *unknown= "UNKNOWN"; + const char *type_id= unknown; + const char *val_id= unknown; + + RNA_enum_identifier(event_type_items, event->type, &type_id); + RNA_enum_identifier(event_value_items, event->val, &val_id); + + printf("wmEvent - type:%d/%s, val:%d/%s, " + "shift:%d, ctrl:%d, alt:%d, oskey:%d, keymodifier:%d, " + "mouse:(%d,%d), ascii:'%c', utf8:'%.6s', " + "keymap_idname:%s, pointer:%p\n", + event->type, type_id, event->val, val_id, + event->shift, event->ctrl, event->alt, event->oskey, event->keymodifier, + event->x, event->y, event->ascii, event->utf8_buf, + event->keymap_idname, (void *)event); + } + else { + printf("wmEvent - NULL\n"); + } +} + +#endif /* NDEBUG */ + static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int popup) { if(popup) { diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 7a8d69e58a5..a06da3941af 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -678,7 +678,7 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) else { pup= uiPupMenuBegin(C, op->type->name, ICON_NONE); layout= uiPupMenuLayout(pup); - uiItemsFullEnumO(layout, op->type->idname, (char*)RNA_property_identifier(prop), op->ptr->data, WM_OP_EXEC_REGION_WIN, 0); + uiItemsFullEnumO(layout, op->type->idname, RNA_property_identifier(prop), op->ptr->data, WM_OP_EXEC_REGION_WIN, 0); uiPupMenuEnd(C, pup); } From 1a622354171ce930b3b0a8bfffe814279a4c125d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Oct 2011 08:31:28 +0000 Subject: [PATCH 14/20] svn merge -r41171:41170 . --- fix coming next --- release/scripts/startup/keyingsets_builtins.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py index 0e31601a4d7..c7922a0dfa1 100644 --- a/release/scripts/startup/keyingsets_builtins.py +++ b/release/scripts/startup/keyingsets_builtins.py @@ -364,16 +364,12 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo): if prop == "_RNA_UI": continue - # only do props which are marked as animatable, or those which are "numeric" types... + # for now, just add all of 'em prop_rna = type(bone).bl_rna.properties.get(prop, None) if prop_rna is None: prop_path = '["%s"]' % prop - - # XXX: the check below from r.40868 causes crashes [#28967] on ID-prop groups, - # so let's just include everything (doing nothing breaks keying of Sintel face rig) - #if bone.path_resolve(prop_path, False).rna_type in prop_type_compat: - # ksi.addProp(ks, bone, prop_path) - ksi.addProp(ks, bone, prop_path) + if bone.path_resolve(prop_path, False).rna_type in prop_type_compat: + ksi.addProp(ks, bone, prop_path) elif prop_rna.is_animatable: ksi.addProp(ks, bone, prop) From a35261cfee1e04bca3366e6967e046cdb00d3d44 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Oct 2011 09:04:40 +0000 Subject: [PATCH 15/20] fix [#28967] Attempting to add a new pose to the Pose Library causes Blender 2.60 RC2 to crash. --- source/blender/makesrna/intern/rna_access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 422ee6f31dc..149497c85fb 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2885,7 +2885,7 @@ int RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, Pointer BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); *r_ptr= *ptr; - return ((r_ptr->type = prop->srna) ? 1:0); + return ((r_ptr->type = rna_ensure_property(prop)->srna) ? 1:0); } int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, PropertyRNA *itemprop, RawArray *array) From 13fd777bc0a9acd50f75251ee4d40a50daec0476 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 21 Oct 2011 11:33:18 +0000 Subject: [PATCH 16/20] Fix compilation error with MSVC caused by recent commit. --- source/blender/blenfont/intern/blf_lang.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c index d5245073e59..87fbbc7b3e5 100644 --- a/source/blender/blenfont/intern/blf_lang.c +++ b/source/blender/blenfont/intern/blf_lang.c @@ -55,6 +55,7 @@ #include "BLI_linklist.h" /* linknode */ #include "BLI_string.h" +#include "BLI_utildefines.h" #include "BLI_path_util.h" #define DOMAIN_NAME "blender" From 4d48dbe5fd553ab149abd1f062eec08ae813060a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 21 Oct 2011 17:10:59 +0000 Subject: [PATCH 17/20] Code cleanup: remove some unused code in header. --- source/blender/makesrna/RNA_access.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 374b1d93444..1f45fe2646f 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -823,20 +823,6 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, char *RNA_path_from_ID_to_struct(PointerRNA *ptr); char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop); -#if 0 -/* Dependency - * - * Experimental code that will generate callbacks for each dependency - * between ID types. This may end up being useful for UI - * and evaluation code that needs to know such dependencies for correct - * redraws and re-evaluations. */ - -typedef void (*PropDependencyCallback)(void *udata, PointerRNA *from, PointerRNA *to); -void RNA_test_dependencies_cb(void *udata, PointerRNA *from, PointerRNA *to); - -void RNA_generate_dependencies(PointerRNA *mainptr, void *udata, PropDependencyCallback cb); -#endif - /* Quick name based property access * * These are just an easier way to access property values without having to From 00735ed9e49d2103e06b0e25513b5b880f0db226 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 21 Oct 2011 17:37:38 +0000 Subject: [PATCH 18/20] Code cleanup: don't use btempdir/bprogdir/bprogname globals anymore, but wrap in BLI_ functions. --- source/blender/blenkernel/intern/blender.c | 4 +- source/blender/blenkernel/intern/pointcache.c | 4 +- source/blender/blenlib/BLI_blenlib.h | 2 - source/blender/blenlib/BLI_path_util.h | 35 ++++----- source/blender/blenlib/intern/path_util.c | 72 ++++++++++++++++--- source/blender/editors/interface/resources.c | 2 +- source/blender/makesrna/intern/rna_userdef.c | 3 +- .../modifiers/intern/MOD_fluidsim_util.c | 2 +- source/blender/python/BPY_extern.h | 2 - source/blender/python/intern/bpy_app.c | 7 +- source/blender/python/intern/bpy_interface.c | 6 +- .../blender/render/intern/source/pipeline.c | 2 +- .../blender/windowmanager/intern/wm_files.c | 9 +-- .../windowmanager/intern/wm_operators.c | 2 +- .../bad_level_call_stubs/stubs.c | 1 - source/creator/creator.c | 18 ++--- .../gameengine/GamePlayer/ghost/GPG_ghost.cpp | 12 +--- 17 files changed, 104 insertions(+), 79 deletions(-) diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 5358a26e660..7a675dc64c3 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -549,7 +549,7 @@ void BKE_write_undo(bContext *C, const char *name) counter= counter % U.undosteps; BLI_snprintf(numstr, sizeof(numstr), "%d.blend", counter); - BLI_make_file_string("/", filepath, btempdir, numstr); + BLI_make_file_string("/", filepath, BLI_temporary_dir(), numstr); /* success= */ /* UNUSED */ BLO_write_file(CTX_data_main(C), filepath, fileflags, NULL, NULL); @@ -719,7 +719,7 @@ void BKE_undo_save_quit(void) /* no undo state to save */ if(undobase.first==undobase.last) return; - BLI_make_file_string("/", str, btempdir, "quit.blend"); + BLI_make_file_string("/", str, BLI_temporary_dir(), "quit.blend"); file = open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666); if(file == -1) { diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index bd5e5dc6049..f12e9698810 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -923,8 +923,8 @@ static int ptcache_path(PTCacheID *pid, char *filename) } /* use the temp path. this is weak but better then not using point cache at all */ - /* btempdir is assumed to exist and ALWAYS has a trailing slash */ - BLI_snprintf(filename, MAX_PTCACHE_PATH, "%s"PTCACHE_PATH"%d", btempdir, abs(getpid())); + /* temporary directory is assumed to exist and ALWAYS has a trailing slash */ + BLI_snprintf(filename, MAX_PTCACHE_PATH, "%s"PTCACHE_PATH"%d", BLI_temporary_dir(), abs(getpid())); return BLI_add_slash(filename); /* new strlen() */ } diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h index cda7a51c47f..4eb4b71da12 100644 --- a/source/blender/blenlib/BLI_blenlib.h +++ b/source/blender/blenlib/BLI_blenlib.h @@ -64,8 +64,6 @@ struct ListBase; #include -extern char btempdir[]; /* creator.c temp dir used instead of U.tempdir, set with BLI_where_is_temp( btempdir, 1 ); */ - #ifdef __cplusplus extern "C" { #endif diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 9ccdc37c353..56ecec042f2 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -181,29 +181,20 @@ void BLI_path_rel(char *file, const char *relfile); */ void BLI_char_switch(char *string, char from, char to); -/** - * Checks if name is a fully qualified filename to an executable. - * If not it searches $PATH for the file. On Windows it also - * adds the correct extension (.com .exe etc) from - * $PATHEXT if necessary. Also on Windows it translates - * the name to its 8.3 version to prevent problems with - * spaces and stuff. Final result is returned in fullname. - * - * @param fullname The full path and full name of the executable - * @param name The name of the executable (usually argv[0]) to be checked - */ -void BLI_where_am_i(char *fullname, const size_t maxlen, const char *name); - - /** - * Gets the temp directory when blender first runs. - * If the default path is not found, use try $TEMP - * - * Also make sure the temp dir has a trailing slash - * - * @param fullname The full path to the temp directory - */ -void BLI_where_is_temp(char *fullname, const size_t maxlen, int usertemp); + /* Initialize path to program executable */ +void BLI_init_program_path(const char *argv0); + /* Initialize path to temporary directory. + * NOTE: On Window userdir will be set to the temporary directory! */ +void BLI_init_temporary_dir(char *userdir); + /* Path to executable */ +const char *BLI_program_path(void); + /* Path to directory of executable */ +const char *BLI_program_dir(void); + /* Path to temporary directory (with trailing slash) */ +const char *BLI_temporary_dir(void); + /* Path to the system temporary directory (with trailing slash) */ +void BLI_system_temporary_dir(char *dir); #ifdef WITH_ICONV void BLI_string_to_utf8(char *original, char *utf_8, const char *code); diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index b338bfcbc50..f57ac09c9b9 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -41,7 +41,7 @@ #include "MEM_guardedalloc.h" -#include "DNA_userdef_types.h" +#include "DNA_listBase.h" #include "BLI_fileops.h" #include "BLI_path_util.h" @@ -87,8 +87,9 @@ /* local */ #define UNIQUE_NAME_MAX 128 -extern char bprogname[]; -extern char bprogdir[]; +static char bprogname[FILE_MAX]; /* path to program executable */ +static char bprogdir[FILE_MAX]; /* path in which executable is located */ +static char btempdir[FILE_MAX]; /* temporary directory */ static int add_win32_extension(char *name); static char *blender_version_decimal(const int ver); @@ -1670,8 +1671,19 @@ static int add_win32_extension(char *name) return (retval); } -/* filename must be FILE_MAX length minimum */ -void BLI_where_am_i(char *fullname, const size_t maxlen, const char *name) +/* +* Checks if name is a fully qualified filename to an executable. +* If not it searches $PATH for the file. On Windows it also +* adds the correct extension (.com .exe etc) from +* $PATHEXT if necessary. Also on Windows it translates +* the name to its 8.3 version to prevent problems with +* spaces and stuff. Final result is returned in fullname. +* +* @param fullname The full path and full name of the executable +* (must be FILE_MAX minimum) +* @param name The name of the executable (usually argv[0]) to be checked +*/ +static void bli_where_am_i(char *fullname, const size_t maxlen, const char *name) { char filename[FILE_MAXDIR+FILE_MAXFILE]; const char *path = NULL, *temp; @@ -1751,12 +1763,37 @@ void BLI_where_am_i(char *fullname, const size_t maxlen, const char *name) } } -void BLI_where_is_temp(char *fullname, const size_t maxlen, int usertemp) +void BLI_init_program_path(const char *argv0) +{ + bli_where_am_i(bprogname, sizeof(bprogname), argv0); + BLI_split_dir_part(bprogname, bprogdir, sizeof(bprogdir)); +} + +const char *BLI_program_path(void) +{ + return bprogname; +} + +const char *BLI_program_dir(void) +{ + return bprogdir; +} + +/** +* Gets the temp directory when blender first runs. +* If the default path is not found, use try $TEMP +* +* Also make sure the temp dir has a trailing slash +* +* @param fullname The full path to the temp directory +* @param userdir Directory specified in user preferences +*/ +void BLI_where_is_temp(char *fullname, const size_t maxlen, char *userdir) { fullname[0] = '\0'; - if (usertemp && BLI_is_dir(U.tempdir)) { - BLI_strncpy(fullname, U.tempdir, maxlen); + if (userdir && BLI_is_dir(userdir)) { + BLI_strncpy(fullname, userdir, maxlen); } @@ -1790,13 +1827,28 @@ void BLI_where_is_temp(char *fullname, const size_t maxlen, int usertemp) /* add a trailing slash if needed */ BLI_add_slash(fullname); #ifdef WIN32 - if(U.tempdir != fullname) { - BLI_strncpy(U.tempdir, fullname, maxlen); /* also set user pref to show %TEMP%. /tmp/ is just plain confusing for Windows users. */ + if(userdir != fullname) { + BLI_strncpy(userdir, fullname, maxlen); /* also set user pref to show %TEMP%. /tmp/ is just plain confusing for Windows users. */ } #endif } } +void BLI_init_temporary_dir(char *userdir) +{ + BLI_where_is_temp(btempdir, FILE_MAX, userdir); +} + +const char *BLI_temporary_dir(void) +{ + return btempdir; +} + +void BLI_system_temporary_dir(char *dir) +{ + BLI_where_is_temp(dir, FILE_MAX, NULL); +} + #ifdef WITH_ICONV void BLI_string_to_utf8(char *original, char *utf_8, const char *code) diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index fd511948bac..61936fba931 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1127,7 +1127,7 @@ void init_userdef_do_versions(void) } if(U.mixbufsize==0) U.mixbufsize= 2048; if (strcmp(U.tempdir, "/") == 0) { - BLI_where_is_temp(U.tempdir, sizeof(U.tempdir), FALSE); + BLI_system_temporary_dir(U.tempdir); } if (U.autokey_mode == 0) { /* 'add/replace' but not on */ diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index d579d00f6ce..c6a76cf42b9 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -295,8 +295,7 @@ static void rna_userdef_addon_remove(bAddon *bext) static void rna_userdef_temp_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) { - extern char btempdir[]; - BLI_where_is_temp(btempdir, FILE_MAX, 1); + BLI_init_temporary_dir(U.tempdir); } static void rna_userdef_text_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 277f0852f90..a2f62d55d69 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -105,7 +105,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd) /* elubie: changed this to default to the same dir as the render output to prevent saving to C:\ on Windows */ - BLI_strncpy(fss->surfdataPath, btempdir, FILE_MAX); + BLI_strncpy(fss->surfdataPath, BLI_temporary_dir(), FILE_MAX); // first init of bounding box // no bounding box needed diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index cd5c8e53ef7..ae82dac7f14 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -36,8 +36,6 @@ #ifndef BPY_EXTERN_H #define BPY_EXTERN_H -extern char bprogname[]; /* holds a copy of argv[0], from creator.c */ - struct Text; /* defined in DNA_text_types.h */ struct ID; /* DNA_ID.h */ struct Object; /* DNA_object_types.h */ diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index bd7be8dd9c5..c3d60bc353d 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -93,8 +93,6 @@ static PyStructSequence_Desc app_info_desc= { static PyObject *make_app_info(void) { - extern char bprogname[]; /* argv[0] from creator.c */ - PyObject *app_info; int pos= 0; @@ -118,7 +116,7 @@ static PyObject *make_app_info(void) SetStrItem(""); #endif SetStrItem(STRINGIFY(BLENDER_VERSION_CYCLE)); - SetStrItem(bprogname); + SetStrItem(BLI_program_path()); SetObjItem(PyBool_FromLong(G.background)); /* build info */ @@ -200,8 +198,7 @@ static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void static PyObject *bpy_app_tempdir_get(PyObject *UNUSED(self), void *UNUSED(closure)) { - extern char btempdir[]; - return PyC_UnicodeFromByte(btempdir); + return PyC_UnicodeFromByte(BLI_temporary_dir()); } static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(closure)) diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index ddbd557375c..90156a9cb3e 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -193,9 +193,9 @@ void BPY_python_start(int argc, const char **argv) PyThreadState *py_tstate= NULL; /* not essential but nice to set our name */ - static wchar_t bprogname_wchar[FILE_MAXDIR+FILE_MAXFILE]; /* python holds a reference */ - BLI_strncpy_wchar_from_utf8(bprogname_wchar, bprogname, sizeof(bprogname_wchar) / sizeof(wchar_t)); - Py_SetProgramName(bprogname_wchar); + static wchar_t program_path_wchar[FILE_MAXDIR+FILE_MAXFILE]; /* python holds a reference */ + BLI_strncpy_wchar_from_utf8(program_path_wchar, BLI_program_path(), sizeof(program_path_wchar) / sizeof(wchar_t)); + Py_SetProgramName(program_path_wchar); /* must run before python initializes */ PyImport_ExtendInittab(bpy_internal_modules); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 3db73816025..405779c360f 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -478,7 +478,7 @@ static void scene_unique_exr_name(Scene *scene, char *str, int sample) else BLI_snprintf(name, sizeof(name), "%s_%s%d.exr", fi, scene->id.name+2, sample); - BLI_make_file_string("/", str, btempdir, name); + BLI_make_file_string("/", str, BLI_temporary_dir(), name); } static void render_unique_exr_name(Render *re, char *str, int sample) diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 9b2d7026a46..4cd31b8d894 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -289,8 +289,9 @@ static void wm_init_userdef(bContext *C) if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC; else G.f &= ~G_SCRIPT_AUTOEXEC; } + /* update tempdir from user preferences */ - BLI_where_is_temp(btempdir, FILE_MAX, 1); + BLI_init_temporary_dir(U.tempdir); } @@ -856,14 +857,14 @@ void wm_autosave_location(char *filepath) * BLI_make_file_string will create string that has it most likely on C:\ * through get_default_root(). * If there is no C:\tmp autosave fails. */ - if (!BLI_exists(btempdir)) { + if (!BLI_exists(BLI_temporary_dir())) { savedir = BLI_get_folder_create(BLENDER_USER_AUTOSAVE, NULL); BLI_make_file_string("/", filepath, savedir, pidstr); return; } #endif - BLI_make_file_string("/", filepath, btempdir, pidstr); + BLI_make_file_string("/", filepath, BLI_temporary_dir(), pidstr); } void WM_autosave_init(wmWindowManager *wm) @@ -921,7 +922,7 @@ void wm_autosave_delete(void) if(BLI_exists(filename)) { char str[FILE_MAXDIR+FILE_MAXFILE]; - BLI_make_file_string("/", str, btempdir, "quit.blend"); + BLI_make_file_string("/", str, BLI_temporary_dir(), "quit.blend"); /* if global undo; remove tempsave, otherwise rename */ if(U.uiflag & USER_GLOBALUNDO) BLI_delete(filename, 0, 0); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index a06da3941af..5fee5fb2a57 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1807,7 +1807,7 @@ static int wm_recover_last_session_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_WINDOW, NULL); /* load file */ - BLI_make_file_string("/", filename, btempdir, "quit.blend"); + BLI_make_file_string("/", filename, BLI_temporary_dir(), "quit.blend"); WM_read_file(C, filename, op->reports); G.fileflags &= ~G_FILE_RECOVER; diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index fe53937ec5a..788b4e40eb2 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -129,7 +129,6 @@ struct RenderResult *RE_GetResult(struct Render *re){return (struct RenderResult struct Render *RE_GetRender(const char *name){return (struct Render *) NULL;} /* blenkernel */ -char btempdir[] = ""; void RE_FreeRenderResult(struct RenderResult *res){} struct RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty){return (struct RenderResult *) NULL;} void RE_GetResultImage(struct Render *re, struct RenderResult *rr){} diff --git a/source/creator/creator.c b/source/creator/creator.c index 24f2d22a029..cdbc21337e6 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -62,6 +62,7 @@ #include "DNA_ID.h" #include "DNA_scene_types.h" +#include "DNA_userdef_types.h" #include "BLI_blenlib.h" @@ -141,10 +142,6 @@ static int print_version(int argc, const char **argv, void *data); extern int pluginapi_force_ref(void); /* from blenpluginapi:pluginapi.c */ -char bprogname[FILE_MAX]; -char bprogdir[FILE_MAX]; -char btempdir[FILE_MAX]; - #define BLEND_VERSION_STRING_FMT "Blender %d.%02d (sub %d)\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION /* Initialize callbacks for the modules that need them */ @@ -1154,11 +1151,8 @@ int main(int argc, const char **argv) fpsetmask(0); #endif - // copy path to executable in bprogname. playanim and creting runtimes - // need this. - - BLI_where_am_i(bprogname, sizeof(bprogname), argv[0]); - BLI_split_dir_part(bprogname, bprogdir, sizeof(bprogdir)); + // initialize path to executable + BLI_init_program_path(argv[0]); BLI_threadapi_init(); @@ -1213,7 +1207,8 @@ int main(int argc, const char **argv) WM_init(C, argc, argv); /* this is properly initialized with user defs, but this is default */ - BLI_where_is_temp(btempdir, FILE_MAX, 1); /* call after loading the startup.blend so we can read U.tempdir */ + /* call after loading the startup.blend so we can read U.tempdir */ + BLI_init_temporary_dir(U.tempdir); #ifdef WITH_SDL BLI_setenv("SDL_VIDEODRIVER", "dummy"); @@ -1224,7 +1219,8 @@ int main(int argc, const char **argv) WM_init(C, argc, argv); - BLI_where_is_temp(btempdir, FILE_MAX, 0); /* call after loading the startup.blend so we can read U.tempdir */ + /* don't use user preferences temp dir */ + BLI_init_temporary_dir(NULL); } #ifdef WITH_PYTHON /** diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 78ea2aac8ce..f5439ba4f64 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -76,9 +76,6 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[]); -extern char bprogname[]; /* holds a copy of argv[0], from creator.c */ -extern char btempdir[]; /* use this to store a valid temp directory */ - // For BLF #include "BLF_api.h" #include "BLF_translation.h" @@ -116,9 +113,6 @@ extern char datatoc_bfont_ttf[]; const int kMinWindowWidth = 100; const int kMinWindowHeight = 100; -char bprogname[FILE_MAX]; -char bprogdir[FILE_MAX]; - static void mem_error_cb(const char *errorStr) { fprintf(stderr, "%s", errorStr); @@ -380,8 +374,8 @@ int main(int argc, char** argv) signal (SIGFPE, SIG_IGN); #endif /* __alpha__ */ #endif /* __linux__ */ - BLI_where_am_i(bprogname, sizeof(bprogname), argv[0]); - BLI_split_dir_part(bprogname, bprogdir, sizeof(bprogdir)); + BLI_init_program_path(argv[0]); + BLI_init_temporary_dir(NULL); #ifdef __APPLE__ // Can't use Carbon right now because of double defined type ID (In Carbon.h and DNA_ID.h, sigh) /* @@ -786,7 +780,7 @@ int main(int argc, char** argv) } else { - bfd = load_game_data(bprogname, filename[0]? filename: NULL); + bfd = load_game_data(BLI_program_path(), filename[0]? filename: NULL); } //::printf("game data loaded from %s\n", filename); From c9035e20d0033e897aaea9ed761002ec02331ce4 Mon Sep 17 00:00:00 2001 From: Alexander Kuznetsov Date: Fri, 21 Oct 2011 17:40:35 +0000 Subject: [PATCH 19/20] UTF8 input support for Windows. ToDo: * add support for dead keys * other input methods (for hieroglyphs) --- intern/ghost/intern/GHOST_SystemWin32.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 24b6474732e..99ce81165ad 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -712,21 +712,21 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP GHOST_SystemWin32 * system = (GHOST_SystemWin32 *)getSystem(); GHOST_TKey key = system->hardKey(window, raw, &keyDown, &vk); GHOST_EventKey* event; + if (key != GHOST_kKeyUnknown) { - char ascii = '\0'; + char utf8_char[6] = {0} ; - unsigned short utf16[2]={0}; + wchar_t utf16[2]={0}; BYTE state[256]; - GetKeyboardState((PBYTE)state); + GetKeyboardState((PBYTE)state); - if(ToAsciiEx(vk, 0, state, utf16, 0, system->m_keylayout)) - WideCharToMultiByte(CP_ACP, 0x00000400, + if(ToUnicodeEx(vk, 0, state, utf16, 2, 0, system->m_keylayout)) + WideCharToMultiByte(CP_UTF8, 0, (wchar_t*)utf16, 1, - (LPSTR) &ascii, 1, - NULL,NULL); - - /* TODO, last arg is utf8, need to pass utf8 arg */ - event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, ascii, NULL); + (LPSTR) utf8_char, 5, + NULL,NULL); else *utf8_char = 0; + + event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, (*utf8_char & 0x80)?'?':*utf8_char, utf8_char); #ifdef GHOST_DEBUG std::cout << ascii << std::endl; From 932aa116df985d21114dcad8c2518f69f8a6a39e Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 21 Oct 2011 19:09:14 +0000 Subject: [PATCH 20/20] utf8 OSX - disabling utf8 at KeyUp, otherwise TextObject doesn't work. This bug is also present in Windows, so I believe the real bug is in Linux (and in the text object input). Also Cmd+C and Cmd+v doesn't work for utf8 yet. --- intern/ghost/intern/GHOST_SystemCocoa.mm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index c3c0c591444..1a6aaadb506 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -1707,10 +1707,6 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr) } } - /* XXX the above code gives us the right utf8, however if we pass it along Font Object doesn't work. - let's leave utf8 disabled for OSX before we fix that */ - utf8_buf[0] = '\0';//to be removed once things are working - if ((keyCode == GHOST_kKeyQ) && (m_modifierMask & NSCommandKeyMask)) break; //Cmd-Q is directly handled by Cocoa @@ -1718,8 +1714,10 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr) pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii, utf8_buf) ); //printf("Key down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf); } else { + // XXX Font Object bug - backspace or adding new chars are being computed twice (keydown and keyup) + utf8_buf[0] = '\0'; pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, ascii, utf8_buf) ); - //printf("Key down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf); + //printf("Key up rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf); } break;