Commit f49489a6 authored by Cedric Roux's avatar Cedric Roux
Browse files

add _silent functions for gui/timeline.c, the way view/time.c uses it

requires those optimizations
parent 0cf4738d
......@@ -55,8 +55,11 @@ void textlist_get_line(gui *gui, widget *this, int line,
void textlist_set_color(gui *gui, widget *this, int line, int color);
void timeline_clear(gui *gui, widget *this);
void timeline_clear_silent(gui *gui, widget *this);
void timeline_add_points(gui *gui, widget *this, int subline, int color,
int *x, int len);
void timeline_add_points_silent(gui *gui, widget *this, int subline,
int color, int *x, int len);
void timeline_set_subline_background_color(gui *gui, widget *this,
int subline, int color);
void timeline_get_width(gui *gui, widget *this, int *width);
......
......@@ -97,7 +97,7 @@ widget *new_timeline(gui *_gui, int width, int number_of_sublines,
/* public functions */
/*************************************************************************/
void timeline_clear(gui *_gui, widget *_this)
static void _timeline_clear(gui *_gui, widget *_this, int silent)
{
struct gui *g = _gui;
struct timeline_widget *this = _this;
......@@ -110,13 +110,24 @@ void timeline_clear(gui *_gui, widget *_this)
for (j = 0; j < this->s[i].width; j++)
this->s[i].color[j] = -1;
send_event(g, DIRTY, this->common.id);
if (silent == 0)
send_event(g, DIRTY, this->common.id);
gunlock(g);
}
void timeline_add_points(gui *_gui, widget *_this, int subline, int color,
int *x, int len)
void timeline_clear(gui *_gui, widget *_this)
{
_timeline_clear(_gui, _this, 0);
}
void timeline_clear_silent(gui *_gui, widget *_this)
{
_timeline_clear(_gui, _this, 1);
}
static void _timeline_add_points(gui *_gui, widget *_this, int subline,
int color, int *x, int len, int silent)
{
struct gui *g = _gui;
struct timeline_widget *this = _this;
......@@ -129,11 +140,24 @@ void timeline_add_points(gui *_gui, widget *_this, int subline, int color,
this->s[subline].color[x[i]] = color;
}
send_event(g, DIRTY, this->common.id);
if (silent == 0)
send_event(g, DIRTY, this->common.id);
gunlock(g);
}
void timeline_add_points(gui *_gui, widget *_this, int subline, int color,
int *x, int len)
{
_timeline_add_points(_gui, _this, subline, color, x, len, 0);
}
void timeline_add_points_silent(gui *_gui, widget *_this, int subline,
int color, int *x, int len)
{
_timeline_add_points(_gui, _this, subline, color, x, len, 1);
}
void timeline_set_subline_background_color(gui *_gui, widget *_this,
int subline, int color)
{
......
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