viscal

cairo/gtk vi-like timeblocking calendar
git clone git://jb55.com/viscal
Log | Files | Refs | README | LICENSE

commit e34b5a50e96269fd0aac1cd17995b5a1776bb40c
parent bff3f388e6ec053a80620652d7352129f34d98ea
Author: William Casarin <bill@casarin.me>
Date:   Sun, 26 Mar 2017 20:04:33 -0700

fix gcc errors

fixes #1

Diffstat:
MMakefile | 1+
Mcalendar.c | 6+++---
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile @@ -12,6 +12,7 @@ CFLAGS=-Wall \ -Werror=int-conversion \ -std=c99 \ -g \ + -lm \ `pkg-config --cflags --libs $(DEPS)` tags: TAGS diff --git a/calendar.c b/calendar.c @@ -21,9 +21,10 @@ __typeof__ (b) _b = (b); \ _a < _b ? _a : _b; }) +#define MAX_EVENTS 1024 + static const double BGCOLOR = 0.35; static const int DAY_SECONDS = 86400; -static const int MAX_EVENTS = 1024; static const int TXTPAD = 11; static const int EVPAD = 2; static const int EVMARGIN = 1; @@ -827,11 +828,9 @@ event_draw (cairo_t *cr, struct cal *cal, struct event *ev) { cairo_set_source_rgba(cr, c.r, c.g, c.b, c.a); draw_rectangle(cr, ev->width, evheight); cairo_fill(cr); - // TODO txt extents to center // TODO: event text color static const double txtc = 0.2; cairo_set_source_rgb(cr, txtc, txtc, txtc); - // TODO: event text formatting based on rendered sizes and text exts if (isdate) { sprintf(buffer, "%s", summary); cairo_text_extents(cr, buffer, &exts); @@ -850,6 +849,7 @@ event_draw (cairo_t *cr, struct cal *cal, struct event *ev) { else { format_locale_timet(bsmall, 32, st); format_locale_timet(bsmall2, 32, et); + // TODO: configurable event format sprintf(buffer, "%d %s", len / 60, summary); cairo_text_extents(cr, buffer, &exts); double ey = evheight < exts.height