Cleanup: remove unused test break code for handling cancels.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 8 Mar 2019 01:15:24 +0000 (02:15 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 8 Mar 2019 09:24:59 +0000 (10:24 +0100)
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/intern/blender.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm_window.h

index 6659bcc649be77cbbd21f89ac40cd54e9dd2ebab..1becd3ed0863aa334215c1bd405d0f93f1334526 100644 (file)
@@ -48,10 +48,6 @@ void BKE_blender_userdef_app_template_data_set_and_free(struct UserDef *userdef)
 
 void BKE_blender_userdef_data_free(struct UserDef *userdef, bool clear_fonts);
 
 
 void BKE_blender_userdef_data_free(struct UserDef *userdef, bool clear_fonts);
 
-/* set this callback when a UI is running */
-void BKE_blender_callback_test_break_set(void (*func)(void));
-int  BKE_blender_test_break(void);
-
 /* Blenders' own atexit (avoids leaking) */
 void BKE_blender_atexit_register(void (*func)(void *user_data), void *user_data);
 void BKE_blender_atexit_unregister(void (*func)(void *user_data), const void *user_data);
 /* Blenders' own atexit (avoids leaking) */
 void BKE_blender_atexit_register(void (*func)(void *user_data), void *user_data);
 void BKE_blender_atexit_unregister(void (*func)(void *user_data), const void *user_data);
index a5c80ab05a0a9931c273b211ec955624f7236024..08d49dee754aeb1b4e8f6e920358f0763f9fa050 100644 (file)
@@ -325,27 +325,6 @@ void BKE_blender_userdef_app_template_data_set_and_free(UserDef *userdef)
        MEM_freeN(userdef);
 }
 
        MEM_freeN(userdef);
 }
 
-/* *****************  testing for break ************* */
-
-static void (*blender_test_break_cb)(void) = NULL;
-
-void BKE_blender_callback_test_break_set(void (*func)(void))
-{
-       blender_test_break_cb = func;
-}
-
-
-int BKE_blender_test_break(void)
-{
-       if (!G.background) {
-               if (blender_test_break_cb)
-                       blender_test_break_cb();
-       }
-
-       return (G.is_break == true);
-}
-
-
 /** \name Blender's AtExit
  *
  * \note Don't use MEM_mallocN so functions can be registered at any time.
 /** \name Blender's AtExit
  *
  * \note Don't use MEM_mallocN so functions can be registered at any time.
index 5990308ee44541e2b20e43c405a4f682867f2c51..946e7c4a856a2a9c7072ee3d1f491d7148086f0d 100644 (file)
@@ -224,7 +224,6 @@ void WM_init(bContext *C, int argc, const char **argv)
        BKE_region_callback_free_gizmomap_set(wm_gizmomap_remove); /* screen.c */
        BKE_region_callback_refresh_tag_gizmomap_set(WM_gizmomap_tag_refresh);
        BKE_library_callback_remap_editor_id_reference_set(WM_main_remap_editor_id_reference);   /* library.c */
        BKE_region_callback_free_gizmomap_set(wm_gizmomap_remove); /* screen.c */
        BKE_region_callback_refresh_tag_gizmomap_set(WM_gizmomap_tag_refresh);
        BKE_library_callback_remap_editor_id_reference_set(WM_main_remap_editor_id_reference);   /* library.c */
-       BKE_blender_callback_test_break_set(wm_window_testbreak); /* blender.c */
        BKE_spacedata_callback_id_remap_set(ED_spacedata_id_remap); /* screen.c */
        DEG_editors_set_update_cb(ED_render_id_flush_update,
                                  ED_render_scene_update);
        BKE_spacedata_callback_id_remap_set(ED_spacedata_id_remap); /* screen.c */
        DEG_editors_set_update_cb(ED_render_id_flush_update,
                                  ED_render_scene_update);
index 613f5c58f858f2c83e18139b798736915be077ae..ae9d446711270abe891015152490cd8b40afe76d 100644 (file)
@@ -1664,33 +1664,6 @@ void wm_window_process_events(const bContext *C)
                PIL_sleep_ms(5);
 }
 
                PIL_sleep_ms(5);
 }
 
-void wm_window_process_events_nosleep(void)
-{
-       if (GHOST_ProcessEvents(g_system, 0))
-               GHOST_DispatchEvents(g_system);
-}
-
-/* exported as handle callback to bke blender.c */
-void wm_window_testbreak(void)
-{
-       static double ltime = 0;
-       double curtime = PIL_check_seconds_timer();
-
-       BLI_assert(BLI_thread_is_main());
-
-       /* only check for breaks every 50 milliseconds
-        * if we get called more often.
-        */
-       if ((curtime - ltime) > 0.05) {
-               int hasevent = GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
-
-               if (hasevent)
-                       GHOST_DispatchEvents(g_system);
-
-               ltime = curtime;
-       }
-}
-
 /* **************** init ********************** */
 
 /* bContext can be null in background mode because we don't
 /* **************** init ********************** */
 
 /* bContext can be null in background mode because we don't
index 248696a22d6655d7decf82ab05427b9c476f58a8..9e7eb2130709be3abfce00bdd3f6e59efc440b36 100644 (file)
@@ -48,7 +48,6 @@ void          wm_window_title                         (wmWindowManager *wm, wmWindow *win);
 void           wm_window_ghostwindows_ensure(wmWindowManager *wm);
 void           wm_window_ghostwindows_remove_invalid(bContext *C, wmWindowManager *wm);
 void           wm_window_process_events        (const bContext *C);
 void           wm_window_ghostwindows_ensure(wmWindowManager *wm);
 void           wm_window_ghostwindows_remove_invalid(bContext *C, wmWindowManager *wm);
 void           wm_window_process_events        (const bContext *C);
-void           wm_window_process_events_nosleep(void);
 
 void           wm_window_clear_drawable(wmWindowManager *wm);
 void           wm_window_make_drawable(wmWindowManager *wm, wmWindow *win);
 
 void           wm_window_clear_drawable(wmWindowManager *wm);
 void           wm_window_make_drawable(wmWindowManager *wm, wmWindow *win);
@@ -66,8 +65,6 @@ void          wm_get_cursor_position                  (wmWindow *win, int *x, int *y);
 void           wm_cursor_position_from_ghost   (wmWindow *win, int *x, int *y);
 void           wm_cursor_position_to_ghost             (wmWindow *win, int *x, int *y);
 
 void           wm_cursor_position_from_ghost   (wmWindow *win, int *x, int *y);
 void           wm_cursor_position_to_ghost             (wmWindow *win, int *x, int *y);
 
-void           wm_window_testbreak             (void);
-
 #ifdef WITH_INPUT_IME
 void           wm_window_IME_begin     (wmWindow *win, int x, int y, int w, int h, bool complete);
 void           wm_window_IME_end       (wmWindow *win);
 #ifdef WITH_INPUT_IME
 void           wm_window_IME_begin     (wmWindow *win, int x, int y, int w, int h, bool complete);
 void           wm_window_IME_end       (wmWindow *win);