]> www.fi.muni.cz Git - evince.git/commitdiff
[dualscreen] timer skeleton
authorLukáš Bezdička <255993@mail.muni.cz>
Thu, 28 Apr 2011 17:53:28 +0000 (19:53 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 1 Jun 2011 11:09:22 +0000 (13:09 +0200)
shell/ev-presentation-timer.c [new file with mode: 0644]
shell/ev-presentation-timer.h [new file with mode: 0644]

diff --git a/shell/ev-presentation-timer.c b/shell/ev-presentation-timer.c
new file mode 100644 (file)
index 0000000..abf5d6d
--- /dev/null
@@ -0,0 +1,84 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
+/* this file is part of evince, a gnome document viewer
+ *
+ *
+ *  Author:
+ *    Lukas Bezdicka <255993@mail.muni.cz>
+ *
+ * Evince 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Evince 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <cairo.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <math.h>
+
+#include "ev-presentation-timer.h"
+
+struct _EvPresentationTimerPrivate
+{
+       cairo_surface_t *surface;
+};
+
+#define EV_PRESENTATION_TIMER_GET_PRIVATE(object) \
+       (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_PRESENTATION_TIMER, EvPresentationTimerPrivate))
+
+G_DEFINE_TYPE (EvPresentationTimer, ev_presentation_timer, GTK_TYPE_DRAWING_AREA);
+
+
+static gboolean
+ev_presentation_timer_draw(GtkWidget *timer, cairo_t *cr)
+{
+  cairo_set_source_rgb(cr, 0, 0, 0);
+  cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
+      CAIRO_FONT_WEIGHT_NORMAL);
+  cairo_set_font_size(cr, 40.0);
+
+  cairo_move_to(cr, 10.0, 50.0);
+  cairo_show_text(cr, "Disziplin ist Macht.");
+
+       return FALSE;
+}
+
+static void
+ev_presentation_timer_init (EvPresentationTimer *ev_timer)
+{
+//     ev_timer->priv = EV_DSCWINDOW_GET_PRIVATE (ev_timer);
+}
+
+static void
+ev_presentation_timer_class_init (EvPresentationTimerClass *klass)
+{
+       GObjectClass    *object_class = G_OBJECT_CLASS (klass);
+       GtkWidgetClass  *widget_class = GTK_WIDGET_CLASS (klass);
+       //GtkDrawingAreaClass     *drawing_area_class = GTK_DRAWING_AREA_CLASS (klass);
+       g_type_class_add_private (object_class, sizeof (EvPresentationTimerPrivate));
+       widget_class->draw = ev_presentation_timer_draw;
+
+       /*object_class->finalize = ev_presentation_timer_finalize;*/
+}
+
+GtkWidget *
+ev_presentation_timer_new (void)
+{
+       EvPresentationTimer     *ev_timer;
+
+       ev_timer = g_object_new (EV_TYPE_PRESENTATION_TIMER, NULL);
+        return GTK_WIDGET (ev_timer);
+}
diff --git a/shell/ev-presentation-timer.h b/shell/ev-presentation-timer.h
new file mode 100644 (file)
index 0000000..3dc5208
--- /dev/null
@@ -0,0 +1,55 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
+/* this file is part of evince, a gnome document viewer
+ *
+ *
+ *  Author:
+ *    Lukas Bezdicka <255993@mail.muni.cz>
+ *
+ * Evince 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Evince 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _EV_PRESENTATION_TIMER_H_
+#define _EV_PRESENTATION_TIMER_H_
+
+G_BEGIN_DECLS
+
+typedef struct _EvPresentationTimerClass       EvPresentationTimerClass;
+typedef struct _EvPresentationTimer            EvPresentationTimer;
+typedef struct _EvPresentationTimerPrivate      EvPresentationTimerPrivate;
+
+#define EV_TYPE_PRESENTATION_TIMER                     (ev_presentation_timer_get_type ())
+#define EV_PRESENTATION_TIMER(object)                  (G_TYPE_CHECK_INSTANCE_CAST ((object), EV_TYPE_PRESENTATION_TIMER, EvPresentationTimer))
+#define EV_PRESENTATION_TIMER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_PRESENTATION_TIMER, EvPresentationTimerClass))
+#define EV_IS_PRESENTATION_TIMER(object)       (G_TYPE_CHECK_INSTANCE_TYPE ((object), EV_TYPE_PRESENTATION_TIMER))
+#define EV_IS_PRESENTATION_TIMER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_PRESENTATION_TIMER))
+#define EV_PRESENTATION_TIMER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), EV_TYPE_PRESENTATION_TIMER, EvPresentationTimerClass))
+
+struct _EvPresentationTimerClass
+{
+       GtkDrawingAreaClass parent_class;
+};
+
+struct _EvPresentationTimer
+{
+       GtkDrawingArea                  parent_instance;
+       EvPresentationTimerPrivate     *priv;
+};
+
+GType                  ev_presentation_timer_get_type     (void);
+GtkWidget             *ev_presentation_timer_new          (void);
+
+G_END_DECLS
+
+#endif /* _EV_PRESENTATION_TIMER_H_ */