summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-10-19 19:36:15 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-10-19 19:36:15 +0000
commit6e200ea6732929f8af2d5c1c839ed4de7f427cdc (patch)
treed64eab7d2041cba6fa1396d829f072b18597cec0
parentcd6a78ac6e1686d83bba56f83ba2c92b6105830e (diff)
formatting
SVN revision: 78268
-rw-r--r--src/lib/Etrophy.h132
-rw-r--r--src/lib/etrophy.c86
-rw-r--r--src/lib/etrophy_layouts.c8
3 files changed, 114 insertions, 112 deletions
diff --git a/src/lib/Etrophy.h b/src/lib/Etrophy.h
index c2998d2..fa89557 100644
--- a/src/lib/Etrophy.h
+++ b/src/lib/Etrophy.h
@@ -36,102 +36,104 @@ extern "C" {
36#endif 36#endif
37 37
38typedef struct _Etrophy_Trophy Etrophy_Trophy; 38typedef struct _Etrophy_Trophy Etrophy_Trophy;
39typedef enum { 39typedef enum
40{
40 ETROPHY_TROPHY_STATE_HIDDEN = 0, 41 ETROPHY_TROPHY_STATE_HIDDEN = 0,
41 ETROPHY_TROPHY_STATE_VISIBLE, 42 ETROPHY_TROPHY_STATE_VISIBLE,
42 ETROPHY_TROPHY_STATE_LAST_VALUE 43 ETROPHY_TROPHY_STATE_LAST_VALUE
43} Etrophy_Trophy_Visibility; 44} Etrophy_Trophy_Visibility;
44 45
45typedef struct _Etrophy_Lock Etrophy_Lock; 46typedef struct _Etrophy_Lock Etrophy_Lock;
46typedef enum { 47typedef enum
48{
47 ETROPHY_LOCK_STATE_LOCKED = 0, 49 ETROPHY_LOCK_STATE_LOCKED = 0,
48 ETROPHY_LOCK_STATE_UNLOCKED, 50 ETROPHY_LOCK_STATE_UNLOCKED,
49 ETROPHY_LOCK_STATE_LAST_VALUE 51 ETROPHY_LOCK_STATE_LAST_VALUE
50} Etrophy_Lock_State; 52} Etrophy_Lock_State;
51 53
52typedef struct _Etrophy_Score Etrophy_Score; 54typedef struct _Etrophy_Score Etrophy_Score;
53typedef struct _Etrophy_Level Etrophy_Level; 55typedef struct _Etrophy_Level Etrophy_Level;
54typedef struct _Etrophy_Gamescore Etrophy_Gamescore; 56typedef struct _Etrophy_Gamescore Etrophy_Gamescore;
55 57
56/* Etrophy_Trophy */ 58/* Etrophy_Trophy */
57EAPI Etrophy_Trophy *etrophy_trophy_new(const char *name, const char *description, Etrophy_Trophy_Visibility visibility, unsigned int goal); 59EAPI Etrophy_Trophy *etrophy_trophy_new(const char *name, const char *description, Etrophy_Trophy_Visibility visibility, unsigned int goal);
58EAPI void etrophy_trophy_free(Etrophy_Trophy *trophy); 60EAPI void etrophy_trophy_free(Etrophy_Trophy *trophy);
59 61
60EAPI const char *etrophy_trophy_name_get(const Etrophy_Trophy *trophy); 62EAPI const char *etrophy_trophy_name_get(const Etrophy_Trophy *trophy);
61EAPI const char *etrophy_trophy_description_get(const Etrophy_Trophy *trophy); 63EAPI const char *etrophy_trophy_description_get(const Etrophy_Trophy *trophy);
62EAPI Etrophy_Trophy_Visibility etrophy_trophy_visibility_get(const Etrophy_Trophy *trophy); 64EAPI Etrophy_Trophy_Visibility etrophy_trophy_visibility_get(const Etrophy_Trophy *trophy);
63EAPI void etrophy_trophy_goal_get(const Etrophy_Trophy *trophy, unsigned int *goal, unsigned int *counter); 65EAPI void etrophy_trophy_goal_get(const Etrophy_Trophy *trophy, unsigned int *goal, unsigned int *counter);
64EAPI void etrophy_trophy_counter_increment(Etrophy_Trophy *trophy, unsigned int value); 66EAPI void etrophy_trophy_counter_increment(Etrophy_Trophy *trophy, unsigned int value);
65EAPI Eina_Bool etrophy_trophy_earned_get(const Etrophy_Trophy *trophy); 67EAPI Eina_Bool etrophy_trophy_earned_get(const Etrophy_Trophy *trophy);
66EAPI unsigned int etrophy_trophy_date_get(const Etrophy_Trophy *trophy); 68EAPI unsigned int etrophy_trophy_date_get(const Etrophy_Trophy *trophy);
67 69
68/* Etrophy_Lock */ 70/* Etrophy_Lock */
69EAPI Etrophy_Lock *etrophy_lock_new(const char *name, Etrophy_Lock_State state); 71EAPI Etrophy_Lock *etrophy_lock_new(const char *name, Etrophy_Lock_State state);
70EAPI void etrophy_lock_free(Etrophy_Lock *lock); 72EAPI void etrophy_lock_free(Etrophy_Lock *lock);
71 73
72EAPI const char *etrophy_lock_name_get(const Etrophy_Lock *lock); 74EAPI const char *etrophy_lock_name_get(const Etrophy_Lock *lock);
73EAPI void etrophy_lock_state_set(Etrophy_Lock *lock, Etrophy_Lock_State state); 75EAPI void etrophy_lock_state_set(Etrophy_Lock *lock, Etrophy_Lock_State state);
74EAPI Etrophy_Lock_State etrophy_lock_state_get(const Etrophy_Lock *lock); 76EAPI Etrophy_Lock_State etrophy_lock_state_get(const Etrophy_Lock *lock);
75EAPI unsigned int etrophy_lock_date_get(const Etrophy_Lock *lock); 77EAPI unsigned int etrophy_lock_date_get(const Etrophy_Lock *lock);
76 78
77/* Etrophy_Score */ 79/* Etrophy_Score */
78EAPI Etrophy_Score *etrophy_score_new(const char *player_name, int score); 80EAPI Etrophy_Score *etrophy_score_new(const char *player_name, int score);
79EAPI void etrophy_score_free(Etrophy_Score *escore); 81EAPI void etrophy_score_free(Etrophy_Score *escore);
80 82
81EAPI const char *etrophy_score_player_name_get(const Etrophy_Score *escore); 83EAPI const char *etrophy_score_player_name_get(const Etrophy_Score *escore);
82EAPI int etrophy_score_score_get(const Etrophy_Score *escore); 84EAPI int etrophy_score_score_get(const Etrophy_Score *escore);
83EAPI unsigned int etrophy_score_date_get(const Etrophy_Score *escore); 85EAPI unsigned int etrophy_score_date_get(const Etrophy_Score *escore);
84 86
85/* Etrophy_Level */ 87/* Etrophy_Level */
86EAPI Etrophy_Level *etrophy_level_new(const char *name); 88EAPI Etrophy_Level *etrophy_level_new(const char *name);
87EAPI void etrophy_level_free(Etrophy_Level *level); 89EAPI void etrophy_level_free(Etrophy_Level *level);
88 90
89EAPI const char *etrophy_level_name_get(const Etrophy_Level *level); 91EAPI const char *etrophy_level_name_get(const Etrophy_Level *level);
90EAPI void etrophy_level_score_add(Etrophy_Level *level, Etrophy_Score *escore); 92EAPI void etrophy_level_score_add(Etrophy_Level *level, Etrophy_Score *escore);
91EAPI void etrophy_level_score_del(Etrophy_Level *level, Etrophy_Score *escore); 93EAPI void etrophy_level_score_del(Etrophy_Level *level, Etrophy_Score *escore);
92EAPI const Eina_List *etrophy_level_scores_list_get(const Etrophy_Level *level); 94EAPI const Eina_List *etrophy_level_scores_list_get(const Etrophy_Level *level);
93EAPI void etrophy_level_scores_list_clear(Etrophy_Level *level); 95EAPI void etrophy_level_scores_list_clear(Etrophy_Level *level);
94 96
95/* Etrophy_Gamescore */ 97/* Etrophy_Gamescore */
96EAPI Etrophy_Gamescore *etrophy_gamescore_new(const char *gamename); 98EAPI Etrophy_Gamescore *etrophy_gamescore_new(const char *gamename);
97EAPI void etrophy_gamescore_free(Etrophy_Gamescore *gamescore); 99EAPI void etrophy_gamescore_free(Etrophy_Gamescore *gamescore);
98EAPI Eet_Data_Descriptor *etrophy_gamescore_edd_get(void); 100EAPI Eet_Data_Descriptor *etrophy_gamescore_edd_get(void);
99EAPI Etrophy_Gamescore *etrophy_gamescore_path_load(const char *filename); 101EAPI Etrophy_Gamescore *etrophy_gamescore_path_load(const char *filename);
100EAPI Etrophy_Gamescore *etrophy_gamescore_load(const char *gamename); 102EAPI Etrophy_Gamescore *etrophy_gamescore_load(const char *gamename);
101EAPI Eina_Bool etrophy_gamescore_save(Etrophy_Gamescore *gamescore, const char *filename); 103EAPI Eina_Bool etrophy_gamescore_save(Etrophy_Gamescore *gamescore, const char *filename);
102 104
103EAPI void etrophy_gamescore_level_add(Etrophy_Gamescore *gamescore, Etrophy_Level *level); 105EAPI void etrophy_gamescore_level_add(Etrophy_Gamescore *gamescore, Etrophy_Level *level);
104EAPI void etrophy_gamescore_level_del(Etrophy_Gamescore *gamescore, Etrophy_Level *level); 106EAPI void etrophy_gamescore_level_del(Etrophy_Gamescore *gamescore, Etrophy_Level *level);
105EAPI Etrophy_Level *etrophy_gamescore_level_get(Etrophy_Gamescore *gamescore, const char *name); 107EAPI Etrophy_Level *etrophy_gamescore_level_get(Etrophy_Gamescore *gamescore, const char *name);
106EAPI const Eina_List *etrophy_gamescore_levels_list_get(const Etrophy_Gamescore *gamescore); 108EAPI const Eina_List *etrophy_gamescore_levels_list_get(const Etrophy_Gamescore *gamescore);
107EAPI void etrophy_gamescore_levels_list_clear(Etrophy_Gamescore *gamescore); 109EAPI void etrophy_gamescore_levels_list_clear(Etrophy_Gamescore *gamescore);
108 110
109EAPI void etrophy_gamescore_trophy_add(Etrophy_Gamescore *gamescore, Etrophy_Trophy *trophy); 111EAPI void etrophy_gamescore_trophy_add(Etrophy_Gamescore *gamescore, Etrophy_Trophy *trophy);
110EAPI void etrophy_gamescore_trophy_del(Etrophy_Gamescore *gamescore, Etrophy_Trophy *trophy); 112EAPI void etrophy_gamescore_trophy_del(Etrophy_Gamescore *gamescore, Etrophy_Trophy *trophy);
111EAPI Etrophy_Trophy *etrophy_gamescore_trophy_get(Etrophy_Gamescore *gamescore, const char *name); 113EAPI Etrophy_Trophy *etrophy_gamescore_trophy_get(Etrophy_Gamescore *gamescore, const char *name);
112EAPI const Eina_List *etrophy_gamescore_trophies_list_get(const Etrophy_Gamescore *gamescore); 114EAPI const Eina_List *etrophy_gamescore_trophies_list_get(const Etrophy_Gamescore *gamescore);
113EAPI void etrophy_gamescore_trophies_list_clear(Etrophy_Gamescore *gamescore); 115EAPI void etrophy_gamescore_trophies_list_clear(Etrophy_Gamescore *gamescore);
114 116
115EAPI void etrophy_gamescore_lock_add(Etrophy_Gamescore *gamescore, Etrophy_Lock *lock); 117EAPI void etrophy_gamescore_lock_add(Etrophy_Gamescore *gamescore, Etrophy_Lock *lock);
116EAPI void etrophy_gamescore_lock_del(Etrophy_Gamescore *gamescore, Etrophy_Lock *lock); 118EAPI void etrophy_gamescore_lock_del(Etrophy_Gamescore *gamescore, Etrophy_Lock *lock);
117EAPI Etrophy_Lock *etrophy_gamescore_lock_get(Etrophy_Gamescore *gamescore, const char *name); 119EAPI Etrophy_Lock *etrophy_gamescore_lock_get(Etrophy_Gamescore *gamescore, const char *name);
118EAPI const Eina_List *etrophy_gamescore_locks_list_get(const Etrophy_Gamescore *gamescore); 120EAPI const Eina_List *etrophy_gamescore_locks_list_get(const Etrophy_Gamescore *gamescore);
119EAPI void etrophy_gamescore_locks_list_clear(Etrophy_Gamescore *gamescore); 121EAPI void etrophy_gamescore_locks_list_clear(Etrophy_Gamescore *gamescore);
120 122
121EAPI void etrophy_gamescore_clear(Etrophy_Gamescore *gamescore); 123EAPI void etrophy_gamescore_clear(Etrophy_Gamescore *gamescore);
122 124
123EAPI int etrophy_gamescore_level_hi_score_get(const Etrophy_Gamescore *gamescore, const char *level_name); 125EAPI int etrophy_gamescore_level_hi_score_get(const Etrophy_Gamescore *gamescore, const char *level_name);
124EAPI int etrophy_gamescore_level_low_score_get(const Etrophy_Gamescore *gamescore, const char *level_name); 126EAPI int etrophy_gamescore_level_low_score_get(const Etrophy_Gamescore *gamescore, const char *level_name);
125EAPI Etrophy_Score *etrophy_gamescore_level_score_add(Etrophy_Gamescore *gamescore, const char *level_name, const char *player_name, int score); 127EAPI Etrophy_Score *etrophy_gamescore_level_score_add(Etrophy_Gamescore *gamescore, const char *level_name, const char *player_name, int score);
126 128
127/* Layouts */ 129/* Layouts */
128EAPI Evas_Object *etrophy_score_layout_add(Evas_Object *parent, Etrophy_Gamescore *gamescore); 130EAPI Evas_Object *etrophy_score_layout_add(Evas_Object *parent, Etrophy_Gamescore *gamescore);
129EAPI Evas_Object *etrophy_trophies_layout_add(Evas_Object *parent, Etrophy_Gamescore *gamescore); 131EAPI Evas_Object *etrophy_trophies_layout_add(Evas_Object *parent, Etrophy_Gamescore *gamescore);
130EAPI Evas_Object *etrophy_locks_layout_add(Evas_Object *parent, Etrophy_Gamescore *gamescore); 132EAPI Evas_Object *etrophy_locks_layout_add(Evas_Object *parent, Etrophy_Gamescore *gamescore);
131 133
132/* Global initializer / shutdown functions */ 134/* Global initializer / shutdown functions */
133EAPI int etrophy_init(void); 135EAPI int etrophy_init(void);
134EAPI int etrophy_shutdown(void); 136EAPI int etrophy_shutdown(void);
135 137
136#ifdef __cplusplus 138#ifdef __cplusplus
137} 139}
diff --git a/src/lib/etrophy.c b/src/lib/etrophy.c
index c700454..dbca991 100644
--- a/src/lib/etrophy.c
+++ b/src/lib/etrophy.c
@@ -49,39 +49,39 @@ static int _etrophy_init_count = 0;
49 49
50struct _Etrophy_Trophy 50struct _Etrophy_Trophy
51{ 51{
52 const char *name; 52 const char *name;
53 const char *description; 53 const char *description;
54 Etrophy_Trophy_Visibility visibility; 54 Etrophy_Trophy_Visibility visibility;
55 unsigned int counter; 55 unsigned int counter;
56 unsigned int goal; 56 unsigned int goal;
57 unsigned int date; 57 unsigned int date;
58}; 58};
59 59
60struct _Etrophy_Lock 60struct _Etrophy_Lock
61{ 61{
62 const char *name; 62 const char *name;
63 Etrophy_Lock_State state; 63 Etrophy_Lock_State state;
64 unsigned int date; 64 unsigned int date;
65}; 65};
66 66
67struct _Etrophy_Score 67struct _Etrophy_Score
68{ 68{
69 const char *player_name; 69 const char *player_name;
70 int score; 70 int score;
71 unsigned int date; 71 unsigned int date;
72}; 72};
73 73
74struct _Etrophy_Level 74struct _Etrophy_Level
75{ 75{
76 const char *name; 76 const char *name;
77 Eina_List *scores; 77 Eina_List *scores;
78}; 78};
79 79
80struct _Etrophy_Gamescore 80struct _Etrophy_Gamescore
81{ 81{
82 Eina_List *levels; 82 Eina_List *levels;
83 Eina_List *trophies; 83 Eina_List *trophies;
84 Eina_List *locks; 84 Eina_List *locks;
85 const char *__eet_filename; 85 const char *__eet_filename;
86}; 86};
87 87
@@ -142,7 +142,7 @@ etrophy_trophy_new(const char *name, const char *description, Etrophy_Trophy_Vis
142 trophy->name = eina_stringshare_add(name); 142 trophy->name = eina_stringshare_add(name);
143 trophy->description = eina_stringshare_add(description); 143 trophy->description = eina_stringshare_add(description);
144 trophy->visibility = visibility; 144 trophy->visibility = visibility;
145 trophy->date = (unsigned int) ecore_time_get(); 145 trophy->date = (unsigned int)ecore_time_get();
146 trophy->goal = goal; 146 trophy->goal = goal;
147 147
148 return trophy; 148 return trophy;
@@ -198,14 +198,14 @@ etrophy_trophy_counter_increment(Etrophy_Trophy *trophy, unsigned int value)
198 if (trophy->counter > trophy->goal) 198 if (trophy->counter > trophy->goal)
199 trophy->counter = trophy->goal; 199 trophy->counter = trophy->goal;
200 200
201 trophy->date = (unsigned int) ecore_time_get(); 201 trophy->date = (unsigned int)ecore_time_get();
202} 202}
203 203
204EAPI inline Eina_Bool 204EAPI inline Eina_Bool
205etrophy_trophy_earned_get(const Etrophy_Trophy *trophy) 205etrophy_trophy_earned_get(const Etrophy_Trophy *trophy)
206{ 206{
207 EINA_SAFETY_ON_NULL_RETURN_VAL(trophy, EINA_FALSE); 207 EINA_SAFETY_ON_NULL_RETURN_VAL(trophy, EINA_FALSE);
208 return (trophy->goal == trophy->counter); 208 return trophy->goal == trophy->counter;
209} 209}
210 210
211EAPI inline unsigned int 211EAPI inline unsigned int
@@ -257,7 +257,7 @@ etrophy_lock_new(const char *name, Etrophy_Lock_State state)
257 257
258 lock->name = eina_stringshare_add(name); 258 lock->name = eina_stringshare_add(name);
259 lock->state = state; 259 lock->state = state;
260 lock->date = (unsigned int) ecore_time_get(); 260 lock->date = (unsigned int)ecore_time_get();
261 261
262 return lock; 262 return lock;
263} 263}
@@ -290,7 +290,7 @@ etrophy_lock_state_set(Etrophy_Lock *lock, Etrophy_Lock_State state)
290 EINA_SAFETY_ON_NULL_RETURN(lock); 290 EINA_SAFETY_ON_NULL_RETURN(lock);
291 if (state >= ETROPHY_LOCK_STATE_LAST_VALUE) return; 291 if (state >= ETROPHY_LOCK_STATE_LAST_VALUE) return;
292 lock->state = state; 292 lock->state = state;
293 lock->date = (unsigned int) ecore_time_get(); 293 lock->date = (unsigned int)ecore_time_get();
294} 294}
295 295
296EAPI inline unsigned int 296EAPI inline unsigned int
@@ -339,7 +339,7 @@ etrophy_score_new(const char *player_name, int score)
339 339
340 escore->player_name = eina_stringshare_add(player_name); 340 escore->player_name = eina_stringshare_add(player_name);
341 escore->score = score; 341 escore->score = score;
342 escore->date = (unsigned int) ecore_time_get(); 342 escore->date = (unsigned int)ecore_time_get();
343 343
344 DBG("Score created. Player: %s, score: %i", player_name, score); 344 DBG("Score created. Player: %s, score: %i", player_name, score);
345 345
@@ -427,7 +427,7 @@ etrophy_level_free(Etrophy_Level *level)
427 if (level->scores) 427 if (level->scores)
428 { 428 {
429 Etrophy_Score *scores_elem; 429 Etrophy_Score *scores_elem;
430 EINA_LIST_FREE (level->scores, scores_elem) 430 EINA_LIST_FREE(level->scores, scores_elem)
431 etrophy_score_free(scores_elem); 431 etrophy_score_free(scores_elem);
432 } 432 }
433 free(level); 433 free(level);
@@ -469,7 +469,7 @@ etrophy_level_scores_list_clear(Etrophy_Level *level)
469{ 469{
470 EINA_SAFETY_ON_NULL_RETURN(level); 470 EINA_SAFETY_ON_NULL_RETURN(level);
471 Etrophy_Score *data; 471 Etrophy_Score *data;
472 EINA_LIST_FREE (level->scores, data) 472 EINA_LIST_FREE(level->scores, data)
473 etrophy_score_free(data); 473 etrophy_score_free(data);
474} 474}
475 475
@@ -544,7 +544,7 @@ etrophy_gamescore_new(const char *gamename)
544 INF("Directory %s created.", filename); 544 INF("Directory %s created.", filename);
545 } 545 }
546 else 546 else
547 INF("Base directory: %s.", filename); 547 INF("Base directory: %s.", filename);
548 548
549 snprintf(filename, sizeof(filename), "%s/.etrophy/%s.eet", home, gamename); 549 snprintf(filename, sizeof(filename), "%s/.etrophy/%s.eet", home, gamename);
550 gamescore->__eet_filename = eina_stringshare_add(filename); 550 gamescore->__eet_filename = eina_stringshare_add(filename);
@@ -558,17 +558,17 @@ etrophy_gamescore_free(Etrophy_Gamescore *gamescore)
558 if (!gamescore) return; 558 if (!gamescore) return;
559 { 559 {
560 Etrophy_Level *levels_elem; 560 Etrophy_Level *levels_elem;
561 EINA_LIST_FREE (gamescore->levels, levels_elem) 561 EINA_LIST_FREE(gamescore->levels, levels_elem)
562 etrophy_level_free(levels_elem); 562 etrophy_level_free(levels_elem);
563 } 563 }
564 { 564 {
565 Etrophy_Trophy *trophies_elem; 565 Etrophy_Trophy *trophies_elem;
566 EINA_LIST_FREE (gamescore->trophies, trophies_elem) 566 EINA_LIST_FREE(gamescore->trophies, trophies_elem)
567 etrophy_trophy_free(trophies_elem); 567 etrophy_trophy_free(trophies_elem);
568 } 568 }
569 { 569 {
570 Etrophy_Lock *locks_elem; 570 Etrophy_Lock *locks_elem;
571 EINA_LIST_FREE (gamescore->locks, locks_elem) 571 EINA_LIST_FREE(gamescore->locks, locks_elem)
572 etrophy_lock_free(locks_elem); 572 etrophy_lock_free(locks_elem);
573 } 573 }
574 free(gamescore); 574 free(gamescore);
@@ -600,8 +600,8 @@ etrophy_gamescore_level_get(Etrophy_Gamescore *gamescore, const char *name)
600 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL); 600 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
601 601
602 EINA_LIST_FOREACH(gamescore->levels, l, level) 602 EINA_LIST_FOREACH(gamescore->levels, l, level)
603 if (!strcmp(name, level->name)) 603 if (!strcmp(name, level->name))
604 return level; 604 return level;
605 605
606 return NULL; 606 return NULL;
607} 607}
@@ -611,7 +611,7 @@ etrophy_gamescore_levels_list_clear(Etrophy_Gamescore *gamescore)
611{ 611{
612 EINA_SAFETY_ON_NULL_RETURN(gamescore); 612 EINA_SAFETY_ON_NULL_RETURN(gamescore);
613 Etrophy_Level *data; 613 Etrophy_Level *data;
614 EINA_LIST_FREE (gamescore->levels, data) 614 EINA_LIST_FREE(gamescore->levels, data)
615 etrophy_level_free(data); 615 etrophy_level_free(data);
616} 616}
617 617
@@ -648,8 +648,8 @@ etrophy_gamescore_trophy_get(Etrophy_Gamescore *gamescore, const char *name)
648 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL); 648 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
649 649
650 EINA_LIST_FOREACH(gamescore->trophies, l, trophy) 650 EINA_LIST_FOREACH(gamescore->trophies, l, trophy)
651 if (!strcmp(name, trophy->name)) 651 if (!strcmp(name, trophy->name))
652 return trophy; 652 return trophy;
653 653
654 return NULL; 654 return NULL;
655} 655}
@@ -659,7 +659,7 @@ etrophy_gamescore_trophies_list_clear(Etrophy_Gamescore *gamescore)
659{ 659{
660 EINA_SAFETY_ON_NULL_RETURN(gamescore); 660 EINA_SAFETY_ON_NULL_RETURN(gamescore);
661 Etrophy_Trophy *data; 661 Etrophy_Trophy *data;
662 EINA_LIST_FREE (gamescore->trophies, data) 662 EINA_LIST_FREE(gamescore->trophies, data)
663 etrophy_trophy_free(data); 663 etrophy_trophy_free(data);
664} 664}
665 665
@@ -696,8 +696,8 @@ etrophy_gamescore_lock_get(Etrophy_Gamescore *gamescore, const char *name)
696 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL); 696 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
697 697
698 EINA_LIST_FOREACH(gamescore->locks, l, lock) 698 EINA_LIST_FOREACH(gamescore->locks, l, lock)
699 if (!strcmp(name, lock->name)) 699 if (!strcmp(name, lock->name))
700 return lock; 700 return lock;
701 701
702 return NULL; 702 return NULL;
703} 703}
@@ -707,7 +707,7 @@ etrophy_gamescore_locks_list_clear(Etrophy_Gamescore *gamescore)
707{ 707{
708 EINA_SAFETY_ON_NULL_RETURN(gamescore); 708 EINA_SAFETY_ON_NULL_RETURN(gamescore);
709 Etrophy_Lock *data; 709 Etrophy_Lock *data;
710 EINA_LIST_FREE (gamescore->locks, data) 710 EINA_LIST_FREE(gamescore->locks, data)
711 etrophy_lock_free(data); 711 etrophy_lock_free(data);
712} 712}
713 713
@@ -794,15 +794,15 @@ etrophy_gamescore_level_score_add(Etrophy_Gamescore *gamescore, const char *leve
794 } 794 }
795 795
796 if (!level) 796 if (!level)
797 { 797 {
798 level = etrophy_level_new(level_name); 798 level = etrophy_level_new(level_name);
799 if (!level) 799 if (!level)
800 { 800 {
801 etrophy_score_free(escore); 801 etrophy_score_free(escore);
802 return NULL; 802 return NULL;
803 } 803 }
804 gamescore->levels = eina_list_append(gamescore->levels, level); 804 gamescore->levels = eina_list_append(gamescore->levels, level);
805 } 805 }
806 806
807 level->scores = eina_list_sorted_insert(level->scores, _score_cmp, escore); 807 level->scores = eina_list_sorted_insert(level->scores, _score_cmp, escore);
808 808
diff --git a/src/lib/etrophy_layouts.c b/src/lib/etrophy_layouts.c
index d3282a0..881b8c4 100644
--- a/src/lib/etrophy_layouts.c
+++ b/src/lib/etrophy_layouts.c
@@ -53,8 +53,8 @@ _score_level_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED_
53 while (item) 53 while (item)
54 { 54 {
55 if (elm_genlist_item_item_class_get(item) == &itc_group) 55 if (elm_genlist_item_item_class_get(item) == &itc_group)
56 if (value == i++) 56 if (value == i++)
57 elm_genlist_item_bring_in(item, ELM_GENLIST_ITEM_SCROLLTO_TOP); 57 elm_genlist_item_bring_in(item, ELM_GENLIST_ITEM_SCROLLTO_TOP);
58 item = elm_genlist_item_next_get(item); 58 item = elm_genlist_item_next_get(item);
59 } 59 }
60} 60}
@@ -99,7 +99,7 @@ etrophy_score_layout_add(Evas_Object *parent, Etrophy_Gamescore *gamescore)
99 99
100 itc.item_style = "double_label"; 100 itc.item_style = "double_label";
101 itc.func.text_get = _text_get; 101 itc.func.text_get = _text_get;
102 itc.func.content_get = NULL; 102 itc.func.content_get = NULL;
103 itc.func.state_get = NULL; 103 itc.func.state_get = NULL;
104 itc.func.del = NULL; 104 itc.func.del = NULL;
105 105
@@ -128,7 +128,7 @@ etrophy_score_layout_add(Evas_Object *parent, Etrophy_Gamescore *gamescore)
128 item = elm_genlist_item_append(genlist, &itc, score, NULL, 128 item = elm_genlist_item_append(genlist, &itc, score, NULL,
129 ELM_GENLIST_ITEM_NONE, NULL, NULL); 129 ELM_GENLIST_ITEM_NONE, NULL, NULL);
130 elm_genlist_item_select_mode_set( 130 elm_genlist_item_select_mode_set(
131 item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); 131 item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
132 } 132 }
133 } 133 }
134 134