summaryrefslogtreecommitdiff
path: root/clock
diff options
context:
space:
mode:
Diffstat (limited to 'clock')
-rw-r--r--clock/Makefile11
-rw-r--r--clock/src/clockface.h21
-rw-r--r--clock/src/main.cc4
3 files changed, 26 insertions, 10 deletions
diff --git a/clock/Makefile b/clock/Makefile
index 22579b7..a18db40 100644
--- a/clock/Makefile
+++ b/clock/Makefile
@@ -7,17 +7,10 @@ dbg = -g
opt = -O0
inc = -Isrc -I../libwinnie/src
-backend = SDL
-
-ifeq ($(backend), SDL)
- def = -DWINNIE_SDL
- libs = -lSDL
-else
- def = -DWINNIE_FBDEV
-endif
+include ../backend.mk
CXX = g++
-CXXFLAGS = -pedantic -Wall $(dbg) $(opt) $(inc) $(def) `freetype-config --cflags`
+CXXFLAGS = -pedantic -Wall -fPIC $(dbg) $(opt) $(inc) $(def) `freetype-config --cflags`
LDFLAGS = -L../libwinnie/ $(libs) `freetype-config --libs` -lrt -lwinnie -ldl
$(lib_so): $(obj)
diff --git a/clock/src/clockface.h b/clock/src/clockface.h
index f3bf1e5..957b081 100644
--- a/clock/src/clockface.h
+++ b/clock/src/clockface.h
@@ -1,3 +1,24 @@
+/*
+winnie - an experimental window system
+
+Copyright (C) 2013 Eleni Maria Stea
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Author: Eleni Maria Stea <elene.mst@gmail.com>
+*/
+
/* GIMP RGB C-Source image dump (clockface.c) */
static const struct {
diff --git a/clock/src/main.cc b/clock/src/main.cc
index 3ede2e1..50743d4 100644
--- a/clock/src/main.cc
+++ b/clock/src/main.cc
@@ -58,6 +58,8 @@ extern "C" bool init()
}
wm->add_window(clock_win);
+
+ set_window_timer(clock_win, 1000, TIMER_REPEAT);
return true;
}
@@ -139,5 +141,5 @@ static void motion(Window *win, int x, int y)
static void timer(Window *win)
{
- gfx_update(win->get_absolute_rect());
+ wm->invalidate_region(win->get_absolute_rect());
}