int errno;
+enum state {
+ STATE_UNKNOWN = 0,
+ STATE_RESUMED = 1,
+ STATE_PAUSED = 2
+};
+
struct item {
char *id;
void *update_timer;
struct widget_provider_event_callback *table;
- int paused;
+ enum state state;
void *data;
Eina_List *handle_list;
};
char *hw_acceleration;
Ecore_Timer *ping_timer;
Eina_List *inst_list;
- int paused;
+ enum state state;
int initialized;
Eina_List *internal_item_list;
Eina_List *widget_pre_callback_list[WIDGET_PRE_CALLBACK_COUNT];
.hw_acceleration = NULL,
.ping_timer = NULL,
.inst_list = NULL,
- .paused = 1,
+ .state = STATE_UNKNOWN,
.initialized = 0,
.internal_item_list = NULL,
.widget_pre_callback_list = { NULL, },
}
}
- item->paused = 1;
+ item->state = STATE_UNKNOWN;
s_info.inst_list = eina_list_append(s_info.inst_list, item);
return item;
Eina_List *l;
struct item *inst;
- if (s_info.paused == 1) {
+ if (s_info.state == STATE_PAUSED) {
DbgPrint("Already paused\n");
return WIDGET_ERROR_NONE;
}
- s_info.paused = 1;
+ s_info.state = STATE_PAUSED;
EINA_LIST_FOREACH(s_info.inst_list, l, inst) {
- if (inst->paused == 1) {
+ if (inst->state != STATE_RESUMED) {
continue;
}
Eina_List *l;
struct item *inst;
- if (s_info.paused == 0) {
+ if (s_info.state == STATE_RESUMED) {
DbgPrint("Already resumed\n");
return WIDGET_ERROR_NONE;
}
- s_info.paused = 0;
+ s_info.state = STATE_RESUMED;
EINA_LIST_FOREACH(s_info.inst_list, l, inst) {
- if (inst->paused == 1) {
+ if (inst->state != STATE_RESUMED) {
continue;
}
return WIDGET_ERROR_INVALID_PARAMETER;
}
- if (inst->paused == 1) {
+ if (inst->state == STATE_PAUSED) {
DbgPrint("Already paused\n");
return WIDGET_ERROR_ALREADY_EXIST;
}
- inst->paused = 1;
+ inst->state = STATE_PAUSED;
- if (s_info.paused == 1) {
+ if (s_info.state != STATE_RESUMED) {
return WIDGET_ERROR_NONE;
}
return WIDGET_ERROR_INVALID_PARAMETER;
}
- if (inst->paused == 0) {
+ if (inst->state == STATE_RESUMED) {
return WIDGET_ERROR_ALREADY_EXIST;
}
- inst->paused = 0;
+ inst->state = STATE_RESUMED;
- if (s_info.paused == 1) {
+ if (s_info.state != STATE_RESUMED) {
return WIDGET_ERROR_NONE;
}