hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=a83556895f49d12b4632e779e53fcd1da0451c23

commit a83556895f49d12b4632e779e53fcd1da0451c23
Author: ChunEon Park <her...@hermet.pe.kr>
Date:   Tue Apr 14 13:15:48 2015 +0900

    base_gui: + assert for easy debugging
---
 src/bin/base_gui.c   | 13 +++++++++++++
 src/include/common.h |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/bin/base_gui.c b/src/bin/base_gui.c
index 6f2b172..ab91d03 100644
--- a/src/bin/base_gui.c
+++ b/src/bin/base_gui.c
@@ -45,6 +45,7 @@ void
 base_error_msg_set(const char *msg)
 {
    base_data *bd = g_bd;
+   assert(bd);
    elm_object_signal_emit(bd->layout, "elm,state,alert,show", "");
    console_text_set(bd->console, msg);
    panes_editors_full_view(EINA_FALSE);
@@ -55,6 +56,7 @@ void
 base_title_set(const char *path)
 {
    base_data *bd = g_bd;
+   assert(bd);
    char buf[PATH_MAX];
    snprintf(buf, sizeof(buf), "%s - Enventor", path);
    elm_win_title_set(bd->win, buf);
@@ -64,6 +66,7 @@ void
 base_statusbar_toggle(Eina_Bool config)
 {
    base_data *bd = g_bd;
+   assert(bd);
 
    if (config) config_stats_bar_set(!config_stats_bar_get());
 
@@ -77,6 +80,7 @@ void
 base_tools_toggle(Eina_Bool config)
 {
    base_data *bd = g_bd;
+   assert(bd);
 
    if (config) config_tools_set(!config_tools_get());
 
@@ -90,6 +94,7 @@ Evas_Object *
 base_win_get(void)
 {
    base_data *bd = g_bd;
+   assert(bd && bd->win);
    return bd->win;
 }
 
@@ -97,6 +102,7 @@ Evas_Object *
 base_layout_get(void)
 {
    base_data *bd = g_bd;
+   assert(bd && bd->layout);
    return bd->layout;
 }
 
@@ -104,12 +110,14 @@ void
 base_win_resize_object_add(Evas_Object *resize_obj)
 {
    base_data *bd = g_bd;
+   assert(bd);
    elm_win_resize_object_add(bd->win, resize_obj);
 }
 
 void base_tools_set(Evas_Object *tools)
 {
    base_data *bd = g_bd;
+   assert(bd);
    elm_object_part_content_set(bd->layout, "elm.swallow.tools", tools);
 
    if (config_tools_get())
@@ -152,6 +160,7 @@ void
 base_console_auto_hide(void)
 {
    base_data *bd = g_bd;
+   assert(bd);
 
    if (!config_console_get()) return;
    if (bd->console_msg) return;
@@ -171,6 +180,8 @@ void
 base_gui_term(void)
 {
    base_data *bd = g_bd;
+   assert(bd);
+
    panes_term();
    free(bd);
 }
@@ -179,6 +190,8 @@ void
 base_console_reset(void)
 {
    base_data *bd = g_bd;
+   assert(bd);
+
    console_text_set(bd->console, "");
    bd->console_msg = EINA_FALSE;
    if (config_console_get()) panes_editors_full_view(EINA_TRUE);
diff --git a/src/include/common.h b/src/include/common.h
index 7b80a0a..d94ab33 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -12,7 +12,7 @@ typedef struct statusbar_s stats_data;
 
 #define ENVENTOR_BETA_API_SUPPORT 1
 #include <Enventor.h>
-
+#include <assert.h>
 #include "menu.h"
 #include "statusbar.h"
 #include "config_data.h"

-- 


Reply via email to