size_t size);
void (*on_boot_progress)(ply_boot_splash_plugin_t *plugin,
double duration,
- double percent_done);
+ double fraction_done);
void (*on_root_mounted)(ply_boot_splash_plugin_t *plugin);
void (*hide_splash_screen)(ply_boot_splash_plugin_t *plugin,
ply_event_loop_t *loop);
int number_of_rows;
int number_of_columns;
- double percent_done;
+ double fraction_done;
uint32_t is_hidden : 1;
};
progress_bar->column,
progress_bar->row);
- brown_fraction = -(progress_bar->percent_done * progress_bar->percent_done) + 2 * progress_bar->percent_done;
- blue_fraction = progress_bar->percent_done;
- white_fraction = progress_bar->percent_done * progress_bar->percent_done;
+ brown_fraction = -(progress_bar->fraction_done * progress_bar->fraction_done) + 2 * progress_bar->fraction_done;
+ blue_fraction = progress_bar->fraction_done;
+ white_fraction = progress_bar->fraction_done * progress_bar->fraction_done;
for (i = 0; i < width; i++) {
double f;
}
void
-ply_text_progress_bar_set_percent_done (ply_text_progress_bar_t *progress_bar,
- double percent_done)
+ply_text_progress_bar_set_fraction_done (ply_text_progress_bar_t *progress_bar,
+ double fraction_done)
{
- progress_bar->percent_done = percent_done;
+ progress_bar->fraction_done = fraction_done;
}
double
-ply_text_progress_bar_get_percent_done (ply_text_progress_bar_t *progress_bar)
+ply_text_progress_bar_get_fraction_done (ply_text_progress_bar_t *progress_bar)
{
- return progress_bar->percent_done;
+ return progress_bar->fraction_done;
}
int
ply_text_display_t *display);
void ply_text_progress_bar_hide (ply_text_progress_bar_t *progress_bar);
-void ply_text_progress_bar_set_percent_done (ply_text_progress_bar_t *progress_bar,
- double percent_done);
+void ply_text_progress_bar_set_fraction_done (ply_text_progress_bar_t *progress_bar,
+ double fraction_done);
-double ply_text_progress_bar_get_percent_done (ply_text_progress_bar_t *progress_bar);
+double ply_text_progress_bar_get_fraction_done (ply_text_progress_bar_t *progress_bar);
int ply_text_progress_bar_get_number_of_rows (ply_text_progress_bar_t *progress_bar);
int ply_text_progress_bar_get_number_of_columns (ply_text_progress_bar_t *progress_bar);
int number_of_rows;
int number_of_columns;
- double percent_done;
+ double fraction_done;
uint32_t is_hidden : 1;
};
step_bar->column,
step_bar->row);
- cur = step_bar->percent_done * step_bar->number_of_columns;
+ cur = step_bar->fraction_done * step_bar->number_of_columns;
for (i = 0; i < step_bar->number_of_columns; i++) {
if (i == cur)
ply_text_display_set_foreground_color (step_bar->display,
}
void
-ply_text_step_bar_set_percent_done (ply_text_step_bar_t *step_bar,
- double percent_done)
+ply_text_step_bar_set_fraction_done (ply_text_step_bar_t *step_bar,
+ double fraction_done)
{
- step_bar->percent_done = percent_done;
+ step_bar->fraction_done = fraction_done;
}
double
-ply_text_step_bar_get_percent_done (ply_text_step_bar_t *step_bar)
+ply_text_step_bar_get_fraction_done (ply_text_step_bar_t *step_bar)
{
- return step_bar->percent_done;
+ return step_bar->fraction_done;
}
int
ply_text_display_t *display);
void ply_text_step_bar_hide (ply_text_step_bar_t *step_bar);
-void ply_text_step_bar_set_percent_done (ply_text_step_bar_t *step_bar,
- double percent_done);
+void ply_text_step_bar_set_fraction_done (ply_text_step_bar_t *step_bar,
+ double fraction_done);
-double ply_text_step_bar_get_percent_done (ply_text_step_bar_t *step_bar);
+double ply_text_step_bar_get_fraction_done (ply_text_step_bar_t *step_bar);
int ply_text_step_bar_get_number_of_rows (ply_text_step_bar_t *step_bar);
int ply_text_step_bar_get_number_of_columns (ply_text_step_bar_t *step_bar);
ply_rectangle_t area;
ply_rectangle_t frame_area;
- double percent_done;
+ double fraction_done;
int previous_frame_number;
double transition_start_time;
progress_animation->frames_prefix = strdup (frames_prefix);
progress_animation->image_dir = strdup (image_dir);
progress_animation->is_hidden = true;
- progress_animation->percent_done = 0.0;
+ progress_animation->fraction_done = 0.0;
progress_animation->area.x = 0;
progress_animation->area.y = 0;
progress_animation->area.width = 0;
if (number_of_frames == 0)
return;
- frame_number = progress_animation->percent_done * (number_of_frames - 1);
+ frame_number = progress_animation->fraction_done * (number_of_frames - 1);
if (progress_animation->previous_frame_number != frame_number &&
progress_animation->transition != PLY_PROGRESS_ANIMATION_TRANSITION_NONE &&
}
void
-ply_progress_animation_set_percent_done (ply_progress_animation_t *progress_animation,
- double percent_done)
+ply_progress_animation_set_fraction_done (ply_progress_animation_t *progress_animation,
+ double fraction_done)
{
- progress_animation->percent_done = percent_done;
+ progress_animation->fraction_done = fraction_done;
ply_progress_animation_draw (progress_animation);
}
double
-ply_progress_animation_get_percent_done (ply_progress_animation_t *progress_animation)
+ply_progress_animation_get_fraction_done (ply_progress_animation_t *progress_animation)
{
- return progress_animation->percent_done;
+ return progress_animation->fraction_done;
}
/* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */
long ply_progress_animation_get_width (ply_progress_animation_t *progress_animation);
long ply_progress_animation_get_height (ply_progress_animation_t *progress_animation);
-void ply_progress_animation_set_percent_done (ply_progress_animation_t *progress_animation,
- double percent_done);
-double ply_progress_animation_get_percent_done (ply_progress_animation_t *progress_animation);
+void ply_progress_animation_set_fraction_done (ply_progress_animation_t *progress_animation,
+ double fraction_done);
+double ply_progress_animation_get_fraction_done (ply_progress_animation_t *progress_animation);
#endif
uint32_t fg_color;
uint32_t bg_color;
- double percent_done;
+ double fraction_done;
uint32_t is_hidden : 1;
};
progress_bar->is_hidden = true;
progress_bar->fg_color = 0xffffffff; /* Solid white */
progress_bar->bg_color = 0x01000000; /* Transparent */
- progress_bar->percent_done = 0.0;
+ progress_bar->fraction_done = 0.0;
return progress_bar;
}
*/
fill_area = progress_bar->area;
- fill_area.width = progress_bar->area.width * progress_bar->percent_done;
+ fill_area.width = progress_bar->area.width * progress_bar->fraction_done;
ply_pixel_buffer_fill_with_hex_color (buffer, &fill_area, progress_bar->fg_color);
fill_area.x = fill_area.x + fill_area.width;
}
void
-ply_progress_bar_set_percent_done (ply_progress_bar_t *progress_bar,
- double percent_done)
+ply_progress_bar_set_fraction_done (ply_progress_bar_t *progress_bar,
+ double fraction_done)
{
- progress_bar->percent_done = percent_done;
+ progress_bar->fraction_done = fraction_done;
ply_progress_bar_draw (progress_bar);
}
double
-ply_progress_bar_get_percent_done (ply_progress_bar_t *progress_bar)
+ply_progress_bar_get_fraction_done (ply_progress_bar_t *progress_bar)
{
- return progress_bar->percent_done;
+ return progress_bar->fraction_done;
}
void
long ply_progress_bar_get_width (ply_progress_bar_t *bar);
long ply_progress_bar_get_height (ply_progress_bar_t *bar);
-void ply_progress_bar_set_percent_done (ply_progress_bar_t *bar,
- double percent_done);
-double ply_progress_bar_get_percent_done (ply_progress_bar_t *bar);
+void ply_progress_bar_set_fraction_done (ply_progress_bar_t *bar,
+ double fraction_done);
+double ply_progress_bar_get_fraction_done (ply_progress_bar_t *bar);
void ply_progress_bar_set_colors (ply_progress_bar_t *bar,
uint32_t fg_color,
static void
on_boot_progress (ply_boot_splash_plugin_t *plugin,
double duration,
- double percent_done)
+ double fraction_done)
{
script_lib_plymouth_on_boot_progress (plugin->script_state,
plugin->script_plymouth_lib,
duration,
- percent_done);
+ fraction_done);
}
static bool
static void
on_boot_progress (ply_boot_splash_plugin_t *plugin,
double duration,
- double percent_done)
+ double fraction_done)
{
if (plugin->progress_target < 0)
- plugin->progress = percent_done;
- plugin->progress_target = percent_done;
+ plugin->progress = fraction_done;
+ plugin->progress_target = fraction_done;
}
static void
static void
on_boot_progress (ply_boot_splash_plugin_t *plugin,
double duration,
- double percent_done)
+ double fraction_done)
{
ply_list_node_t *node;
double total_duration;
- total_duration = duration / percent_done;
+ total_duration = duration / fraction_done;
/* Fun made-up smoothing function to make the growth asymptotic:
* fraction(time,estimate)=1-2^(-(time^1.45)/estimate) */
- percent_done = 1.0 - pow (2.0, -pow (duration, 1.45) / total_duration) * (1.0 - percent_done);
+ fraction_done = 1.0 - pow (2.0, -pow (duration, 1.45) / total_duration) * (1.0 - fraction_done);
node = ply_list_get_first_node (plugin->views);
view = ply_list_node_get_data (node);
next_node = ply_list_get_next_node (plugin->views, node);
- ply_text_step_bar_set_percent_done (view->step_bar, percent_done);
+ ply_text_step_bar_set_fraction_done (view->step_bar, fraction_done);
if (plugin->is_animating)
ply_text_step_bar_draw (view->step_bar);
static void
on_boot_progress (ply_boot_splash_plugin_t *plugin,
double duration,
- double percent_done)
+ double fraction_done)
{
ply_list_node_t *node;
double total_duration;
- total_duration = duration / percent_done;
+ total_duration = duration / fraction_done;
/* Fun made-up smoothing function to make the growth asymptotic:
* fraction(time,estimate)=1-2^(-(time^1.45)/estimate) */
- percent_done = 1.0 - pow (2.0, -pow (duration, 1.45) / total_duration) * (1.0 - percent_done);
+ fraction_done = 1.0 - pow (2.0, -pow (duration, 1.45) / total_duration) * (1.0 - fraction_done);
node = ply_list_get_first_node (plugin->views);
view = ply_list_node_get_data (node);
next_node = ply_list_get_next_node (plugin->views, node);
- ply_text_progress_bar_set_percent_done (view->progress_bar, percent_done);
+ ply_text_progress_bar_set_fraction_done (view->progress_bar, fraction_done);
if (plugin->is_animating)
ply_text_progress_bar_draw (view->progress_bar);
#define FRAMES_PER_SECOND 30
#endif
-#ifndef SHOW_ANIMATION_PERCENT
-#define SHOW_ANIMATION_PERCENT 0.9
+#ifndef SHOW_ANIMATION_FRACTION
+#define SHOW_ANIMATION_FRACTION 0.9
#endif
#define PROGRESS_BAR_WIDTH 400
static void
update_progress_animation (ply_boot_splash_plugin_t *plugin,
- double percent_done)
+ double fraction_done)
{
ply_list_node_t *node;
view_t *view;
view = ply_list_node_get_data (node);
if (view->progress_animation != NULL)
- ply_progress_animation_set_percent_done (view->progress_animation,
- percent_done);
+ ply_progress_animation_set_fraction_done (view->progress_animation,
+ fraction_done);
- ply_progress_bar_set_percent_done (view->progress_bar, percent_done);
+ ply_progress_bar_set_fraction_done (view->progress_bar, fraction_done);
if (!ply_progress_bar_is_hidden (view->progress_bar) &&
plugin->mode_settings[plugin->mode].progress_bar_show_percent_complete) {
- snprintf (buf, sizeof(buf), _("%d%% complete"), (int)(percent_done * 100));
+ snprintf (buf, sizeof(buf), _("%d%% complete"), (int)(fraction_done * 100));
view_show_message (view, buf);
}
static void
on_boot_progress (ply_boot_splash_plugin_t *plugin,
double duration,
- double percent_done)
+ double fraction_done)
{
if (plugin->mode == PLY_BOOT_SPLASH_MODE_UPDATES ||
plugin->mode == PLY_BOOT_SPLASH_MODE_SYSTEM_UPGRADE ||
* become_idle gets called.
*/
if (plugin->mode_settings[plugin->mode].use_end_animation &&
- percent_done >= SHOW_ANIMATION_PERCENT) {
+ fraction_done >= SHOW_ANIMATION_FRACTION) {
if (plugin->stop_trigger == NULL) {
ply_trace ("boot progressed to end");
} else {
double total_duration;
- percent_done *= (1 / SHOW_ANIMATION_PERCENT);
+ fraction_done *= (1 / SHOW_ANIMATION_FRACTION);
switch (plugin->progress_function) {
/* Fun made-up smoothing function to make the growth asymptotic:
* fraction(time,estimate)=1-2^(-(time^1.45)/estimate) */
case PROGRESS_FUNCTION_TYPE_WWOODS:
- total_duration = duration / percent_done;
- percent_done = 1.0 - pow (2.0, -pow (duration, 1.45) / total_duration) * (1.0 - percent_done);
+ total_duration = duration / fraction_done;
+ fraction_done = 1.0 - pow (2.0, -pow (duration, 1.45) / total_duration) * (1.0 - fraction_done);
break;
case PROGRESS_FUNCTION_TYPE_LINEAR:
break;
}
- update_progress_animation (plugin, percent_done);
+ update_progress_animation (plugin, fraction_done);
}
}