Change throbber to take window instead of framebuffer

We want the throbber to know about the window it's in,
so that it will be easier to move drawing code to a
draw handler model
calculate-0.9.5
Ray Strode 17 years ago
parent cae6ca26f3
commit 788359b9ec

@ -189,7 +189,7 @@ start_animation (ply_boot_splash_plugin_t *plugin)
height = throbber_get_height (plugin->throbber);
throbber_start (plugin->throbber,
plugin->loop,
plugin->frame_buffer,
plugin->window,
area.width / 2.0 - width / 2.0,
area.width / 2.0 - height / 2.0);
}

@ -62,6 +62,7 @@ struct _throbber
char *image_dir;
char *frames_prefix;
ply_window_t *window;
ply_frame_buffer_t *frame_buffer;
ply_frame_buffer_area_t frame_area;
@ -261,7 +262,7 @@ out:
bool
throbber_start (throbber_t *throbber,
ply_event_loop_t *loop,
ply_frame_buffer_t *frame_buffer,
ply_window_t *window,
long x,
long y)
{
@ -275,7 +276,8 @@ throbber_start (throbber_t *throbber,
}
throbber->loop = loop;
throbber->frame_buffer = frame_buffer;
throbber->window = window;
throbber->frame_buffer = ply_window_get_frame_buffer (window);;
throbber->x = x;
throbber->y = y;
@ -297,6 +299,7 @@ throbber_stop (throbber_t *throbber)
ply_frame_buffer_fill_with_color (throbber->frame_buffer, &throbber->frame_area,
0.0, 0.43, .71, 1.0);
throbber->frame_buffer = NULL;
throbber->window = NULL;
if (throbber->loop != NULL)
{

@ -28,6 +28,7 @@
#include "ply-event-loop.h"
#include "ply-frame-buffer.h"
#include "ply-window.h"
typedef struct _throbber throbber_t;
@ -38,7 +39,7 @@ void throbber_free (throbber_t *throbber);
bool throbber_start (throbber_t *throbber,
ply_event_loop_t *loop,
ply_frame_buffer_t *frame_buffer,
ply_window_t *window,
long x,
long y);
void throbber_stop (throbber_t *throbber);

Loading…
Cancel
Save