diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-08-01 22:12:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-08-01 22:12:47 +0400 |
commit | b7ad6b4437c3978ab354e34c0763051914f5493e (patch) | |
tree | 97f296fbea9d268766c6b521e0359fc006caef9f | |
parent | 567e0621029c55747c63b0ea39111913ad5ff126 (diff) |
Minor changes, sync with master
18 files changed, 44 insertions, 47 deletions
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 5cbe4080627..6d948b2135f 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -469,10 +469,10 @@ processEvents( * ghost events and call base class pushEvent() method. */ bool anyProcessed = false; - + do { GHOST_TimerManager *timerMgr = getTimerManager(); - + if (waitForEvent && m_dirty_windows.empty() && !XPending(m_display)) { GHOST_TUns64 next = timerMgr->nextFireTime(); @@ -486,11 +486,11 @@ processEvents( SleepTillEvent(m_display, next - getMilliSeconds()); } } - + if (timerMgr->fireTimers(getMilliSeconds())) { anyProcessed = true; } - + while (XPending(m_display)) { XEvent xevent; XNextEvent(m_display, &xevent); @@ -525,14 +525,13 @@ processEvents( continue; } #endif - /* when using autorepeat, some keypress events can actually come -after- the + /* when using autorepeat, some keypress events can actually come *after* the * last keyrelease. The next code takes care of that */ if (xevent.type == KeyRelease) { m_last_release_keycode = xevent.xkey.keycode; m_last_release_time = xevent.xkey.time; } - - if (xevent.type == KeyPress) { + else if (xevent.type == KeyPress) { if ((xevent.xkey.keycode == m_last_release_keycode) && ((xevent.xkey.time <= m_last_release_time))) continue; } @@ -805,7 +804,7 @@ GHOST_SystemX11::processEvent(XEvent *xe) gkey = convertXKey(key_sym); - GHOST_TEventType type = (xke->type == KeyPress) ? + GHOST_TEventType type = (xke->type == KeyPress) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp; if (!XLookupString(xke, &ascii, 1, NULL, NULL)) { diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h index f6191aa85dc..a21300e36f0 100644 --- a/intern/ghost/intern/GHOST_SystemX11.h +++ b/intern/ghost/intern/GHOST_SystemX11.h @@ -356,6 +356,7 @@ private: * and stop accumulating all events generated before that */ Time m_last_warp; + /* detect autorepeat glitch */ unsigned int m_last_release_keycode; Time m_last_release_time; diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index c42ab6e25f2..15e482a5e63 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -526,7 +526,7 @@ class WM_OT_context_menu_enum(Operator): layout.prop(value_base, prop_string, expand=True) context.window_manager.popup_menu(draw_func=draw_cb, title=prop.name, icon=prop.icon) - + return {'FINISHED'} diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 6cdd8c456d3..53de1dc50fd 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1773,10 +1773,6 @@ class VIEW3D_PT_tools_grease_pencil(GreasePencilPanel, Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'TOOLS' bl_category = "Grease Pencil" - - @classmethod - def poll(cls, context): - return (context.sculpt_object and context.tool_settings.sculpt) if __name__ == "__main__": # only for live edit. diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 1e68de0cf66..9abe89045af 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1183,9 +1183,7 @@ void uiEndBlock_ex(const bContext *C, uiBlock *block, const int xy[2]) if (block->layouts.first) { uiBlockLayoutResolve(block, NULL, NULL); } - ui_block_do_align(block); - if ((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) { ui_menu_block_set_keyaccels(block); /* could use a different flag to check */ } @@ -3075,7 +3073,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str, but->drawflag |= (UI_BUT_TEXT_LEFT | UI_BUT_ICON_LEFT); } else if ((block->flag & UI_BLOCK_LOOP) || - ELEM(but->type, MENU, TEX, LABEL, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR, SEARCH_MENU_UNLINK)) + ELEM(but->type, MENU, TEX, LABEL, BLOCK, BUTM, SEARCH_MENU, PROGRESSBAR, SEARCH_MENU_UNLINK)) { but->drawflag |= (UI_BUT_TEXT_LEFT | UI_BUT_ICON_LEFT); } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index bb5872f2262..125c07cff49 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -6589,7 +6589,6 @@ static bool ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y) { uiBlock *block = but->block; float mx, my; - if (!ui_mouse_inside_region(ar, x, y)) return false; @@ -8516,8 +8515,10 @@ static int ui_handle_menu_return_submenu(bContext *C, const wmEvent *event, uiPo } return WM_UI_HANDLER_CONTINUE; - } else + } + else { return WM_UI_HANDLER_BREAK; + } } static bool ui_pie_menu_supported_apply(uiBut *but) { @@ -9107,7 +9108,6 @@ void UI_add_popup_handlers(bContext *C, ListBase *handlers, uiPopupBlockHandle * WM_event_add_ui_handler(C, handlers, ui_handler_popup, ui_handler_remove_popup, popup, accept_dbl_click); } - void UI_remove_popup_handlers(ListBase *handlers, uiPopupBlockHandle *popup) { WM_event_remove_ui_handler(handlers, ui_handler_popup, ui_handler_remove_popup, popup, false); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 6b101aa1f6c..71219c8033e 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -132,7 +132,7 @@ typedef enum RadialDirection { UI_RADIAL_S = 5, UI_RADIAL_SW = 6, UI_RADIAL_W = 7, - UI_RADIAL_NW = 8 + UI_RADIAL_NW = 8, } RadialDirection; extern const char ui_radial_dir_to_num[8]; @@ -161,13 +161,15 @@ extern const char ui_radial_dir_to_num[8]; #define USE_NUMBUTS_LR_ALIGN /* PieMenuData->flags */ -#define UI_PIE_DEGREES_RANGE_LARGE (1 << 0) /* pie menu item collision is detected at 90 degrees */ -#define UI_PIE_INITIAL_DIRECTION (1 << 1) /* use initial center of pie menu to calculate direction */ -#define UI_PIE_3_ITEMS (1 << 2) /* pie menu has only 3 items, careful when centering */ -#define UI_PIE_INVALID_DIR (1 << 3) /* mouse not far enough from center position */ -#define UI_PIE_FINISHED (1 << 4) /* pie menu finished but we still wait for a release event */ -#define UI_PIE_CLICK_STYLE (1 << 5) /* pie menu changed to click style, click to confirm */ -#define UI_PIE_ANIMATION_FINISHED (1 << 6) /* pie animation finished, do not calculate any more motio */ +enum { + UI_PIE_DEGREES_RANGE_LARGE = (1 << 0), /* pie menu item collision is detected at 90 degrees */ + UI_PIE_INITIAL_DIRECTION = (1 << 1), /* use initial center of pie menu to calculate direction */ + UI_PIE_3_ITEMS = (1 << 2), /* pie menu has only 3 items, careful when centering */ + UI_PIE_INVALID_DIR = (1 << 3), /* mouse not far enough from center position */ + UI_PIE_FINISHED = (1 << 4), /* pie menu finished but we still wait for a release event */ + UI_PIE_CLICK_STYLE = (1 << 5), /* pie menu changed to click style, click to confirm */ + UI_PIE_ANIMATION_FINISHED = (1 << 6), /* pie animation finished, do not calculate any more motio */ +}; #define PIE_CLICK_THRESHOLD 50.0f diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 895211a3c93..21a676cd32e 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -884,8 +884,8 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname PointerRNA ptr; PropertyRNA *prop; uiBlock *block = layout->root->block; - bool radial = (layout->item.type == ITEM_LAYOUT_RADIAL) || - ((layout->item.type == ITEM_LAYOUT_ROOT) && (layout->root->type == UI_LAYOUT_PIEMENU)); + const bool radial = (layout->item.type == ITEM_LAYOUT_RADIAL) || + ((layout->item.type == ITEM_LAYOUT_ROOT) && (layout->root->type == UI_LAYOUT_PIEMENU)); if (!ot || !ot->srna) { ui_item_disabled(layout, opname); @@ -2112,7 +2112,7 @@ static void ui_litem_layout_column(uiLayout *litem) /* calculates the angle of a specified button in a radial menu, * stores a float vector in unit circle */ -static RadialDirection ui_get_radialbut_vec(float *vec, short itemnum) +static RadialDirection ui_get_radialbut_vec(float vec[2], short itemnum) { float angle = 0.0f; RadialDirection dir = UI_RADIAL_NONE; diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index ae14fb3acff..5f60acc630c 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1569,7 +1569,7 @@ static void ui_popup_block_clip(wmWindow *window, uiBlock *block) block->rect.xmin += xofs; block->rect.xmax += xofs; } - + if (block->rect.ymin < width) block->rect.ymin = width; if (block->rect.ymax > winy - MENU_TOP) @@ -2640,6 +2640,7 @@ uiLayout *uiPupMenuLayout(uiPopupMenu *pup) } /*************************** Pie Menus ***************************************/ + static uiBlock *ui_block_func_PIE(bContext *UNUSED(C), uiPopupBlockHandle *handle, void *arg_pie) { uiBlock *block; @@ -2672,8 +2673,8 @@ static uiBlock *ui_block_func_PIE(bContext *UNUSED(C), uiPopupBlockHandle *handl static float uiPieTitleWidth(const char *name, int icon) { - return UI_GetStringWidth(name) + - (UI_UNIT_X * (1.50f + (icon ? 0.25f : 0.0f))); + return (UI_GetStringWidth(name) + + (UI_UNIT_X * (1.50f + (icon ? 0.25f : 0.0f)))); } struct uiPieMenu *uiPieMenuBegin(struct bContext *C, const char *title, int icon, const wmEvent *event) diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index fbd8522f176..6682203c3fb 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -210,7 +210,7 @@ void ED_operatormacros_mesh(void) { wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - + ot = WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", "Cut mesh loop and slide it", OPTYPE_UNDO | OPTYPE_REGISTER); WM_operatortype_macro_define(ot, "MESH_OT_loopcut"); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 9ae6408e42e..f38a9be5a04 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -333,7 +333,7 @@ void view3d_keymap(wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_RIGHT); RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD4, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPLEFT); WM_keymap_add_item(keymap, "VIEW3D_OT_view_persportho", PAD5, KM_PRESS, 0, 0); - + RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD6, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPRIGHT); RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_TOP); RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD8, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPUP); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index fa9b235a4c5..8147e6f8a55 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1342,7 +1342,7 @@ void RNA_property_enum_items_gettexted_all(bContext *C, PointerRNA *ptr, Propert /* items that do not exist on list are returned, but have their names/identifiers NULLed out */ for (i_fixed = 0; item[i_fixed].identifier; i_fixed++) { - if (strcmp(item[i_fixed].identifier, (*r_item)[i].identifier) == 0) { + if (STREQ(item[i_fixed].identifier, (*r_item)[i].identifier)) { exists = true; break; } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index a6ab0dda887..fdcbfb2c876 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -368,7 +368,6 @@ static void rna_Space_transform_manipulators_update(Main *UNUSED(bmain), Scene * v3d->twflag |= V3D_USE_MANIPULATOR; } - static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr) { Scene *scene = ((bScreen *)ptr->id.data)->scene; @@ -677,7 +676,7 @@ static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C } static EnumPropertyItem *rna_SpaceView3D_viewport_shade_pie_itemf(bContext *UNUSED(C), PointerRNA *ptr, - PropertyRNA *UNUSED(prop), bool *r_free) + PropertyRNA *UNUSED(prop), bool *r_free) { Scene *scene = ((bScreen *)ptr->id.data)->scene; RenderEngineType *type = RE_engines_find(scene->r.engine); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index f5d459adbff..184b2088bea 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -3157,7 +3157,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) "Direct conversion of frame numbers to seconds"}, {0, NULL, 0, NULL, NULL} }; - + PropertyRNA *prop; StructRNA *srna; diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 62bedf6a00f..5e98307dd27 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -272,15 +272,15 @@ bool WM_operator_last_properties_store(struct wmOperator *op); /* call operator or call custom pie menu */ struct PointerRNA *WM_operator_pie_macro(const char *idname, const char *name, const char *description, - int flag, const char *opname, const char *piename); + int flag, const char *opname, const char *piename); /* call operator or call pie menu from expanded operator enum property */ struct PointerRNA *WM_operator_property_pie_macro(const char *idname, const char *name, const char *description, - int flag, const char *piename, const char *opname, const char *propname); + int flag, const char *piename, const char *opname, const char *propname); /* call operator or call pie menu from expanded enum path property */ struct PointerRNA *WM_operator_enum_pie_macro(const char *idname, const char *name, const char *description, - int flag, const char *piename, const char *opname, const char *path); + int flag, const char *piename, const char *opname, const char *path); /* MOVE THIS SOMEWHERE ELSE */ #define SEL_TOGGLE 0 #define SEL_SELECT 1 diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h index c6095494332..8f3b4dbb8e6 100644 --- a/source/blender/windowmanager/WM_keymap.h +++ b/source/blender/windowmanager/WM_keymap.h @@ -64,7 +64,7 @@ wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, const char *idname, in int val, int modifier, int keymodifier); wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier); -wmKeyMapItem *WM_keymap_add_pie_menu(struct wmKeyMap *keymap, const char *idname, int type, +wmKeyMapItem *WM_keymap_add_menu_pie(struct wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier, bool force_click); bool WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 46a897a4351..163cc84b338 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -271,6 +271,7 @@ void wm_event_do_notifiers(bContext *C) /* free popup handlers only [#35434] */ UI_remove_popup_handlers_all(C, &win->modalhandlers); + ED_screen_set(C, note->reference); // XXX hrms, think this over! if (G.debug & G_DEBUG_EVENTS) printf("%s: screen set %p\n", __func__, note->reference); @@ -3450,7 +3451,7 @@ bool WM_event_is_tablet(const struct wmEvent *event) PointerRNA *WM_operator_pie_macro(const char *idname, const char *name, const char *description, - int flag, const char *opname, const char *piename) + int flag, const char *opname, const char *piename) { wmOperatorType *ot; wmOperatorTypeMacro *otmacro; @@ -3469,7 +3470,7 @@ PointerRNA *WM_operator_pie_macro(const char *idname, const char *name, const ch struct PointerRNA *WM_operator_property_pie_macro(const char *idname, const char *name, const char *description, - int flag, const char *piename, const char *opname, const char *propname) + int flag, const char *piename, const char *opname, const char *propname) { wmOperatorType *ot; wmOperatorTypeMacro *otmacro; @@ -3492,7 +3493,7 @@ struct PointerRNA *WM_operator_property_pie_macro(const char *idname, const char /* call operator or call pie menu from expanded enum path property */ struct PointerRNA *WM_operator_enum_pie_macro(const char *idname, const char *name, const char *description, - int flag, const char *piename, const char *opname, const char *path) + int flag, const char *piename, const char *opname, const char *path) { wmOperatorType *ot; wmOperatorTypeMacro *otmacro; diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index ad5e3495f81..e7bdce92122 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -464,7 +464,7 @@ wmKeyMapItem *WM_keymap_add_menu(wmKeyMap *keymap, const char *idname, int type, return kmi; } -wmKeyMapItem *WM_keymap_add_pie_menu(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier, bool force_click) +wmKeyMapItem *WM_keymap_add_menu_pie(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier, bool force_click) { wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_menu_pie", type, val, modifier, keymodifier); RNA_string_set(kmi->ptr, "name", idname); |