summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_fb/ecore_fb.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2009-10-10 05:28:43 +0000
committerVincent Torri <vincent.torri@gmail.com>2009-10-10 05:28:43 +0000
commit4072d0b23d3c3803932c6f82ec89555b52e3b8a2 (patch)
treeee18a18b8d3d63083a276c94f0387ff5d5636185 /legacy/ecore/src/lib/ecore_fb/ecore_fb.c
parent1d869a9ab18b75ac4c6da60f99841f212ba43eaf (diff)
* check the returned value of the _init() functions
* simplify a bit the init/shutdown functions SVN revision: 42995
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_fb/ecore_fb.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb.c
index 83b36b5658..acc380ab0d 100644
--- a/legacy/ecore/src/lib/ecore_fb/ecore_fb.c
+++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb.c
@@ -41,18 +41,21 @@ static double _ecore_fb_double_click_time = 0.25;
41EAPI int 41EAPI int
42ecore_fb_init(const char *name __UNUSED__) 42ecore_fb_init(const char *name __UNUSED__)
43{ 43{
44 if(!_ecore_fb_init_count) 44 if (++_ecore_fb_init_count != 1)
45 { 45 return _ecore_fb_init_count;
46 if(!ecore_fb_vt_init()) return 0; 46
47 ECORE_FB_EVENT_KEY_DOWN = ecore_event_type_new(); 47 if (!ecore_fb_vt_init())
48 ECORE_FB_EVENT_KEY_UP = ecore_event_type_new(); 48 return --_ecore_fb_init_count;
49 ECORE_FB_EVENT_MOUSE_BUTTON_DOWN = ecore_event_type_new(); 49
50 ECORE_FB_EVENT_MOUSE_BUTTON_UP = ecore_event_type_new(); 50 ECORE_FB_EVENT_KEY_DOWN = ecore_event_type_new();
51 ECORE_FB_EVENT_MOUSE_MOVE = ecore_event_type_new(); 51 ECORE_FB_EVENT_KEY_UP = ecore_event_type_new();
52 ECORE_FB_EVENT_MOUSE_WHEEL = ecore_event_type_new(); 52 ECORE_FB_EVENT_MOUSE_BUTTON_DOWN = ecore_event_type_new();
53 _ecore_fb_size_get(&_ecore_fb_console_w, &_ecore_fb_console_h); 53 ECORE_FB_EVENT_MOUSE_BUTTON_UP = ecore_event_type_new();
54 } 54 ECORE_FB_EVENT_MOUSE_MOVE = ecore_event_type_new();
55 return ++_ecore_fb_init_count; 55 ECORE_FB_EVENT_MOUSE_WHEEL = ecore_event_type_new();
56 _ecore_fb_size_get(&_ecore_fb_console_w, &_ecore_fb_console_h);
57
58 return _ecore_fb_init_count;
56} 59}
57 60
58/** 61/**
@@ -64,13 +67,12 @@ ecore_fb_init(const char *name __UNUSED__)
64EAPI int 67EAPI int
65ecore_fb_shutdown(void) 68ecore_fb_shutdown(void)
66{ 69{
67 _ecore_fb_init_count--; 70 if (--_ecore_fb_init_count != 0)
68 if(!_ecore_fb_init_count) 71 return _ecore_fb_init_count;
69 { 72
70 ecore_fb_vt_shutdown(); 73 ecore_fb_vt_shutdown();
71 return 0; 74
72 } 75 return _ecore_fb_init_count;
73 return _ecore_fb_init_count;
74} 76}
75 77
76 78