#include <Elementary.h>
#include <time.h>
typedef struct Progressbar_Example
{
} Progressbar_Example;
static Progressbar_Example example_data;
{
double progress;
if (progress < 1.0) progress += 0.0123;
else progress = 0.0;
example_data.run = 0;
}
static void
{
if (!example_data.run)
{
0.1, _progressbar_example_value_set, NULL);
}
}
static void
{
if (example_data.run)
{
}
}
static char *
_progress_format_cb(double val)
{
static char buf[30];
int files = (1-val)*14000;
if (snprintf(buf, 30, "%i files left", files) > 0)
return strdup(buf);
return NULL;
}
static void
_progress_format_free(char *str)
{
free(str);
}
static void
_on_changed(void *data,
{
static char buf[30];
static time_t tstart = 0;
static double eta = 0;
time_t tdiff;
double val;
{
tstart = 0;
elm_object_text_set(label, "ETA: N/A");
return;
}
if (tstart == 0)
{
tstart = time(NULL);
}
tdiff = time(NULL) - tstart;
eta = 0.3*eta + 0.7*(tdiff/val)*(1-val);
snprintf(buf, 30, "ETA: %.0fs", eta);
elm_object_text_set(label, buf);
}
static void
{
_progressbar_example_stop(NULL, NULL, NULL);
}
EAPI_MAIN int
{
Evas_Object *win, *pb, *bx, *hbx, *bt, *bt_bx, *ic1, *ic2, *label;
char buf[PATH_MAX];
example_data.pb1 = pb;
elm_object_text_set(pb, "Infinite bounce");
example_data.pb2 = pb;
elm_object_text_set(pb, "Label");
_progress_format_free);
example_data.pb3 = pb;
elm_object_text_set(pb, "Label");
elm_object_text_set(label, "ETA: N/A");
example_data.pb4 = pb;
elm_object_text_set(pb, "percent");
example_data.pb5 = pb;
elm_object_text_set(pb, "Infinite bounce");
example_data.pb6 = pb;
elm_object_text_set(pb, "Label");
example_data.pb7 = pb;
elm_object_text_set(pb, "Style: wheel");
example_data.pb8 = pb;
elm_object_text_set(bt, "Start");
NULL);
elm_object_text_set(bt, "Stop");
NULL);
return 0;
}