if (!ply_image_load (plugin->box_image))
return false;
+ ply_trace ("loading throbber");
+ if (!throbber_load (plugin->throbber))
+ return false;
+
plugin->window = window;
ply_trace ("setting graphics mode");
throbber->frames = ply_array_new ();
throbber->frames_prefix = strdup (frames_prefix);
throbber->image_dir = strdup (image_dir);
- throbber->width = 82;
- throbber->height = 47;
+ throbber->width = 0;
+ throbber->height = 0;
throbber->frame_area.width = 0;
throbber->frame_area.height = 0;
- throbber->frame_area.x = 700;
- throbber->frame_area.y = 700;
+ throbber->frame_area.x = 0;
+ throbber->frame_area.y = 0;
return throbber;
}
return load_finished;
}
+bool
+throbber_load (throbber_t *throbber)
+{
+ if (ply_array_get_size (throbber->frames) != 0)
+ throbber_remove_frames (throbber->frames);
+
+ if (!throbber_add_frames (throbber))
+ return false;
+
+ return true;
+}
+
bool
throbber_start (throbber_t *throbber,
ply_event_loop_t *loop,
assert (throbber != NULL);
assert (throbber->loop == NULL);
- if (ply_array_get_size (throbber->frames) == 0)
- {
- if (!throbber_add_frames (throbber))
- return false;
- }
-
throbber->loop = loop;
throbber->window = window;
throbber->frame_buffer = ply_window_get_frame_buffer (window);;
const char *frames_prefix);
void throbber_free (throbber_t *throbber);
+bool throbber_load (throbber_t *throbber);
bool throbber_start (throbber_t *throbber,
ply_event_loop_t *loop,
ply_window_t *window,