[Xfce4-commits] <xfce4-panel:devel> * Remove clock .svn files
Nick Schermer
nick at xfce.org
Tue Aug 11 20:22:20 CEST 2009
Updating branch refs/heads/devel
to d609b5d0ca7c404926ebec6f709de49d56c1b7d6 (commit)
from 20f7d188426198773079afb80bcba5578edfdc5d (commit)
commit d609b5d0ca7c404926ebec6f709de49d56c1b7d6
Author: Nick Schermer <nick at xfce.org>
Date: Sat Jun 21 11:11:45 2008 +0200
* Remove clock .svn files
plugins/clock/.svn/all-wcprops | 89 ---
plugins/clock/.svn/dir-prop-base | 10 -
plugins/clock/.svn/entries | 210 ------
plugins/clock/.svn/format | 1 -
plugins/clock/.svn/prop-base/Makefile.am.svn-base | 5 -
.../clock/.svn/prop-base/clock-analog.c.svn-base | 5 -
.../clock/.svn/prop-base/clock-analog.h.svn-base | 5 -
.../clock/.svn/prop-base/clock-binary.c.svn-base | 5 -
.../clock/.svn/prop-base/clock-binary.h.svn-base | 5 -
.../clock/.svn/prop-base/clock-dialog.c.svn-base | 5 -
.../clock/.svn/prop-base/clock-dialog.h.svn-base | 5 -
.../clock/.svn/prop-base/clock-digital.c.svn-base | 5 -
.../clock/.svn/prop-base/clock-digital.h.svn-base | 5 -
plugins/clock/.svn/prop-base/clock-lcd.c.svn-base | 5 -
plugins/clock/.svn/prop-base/clock-lcd.h.svn-base | 5 -
plugins/clock/.svn/prop-base/clock.c.svn-base | 9 -
.../.svn/prop-base/clock.desktop.in.in.svn-base | 5 -
plugins/clock/.svn/prop-base/clock.h.svn-base | 5 -
plugins/clock/.svn/text-base/Makefile.am.svn-base | 81 ---
.../clock/.svn/text-base/clock-analog.c.svn-base | 377 -----------
.../clock/.svn/text-base/clock-analog.h.svn-base | 43 --
.../clock/.svn/text-base/clock-binary.c.svn-base | 395 ------------
.../clock/.svn/text-base/clock-binary.h.svn-base | 43 --
.../clock/.svn/text-base/clock-dialog.c.svn-base | 563 -----------------
.../clock/.svn/text-base/clock-dialog.h.svn-base | 31 -
.../clock/.svn/text-base/clock-digital.c.svn-base | 226 -------
.../clock/.svn/text-base/clock-digital.h.svn-base | 43 --
plugins/clock/.svn/text-base/clock-lcd.c.svn-base | 551 ----------------
plugins/clock/.svn/text-base/clock-lcd.h.svn-base | 43 --
plugins/clock/.svn/text-base/clock.c.svn-base | 667 --------------------
.../.svn/text-base/clock.desktop.in.in.svn-base | 8 -
plugins/clock/.svn/text-base/clock.h.svn-base | 105 ---
32 files changed, 0 insertions(+), 3560 deletions(-)
diff --git a/plugins/clock/.svn/all-wcprops b/plugins/clock/.svn/all-wcprops
deleted file mode 100644
index 555f79b..0000000
--- a/plugins/clock/.svn/all-wcprops
+++ /dev/null
@@ -1,89 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 56
-/svn/xfce/!svn/ver/26625/xfce4-panel/trunk/plugins/clock
-END
-clock-analog.h
-K 25
-svn:wc:ra_dav:version-url
-V 71
-/svn/xfce/!svn/ver/25890/xfce4-panel/trunk/plugins/clock/clock-analog.h
-END
-clock-lcd.h
-K 25
-svn:wc:ra_dav:version-url
-V 68
-/svn/xfce/!svn/ver/25890/xfce4-panel/trunk/plugins/clock/clock-lcd.h
-END
-clock.h
-K 25
-svn:wc:ra_dav:version-url
-V 64
-/svn/xfce/!svn/ver/26385/xfce4-panel/trunk/plugins/clock/clock.h
-END
-clock-binary.h
-K 25
-svn:wc:ra_dav:version-url
-V 71
-/svn/xfce/!svn/ver/25890/xfce4-panel/trunk/plugins/clock/clock-binary.h
-END
-clock-digital.c
-K 25
-svn:wc:ra_dav:version-url
-V 72
-/svn/xfce/!svn/ver/25899/xfce4-panel/trunk/plugins/clock/clock-digital.c
-END
-Makefile.am
-K 25
-svn:wc:ra_dav:version-url
-V 68
-/svn/xfce/!svn/ver/25890/xfce4-panel/trunk/plugins/clock/Makefile.am
-END
-clock-dialog.c
-K 25
-svn:wc:ra_dav:version-url
-V 71
-/svn/xfce/!svn/ver/26477/xfce4-panel/trunk/plugins/clock/clock-dialog.c
-END
-clock-analog.c
-K 25
-svn:wc:ra_dav:version-url
-V 71
-/svn/xfce/!svn/ver/25905/xfce4-panel/trunk/plugins/clock/clock-analog.c
-END
-clock-digital.h
-K 25
-svn:wc:ra_dav:version-url
-V 72
-/svn/xfce/!svn/ver/25890/xfce4-panel/trunk/plugins/clock/clock-digital.h
-END
-clock-lcd.c
-K 25
-svn:wc:ra_dav:version-url
-V 68
-/svn/xfce/!svn/ver/26385/xfce4-panel/trunk/plugins/clock/clock-lcd.c
-END
-clock.c
-K 25
-svn:wc:ra_dav:version-url
-V 64
-/svn/xfce/!svn/ver/26625/xfce4-panel/trunk/plugins/clock/clock.c
-END
-clock.desktop.in.in
-K 25
-svn:wc:ra_dav:version-url
-V 76
-/svn/xfce/!svn/ver/25890/xfce4-panel/trunk/plugins/clock/clock.desktop.in.in
-END
-clock-binary.c
-K 25
-svn:wc:ra_dav:version-url
-V 71
-/svn/xfce/!svn/ver/25899/xfce4-panel/trunk/plugins/clock/clock-binary.c
-END
-clock-dialog.h
-K 25
-svn:wc:ra_dav:version-url
-V 71
-/svn/xfce/!svn/ver/25890/xfce4-panel/trunk/plugins/clock/clock-dialog.h
-END
diff --git a/plugins/clock/.svn/dir-prop-base b/plugins/clock/.svn/dir-prop-base
deleted file mode 100644
index fcca934..0000000
--- a/plugins/clock/.svn/dir-prop-base
+++ /dev/null
@@ -1,10 +0,0 @@
-K 10
-svn:ignore
-V 42
-Makefile
-Makefile.in
-.deps
-.libs
-*desktop
-
-END
diff --git a/plugins/clock/.svn/entries b/plugins/clock/.svn/entries
deleted file mode 100644
index 1c36f8e..0000000
--- a/plugins/clock/.svn/entries
+++ /dev/null
@@ -1,210 +0,0 @@
-8
-
-dir
-26625
-https://svn.xfce.org/svn/xfce/xfce4-panel/trunk/plugins/clock
-https://svn.xfce.org/svn/xfce
-
-
-
-2008-02-18T07:59:29.025147Z
-26625
-nick
-has-props
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-a0aa69c2-05f4-0310-b83c-d5d913b14636
-
-clock-analog.h
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-df81a049a71a1e39054a4bb4d39bc364
-2007-07-06T19:57:20.222544Z
-25890
-nick
-has-props
-
-clock-lcd.h
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-7996d55d3b72f40e9d2a6b262b6205b0
-2007-07-06T19:57:20.222544Z
-25890
-nick
-has-props
-
-clock.h
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-8f7076898e0b06de115fa080d95e8b88
-2007-11-21T10:21:11.159627Z
-26385
-nick
-has-props
-
-clock-binary.h
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-0feec91fbb3c524f065f327763745d13
-2007-07-06T19:57:20.222544Z
-25890
-nick
-has-props
-
-clock-digital.c
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-8a8951e77e6d5ae3d8b910c812c1c8cf
-2007-07-08T10:03:02.704025Z
-25899
-nick
-has-props
-
-Makefile.am
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-289bcee5642e698e74b778dbd824fc18
-2007-07-06T19:57:20.222544Z
-25890
-nick
-has-props
-
-clock-dialog.c
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-a382b283c3e9b1210debcee13b22100b
-2007-12-14T10:14:04.569928Z
-26477
-nick
-has-props
-
-clock-analog.c
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-32d14fb0e5779485a25a6e8e5ef1bc6d
-2007-07-09T19:51:58.413526Z
-25905
-nick
-has-props
-
-clock-digital.h
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-f45daed913b547fc6b93af3578fb6079
-2007-07-06T19:57:20.222544Z
-25890
-nick
-has-props
-
-clock-lcd.c
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-e23f7b0ba4e8a68c3406febb972598d0
-2007-11-21T10:21:11.159627Z
-26385
-nick
-has-props
-
-clock.c
-file
-
-
-
-
-2008-02-18T07:59:28.000000Z
-dc3f7e658cb0687f53af7739394720de
-2008-02-18T07:59:29.025147Z
-26625
-nick
-has-props
-
-clock.desktop.in.in
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-3328f6a0e9c3f094f148100e0e345791
-2007-07-06T19:57:20.222544Z
-25890
-nick
-has-props
-
-clock-binary.c
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-4382fb6dedb49c83e08e08fe03677922
-2007-07-08T10:03:02.704025Z
-25899
-nick
-has-props
-
-clock-dialog.h
-file
-
-
-
-
-2007-12-21T07:30:11.000000Z
-7cd25d14556394c5ba2a759e7f0f455f
-2007-07-06T19:57:20.222544Z
-25890
-nick
-has-props
-
diff --git a/plugins/clock/.svn/format b/plugins/clock/.svn/format
deleted file mode 100644
index 45a4fb7..0000000
--- a/plugins/clock/.svn/format
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/plugins/clock/.svn/prop-base/Makefile.am.svn-base b/plugins/clock/.svn/prop-base/Makefile.am.svn-base
deleted file mode 100644
index 92c8ad7..0000000
--- a/plugins/clock/.svn/prop-base/Makefile.am.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 12
-svn:keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock-analog.c.svn-base b/plugins/clock/.svn/prop-base/clock-analog.c.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock-analog.c.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock-analog.h.svn-base b/plugins/clock/.svn/prop-base/clock-analog.h.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock-analog.h.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock-binary.c.svn-base b/plugins/clock/.svn/prop-base/clock-binary.c.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock-binary.c.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock-binary.h.svn-base b/plugins/clock/.svn/prop-base/clock-binary.h.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock-binary.h.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock-dialog.c.svn-base b/plugins/clock/.svn/prop-base/clock-dialog.c.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock-dialog.c.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock-dialog.h.svn-base b/plugins/clock/.svn/prop-base/clock-dialog.h.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock-dialog.h.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock-digital.c.svn-base b/plugins/clock/.svn/prop-base/clock-digital.c.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock-digital.c.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock-digital.h.svn-base b/plugins/clock/.svn/prop-base/clock-digital.h.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock-digital.h.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock-lcd.c.svn-base b/plugins/clock/.svn/prop-base/clock-lcd.c.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock-lcd.c.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock-lcd.h.svn-base b/plugins/clock/.svn/prop-base/clock-lcd.h.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock-lcd.h.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock.c.svn-base b/plugins/clock/.svn/prop-base/clock.c.svn-base
deleted file mode 100644
index ab0d44b..0000000
--- a/plugins/clock/.svn/prop-base/clock.c.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 8
-keywords
-V 2
-Id
-K 12
-svn:keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock.desktop.in.in.svn-base b/plugins/clock/.svn/prop-base/clock.desktop.in.in.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock.desktop.in.in.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/prop-base/clock.h.svn-base b/plugins/clock/.svn/prop-base/clock.h.svn-base
deleted file mode 100644
index 4d1314e..0000000
--- a/plugins/clock/.svn/prop-base/clock.h.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 8
-keywords
-V 2
-Id
-END
diff --git a/plugins/clock/.svn/text-base/Makefile.am.svn-base b/plugins/clock/.svn/text-base/Makefile.am.svn-base
deleted file mode 100644
index 12f3216..0000000
--- a/plugins/clock/.svn/text-base/Makefile.am.svn-base
+++ /dev/null
@@ -1,81 +0,0 @@
-# $Id$
-
-INCLUDES = \
- -I$(top_srcdir) \
- -DG_LOG_DOMAIN=\"libclock\" \
- -DLOCALEDIR=\"$(localedir)\" \
- $(PLATFORM_CPPFLAGS)
-
-plugindir = \
- $(libdir)/xfce4/panel-plugins
-
-plugin_LTLIBRARIES = \
- libclock.la
-
-libclock_la_SOURCES = \
- clock.c \
- clock.h \
- clock-analog.c \
- clock-analog.h \
- clock-binary.c \
- clock-binary.h \
- clock-dialog.c \
- clock-dialog.h \
- clock-digital.c \
- clock-digital.h \
- clock-lcd.c \
- clock-lcd.h
-
-libclock_la_CFLAGS = \
- $(GTK_CFLAGS) \
- $(LIBXFCE4UTIL_CFLAGS) \
- $(CAIRO_CFLAGS) \
- $(LIBXFCEGUI4_CFLAGS) \
- $(PLATFORM_CFLAGS)
-
-libclock_la_LDFLAGS = \
- -avoid-version \
- -module \
- $(PLATFORM_LDFLAGS)
-
-if HAVE_CYGWIN
-libclock_la_LDFLAGS += \
- -no-undefined
-endif
-
-libclock_la_LIBADD = \
- $(top_builddir)/libxfce4panel/libxfce4panel.la \
- $(GTK_LIBS) \
- $(CAIRO_LIBS) \
- $(LIBXFCE4UTIL_LIBS) \
- $(LIBXFCEGUI4_LIBS)
-
-libclock_la_DEPENDENCIES = \
- $(top_builddir)/libxfce4panel/libxfce4panel.la
-
-#
-# .desktop file
-#
-desktopdir = \
- $(datadir)/xfce4/panel-plugins
-
-desktop_in_in_files = \
- clock.desktop.in.in
-
-desktop_in_files = \
- $(desktop_in_in_files:.desktop.in.in=.desktop.in)
-
-%.desktop.in: %.desktop.in.in
- sed -e "s,\@libdir\@,$(libdir),g" < $< > $@
-
-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
- at INTLTOOL_DESKTOP_RULE@
-
-EXTRA_DIST = \
- $(desktop_in_in_files)
-
-DISTCLEANFILES = \
- $(desktop_DATA) \
- $(desktop_in_files)
-
-# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/plugins/clock/.svn/text-base/clock-analog.c.svn-base b/plugins/clock/.svn/text-base/clock-analog.c.svn-base
deleted file mode 100644
index d7a5dce..0000000
--- a/plugins/clock/.svn/text-base/clock-analog.c.svn-base
+++ /dev/null
@@ -1,377 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <cairo/cairo.h>
-
-#include "clock.h"
-#include "clock-analog.h"
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-#define CLOCK_SCALE 0.1
-#define TICKS_TO_RADIANS(x) (M_PI - (M_PI / 30.0) * (x))
-#define HOURS_TO_RADIANS(x,y) (M_PI - (M_PI / 6.0) * (((x) > 12 ? (x) - 12 : (x)) + (y) / 60.0))
-
-
-
-/* prototypes */
-static void xfce_clock_analog_class_init (XfceClockAnalogClass *klass);
-static void xfce_clock_analog_init (XfceClockAnalog *clock);
-static void xfce_clock_analog_finalize (GObject *object);
-static void xfce_clock_analog_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void xfce_clock_analog_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-static void xfce_clock_analog_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-static gboolean xfce_clock_analog_expose_event (GtkWidget *widget,
- GdkEventExpose *event);
-static void xfce_clock_analog_draw_ticks (cairo_t *cr,
- gdouble xc,
- gdouble yc,
- gdouble radius);
-static void xfce_clock_analog_draw_pointer (cairo_t *cr,
- gdouble xc,
- gdouble yc,
- gdouble radius,
- gdouble angle,
- gdouble scale,
- gboolean line);
-
-
-
-enum
-{
- PROP_0,
- PROP_SHOW_SECONDS
-};
-
-struct _XfceClockAnalogClass
-{
- GtkImageClass __parent__;
-};
-
-struct _XfceClockAnalog
-{
- GtkImage __parent__;
-
- /* draw seconds */
- guint show_seconds : 1;
-};
-
-
-
-static GObjectClass *xfce_clock_analog_parent_class;
-
-
-
-GType
-xfce_clock_analog_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- type = g_type_register_static_simple (GTK_TYPE_IMAGE,
- I_("XfceClockAnalog"),
- sizeof (XfceClockAnalogClass),
- (GClassInitFunc) xfce_clock_analog_class_init,
- sizeof (XfceClockAnalog),
- (GInstanceInitFunc) xfce_clock_analog_init,
- 0);
- }
-
- return type;
-}
-
-
-
-static void
-xfce_clock_analog_class_init (XfceClockAnalogClass *klass)
-{
- GObjectClass *gobject_class;
- GtkWidgetClass *gtkwidget_class;
-
- xfce_clock_analog_parent_class = g_type_class_peek_parent (klass);
-
- gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = xfce_clock_analog_finalize;
- gobject_class->set_property = xfce_clock_analog_set_property;
- gobject_class->get_property = xfce_clock_analog_get_property;
-
- gtkwidget_class = GTK_WIDGET_CLASS (klass);
- gtkwidget_class->size_request = xfce_clock_analog_size_request;
- gtkwidget_class->expose_event = xfce_clock_analog_expose_event;
-
- /**
- * Whether we display seconds
- **/
- g_object_class_install_property (gobject_class,
- PROP_SHOW_SECONDS,
- g_param_spec_boolean ("show-seconds", "show-seconds", "show-seconds",
- FALSE, PANEL_PARAM_READWRITE));
-}
-
-
-
-static void
-xfce_clock_analog_init (XfceClockAnalog *clock)
-{
- /* init */
- clock->show_seconds = FALSE;
-}
-
-
-
-static void
-xfce_clock_analog_finalize (GObject *object)
-{
- (*G_OBJECT_CLASS (xfce_clock_analog_parent_class)->finalize) (object);
-}
-
-
-
-static void
-xfce_clock_analog_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- XfceClockAnalog *clock = XFCE_CLOCK_ANALOG (object);
-
- switch (prop_id)
- {
- case PROP_SHOW_SECONDS:
- clock->show_seconds = g_value_get_boolean (value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
-static void
-xfce_clock_analog_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- XfceClockAnalog *clock = XFCE_CLOCK_ANALOG (object);
-
- switch (prop_id)
- {
- case PROP_SHOW_SECONDS:
- g_value_set_boolean (value, clock->show_seconds);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
-static void
-xfce_clock_analog_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- gint width, height;
-
- /* get the current widget size */
- gtk_widget_get_size_request (widget, &width, &height);
-
- /* square the widget */
- requisition->width = requisition->height = MAX (width, height);
-}
-
-
-
-static gboolean
-xfce_clock_analog_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- XfceClockAnalog *clock = XFCE_CLOCK_ANALOG (widget);
- gdouble xc, yc;
- gdouble angle, radius;
- cairo_t *cr;
- struct tm tm;
-
- g_return_val_if_fail (XFCE_CLOCK_IS_ANALOG (clock), FALSE);
-
- /* get center of the widget and the radius */
- xc = (widget->allocation.width / 2.0);
- yc = (widget->allocation.height / 2.0);
- radius = MIN (xc, yc);
-
- /* add the window offset */
- xc += widget->allocation.x;
- yc += widget->allocation.y;
-
- /* get the cairo context */
- cr = gdk_cairo_create (widget->window);
-
- if (G_LIKELY (cr != NULL))
- {
- /* get the local time */
- xfce_clock_util_get_localtime (&tm);
-
- /* set the line properties */
- cairo_set_line_width (cr, 1);
- gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_NORMAL]);
-
- /* draw the ticks */
- xfce_clock_analog_draw_ticks (cr, xc, yc, radius);
-
- if (clock->show_seconds)
- {
- /* second pointer */
- angle = TICKS_TO_RADIANS (tm.tm_sec);
- xfce_clock_analog_draw_pointer (cr, xc, yc, radius, angle, 0.7, TRUE);
- }
-
- /* minute pointer */
- angle = TICKS_TO_RADIANS (tm.tm_min);
- xfce_clock_analog_draw_pointer (cr, xc, yc, radius, angle, 0.8, FALSE);
-
- /* hour pointer */
- angle = HOURS_TO_RADIANS (tm.tm_hour, tm.tm_min);
- xfce_clock_analog_draw_pointer (cr, xc, yc, radius, angle, 0.5, FALSE);
-
- /* cleanup */
- cairo_destroy (cr);
- }
-
- return FALSE;
-}
-
-
-
-static void
-xfce_clock_analog_draw_ticks (cairo_t *cr,
- gdouble xc,
- gdouble yc,
- gdouble radius)
-{
- gint i;
- gdouble x, y, angle;
-
- for (i = 0; i < 12; i++)
- {
- /* calculate */
- angle = HOURS_TO_RADIANS (i, 0);
- x = xc + sin (angle) * (radius * (1.0 - CLOCK_SCALE));
- y = yc + cos (angle) * (radius * (1.0 - CLOCK_SCALE));
-
- /* draw arc */
- cairo_move_to (cr, x, y);
- cairo_arc (cr, x, y, radius * CLOCK_SCALE, 0, 2 * M_PI);
- cairo_close_path (cr);
- }
-
- /* fill the arcs */
- cairo_fill (cr);
-}
-
-
-
-static void
-xfce_clock_analog_draw_pointer (cairo_t *cr,
- gdouble xc,
- gdouble yc,
- gdouble radius,
- gdouble angle,
- gdouble scale,
- gboolean line)
-{
- gdouble xs, ys;
- gdouble xt, yt;
-
- /* calculate tip position */
- xt = xc + sin (angle) * radius * scale;
- yt = yc + cos (angle) * radius * scale;
-
- if (line)
- {
- /* draw the line */
- cairo_move_to (cr, xc, yc);
- cairo_line_to (cr, xt, yt);
-
- /* draw the line */
- cairo_stroke (cr);
- }
- else
- {
- /* calculate start position */
- xs = xc + sin (angle - 0.5 * M_PI) * radius * CLOCK_SCALE;
- ys = yc + cos (angle - 0.5 * M_PI) * radius * CLOCK_SCALE;
-
- /* draw the pointer */
- cairo_move_to (cr, xs, ys);
- cairo_arc (cr, xc, yc, radius * CLOCK_SCALE, -angle + M_PI, -angle);
- cairo_line_to (cr, xt, yt);
- cairo_close_path (cr);
-
- /* fill the pointer */
- cairo_fill (cr);
- }
-}
-
-
-
-GtkWidget *
-xfce_clock_analog_new (void)
-{
- return g_object_new (XFCE_CLOCK_TYPE_ANALOG, NULL);
-}
-
-
-
-gboolean
-xfce_clock_analog_update (gpointer user_data)
-{
- GtkWidget *widget = GTK_WIDGET (user_data);
-
- /* update if the widget if visible */
- if (G_LIKELY (GTK_WIDGET_VISIBLE (widget)))
- gtk_widget_queue_draw (widget);
-
- return TRUE;
-}
diff --git a/plugins/clock/.svn/text-base/clock-analog.h.svn-base b/plugins/clock/.svn/text-base/clock-analog.h.svn-base
deleted file mode 100644
index 2bca95c..0000000
--- a/plugins/clock/.svn/text-base/clock-analog.h.svn-base
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __CLOCK_ANALOG_H__
-#define __CLOCK_ANALOG_H__
-
-G_BEGIN_DECLS
-
-typedef struct _XfceClockAnalogClass XfceClockAnalogClass;
-typedef struct _XfceClockAnalog XfceClockAnalog;
-
-#define XFCE_CLOCK_TYPE_ANALOG (xfce_clock_analog_get_type ())
-#define XFCE_CLOCK_ANALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_CLOCK_TYPE_ANALOG, XfceClockAnalog))
-#define XFCE_CLOCK_ANALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_CLOCK_TYPE_ANALOG, XfceClockAnalogClass))
-#define XFCE_CLOCK_IS_ANALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_CLOCK_TYPE_ANALOG))
-#define XFCE_CLOCK_IS_ANALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_CLOCK_TYPE_ANALOG))
-#define XFCE_CLOCK_ANALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_CLOCK_TYPE_ANALOG, XfceClockAnalogClass))
-
-GType xfce_clock_analog_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL;
-
-GtkWidget *xfce_clock_analog_new (void) G_GNUC_MALLOC G_GNUC_INTERNAL;
-
-gboolean xfce_clock_analog_update (gpointer user_data) G_GNUC_INTERNAL;
-
-G_END_DECLS
-
-#endif /* !__CLOCK_ANALOG_H__ */
diff --git a/plugins/clock/.svn/text-base/clock-binary.c.svn-base b/plugins/clock/.svn/text-base/clock-binary.c.svn-base
deleted file mode 100644
index b5238cd..0000000
--- a/plugins/clock/.svn/text-base/clock-binary.c.svn-base
+++ /dev/null
@@ -1,395 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-#ifndef M_PI
-#define M_PI 3.141592654
-#endif
-
-#include <gtk/gtk.h>
-#include <cairo/cairo.h>
-
-#include "clock.h"
-#include "clock-binary.h"
-
-
-
-/* class functions */
-static void xfce_clock_binary_class_init (XfceClockBinaryClass *klass);
-static void xfce_clock_binary_init (XfceClockBinary *clock);
-static void xfce_clock_binary_finalize (GObject *object);
-static void xfce_clock_binary_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void xfce_clock_binary_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-static void xfce_clock_binary_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-static gboolean xfce_clock_binary_expose_event (GtkWidget *widget,
- GdkEventExpose *event);
-
-
-enum
-{
- PROP_0,
- PROP_SHOW_SECONDS,
- PROP_TRUE_BINARY
-};
-
-struct _XfceClockBinaryClass
-{
- GtkImageClass __parent__;
-};
-
-struct _XfceClockBinary
-{
- GtkImage __parent__;
-
- /* whether we draw seconds */
- guint show_seconds : 1;
-
- /* if this is a true binary clock */
- guint true_binary : 1;
-};
-
-
-
-static GObjectClass *xfce_clock_binary_parent_class;
-
-
-
-GType
-xfce_clock_binary_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- type = g_type_register_static_simple (GTK_TYPE_IMAGE,
- I_("XfceClockBinary"),
- sizeof (XfceClockBinaryClass),
- (GClassInitFunc) xfce_clock_binary_class_init,
- sizeof (XfceClockBinary),
- (GInstanceInitFunc) xfce_clock_binary_init,
- 0);
- }
-
- return type;
-}
-
-
-
-static void
-xfce_clock_binary_class_init (XfceClockBinaryClass *klass)
-{
- GObjectClass *gobject_class;
- GtkWidgetClass *gtkwidget_class;
-
- xfce_clock_binary_parent_class = g_type_class_peek_parent (klass);
-
- gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = xfce_clock_binary_finalize;
- gobject_class->set_property = xfce_clock_binary_set_property;
- gobject_class->get_property = xfce_clock_binary_get_property;
-
- gtkwidget_class = GTK_WIDGET_CLASS (klass);
- gtkwidget_class->size_request = xfce_clock_binary_size_request;
- gtkwidget_class->expose_event = xfce_clock_binary_expose_event;
-
- /**
- * Whether we display seconds
- **/
- g_object_class_install_property (gobject_class,
- PROP_SHOW_SECONDS,
- g_param_spec_boolean ("show-seconds", "show-seconds", "show-seconds",
- FALSE, PANEL_PARAM_READWRITE));
-
- /**
- * Whether this is a true binary clock
- **/
- g_object_class_install_property (gobject_class,
- PROP_TRUE_BINARY,
- g_param_spec_boolean ("true-binary", "true-binary", "true-binary",
- FALSE, PANEL_PARAM_READWRITE));
-}
-
-
-
-static void
-xfce_clock_binary_init (XfceClockBinary *clock)
-{
- /* init */
- clock->show_seconds = FALSE;
- clock->true_binary = FALSE;
-}
-
-
-
-static void
-xfce_clock_binary_finalize (GObject *object)
-{
- (*G_OBJECT_CLASS (xfce_clock_binary_parent_class)->finalize) (object);
-}
-
-
-
-static void
-xfce_clock_binary_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- XfceClockBinary *clock = XFCE_CLOCK_BINARY (object);
-
- switch (prop_id)
- {
- case PROP_SHOW_SECONDS:
- clock->show_seconds = g_value_get_boolean (value);
- break;
-
- case PROP_TRUE_BINARY:
- clock->true_binary = g_value_get_boolean (value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
-static void
-xfce_clock_binary_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- XfceClockBinary *clock = XFCE_CLOCK_BINARY (object);
-
- switch (prop_id)
- {
- case PROP_SHOW_SECONDS:
- g_value_set_boolean (value, clock->show_seconds);
- break;
-
- case PROP_TRUE_BINARY:
- g_value_set_boolean (value, clock->true_binary);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
-static void
-xfce_clock_binary_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- gint width, height;
- gdouble ratio;
- XfceClockBinary *clock = XFCE_CLOCK_BINARY (widget);
-
- /* get the current widget size */
- gtk_widget_get_size_request (widget, &width, &height);
-
- /* ratio of the clock */
- if (clock->true_binary)
- {
- ratio = clock->show_seconds ? 2.0 : 3.0;
- }
- else
- {
- ratio = clock->show_seconds ? 1.5 : 1.0;
- }
-
- /* set requisition based on the plugin orientation */
- if (width == -1)
- {
- requisition->height = height;
- requisition->width = height * ratio;
- }
- else
- {
- requisition->height = width / ratio;
- requisition->width = width;
- }
-}
-
-
-
-static gboolean
-xfce_clock_binary_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- XfceClockBinary *clock = XFCE_CLOCK_BINARY (widget);
- gdouble cw, ch, columns;
- gint ticks, cells, decimal;
- gdouble radius;
- gdouble x, y;
- gint i, j;
- gint decimal_tb[] = {32, 16, 8, 4, 2, 1};
- gint decimal_bcd[] = {80, 40, 20, 10, 8, 4, 2, 1};
- cairo_t *cr;
- GdkColor active, inactive;
- struct tm tm;
-
- g_return_val_if_fail (XFCE_CLOCK_IS_BINARY (clock), FALSE);
-
- /* number of columns and cells */
- columns = clock->show_seconds ? 3.0 : 2.0;
- cells = clock->true_binary ? 6 : 8;
-
- /* cell width and height */
- if (clock->true_binary)
- {
- cw = widget->allocation.width / 6.0;
- ch = widget->allocation.height / columns;
- }
- else /* bcd clock */
- {
- cw = widget->allocation.width / columns / 2.0;
- ch = widget->allocation.height / 4.0;
- }
-
- /* arc radius */
- radius = MIN (cw, ch) / 2.0 * 0.7;
-
- /* get colors */
- inactive = widget->style->fg[GTK_STATE_NORMAL];
- active = widget->style->bg[GTK_STATE_SELECTED];
-
- /* get the cairo context */
- cr = gdk_cairo_create (widget->window);
-
- if (G_LIKELY (cr != NULL))
- {
- /* get the current time */
- xfce_clock_util_get_localtime (&tm);
-
- /* walk the three or two time parts */
- for (i = 0; i < columns; i++)
- {
- /* get the time of this column */
- if (i == 0)
- ticks = tm.tm_hour;
- else if (i == 1)
- ticks = tm.tm_min;
- else
- ticks = tm.tm_sec;
-
- /* walk the binary columns */
- for (j = 0; j < cells; j++)
- {
- if (clock->true_binary)
- {
- /* skip the columns we don't draw */
- if (i == 0 && j == 0)
- continue;
-
- /* decimal representation of this cell */
- decimal = decimal_tb[j];
-
- /* center of the arc */
- x = cw * (j + 0.5) + widget->allocation.x;
- y = ch * (i + 0.5) + widget->allocation.y;
- }
- else /* bcd clock */
- {
- /* skip the columns we don't draw */
- if ((j == 0) || (i == 0 && j == 1))
- continue;
-
- /* decimal representation of this cell */
- decimal = decimal_bcd[j];
-
- /* center of the arc */
- x = cw * (i * 2 + (j < 4 ? 0 : 1) + 0.5) + widget->allocation.x;
- y = ch * ((j >= 4 ? j - 4 : j) + 0.5) + widget->allocation.y;
- }
-
- /* if this binary values 'fits' in the time */
- if (ticks >= decimal)
- {
- /* extract the decimal value from the time */
- ticks -= decimal;
-
- /* set the active color */
- gdk_cairo_set_source_color (cr, &active);
- }
- else
- {
- /* set the inactive color */
- gdk_cairo_set_source_color (cr, &inactive);
- }
-
- /* draw the arc */
- cairo_move_to (cr, x, y);
- cairo_arc (cr, x, y, radius, 0, 2 * M_PI);
- cairo_close_path (cr);
-
- /* fill the arc */
- cairo_fill (cr);
- }
- }
-
- /* cleanup */
- cairo_destroy (cr);
- }
-
- return FALSE;
-}
-
-
-
-GtkWidget *
-xfce_clock_binary_new (void)
-{
- return g_object_new (XFCE_CLOCK_TYPE_BINARY, NULL);
-}
-
-
-
-gboolean
-xfce_clock_binary_update (gpointer user_data)
-{
- GtkWidget *widget = GTK_WIDGET (user_data);
-
- /* update if the widget if visible */
- if (G_LIKELY (GTK_WIDGET_VISIBLE (widget)))
- gtk_widget_queue_draw (widget);
-
- return TRUE;
-}
diff --git a/plugins/clock/.svn/text-base/clock-binary.h.svn-base b/plugins/clock/.svn/text-base/clock-binary.h.svn-base
deleted file mode 100644
index 92f97bf..0000000
--- a/plugins/clock/.svn/text-base/clock-binary.h.svn-base
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __CLOCK_BINARY_H__
-#define __CLOCK_BINARY_H__
-
-G_BEGIN_DECLS
-
-typedef struct _XfceClockBinaryClass XfceClockBinaryClass;
-typedef struct _XfceClockBinary XfceClockBinary;
-
-#define XFCE_CLOCK_TYPE_BINARY (xfce_clock_binary_get_type ())
-#define XFCE_CLOCK_BINARY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_CLOCK_TYPE_BINARY, XfceClockBinary))
-#define XFCE_CLOCK_BINARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_CLOCK_TYPE_BINARY, XfceClockBinaryClass))
-#define XFCE_CLOCK_IS_BINARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_CLOCK_TYPE_BINARY))
-#define XFCE_CLOCK_IS_BINARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_CLOCK_TYPE_BINARY))
-#define XFCE_CLOCK_BINARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_CLOCK_TYPE_BINARY, XfceClockBinaryClass))
-
-GType xfce_clock_binary_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL;
-
-GtkWidget *xfce_clock_binary_new (void) G_GNUC_MALLOC G_GNUC_INTERNAL;
-
-gboolean xfce_clock_binary_update (gpointer user_data) G_GNUC_INTERNAL;
-
-G_END_DECLS
-
-#endif /* !__CLOCK_BINARY_H__ */
diff --git a/plugins/clock/.svn/text-base/clock-dialog.c.svn-base b/plugins/clock/.svn/text-base/clock-dialog.c.svn-base
deleted file mode 100644
index 2023fd0..0000000
--- a/plugins/clock/.svn/text-base/clock-dialog.c.svn-base
+++ /dev/null
@@ -1,563 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <gtk/gtk.h>
-#include <libxfce4util/libxfce4util.h>
-#include <libxfce4panel/xfce-panel-plugin.h>
-#include <libxfcegui4/xfce-titled-dialog.h>
-#include <libxfcegui4/xfce-widget-helpers.h>
-
-#include "clock.h"
-#include "clock-dialog.h"
-
-
-
-/** default formats **/
-static const gchar *tooltip_formats[] = {
- DEFAULT_TOOLTIP_FORMAT,
- "%x",
- NULL
-};
-
-static const gchar *digital_formats[] = {
- DEFAULT_DIGITAL_FORMAT,
- "%T",
- "%r",
- "%R %p",
- NULL
-};
-
-
-
-/** prototypes **/
-void xfce_clock_dialog_options (ClockPlugin *clock);
-
-
-
-static void
-xfce_clock_dialog_reload_settings (ClockPlugin *clock)
-{
- if (G_LIKELY (clock->widget))
- {
- /* save the settings */
- xfce_clock_widget_update_settings (clock);
-
- /* make sure the plugin sets it's size again */
- gtk_widget_queue_resize (clock->widget);
-
- /* run a direct update */
- (clock->update) (clock->widget);
-
- /* reschedule the timeout */
- xfce_clock_widget_sync (clock);
- }
-}
-
-
-
-static void
-xfce_clock_dialog_mode_changed (GtkComboBox *combo,
- ClockPlugin *clock)
-{
- /* set the new mode */
- clock->mode = gtk_combo_box_get_active (combo);
-
- /* update the plugin widget */
- if (G_LIKELY (clock->widget))
- {
- /* set the new clock mode */
- xfce_clock_widget_set_mode (clock);
-
- /* update the settings */
- xfce_clock_dialog_reload_settings (clock);
-
- /* update the plugin size */
- xfce_clock_plugin_set_size (clock, xfce_panel_plugin_get_size (clock->plugin));
- }
-
- /* update the dialog */
- xfce_clock_dialog_options (clock);
-}
-
-
-
-static void
-xfce_clock_dialog_show_frame_toggled (GtkToggleButton *button,
- ClockPlugin *clock)
-{
- /* set frame mode */
- clock->show_frame = gtk_toggle_button_get_active (button);
-
- /* change frame shadow */
- gtk_frame_set_shadow_type (GTK_FRAME (clock->frame), clock->show_frame ? GTK_SHADOW_IN : GTK_SHADOW_NONE);
-}
-
-
-
-static void
-xfce_clock_dialog_tooltip_format_changed (GtkComboBox *combo,
- ClockPlugin *clock)
-{
- gint index;
- GtkWidget *entry;
-
- /* stop running timeout */
- if (clock->tooltip_timeout_id)
- {
- g_source_remove (clock->tooltip_timeout_id);
- clock->tooltip_timeout_id = 0;
- }
-
- /* get index of selected item */
- index = gtk_combo_box_get_active (combo);
-
- /* get the custom entry */
- entry = g_object_get_data (G_OBJECT (combo), I_("entry"));
-
- /* set one of the default formats */
- if (index < G_N_ELEMENTS (tooltip_formats))
- {
- /* hide the entry */
- gtk_widget_hide (entry);
-
- /* cleanup old format */
- g_free (clock->tooltip_format);
-
- /* set new format */
- clock->tooltip_format = g_strdup (tooltip_formats[index]);
-
- /* restart the tooltip timeout */
- xfce_clock_tooltip_sync (clock);
- }
- else
- {
- /* set string */
- gtk_entry_set_text (GTK_ENTRY (entry), clock->tooltip_format);
-
- /* show */
- gtk_widget_show (entry);
- }
-}
-
-
-
-static void
-xfce_clock_dialog_tooltip_entry_changed (GtkEntry *entry,
- ClockPlugin *clock)
-{
- /* cleanup old format */
- g_free (clock->tooltip_format);
-
- /* set new format */
- clock->tooltip_format = g_strdup (gtk_entry_get_text (entry));
-
- /* restart the tooltip timeout */
- xfce_clock_tooltip_sync (clock);
-}
-
-
-
-static void
-xfce_clock_dialog_show_seconds_toggled (GtkToggleButton *button,
- ClockPlugin *clock)
-{
- /* whether we show seconds */
- clock->show_seconds = gtk_toggle_button_get_active (button);
-
- /* update the clock */
- xfce_clock_dialog_reload_settings (clock);
-}
-
-
-
-static void
-xfce_clock_dialog_show_military_toggled (GtkToggleButton *button,
- ClockPlugin *clock)
-{
- /* whether we show a 24h clock */
- clock->show_military = gtk_toggle_button_get_active (button);
-
- /* update the clock */
- xfce_clock_dialog_reload_settings (clock);
-}
-
-
-
-static void
-xfce_clock_dialog_show_meridiem_toggled (GtkToggleButton *button,
- ClockPlugin *clock)
-{
- /* whether we show am/pm */
- clock->show_meridiem = gtk_toggle_button_get_active (button);
-
- /* update the clock */
- xfce_clock_dialog_reload_settings (clock);
-}
-
-
-
-static void
-xfce_clock_dialog_flash_separators_toggled (GtkToggleButton *button,
- ClockPlugin *clock)
-{
- /* whether flash the separators */
- clock->flash_separators = gtk_toggle_button_get_active (button);
-
- /* update the clock */
- xfce_clock_dialog_reload_settings (clock);
-}
-
-
-
-static void
-xfce_clock_dialog_true_binary_toggled (GtkToggleButton *button,
- ClockPlugin *clock)
-{
- /* whether we this is a true binary clock */
- clock->true_binary = gtk_toggle_button_get_active (button);
-
- /* update the clock */
- xfce_clock_dialog_reload_settings (clock);
-}
-
-
-
-static void
-xfce_clock_dialog_digital_format_changed (GtkComboBox *combo,
- ClockPlugin *clock)
-{
- gint index;
- GtkWidget *entry;
-
- /* get index of selected item */
- index = gtk_combo_box_get_active (combo);
-
- /* get the custom entry */
- entry = g_object_get_data (G_OBJECT (combo), I_("entry"));
-
- /* set one of the default formats */
- if (index < G_N_ELEMENTS (digital_formats))
- {
- /* hide the entry */
- gtk_widget_hide (entry);
-
- /* cleanup old format */
- g_free (clock->digital_format);
-
- /* set new format */
- clock->digital_format = g_strdup (digital_formats[index]);
-
- /* reload settings */
- xfce_clock_dialog_reload_settings (clock);
- }
- else
- {
- /* set string */
- gtk_entry_set_text (GTK_ENTRY (entry), clock->digital_format);
-
- /* show */
- gtk_widget_show (entry);
- }
-}
-
-
-
-static void
-xfce_clock_dialog_digital_entry_changed (GtkEntry *entry,
- ClockPlugin *clock)
-{
- /* cleanup old format */
- g_free (clock->digital_format);
-
- /* set new format */
- clock->digital_format = g_strdup (gtk_entry_get_text (entry));
-
- /* reload settings */
- xfce_clock_dialog_reload_settings (clock);
-}
-
-
-
-static gboolean
-xfce_clock_dialog_row_separator_func (GtkTreeModel *model,
- GtkTreeIter *iter,
- gpointer user_data)
-{
- gchar *title;
- gboolean result = FALSE;
-
- gtk_tree_model_get (model, iter, 0, &title, -1);
- if (G_LIKELY (title != NULL))
- {
- result = (strcmp (title, "-") == 0);
-
- /* cleanup */
- g_free (title);
- }
-
- return result;
-}
-
-
-
-static gboolean
-xfce_clock_dialog_append_combobox_formats (GtkComboBox *combo,
- const gchar *formats[],
- const gchar *current_format)
-{
- gint i;
- struct tm tm;
- gchar *string;
- gboolean has_active = FALSE;
-
- /* get the local time */
- xfce_clock_util_get_localtime (&tm);
-
- for (i = 0; formats[i] != NULL; i++)
- {
- /* insert user-redable string */
- string = xfce_clock_util_strdup_strftime (formats[i], &tm);
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo), string);
- g_free (string);
-
- /* check if this is the active string */
- if (!has_active && current_format && strcmp (formats[i], current_format) == 0)
- {
- gtk_combo_box_set_active (GTK_COMBO_BOX (combo), i);
- has_active = TRUE;
- }
- }
-
- /* insert the separator and the custom line */
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "-");
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Custom"));
-
- if (!has_active)
- {
- if (!current_format)
- {
- has_active = TRUE;
- i = -1;
- }
-
- /* select item */
- gtk_combo_box_set_active (GTK_COMBO_BOX (combo), i + 1);
- }
-
- return has_active;
-}
-
-
-
-static void
-xfce_clock_dialog_response (GtkWidget *dialog,
- gint response,
- ClockPlugin *clock)
-{
- /* destroy the dialog */
- gtk_widget_destroy (dialog);
-
- /* remove links */
- g_object_set_data (G_OBJECT (clock->plugin), I_("configure-dialog"), NULL);
- g_object_set_data (G_OBJECT (clock->plugin), I_("configure-dialog-bin"), NULL);
-
- /* unblock the plugin menu */
- xfce_panel_plugin_unblock_menu (clock->plugin);
-}
-
-
-
-void
-xfce_clock_dialog_options (ClockPlugin *clock)
-{
- GtkWidget *button, *bin, *vbox, *combo, *entry;
- gboolean has_active;
-
- /* get the frame bin */
- bin = g_object_get_data (G_OBJECT (clock->plugin), I_("configure-dialog-bin"));
- gtk_container_foreach (GTK_CONTAINER (bin), (GtkCallback) gtk_widget_destroy, NULL);
-
- /* main vbox */
- vbox = gtk_vbox_new (FALSE, 8);
- gtk_container_add (GTK_CONTAINER (bin), vbox);
- gtk_widget_show (vbox);
-
- if (clock->mode == XFCE_CLOCK_ANALOG || clock->mode == XFCE_CLOCK_BINARY || clock->mode == XFCE_CLOCK_LCD)
- {
- button = gtk_check_button_new_with_mnemonic (_("Display _seconds"));
- gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), clock->show_seconds);
- g_signal_connect (button, "toggled", G_CALLBACK (xfce_clock_dialog_show_seconds_toggled), clock);
- gtk_widget_show (button);
- }
-
- if (clock->mode == XFCE_CLOCK_LCD)
- {
- button = gtk_check_button_new_with_mnemonic (_("Use 24-_hour clock"));
- gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), clock->show_military);
- g_signal_connect (button, "toggled", G_CALLBACK (xfce_clock_dialog_show_military_toggled), clock);
- gtk_widget_show (button);
-
- button = gtk_check_button_new_with_mnemonic (_("Fl_ash time separators"));
- gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), clock->flash_separators);
- g_signal_connect (button, "toggled", G_CALLBACK (xfce_clock_dialog_flash_separators_toggled), clock);
- gtk_widget_show (button);
-
- button = gtk_check_button_new_with_mnemonic (_("Sho_w AM/PM"));
- gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), clock->show_meridiem);
- g_signal_connect (button, "toggled", G_CALLBACK (xfce_clock_dialog_show_meridiem_toggled), clock);
- gtk_widget_show (button);
- }
-
- if (clock->mode == XFCE_CLOCK_BINARY)
- {
- button = gtk_check_button_new_with_mnemonic (_("True _binary clock"));
- gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), clock->true_binary);
- g_signal_connect (button, "toggled", G_CALLBACK (xfce_clock_dialog_true_binary_toggled), clock);
- gtk_widget_show (button);
- }
-
- if (clock->mode == XFCE_CLOCK_DIGITAL)
- {
- combo = gtk_combo_box_new_text ();
- gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0);
- gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (combo), xfce_clock_dialog_row_separator_func, NULL, NULL);
- has_active = xfce_clock_dialog_append_combobox_formats (GTK_COMBO_BOX (combo), digital_formats, clock->digital_format);
- g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK (xfce_clock_dialog_digital_format_changed), clock);
- gtk_widget_show (combo);
-
- entry = gtk_entry_new_with_max_length (BUFFER_SIZE-1);
- gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0);
- g_object_set_data (G_OBJECT (combo), I_("entry"), entry);
- if (!has_active)
- {
- gtk_widget_show (entry);
- gtk_entry_set_text (GTK_ENTRY (entry), clock->digital_format);
- }
- g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (xfce_clock_dialog_digital_entry_changed), clock);
- }
-}
-
-
-
-void
-xfce_clock_dialog_show (ClockPlugin *clock)
-{
- GtkWidget *dialog, *dialog_vbox;
- GtkWidget *frame, *bin, *vbox, *combo;
- GtkWidget *button, *entry;
- gboolean has_active;
-
- /* block the right-click menu */
- xfce_panel_plugin_block_menu (clock->plugin);
-
- /* create dialog */
- dialog = xfce_titled_dialog_new_with_buttons (_("Clock"), NULL,
- GTK_DIALOG_NO_SEPARATOR,
- GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
- NULL);
- gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen (GTK_WIDGET (clock->plugin)));
- gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER);
- gtk_window_set_icon_name (GTK_WINDOW (dialog), "xfce4-settings");
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
- g_object_set_data (G_OBJECT (clock->plugin), I_("configure-dialog"), dialog);
- g_signal_connect (G_OBJECT (dialog), "response", G_CALLBACK (xfce_clock_dialog_response), clock);
-
- /* main vbox */
- dialog_vbox = gtk_vbox_new (FALSE, 8);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), dialog_vbox, TRUE, TRUE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (dialog_vbox), 6);
- gtk_widget_show (dialog_vbox);
-
- /* appearance settings */
- frame = xfce_create_framebox (_("Appearance"), &bin);
- gtk_box_pack_start (GTK_BOX (dialog_vbox), frame, FALSE, TRUE, 0);
- gtk_widget_show (frame);
-
- vbox = gtk_vbox_new (FALSE, 8);
- gtk_container_add (GTK_CONTAINER (bin), vbox);
- gtk_widget_show (vbox);
-
- combo = gtk_combo_box_new_text ();
- gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0);
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Analog"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Binary"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Digital"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("LCD"));
- gtk_combo_box_set_active (GTK_COMBO_BOX (combo), clock->mode);
- g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK (xfce_clock_dialog_mode_changed), clock);
- gtk_widget_show (combo);
-
- button = gtk_check_button_new_with_mnemonic (_("Show _frame"));
- gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), clock->show_frame);
- g_signal_connect (button, "toggled", G_CALLBACK (xfce_clock_dialog_show_frame_toggled), clock);
- gtk_widget_show (button);
-
- /* tooltip settings */
- frame = xfce_create_framebox (_("Tooltip Format"), &bin);
- gtk_box_pack_start (GTK_BOX (dialog_vbox), frame, FALSE, TRUE, 0);
- gtk_widget_show (frame);
-
- vbox = gtk_vbox_new (FALSE, 8);
- gtk_container_add (GTK_CONTAINER (bin), vbox);
- gtk_widget_show (vbox);
-
- combo = gtk_combo_box_new_text ();
- gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0);
- gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (combo), xfce_clock_dialog_row_separator_func, NULL, NULL);
- has_active = xfce_clock_dialog_append_combobox_formats (GTK_COMBO_BOX (combo), tooltip_formats, clock->tooltip_format);
- g_signal_connect (G_OBJECT (combo), "changed", G_CALLBACK (xfce_clock_dialog_tooltip_format_changed), clock);
- gtk_widget_show (combo);
-
- entry = gtk_entry_new_with_max_length (BUFFER_SIZE-1);
- gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0);
- g_object_set_data (G_OBJECT (combo), I_("entry"), entry);
- if (!has_active)
- {
- gtk_widget_show (entry);
- gtk_entry_set_text (GTK_ENTRY (entry), clock->tooltip_format);
- }
- g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (xfce_clock_dialog_tooltip_entry_changed), clock);
-
- /* clock settings */
- frame = xfce_create_framebox (_("Clock Options"), &bin);
- gtk_box_pack_start (GTK_BOX (dialog_vbox), frame, FALSE, TRUE, 0);
- g_object_set_data (G_OBJECT (clock->plugin), I_("configure-dialog-bin"), bin);
- gtk_widget_show (frame);
-
- /* add the potions */
- xfce_clock_dialog_options (clock);
-
- /* show the dialog */
- gtk_widget_show (dialog);
-}
-
diff --git a/plugins/clock/.svn/text-base/clock-dialog.h.svn-base b/plugins/clock/.svn/text-base/clock-dialog.h.svn-base
deleted file mode 100644
index 7545070..0000000
--- a/plugins/clock/.svn/text-base/clock-dialog.h.svn-base
+++ /dev/null
@@ -1,31 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __CLOCK_DIALOG_H__
-#define __CLOCK_DIALOG_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-void xfce_clock_dialog_show (ClockPlugin *clock) G_GNUC_INTERNAL;
-
-G_END_DECLS
-
-#endif /* !__CLOCK_DIALOG_H__ */
diff --git a/plugins/clock/.svn/text-base/clock-digital.c.svn-base b/plugins/clock/.svn/text-base/clock-digital.c.svn-base
deleted file mode 100644
index bebe025..0000000
--- a/plugins/clock/.svn/text-base/clock-digital.c.svn-base
+++ /dev/null
@@ -1,226 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-
-#include <gtk/gtk.h>
-
-#include "clock.h"
-#include "clock-digital.h"
-
-
-
-/* class functions */
-static void xfce_clock_digital_class_init (XfceClockDigitalClass *klass);
-static void xfce_clock_digital_init (XfceClockDigital *clock);
-static void xfce_clock_digital_finalize (GObject *object);
-static void xfce_clock_digital_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void xfce_clock_digital_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-
-
-
-enum
-{
- PROP_0,
- PROP_DIGITAL_FORMAT
-};
-
-struct _XfceClockDigitalClass
-{
- GtkLabelClass __parent__;
-};
-
-struct _XfceClockDigital
-{
- GtkLabel __parent__;
-
- /* current clock format */
- gchar *format;
-};
-
-
-
-static GObjectClass *xfce_clock_digital_parent_class;
-
-
-
-GType
-xfce_clock_digital_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- type = g_type_register_static_simple (GTK_TYPE_LABEL,
- I_("XfceClockDigital"),
- sizeof (XfceClockDigitalClass),
- (GClassInitFunc) xfce_clock_digital_class_init,
- sizeof (XfceClockDigital),
- (GInstanceInitFunc) xfce_clock_digital_init,
- 0);
- }
-
- return type;
-}
-
-
-
-static void
-xfce_clock_digital_class_init (XfceClockDigitalClass *klass)
-{
- GObjectClass *gobject_class;
-
- xfce_clock_digital_parent_class = g_type_class_peek_parent (klass);
-
- gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = xfce_clock_digital_finalize;
- gobject_class->set_property = xfce_clock_digital_set_property;
- gobject_class->get_property = xfce_clock_digital_get_property;
-
- /**
- * Digital clock format
- **/
- g_object_class_install_property (gobject_class,
- PROP_DIGITAL_FORMAT,
- g_param_spec_string ("digital-format", "digital-format", "digital-format",
- NULL, PANEL_PARAM_READWRITE));
-}
-
-
-
-static void
-xfce_clock_digital_init (XfceClockDigital *clock)
-{
- /* init */
- clock->format = NULL;
-
- /* center text */
- gtk_label_set_justify (GTK_LABEL (clock), GTK_JUSTIFY_CENTER);
-}
-
-
-
-static void
-xfce_clock_digital_finalize (GObject *object)
-{
- XfceClockDigital *clock = XFCE_CLOCK_DIGITAL (object);
-
- /* cleanup */
- g_free (clock->format);
-
- (*G_OBJECT_CLASS (xfce_clock_digital_parent_class)->finalize) (object);
-}
-
-
-
-static void
-xfce_clock_digital_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- XfceClockDigital *clock = XFCE_CLOCK_DIGITAL (object);
-
- switch (prop_id)
- {
- case PROP_DIGITAL_FORMAT:
- /* cleanup */
- g_free (clock->format);
-
- /* set new format */
- clock->format = g_value_dup_string (value);
-
- /* update the widget */
- xfce_clock_digital_update (clock);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
-static void
-xfce_clock_digital_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- XfceClockDigital *clock = XFCE_CLOCK_DIGITAL (object);
-
- switch (prop_id)
- {
- case PROP_DIGITAL_FORMAT:
- g_value_set_string (value,clock->format);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
-GtkWidget *
-xfce_clock_digital_new (void)
-{
- return g_object_new (XFCE_CLOCK_TYPE_DIGITAL, NULL);
-}
-
-
-
-gboolean
-xfce_clock_digital_update (gpointer user_data)
-{
- XfceClockDigital *clock = XFCE_CLOCK_DIGITAL (user_data);
- gchar *string;
- struct tm tm;
-
- g_return_val_if_fail (XFCE_CLOCK_IS_DIGITAL (clock), FALSE);
- g_return_val_if_fail (clock->format != NULL, FALSE);
-
- /* get the local time */
- xfce_clock_util_get_localtime (&tm);
-
- /* get the string */
- string = xfce_clock_util_strdup_strftime (clock->format, &tm);
-
- /* set the new label */
- gtk_label_set_markup (GTK_LABEL (clock), string);
-
- /* cleanup */
- g_free (string);
-
- return TRUE;
-}
diff --git a/plugins/clock/.svn/text-base/clock-digital.h.svn-base b/plugins/clock/.svn/text-base/clock-digital.h.svn-base
deleted file mode 100644
index 94b2b25..0000000
--- a/plugins/clock/.svn/text-base/clock-digital.h.svn-base
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __CLOCK_DIGITAL_H__
-#define __CLOCK_DIGITAL_H__
-
-G_BEGIN_DECLS
-
-typedef struct _XfceClockDigitalClass XfceClockDigitalClass;
-typedef struct _XfceClockDigital XfceClockDigital;
-
-#define XFCE_CLOCK_TYPE_DIGITAL (xfce_clock_digital_get_type ())
-#define XFCE_CLOCK_DIGITAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_CLOCK_TYPE_DIGITAL, XfceClockDigital))
-#define XFCE_CLOCK_DIGITAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_CLOCK_TYPE_DIGITAL, XfceClockDigitalClass))
-#define XFCE_CLOCK_IS_DIGITAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_CLOCK_TYPE_DIGITAL))
-#define XFCE_CLOCK_IS_DIGITAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_CLOCK_TYPE_DIGITAL))
-#define XFCE_CLOCK_DIGITAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_CLOCK_TYPE_DIGITAL, XfceClockDigitalClass))
-
-GType xfce_clock_digital_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL;
-
-GtkWidget *xfce_clock_digital_new (void) G_GNUC_MALLOC G_GNUC_INTERNAL;
-
-gboolean xfce_clock_digital_update (gpointer user_data) G_GNUC_INTERNAL;
-
-G_END_DECLS
-
-#endif /* !__CLOCK_DIGITAL_H__ */
diff --git a/plugins/clock/.svn/text-base/clock-lcd.c.svn-base b/plugins/clock/.svn/text-base/clock-lcd.c.svn-base
deleted file mode 100644
index 16853bd..0000000
--- a/plugins/clock/.svn/text-base/clock-lcd.c.svn-base
+++ /dev/null
@@ -1,551 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-
-#include <gtk/gtk.h>
-#include <cairo/cairo.h>
-
-#include "clock.h"
-#include "clock-lcd.h"
-
-#define RELATIVE_SPACE 0.10
-
-
-
-/* prototypes */
-static void xfce_clock_lcd_class_init (XfceClockLcdClass *klass);
-static void xfce_clock_lcd_init (XfceClockLcd *clock);
-static void xfce_clock_lcd_finalize (GObject *object);
-static void xfce_clock_lcd_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void xfce_clock_lcd_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-static void xfce_clock_lcd_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-static gboolean xfce_clock_lcd_expose_event (GtkWidget *widget,
- GdkEventExpose *event);
-static gdouble xfce_clock_lcd_get_ratio (XfceClockLcd *clock);
-static gdouble xfce_clock_lcd_draw_dots (cairo_t *cr,
- gdouble size,
- gdouble offset_x,
- gdouble offset_y);
-static gdouble xfce_clock_lcd_draw_digit (cairo_t *cr,
- guint number,
- gdouble size,
- gdouble offset_x,
- gdouble offset_y);
-
-
-
-enum
-{
- PROP_0,
- PROP_SHOW_SECONDS,
- PROP_SHOW_MILITARY,
- PROP_SHOW_MERIDIEM,
- PROP_FLASH_SEPARATORS,
-};
-
-struct _XfceClockLcdClass
-{
- GtkImageClass __parent__;
-};
-
-struct _XfceClockLcd
-{
- GtkImage __parent__;
-
- /* whether we show seconds */
- guint show_seconds : 1;
-
- /* whether it's a 24h clock */
- guint show_military : 1;
-
- /* whether we display am/pm */
- guint show_meridiem : 1;
-
- /* whether to flash the separators */
- guint flash_separators : 1;
-};
-
-
-
-static GObjectClass *xfce_clock_lcd_parent_class;
-
-
-
-GType
-xfce_clock_lcd_get_type (void)
-{
- static GType type = G_TYPE_INVALID;
-
- if (G_UNLIKELY (type == G_TYPE_INVALID))
- {
- type = g_type_register_static_simple (GTK_TYPE_IMAGE,
- I_("XfceClockLcd"),
- sizeof (XfceClockLcdClass),
- (GClassInitFunc) xfce_clock_lcd_class_init,
- sizeof (XfceClockLcd),
- (GInstanceInitFunc) xfce_clock_lcd_init,
- 0);
- }
-
- return type;
-}
-
-
-
-static void
-xfce_clock_lcd_class_init (XfceClockLcdClass *klass)
-{
- GObjectClass *gobject_class;
- GtkWidgetClass *gtkwidget_class;
-
- xfce_clock_lcd_parent_class = g_type_class_peek_parent (klass);
-
- gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = xfce_clock_lcd_finalize;
- gobject_class->set_property = xfce_clock_lcd_set_property;
- gobject_class->get_property = xfce_clock_lcd_get_property;
-
- gtkwidget_class = GTK_WIDGET_CLASS (klass);
- gtkwidget_class->size_request = xfce_clock_lcd_size_request;
- gtkwidget_class->expose_event = xfce_clock_lcd_expose_event;
-
- /**
- * Whether we display seconds
- **/
- g_object_class_install_property (gobject_class,
- PROP_SHOW_SECONDS,
- g_param_spec_boolean ("show-seconds", "show-seconds", "show-seconds",
- FALSE,
- PANEL_PARAM_READWRITE));
-
- /**
- * Whether we show a 24h clock
- **/
- g_object_class_install_property (gobject_class,
- PROP_SHOW_MILITARY,
- g_param_spec_boolean ("show-military", "show-military", "show-military",
- FALSE,
- PANEL_PARAM_READWRITE));
-
- /**
- * Whether we show am or pm
- **/
- g_object_class_install_property (gobject_class,
- PROP_SHOW_MERIDIEM,
- g_param_spec_boolean ("show-meridiem", "show-meridiem", "show-meridiem",
- TRUE,
- PANEL_PARAM_READWRITE));
-
- /**
- * Whether to flash the time separators
- **/
- g_object_class_install_property (gobject_class,
- PROP_FLASH_SEPARATORS,
- g_param_spec_boolean ("flash-separators", "flash-separators", "flash-separators",
- FALSE,
- PANEL_PARAM_READWRITE));
-}
-
-
-
-static void
-xfce_clock_lcd_init (XfceClockLcd *clock)
-{
- /* init */
- clock->show_seconds = FALSE;
- clock->show_meridiem = FALSE;
- clock->show_military = TRUE;
- clock->flash_separators = FALSE;
-}
-
-
-
-static void
-xfce_clock_lcd_finalize (GObject *object)
-{
- (*G_OBJECT_CLASS (xfce_clock_lcd_parent_class)->finalize) (object);
-}
-
-
-
-static void
-xfce_clock_lcd_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- XfceClockLcd *clock = XFCE_CLOCK_LCD (object);
-
- switch (prop_id)
- {
- case PROP_SHOW_SECONDS:
- clock->show_seconds = g_value_get_boolean (value);
- break;
-
- case PROP_SHOW_MILITARY:
- clock->show_military = g_value_get_boolean (value);
- break;
-
- case PROP_SHOW_MERIDIEM:
- clock->show_meridiem = g_value_get_boolean (value);
- break;
-
- case PROP_FLASH_SEPARATORS:
- clock->flash_separators = g_value_get_boolean (value);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
-static void
-xfce_clock_lcd_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- XfceClockLcd *clock = XFCE_CLOCK_LCD (object);
-
- switch (prop_id)
- {
- case PROP_SHOW_SECONDS:
- g_value_set_boolean (value, clock->show_seconds);
- break;
-
- case PROP_SHOW_MILITARY:
- g_value_set_boolean (value, clock->show_military);
- break;
-
- case PROP_SHOW_MERIDIEM:
- g_value_set_boolean (value, clock->show_meridiem);
- break;
-
- case PROP_FLASH_SEPARATORS:
- g_value_set_boolean (value, clock->flash_separators);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
-static void
-xfce_clock_lcd_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- gint width, height;
- gdouble ratio;
-
- /* get the current widget size */
- gtk_widget_get_size_request (widget, &width, &height);
-
- /* get the width:height ratio */
- ratio = xfce_clock_lcd_get_ratio (XFCE_CLOCK_LCD (widget));
-
- if (width == -1)
- {
- requisition->height = MAX (10, height - height % 10);
- requisition->width = requisition->height * ratio;
- }
- else
- {
- /* calc height */
- height = width / ratio;
- height = MAX (10, height - height % 10);
-
- requisition->height = height;
- requisition->width = height * ratio;
- }
-}
-
-
-
-static gboolean
-xfce_clock_lcd_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- XfceClockLcd *clock = XFCE_CLOCK_LCD (widget);
- cairo_t *cr;
- gdouble offset_x, offset_y;
- gint ticks, i;
- gdouble size;
- gdouble ratio;
- struct tm tm;
-
- g_return_val_if_fail (XFCE_CLOCK_IS_LCD (clock), FALSE);
-
- /* size of a digit should be a fraction of 10 */
- size = widget->allocation.height - widget->allocation.height % 10;
-
- /* get the width:height ratio */
- ratio = xfce_clock_lcd_get_ratio (XFCE_CLOCK_LCD (widget));
-
- /* begin offsets */
- offset_x = widget->allocation.x + (widget->allocation.width - (size * ratio)) / 2;
- offset_y = widget->allocation.y + (widget->allocation.height - size) / 2;
-
- /* get the cairo context */
- cr = gdk_cairo_create (widget->window);
-
- if (G_LIKELY (cr != NULL))
- {
- /* get the local time */
- xfce_clock_util_get_localtime (&tm);
-
- /* draw the hours */
- ticks = tm.tm_hour;
-
- /* convert 24h clock to 12h clock */
- if (!clock->show_military && ticks > 12)
- ticks -= 12;
-
- /* queue a resize when the number of hour digits changed */
- if (G_UNLIKELY ((ticks == 10 || ticks == 0) && tm.tm_min == 0 && tm.tm_sec == 0))
- gtk_widget_queue_resize (widget);
-
- if (ticks >= 10)
- {
- /* draw the number and increase the offset*/
- offset_x = xfce_clock_lcd_draw_digit (cr, ticks >= 20 ? 2 : 1, size, offset_x, offset_y);
- }
-
- /* draw the other number of the hour and increase the offset */
- offset_x = xfce_clock_lcd_draw_digit (cr, ticks % 10, size, offset_x, offset_y);
-
- for (i = 0; i < 2; i++)
- {
- /* get the time */
- if (i == 0)
- {
- /* get the minutes */
- ticks = tm.tm_min;
- }
- else
- {
- /* leave when we don't want seconds */
- if (!clock->show_seconds)
- break;
-
- /* get the seconds */
- ticks = tm.tm_sec;
- }
-
- /* draw the dots */
- if (clock->flash_separators && (tm.tm_sec % 2) == 1)
- offset_x += size * RELATIVE_SPACE * 2;
- else
- offset_x = xfce_clock_lcd_draw_dots (cr, size, offset_x, offset_y);
-
- /* draw the first digit */
- offset_x = xfce_clock_lcd_draw_digit (cr, (ticks - (ticks % 10)) / 10, size, offset_x, offset_y);
-
- /* draw the second digit */
- offset_x = xfce_clock_lcd_draw_digit (cr, ticks % 10, size, offset_x, offset_y);
- }
-
- if (clock->show_meridiem)
- {
- /* am or pm? */
- ticks = tm.tm_hour >= 12 ? 11 : 10;
-
- /* draw the digit */
- offset_x = xfce_clock_lcd_draw_digit (cr, ticks, size, offset_x, offset_y);
- }
-
- /* cleanup */
- cairo_destroy (cr);
- }
-
- return FALSE;
-}
-
-
-
-static gdouble
-xfce_clock_lcd_get_ratio (XfceClockLcd *clock)
-{
- gdouble ratio;
- gint ticks;
- struct tm tm;
-
- /* get the local time */
- xfce_clock_util_get_localtime (&tm);
-
- /* hour + minutes */
- ratio = (3 * 0.5 + 6 * RELATIVE_SPACE);
-
- ticks = tm.tm_hour;
-
- if (!clock->show_military && ticks > 12)
- ticks -= 12;
-
- if (ticks >= 10)
- ratio += (0.5 + RELATIVE_SPACE);
-
- if (clock->show_seconds)
- ratio += (2 * 0.5 + 4 * RELATIVE_SPACE);
-
- if (clock->show_meridiem)
- ratio += (0.5 + RELATIVE_SPACE);
-
- return ratio;
-}
-
-
-
-static gdouble
-xfce_clock_lcd_draw_dots (cairo_t *cr,
- gdouble size,
- gdouble offset_x,
- gdouble offset_y)
-{
- gint i;
-
- /* draw the dots */
- for (i = 1; i < 3; i++)
- cairo_rectangle (cr, offset_x, offset_y + size * 0.30 * i,
- size * 0.10, size * 0.10);
-
- /* fill the dots */
- cairo_fill (cr);
-
- return (offset_x + size * RELATIVE_SPACE * 2);
-}
-
-
-
-static gdouble
-xfce_clock_lcd_draw_digit (cairo_t *cr,
- guint number,
- gdouble size,
- gdouble offset_x,
- gdouble offset_y)
-{
- gint i, j;
- gint segment;
- gdouble x, y;
-
- g_return_val_if_fail (number >= 0 || number <= 11, offset_x);
-
- /* coordicates to draw for each segment */
- gdouble segments_x[][6] = { { 0.02, 0.48, 0.38, 0.12, -1.0, 0.00 },
- { 0.40, 0.50, 0.50, 0.40, -1.0, 0.00 },
- { 0.40, 0.50, 0.50, 0.40, -1.0, 0.00 },
- { 0.12, 0.38, 0.48, 0.02, -1.0, 0.00 },
- { 0.00, 0.10, 0.10, 0.00, -1.0, 0.00 },
- { 0.00, 0.10, 0.10, 0.00, -1.0, 0.00 },
- { 0.00, 0.10, 0.40, 0.50, 0.40, 0.10 } };
- gdouble segments_y[][6] = { { 0.00, 0.00, 0.10, 0.10, -1.0, 0.00 },
- { 0.12, 0.02, 0.48, 0.43, -1.0, 0.00 },
- { 0.57, 0.52, 0.98, 0.88, -1.0, 0.00 },
- { 0.90, 0.90, 1.00, 1.00, -1.0, 0.00 },
- { 0.52, 0.57, 0.88, 0.98, -1.0, 0.00 },
- { 0.02, 0.12, 0.43, 0.48, -1.0, 0.00 },
- { 0.50, 0.45, 0.45, 0.50, 0.55, 0.55 } };
-
- /* segment to draw for each number: 0, 1, ..., 9, A, P */
- gint numbers[][8] = { { 0, 1, 2, 3, 4, 5, -1 },
- { 1, 2, -1 },
- { 0, 1, 6, 4, 3, -1 },
- { 0, 1, 6, 2, 3, -1 },
- { 5, 6, 1, 2, -1 },
- { 0, 5, 6, 2, 3, -1 },
- { 0, 5, 4, 3, 2, 6, -1 },
- { 0, 1, 2, -1 },
- { 0, 1, 2, 3, 4, 5, 6, -1 },
- { 3, 2, 1, 0, 5, 6, -1 },
- { 4, 5, 0, 1, 2, 6, -1 },
- { 4, 5, 0, 1, 6, -1 } };
-
- for (i = 0; i < 9; i++)
- {
- /* get the segment we're going to draw */
- segment = numbers[number][i];
-
- /* leave when there are no more segments left */
- if (segment == -1)
- break;
-
- /* walk through the coordinate points */
- for (j = 0; j < 6; j++)
- {
- /* get x and y coordinates for this point */
- x = segments_x[segment][j] * size + offset_x;
- y = segments_y[segment][j] * size + offset_y;
-
- /* leave when there are no valid coordinates */
- if (x < 0 || y < 0)
- break;
-
- if (j == 0)
- cairo_move_to (cr, x, y);
- else
- cairo_line_to (cr, x, y);
- }
-
- /* close the line */
- cairo_close_path (cr);
- }
-
- /* fill the segments */
- cairo_fill (cr);
-
- return (offset_x + size * (0.50 + RELATIVE_SPACE));
-}
-
-
-
-GtkWidget *
-xfce_clock_lcd_new (void)
-{
- return g_object_new (XFCE_CLOCK_TYPE_LCD, NULL);
-}
-
-
-
-gboolean
-xfce_clock_lcd_update (gpointer user_data)
-{
- GtkWidget *widget = GTK_WIDGET (user_data);
-
- /* update if the widget if visible */
- if (G_LIKELY (GTK_WIDGET_VISIBLE (widget)))
- gtk_widget_queue_draw (widget);
-
- return TRUE;
-}
diff --git a/plugins/clock/.svn/text-base/clock-lcd.h.svn-base b/plugins/clock/.svn/text-base/clock-lcd.h.svn-base
deleted file mode 100644
index 2329628..0000000
--- a/plugins/clock/.svn/text-base/clock-lcd.h.svn-base
+++ /dev/null
@@ -1,43 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __CLOCK_LCD_H__
-#define __CLOCK_LCD_H__
-
-G_BEGIN_DECLS
-
-typedef struct _XfceClockLcdClass XfceClockLcdClass;
-typedef struct _XfceClockLcd XfceClockLcd;
-
-#define XFCE_CLOCK_TYPE_LCD (xfce_clock_lcd_get_type ())
-#define XFCE_CLOCK_LCD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_CLOCK_TYPE_LCD, XfceClockLcd))
-#define XFCE_CLOCK_LCD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_CLOCK_TYPE_LCD, XfceClockLcdClass))
-#define XFCE_CLOCK_IS_LCD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_CLOCK_TYPE_LCD))
-#define XFCE_CLOCK_IS_LCD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_CLOCK_TYPE_LCD))
-#define XFCE_CLOCK_LCD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_CLOCK_TYPE_LCD, XfceClockLcdClass))
-
-GType xfce_clock_lcd_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL;
-
-GtkWidget *xfce_clock_lcd_new (void) G_GNUC_MALLOC G_GNUC_INTERNAL;
-
-gboolean xfce_clock_lcd_update (gpointer user_data) G_GNUC_INTERNAL;
-
-G_END_DECLS
-
-#endif /* !__CLOCK_LCD_H__ */
diff --git a/plugins/clock/.svn/text-base/clock.c.svn-base b/plugins/clock/.svn/text-base/clock.c.svn-base
deleted file mode 100644
index 4c03b65..0000000
--- a/plugins/clock/.svn/text-base/clock.c.svn-base
+++ /dev/null
@@ -1,667 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-
-#include "clock.h"
-#include "clock-analog.h"
-#include "clock-binary.h"
-#include "clock-dialog.h"
-#include "clock-digital.h"
-#include "clock-lcd.h"
-
-
-#define USE_DEBUG_TIME (0)
-
-
-
-/** prototypes **/
-#if USE_DEBUG_TIME
-static void xfce_clock_util_get_debug_localtime (struct tm *tm);
-#endif
-static guint xfce_clock_util_interval_from_format (const gchar *format);
-static guint xfce_clock_util_next_interval (guint timeout_interval);
-static gboolean xfce_clock_tooltip_update (gpointer user_data);
-static gboolean xfce_clock_tooltip_sync_timeout (gpointer user_data);
-static gboolean xfce_clock_widget_sync_timeout (gpointer user_data);
-static ClockPlugin *xfce_clock_plugin_init (XfcePanelPlugin *plugin);
-static void xfce_clock_plugin_read (ClockPlugin *clock);
-static void xfce_clock_plugin_write (ClockPlugin *clock);
-static void xfce_clock_plugin_free (ClockPlugin *clock);
-static void xfce_clock_plugin_construct (XfcePanelPlugin *plugin);
-
-
-
-/** register the plugin **/
-XFCE_PANEL_PLUGIN_REGISTER_INTERNAL (xfce_clock_plugin_construct);
-
-
-
-/** utilities **/
-void
-xfce_clock_util_get_localtime (struct tm *tm)
-{
- time_t now = time (0);
-
-#ifndef HAVE_LOCALTIME_R
- struct tm *tmbuf;
-
- tmbuf = localtime (&now);
- *tm = *tmbuf;
-#else
- localtime_r (&now, tm);
-#endif
-
-#if USE_DEBUG_TIME
- xfce_clock_util_get_debug_localtime (tm);
-#endif
-}
-
-
-
-#if USE_DEBUG_TIME
-static void
-xfce_clock_util_get_debug_localtime (struct tm *tm)
-{
- static gint hour = 23;
- static gint min = 59;
- static gint sec = 45;
-
- /* add 1 seconds */
- sec++;
-
- /* update times */
- if (sec > 59)
- {
- sec = 0;
- min++;
- }
- if (min > 59)
- {
- min = 0;
- hour++;
- }
- if (hour > 23)
- {
- hour = 0;
- }
-
- /* set time structure */
- tm->tm_sec = sec;
- tm->tm_min = min;
- tm->tm_hour = hour;
-}
-#endif
-
-
-
-static guint
-xfce_clock_util_interval_from_format (const gchar *format)
-{
- const gchar *p;
- guint interval = CLOCK_INTERVAL_HOUR;
-
- if (G_UNLIKELY (format == NULL))
- return CLOCK_INTERVAL_HOUR;
-
- for (p = format; *p != '\0'; ++p)
- {
- if (p[0] == '%' && p[1] != '\0')
- {
- switch (*++p)
- {
- case 'c':
- case 'N':
- case 'r':
- case 's':
- case 'S':
- case 'T':
- case 'X':
- return CLOCK_INTERVAL_SECOND;
-
- case 'M':
- case 'R':
- interval = CLOCK_INTERVAL_MINUTE;
- break;
- }
- }
- }
-
- return interval;
-}
-
-
-
-static guint
-xfce_clock_util_next_interval (guint timeout_interval)
-{
- struct tm tm;
- GTimeVal timeval;
- guint interval;
-
- /* get the precise time */
- g_get_current_time (&timeval);
-
- /* ms to next second */
- interval = 1000 - (timeval.tv_usec / 1000);
-
- /* get current time */
- xfce_clock_util_get_localtime (&tm);
-
- /* add the interval time to the next update */
- switch (timeout_interval)
- {
- case CLOCK_INTERVAL_HOUR:
- /* ms to next hour */
- interval += (60 - tm.tm_min) * CLOCK_INTERVAL_MINUTE;
-
- /* fall-through to add the minutes */
-
- case CLOCK_INTERVAL_MINUTE:
- /* ms to next minute */
- interval += (60 - tm.tm_sec) * CLOCK_INTERVAL_SECOND;
- break;
-
- default:
- break;
- }
-
- return interval;
-}
-
-
-
-gchar *
-xfce_clock_util_strdup_strftime (const gchar *format,
- const struct tm *tm)
-{
- gchar *converted, *result;
- gsize length;
- gchar buffer[BUFFER_SIZE];
-
- /* convert to locale, because that's what strftime uses */
- converted = g_locale_from_utf8 (format, -1, NULL, NULL, NULL);
- if (G_UNLIKELY (converted == NULL))
- return NULL;
-
- /* parse the time string */
- length = strftime (buffer, sizeof (buffer), converted, tm);
- if (G_UNLIKELY (length == 0))
- buffer[0] = '\0';
-
- /* convert the string back to utf-8 */
- result = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
-
- /* cleanup */
- g_free (converted);
-
- return result;
-}
-
-
-
-/** tooltip functions **/
-static gboolean
-xfce_clock_tooltip_update (gpointer user_data)
-{
- ClockPlugin *clock = (ClockPlugin *) user_data;
- gchar *string;
- static GtkTooltips *tooltips = NULL;
- struct tm tm;
-
- if (G_UNLIKELY (clock->tooltip_format == NULL))
- return TRUE;
-
- /* allocate the tooltip on-demand */
- if (G_UNLIKELY (tooltips == NULL))
- tooltips = gtk_tooltips_new ();
-
- /* get the local time */
- xfce_clock_util_get_localtime (&tm);
-
- /* get the string */
- string = xfce_clock_util_strdup_strftime (clock->tooltip_format, &tm);
-
- /* set the tooltip */
- gtk_tooltips_set_tip (tooltips, clock->ebox, string, NULL);
-
- /* cleanup */
- g_free (string);
-
- return TRUE;
-}
-
-
-
-static gboolean
-xfce_clock_tooltip_sync_timeout (gpointer user_data)
-{
- ClockPlugin *clock = (ClockPlugin *) user_data;
-
- /* start the tooltip update interval */
- clock->clock_timeout_id = g_timeout_add (clock->tooltip_interval, xfce_clock_tooltip_update, clock);
-
- /* manual update for this timeout */
- xfce_clock_tooltip_update (clock);
-
- /* stop the sync timeout */
- return FALSE;
-}
-
-
-
-void
-xfce_clock_tooltip_sync (ClockPlugin *clock)
-{
- guint interval;
-
- if (clock->tooltip_timeout_id)
- {
- /* stop old and reset timeout */
- g_source_remove (clock->tooltip_timeout_id);
- clock->tooltip_timeout_id = 0;
- }
-
- /* detect the tooltip interval from the string */
- clock->tooltip_interval = xfce_clock_util_interval_from_format (clock->tooltip_format);
-
- /* get the interval to the next update */
- interval = xfce_clock_util_next_interval (clock->tooltip_interval);
-
- /* start the sync timeout */
- clock->tooltip_timeout_id = g_timeout_add (interval, xfce_clock_tooltip_sync_timeout, clock);
-
- /* update the tooltip */
- xfce_clock_tooltip_update (clock);
-}
-
-
-
-/** clock widget functions **/
-static gboolean
-xfce_clock_widget_sync_timeout (gpointer user_data)
-{
- ClockPlugin *clock = (ClockPlugin *) user_data;
-
- if (G_LIKELY (clock->widget))
- {
- /* start the clock update timeout */
- clock->clock_timeout_id = g_timeout_add (clock->interval, clock->update, clock->widget);
-
- /* manual update for this interval */
- (clock->update) (clock->widget);
- }
- else
- {
- /* remove timer id */
- clock->clock_timeout_id = 0;
- }
-
- /* stop the sync timeout */
- return FALSE;
-}
-
-
-
-void
-xfce_clock_widget_sync (ClockPlugin *clock)
-{
- guint interval;
-
- if (clock->clock_timeout_id)
- {
- /* stop old and reset timeout */
- g_source_remove (clock->clock_timeout_id);
- clock->clock_timeout_id = 0;
- }
-
- if (G_LIKELY (clock->widget))
- {
- /* get the interval to the next update */
- interval = xfce_clock_util_next_interval (clock->interval);
-
- /* start the sync timeout */
- clock->clock_timeout_id = g_timeout_add (interval, xfce_clock_widget_sync_timeout, clock);
- }
-}
-
-
-
-void
-xfce_clock_widget_update_settings (ClockPlugin *clock)
-{
- g_return_if_fail (clock->widget != NULL);
-
- /* send the settings based on the clock mode */
- switch (clock->mode)
- {
- case XFCE_CLOCK_ANALOG:
- /* set settings */
- g_object_set (G_OBJECT (clock->widget),
- "show-seconds", clock->show_seconds, NULL);
- break;
-
- case XFCE_CLOCK_BINARY:
- /* set settings */
- g_object_set (G_OBJECT (clock->widget),
- "show-seconds", clock->show_seconds,
- "true-binary", clock->true_binary, NULL);
- break;
-
- case XFCE_CLOCK_DIGITAL:
- /* set settings */
- g_object_set (G_OBJECT (clock->widget),
- "digital-format", clock->digital_format, NULL);
- break;
-
- case XFCE_CLOCK_LCD:
- /* set settings */
- g_object_set (G_OBJECT (clock->widget),
- "show-seconds", clock->show_seconds,
- "show-military", clock->show_military,
- "show-meridiem", clock->show_meridiem,
- "flash-separators", clock->flash_separators, NULL);
- break;
- }
-
- /* get update interval */
- if (clock->mode == XFCE_CLOCK_DIGITAL)
- {
- /* get interval from string */
- clock->interval = xfce_clock_util_interval_from_format (clock->digital_format);
- }
- else
- {
- /* interval from setting */
- if (clock->mode == XFCE_CLOCK_LCD)
- clock->interval = (clock->show_seconds || clock->flash_separators) ? CLOCK_INTERVAL_SECOND : CLOCK_INTERVAL_MINUTE;
- else
- clock->interval = clock->show_seconds ? CLOCK_INTERVAL_SECOND : CLOCK_INTERVAL_MINUTE;
- }
-}
-
-
-
-void
-xfce_clock_widget_set_mode (ClockPlugin *clock)
-{
- GtkWidget *widget;
-
- /* stop runing timeout */
- if (clock->clock_timeout_id)
- {
- g_source_remove (clock->clock_timeout_id);
- clock->clock_timeout_id = 0;
- }
-
- /* destroy the old widget */
- if (clock->widget)
- {
- gtk_widget_destroy (clock->widget);
- clock->widget = NULL;
- }
-
- switch (clock->mode)
- {
- case XFCE_CLOCK_ANALOG:
- widget = xfce_clock_analog_new ();
- clock->update = xfce_clock_analog_update;
- break;
-
- case XFCE_CLOCK_BINARY:
- widget = xfce_clock_binary_new ();
- clock->update = xfce_clock_binary_update;
- break;
-
- case XFCE_CLOCK_DIGITAL:
- widget = xfce_clock_digital_new ();
- clock->update = xfce_clock_digital_update;
- break;
-
- case XFCE_CLOCK_LCD:
- widget = xfce_clock_lcd_new ();
- clock->update = xfce_clock_lcd_update;
- break;
-
- default:
- g_error ("Unknown clock type");
- return;
- }
-
- /* set the clock */
- clock->widget = widget;
-
- /* add and show the clock */
- gtk_container_add (GTK_CONTAINER (clock->frame), widget);
- gtk_widget_show (widget);
-}
-
-
-
-/** plugin functions **/
-static ClockPlugin *
-xfce_clock_plugin_init (XfcePanelPlugin *plugin)
-{
- ClockPlugin *clock;
-
- /* create structure */
- clock = panel_slice_new0 (ClockPlugin);
-
- /* set plugin */
- clock->plugin = plugin;
-
- /* initialize */
- clock->clock_timeout_id = 0;
- clock->tooltip_timeout_id = 0;
- clock->widget = NULL;
- clock->tooltip_format = NULL;
- clock->digital_format = NULL;
-
- /* read the user settings */
- xfce_clock_plugin_read (clock);
-
- /* build widgets */
- clock->ebox = gtk_event_box_new ();
- gtk_container_add (GTK_CONTAINER (plugin), clock->ebox);
- gtk_event_box_set_visible_window (GTK_EVENT_BOX (clock->ebox), FALSE);
- gtk_widget_show (clock->ebox);
-
- clock->frame = gtk_frame_new (NULL);
- gtk_container_add (GTK_CONTAINER (clock->ebox), clock->frame);
- gtk_frame_set_shadow_type (GTK_FRAME (clock->frame), clock->show_frame ? GTK_SHADOW_IN : GTK_SHADOW_NONE);
- gtk_widget_show (clock->frame);
-
- /* set the clock */
- xfce_clock_widget_set_mode (clock);
-
- /* set the clock settings */
- xfce_clock_widget_update_settings (clock);
-
- /* start the timeout */
- xfce_clock_widget_sync (clock);
-
- /* start the tooltip sync */
- xfce_clock_tooltip_sync (clock);
-
- return clock;
-}
-
-
-
-gboolean
-xfce_clock_plugin_set_size (ClockPlugin *clock,
- guint size)
-{
- GtkOrientation orientation;
-
- /* set the frame border */
- gtk_container_set_border_width (GTK_CONTAINER (clock->frame), size > 26 ? 1 : 0);
-
- /* get the clock size */
- size -= size > 26 ? 6 : 4;
-
- /* get plugin orientation */
- orientation = xfce_panel_plugin_get_orientation (clock->plugin);
-
- /* set the clock size */
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_set_size_request (clock->widget, -1, size);
- else
- gtk_widget_set_size_request (clock->widget, size, -1);
-
- return TRUE;
-}
-
-
-
-static void
-xfce_clock_plugin_read (ClockPlugin *clock)
-{
- gchar *filename;
- const gchar *value;
- XfceRc *rc;
-
- /* config filename */
- filename = xfce_panel_plugin_lookup_rc_file (clock->plugin);
-
- if (G_LIKELY (filename))
- {
- /* open rc file (readonly) and cleanup */
- rc = xfce_rc_simple_open (filename, TRUE);
- g_free (filename);
-
- if (G_LIKELY (rc))
- {
- /* read strings */
- value = xfce_rc_read_entry (rc, "DigitalFormat", DEFAULT_DIGITAL_FORMAT);
- if (G_LIKELY (value != NULL && *value != '\0'))
- clock->digital_format = g_strdup (value);
-
- value = xfce_rc_read_entry (rc, "TooltipFormat", DEFAULT_TOOLTIP_FORMAT);
- if (G_LIKELY (value != NULL && *value != '\0'))
- clock->tooltip_format = g_strdup (value);
-
- /* read clock type */
- clock->mode = xfce_rc_read_int_entry (rc, "ClockType", XFCE_CLOCK_DIGITAL);
-
- /* read boolean settings */
- clock->show_frame = xfce_rc_read_bool_entry (rc, "ShowFrame", TRUE);
- clock->show_seconds = xfce_rc_read_bool_entry (rc, "ShowSeconds", FALSE);
- clock->show_military = xfce_rc_read_bool_entry (rc, "ShowMilitary", TRUE);
- clock->show_meridiem = xfce_rc_read_bool_entry (rc, "ShowMeridiem", FALSE);
- clock->true_binary = xfce_rc_read_bool_entry (rc, "TrueBinary", FALSE);
- clock->flash_separators = xfce_rc_read_bool_entry (rc, "FlashSeparators", FALSE);
-
- /* close the rc file */
- xfce_rc_close (rc);
- }
- }
-}
-
-
-
-static void
-xfce_clock_plugin_write (ClockPlugin *clock)
-{
- gchar *filename;
- XfceRc *rc;
-
- /* config filename */
- filename = xfce_panel_plugin_save_location (clock->plugin, TRUE);
-
- if (G_LIKELY (filename))
- {
- /* open rc file and cleanup */
- rc = xfce_rc_simple_open (filename, FALSE);
- g_free (filename);
-
- if (G_LIKELY (rc))
- {
- /* write settings */
- if (G_LIKELY (clock->digital_format && *clock->digital_format != '\0'))
- xfce_rc_write_entry (rc, "DigitalFormat", clock->digital_format);
-
- if (G_LIKELY (clock->tooltip_format && *clock->tooltip_format != '\0'))
- xfce_rc_write_entry (rc, "TooltipFormat", clock->tooltip_format);
-
- xfce_rc_write_int_entry (rc, "ClockType", clock->mode);
- xfce_rc_write_bool_entry (rc, "ShowFrame", clock->show_frame);
- xfce_rc_write_bool_entry (rc, "ShowSeconds", clock->show_seconds);
- xfce_rc_write_bool_entry (rc, "ShowMilitary", clock->show_military);
- xfce_rc_write_bool_entry (rc, "ShowMeridiem", clock->show_meridiem);
- xfce_rc_write_bool_entry (rc, "TrueBinary", clock->true_binary);
- xfce_rc_write_bool_entry (rc, "FlashSeparators", clock->flash_separators);
-
- /* close the rc file */
- xfce_rc_close (rc);
- }
- }
-}
-
-
-
-static void
-xfce_clock_plugin_free (ClockPlugin *clock)
-{
- GtkWidget *dialog;
-
- /* stop timeouts */
- if (G_LIKELY (clock->clock_timeout_id))
- g_source_remove (clock->clock_timeout_id);
-
- if (G_LIKELY (clock->tooltip_timeout_id))
- g_source_remove (clock->tooltip_timeout_id);
-
- /* destroy the configure dialog if it's still open */
- dialog = g_object_get_data (G_OBJECT (clock->plugin), I_("configure-dialog"));
- if (G_UNLIKELY (dialog != NULL))
- gtk_widget_destroy (dialog);
-
- /* cleanup */
- g_free (clock->tooltip_format);
- g_free (clock->digital_format);
-
- /* free structure */
- panel_slice_free (ClockPlugin, clock);
-}
-
-
-
-static void
-xfce_clock_plugin_construct (XfcePanelPlugin *plugin)
-{
- ClockPlugin *clock = xfce_clock_plugin_init (plugin);
-
- /* plugin settings */
- xfce_panel_plugin_add_action_widget (plugin, clock->ebox);
- xfce_panel_plugin_menu_show_configure (plugin);
-
- /* connect signals */
- g_signal_connect_swapped (G_OBJECT (plugin), "size-changed", G_CALLBACK (xfce_clock_plugin_set_size), clock);
- g_signal_connect_swapped (G_OBJECT (plugin), "save", G_CALLBACK (xfce_clock_plugin_write), clock);
- g_signal_connect_swapped (G_OBJECT (plugin), "free-data", G_CALLBACK (xfce_clock_plugin_free), clock);
- g_signal_connect_swapped (G_OBJECT (plugin), "configure-plugin", G_CALLBACK (xfce_clock_dialog_show), clock);
-}
-
diff --git a/plugins/clock/.svn/text-base/clock.desktop.in.in.svn-base b/plugins/clock/.svn/text-base/clock.desktop.in.in.svn-base
deleted file mode 100644
index c95b573..0000000
--- a/plugins/clock/.svn/text-base/clock.desktop.in.in.svn-base
+++ /dev/null
@@ -1,8 +0,0 @@
-[Xfce Panel]
-Type=X-XFCE-PanelPlugin
-Encoding=UTF-8
-_Name=Clock
-_Comment=What time is it?
-Icon=xfce4-clock
-X-XFCE-Module=clock
-X-XFCE-Module-Path=@libdir@/xfce4/panel-plugins
diff --git a/plugins/clock/.svn/text-base/clock.h.svn-base b/plugins/clock/.svn/text-base/clock.h.svn-base
deleted file mode 100644
index 9f31ff3..0000000
--- a/plugins/clock/.svn/text-base/clock.h.svn-base
+++ /dev/null
@@ -1,105 +0,0 @@
-/* $Id$ */
-/*
- * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
- *
- * 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __CLOCK_H__
-#define __CLOCK_H__
-
-#include <gtk/gtk.h>
-#include <libxfce4util/libxfce4util.h>
-#include <libxfce4panel/xfce-panel-plugin.h>
-
-G_BEGIN_DECLS
-
-#define CLOCK_INTERVAL_SECOND (1000)
-#define CLOCK_INTERVAL_MINUTE (60 * 1000)
-#define CLOCK_INTERVAL_HOUR (3600 * 1000)
-
-#define BUFFER_SIZE 256
-#define DEFAULT_TOOLTIP_FORMAT "%A %d %B %Y"
-#define DEFAULT_DIGITAL_FORMAT "%R"
-
-
-
-typedef struct _ClockPlugin ClockPlugin;
-typedef enum _ClockPluginMode ClockPluginMode;
-
-enum _ClockPluginMode
-{
- XFCE_CLOCK_ANALOG = 0,
- XFCE_CLOCK_BINARY,
- XFCE_CLOCK_DIGITAL,
- XFCE_CLOCK_LCD
-};
-
-struct _ClockPlugin
-{
- /* plugin */
- XfcePanelPlugin *plugin;
-
- /* widgets */
- GtkWidget *ebox;
- GtkWidget *frame;
- GtkWidget *widget;
-
- /* clock update function and timeout */
- GSourceFunc update;
- guint interval;
-
- /* tooltip interval */
- guint tooltip_interval;
-
- /* clock type */
- ClockPluginMode mode;
-
- /* timeouts */
- guint clock_timeout_id;
- guint tooltip_timeout_id;
-
- /* settings */
- gchar *tooltip_format;
- gchar *digital_format;
- guint show_frame : 1;
- guint show_seconds : 1;
- guint show_military : 1;
- guint show_meridiem : 1;
- guint true_binary : 1;
- guint flash_separators : 1;
-};
-
-
-
-void xfce_clock_util_get_localtime (struct tm *tm) G_GNUC_INTERNAL;
-
-gchar *xfce_clock_util_strdup_strftime (const gchar *format,
- const struct tm *tm) G_GNUC_MALLOC G_GNUC_INTERNAL;
-
-void xfce_clock_tooltip_sync (ClockPlugin *clock) G_GNUC_INTERNAL;
-
-void xfce_clock_widget_sync (ClockPlugin *clock) G_GNUC_INTERNAL;
-
-void xfce_clock_widget_update_settings (ClockPlugin *clock) G_GNUC_INTERNAL;
-
-void xfce_clock_widget_set_mode (ClockPlugin *clock) G_GNUC_INTERNAL;
-
-gboolean xfce_clock_plugin_set_size (ClockPlugin *clock,
- guint size) G_GNUC_INTERNAL;
-
-G_END_DECLS
-
-#endif /* !__CLOCK_H__ */
More information about the Xfce4-commits
mailing list