summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/charts.c6
-rw-r--r--src/vcr.c3
-rw-r--r--src/vcr.h7
3 files changed, 11 insertions, 5 deletions
diff --git a/src/charts.c b/src/charts.c
index 30eca06..eadfc01 100644
--- a/src/charts.c
+++ b/src/charts.c
@@ -457,7 +457,7 @@ static void print_argv(const vwm_charts_t *charts, const vwm_chart_t *chart, int
assert(chart);
proc_argv2strs(proc, strs, NELEMS(strs), &n_strs);
- vcr_draw_text(chart->vcr, VCR_LAYER_TEXT, x, row, strs, n_strs, res_width);
+ vcr_draw_text(chart->vcr, VCR_LAYER_TEXT, VCR_TEXT_FLAGS_CLIPPED, x, row, strs, n_strs, res_width);
}
@@ -800,7 +800,7 @@ static void draw_row_columns(vwm_charts_t *charts, vwm_chart_t *chart, vwm_row_c
int str_width, xpos;
/* get the width first, so we can place the text, note the -1 to suppress drawings */
- vcr_draw_text(chart->vcr, VCR_LAYER_TEXT, -1 /* x */, -1 /* row */, strs, 1, &str_width);
+ vcr_draw_text(chart->vcr, VCR_LAYER_TEXT, VCR_TEXT_FLAGS_CLIPPED, -1 /* x */, -1 /* row */, strs, 1, &str_width);
if (uniform && str_width > c->width) {
c->width = str_width;
chart->redraw_needed++;
@@ -838,7 +838,7 @@ static void draw_row_columns(vwm_charts_t *charts, vwm_chart_t *chart, vwm_row_c
assert(0);
}
- vcr_draw_text(chart->vcr, VCR_LAYER_TEXT, xpos, row, strs, 1, NULL);
+ vcr_draw_text(chart->vcr, VCR_LAYER_TEXT, VCR_TEXT_FLAGS_CLIPPED, xpos, row, strs, 1, NULL);
}
if (advance) {
diff --git a/src/vcr.c b/src/vcr.c
index 5406a9d..93155be 100644
--- a/src/vcr.c
+++ b/src/vcr.c
@@ -944,7 +944,7 @@ int vcr_resize_visible(vcr_t *vcr, int width, int height)
* x may be negative or extend outside vcr bounds, clipping will be performed as needed.
*/
/* XXX: maybe these strs should also include lengths instead of being null-terminated */
-void vcr_draw_text(vcr_t *vcr, vcr_layer_t layer, int x, int row, const vcr_str_t *strs, int n_strs, int *res_width)
+void vcr_draw_text(vcr_t *vcr, vcr_layer_t layer, vcr_text_flags_t flags, int x, int row, const vcr_str_t *strs, int n_strs, int *res_width)
{
assert(vcr);
assert(vcr->backend);
@@ -952,6 +952,7 @@ void vcr_draw_text(vcr_t *vcr, vcr_layer_t layer, int x, int row, const vcr_str_
assert(row >= 0 || res_width);
assert(strs);
assert(n_strs > 0);
+ assert(flags < VCR_TEXT_FLAGS_CNT);
/* FIXME: this should really be able to draw text into any valid layer,
* it's just the pictures/pixmaps in vcr_t aren't currently organized as an
* array easily indexed by the layer enum. TODO
diff --git a/src/vcr.h b/src/vcr.h
index 612ac23..23294fa 100644
--- a/src/vcr.h
+++ b/src/vcr.h
@@ -44,6 +44,11 @@ typedef enum vcr_bar_base_t {
VCR_BAR_BASE_CNT
} vcr_bar_base_t;
+typedef enum vcr_text_flags_t {
+ VCR_TEXT_FLAGS_CLIPPED,
+ VCR_TEXT_FLAGS_CNT
+} vcr_text_flags_t;
+
typedef struct vcr_backend_t vcr_backend_t;
typedef struct vcr_dest_t vcr_dest_t;
typedef struct vcr_t vcr_t;
@@ -72,7 +77,7 @@ vcr_dest_t * vcr_dest_free(vcr_dest_t *dest);
vcr_t * vcr_new(vcr_backend_t *vbe, int *hierarchy_end_ptr, int *snowflakes_cnt_ptr, const unsigned *marker_distance_ptr);
vcr_t * vcr_free(vcr_t *vcr);
int vcr_resize_visible(vcr_t *vcr, int width, int height);
-void vcr_draw_text(vcr_t *vcr, vcr_layer_t layer, int x, int row, const vcr_str_t *strs, int n_strs, int *res_width);
+void vcr_draw_text(vcr_t *vcr, vcr_layer_t layer, vcr_text_flags_t flags, int x, int row, const vcr_str_t *strs, int n_strs, int *res_width);
void vcr_draw_ortho_line(vcr_t *vcr, vcr_layer_t layer, int x1, int y1, int x2, int y2);
void vcr_mark_finish_line(vcr_t *vcr, vcr_layer_t layer, int row);
void vcr_draw_bar(vcr_t *vcr, vcr_layer_t layer, vcr_bar_base_t base, int row, int height);
© All Rights Reserved