Commit 1a14f7fd authored by Christoffer Ackelman's avatar Christoffer Ackelman

Gtk: Removed the redraw timer since we redraw if dirty on scan.

parent 7f9c50f0
......@@ -98,7 +98,6 @@ static GdkColor flow_allocate_color(
static void event_timer(FlowCtx* ctx, int time_ms);
static void cancel_event_timer(FlowCtx* ctx);
static gboolean event_timer_cb(void* ctx);
static gboolean redraw_timer_cb(void* ctx);
static void flow_create_cursor(FlowDrawGtk* draw_ctx)
{
......@@ -336,8 +335,6 @@ FlowDrawGtk::~FlowDrawGtk()
{
closing_down = 1;
cancel_redraw_timer();
ctx->set_nodraw();
delete ctx;
draw_free_gc(this);
......@@ -1293,28 +1290,6 @@ static void event_timer(FlowCtx* ctx, int time_ms)
draw_ctx->timer_id = g_timeout_add(time_ms, event_timer_cb, ctx);
}
static gboolean redraw_timer_cb(void* data) {
FlowDrawGtk* draw_ctx = (FlowDrawGtk*)data;
draw_ctx->redraw_timer = 0;
draw_ctx->ctx->redraw_if_dirty();
return FALSE;
}
void FlowDrawGtk::cancel_redraw_timer()
{
if (redraw_timer) {
g_source_remove(redraw_timer);
redraw_timer = 0;
}
}
void FlowDrawGtk::start_redraw_timer()
{
if (!redraw_timer) {
redraw_timer = g_timeout_add(40, redraw_timer_cb, this);
}
}
void FlowDrawGtk::set_timer(FlowCtx* ctx, int time_ms,
void (*callback_func)(FlowCtx* ctx), void** id)
{
......
......@@ -75,7 +75,6 @@ public:
GdkColor color_vect[20];
int color_vect_cnt;
int closing_down;
guint redraw_timer;
FlowDrawGtk(GtkWidget* toplevel, void** flow_ctx,
int (*init_proc)(GtkWidget* w, FlowCtx* ctx, void* client_data),
......@@ -93,8 +92,6 @@ public:
int begin(DrawWind *wind);
void end();
void start_redraw_timer();
void cancel_redraw_timer();
void rect(int x, int y, int width, int height, flow_eDrawType gc_type,
int fill, int idx, int highlight = 0, int dimmed = 0);
......
......@@ -515,7 +515,6 @@ void FlowCtx::get_borders()
void FlowCtx::set_dirty()
{
is_dirty = 1;
fdraw->start_redraw_timer();
}
void FlowCtx::redraw_if_dirty()
......@@ -525,7 +524,6 @@ void FlowCtx::redraw_if_dirty()
}
if (is_dirty) {
is_dirty = 0;
fdraw->cancel_redraw_timer();
fdraw->begin(mw);
fdraw->clear();
draw(0, 0, window_width, window_height);
......
......@@ -59,8 +59,6 @@ public:
virtual int begin(DrawWind* wind);
virtual void end();
virtual void start_redraw_timer() {}
virtual void cancel_redraw_timer() {}
virtual void rect(int x, int y, int width, int height, flow_eDrawType gc_type,
int fill, int idx, int highlight = 0, int dimmed = 0) = 0;
......
......@@ -172,7 +172,6 @@ static GdkColor glow_allocate_custom_color(GlowDrawGtk* draw_ctx,
static void event_timer(GlowDrawGtk* ctx, int time_ms);
static void cancel_event_timer(GlowDrawGtk* ctx);
static gboolean event_timer_cb(void* ctx);
static gboolean redraw_timer_cb(void* ctx);
static int glow_read_color_file(
const char* filename, draw_sColor** color_array, int* size);
......@@ -531,8 +530,6 @@ GlowDrawGtk::~GlowDrawGtk()
{
closing_down = 1;
cancel_redraw_timer();
ctx->set_nodraw();
if (ctx->type() == glow_eCtxType_Grow)
delete (GrowCtx*)ctx;
......@@ -1633,28 +1630,6 @@ static void event_timer(GlowDrawGtk* draw_ctx, int time_ms)
draw_ctx->timer_id = g_timeout_add(time_ms, event_timer_cb, draw_ctx);
}
static gboolean redraw_timer_cb(void* data) {
GlowDrawGtk* draw_ctx = (GlowDrawGtk*)data;
draw_ctx->redraw_timer = 0;
draw_ctx->ctx->redraw_if_dirty();
return FALSE;
}
void GlowDrawGtk::cancel_redraw_timer()
{
if (redraw_timer) {
g_source_remove(redraw_timer);
redraw_timer = 0;
}
}
void GlowDrawGtk::start_redraw_timer()
{
if (!redraw_timer) {
redraw_timer = g_timeout_add(40, redraw_timer_cb, this);
}
}
void GlowDrawGtk::set_timer(
GlowCtx* gctx, int time_ms, void (*callback_func)(GlowCtx* ctx), void** id)
{
......
......@@ -111,7 +111,6 @@ public:
int closing_down;
GlowCustomColorsGtk* customcolors[CUSTOMCOLORS_STACK_SIZE];
int customcolors_cnt;
guint redraw_timer;
void event_handler(GdkEvent event);
void enable_event(glow_eEvent event, glow_eEventType event_type,
......@@ -120,8 +119,6 @@ public:
int begin(DrawWind* wind);
void end(bool flush = true);
void start_redraw_timer();
void cancel_redraw_timer();
void get_window_size(DrawWind* w, int* width, int* height);
void set_window_size(DrawWind* w, int width, int height);
......
......@@ -672,7 +672,6 @@ void GlowCtx::get_borders()
void GlowCtx::set_dirty()
{
is_dirty = 1;
gdraw->start_redraw_timer();
}
void GlowCtx::redraw_if_dirty()
......@@ -682,7 +681,6 @@ void GlowCtx::redraw_if_dirty()
}
if (is_dirty) {
is_dirty = 0;
gdraw->cancel_redraw_timer();
gdraw->begin(mw);
gdraw->clear();
draw(mw, 0, 0, mw->window_width, mw->window_height);
......
......@@ -81,8 +81,6 @@ public:
virtual int begin(DrawWind* wind) = 0;
virtual void end(bool flush = true) = 0;
virtual void start_redraw_timer() {}
virtual void cancel_redraw_timer() {}
virtual void rect(int x, int y, int width, int height, glow_eDrawType gc_type,
int fill, int idx, int highlight = 0) = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment