From 712a72c30195f9d9e3ce1b36870c264ffb30156f Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Sat, 9 Oct 2010 02:55:21 -0400 Subject: [PATCH] Remove typing break --- Makefile.am | 4 - configure.ac | 45 - .../gnome-keyboard-properties-dialog.ui | 246 +---- panels/keyboard/gnome-keyboard-properties.c | 37 - typing-break/Makefile.am | 58 -- typing-break/bar-disabled.png | Bin 496 -> 0 bytes typing-break/bar-green.png | Bin 286 -> 0 bytes typing-break/bar-red.png | Bin 277 -> 0 bytes typing-break/bar.png | Bin 362 -> 0 bytes typing-break/drw-break-window.c | 587 ------------ typing-break/drw-break-window.h | 55 -- typing-break/drw-monitor.c | 196 ---- typing-break/drw-monitor.h | 51 - typing-break/drw-selection.c | 190 ---- typing-break/drw-selection.h | 33 - typing-break/drw-timer.c | 52 - typing-break/drw-timer.h | 42 - typing-break/drw-utils.c | 224 ----- typing-break/drw-utils.h | 29 - typing-break/drwright.c | 903 ------------------ typing-break/drwright.h | 30 - typing-break/main.c | 125 --- typing-break/ocean-stripes.png | Bin 274 -> 0 bytes typing-break/stock_stop.png | Bin 1451 -> 0 bytes typing-break/typing-monitor.png | Bin 3292 -> 0 bytes typing-break/typing-monitor.svg | 336 ------- 26 files changed, 28 insertions(+), 3215 deletions(-) delete mode 100644 typing-break/Makefile.am delete mode 100644 typing-break/bar-disabled.png delete mode 100644 typing-break/bar-green.png delete mode 100644 typing-break/bar-red.png delete mode 100644 typing-break/bar.png delete mode 100644 typing-break/drw-break-window.c delete mode 100644 typing-break/drw-break-window.h delete mode 100644 typing-break/drw-monitor.c delete mode 100644 typing-break/drw-monitor.h delete mode 100644 typing-break/drw-selection.c delete mode 100644 typing-break/drw-selection.h delete mode 100644 typing-break/drw-timer.c delete mode 100644 typing-break/drw-timer.h delete mode 100644 typing-break/drw-utils.c delete mode 100644 typing-break/drw-utils.h delete mode 100644 typing-break/drwright.c delete mode 100644 typing-break/drwright.h delete mode 100644 typing-break/main.c delete mode 100644 typing-break/ocean-stripes.png delete mode 100644 typing-break/stock_stop.png delete mode 100644 typing-break/typing-monitor.png delete mode 100644 typing-break/typing-monitor.svg diff --git a/Makefile.am b/Makefile.am index 9c4d41186..b9975cbca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index b359d8964..147481732 100644 --- a/configure.ac +++ b/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 diff --git a/panels/keyboard/gnome-keyboard-properties-dialog.ui b/panels/keyboard/gnome-keyboard-properties-dialog.ui index e16ab640f..910da074b 100644 --- a/panels/keyboard/gnome-keyboard-properties-dialog.ui +++ b/panels/keyboard/gnome-keyboard-properties-dialog.ui @@ -75,16 +75,17 @@ 450 430 dialog - False True + vertical 2 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + vertical 12 @@ -94,10 +95,12 @@ True 12 + vertical 18 True + vertical 6 @@ -131,6 +134,7 @@ True + vertical 6 @@ -154,6 +158,7 @@ True + vertical 6 @@ -191,6 +196,7 @@ True + vertical 6 @@ -232,6 +238,7 @@ True + vertical 6 @@ -268,6 +275,7 @@ True + vertical 6 @@ -329,6 +337,7 @@ True + vertical 6 @@ -362,6 +371,7 @@ True + vertical 6 @@ -493,10 +503,12 @@ True 12 + vertical 12 True + vertical 6 @@ -526,6 +538,7 @@ True + vertical 6 True @@ -562,6 +575,7 @@ True + vertical 6 True @@ -598,6 +612,7 @@ True + vertical 6 True @@ -768,11 +783,13 @@ default settings GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 + vertical 18 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 6 @@ -782,6 +799,7 @@ default settings True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 6 @@ -818,6 +836,7 @@ default settings True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 6 @@ -852,6 +871,7 @@ default settings True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 6 @@ -901,6 +921,7 @@ default settings True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 6 @@ -935,6 +956,7 @@ default settings True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 6 @@ -1054,6 +1076,7 @@ default settings True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 6 @@ -1088,6 +1111,7 @@ default settings True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 6 @@ -1248,10 +1272,12 @@ default settings GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 12 + vertical True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 6 @@ -1286,6 +1312,7 @@ default settings True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 6 @@ -1542,223 +1569,6 @@ default settings False - - - True - 12 - - - True - 12 - 18 - - - True - 6 - - - _Lock screen to enforce typing break - True - True - False - Lock screen after a certain duration to help prevent repetitive keyboard use injuries - True - True - - - False - False - 0 - - - - - True - - - True - - - - False - False - 0 - - - - - True - 6 - - - True - 12 - - - True - 6 - - - True - 0 - _Work interval lasts: - True - break_enabled_spin - - - 0 - - - - - True - 0 - _Break interval lasts: - True - break_interval_spin - - - 1 - - - - - False - False - 0 - - - - - True - 6 - - - True - 6 - - - True - True - Duration of work before forcing a break - adjustment9 - 1 - - - 0 - - - - - True - True - Duration of the break when typing is disallowed - adjustment10 - 1 - - - 1 - - - - - 0 - - - - - True - 6 - - - True - 0 - minutes - - - 0 - - - - - True - 0 - minutes - - - 1 - - - - - 1 - - - - - False - False - 1 - - - - - 0 - - - - - All_ow postponing of breaks - True - True - False - Check if breaks are allowed to be postponed - True - True - - - False - False - 1 - - - - - 1 - - - - - False - False - 1 - - - - - 0 - - - - - 0 - - - - - 4 - - - - - True - Typing Break - - - 4 - False - - 0 diff --git a/panels/keyboard/gnome-keyboard-properties.c b/panels/keyboard/gnome-keyboard-properties.c index aaca5924e..920a5b8b6 100644 --- a/panels/keyboard/gnome-keyboard-properties.c +++ b/panels/keyboard/gnome-keyboard-properties.c @@ -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); diff --git a/typing-break/Makefile.am b/typing-break/Makefile.am deleted file mode 100644 index c03e60420..000000000 --- a/typing-break/Makefile.am +++ /dev/null @@ -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 diff --git a/typing-break/bar-disabled.png b/typing-break/bar-disabled.png deleted file mode 100644 index 247e976cf3d0e8331e5e8d4fca6498abdaa3f7f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 496 zcmVPx#24YJ`L;$$}ya2V6+mUSm000SaNLh0L01FKO01FKP?FYat00007bV*G`2iOA_ z6Ac-6a_X=E00D4GL_t(I%axPQN&-<7#=j|-J%9__^#loHG}TOH=#Zjm4F1bZeT)c+ z9;7UF7}OMvQL-4Li5$>gp+yT9ZH0*bZFDee)cb9|bMCqK$Kk?9VMu1Pc>%yDfZ4uN zL*ws${|?}_+wHy$1}6O0+$zgFVS*$vuTT`VZUiv_z)|YZ5OAD2`EzC(ciC!PM7!P5 z-3UHo1fgjf?REz?Ti=&x!|g^PUxPx^G%(CES}hIC3WL_8HZ?>S%dJ6GAHZ=e)O!^i z$C5*u${p(?&NuV$0ba*ocqj2HfJ1mv{099eUY+j36JiEti9 zhP{3q4r{&zzE_dlQt+tr^36Q)`0`K7Dy&bo27Ni&DXCQOPhzEP(n$t^KOKw1PHg6X cIR6>r#t7-f2^W0pfi7k6boFyt=akR{0JdFciU0rr diff --git a/typing-break/bar-red.png b/typing-break/bar-red.png deleted file mode 100644 index dd3db7679d71c8a1b18bf3d9786f5db30a8abde5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 277 zcmeAS@N?(olHy`uVBq!ia0vp^fY z09g!Im+e~$q&N#aB8wRqxOqUB(cVGn1W=H@#M9T6{RXqRu#Em|!5B-R&{R(s#}JFt zS0`=cJ!~Mr?AalwV7%ngzr!m|@klmmsz`FZX;<9oxv%Dryhqc4^*raNy`Lj%YvX14 zN5iUaYS9hbV!OS(iYkl+6QsJj6)&+JRl8H4Y{!=g-aBx_G_Gjx_gz zzijUvju}aMmj#_Yv_mjQ$fx1i(ka~5vJb-cMOx3!a+gY3nX|h~jN>E!XGVeJGJC$3 SEcg#}AcLo?pUXO@geCw3NL~W~ diff --git a/typing-break/bar.png b/typing-break/bar.png deleted file mode 100644 index 4eead01c91a0ba8c8f88a3ee0121d7333f94ea4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 362 zcmV-w0hRuVP)Px#24YJ`L;$$}ya2V6+mUSm000SaNLh0L01FKO01FKP?FYat00007bV*G`2iOA_ z5+)5A8mW^2008PqL_t(I%bk-s4#F@HMgNz_R2(1$bld_VL<{0Z2qDB_B9sn6%?-E$ z1w{(lNC*L@h?AHlo2MCjmZ$HrO*j?=!2rM$fU=%W+SvUaz%`EJTb2-fT6Z)ao={`k zFglW)ltBalma9c6V7=P>#H6fvzdQWIX7lOa+ER#80@99w)yMmWyt0MX%FZ!^n8uJI zp*2z=%&(<2L@OyeNw5M_sl@hYBo8GbFhs6^^cbw_hy|F`6MjnQ9D_a(5p5d@!gwmt zPKs>x*dB!vvG0tnZzr$p^?PV)()6dcft - - * - * 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 -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_CANBERRA_GTK -#include -#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 ("%s", - _("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 ("%d:%02d", - 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; -} diff --git a/typing-break/drw-break-window.h b/typing-break/drw-break-window.h deleted file mode 100644 index a856cd3fd..000000000 --- a/typing-break/drw-break-window.h +++ /dev/null @@ -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 - * - * 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 - -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__ */ diff --git a/typing-break/drw-monitor.c b/typing-break/drw-monitor.c deleted file mode 100644 index e9dc57b46..000000000 --- a/typing-break/drw-monitor.c +++ /dev/null @@ -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 - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#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); -} - diff --git a/typing-break/drw-monitor.h b/typing-break/drw-monitor.h deleted file mode 100644 index 3b5ef6774..000000000 --- a/typing-break/drw-monitor.h +++ /dev/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 - * - * 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 - -#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__ */ diff --git a/typing-break/drw-selection.c b/typing-break/drw-selection.c deleted file mode 100644 index 9607df917..000000000 --- a/typing-break/drw-selection.c +++ /dev/null @@ -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 -#include -#include - -#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; -} diff --git a/typing-break/drw-selection.h b/typing-break/drw-selection.h deleted file mode 100644 index f384a4e16..000000000 --- a/typing-break/drw-selection.h +++ /dev/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__ */ diff --git a/typing-break/drw-timer.c b/typing-break/drw-timer.c deleted file mode 100644 index 8eafc5349..000000000 --- a/typing-break/drw-timer.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2009 Nathaniel Smith - * - * 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 -#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); -} - diff --git a/typing-break/drw-timer.h b/typing-break/drw-timer.h deleted file mode 100644 index 09392d25a..000000000 --- a/typing-break/drw-timer.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2009 Nathaniel Smith - * - * 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__ */ diff --git a/typing-break/drw-utils.c b/typing-break/drw-utils.c deleted file mode 100644 index 9242fa223..000000000 --- a/typing-break/drw-utils.c +++ /dev/null @@ -1,224 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2003 Richard Hult - * - * 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 -#include -#include -#include -#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); - } -} - diff --git a/typing-break/drw-utils.h b/typing-break/drw-utils.h deleted file mode 100644 index 9ef75bb79..000000000 --- a/typing-break/drw-utils.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2003 Richard Hult - * - * 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 - -void drw_setup_background (GtkWidget *window); - - -#endif /* __DRW_UTILS_H__ */ diff --git a/typing-break/drwright.c b/typing-break/drwright.c deleted file mode 100644 index 5e8674d00..000000000 --- a/typing-break/drwright.c +++ /dev/null @@ -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 - * 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 -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_APP_INDICATOR -#include -#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 "), - 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[] = - "" - " " - " " - " " - " " - " " - " " - ""; - - 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; -} diff --git a/typing-break/drwright.h b/typing-break/drwright.h deleted file mode 100644 index df2cf9919..000000000 --- a/typing-break/drwright.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2002 Richard Hult - * - * 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__ */ diff --git a/typing-break/main.c b/typing-break/main.c deleted file mode 100644 index ef0a3395e..000000000 --- a/typing-break/main.c +++ /dev/null @@ -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 - * - * 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 -#include -#include -#include -#include -#include - -#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; -} diff --git a/typing-break/ocean-stripes.png b/typing-break/ocean-stripes.png deleted file mode 100644 index d0570962e8133edca3472b2191d1f177d1403787..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0L3?#3!&-4XSoB=)|u4gV>-@NC-pPL@zl%_w9?DAArVbfsM;d&r2*R1)67;mY8a4X=-d_Vq$4- zm||j{WRaX|WNwsbnQUN^l45CAue}1OixZ^FB{e6plEKixAV#uFVdQ&MBb@ E0Af{AnE(I) diff --git a/typing-break/stock_stop.png b/typing-break/stock_stop.png deleted file mode 100644 index 4beba47d95667132157f7c76cc8f4cf40ee4ccda..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1451 zcmV;c1yuTpP)_e|KhfcV^c6Uhmp#$4-pF2~7eaZBx-E5~3}F z0v6#R{-OdTBr0e@ZK3=DNmEp*RG_FuDim4-5(tqX*9csZ5;aXyI}VAeHceWZL~&ib z#&5^F>wV13J^Vq8Y^QnjldeWr_s;j7bMLv|fo16L?>CmuoiK{aVJ?kZw%z>ybrCTJ z1_rWw_Utj2Z?^jT`&~fy_V(7a)+?B*4P+I0*0PKN5tVan`=NTh{^v&@eZ)R`bf}_~ z(jro+H@ubq^!4@GeSLl5)nVGKh+Y8>F!IFSpH`nA_={}W@?l9Olbe7nSAm(&=k>_Q zNH9D+ykfz>^o@tZw{N|1>zP8KWmoT~Ka;%oJKwbstyA$Pb@tr(Z?+W*-%BMDW7%}# zl-70C{k|@Da%#rodeP)KhbG6z<@D>X>HF`yN6HHe^3uTr^4O1e$>e|jEl>S?uXJ~H z>D#t#wE;HttXpw!#Dk-fi-07ONk=Im z5(<$>BtQhTPdc3efkZ5h2xRhY_?Y;9aPNvTy&8LWN2fhD_Rdt``z`rwl9@s)+N-g) zqX13?(=<>9WSes+!ypI(0@2ZH3AjKNkh$5(Og59=G(AzIvwJ<_X1TafA<~p(O(ct< z{`c;bQdCOwH0pIc-{*=)^x*d&Z13o3JKJ7p(QWzW1Ey)VCF4!R)6Iwqk!xijQa;||3{%AsO7qi1qfxwSnZ;@i5eZ$Efe1?` z^vXM9VVN`B4m|h{wX1%BNJWFg|&aMxZ3@g#E=@Ep&<8 z1cK}81!qqFv*-8E{Q3{;+S_L>kVGUb@sK4^%M{l##8Swm-gFxH(>)tMYrLBsUlE_W z<953^F>&UuJMU~sCK8Sge1bsZ2LXW&sCph&C=_HfshOeU!-w|md#)SU0aUKbO$T21 zhhf6HA3X2?U;M)7nVO!)PzpZ?s8koJ)@m50Y1*!nJ9gs4mw-7Sy<9+DcP>NEyj4})i)4=lsre|g-m&!%pW?*cI;J@HmP{uhE?hpU~002ovPDHLk FV1jZh*?s^3 diff --git a/typing-break/typing-monitor.png b/typing-break/typing-monitor.png deleted file mode 100644 index 41ee09cff23523b5fc1f9c5359be0684a186748b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3292 zcmV<23?uW2P)D0|kGie(SDlzGV=}ax6$ew!YnRYszOdodZ8tO@GTnh;sV;npXOnA5m z1VY9^JS3q7X|=C=&!d0rN?O@q3k-#PGk4CtXV1Ck`+d)IzPrR)i{E6Tx0``4N_PYR zLI}ChxpxGB?c2A9UU=aJ=SJp|+wB8wZEa3E9k0+@rhwk`x^>@AU(fv8s)2(C4+<$! z7l{-_LLo##p{d@BFTUtq&pU1#fX>cN>6_$o?#ePDq{o4rCBJj3t+ZLMad-$zn z@@mxG-R&r)?lvZzBbaTsK@U zgeWJRh8)LX#wTe)2$h7=Og2NMbSPttYRxl~eg7>3KnNkPz4cn93pP{htV0NQv)K#} zOptN314!$J9mmTmMy$8( zAf>cQ1%aOmvO&uCgRErC5mJnVg#6fXyrX;e?E7%dnl);&>wMubx@F6j3c}3;j&xTs zPGUcAK2uC8@M;SdDpFvfy021+T6(NIbu2z+Gy0KT6=I-N#u@7Z)` zXD8KKcWa}5W|V%lscF;UTMD41rKMWB?4PDho%WT+HEZ3nvU0*0Lpq(p#lAlD_g%zr zVi<`;0>i^YNQ@*vKoE^a5Q!Bb>O~Ot!YC~%!OR)eh(=?`WYRc){=9j6S4VavnfxE4 z$oHC>nl9dS0MGqh%MXf+i+}XUHy(2#tq%uaSwLfl3a7Q39iUSe=1UJ^+An z3Bp`Z?tpL?B3h16>1;5s0+vS+i+Y$gqY7tx&*AqUUkBH5@h|`O(=$)~WmC=P@iwVE zkj?tlp->1fZ~YJW*%Z2typJp0yO8NS25a=#I17MF4;B-5$66}@sj=Sd<&Tg&_bX7! zp|T^0m(RnMIbVhF%JF8~8~FAUe}W(gW=)2-NhdOEE#jB@aOLFN7&`q9tObk(tj#fw ze5(jRNWQOtMwuVo`4godDDFKwW@VxQOXiICe1ppz%MHsR@!IK*{ ze{b{f1i?(k2U=R2?Z&1}IDg?B{_Ev`NAk)A44!-!!{?4cYYk(s0;u4%gyh6I$|xZK zrMY{`7-G}!LfPD}AY3#RkN(c%m|MSKY_7Ey$>az+j~@%(+q-9Agryf0g19aXM7#)| zeDb?EbLJ!Ld3QDv$t3(_9GT0#NL>0gGKoPbKLZtHa;=}uEg~Io>4HlaLb`CGW$?$bi{iv#{8Z{rZv^K*FhesAJygS^msDUnB@>|05yvp|W_Gbb7=?wwM zNt2+iZVu+msYjp!4D|Qo^hZ57bEX@KD_5Yk%9#@g2xU1b8Vv#iSOUf=!d?{9rdOeA z#!QrzmqQA1)wL3-^h1Xa|LO&;_2R`1i|PD%3wZm^9gh}{xh?>oJbF9QL3Q;k%$ijL zN`D)aQfRGnW@RR}xqCC#HyP7?y6Ne?EiKRdc~{r*wuK88L>S`;{9tO~m^zg z;}3t4Or;{%`u(N?xE%$8J6;2yM|V7cmX>E$dExNLwSNChCvItNp2HaX!<*06lxTM%{}7h3CFQY)aV0%&P%Uf?)RbHs~0`1OY#mfK!^<^PA{0+Ld~3y1%B z?%erkSk!=6tQa5u?-2z^RP!J^ILFPHjycyJ( z6GFfk!@$6RdHI!>4rH_0l^dHjX_`mfw76kOLtSkhQ%X%>-dc`Ni7KP?$! z3>c%BK79sGoIDQK4dpjn*V?Y%n2j;UQC3!g6J5ull|n2QLnfU@j;C>fDy6V+!CjJb z{w)AtAx{!(?ekw=y@q{Strl8q1c8szk}`C3>_AOTEsBbY^B^n;ArmfZ?WC?zavTRm zMJ0&Eig4yk4|cS-VdbjTa2yAMGcZQ;<8yNe0fZ1Z@WK9)-S58hw`^y}+c@yS{%$cA}{%zujL{hgX6g9ALuu`cE5Gx$l;^U0tH9PA8r2O^x~4@_T~57 zTfbt(Du)oj_p?xHTpNY0QaRrUf&jV5r4R(FAbc7CIiDbez~)VfGX_d?KsaaMTtZ3# z&P6^PlY+2J!5D|*xL}Oo(4m9=dwchs>hJ4+u=$yma}xk8TeghOnq3{b@BVw6g%D4U zX5yUseFTAmwI=U`qd@G~^XR=X8pdFP364s!Fn1LCPVS-;TFynj$|umsNulp)(w{Eo)002OJeLZt3D#XK$tM95TFaI0Ian^qQp>K$)nN>^(Ip)wx zDJT_;+2uG8sZJ**otY z>)N|Fumwzisw%O5{d&^V(<6;>`Rc~y^D4_rzZnjPA8{Nx=dOi|bbb9?x1zk9a4rhW zYN95Lu>i)kQYhV=iI54;lrm_o5swer?$f8ToyU){L}KJrI+K3=@|B^N-`KV1q>9Ib zQ>RX8e1fi7R%vW(r0H~;rvXW<6*aSF#}>@3SsjbT9+Xl%;JR+f-3u3)($X^Kd7cP` z!^CwQNGZXE0B3wGYmaU(f*^n&_{e6nNT*UZnM|rHLs#_i6UXTA@bI7?1aFNbM%uc% zKi+e)=k$;jB1m7nsJgqm^|kn%R9$HO`t_u%tBadZNHA+11@L>9Hq59jD{bJMRWQoR zq?FU7Bd0OSDhWZUF}BDU9RUDJ*$Aa%$XW~zIH al>QHC0a~vPH~JU=0000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - -