From 0b0e6bc987da4fd88a7854ebb12bde705e92c428 Mon Sep 17 00:00:00 2001 From: Perberos Date: Thu, 1 Dec 2011 21:51:44 -0300 Subject: moving from https://github.com/perberos/mate-desktop-environment --- typing-break/Makefile.am | 58 +++ typing-break/Makefile.in | 899 +++++++++++++++++++++++++++++++++++++++ typing-break/bar-disabled.png | Bin 0 -> 496 bytes typing-break/bar-green.png | Bin 0 -> 286 bytes typing-break/bar-red.png | Bin 0 -> 277 bytes typing-break/bar.png | Bin 0 -> 362 bytes typing-break/drw-break-window.c | 640 ++++++++++++++++++++++++++++ typing-break/drw-break-window.h | 59 +++ typing-break/drw-monitor.c | 193 +++++++++ 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 | 250 +++++++++++ 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 0 -> 274 bytes typing-break/typing-monitor.png | Bin 0 -> 3292 bytes typing-break/typing-monitor.svg | 336 +++++++++++++++ 22 files changed, 3890 insertions(+) create mode 100644 typing-break/Makefile.am create mode 100644 typing-break/Makefile.in create mode 100644 typing-break/bar-disabled.png create mode 100644 typing-break/bar-green.png create mode 100644 typing-break/bar-red.png create mode 100644 typing-break/bar.png create mode 100644 typing-break/drw-break-window.c create mode 100644 typing-break/drw-break-window.h create mode 100644 typing-break/drw-monitor.c create mode 100644 typing-break/drw-monitor.h create mode 100644 typing-break/drw-selection.c create mode 100644 typing-break/drw-selection.h create mode 100644 typing-break/drw-timer.c create mode 100644 typing-break/drw-timer.h create mode 100644 typing-break/drw-utils.c create mode 100644 typing-break/drw-utils.h create mode 100644 typing-break/drwright.c create mode 100644 typing-break/drwright.h create mode 100644 typing-break/main.c create mode 100644 typing-break/ocean-stripes.png create mode 100644 typing-break/typing-monitor.png create mode 100644 typing-break/typing-monitor.svg (limited to 'typing-break') diff --git a/typing-break/Makefile.am b/typing-break/Makefile.am new file mode 100644 index 00000000..1e1ad00d --- /dev/null +++ b/typing-break/Makefile.am @@ -0,0 +1,58 @@ +bin_PROGRAMS = mate-typing-monitor + +mate_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 + +mate_typing_monitor_CPPFLAGS = \ + -DMATELOCALEDIR="\"$(datadir)/locale\"" \ + -DIMAGEDIR=\"$(pkgdatadir)/pixmaps\" \ + $(AM_CPPFLAGS) +mate_typing_monitor_CFLAGS = \ + @TYPING_CFLAGS@ \ + $(AM_CFLAGS) + +mate_typing_monitor_LDADD = @TYPING_LIBS@ @SCREENSAVER_LIBS@ + +if HAVE_LIBCANBERRA_GTK + mate_typing_monitor_CFLAGS += -DHAVE_CANBERRA_GTK @LIBCANBERRA_GTK_CFLAGS@ + mate_typing_monitor_LDADD += @LIBCANBERRA_GTK_LIBS@ +endif + +if HAVE_APP_INDICATOR + mate_typing_monitor_CFLAGS += -DHAVE_APP_INDICATOR @APP_INDICATOR_CFLAGS@ + mate_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/Makefile.in b/typing-break/Makefile.in new file mode 100644 index 00000000..721b47c3 --- /dev/null +++ b/typing-break/Makefile.in @@ -0,0 +1,899 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = mate-typing-monitor$(EXEEXT) +@HAVE_LIBCANBERRA_GTK_TRUE@am__append_1 = -DHAVE_CANBERRA_GTK @LIBCANBERRA_GTK_CFLAGS@ +@HAVE_LIBCANBERRA_GTK_TRUE@am__append_2 = @LIBCANBERRA_GTK_LIBS@ +@HAVE_APP_INDICATOR_TRUE@am__append_3 = -DHAVE_APP_INDICATOR @APP_INDICATOR_CFLAGS@ +@HAVE_APP_INDICATOR_TRUE@am__append_4 = @APP_INDICATOR_LIBS@ +subdir = typing-break +DIST_COMMON = $(dist_icon_DATA) $(dist_image_DATA) \ + $(dist_svgicon_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/mate-doc-utils.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(icondir)" \ + "$(DESTDIR)$(imagedir)" "$(DESTDIR)$(svgicondir)" +PROGRAMS = $(bin_PROGRAMS) +am_mate_typing_monitor_OBJECTS = mate_typing_monitor-main.$(OBJEXT) \ + mate_typing_monitor-drwright.$(OBJEXT) \ + mate_typing_monitor-drw-break-window.$(OBJEXT) \ + mate_typing_monitor-drw-monitor.$(OBJEXT) \ + mate_typing_monitor-drw-utils.$(OBJEXT) \ + mate_typing_monitor-drw-selection.$(OBJEXT) \ + mate_typing_monitor-drw-timer.$(OBJEXT) +mate_typing_monitor_OBJECTS = $(am_mate_typing_monitor_OBJECTS) +am__DEPENDENCIES_1 = +mate_typing_monitor_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +mate_typing_monitor_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(mate_typing_monitor_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(mate_typing_monitor_SOURCES) +DIST_SOURCES = $(mate_typing_monitor_SOURCES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +DATA = $(dist_icon_DATA) $(dist_image_DATA) $(dist_svgicon_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APP_INDICATOR_CFLAGS = @APP_INDICATOR_CFLAGS@ +APP_INDICATOR_LIBS = @APP_INDICATOR_LIBS@ +AR = @AR@ +AT_CAPPLET_CFLAGS = @AT_CAPPLET_CFLAGS@ +AT_CAPPLET_LIBS = @AT_CAPPLET_LIBS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CAPPLET_CFLAGS = @CAPPLET_CFLAGS@ +CAPPLET_LIBS = @CAPPLET_LIBS@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DEFAULT_APPLICATIONS_CAPPLET_CFLAGS = @DEFAULT_APPLICATIONS_CAPPLET_CFLAGS@ +DEFAULT_APPLICATIONS_CAPPLET_LIBS = @DEFAULT_APPLICATIONS_CAPPLET_LIBS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DISABLE_DEPRECATED = @DISABLE_DEPRECATED@ +DISPLAY_CAPPLET_CFLAGS = @DISPLAY_CAPPLET_CFLAGS@ +DISPLAY_CAPPLET_LIBS = @DISPLAY_CAPPLET_LIBS@ +DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@ +DLLTOOL = @DLLTOOL@ +DOC_USER_FORMATS = @DOC_USER_FORMATS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +EXTERNAL_LIBSLAB_CFLAGS = @EXTERNAL_LIBSLAB_CFLAGS@ +EXTERNAL_LIBSLAB_LIBS = @EXTERNAL_LIBSLAB_LIBS@ +FGREP = @FGREP@ +FONT_CAPPLET_CFLAGS = @FONT_CAPPLET_CFLAGS@ +FONT_CAPPLET_LIBS = @FONT_CAPPLET_LIBS@ +FONT_VIEWER_CFLAGS = @FONT_VIEWER_CFLAGS@ +FONT_VIEWER_LIBS = @FONT_VIEWER_LIBS@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GREP = @GREP@ +GSD_DBUS_CFLAGS = @GSD_DBUS_CFLAGS@ +GSD_DBUS_LIBS = @GSD_DBUS_LIBS@ +GTK_ENGINE_DIR = @GTK_ENGINE_DIR@ +HELP_DIR = @HELP_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBCANBERRA_GTK_CFLAGS = @LIBCANBERRA_GTK_CFLAGS@ +LIBCANBERRA_GTK_LIBS = @LIBCANBERRA_GTK_LIBS@ +LIBEBOOK_CFLAGS = @LIBEBOOK_CFLAGS@ +LIBEBOOK_LIBS = @LIBEBOOK_LIBS@ +LIBMATEKBDUI_CFLAGS = @LIBMATEKBDUI_CFLAGS@ +LIBMATEKBDUI_LIBS = @LIBMATEKBDUI_LIBS@ +LIBMATEKBD_CFLAGS = @LIBMATEKBD_CFLAGS@ +LIBMATEKBD_LIBS = @LIBMATEKBD_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSLAB_CFLAGS = @LIBSLAB_CFLAGS@ +LIBSLAB_LIBS = @LIBSLAB_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MARCO_CFLAGS = @MARCO_CFLAGS@ +MARCO_LIBS = @MARCO_LIBS@ +MATECC_CAPPLETS_CFLAGS = @MATECC_CAPPLETS_CFLAGS@ +MATECC_CAPPLETS_CLEANFILES = @MATECC_CAPPLETS_CLEANFILES@ +MATECC_CAPPLETS_EXTRA_DIST = @MATECC_CAPPLETS_EXTRA_DIST@ +MATECC_CAPPLETS_LIBS = @MATECC_CAPPLETS_LIBS@ +MATECC_CFLAGS = @MATECC_CFLAGS@ +MATECC_LIBS = @MATECC_LIBS@ +MATECC_SHELL_CFLAGS = @MATECC_SHELL_CFLAGS@ +MATECC_SHELL_LIBS = @MATECC_SHELL_LIBS@ +MATECONFTOOL = @MATECONFTOOL@ +MATECONF_SCHEMA_CONFIG_SOURCE = @MATECONF_SCHEMA_CONFIG_SOURCE@ +MATECONF_SCHEMA_FILE_DIR = @MATECONF_SCHEMA_FILE_DIR@ +MATE_DESKTOP_CFLAGS = @MATE_DESKTOP_CFLAGS@ +MATE_DESKTOP_LIBS = @MATE_DESKTOP_LIBS@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OMF_DIR = @OMF_DIR@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +RANLIB = @RANLIB@ +SCREENSAVER_LIBS = @SCREENSAVER_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TYPING_BREAK = @TYPING_BREAK@ +TYPING_CFLAGS = @TYPING_CFLAGS@ +TYPING_LIBS = @TYPING_LIBS@ +UPDATE_MIME_DATABASE = @UPDATE_MIME_DATABASE@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +XCURSOR_CFLAGS = @XCURSOR_CFLAGS@ +XCURSOR_LIBS = @XCURSOR_LIBS@ +XF86MISC_LIBS = @XF86MISC_LIBS@ +XGETTEXT = @XGETTEXT@ +XINPUT_CFLAGS = @XINPUT_CFLAGS@ +XINPUT_LIBS = @XINPUT_LIBS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +mate_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 + +mate_typing_monitor_CPPFLAGS = \ + -DMATELOCALEDIR="\"$(datadir)/locale\"" \ + -DIMAGEDIR=\"$(pkgdatadir)/pixmaps\" \ + $(AM_CPPFLAGS) + +mate_typing_monitor_CFLAGS = @TYPING_CFLAGS@ $(AM_CFLAGS) \ + $(am__append_1) $(am__append_3) +mate_typing_monitor_LDADD = @TYPING_LIBS@ @SCREENSAVER_LIBS@ \ + $(am__append_2) $(am__append_4) +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 +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu typing-break/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu typing-break/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +mate-typing-monitor$(EXEEXT): $(mate_typing_monitor_OBJECTS) $(mate_typing_monitor_DEPENDENCIES) + @rm -f mate-typing-monitor$(EXEEXT) + $(AM_V_CCLD)$(mate_typing_monitor_LINK) $(mate_typing_monitor_OBJECTS) $(mate_typing_monitor_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mate_typing_monitor-drw-break-window.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mate_typing_monitor-drw-monitor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mate_typing_monitor-drw-selection.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mate_typing_monitor-drw-timer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mate_typing_monitor-drw-utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mate_typing_monitor-drwright.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mate_typing_monitor-main.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mate_typing_monitor-main.o: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-main.o -MD -MP -MF $(DEPDIR)/mate_typing_monitor-main.Tpo -c -o mate_typing_monitor-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-main.Tpo $(DEPDIR)/mate_typing_monitor-main.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='mate_typing_monitor-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c + +mate_typing_monitor-main.obj: main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-main.obj -MD -MP -MF $(DEPDIR)/mate_typing_monitor-main.Tpo -c -o mate_typing_monitor-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-main.Tpo $(DEPDIR)/mate_typing_monitor-main.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='mate_typing_monitor-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` + +mate_typing_monitor-drwright.o: drwright.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drwright.o -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drwright.Tpo -c -o mate_typing_monitor-drwright.o `test -f 'drwright.c' || echo '$(srcdir)/'`drwright.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drwright.Tpo $(DEPDIR)/mate_typing_monitor-drwright.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drwright.c' object='mate_typing_monitor-drwright.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drwright.o `test -f 'drwright.c' || echo '$(srcdir)/'`drwright.c + +mate_typing_monitor-drwright.obj: drwright.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drwright.obj -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drwright.Tpo -c -o mate_typing_monitor-drwright.obj `if test -f 'drwright.c'; then $(CYGPATH_W) 'drwright.c'; else $(CYGPATH_W) '$(srcdir)/drwright.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drwright.Tpo $(DEPDIR)/mate_typing_monitor-drwright.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drwright.c' object='mate_typing_monitor-drwright.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drwright.obj `if test -f 'drwright.c'; then $(CYGPATH_W) 'drwright.c'; else $(CYGPATH_W) '$(srcdir)/drwright.c'; fi` + +mate_typing_monitor-drw-break-window.o: drw-break-window.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drw-break-window.o -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drw-break-window.Tpo -c -o mate_typing_monitor-drw-break-window.o `test -f 'drw-break-window.c' || echo '$(srcdir)/'`drw-break-window.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drw-break-window.Tpo $(DEPDIR)/mate_typing_monitor-drw-break-window.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drw-break-window.c' object='mate_typing_monitor-drw-break-window.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drw-break-window.o `test -f 'drw-break-window.c' || echo '$(srcdir)/'`drw-break-window.c + +mate_typing_monitor-drw-break-window.obj: drw-break-window.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drw-break-window.obj -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drw-break-window.Tpo -c -o mate_typing_monitor-drw-break-window.obj `if test -f 'drw-break-window.c'; then $(CYGPATH_W) 'drw-break-window.c'; else $(CYGPATH_W) '$(srcdir)/drw-break-window.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drw-break-window.Tpo $(DEPDIR)/mate_typing_monitor-drw-break-window.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drw-break-window.c' object='mate_typing_monitor-drw-break-window.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drw-break-window.obj `if test -f 'drw-break-window.c'; then $(CYGPATH_W) 'drw-break-window.c'; else $(CYGPATH_W) '$(srcdir)/drw-break-window.c'; fi` + +mate_typing_monitor-drw-monitor.o: drw-monitor.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drw-monitor.o -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drw-monitor.Tpo -c -o mate_typing_monitor-drw-monitor.o `test -f 'drw-monitor.c' || echo '$(srcdir)/'`drw-monitor.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drw-monitor.Tpo $(DEPDIR)/mate_typing_monitor-drw-monitor.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drw-monitor.c' object='mate_typing_monitor-drw-monitor.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drw-monitor.o `test -f 'drw-monitor.c' || echo '$(srcdir)/'`drw-monitor.c + +mate_typing_monitor-drw-monitor.obj: drw-monitor.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drw-monitor.obj -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drw-monitor.Tpo -c -o mate_typing_monitor-drw-monitor.obj `if test -f 'drw-monitor.c'; then $(CYGPATH_W) 'drw-monitor.c'; else $(CYGPATH_W) '$(srcdir)/drw-monitor.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drw-monitor.Tpo $(DEPDIR)/mate_typing_monitor-drw-monitor.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drw-monitor.c' object='mate_typing_monitor-drw-monitor.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drw-monitor.obj `if test -f 'drw-monitor.c'; then $(CYGPATH_W) 'drw-monitor.c'; else $(CYGPATH_W) '$(srcdir)/drw-monitor.c'; fi` + +mate_typing_monitor-drw-utils.o: drw-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drw-utils.o -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drw-utils.Tpo -c -o mate_typing_monitor-drw-utils.o `test -f 'drw-utils.c' || echo '$(srcdir)/'`drw-utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drw-utils.Tpo $(DEPDIR)/mate_typing_monitor-drw-utils.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drw-utils.c' object='mate_typing_monitor-drw-utils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drw-utils.o `test -f 'drw-utils.c' || echo '$(srcdir)/'`drw-utils.c + +mate_typing_monitor-drw-utils.obj: drw-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drw-utils.obj -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drw-utils.Tpo -c -o mate_typing_monitor-drw-utils.obj `if test -f 'drw-utils.c'; then $(CYGPATH_W) 'drw-utils.c'; else $(CYGPATH_W) '$(srcdir)/drw-utils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drw-utils.Tpo $(DEPDIR)/mate_typing_monitor-drw-utils.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drw-utils.c' object='mate_typing_monitor-drw-utils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drw-utils.obj `if test -f 'drw-utils.c'; then $(CYGPATH_W) 'drw-utils.c'; else $(CYGPATH_W) '$(srcdir)/drw-utils.c'; fi` + +mate_typing_monitor-drw-selection.o: drw-selection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drw-selection.o -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drw-selection.Tpo -c -o mate_typing_monitor-drw-selection.o `test -f 'drw-selection.c' || echo '$(srcdir)/'`drw-selection.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drw-selection.Tpo $(DEPDIR)/mate_typing_monitor-drw-selection.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drw-selection.c' object='mate_typing_monitor-drw-selection.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drw-selection.o `test -f 'drw-selection.c' || echo '$(srcdir)/'`drw-selection.c + +mate_typing_monitor-drw-selection.obj: drw-selection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drw-selection.obj -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drw-selection.Tpo -c -o mate_typing_monitor-drw-selection.obj `if test -f 'drw-selection.c'; then $(CYGPATH_W) 'drw-selection.c'; else $(CYGPATH_W) '$(srcdir)/drw-selection.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drw-selection.Tpo $(DEPDIR)/mate_typing_monitor-drw-selection.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drw-selection.c' object='mate_typing_monitor-drw-selection.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drw-selection.obj `if test -f 'drw-selection.c'; then $(CYGPATH_W) 'drw-selection.c'; else $(CYGPATH_W) '$(srcdir)/drw-selection.c'; fi` + +mate_typing_monitor-drw-timer.o: drw-timer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drw-timer.o -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drw-timer.Tpo -c -o mate_typing_monitor-drw-timer.o `test -f 'drw-timer.c' || echo '$(srcdir)/'`drw-timer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drw-timer.Tpo $(DEPDIR)/mate_typing_monitor-drw-timer.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drw-timer.c' object='mate_typing_monitor-drw-timer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drw-timer.o `test -f 'drw-timer.c' || echo '$(srcdir)/'`drw-timer.c + +mate_typing_monitor-drw-timer.obj: drw-timer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -MT mate_typing_monitor-drw-timer.obj -MD -MP -MF $(DEPDIR)/mate_typing_monitor-drw-timer.Tpo -c -o mate_typing_monitor-drw-timer.obj `if test -f 'drw-timer.c'; then $(CYGPATH_W) 'drw-timer.c'; else $(CYGPATH_W) '$(srcdir)/drw-timer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mate_typing_monitor-drw-timer.Tpo $(DEPDIR)/mate_typing_monitor-drw-timer.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drw-timer.c' object='mate_typing_monitor-drw-timer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mate_typing_monitor_CPPFLAGS) $(CPPFLAGS) $(mate_typing_monitor_CFLAGS) $(CFLAGS) -c -o mate_typing_monitor-drw-timer.obj `if test -f 'drw-timer.c'; then $(CYGPATH_W) 'drw-timer.c'; else $(CYGPATH_W) '$(srcdir)/drw-timer.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-dist_iconDATA: $(dist_icon_DATA) + @$(NORMAL_INSTALL) + test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)" + @list='$(dist_icon_DATA)'; test -n "$(icondir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ + done + +uninstall-dist_iconDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_icon_DATA)'; test -n "$(icondir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(icondir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(icondir)" && rm -f $$files +install-dist_imageDATA: $(dist_image_DATA) + @$(NORMAL_INSTALL) + test -z "$(imagedir)" || $(MKDIR_P) "$(DESTDIR)$(imagedir)" + @list='$(dist_image_DATA)'; test -n "$(imagedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(imagedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(imagedir)" || exit $$?; \ + done + +uninstall-dist_imageDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_image_DATA)'; test -n "$(imagedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(imagedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(imagedir)" && rm -f $$files +install-dist_svgiconDATA: $(dist_svgicon_DATA) + @$(NORMAL_INSTALL) + test -z "$(svgicondir)" || $(MKDIR_P) "$(DESTDIR)$(svgicondir)" + @list='$(dist_svgicon_DATA)'; test -n "$(svgicondir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(svgicondir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(svgicondir)" || exit $$?; \ + done + +uninstall-dist_svgiconDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_svgicon_DATA)'; test -n "$(svgicondir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(svgicondir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(svgicondir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(icondir)" "$(DESTDIR)$(imagedir)" "$(DESTDIR)$(svgicondir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-dist_iconDATA install-dist_imageDATA \ + install-dist_svgiconDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-dist_iconDATA \ + uninstall-dist_imageDATA uninstall-dist_svgiconDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +.MAKE: install-am install-data-am install-strip uninstall-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am \ + install-data-hook install-dist_iconDATA install-dist_imageDATA \ + install-dist_svgiconDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-dist_iconDATA uninstall-dist_imageDATA \ + uninstall-dist_svgiconDATA uninstall-hook + +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 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/typing-break/bar-disabled.png b/typing-break/bar-disabled.png new file mode 100644 index 00000000..247e976c Binary files /dev/null and b/typing-break/bar-disabled.png differ diff --git a/typing-break/bar-green.png b/typing-break/bar-green.png new file mode 100644 index 00000000..8979d10c Binary files /dev/null and b/typing-break/bar-green.png differ diff --git a/typing-break/bar-red.png b/typing-break/bar-red.png new file mode 100644 index 00000000..dd3db767 Binary files /dev/null and b/typing-break/bar-red.png differ diff --git a/typing-break/bar.png b/typing-break/bar.png new file mode 100644 index 00000000..4eead01c Binary files /dev/null and b/typing-break/bar.png differ diff --git a/typing-break/drw-break-window.c b/typing-break/drw-break-window.c new file mode 100644 index 00000000..4684f1a5 --- /dev/null +++ b/typing-break/drw-break-window.c @@ -0,0 +1,640 @@ +/* -*- 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 + +#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_expose_event_cb (GtkLabel *label, + GdkEventExpose *event, + 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; + MateConfClient *client; + + priv = DRW_BREAK_WINDOW_GET_PRIVATE (window); + window->priv = priv; + + client = mateconf_client_get_default (); + + priv->break_time = 60 * mateconf_client_get_int (client, + MATECONF_PATH "/break_time", + NULL); + + allow_postpone = mateconf_client_get_bool (client, + MATECONF_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, + "expose_event", + G_CALLBACK (label_expose_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, + "expose_event", + G_CALLBACK (label_expose_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; + MateConfClient *client = mateconf_client_get_default(); + + str = gtk_entry_get_text (GTK_ENTRY (entry)); + + phrase = mateconf_client_get_string (client, + MATECONF_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_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; /*mateconf_client_get_string (mateconf_client_get_default (), + MATECONF_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 void +get_layout_location (GtkLabel *label, + gint *xp, + gint *yp) +{ + GtkMisc *misc; + GtkWidget *widget; + GtkAllocation widget_allocation; + GtkRequisition widget_requisition; + gfloat xalign, yalign; + gint x, y; + gint xpad, ypad; + + misc = GTK_MISC (label); + widget = GTK_WIDGET (label); + + gtk_misc_get_alignment (misc, &xalign, &yalign); + gtk_misc_get_padding (misc, &xpad, &ypad); + gtk_widget_get_allocation (widget, &widget_allocation); + gtk_widget_get_requisition (widget, &widget_requisition); + + if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR) + xalign = 1.0 - xalign; + + x = floor (widget_allocation.x + (int)xpad + + ((widget_allocation.width - widget_requisition.width - 1) * xalign) + + 0.5); + + y = floor (widget_allocation.y + (int)ypad + + ((widget_allocation.height - widget_requisition.height - 1) * yalign) + + 0.5); + + if (xp) { + *xp = x; + } + + if (yp) { + *yp = y; + } +} + +static gboolean +label_expose_event_cb (GtkLabel *label, + GdkEventExpose *event, + gpointer user_data) +{ + gint x, y; + GdkColor color; + GtkWidget *widget; + GdkWindow *window; + GdkGC *gc; + + color.red = 0; + color.green = 0; + color.blue = 0; + color.pixel = 0; + + get_layout_location (label, &x, &y); + + widget = GTK_WIDGET (label); + window = gtk_widget_get_window (widget); + + gc = gdk_gc_new (window); + gdk_gc_set_rgb_fg_color (gc, &color); + gdk_gc_set_clip_rectangle (gc, &event->area); + + gdk_draw_layout_with_colors (window, + gc, + x + 1, + y + 1, + gtk_label_get_layout (label), + &color, + NULL); + g_object_unref (gc); + + gtk_paint_layout (gtk_widget_get_style (widget), + window, + gtk_widget_get_state (widget), + FALSE, + &event->area, + 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 new file mode 100644 index 00000000..e7e1c156 --- /dev/null +++ b/typing-break/drw-break-window.h @@ -0,0 +1,59 @@ +/* -*- 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 + +#ifdef __cplusplus +extern "C" { +#endif + +#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); + +#ifdef __cplusplus +} +#endif + +#endif /* __DRW_BREAK_WINDOW_H__ */ diff --git a/typing-break/drw-monitor.c b/typing-break/drw-monitor.c new file mode 100644 index 00000000..5f0270c0 --- /dev/null +++ b/typing-break/drw-monitor.c @@ -0,0 +1,193 @@ +/* -*- 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 (), DefaultRootWindow (GDK_DISPLAY ()), 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 (), &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 new file mode 100644 index 00000000..3b5ef677 --- /dev/null +++ b/typing-break/drw-monitor.h @@ -0,0 +1,51 @@ +/* -*- 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 new file mode 100644 index 00000000..99b0980e --- /dev/null +++ b/typing-break/drw-selection.c @@ -0,0 +1,190 @@ +/* -*- 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 (); + 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 (); + 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 new file mode 100644 index 00000000..f384a4e1 --- /dev/null +++ b/typing-break/drw-selection.h @@ -0,0 +1,33 @@ +/* -*- 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 new file mode 100644 index 00000000..d108034c --- /dev/null +++ b/typing-break/drw-timer.c @@ -0,0 +1,52 @@ +/* -*- 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 () +{ + 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 new file mode 100644 index 00000000..1a259c5c --- /dev/null +++ b/typing-break/drw-timer.h @@ -0,0 +1,42 @@ +/* -*- 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 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 new file mode 100644 index 00000000..ff19f74f --- /dev/null +++ b/typing-break/drw-utils.c @@ -0,0 +1,250 @@ +/* -*- 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 "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_expose_event (GtkWidget *widget, + GdkEventExpose *event, + gpointer data) +{ + cairo_t *context; + cairo_t *cr; + cairo_surface_t *surface; + int width; + int height; + + context = gdk_cairo_create (gtk_widget_get_window (widget)); + + 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); + } + cairo_destroy (context); + + return FALSE; +} + +static void +set_pixmap_background (GtkWidget *window) +{ + GdkScreen *screen; + GdkPixbuf *tmp_pixbuf, *pixbuf, *tile_pixbuf; + GdkPixmap *pixmap; + GdkRectangle rect; + GdkColor color; + gint width, height; + + gtk_widget_realize (window); + + screen = gtk_widget_get_screen (window); + width = gdk_screen_get_width (screen); + height = gdk_screen_get_height (screen); + + tmp_pixbuf = gdk_pixbuf_get_from_drawable (NULL, + gdk_screen_get_root_window (screen), + gdk_screen_get_system_colormap (screen), + 0, + 0, + 0, + 0, + width, height); + + 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); + + gdk_pixbuf_composite (tile_pixbuf, + tmp_pixbuf, + 0, + 0, + width, + height, + 0, + 0, + 1, + 1, + GDK_INTERP_NEAREST, + 225); + + g_object_unref (tile_pixbuf); + + pixmap = gdk_pixmap_new (gtk_widget_get_window (window), + width, + height, + -1); + + gdk_draw_pixbuf (pixmap, + NULL, + tmp_pixbuf, + 0, + 0, + 0, + 0, + width, + height, + GDK_RGB_DITHER_NONE, + 0, + 0); + + g_object_unref (tmp_pixbuf); + + gdk_window_set_back_pixmap (gtk_widget_get_window (window), pixmap, FALSE); + g_object_unref (pixmap); +} + +void +drw_setup_background (GtkWidget *window) +{ + GdkScreen *screen; + GdkColormap *colormap; + gboolean is_composited; + + screen = gtk_widget_get_screen (window); + colormap = gdk_screen_get_rgba_colormap (screen); + + if (colormap != NULL && gdk_screen_is_composited (screen)) { + gtk_widget_set_colormap (GTK_WIDGET (window), colormap); + is_composited = TRUE; + } else { + is_composited = FALSE; + } + + if (is_composited) { + g_signal_connect (window, "expose-event", G_CALLBACK (window_expose_event), window); + } else { + set_pixmap_background (window); + } +} + diff --git a/typing-break/drw-utils.h b/typing-break/drw-utils.h new file mode 100644 index 00000000..9ef75bb7 --- /dev/null +++ b/typing-break/drw-utils.h @@ -0,0 +1,29 @@ +/* -*- 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 new file mode 100644 index 00000000..315a2d51 --- /dev/null +++ b/typing-break/drwright.c @@ -0,0 +1,903 @@ +/* -*- 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 +mateconf_notify_cb (MateConfClient *client, + guint cnxn_id, + MateConfEntry *entry, + gpointer user_data) +{ + DrWright *dr = user_data; + GtkWidget *item; + + if (!strcmp (entry->key, MATECONF_PATH "/type_time")) { + if (entry->value->type == MATECONF_VALUE_INT) { + dr->type_time = 60 * mateconf_value_get_int (entry->value); + dr->warn_time = MIN (dr->type_time / 10, 5*60); + + dr->state = STATE_START; + } + } + else if (!strcmp (entry->key, MATECONF_PATH "/break_time")) { + if (entry->value->type == MATECONF_VALUE_INT) { + dr->break_time = 60 * mateconf_value_get_int (entry->value); + dr->state = STATE_START; + } + } + else if (!strcmp (entry->key, MATECONF_PATH "/enabled")) { + if (entry->value->type == MATECONF_VALUE_BOOL) { + dr->enabled = mateconf_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, "mate-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; + MateConfClient *client; + GtkActionGroup *action_group; + + static const char ui_description[] = + "" + " " + " " + " " + " " + " " + " " + ""; + + dr = g_new0 (DrWright, 1); + + client = mateconf_client_get_default (); + + mateconf_client_add_dir (client, + MATECONF_PATH, + MATECONF_CLIENT_PRELOAD_NONE, + NULL); + + mateconf_client_notify_add (client, MATECONF_PATH, + mateconf_notify_cb, + dr, + NULL, + NULL); + + dr->type_time = 60 * mateconf_client_get_int ( + client, MATECONF_PATH "/type_time", NULL); + + dr->warn_time = MIN (dr->type_time / 12, 60*3); + + dr->break_time = 60 * mateconf_client_get_int ( + client, MATECONF_PATH "/break_time", NULL); + + dr->enabled = mateconf_client_get_bool ( + client, + MATECONF_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 new file mode 100644 index 00000000..bdd7a0e3 --- /dev/null +++ b/typing-break/drwright.h @@ -0,0 +1,30 @@ +/* -*- 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 MATECONF_PATH "/desktop/mate/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 new file mode 100644 index 00000000..a81bdd9b --- /dev/null +++ b/typing-break/main.c @@ -0,0 +1,125 @@ +/* -*- 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); + 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, MATELOCALEDIR); + 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 new file mode 100644 index 00000000..d0570962 Binary files /dev/null and b/typing-break/ocean-stripes.png differ diff --git a/typing-break/typing-monitor.png b/typing-break/typing-monitor.png new file mode 100644 index 00000000..41ee09cf Binary files /dev/null and b/typing-break/typing-monitor.png differ diff --git a/typing-break/typing-monitor.svg b/typing-break/typing-monitor.svg new file mode 100644 index 00000000..b8298719 --- /dev/null +++ b/typing-break/typing-monitor.svg @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + -- cgit v1.2.1