From ee62356349d51d0e372e96938d89735cd2b51ca0 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 13 May 2016 15:29:08 +0200 Subject: [PATCH] new function timeline_get_width --- common/utils/T/tracer/gui/gui.h | 1 + common/utils/T/tracer/gui/timeline.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/common/utils/T/tracer/gui/gui.h b/common/utils/T/tracer/gui/gui.h index 5902ea2831..2a60e08e96 100644 --- a/common/utils/T/tracer/gui/gui.h +++ b/common/utils/T/tracer/gui/gui.h @@ -59,6 +59,7 @@ void timeline_add_points(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); void gui_loop(gui *gui); diff --git a/common/utils/T/tracer/gui/timeline.c b/common/utils/T/tracer/gui/timeline.c index 9e794dda4c..7c8469f928 100644 --- a/common/utils/T/tracer/gui/timeline.c +++ b/common/utils/T/tracer/gui/timeline.c @@ -148,3 +148,15 @@ void timeline_set_subline_background_color(gui *_gui, widget *_this, gunlock(g); } + +void timeline_get_width(gui *_gui, widget *_this, int *width) +{ + struct gui *g = _gui; + struct timeline_widget *this = _this; + + glock(g); + + *width = this->common.width == 0 ? this->wanted_width : this->common.width; + + gunlock(g); +} -- GitLab