Remove typing break
|
@ -4,10 +4,6 @@ SUBDIRS = po libgnome-control-center shell panels \
|
|||
help docs
|
||||
DIST_SUBDIRS = po help shell typing-break docs examples panels libgnome-control-center
|
||||
|
||||
if HAVE_TYPING_BREAK
|
||||
SUBDIRS += typing-break
|
||||
endif
|
||||
|
||||
if BUILD_EXAMPLES
|
||||
SUBDIRS += examples
|
||||
endif
|
||||
|
|
45
configure.ac
|
@ -48,22 +48,6 @@ GNOME_MAINTAINER_MODE_DEFINES
|
|||
AC_PATH_XTRA
|
||||
x_libs="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
|
||||
|
||||
AC_CHECK_FUNC(XScreenSaverQueryInfo, [
|
||||
TYPING_BREAK="typing-break"], [
|
||||
save_LIBS=$LIBS
|
||||
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lXss -lXext -lX11"
|
||||
AC_CHECK_LIB(Xss, XScreenSaverQueryInfo, [
|
||||
TYPING_BREAK="typing-break"
|
||||
SCREENSAVER_LIBS="$X_PRE_LIBS $X_LIBS -lXss -lXext -lX11"], [
|
||||
LIBS=$save_LIBS
|
||||
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lXext -lX11"
|
||||
AC_CHECK_LIB(Xext, XScreenSaverQueryInfo, [
|
||||
TYPING_BREAK="typing-break"
|
||||
SCREENSAVER_LIBS="$X_PRE_LIBS $X_LIBS -lXext -lX11"],[])])
|
||||
LIBS=$save_LIBS])
|
||||
AC_SUBST(TYPING_BREAK)
|
||||
AC_SUBST(SCREENSAVER_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(LIBCANBERRA_GTK, libcanberra-gtk3, [
|
||||
CANBERRA_GTK=1
|
||||
AC_SUBST(LIBCANBERRA_GTK_CFLAGS)
|
||||
|
@ -71,33 +55,6 @@ PKG_CHECK_MODULES(LIBCANBERRA_GTK, libcanberra-gtk3, [
|
|||
], [:])
|
||||
AM_CONDITIONAL(HAVE_LIBCANBERRA_GTK, test "x$CANBERRA_GTK" = "x1")
|
||||
|
||||
AM_CONDITIONAL(HAVE_TYPING_BREAK, test "x$TYPING_BREAK" = xtyping-break)
|
||||
|
||||
dnl app indicator
|
||||
APPINDICATOR_REQUIRED=0.0.7
|
||||
|
||||
AC_ARG_ENABLE(appindicator,
|
||||
AS_HELP_STRING([--enable-appindicator[=@<:@no/auto/yes@:>@]],[Build support for application indicators ]),
|
||||
[enable_appindicator=$enableval],
|
||||
[enable_appindicator="auto"])
|
||||
|
||||
if test x$enable_appindicator = xauto ; then
|
||||
PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],
|
||||
enable_appindicator="yes",
|
||||
enable_appindicator="no")
|
||||
fi
|
||||
|
||||
if test x$enable_appindicator = xyes ; then
|
||||
PKG_CHECK_EXISTS([appindicator-0.1 >= $APPINDICATOR_REQUIRED],,
|
||||
AC_MSG_ERROR([appindicator-0.1 is not installed]))
|
||||
PKG_CHECK_MODULES(APP_INDICATOR,
|
||||
appindicator-0.1 >= $APPINDICATOR_REQUIRED)
|
||||
AC_SUBST(APP_INDICATOR_CFLAGS)
|
||||
AC_SUBST(APP_INDICATOR_LIBS)
|
||||
AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_APP_INDICATOR, test x"$enable_appindicator" = xyes)
|
||||
|
||||
dnl keyboard-properties-capplet
|
||||
savecppflags=$CPPFLAGS
|
||||
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
||||
|
@ -129,7 +86,6 @@ PKG_CHECK_MODULES(GNOMECC_SHELL, $COMMON_MODULES libgnome-menu gio-unix-2.0)
|
|||
PKG_CHECK_MODULES(DBUS, dbus-1 dbus-glib-1)
|
||||
PKG_CHECK_MODULES(GNOME_DESKTOP, gnome-desktop-3.0)
|
||||
PKG_CHECK_MODULES(DEFAULT_APPLICATIONS_CAPPLET, libxml-2.0)
|
||||
PKG_CHECK_MODULES(TYPING, glib-2.0 > 2.11 gconf-2.0 gtk+-3.0)
|
||||
PKG_CHECK_MODULES(GSD_DBUS, gnome-settings-daemon)
|
||||
PKG_CHECK_MODULES(GIO, gio-2.0)
|
||||
PKG_CHECK_MODULES(XML, libxml-2.0)
|
||||
|
@ -373,7 +329,6 @@ panels/universal-access/gnome-universal-access-panel.desktop.in
|
|||
po/Makefile.in
|
||||
shell/Makefile
|
||||
shell/gnome-control-center.desktop.in
|
||||
typing-break/Makefile
|
||||
])
|
||||
|
||||
dnl due to a bug in intltool we need to expand something from the root last control-center.spec
|
||||
|
|
|
@ -75,16 +75,17 @@
|
|||
<property name="default_width">450</property>
|
||||
<property name="default_height">430</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="has_separator">False</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkNotebook" id="keyboard_notebook">
|
||||
|
@ -94,10 +95,12 @@
|
|||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">18</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox22">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
|
@ -131,6 +134,7 @@
|
|||
<child>
|
||||
<object class="GtkVBox" id="vbox3">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="repeat_toggle">
|
||||
|
@ -154,6 +158,7 @@
|
|||
<child>
|
||||
<object class="GtkVBox" id="vbox24">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="repeat_delay_label">
|
||||
|
@ -191,6 +196,7 @@
|
|||
<child>
|
||||
<object class="GtkVBox" id="vbox25">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="delay_short_label">
|
||||
|
@ -232,6 +238,7 @@
|
|||
<child>
|
||||
<object class="GtkVBox" id="vbox26">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkHScale" id="repeat_delay_scale">
|
||||
|
@ -268,6 +275,7 @@
|
|||
<child>
|
||||
<object class="GtkVBox" id="vbox27">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="delay_long_label">
|
||||
|
@ -329,6 +337,7 @@
|
|||
<child>
|
||||
<object class="GtkVBox" id="vbox23">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label5">
|
||||
|
@ -362,6 +371,7 @@
|
|||
<child>
|
||||
<object class="GtkVBox" id="cursor_vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="cursor_toggle">
|
||||
|
@ -493,10 +503,12 @@
|
|||
<object class="GtkVBox" id="vbox33">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox34">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
|
@ -526,6 +538,7 @@
|
|||
<child>
|
||||
<object class="GtkVBox" id="vbox4">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
|
@ -562,6 +575,7 @@
|
|||
<child>
|
||||
<object class="GtkVBox" id="vbox5">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
|
@ -598,6 +612,7 @@
|
|||
<child>
|
||||
<object class="GtkVBox" id="vbox6">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<child>
|
||||
|
@ -768,11 +783,13 @@ default settings</property>
|
|||
<object class="GtkVBox" id="vbox77">
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">18</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox78">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox39">
|
||||
|
@ -782,6 +799,7 @@ default settings</property>
|
|||
<object class="GtkVBox" id="vbox79">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="master_enable">
|
||||
|
@ -818,6 +836,7 @@ default settings</property>
|
|||
<object class="GtkVBox" id="vbox80">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label73">
|
||||
|
@ -852,6 +871,7 @@ default settings</property>
|
|||
<object class="GtkVBox" id="vbox81">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="stickykeys_enable">
|
||||
|
@ -901,6 +921,7 @@ default settings</property>
|
|||
<object class="GtkVBox" id="vbox82">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label75">
|
||||
|
@ -935,6 +956,7 @@ default settings</property>
|
|||
<object class="GtkVBox" id="vbox83">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="slowkeys_enable">
|
||||
|
@ -1054,6 +1076,7 @@ default settings</property>
|
|||
<object class="GtkVBox" id="vbox84">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label77">
|
||||
|
@ -1088,6 +1111,7 @@ default settings</property>
|
|||
<object class="GtkVBox" id="vbox85">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="bouncekeys_enable">
|
||||
|
@ -1248,10 +1272,12 @@ default settings</property>
|
|||
<object class="GtkVBox" id="vbox89">
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="border_width">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox90">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="mousekeys_enable">
|
||||
|
@ -1286,6 +1312,7 @@ default settings</property>
|
|||
<object class="GtkVBox" id="vbox91">
|
||||
<property name="visible">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="mousekeys_table">
|
||||
|
@ -1542,223 +1569,6 @@ default settings</property>
|
|||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox14">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox18">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">12</property>
|
||||
<property name="spacing">18</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox28">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="break_enabled_toggle">
|
||||
<property name="label" translatable="yes">_Lock screen to enforce typing break</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Lock screen after a certain duration to help prevent repetitive keyboard use injuries</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox26">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label45">
|
||||
<property name="visible">True</property>
|
||||
<property name="label"> </property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVBox" id="break_details_table">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox27">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox30">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label37">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">_Work interval lasts:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">break_enabled_spin</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label30">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">_Break interval lasts:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">break_interval_spin</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox28">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox31">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="break_enabled_spin">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Duration of work before forcing a break</property>
|
||||
<property name="adjustment">adjustment9</property>
|
||||
<property name="climb_rate">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="break_interval_spin">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Duration of the break when typing is disallowed</property>
|
||||
<property name="adjustment">adjustment10</property>
|
||||
<property name="climb_rate">1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox32">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label39">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">minutes</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label31">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">minutes</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="break_postponement_toggle">
|
||||
<property name="label" translatable="yes">All_ow postponing of breaks</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Check if breaks are allowed to be postponed</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel" id="label20">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Typing Break</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">4</property>
|
||||
<property name="tab_fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
|
|
|
@ -148,43 +148,6 @@ setup_dialog (GtkBuilder * dialog, GConfChangeSet * changeset)
|
|||
"conv-from-widget-cb",
|
||||
blink_from_widget, NULL);
|
||||
|
||||
/* Ergonomics */
|
||||
monitor = g_find_program_in_path ("gnome-typing-monitor");
|
||||
if (monitor != NULL) {
|
||||
g_free (monitor);
|
||||
|
||||
peditor = gconf_peditor_new_boolean
|
||||
(changeset, "/desktop/gnome/typing_break/enabled",
|
||||
WID ("break_enabled_toggle"), NULL);
|
||||
gconf_peditor_widget_set_guard (GCONF_PROPERTY_EDITOR
|
||||
(peditor),
|
||||
WID
|
||||
("break_details_table"));
|
||||
gconf_peditor_new_numeric_range (changeset,
|
||||
"/desktop/gnome/typing_break/type_time",
|
||||
WID
|
||||
("break_enabled_spin"),
|
||||
NULL);
|
||||
gconf_peditor_new_numeric_range (changeset,
|
||||
"/desktop/gnome/typing_break/break_time",
|
||||
WID
|
||||
("break_interval_spin"),
|
||||
NULL);
|
||||
gconf_peditor_new_boolean (changeset,
|
||||
"/desktop/gnome/typing_break/allow_postpone",
|
||||
WID
|
||||
("break_postponement_toggle"),
|
||||
NULL);
|
||||
|
||||
} else {
|
||||
/* don't show the typing break tab if the daemon is not available */
|
||||
GtkNotebook *nb = GTK_NOTEBOOK (WID ("keyboard_notebook"));
|
||||
gint tb_page =
|
||||
gtk_notebook_page_num (nb,
|
||||
WID ("break_enabled_toggle"));
|
||||
gtk_notebook_remove_page (nb, tb_page);
|
||||
}
|
||||
|
||||
g_signal_connect (WID ("keyboard_dialog"), "response",
|
||||
(GCallback) dialog_response, changeset);
|
||||
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
bin_PROGRAMS = gnome-typing-monitor
|
||||
|
||||
gnome_typing_monitor_SOURCES = \
|
||||
main.c \
|
||||
drwright.c \
|
||||
drwright.h \
|
||||
drw-break-window.c \
|
||||
drw-break-window.h \
|
||||
drw-monitor.c \
|
||||
drw-monitor.h \
|
||||
drw-utils.c \
|
||||
drw-utils.h \
|
||||
drw-selection.c \
|
||||
drw-selection.h \
|
||||
drw-timer.c \
|
||||
drw-timer.h
|
||||
|
||||
gnome_typing_monitor_CPPFLAGS = \
|
||||
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
|
||||
-DIMAGEDIR=\"$(pkgdatadir)/pixmaps\" \
|
||||
$(AM_CPPFLAGS)
|
||||
gnome_typing_monitor_CFLAGS = \
|
||||
@TYPING_CFLAGS@ \
|
||||
$(AM_CFLAGS)
|
||||
|
||||
gnome_typing_monitor_LDADD = @TYPING_LIBS@ @SCREENSAVER_LIBS@
|
||||
|
||||
if HAVE_LIBCANBERRA_GTK
|
||||
gnome_typing_monitor_CFLAGS += -DHAVE_CANBERRA_GTK @LIBCANBERRA_GTK_CFLAGS@
|
||||
gnome_typing_monitor_LDADD += @LIBCANBERRA_GTK_LIBS@
|
||||
endif
|
||||
|
||||
if HAVE_APP_INDICATOR
|
||||
gnome_typing_monitor_CFLAGS += -DHAVE_APP_INDICATOR @APP_INDICATOR_CFLAGS@
|
||||
gnome_typing_monitor_LDADD += @APP_INDICATOR_LIBS@
|
||||
endif
|
||||
|
||||
imagedir = $(pkgdatadir)/pixmaps
|
||||
dist_image_DATA = bar.png bar-red.png bar-green.png bar-disabled.png ocean-stripes.png
|
||||
|
||||
# Themeable application icon
|
||||
icondir = $(datadir)/icons/hicolor/48x48/apps
|
||||
dist_icon_DATA = typing-monitor.png
|
||||
svgicondir = $(datadir)/icons/hicolor/scalable/apps
|
||||
dist_svgicon_DATA = typing-monitor.svg
|
||||
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
|
||||
install-data-hook: update-icon-cache
|
||||
uninstall-hook: update-icon-cache
|
||||
update-icon-cache:
|
||||
@-if test -z "$(DESTDIR)"; then \
|
||||
echo "Updating Gtk icon cache."; \
|
||||
$(gtk_update_icon_cache); \
|
||||
else \
|
||||
echo "*** Icon cache not updated. After (un)install, run this:"; \
|
||||
echo "*** $(gtk_update_icon_cache)"; \
|
||||
fi
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
Before Width: | Height: | Size: 496 B |
Before Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 277 B |
Before Width: | Height: | Size: 362 B |
|
@ -1,587 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/*
|
||||
* Copyright (C) 2002 CodeFactory AB
|
||||
* Copyright (C) 2002-2003 Richard Hult <richard@imendio.com>
|
||||
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gconf/gconf-client.h>
|
||||
|
||||
#ifdef HAVE_CANBERRA_GTK
|
||||
#include <canberra-gtk.h>
|
||||
#endif
|
||||
|
||||
#include "drwright.h"
|
||||
#include "drw-utils.h"
|
||||
#include "drw-break-window.h"
|
||||
#include "drw-timer.h"
|
||||
|
||||
struct _DrwBreakWindowPrivate {
|
||||
GtkWidget *clock_label;
|
||||
GtkWidget *break_label;
|
||||
GtkWidget *image;
|
||||
|
||||
GtkWidget *postpone_entry;
|
||||
GtkWidget *postpone_button;
|
||||
|
||||
DrwTimer *timer;
|
||||
|
||||
gint break_time;
|
||||
gchar *break_text;
|
||||
guint clock_timeout_id;
|
||||
guint postpone_timeout_id;
|
||||
guint postpone_sensitize_id;
|
||||
};
|
||||
|
||||
#define DRW_BREAK_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DRW_TYPE_BREAK_WINDOW, DrwBreakWindowPrivate))
|
||||
|
||||
#define POSTPONE_CANCEL 30
|
||||
|
||||
/* Signals */
|
||||
enum {
|
||||
DONE,
|
||||
POSTPONE,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static void drw_break_window_class_init (DrwBreakWindowClass *klass);
|
||||
static void drw_break_window_init (DrwBreakWindow *window);
|
||||
static void drw_break_window_finalize (GObject *object);
|
||||
static void drw_break_window_dispose (GObject *object);
|
||||
static gboolean postpone_sensitize_cb (DrwBreakWindow *window);
|
||||
static gboolean clock_timeout_cb (DrwBreakWindow *window);
|
||||
static void postpone_clicked_cb (GtkWidget *button,
|
||||
GtkWidget *window);
|
||||
static gboolean label_draw_event_cb (GtkLabel *label,
|
||||
cairo_t *cr,
|
||||
gpointer user_data);
|
||||
static void label_size_request_cb (GtkLabel *label,
|
||||
GtkRequisition *requisition,
|
||||
gpointer user_data);
|
||||
|
||||
G_DEFINE_TYPE (DrwBreakWindow, drw_break_window, GTK_TYPE_WINDOW)
|
||||
|
||||
static guint signals[LAST_SIGNAL];
|
||||
|
||||
static void
|
||||
drw_break_window_class_init (DrwBreakWindowClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = drw_break_window_finalize;
|
||||
object_class->dispose = drw_break_window_dispose;
|
||||
|
||||
signals[POSTPONE] =
|
||||
g_signal_new ("postpone",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
signals[DONE] =
|
||||
g_signal_new ("done",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
g_type_class_add_private (klass, sizeof (DrwBreakWindowPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
drw_break_window_init (DrwBreakWindow *window)
|
||||
{
|
||||
DrwBreakWindowPrivate *priv;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *align;
|
||||
GtkWidget *monitor_box;
|
||||
gchar *str;
|
||||
GtkWidget *outer_vbox;
|
||||
GtkWidget *button_box;
|
||||
gboolean allow_postpone;
|
||||
|
||||
gint root_monitor = 0;
|
||||
GdkScreen *screen = NULL;
|
||||
GdkRectangle monitor;
|
||||
gint right_padding;
|
||||
gint bottom_padding;
|
||||
GConfClient *client;
|
||||
|
||||
priv = DRW_BREAK_WINDOW_GET_PRIVATE (window);
|
||||
window->priv = priv;
|
||||
|
||||
client = gconf_client_get_default ();
|
||||
|
||||
priv->break_time = 60 * gconf_client_get_int (client,
|
||||
GCONF_PATH "/break_time",
|
||||
NULL);
|
||||
|
||||
allow_postpone = gconf_client_get_bool (client,
|
||||
GCONF_PATH "/allow_postpone",
|
||||
NULL);
|
||||
g_object_unref (client);
|
||||
|
||||
g_object_set (window, "type", GTK_WINDOW_POPUP, NULL);
|
||||
gtk_window_set_keep_above (GTK_WINDOW (window), TRUE);
|
||||
gtk_window_fullscreen (GTK_WINDOW (window));
|
||||
gtk_window_set_modal (GTK_WINDOW (window), TRUE);
|
||||
|
||||
screen = gdk_screen_get_default ();
|
||||
gdk_screen_get_monitor_geometry (screen, root_monitor, &monitor);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
gdk_screen_get_width (screen),
|
||||
gdk_screen_get_height (screen));
|
||||
|
||||
gtk_window_set_decorated (GTK_WINDOW (window), FALSE);
|
||||
gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
|
||||
drw_setup_background (GTK_WIDGET (window));
|
||||
|
||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||
gtk_widget_show (align);
|
||||
|
||||
outer_vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_show (outer_vbox);
|
||||
|
||||
right_padding = gdk_screen_get_width (screen) - monitor.width - monitor.x;
|
||||
bottom_padding = gdk_screen_get_height (screen) - monitor.height - monitor.y;
|
||||
|
||||
monitor_box = gtk_alignment_new (0.5, 0.5, 1, 1);
|
||||
gtk_alignment_set_padding (GTK_ALIGNMENT (monitor_box),
|
||||
monitor.y,
|
||||
bottom_padding,
|
||||
monitor.x,
|
||||
right_padding);
|
||||
gtk_widget_show (monitor_box);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), monitor_box);
|
||||
gtk_container_add (GTK_CONTAINER (monitor_box), outer_vbox);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (outer_vbox), align, TRUE, TRUE, 0);
|
||||
|
||||
if (allow_postpone) {
|
||||
button_box = gtk_hbox_new (FALSE, 0);
|
||||
gtk_widget_show (button_box);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (button_box), 12);
|
||||
|
||||
priv->postpone_button = gtk_button_new_with_mnemonic (_("_Postpone Break"));
|
||||
gtk_widget_show (priv->postpone_button);
|
||||
|
||||
gtk_widget_set_sensitive (priv->postpone_button, FALSE);
|
||||
|
||||
if (priv->postpone_sensitize_id) {
|
||||
g_source_remove (priv->postpone_sensitize_id);
|
||||
}
|
||||
|
||||
priv->postpone_sensitize_id = g_timeout_add_seconds (5,
|
||||
(GSourceFunc) postpone_sensitize_cb,
|
||||
window);
|
||||
|
||||
g_signal_connect (priv->postpone_button,
|
||||
"clicked",
|
||||
G_CALLBACK (postpone_clicked_cb),
|
||||
window);
|
||||
|
||||
gtk_box_pack_end (GTK_BOX (button_box), priv->postpone_button, FALSE, TRUE, 0);
|
||||
|
||||
priv->postpone_entry = gtk_entry_new ();
|
||||
gtk_entry_set_has_frame (GTK_ENTRY (priv->postpone_entry), FALSE);
|
||||
|
||||
gtk_box_pack_end (GTK_BOX (button_box), priv->postpone_entry, FALSE, TRUE, 4);
|
||||
|
||||
gtk_box_pack_end (GTK_BOX (outer_vbox), button_box, FALSE, TRUE, 0);
|
||||
}
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (align), vbox);
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_widget_show (hbox);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, FALSE, 0);
|
||||
|
||||
priv->image = gtk_image_new_from_stock (GTK_STOCK_STOP, GTK_ICON_SIZE_DIALOG);
|
||||
gtk_misc_set_alignment (GTK_MISC (priv->image), 1, 0.5);
|
||||
gtk_widget_show (priv->image);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), priv->image, TRUE, TRUE, 8);
|
||||
|
||||
priv->break_label = gtk_label_new (NULL);
|
||||
gtk_widget_show (priv->break_label);
|
||||
|
||||
g_signal_connect (priv->break_label,
|
||||
"draw",
|
||||
G_CALLBACK (label_draw_event_cb),
|
||||
NULL);
|
||||
|
||||
g_signal_connect_after (priv->break_label,
|
||||
"size_request",
|
||||
G_CALLBACK (label_size_request_cb),
|
||||
NULL);
|
||||
|
||||
str = g_strdup_printf ("<span size=\"xx-large\" foreground=\"white\"><b>%s</b></span>",
|
||||
_("Take a break!"));
|
||||
gtk_label_set_markup (GTK_LABEL (priv->break_label), str);
|
||||
g_free (str);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (hbox), priv->break_label, FALSE, FALSE, 12);
|
||||
|
||||
|
||||
priv->clock_label = gtk_label_new (NULL);
|
||||
gtk_misc_set_alignment (GTK_MISC (priv->clock_label), 0.5, 0.5);
|
||||
gtk_widget_show (priv->clock_label);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), priv->clock_label, TRUE, TRUE, 8);
|
||||
|
||||
g_signal_connect (priv->clock_label,
|
||||
"draw",
|
||||
G_CALLBACK (label_draw_event_cb),
|
||||
NULL);
|
||||
|
||||
g_signal_connect_after (priv->clock_label,
|
||||
"size_request",
|
||||
G_CALLBACK (label_size_request_cb),
|
||||
NULL);
|
||||
|
||||
gtk_window_stick (GTK_WINDOW (window));
|
||||
|
||||
priv->timer = drw_timer_new ();
|
||||
|
||||
/* Make sure we have a valid time label from the start. */
|
||||
clock_timeout_cb (window);
|
||||
|
||||
priv->clock_timeout_id = g_timeout_add (1000,
|
||||
(GSourceFunc) clock_timeout_cb,
|
||||
window);
|
||||
#ifdef HAVE_CANBERRA_GTK
|
||||
ca_context_play (ca_gtk_context_get (), 0, CA_PROP_EVENT_ID, "desktop-screen-lock", NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
drw_break_window_finalize (GObject *object)
|
||||
{
|
||||
DrwBreakWindow *window = DRW_BREAK_WINDOW (object);
|
||||
DrwBreakWindowPrivate *priv;
|
||||
|
||||
priv = window->priv;
|
||||
|
||||
if (priv->clock_timeout_id != 0) {
|
||||
g_source_remove (priv->clock_timeout_id);
|
||||
}
|
||||
|
||||
if (priv->postpone_timeout_id != 0) {
|
||||
g_source_remove (priv->postpone_timeout_id);
|
||||
}
|
||||
|
||||
if (priv->postpone_sensitize_id != 0) {
|
||||
g_source_remove (priv->postpone_sensitize_id);
|
||||
}
|
||||
|
||||
window->priv = NULL;
|
||||
|
||||
if (G_OBJECT_CLASS (drw_break_window_parent_class)->finalize) {
|
||||
(* G_OBJECT_CLASS (drw_break_window_parent_class)->finalize) (object);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
drw_break_window_dispose (GObject *object)
|
||||
{
|
||||
DrwBreakWindow *window = DRW_BREAK_WINDOW (object);
|
||||
DrwBreakWindowPrivate *priv;
|
||||
|
||||
priv = window->priv;
|
||||
|
||||
if (priv->timer) {
|
||||
drw_timer_destroy (priv->timer);
|
||||
priv->timer = NULL;
|
||||
}
|
||||
|
||||
if (priv->clock_timeout_id != 0) {
|
||||
g_source_remove (priv->clock_timeout_id);
|
||||
priv->clock_timeout_id = 0;
|
||||
}
|
||||
|
||||
if (priv->postpone_timeout_id != 0) {
|
||||
g_source_remove (priv->postpone_timeout_id);
|
||||
priv->postpone_timeout_id = 0;
|
||||
}
|
||||
|
||||
if (priv->postpone_sensitize_id != 0) {
|
||||
g_source_remove (priv->postpone_sensitize_id);
|
||||
}
|
||||
|
||||
if (G_OBJECT_CLASS (drw_break_window_parent_class)->dispose) {
|
||||
(* G_OBJECT_CLASS (drw_break_window_parent_class)->dispose) (object);
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
drw_break_window_new (void)
|
||||
{
|
||||
GObject *object;
|
||||
|
||||
object = g_object_new (DRW_TYPE_BREAK_WINDOW,
|
||||
"type", GTK_WINDOW_POPUP,
|
||||
"skip-taskbar-hint", TRUE,
|
||||
"skip-pager-hint", TRUE,
|
||||
"focus-on-map", TRUE,
|
||||
NULL);
|
||||
|
||||
return GTK_WIDGET (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
postpone_sensitize_cb (DrwBreakWindow *window)
|
||||
{
|
||||
DrwBreakWindowPrivate *priv;
|
||||
|
||||
priv = window->priv;
|
||||
|
||||
gtk_widget_set_sensitive (priv->postpone_button, TRUE);
|
||||
|
||||
priv->postpone_sensitize_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clock_timeout_cb (DrwBreakWindow *window)
|
||||
{
|
||||
DrwBreakWindowPrivate *priv;
|
||||
gchar *txt;
|
||||
gint minutes;
|
||||
gint seconds;
|
||||
|
||||
g_return_val_if_fail (DRW_IS_BREAK_WINDOW (window), FALSE);
|
||||
|
||||
priv = window->priv;
|
||||
|
||||
seconds = 1 + priv->break_time - drw_timer_elapsed (priv->timer);
|
||||
seconds = MAX (0, seconds);
|
||||
|
||||
if (seconds == 0) {
|
||||
/* Zero this out so the finalizer doesn't try to remove the
|
||||
* source, which would be done in the timeout callback ==
|
||||
* no-no.
|
||||
*/
|
||||
priv->clock_timeout_id = 0;
|
||||
|
||||
#ifdef HAVE_CANBERRA_GTK
|
||||
ca_context_play (ca_gtk_context_get (), 0, CA_PROP_EVENT_ID, "alarm-clock-elapsed", NULL);
|
||||
#endif
|
||||
g_signal_emit (window, signals[DONE], 0, NULL);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
minutes = seconds / 60;
|
||||
seconds -= minutes * 60;
|
||||
|
||||
txt = g_strdup_printf ("<span size=\"25000\" foreground=\"white\"><b>%d:%02d</b></span>",
|
||||
minutes,
|
||||
seconds);
|
||||
gtk_label_set_markup (GTK_LABEL (priv->clock_label), txt);
|
||||
g_free (txt);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
postpone_entry_activate_cb (GtkWidget *entry,
|
||||
DrwBreakWindow *window)
|
||||
{
|
||||
const gchar *str;
|
||||
gchar *phrase;
|
||||
GConfClient *client = gconf_client_get_default();
|
||||
|
||||
str = gtk_entry_get_text (GTK_ENTRY (entry));
|
||||
|
||||
phrase = gconf_client_get_string (client,
|
||||
GCONF_PATH "/unlock_phrase",
|
||||
NULL);
|
||||
g_object_unref (client);
|
||||
|
||||
if (!strcmp (str, phrase)) {
|
||||
g_signal_emit (window, signals[POSTPONE], 0, NULL);
|
||||
g_free (phrase);
|
||||
return;
|
||||
}
|
||||
|
||||
g_free (phrase);
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), "");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
grab_on_window (GdkWindow *window,
|
||||
guint32 activate_time)
|
||||
{
|
||||
if ((gdk_pointer_grab (window, TRUE,
|
||||
GDK_BUTTON_PRESS_MASK |
|
||||
GDK_BUTTON_RELEASE_MASK |
|
||||
GDK_POINTER_MOTION_MASK,
|
||||
NULL, NULL, activate_time) == 0)) {
|
||||
if (gdk_keyboard_grab (window, TRUE,
|
||||
activate_time) == 0)
|
||||
return TRUE;
|
||||
else {
|
||||
gdk_pointer_ungrab (activate_time);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
postpone_cancel_cb (DrwBreakWindow *window)
|
||||
{
|
||||
DrwBreakWindowPrivate *priv;
|
||||
|
||||
priv = window->priv;
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (priv->postpone_entry), "");
|
||||
gtk_widget_hide (priv->postpone_entry);
|
||||
|
||||
priv->postpone_timeout_id = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
postpone_entry_key_press_event_cb (GtkEntry *entry,
|
||||
GdkEventKey *event,
|
||||
DrwBreakWindow *window)
|
||||
{
|
||||
DrwBreakWindowPrivate *priv;
|
||||
|
||||
priv = window->priv;
|
||||
|
||||
if (event->keyval == GDK_KEY_Escape) {
|
||||
if (priv->postpone_timeout_id) {
|
||||
g_source_remove (priv->postpone_timeout_id);
|
||||
}
|
||||
|
||||
postpone_cancel_cb (window);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
g_source_remove (priv->postpone_timeout_id);
|
||||
|
||||
priv->postpone_timeout_id = g_timeout_add_seconds (POSTPONE_CANCEL, (GSourceFunc) postpone_cancel_cb, window);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
postpone_clicked_cb (GtkWidget *button,
|
||||
GtkWidget *window)
|
||||
{
|
||||
DrwBreakWindow *bw = DRW_BREAK_WINDOW (window);
|
||||
DrwBreakWindowPrivate *priv = bw->priv;
|
||||
gchar *phrase;
|
||||
|
||||
/* Disable the phrase for now. */
|
||||
phrase = NULL; /*gconf_client_get_string (gconf_client_get_default (),
|
||||
GCONF_PATH "/unlock_phrase",
|
||||
NULL);*/
|
||||
|
||||
if (!phrase || !phrase[0]) {
|
||||
g_signal_emit (window, signals[POSTPONE], 0, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (gtk_widget_get_visible (priv->postpone_entry)) {
|
||||
gtk_widget_activate (priv->postpone_entry);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_widget_show (priv->postpone_entry);
|
||||
|
||||
priv->postpone_timeout_id = g_timeout_add_seconds (POSTPONE_CANCEL, (GSourceFunc) postpone_cancel_cb, bw);
|
||||
|
||||
grab_on_window (gtk_widget_get_window (priv->postpone_entry), gtk_get_current_event_time ());
|
||||
|
||||
gtk_widget_grab_focus (priv->postpone_entry);
|
||||
|
||||
g_signal_connect (priv->postpone_entry,
|
||||
"activate",
|
||||
G_CALLBACK (postpone_entry_activate_cb),
|
||||
bw);
|
||||
|
||||
g_signal_connect (priv->postpone_entry,
|
||||
"key_press_event",
|
||||
G_CALLBACK (postpone_entry_key_press_event_cb),
|
||||
bw);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
label_draw_event_cb (GtkLabel *label,
|
||||
cairo_t *cr,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint x, y;
|
||||
GtkWidget *widget;
|
||||
GdkWindow *window;
|
||||
|
||||
gtk_label_get_layout_offsets (label, &x, &y);
|
||||
|
||||
widget = GTK_WIDGET (label);
|
||||
window = gtk_widget_get_window (widget);
|
||||
|
||||
cairo_set_source_rgb (cr, 0, 0, 0);
|
||||
|
||||
/* Can't use pango_cairo_show_layout() here as we need to override
|
||||
* the layout's colors with our shadow color.
|
||||
*/
|
||||
cairo_move_to (cr, x + 1, y + 1);
|
||||
pango_cairo_layout_path (cr, gtk_label_get_layout (label));
|
||||
cairo_fill (cr);
|
||||
|
||||
gtk_paint_layout (gtk_widget_get_style (widget),
|
||||
cr,
|
||||
gtk_widget_get_state (widget),
|
||||
FALSE,
|
||||
widget,
|
||||
"label",
|
||||
x, y,
|
||||
gtk_label_get_layout (label));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
label_size_request_cb (GtkLabel *label,
|
||||
GtkRequisition *requisition,
|
||||
gpointer user_data)
|
||||
{
|
||||
requisition->width += 1;
|
||||
requisition->height += 1;
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/*
|
||||
* Copyright (C) 2002 CodeFactory AB
|
||||
* Copyright (C) 2002 Richard Hult <richard@imendio.com>
|
||||
*
|
||||
* 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 __DRW_BREAK_WINDOW_H__
|
||||
#define __DRW_BREAK_WINDOW_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define DRW_TYPE_BREAK_WINDOW (drw_break_window_get_type ())
|
||||
#define DRW_BREAK_WINDOW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DRW_TYPE_BREAK_WINDOW, DrwBreakWindow))
|
||||
#define DRW_BREAK_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), DRW_TYPE_BREAK_WINDOW, DrwBreakWindowClass))
|
||||
#define DRW_IS_BREAK_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DRW_TYPE_BREAK_WINDOW))
|
||||
#define DRW_IS_BREAK_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DRW_TYPE_BREAK_WINDOW))
|
||||
#define DRW_BREAK_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DRW_TYPE_BREAK_WINDOW, DrwBreakWindowClass))
|
||||
|
||||
typedef struct _DrwBreakWindow DrwBreakWindow;
|
||||
typedef struct _DrwBreakWindowClass DrwBreakWindowClass;
|
||||
typedef struct _DrwBreakWindowPrivate DrwBreakWindowPrivate;
|
||||
|
||||
struct _DrwBreakWindow {
|
||||
GtkWindow parent;
|
||||
|
||||
DrwBreakWindowPrivate *priv;
|
||||
};
|
||||
|
||||
struct _DrwBreakWindowClass {
|
||||
GtkWindowClass parent_class;
|
||||
};
|
||||
|
||||
GType drw_break_window_get_type (void) G_GNUC_CONST;
|
||||
GtkWidget * drw_break_window_new (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __DRW_BREAK_WINDOW_H__ */
|
|
@ -1,196 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/*
|
||||
* Copyright (C) 2002 CodeFactory AB
|
||||
* Copyright (C) 2002 Richard Hult <richard@imendio.com>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/scrnsaver.h>
|
||||
#include "drw-monitor.h"
|
||||
|
||||
struct _DrwMonitorPriv {
|
||||
XScreenSaverInfo *ss_info;
|
||||
guint timeout_id;
|
||||
unsigned long last_idle;
|
||||
|
||||
time_t last_activity;
|
||||
};
|
||||
|
||||
/* Signals */
|
||||
enum {
|
||||
ACTIVITY,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
|
||||
static void drw_monitor_class_init (DrwMonitorClass *klass);
|
||||
static void drw_monitor_init (DrwMonitor *monitor);
|
||||
static void drw_monitor_finalize (GObject *object);
|
||||
static gboolean drw_monitor_setup (DrwMonitor *monitor);
|
||||
|
||||
static GObjectClass *parent_class;
|
||||
static guint signals[LAST_SIGNAL];
|
||||
|
||||
|
||||
GType
|
||||
drw_monitor_get_type (void)
|
||||
{
|
||||
static GType object_type = 0;
|
||||
|
||||
if (!object_type) {
|
||||
static const GTypeInfo object_info = {
|
||||
sizeof (DrwMonitorClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) drw_monitor_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (DrwMonitor),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) drw_monitor_init,
|
||||
};
|
||||
|
||||
object_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"DrwMonitor",
|
||||
&object_info, 0);
|
||||
}
|
||||
|
||||
return object_type;
|
||||
}
|
||||
|
||||
static void
|
||||
drw_monitor_class_init (DrwMonitorClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
|
||||
|
||||
object_class->finalize = drw_monitor_finalize;
|
||||
|
||||
signals[ACTIVITY] =
|
||||
g_signal_new ("activity",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
drw_monitor_init (DrwMonitor *monitor)
|
||||
{
|
||||
DrwMonitorPriv *priv;
|
||||
|
||||
priv = g_new0 (DrwMonitorPriv, 1);
|
||||
monitor->priv = priv;
|
||||
|
||||
drw_monitor_setup (monitor);
|
||||
}
|
||||
|
||||
static void
|
||||
drw_monitor_finalize (GObject *object)
|
||||
{
|
||||
DrwMonitor *monitor = DRW_MONITOR (object);
|
||||
DrwMonitorPriv *priv;
|
||||
|
||||
priv = monitor->priv;
|
||||
|
||||
g_source_remove (priv->timeout_id);
|
||||
priv->timeout_id = 0;
|
||||
|
||||
if (priv->ss_info) {
|
||||
XFree (priv->ss_info);
|
||||
}
|
||||
|
||||
g_free (priv);
|
||||
monitor->priv = NULL;
|
||||
|
||||
if (G_OBJECT_CLASS (parent_class)->finalize) {
|
||||
(* G_OBJECT_CLASS (parent_class)->finalize) (object);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drw_monitor_timeout (DrwMonitor *monitor)
|
||||
{
|
||||
DrwMonitorPriv *priv;
|
||||
time_t now;
|
||||
|
||||
priv = monitor->priv;
|
||||
|
||||
if (XScreenSaverQueryInfo (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
||||
DefaultRootWindow (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())),
|
||||
priv->ss_info) != 0) {
|
||||
if (priv->ss_info->idle < priv->last_idle) {
|
||||
now = time (NULL);
|
||||
|
||||
if (now - priv->last_activity < 25) {
|
||||
g_signal_emit (monitor, signals[ACTIVITY], 0, NULL);
|
||||
}
|
||||
|
||||
priv->last_activity = now;
|
||||
}
|
||||
|
||||
priv->last_idle = priv->ss_info->idle;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drw_monitor_setup (DrwMonitor *monitor)
|
||||
{
|
||||
DrwMonitorPriv *priv;
|
||||
int event_base;
|
||||
int error_base;
|
||||
|
||||
priv = monitor->priv;
|
||||
|
||||
if (!XScreenSaverQueryExtension (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
||||
&event_base, &error_base)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
priv->ss_info = XScreenSaverAllocInfo ();
|
||||
|
||||
priv->last_activity = time (NULL);
|
||||
|
||||
priv->timeout_id = g_timeout_add_seconds (3, (GSourceFunc) drw_monitor_timeout, monitor);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
DrwMonitor *
|
||||
drw_monitor_new (void)
|
||||
{
|
||||
return g_object_new (DRW_TYPE_MONITOR, NULL);
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/*
|
||||
* Copyright (C) 2002 CodeFactory AB
|
||||
* Copyright (C) 2002 Richard Hult <richard@imendi.com>
|
||||
*
|
||||
* 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 __DRW_MONITOR_H__
|
||||
#define __DRW_MONITOR_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#define DRW_TYPE_MONITOR (drw_monitor_get_type ())
|
||||
#define DRW_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DRW_TYPE_MONITOR, DrwMonitor))
|
||||
#define DRW_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), DRW_TYPE_MONITOR, DrwMonitorClass))
|
||||
#define DRW_IS_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DRW_TYPE_MONITOR))
|
||||
#define DRW_IS_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DRW_TYPE_MONITOR))
|
||||
#define DRW_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DRW_TYPE_MONITOR, DrwMonitorClass))
|
||||
|
||||
typedef struct _DrwMonitor DrwMonitor;
|
||||
typedef struct _DrwMonitorClass DrwMonitorClass;
|
||||
typedef struct _DrwMonitorPriv DrwMonitorPriv;
|
||||
|
||||
struct _DrwMonitor {
|
||||
GObject parent;
|
||||
|
||||
DrwMonitorPriv *priv;
|
||||
};
|
||||
|
||||
struct _DrwMonitorClass {
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
GType drw_monitor_get_type (void) G_GNUC_CONST;
|
||||
DrwMonitor *drw_monitor_new (void);
|
||||
|
||||
#endif /* __DRW_MONITOR_H__ */
|
|
@ -1,190 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/* Copyright © 2002 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Red Hat not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. Red Hat makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
|
||||
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Author: Owen Taylor, Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
|
||||
#include "drw-selection.h"
|
||||
|
||||
struct _DrwSelection
|
||||
{
|
||||
GdkWindow *owner_window;
|
||||
GtkWidget *invisible;
|
||||
};
|
||||
|
||||
#define SELECTION_NAME "_CODEFACTORY_DRWRIGHT"
|
||||
|
||||
static GdkFilterReturn drw_selection_filter (GdkXEvent *xevent,
|
||||
GdkEvent *event,
|
||||
gpointer data);
|
||||
static void drw_selection_negotiate (DrwSelection *drw_selection);
|
||||
|
||||
static void
|
||||
drw_selection_reset (DrwSelection *drw_selection)
|
||||
{
|
||||
if (drw_selection->owner_window) {
|
||||
gdk_window_remove_filter (drw_selection->owner_window,
|
||||
drw_selection_filter, drw_selection);
|
||||
g_object_unref (drw_selection->owner_window);
|
||||
drw_selection->owner_window = NULL;
|
||||
}
|
||||
|
||||
if (drw_selection->invisible) {
|
||||
gtk_widget_destroy (drw_selection->invisible);
|
||||
drw_selection->invisible = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
drw_selection_clear (GtkWidget *widget,
|
||||
GdkEventSelection *event,
|
||||
gpointer user_data)
|
||||
{
|
||||
DrwSelection *drw_selection = user_data;
|
||||
|
||||
drw_selection_reset (drw_selection);
|
||||
drw_selection_negotiate (drw_selection);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drw_selection_find_existing (DrwSelection *drw_selection)
|
||||
{
|
||||
Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
||||
Window old;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
old = XGetSelectionOwner (xdisplay,
|
||||
gdk_x11_get_xatom_by_name (SELECTION_NAME));
|
||||
if (old) {
|
||||
XSelectInput (xdisplay, old, StructureNotifyMask);
|
||||
drw_selection->owner_window = gdk_window_foreign_new (old);
|
||||
}
|
||||
XSync (xdisplay, False);
|
||||
|
||||
if (gdk_error_trap_pop () == 0 && drw_selection->owner_window) {
|
||||
gdk_window_add_filter (drw_selection->owner_window,
|
||||
drw_selection_filter, drw_selection);
|
||||
|
||||
XUngrabServer (xdisplay);
|
||||
|
||||
return TRUE;
|
||||
} else {
|
||||
if (drw_selection->owner_window) {
|
||||
g_object_unref (drw_selection->owner_window);
|
||||
drw_selection->owner_window = NULL;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drw_selection_claim (DrwSelection *drw_selection)
|
||||
{
|
||||
drw_selection->invisible = gtk_invisible_new ();
|
||||
g_signal_connect (drw_selection->invisible, "selection-clear-event",
|
||||
G_CALLBACK (drw_selection_clear), drw_selection);
|
||||
|
||||
|
||||
if (gtk_selection_owner_set (drw_selection->invisible,
|
||||
gdk_atom_intern (SELECTION_NAME, FALSE),
|
||||
GDK_CURRENT_TIME)) {
|
||||
return TRUE;
|
||||
} else {
|
||||
drw_selection_reset (drw_selection);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
drw_selection_negotiate (DrwSelection *drw_selection)
|
||||
{
|
||||
Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
||||
gboolean found = FALSE;
|
||||
|
||||
/* We don't need both the XGrabServer() and the loop here;
|
||||
* the XGrabServer() should make sure that we only go through
|
||||
* the loop once. It also works if you remove the XGrabServer()
|
||||
* and just have the loop, but then the selection ownership
|
||||
* can get transfered a bunch of times before things
|
||||
* settle down.
|
||||
*/
|
||||
while (!found)
|
||||
{
|
||||
XGrabServer (xdisplay);
|
||||
|
||||
if (drw_selection_find_existing (drw_selection))
|
||||
found = TRUE;
|
||||
else if (drw_selection_claim (drw_selection))
|
||||
found = TRUE;
|
||||
|
||||
XUngrabServer (xdisplay);
|
||||
}
|
||||
}
|
||||
|
||||
static GdkFilterReturn
|
||||
drw_selection_filter (GdkXEvent *xevent,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
DrwSelection *drw_selection = data;
|
||||
XEvent *xev = (XEvent *)xevent;
|
||||
|
||||
if (xev->xany.type == DestroyNotify &&
|
||||
xev->xdestroywindow.window == xev->xdestroywindow.event)
|
||||
{
|
||||
drw_selection_reset (drw_selection);
|
||||
drw_selection_negotiate (drw_selection);
|
||||
|
||||
return GDK_FILTER_REMOVE;
|
||||
}
|
||||
|
||||
return GDK_FILTER_CONTINUE;
|
||||
}
|
||||
|
||||
DrwSelection *
|
||||
drw_selection_start (void)
|
||||
{
|
||||
DrwSelection *drw_selection = g_new (DrwSelection, 1);
|
||||
|
||||
drw_selection->owner_window = NULL;
|
||||
drw_selection->invisible = NULL;
|
||||
|
||||
drw_selection_negotiate (drw_selection);
|
||||
|
||||
return drw_selection;
|
||||
}
|
||||
|
||||
void
|
||||
drw_selection_stop (DrwSelection *drw_selection)
|
||||
{
|
||||
drw_selection_reset (drw_selection);
|
||||
g_free (drw_selection);
|
||||
}
|
||||
|
||||
gboolean
|
||||
drw_selection_is_master (DrwSelection *drw_selection)
|
||||
{
|
||||
return drw_selection->invisible != NULL;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/* Copyright © 2002 Red Hat, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Red Hat not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. Red Hat makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
|
||||
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Author: Owen Taylor, Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#ifndef __DRW_SELECTION_H__
|
||||
#define __DRW_SELECTION_H__
|
||||
|
||||
typedef struct _DrwSelection DrwSelection;
|
||||
|
||||
DrwSelection * drw_selection_start (void);
|
||||
void drw_selection_stop (DrwSelection *drw_selection);
|
||||
gboolean drw_selection_is_master (DrwSelection *drw_selection);
|
||||
|
||||
#endif /* __DRW_SELECTION_H__ */
|
|
@ -1,52 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/*
|
||||
* Copyright (C) 2009 Nathaniel Smith <njs@pobox.com>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#include "drw-timer.h"
|
||||
|
||||
struct _DrwTimer
|
||||
{
|
||||
GTimeVal start_time;
|
||||
};
|
||||
|
||||
DrwTimer * drw_timer_new (void)
|
||||
{
|
||||
DrwTimer * timer = g_new0 (DrwTimer, 1);
|
||||
drw_timer_start (timer);
|
||||
return timer;
|
||||
}
|
||||
|
||||
void drw_timer_start (DrwTimer *timer)
|
||||
{
|
||||
g_get_current_time (&timer->start_time);
|
||||
}
|
||||
|
||||
double drw_timer_elapsed (DrwTimer *timer)
|
||||
{
|
||||
GTimeVal now;
|
||||
g_get_current_time (&now);
|
||||
return now.tv_sec - timer->start_time.tv_sec;
|
||||
}
|
||||
|
||||
void drw_timer_destroy (DrwTimer *timer)
|
||||
{
|
||||
g_free (timer);
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/*
|
||||
* Copyright (C) 2009 Nathaniel Smith <njs@pobox.com>
|
||||
*
|
||||
* 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 __DRW_TIMER_H__
|
||||
#define __DRW_TIMER_H__
|
||||
|
||||
/*
|
||||
* This file defines a timer interface similar to GTimer, but defined in real
|
||||
* wall-clock time. A GTimer may stop counting while the computer is suspended
|
||||
* or the process is stopped:
|
||||
* https://bugzilla.gnome.org/show_bug.cgi?id=552994
|
||||
* but a DrwTimer keeps counting regardless.
|
||||
*
|
||||
* Currently this only provides second resolution as compared to GTimer's
|
||||
* microsecond resolution, but a typing break program doesn't really need
|
||||
* microsecond resolution anyway.
|
||||
*/
|
||||
|
||||
typedef struct _DrwTimer DrwTimer;
|
||||
DrwTimer * drw_timer_new (void);
|
||||
void drw_timer_start (DrwTimer *timer);
|
||||
double drw_timer_elapsed (DrwTimer *timer);
|
||||
void drw_timer_destroy (DrwTimer *timer);
|
||||
|
||||
#endif /* __DRW_TIMER_H__ */
|
|
@ -1,224 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/*
|
||||
* Copyright (C) 2003 Richard Hult <richard@imendio.com>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "drw-utils.h"
|
||||
|
||||
static GdkPixbuf *
|
||||
create_tile_pixbuf (GdkPixbuf *dest_pixbuf,
|
||||
GdkPixbuf *src_pixbuf,
|
||||
GdkRectangle *field_geom,
|
||||
guint alpha,
|
||||
GdkColor *bg_color)
|
||||
{
|
||||
gboolean need_composite;
|
||||
gboolean use_simple;
|
||||
gdouble cx, cy;
|
||||
gdouble colorv;
|
||||
gint pwidth, pheight;
|
||||
|
||||
need_composite = (alpha < 255 || gdk_pixbuf_get_has_alpha (src_pixbuf));
|
||||
use_simple = (dest_pixbuf == NULL);
|
||||
|
||||
if (dest_pixbuf == NULL)
|
||||
dest_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
|
||||
FALSE, 8,
|
||||
field_geom->width, field_geom->height);
|
||||
|
||||
if (need_composite && use_simple)
|
||||
colorv = ((bg_color->red & 0xff00) << 8) |
|
||||
(bg_color->green & 0xff00) |
|
||||
((bg_color->blue & 0xff00) >> 8);
|
||||
else
|
||||
colorv = 0;
|
||||
|
||||
pwidth = gdk_pixbuf_get_width (src_pixbuf);
|
||||
pheight = gdk_pixbuf_get_height (src_pixbuf);
|
||||
|
||||
for (cy = 0; cy < field_geom->height; cy += pheight) {
|
||||
for (cx = 0; cx < field_geom->width; cx += pwidth) {
|
||||
if (need_composite && !use_simple)
|
||||
gdk_pixbuf_composite (src_pixbuf, dest_pixbuf,
|
||||
cx, cy,
|
||||
MIN (pwidth, field_geom->width - cx),
|
||||
MIN (pheight, field_geom->height - cy),
|
||||
cx, cy,
|
||||
1.0, 1.0,
|
||||
GDK_INTERP_BILINEAR,
|
||||
alpha);
|
||||
else if (need_composite && use_simple)
|
||||
gdk_pixbuf_composite_color (src_pixbuf, dest_pixbuf,
|
||||
cx, cy,
|
||||
MIN (pwidth, field_geom->width - cx),
|
||||
MIN (pheight, field_geom->height - cy),
|
||||
cx, cy,
|
||||
1.0, 1.0,
|
||||
GDK_INTERP_BILINEAR,
|
||||
alpha,
|
||||
65536, 65536, 65536,
|
||||
colorv, colorv);
|
||||
else
|
||||
gdk_pixbuf_copy_area (src_pixbuf,
|
||||
0, 0,
|
||||
MIN (pwidth, field_geom->width - cx),
|
||||
MIN (pheight, field_geom->height - cy),
|
||||
dest_pixbuf,
|
||||
cx, cy);
|
||||
}
|
||||
}
|
||||
|
||||
return dest_pixbuf;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
window_draw_event (GtkWidget *widget,
|
||||
cairo_t *context,
|
||||
gpointer data)
|
||||
{
|
||||
cairo_t *cr;
|
||||
cairo_surface_t *surface;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
cairo_set_operator (context, CAIRO_OPERATOR_SOURCE);
|
||||
gtk_window_get_size (GTK_WINDOW (widget), &width, &height);
|
||||
|
||||
surface = cairo_surface_create_similar (cairo_get_target (context),
|
||||
CAIRO_CONTENT_COLOR_ALPHA,
|
||||
width,
|
||||
height);
|
||||
|
||||
if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
cr = cairo_create (surface);
|
||||
if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0);
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
||||
cairo_paint (cr);
|
||||
|
||||
/* draw a box */
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_set_source_rgba (cr, 0.2, 0.2, 0.2, 0.5);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
cairo_set_source_surface (context, surface, 0, 0);
|
||||
cairo_paint (context);
|
||||
|
||||
done:
|
||||
if (surface != NULL) {
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
set_surface_background (GtkWidget *window)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
GdkPixbuf *pixbuf, *tile_pixbuf;
|
||||
cairo_surface_t *surface;
|
||||
cairo_pattern_t *pattern;
|
||||
GdkRectangle rect;
|
||||
GdkColor color;
|
||||
gint width, height;
|
||||
cairo_t *cr;
|
||||
|
||||
gtk_widget_realize (window);
|
||||
|
||||
screen = gtk_widget_get_screen (window);
|
||||
width = gdk_screen_get_width (screen);
|
||||
height = gdk_screen_get_height (screen);
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_file (IMAGEDIR "/ocean-stripes.png", NULL);
|
||||
|
||||
rect.x = 0;
|
||||
rect.y = 0;
|
||||
rect.width = width;
|
||||
rect.height = height;
|
||||
|
||||
color.red = 0;
|
||||
color.blue = 0;
|
||||
color.green = 0;
|
||||
|
||||
tile_pixbuf = create_tile_pixbuf (NULL,
|
||||
pixbuf,
|
||||
&rect,
|
||||
155,
|
||||
&color);
|
||||
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
cr = gdk_cairo_create (gtk_widget_get_window (window));
|
||||
surface = cairo_surface_create_similar (cairo_get_target (cr),
|
||||
CAIRO_CONTENT_COLOR_ALPHA,
|
||||
width,
|
||||
height);
|
||||
cairo_destroy (cr);
|
||||
|
||||
cr = cairo_create (surface);
|
||||
gdk_cairo_set_source_pixbuf (cr, tile_pixbuf, 0, 0);
|
||||
cairo_paint (cr);
|
||||
cairo_destroy (cr);
|
||||
g_object_unref (tile_pixbuf);
|
||||
|
||||
pattern = cairo_pattern_create_for_surface (surface);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
gdk_window_set_background_pattern (gtk_widget_get_window (window), pattern);
|
||||
cairo_pattern_destroy (pattern);
|
||||
}
|
||||
|
||||
void
|
||||
drw_setup_background (GtkWidget *window)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
GdkVisual *visual;
|
||||
gboolean is_composited;
|
||||
|
||||
screen = gtk_widget_get_screen (window);
|
||||
visual = gdk_screen_get_rgba_visual (screen);
|
||||
if (visual == NULL) {
|
||||
visual = gdk_screen_get_system_visual (screen);
|
||||
}
|
||||
|
||||
if (visual != NULL && gdk_screen_is_composited (screen)) {
|
||||
gtk_widget_set_visual (GTK_WIDGET (window), visual);
|
||||
is_composited = TRUE;
|
||||
} else {
|
||||
is_composited = FALSE;
|
||||
}
|
||||
|
||||
if (is_composited) {
|
||||
g_signal_connect (window, "draw", G_CALLBACK (window_draw_event), window);
|
||||
} else {
|
||||
set_surface_background (window);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/*
|
||||
* Copyright (C) 2003 Richard Hult <richard@imendio.com>
|
||||
*
|
||||
* 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 __DRW_UTILS_H__
|
||||
#define __DRW_UTILS_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
void drw_setup_background (GtkWidget *window);
|
||||
|
||||
|
||||
#endif /* __DRW_UTILS_H__ */
|
|
@ -1,903 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/*
|
||||
* Copyright (C) 2003-2005 Imendio HB
|
||||
* Copyright (C) 2002-2003 Richard Hult <richard@imendio.com>
|
||||
* Copyright (C) 2002 CodeFactory AB
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gconf/gconf-client.h>
|
||||
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
#include <libappindicator/app-indicator.h>
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
#include "drwright.h"
|
||||
#include "drw-break-window.h"
|
||||
#include "drw-monitor.h"
|
||||
#include "drw-utils.h"
|
||||
#include "drw-timer.h"
|
||||
|
||||
#ifndef HAVE_APP_INDICATOR
|
||||
#define BLINK_TIMEOUT 200
|
||||
#define BLINK_TIMEOUT_MIN 120
|
||||
#define BLINK_TIMEOUT_FACTOR 100
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
#define POPUP_ITEM_ENABLED 1
|
||||
#define POPUP_ITEM_BREAK 2
|
||||
|
||||
typedef enum {
|
||||
STATE_START,
|
||||
STATE_RUNNING,
|
||||
STATE_WARN,
|
||||
STATE_BREAK_SETUP,
|
||||
STATE_BREAK,
|
||||
STATE_BREAK_DONE_SETUP,
|
||||
STATE_BREAK_DONE
|
||||
} DrwState;
|
||||
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
#define TYPING_MONITOR_ACTIVE_ICON "bar-green"
|
||||
#define TYPING_MONITOR_ATTENTION_ICON "bar-red"
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
struct _DrWright {
|
||||
/* Widgets. */
|
||||
GtkWidget *break_window;
|
||||
GList *secondary_break_windows;
|
||||
|
||||
DrwMonitor *monitor;
|
||||
|
||||
GtkUIManager *ui_manager;
|
||||
|
||||
DrwState state;
|
||||
DrwTimer *timer;
|
||||
DrwTimer *idle_timer;
|
||||
|
||||
gint last_elapsed_time;
|
||||
gint save_last_time;
|
||||
|
||||
/* Time settings. */
|
||||
gint type_time;
|
||||
gint break_time;
|
||||
gint warn_time;
|
||||
|
||||
gboolean enabled;
|
||||
|
||||
guint clock_timeout_id;
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
AppIndicator *indicator;
|
||||
#else
|
||||
guint blink_timeout_id;
|
||||
|
||||
gboolean blink_on;
|
||||
|
||||
GtkStatusIcon *icon;
|
||||
|
||||
GdkPixbuf *neutral_bar;
|
||||
GdkPixbuf *red_bar;
|
||||
GdkPixbuf *green_bar;
|
||||
GdkPixbuf *disabled_bar;
|
||||
GdkPixbuf *composite_bar;
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
GtkWidget *warn_dialog;
|
||||
};
|
||||
|
||||
static void activity_detected_cb (DrwMonitor *monitor,
|
||||
DrWright *drwright);
|
||||
static gboolean maybe_change_state (DrWright *drwright);
|
||||
static gint get_time_left (DrWright *drwright);
|
||||
static gboolean update_status (DrWright *drwright);
|
||||
static void break_window_done_cb (GtkWidget *window,
|
||||
DrWright *dr);
|
||||
static void break_window_postpone_cb (GtkWidget *window,
|
||||
DrWright *dr);
|
||||
static void break_window_destroy_cb (GtkWidget *window,
|
||||
DrWright *dr);
|
||||
static void popup_break_cb (GtkAction *action,
|
||||
DrWright *dr);
|
||||
static void popup_preferences_cb (GtkAction *action,
|
||||
DrWright *dr);
|
||||
static void popup_about_cb (GtkAction *action,
|
||||
DrWright *dr);
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
static void init_app_indicator (DrWright *dr);
|
||||
#else
|
||||
static void init_tray_icon (DrWright *dr);
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
static GList * create_secondary_break_windows (void);
|
||||
|
||||
static const GtkActionEntry actions[] = {
|
||||
{"Preferences", GTK_STOCK_PREFERENCES, NULL, NULL, NULL, G_CALLBACK (popup_preferences_cb)},
|
||||
{"About", GTK_STOCK_ABOUT, NULL, NULL, NULL, G_CALLBACK (popup_about_cb)},
|
||||
{"TakeABreak", NULL, N_("_Take a Break"), NULL, NULL, G_CALLBACK (popup_break_cb)}
|
||||
};
|
||||
|
||||
extern gboolean debug;
|
||||
|
||||
static void
|
||||
setup_debug_values (DrWright *dr)
|
||||
{
|
||||
dr->type_time = 5;
|
||||
dr->warn_time = 4;
|
||||
dr->break_time = 10;
|
||||
}
|
||||
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
static void
|
||||
update_app_indicator (DrWright *dr)
|
||||
{
|
||||
AppIndicatorStatus new_status;
|
||||
|
||||
if (!dr->enabled) {
|
||||
app_indicator_set_status (dr->indicator,
|
||||
APP_INDICATOR_STATUS_PASSIVE);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (dr->state) {
|
||||
case STATE_WARN:
|
||||
case STATE_BREAK_SETUP:
|
||||
case STATE_BREAK:
|
||||
new_status = APP_INDICATOR_STATUS_ATTENTION;
|
||||
break;
|
||||
default:
|
||||
new_status = APP_INDICATOR_STATUS_ACTIVE;
|
||||
}
|
||||
|
||||
app_indicator_set_status (dr->indicator, new_status);
|
||||
}
|
||||
#else
|
||||
static void
|
||||
update_icon (DrWright *dr)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
GdkPixbuf *tmp_pixbuf;
|
||||
gint width, height;
|
||||
gfloat r;
|
||||
gint offset;
|
||||
gboolean set_pixbuf;
|
||||
|
||||
if (!dr->enabled) {
|
||||
gtk_status_icon_set_from_pixbuf (dr->icon,
|
||||
dr->disabled_bar);
|
||||
return;
|
||||
}
|
||||
|
||||
tmp_pixbuf = gdk_pixbuf_copy (dr->neutral_bar);
|
||||
|
||||
width = gdk_pixbuf_get_width (tmp_pixbuf);
|
||||
height = gdk_pixbuf_get_height (tmp_pixbuf);
|
||||
|
||||
set_pixbuf = TRUE;
|
||||
|
||||
switch (dr->state) {
|
||||
case STATE_BREAK:
|
||||
case STATE_BREAK_SETUP:
|
||||
r = 1;
|
||||
break;
|
||||
|
||||
case STATE_BREAK_DONE:
|
||||
case STATE_BREAK_DONE_SETUP:
|
||||
case STATE_START:
|
||||
r = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
r = (float) (drw_timer_elapsed (dr->timer) + dr->save_last_time) /
|
||||
(float) dr->type_time;
|
||||
break;
|
||||
}
|
||||
|
||||
offset = CLAMP ((height - 0) * (1.0 - r), 1, height - 0);
|
||||
|
||||
switch (dr->state) {
|
||||
case STATE_WARN:
|
||||
pixbuf = dr->red_bar;
|
||||
set_pixbuf = FALSE;
|
||||
break;
|
||||
|
||||
case STATE_BREAK_SETUP:
|
||||
case STATE_BREAK:
|
||||
pixbuf = dr->red_bar;
|
||||
break;
|
||||
|
||||
default:
|
||||
pixbuf = dr->green_bar;
|
||||
}
|
||||
|
||||
gdk_pixbuf_composite (pixbuf,
|
||||
tmp_pixbuf,
|
||||
0,
|
||||
offset,
|
||||
width,
|
||||
height - offset,
|
||||
0,
|
||||
0,
|
||||
1.0,
|
||||
1.0,
|
||||
GDK_INTERP_BILINEAR,
|
||||
255);
|
||||
|
||||
if (set_pixbuf) {
|
||||
gtk_status_icon_set_from_pixbuf (dr->icon,
|
||||
tmp_pixbuf);
|
||||
}
|
||||
|
||||
if (dr->composite_bar) {
|
||||
g_object_unref (dr->composite_bar);
|
||||
}
|
||||
|
||||
dr->composite_bar = tmp_pixbuf;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
blink_timeout_cb (DrWright *dr)
|
||||
{
|
||||
gfloat r;
|
||||
gint timeout;
|
||||
|
||||
r = (dr->type_time - drw_timer_elapsed (dr->timer) - dr->save_last_time) / dr->warn_time;
|
||||
timeout = BLINK_TIMEOUT + BLINK_TIMEOUT_FACTOR * r;
|
||||
|
||||
if (timeout < BLINK_TIMEOUT_MIN) {
|
||||
timeout = BLINK_TIMEOUT_MIN;
|
||||
}
|
||||
|
||||
if (dr->blink_on || timeout == 0) {
|
||||
gtk_status_icon_set_from_pixbuf (dr->icon,
|
||||
dr->composite_bar);
|
||||
} else {
|
||||
gtk_status_icon_set_from_pixbuf (dr->icon,
|
||||
dr->neutral_bar);
|
||||
}
|
||||
|
||||
dr->blink_on = !dr->blink_on;
|
||||
|
||||
if (timeout) {
|
||||
dr->blink_timeout_id = g_timeout_add (timeout,
|
||||
(GSourceFunc) blink_timeout_cb,
|
||||
dr);
|
||||
} else {
|
||||
dr->blink_timeout_id = 0;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
static void
|
||||
start_blinking (DrWright *dr)
|
||||
{
|
||||
#ifndef HAVE_APP_INDICATOR
|
||||
if (!dr->blink_timeout_id) {
|
||||
dr->blink_on = TRUE;
|
||||
blink_timeout_cb (dr);
|
||||
}
|
||||
|
||||
/*gtk_widget_show (GTK_WIDGET (dr->icon));*/
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
}
|
||||
|
||||
static void
|
||||
stop_blinking (DrWright *dr)
|
||||
{
|
||||
#ifndef HAVE_APP_INDICATOR
|
||||
if (dr->blink_timeout_id) {
|
||||
g_source_remove (dr->blink_timeout_id);
|
||||
dr->blink_timeout_id = 0;
|
||||
}
|
||||
|
||||
/*gtk_widget_hide (GTK_WIDGET (dr->icon));*/
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
}
|
||||
|
||||
static gboolean
|
||||
grab_keyboard_on_window (GdkWindow *window,
|
||||
guint32 activate_time)
|
||||
{
|
||||
GdkGrabStatus status;
|
||||
|
||||
status = gdk_keyboard_grab (window, TRUE, activate_time);
|
||||
if (status == GDK_GRAB_SUCCESS) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
break_window_map_event_cb (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
DrWright *dr)
|
||||
{
|
||||
grab_keyboard_on_window (gtk_widget_get_window (dr->break_window), gtk_get_current_event_time ());
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
maybe_change_state (DrWright *dr)
|
||||
{
|
||||
gint elapsed_time;
|
||||
gint elapsed_idle_time;
|
||||
|
||||
if (debug) {
|
||||
drw_timer_start (dr->idle_timer);
|
||||
}
|
||||
|
||||
elapsed_time = drw_timer_elapsed (dr->timer) + dr->save_last_time;
|
||||
elapsed_idle_time = drw_timer_elapsed (dr->idle_timer);
|
||||
|
||||
if (elapsed_time > dr->last_elapsed_time + dr->warn_time) {
|
||||
/* If the timeout is delayed by the amount of warning time, then
|
||||
* we must have been suspended or stopped, so we just start
|
||||
* over.
|
||||
*/
|
||||
dr->state = STATE_START;
|
||||
}
|
||||
|
||||
switch (dr->state) {
|
||||
case STATE_START:
|
||||
if (dr->break_window) {
|
||||
gtk_widget_destroy (dr->break_window);
|
||||
dr->break_window = NULL;
|
||||
}
|
||||
|
||||
#ifndef HAVE_APP_INDICATOR
|
||||
gtk_status_icon_set_from_pixbuf (dr->icon,
|
||||
dr->neutral_bar);
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
dr->save_last_time = 0;
|
||||
|
||||
drw_timer_start (dr->timer);
|
||||
drw_timer_start (dr->idle_timer);
|
||||
|
||||
if (dr->enabled) {
|
||||
dr->state = STATE_RUNNING;
|
||||
}
|
||||
|
||||
update_status (dr);
|
||||
stop_blinking (dr);
|
||||
break;
|
||||
|
||||
case STATE_RUNNING:
|
||||
case STATE_WARN:
|
||||
if (elapsed_idle_time >= dr->break_time) {
|
||||
dr->state = STATE_BREAK_DONE_SETUP;
|
||||
} else if (elapsed_time >= dr->type_time) {
|
||||
dr->state = STATE_BREAK_SETUP;
|
||||
} else if (dr->state != STATE_WARN
|
||||
&& elapsed_time >= dr->type_time - dr->warn_time) {
|
||||
dr->state = STATE_WARN;
|
||||
start_blinking (dr);
|
||||
}
|
||||
break;
|
||||
|
||||
case STATE_BREAK_SETUP:
|
||||
/* Don't allow more than one break window to coexist, can happen
|
||||
* if a break is manually enforced.
|
||||
*/
|
||||
if (dr->break_window) {
|
||||
dr->state = STATE_BREAK;
|
||||
break;
|
||||
}
|
||||
|
||||
stop_blinking (dr);
|
||||
#ifndef HAVE_APP_INDICATOR
|
||||
gtk_status_icon_set_from_pixbuf (dr->icon,
|
||||
dr->red_bar);
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
drw_timer_start (dr->timer);
|
||||
|
||||
dr->break_window = drw_break_window_new ();
|
||||
|
||||
g_signal_connect (dr->break_window, "map_event",
|
||||
G_CALLBACK (break_window_map_event_cb),
|
||||
dr);
|
||||
|
||||
g_signal_connect (dr->break_window,
|
||||
"done",
|
||||
G_CALLBACK (break_window_done_cb),
|
||||
dr);
|
||||
|
||||
g_signal_connect (dr->break_window,
|
||||
"postpone",
|
||||
G_CALLBACK (break_window_postpone_cb),
|
||||
dr);
|
||||
|
||||
g_signal_connect (dr->break_window,
|
||||
"destroy",
|
||||
G_CALLBACK (break_window_destroy_cb),
|
||||
dr);
|
||||
|
||||
dr->secondary_break_windows = create_secondary_break_windows ();
|
||||
|
||||
gtk_widget_show (dr->break_window);
|
||||
|
||||
dr->save_last_time = elapsed_time;
|
||||
dr->state = STATE_BREAK;
|
||||
break;
|
||||
|
||||
case STATE_BREAK:
|
||||
if (elapsed_time - dr->save_last_time >= dr->break_time) {
|
||||
dr->state = STATE_BREAK_DONE_SETUP;
|
||||
}
|
||||
break;
|
||||
|
||||
case STATE_BREAK_DONE_SETUP:
|
||||
stop_blinking (dr);
|
||||
#ifndef HAVE_APP_INDICATOR
|
||||
gtk_status_icon_set_from_pixbuf (dr->icon,
|
||||
dr->green_bar);
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
dr->state = STATE_BREAK_DONE;
|
||||
break;
|
||||
|
||||
case STATE_BREAK_DONE:
|
||||
dr->state = STATE_START;
|
||||
if (dr->break_window) {
|
||||
gtk_widget_destroy (dr->break_window);
|
||||
dr->break_window = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
dr->last_elapsed_time = elapsed_time;
|
||||
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
update_app_indicator (dr);
|
||||
#else
|
||||
update_icon (dr);
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
update_status (DrWright *dr)
|
||||
{
|
||||
gint min;
|
||||
gchar *str;
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
GtkWidget *item;
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
if (!dr->enabled) {
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
app_indicator_set_status (dr->indicator,
|
||||
APP_INDICATOR_STATUS_PASSIVE);
|
||||
#else
|
||||
gtk_status_icon_set_tooltip_text (dr->icon,
|
||||
_("Disabled"));
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
min = get_time_left (dr);
|
||||
|
||||
if (min >= 1) {
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
str = g_strdup_printf (_("Take a break now (next in %dm)"), min);
|
||||
#else
|
||||
str = g_strdup_printf (ngettext("%d minute until the next break",
|
||||
"%d minutes until the next break",
|
||||
min), min);
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
} else {
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
str = g_strdup_printf (_("Take a break now (next in less than one minute)"));
|
||||
#else
|
||||
str = g_strdup_printf (_("Less than one minute until the next break"));
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
}
|
||||
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
item = gtk_ui_manager_get_widget (dr->ui_manager, "/Pop/TakeABreak");
|
||||
gtk_menu_item_set_label (GTK_MENU_ITEM (item), str);
|
||||
#else
|
||||
gtk_status_icon_set_tooltip_text (dr->icon, str);
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
g_free (str);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
get_time_left (DrWright *dr)
|
||||
{
|
||||
gint elapsed_time;
|
||||
|
||||
elapsed_time = drw_timer_elapsed (dr->timer);
|
||||
|
||||
return floor (0.5 + (dr->type_time - elapsed_time - dr->save_last_time) / 60.0);
|
||||
}
|
||||
|
||||
static void
|
||||
activity_detected_cb (DrwMonitor *monitor,
|
||||
DrWright *dr)
|
||||
{
|
||||
drw_timer_start (dr->idle_timer);
|
||||
}
|
||||
|
||||
static void
|
||||
gconf_notify_cb (GConfClient *client,
|
||||
guint cnxn_id,
|
||||
GConfEntry *entry,
|
||||
gpointer user_data)
|
||||
{
|
||||
DrWright *dr = user_data;
|
||||
GtkWidget *item;
|
||||
|
||||
if (!strcmp (entry->key, GCONF_PATH "/type_time")) {
|
||||
if (entry->value->type == GCONF_VALUE_INT) {
|
||||
dr->type_time = 60 * gconf_value_get_int (entry->value);
|
||||
dr->warn_time = MIN (dr->type_time / 10, 5*60);
|
||||
|
||||
dr->state = STATE_START;
|
||||
}
|
||||
}
|
||||
else if (!strcmp (entry->key, GCONF_PATH "/break_time")) {
|
||||
if (entry->value->type == GCONF_VALUE_INT) {
|
||||
dr->break_time = 60 * gconf_value_get_int (entry->value);
|
||||
dr->state = STATE_START;
|
||||
}
|
||||
}
|
||||
else if (!strcmp (entry->key, GCONF_PATH "/enabled")) {
|
||||
if (entry->value->type == GCONF_VALUE_BOOL) {
|
||||
dr->enabled = gconf_value_get_bool (entry->value);
|
||||
dr->state = STATE_START;
|
||||
|
||||
item = gtk_ui_manager_get_widget (dr->ui_manager,
|
||||
"/Pop/TakeABreak");
|
||||
gtk_widget_set_sensitive (item, dr->enabled);
|
||||
|
||||
update_status (dr);
|
||||
}
|
||||
}
|
||||
|
||||
maybe_change_state (dr);
|
||||
}
|
||||
|
||||
static void
|
||||
popup_break_cb (GtkAction *action, DrWright *dr)
|
||||
{
|
||||
if (dr->enabled) {
|
||||
dr->state = STATE_BREAK_SETUP;
|
||||
maybe_change_state (dr);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
popup_preferences_cb (GtkAction *action, DrWright *dr)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
GError *error = NULL;
|
||||
GtkWidget *menu;
|
||||
|
||||
menu = gtk_ui_manager_get_widget (dr->ui_manager, "/Pop");
|
||||
screen = gtk_widget_get_screen (menu);
|
||||
|
||||
if (!gdk_spawn_command_line_on_screen (screen, "gnome-keyboard-properties --typing-break", &error)) {
|
||||
GtkWidget *error_dialog;
|
||||
|
||||
error_dialog = gtk_message_dialog_new (NULL, 0,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
_("Unable to bring up the typing break properties dialog with the following error: %s"),
|
||||
error->message);
|
||||
g_signal_connect (error_dialog,
|
||||
"response",
|
||||
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||
gtk_window_set_resizable (GTK_WINDOW (error_dialog), FALSE);
|
||||
gtk_widget_show (error_dialog);
|
||||
|
||||
g_error_free (error);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
popup_about_cb (GtkAction *action, DrWright *dr)
|
||||
{
|
||||
gint i;
|
||||
gchar *authors[] = {
|
||||
N_("Written by Richard Hult <richard@imendio.com>"),
|
||||
N_("Eye candy added by Anders Carlsson"),
|
||||
NULL
|
||||
};
|
||||
|
||||
for (i = 0; authors [i]; i++)
|
||||
authors [i] = _(authors [i]);
|
||||
|
||||
gtk_show_about_dialog (NULL,
|
||||
"authors", authors,
|
||||
"comments", _("A computer break reminder."),
|
||||
"logo-icon-name", "typing-monitor",
|
||||
"translator-credits", _("translator-credits"),
|
||||
"version", VERSION,
|
||||
NULL);
|
||||
}
|
||||
|
||||
#ifndef HAVE_APP_INDICATOR
|
||||
static void
|
||||
popup_menu_cb (GtkWidget *widget,
|
||||
guint button,
|
||||
guint activate_time,
|
||||
DrWright *dr)
|
||||
{
|
||||
GtkWidget *menu;
|
||||
|
||||
menu = gtk_ui_manager_get_widget (dr->ui_manager, "/Pop");
|
||||
|
||||
gtk_menu_popup (GTK_MENU (menu),
|
||||
NULL,
|
||||
NULL,
|
||||
gtk_status_icon_position_menu,
|
||||
dr->icon,
|
||||
0,
|
||||
gtk_get_current_event_time ());
|
||||
}
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
static void
|
||||
break_window_done_cb (GtkWidget *window,
|
||||
DrWright *dr)
|
||||
{
|
||||
gtk_widget_destroy (dr->break_window);
|
||||
|
||||
dr->state = STATE_BREAK_DONE_SETUP;
|
||||
dr->break_window = NULL;
|
||||
|
||||
update_status (dr);
|
||||
maybe_change_state (dr);
|
||||
}
|
||||
|
||||
static void
|
||||
break_window_postpone_cb (GtkWidget *window,
|
||||
DrWright *dr)
|
||||
{
|
||||
gint elapsed_time;
|
||||
|
||||
gtk_widget_destroy (dr->break_window);
|
||||
|
||||
dr->state = STATE_RUNNING;
|
||||
dr->break_window = NULL;
|
||||
|
||||
elapsed_time = drw_timer_elapsed (dr->timer);
|
||||
|
||||
if (elapsed_time + dr->save_last_time >= dr->type_time) {
|
||||
/* Typing time has expired, but break was postponed.
|
||||
* We'll warn again in (elapsed * sqrt (typing_time))^2 */
|
||||
gfloat postpone_time = (((float) elapsed_time) / dr->break_time)
|
||||
* sqrt (dr->type_time);
|
||||
postpone_time *= postpone_time;
|
||||
dr->save_last_time = dr->type_time - MAX (dr->warn_time, (gint) postpone_time);
|
||||
}
|
||||
|
||||
drw_timer_start (dr->timer);
|
||||
maybe_change_state (dr);
|
||||
update_status (dr);
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
update_app_indicator (dr);
|
||||
#else
|
||||
update_icon (dr);
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
}
|
||||
|
||||
static void
|
||||
break_window_destroy_cb (GtkWidget *window,
|
||||
DrWright *dr)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = dr->secondary_break_windows; l; l = l->next) {
|
||||
gtk_widget_destroy (l->data);
|
||||
}
|
||||
|
||||
g_list_free (dr->secondary_break_windows);
|
||||
dr->secondary_break_windows = NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
static void
|
||||
init_app_indicator (DrWright *dr)
|
||||
{
|
||||
GtkWidget *indicator_menu;
|
||||
|
||||
dr->indicator =
|
||||
app_indicator_new_with_path ("typing-break-indicator",
|
||||
TYPING_MONITOR_ACTIVE_ICON,
|
||||
APP_INDICATOR_CATEGORY_APPLICATION_STATUS,
|
||||
IMAGEDIR);
|
||||
if (dr->enabled) {
|
||||
app_indicator_set_status (dr->indicator,
|
||||
APP_INDICATOR_STATUS_ACTIVE);
|
||||
} else {
|
||||
app_indicator_set_status (dr->indicator,
|
||||
APP_INDICATOR_STATUS_PASSIVE);
|
||||
}
|
||||
|
||||
indicator_menu = gtk_ui_manager_get_widget (dr->ui_manager, "/Pop");
|
||||
app_indicator_set_menu (dr->indicator, GTK_MENU (indicator_menu));
|
||||
app_indicator_set_attention_icon (dr->indicator, TYPING_MONITOR_ATTENTION_ICON);
|
||||
|
||||
update_status (dr);
|
||||
update_app_indicator (dr);
|
||||
}
|
||||
#else
|
||||
static void
|
||||
init_tray_icon (DrWright *dr)
|
||||
{
|
||||
dr->icon = gtk_status_icon_new_from_pixbuf (dr->neutral_bar);
|
||||
|
||||
update_status (dr);
|
||||
update_icon (dr);
|
||||
|
||||
g_signal_connect (dr->icon,
|
||||
"popup_menu",
|
||||
G_CALLBACK (popup_menu_cb),
|
||||
dr);
|
||||
}
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
static GList *
|
||||
create_secondary_break_windows (void)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkScreen *screen;
|
||||
GtkWidget *window;
|
||||
gint i;
|
||||
GList *windows = NULL;
|
||||
|
||||
display = gdk_display_get_default ();
|
||||
|
||||
for (i = 0; i < gdk_display_get_n_screens (display); i++) {
|
||||
screen = gdk_display_get_screen (display, i);
|
||||
|
||||
if (screen == gdk_screen_get_default ()) {
|
||||
/* Handled by DrwBreakWindow. */
|
||||
continue;
|
||||
}
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
|
||||
windows = g_list_prepend (windows, window);
|
||||
|
||||
gtk_window_set_screen (GTK_WINDOW (window), screen);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
gdk_screen_get_width (screen),
|
||||
gdk_screen_get_height (screen));
|
||||
|
||||
gtk_widget_set_app_paintable (GTK_WIDGET (window), TRUE);
|
||||
drw_setup_background (GTK_WIDGET (window));
|
||||
gtk_window_stick (GTK_WINDOW (window));
|
||||
gtk_widget_show (window);
|
||||
}
|
||||
|
||||
return windows;
|
||||
}
|
||||
|
||||
DrWright *
|
||||
drwright_new (void)
|
||||
{
|
||||
DrWright *dr;
|
||||
GtkWidget *item;
|
||||
GConfClient *client;
|
||||
GtkActionGroup *action_group;
|
||||
|
||||
static const char ui_description[] =
|
||||
"<ui>"
|
||||
" <popup name='Pop'>"
|
||||
" <menuitem action='Preferences'/>"
|
||||
" <menuitem action='About'/>"
|
||||
" <separator/>"
|
||||
" <menuitem action='TakeABreak'/>"
|
||||
" </popup>"
|
||||
"</ui>";
|
||||
|
||||
dr = g_new0 (DrWright, 1);
|
||||
|
||||
client = gconf_client_get_default ();
|
||||
|
||||
gconf_client_add_dir (client,
|
||||
GCONF_PATH,
|
||||
GCONF_CLIENT_PRELOAD_NONE,
|
||||
NULL);
|
||||
|
||||
gconf_client_notify_add (client, GCONF_PATH,
|
||||
gconf_notify_cb,
|
||||
dr,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
dr->type_time = 60 * gconf_client_get_int (
|
||||
client, GCONF_PATH "/type_time", NULL);
|
||||
|
||||
dr->warn_time = MIN (dr->type_time / 12, 60*3);
|
||||
|
||||
dr->break_time = 60 * gconf_client_get_int (
|
||||
client, GCONF_PATH "/break_time", NULL);
|
||||
|
||||
dr->enabled = gconf_client_get_bool (
|
||||
client,
|
||||
GCONF_PATH "/enabled",
|
||||
NULL);
|
||||
|
||||
g_object_unref (client);
|
||||
|
||||
if (debug) {
|
||||
setup_debug_values (dr);
|
||||
}
|
||||
|
||||
dr->ui_manager = gtk_ui_manager_new ();
|
||||
|
||||
action_group = gtk_action_group_new ("MenuActions");
|
||||
gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
|
||||
gtk_action_group_add_actions (action_group, actions, G_N_ELEMENTS (actions), dr);
|
||||
gtk_ui_manager_insert_action_group (dr->ui_manager, action_group, 0);
|
||||
gtk_ui_manager_add_ui_from_string (dr->ui_manager, ui_description, -1, NULL);
|
||||
|
||||
item = gtk_ui_manager_get_widget (dr->ui_manager, "/Pop/TakeABreak");
|
||||
gtk_widget_set_sensitive (item, dr->enabled);
|
||||
|
||||
dr->timer = drw_timer_new ();
|
||||
dr->idle_timer = drw_timer_new ();
|
||||
|
||||
dr->state = STATE_START;
|
||||
|
||||
dr->monitor = drw_monitor_new ();
|
||||
|
||||
g_signal_connect (dr->monitor,
|
||||
"activity",
|
||||
G_CALLBACK (activity_detected_cb),
|
||||
dr);
|
||||
|
||||
#ifdef HAVE_APP_INDICATOR
|
||||
init_app_indicator (dr);
|
||||
#else
|
||||
dr->neutral_bar = gdk_pixbuf_new_from_file (IMAGEDIR "/bar.png", NULL);
|
||||
dr->red_bar = gdk_pixbuf_new_from_file (IMAGEDIR "/bar-red.png", NULL);
|
||||
dr->green_bar = gdk_pixbuf_new_from_file (IMAGEDIR "/bar-green.png", NULL);
|
||||
dr->disabled_bar = gdk_pixbuf_new_from_file (IMAGEDIR "/bar-disabled.png", NULL);
|
||||
|
||||
init_tray_icon (dr);
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
g_timeout_add_seconds (12,
|
||||
(GSourceFunc) update_status,
|
||||
dr);
|
||||
|
||||
g_timeout_add_seconds (1,
|
||||
(GSourceFunc) maybe_change_state,
|
||||
dr);
|
||||
|
||||
return dr;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/*
|
||||
* Copyright (C) 2002 Richard Hult <richard@imendio.com>
|
||||
*
|
||||
* 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 __DR_WRIGHT_H__
|
||||
#define __DR_WRIGHT_H__
|
||||
|
||||
#define GCONF_PATH "/desktop/gnome/typing_break"
|
||||
|
||||
typedef struct _DrWright DrWright;
|
||||
|
||||
DrWright *drwright_new (void);
|
||||
|
||||
#endif /* __DR_WRIGHT_H__ */
|
|
@ -1,125 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
||||
/*
|
||||
* Copyright (C) 2002 CodeFactory AB
|
||||
* Copyright (C) 2002-2003 Richard Hult <richard@imendio.com>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "drw-selection.h"
|
||||
#include "drwright.h"
|
||||
|
||||
gboolean debug = FALSE;
|
||||
|
||||
#ifndef HAVE_APP_INDICATOR
|
||||
static gboolean
|
||||
have_tray (void)
|
||||
{
|
||||
Screen *xscreen = DefaultScreenOfDisplay (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
|
||||
Atom selection_atom;
|
||||
char *selection_atom_name;
|
||||
|
||||
selection_atom_name = g_strdup_printf ("_NET_SYSTEM_TRAY_S%d",
|
||||
XScreenNumberOfScreen (xscreen));
|
||||
selection_atom = XInternAtom (DisplayOfScreen (xscreen), selection_atom_name, False);
|
||||
g_free (selection_atom_name);
|
||||
|
||||
if (XGetSelectionOwner (DisplayOfScreen (xscreen), selection_atom)) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
DrWright *drwright;
|
||||
DrwSelection *selection;
|
||||
gboolean no_check = FALSE;
|
||||
const GOptionEntry options[] = {
|
||||
{ "debug", 'd', 0, G_OPTION_ARG_NONE, &debug,
|
||||
N_("Enable debugging code"), NULL },
|
||||
{ "no-check", 'n', 0, G_OPTION_ARG_NONE, &no_check,
|
||||
N_("Don't check whether the notification area exists"), NULL },
|
||||
{ NULL }
|
||||
};
|
||||
GOptionContext *option_context;
|
||||
GError *error = NULL;
|
||||
gboolean retval;
|
||||
|
||||
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||
textdomain (GETTEXT_PACKAGE);
|
||||
|
||||
option_context = g_option_context_new (NULL);
|
||||
#if GLIB_CHECK_VERSION (2, 12, 0)
|
||||
g_option_context_set_translation_domain (option_context, GETTEXT_PACKAGE);
|
||||
#endif
|
||||
g_option_context_add_main_entries (option_context, options, GETTEXT_PACKAGE);
|
||||
g_option_context_add_group (option_context, gtk_get_option_group (TRUE));
|
||||
|
||||
retval = g_option_context_parse (option_context, &argc, &argv, &error);
|
||||
g_option_context_free (option_context);
|
||||
if (!retval) {
|
||||
g_print ("%s\n", error->message);
|
||||
g_error_free (error);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
g_set_application_name (_("Typing Monitor"));
|
||||
gtk_window_set_default_icon_name ("typing-monitor");
|
||||
|
||||
selection = drw_selection_start ();
|
||||
if (!drw_selection_is_master (selection)) {
|
||||
g_message ("The typing monitor is already running, exiting.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef HAVE_APP_INDICATOR
|
||||
if (!no_check && !have_tray ()) {
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (
|
||||
NULL, 0,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
_("The typing monitor uses the notification area to display "
|
||||
"information. You don't seem to have a notification area "
|
||||
"on your panel. You can add it by right-clicking on your "
|
||||
"panel and choosing 'Add to panel', selecting 'Notification "
|
||||
"area' and clicking 'Add'."));
|
||||
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
#endif /* HAVE_APP_INDICATOR */
|
||||
|
||||
drwright = drwright_new ();
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
Before Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.2 KiB |
|
@ -1,336 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://web.resource.org/cc/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="48px"
|
||||
height="48px"
|
||||
id="svg4908"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.44+devel"
|
||||
sodipodi:docbase="/home/andreas/project/application icons/48x48"
|
||||
sodipodi:docname="typing-monitor.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
inkscape:export-filename="/home/andreas/project/application icons/48x48/typing-monitor.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"
|
||||
sodipodi:modified="TRUE">
|
||||
<defs
|
||||
id="defs4910">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient7007">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop7009" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop7011" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient6997">
|
||||
<stop
|
||||
style="stop-color:#2e3436;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop6999" />
|
||||
<stop
|
||||
style="stop-color:#2e3436;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop7001" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient6987">
|
||||
<stop
|
||||
style="stop-color:#503000;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop6989" />
|
||||
<stop
|
||||
style="stop-color:#6f4501;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop6991" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient6979">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop6981" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop6983" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5962">
|
||||
<stop
|
||||
style="stop-color:#d8d8d0;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop5964" />
|
||||
<stop
|
||||
style="stop-color:#fafafa;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop5966" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5952">
|
||||
<stop
|
||||
style="stop-color:#a9ada4;stop-opacity:0.16494845;"
|
||||
offset="0"
|
||||
id="stop5954" />
|
||||
<stop
|
||||
id="stop5960"
|
||||
offset="0.5"
|
||||
style="stop-color:#dbdcd9;stop-opacity:0.94901961;" />
|
||||
<stop
|
||||
style="stop-color:#9fa399;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5956" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5938">
|
||||
<stop
|
||||
style="stop-color:#eeeeec;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5940" />
|
||||
<stop
|
||||
id="stop5946"
|
||||
offset="0.5"
|
||||
style="stop-color:#ffffff;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:#e4e4e1;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop5942" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5918">
|
||||
<stop
|
||||
style="stop-color:#555753;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5920" />
|
||||
<stop
|
||||
style="stop-color:#555753;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5922" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5918"
|
||||
id="radialGradient5924"
|
||||
cx="24.23378"
|
||||
cy="36.63369"
|
||||
fx="24.23378"
|
||||
fy="36.63369"
|
||||
r="16.061426"
|
||||
gradientTransform="matrix(1.0419567,3.4062366e-7,0,0.2338642,-1.0167686,29.144193)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5938"
|
||||
id="linearGradient5944"
|
||||
x1="9.0885315"
|
||||
y1="29.413193"
|
||||
x2="30.001532"
|
||||
y2="29.514208"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.0030622,0,0,1,-0.1178936,-1.9999983)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5952"
|
||||
id="linearGradient5958"
|
||||
x1="26.005463"
|
||||
y1="16.791273"
|
||||
x2="35.894749"
|
||||
y2="5.3816786"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9473685,0,0,0.9266,1.9999999,-0.8531999)" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5962"
|
||||
id="radialGradient5968"
|
||||
cx="17.504116"
|
||||
cy="38.896267"
|
||||
fx="17.504116"
|
||||
fy="38.896267"
|
||||
r="22.160923"
|
||||
gradientTransform="matrix(0.9309009,-1.7410792e-2,4.7534748e-3,0.2323648,7.9437685,28.267387)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient6979"
|
||||
id="linearGradient6985"
|
||||
x1="38.85714"
|
||||
y1="31.5"
|
||||
x2="40.642857"
|
||||
y2="31.5"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(0,-1)" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient6987"
|
||||
id="radialGradient6993"
|
||||
cx="23.992792"
|
||||
cy="28.918667"
|
||||
fx="23.992792"
|
||||
fy="28.918667"
|
||||
r="14.691718"
|
||||
gradientTransform="matrix(1.3068587,-1.1013411e-2,2.7605408e-3,0.2917953,-7.2677551,16.22393)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient6997"
|
||||
id="radialGradient7003"
|
||||
cx="24.266502"
|
||||
cy="40.09565"
|
||||
fx="24.266502"
|
||||
fy="40.09565"
|
||||
r="23.964285"
|
||||
gradientTransform="matrix(0.9539749,-7.3807993e-6,-2.5091472e-8,0.2691364,1.132661,29.95978)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient7007"
|
||||
id="radialGradient7013"
|
||||
cx="43.551655"
|
||||
cy="25.449492"
|
||||
fx="43.551655"
|
||||
fy="25.449492"
|
||||
r="1.2435335"
|
||||
gradientTransform="matrix(2.8786818,0,0,3.7781028,-81.819703,-70.701311)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="9.8994949"
|
||||
inkscape:cx="31.996918"
|
||||
inkscape:cy="27.672311"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:window-width="1680"
|
||||
inkscape:window-height="974"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="26" />
|
||||
<metadata
|
||||
id="metadata4913">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="opacity:0.44021738;fill:url(#radialGradient7003);fill-opacity:1.0;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="path6995"
|
||||
sodipodi:cx="24.25"
|
||||
sodipodi:cy="40.75"
|
||||
sodipodi:rx="23.964285"
|
||||
sodipodi:ry="5.8928571"
|
||||
d="M 48.214285 40.75 A 23.964285 5.8928571 0 1 1 0.2857151,40.75 A 23.964285 5.8928571 0 1 1 48.214285 40.75 z"
|
||||
transform="matrix(1.0059613,0,0,1.539394,-0.5017047,-25.658877)" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="opacity:1;fill:url(#radialGradient5968);fill-opacity:1;stroke:#888a85;stroke-width:0.92989331;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="path5912"
|
||||
sodipodi:cx="23.587063"
|
||||
sodipodi:cy="35.171062"
|
||||
sodipodi:rx="21.667772"
|
||||
sodipodi:ry="8.0812206"
|
||||
d="M 45.254835 35.171062 A 21.667772 8.0812206 0 1 1 1.9192905,35.171062 A 21.667772 8.0812206 0 1 1 45.254835 35.171062 z"
|
||||
transform="matrix(1.0384085,0,0,1.1136931,-0.4930076,-3.6697693)" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="opacity:0.66847826;fill:url(#radialGradient5924);fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="path5916"
|
||||
sodipodi:cx="24.496199"
|
||||
sodipodi:cy="38.049999"
|
||||
sodipodi:rx="16.061426"
|
||||
sodipodi:ry="3.8385797"
|
||||
d="M 40.557625 38.049999 A 16.061426 3.8385797 0 1 1 8.4347725,38.049999 A 16.061426 3.8385797 0 1 1 40.557625 38.049999 z"
|
||||
transform="matrix(0.9961755,0,0,1.5630783,-0.3014947,-24.475125)" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.00897741;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="path5970"
|
||||
sodipodi:cx="23.587063"
|
||||
sodipodi:cy="35.171062"
|
||||
sodipodi:rx="21.667772"
|
||||
sodipodi:ry="8.0812206"
|
||||
d="M 45.254835 35.171062 A 21.667772 8.0812206 0 1 1 1.9192905,35.171062 A 21.667772 8.0812206 0 1 1 45.254835 35.171062 z"
|
||||
transform="matrix(0.9922571,0,0,0.9899493,0.6965858,0.6824308)" />
|
||||
<path
|
||||
style="opacity:1;fill:url(#linearGradient5944);fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
d="M 23.90625,11.5 C 15.95303,11.5 9.4999998,14.082773 9.5,17.25 L 9.5,31.8125 L 10.5,33.25 C 10.5,33.25 9.8205441,38.5 23.8125,38.5 C 37.89254,38.5 37.6875,33.34375 37.6875,33.34375 L 38.5,32.15625 L 38.5,31.5 L 40.71875,31.5 C 42.818921,31.5 44.500001,29.81892 44.5,27.71875 L 44.5,23.28125 C 44.5,21.181079 42.81892,19.5 40.71875,19.5 L 38.5,19.5 L 38.5,17.25 C 38.5,14.082773 31.85947,11.5 23.90625,11.5 z M 38.5,21.5 L 39.03125,21.5 C 40.403909,21.5 41.5,22.596091 41.5,23.96875 L 41.5,27.03125 C 41.500001,28.403909 40.403908,29.5 39.03125,29.5 L 38.5,29.5 L 38.5,21.5 z "
|
||||
id="path5905" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="opacity:1;fill:#d3d7cf;fill-opacity:1;stroke:#888a85;stroke-width:0.96812624;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="path5910"
|
||||
sodipodi:cx="24.748737"
|
||||
sodipodi:cy="22.544155"
|
||||
sodipodi:rx="14.142136"
|
||||
sodipodi:ry="3.7375643"
|
||||
d="M 38.890873 22.544155 A 14.142136 3.7375643 0 1 1 10.606602,22.544155 A 14.142136 3.7375643 0 1 1 38.890873 22.544155 z"
|
||||
transform="matrix(0.88616,0,0,1.2039928,2.1008539,-9.1429975)" />
|
||||
<path
|
||||
style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
d="M 23.960422,12.500002 C 16.580811,12.500002 10.490543,14.526543 10.490543,17.45916 L 10.515797,31.51384 L 11.526844,33.0544 C 11.526844,33.0544 10.901642,37.500003 23.884461,37.500003 C 36.94901,37.500005 36.757882,32.727848 36.757882,32.727848 L 37.5,31.629548 L 37.49389,17.686444 C 37.49389,14.753828 31.340033,12.500002 23.960422,12.500002 z "
|
||||
id="path5928"
|
||||
sodipodi:nodetypes="ccccscccc" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="opacity:1;fill:url(#radialGradient6993);fill-opacity:1;stroke:#888a85;stroke-width:1.09916472;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="path5948"
|
||||
sodipodi:cx="24.748737"
|
||||
sodipodi:cy="22.544155"
|
||||
sodipodi:rx="14.142136"
|
||||
sodipodi:ry="3.7375643"
|
||||
d="M 38.890873 22.544155 A 14.142136 3.7375643 0 1 1 10.606602,22.544155 A 14.142136 3.7375643 0 1 1 38.890873 22.544155 z"
|
||||
transform="matrix(0.8838835,0,0,0.9364388,2.125,-2.1112202)" />
|
||||
<path
|
||||
style="opacity:0.44021738;fill:url(#linearGradient5958);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.99999994px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 20.00983,18.67847 C 20.00983,18.67847 19.712477,13.206563 22.388669,10.260151 C 25.064862,7.3137393 27.741054,9.207861 30.714602,6.8928232 C 33.688151,4.5777853 34.28286,1 34.28286,1 C 34.28286,1 38.874954,5.7239821 37.851119,8.5764868 C 36.827284,11.428993 31.37694,9.884524 30.187523,12.41002 C 28.998102,14.935515 33.093442,18.67847 33.093442,18.67847 C 33.093442,18.67847 28.051699,20.000002 24.780796,20.000002 C 21.509894,20.000002 20.00983,18.67847 20.00983,18.67847 z "
|
||||
id="path5950"
|
||||
sodipodi:nodetypes="czzczzczc" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 38,20.5 L 40.57749,20.5 C 42.034984,20.5 43.5,21.525939 43.5,23 L 43.499941,28.217132 C 43.463947,29.280836 42.266279,30.395048 40.437265,30.499107 L 38,30.4486"
|
||||
id="path6959"
|
||||
sodipodi:nodetypes="cccccc" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:url(#linearGradient6985);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 37.928571,30.5 L 40.5,30.5"
|
||||
id="path6961" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:url(#radialGradient7013);stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 42,20.696954 C 42.69772,21.313113 43.445947,21.878765 43.487067,23 L 43.487067,28 C 43.423512,28.950077 42.998471,29.694158 42,30.202031"
|
||||
id="path7005"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 14 KiB |