diff --git a/common/utils/T/tracer/gui/Makefile b/common/utils/T/tracer/gui/Makefile index 7129d390b95319fc5e78b043aa3decf29436540b..fb3a9486d832355c2508755c0c4abd21c1e6992e 100644 --- a/common/utils/T/tracer/gui/Makefile +++ b/common/utils/T/tracer/gui/Makefile @@ -3,7 +3,7 @@ CFLAGS=-Wall -g -pthread OBJS=init.o loop.o toplevel_window.o x.o container.o widget.o \ gui.o label.o event.o xy_plot.o textlist.o notify.o positioner.o \ - timeline.o + timeline.o space.o gui.a: $(OBJS) ar cr gui.a $(OBJS) diff --git a/common/utils/T/tracer/gui/gui.h b/common/utils/T/tracer/gui/gui.h index 6d36cddfd672e295f59eba47929d2101daf8c5b5..208a3c2a5474c81fe61b7a90bdc9693bed44df0f 100644 --- a/common/utils/T/tracer/gui/gui.h +++ b/common/utils/T/tracer/gui/gui.h @@ -33,6 +33,7 @@ widget *new_xy_plot(gui *gui, int width, int height, char *label, widget *new_textlist(gui *gui, int width, int nlines, int background_color); widget *new_timeline(gui *gui, int width, int number_of_sublines, int subline_height); +widget *new_space(gui *gui, int width, int height); void label_set_clickable(gui *gui, widget *label, int clickable); diff --git a/common/utils/T/tracer/gui/gui_defs.h b/common/utils/T/tracer/gui/gui_defs.h index 5b8469ad9a3da9437cdb3a21a6813e7825778744..dc3559c82c7e14ac685bcfaf93e9e47d39832a8a 100644 --- a/common/utils/T/tracer/gui/gui_defs.h +++ b/common/utils/T/tracer/gui/gui_defs.h @@ -31,7 +31,7 @@ extern int volatile gui_logd; enum widget_type { TOPLEVEL_WINDOW, CONTAINER, POSITIONER, TEXT_LIST, XY_PLOT, BUTTON, LABEL, - TIMELINE + TIMELINE, SPACE }; struct widget_list; @@ -148,6 +148,12 @@ struct label_widget { int baseline; /* as given by the graphic's backend */ }; +struct space_widget { + struct widget common; + int wanted_width; + int wanted_height; +}; + /*************************************************************************/ /* events */ /*************************************************************************/ diff --git a/common/utils/T/tracer/gui/space.c b/common/utils/T/tracer/gui/space.c new file mode 100644 index 0000000000000000000000000000000000000000..c98600b88dc6edecac53d1e0417d533a312c1c4e --- /dev/null +++ b/common/utils/T/tracer/gui/space.c @@ -0,0 +1,36 @@ +#include "gui.h" +#include "gui_defs.h" +#include <stdio.h> + +static void paint(gui *_gui, widget *_w) +{ + /* nothing */ +} + +static void hints(gui *_gui, widget *_w, int *width, int *height) +{ + struct space_widget *w = _w; + LOGD("HINTS space %p\n", w); + *width = w->wanted_width; + *height = w->wanted_height; +} + +widget *new_space(gui *_gui, int width, int height) +{ + struct gui *g = _gui; + struct space_widget *w; + + glock(g); + + w = new_widget(g, SPACE, sizeof(struct space_widget)); + + w->wanted_width = width; + w->wanted_height = height; + + w->common.paint = paint; + w->common.hints = hints; + + gunlock(g); + + return w; +} diff --git a/common/utils/T/tracer/gui/widget.c b/common/utils/T/tracer/gui/widget.c index 1d2b03a25f935aa3960c640cde248795f7fb353b..149f4be7f593d2e5ce5eac32499416af4c4361bb 100644 --- a/common/utils/T/tracer/gui/widget.c +++ b/common/utils/T/tracer/gui/widget.c @@ -265,12 +265,11 @@ void widget_dirty(gui *_gui, widget *_this) static const char *names[] = { "TOPLEVEL_WINDOW", "CONTAINER", "POSITIONER", "TEXT_LIST", - "XY_PLOT", "BUTTON", "LABEL", "TIMELINE" + "XY_PLOT", "BUTTON", "LABEL", "TIMELINE", "SPACE" }; const char *widget_name(enum widget_type type) { switch (type) { - default: break; case TOPLEVEL_WINDOW: case CONTAINER: case POSITIONER: @@ -279,6 +278,7 @@ const char *widget_name(enum widget_type type) case BUTTON: case LABEL: case TIMELINE: + case SPACE: return names[type]; } return "UNKNOWN (error)";