From e06d189d6eb6f0b7259ccf69204814a18ab6566a Mon Sep 17 00:00:00 2001 From: mdb Date: Fri, 28 Nov 2003 21:34:59 +0000 Subject: [PATCH] Beginnings of a C++ rewrite. We love to switch languages! git-svn-id: https://samskivert.googlecode.com/svn/trunk@1330 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- projects/lookuplet/.cvsignore | 3 + projects/lookuplet/ChangeLog | 30 + projects/lookuplet/Makefile.am | 8 + projects/lookuplet/TODO | 2 + projects/lookuplet/acconfig.h | 15 + projects/lookuplet/autogen.sh | 19 + projects/lookuplet/configure.in | 30 + projects/lookuplet/debian/changelog | 6 + projects/lookuplet/debian/control | 2 +- projects/lookuplet/install.sh | 63 - projects/lookuplet/lookuplet.glade | 1027 +++++++++-------- projects/lookuplet/src/.cvsignore | 4 + projects/lookuplet/src/Makefile | 410 +++++++ projects/lookuplet/src/Makefile.am | 29 + projects/lookuplet/src/Makefile.in | 410 +++++++ projects/lookuplet/src/about.cc | 9 + projects/lookuplet/src/about.hh | 18 + projects/lookuplet/src/about_glade.cc | 30 + projects/lookuplet/src/about_glade.hh | 24 + projects/lookuplet/src/binding.cc | 21 + projects/lookuplet/src/binding.hh | 22 + projects/lookuplet/src/binding_glade.cc | 119 ++ projects/lookuplet/src/binding_glade.hh | 34 + projects/lookuplet/src/lookuplet.cc | 60 + projects/lookuplet/src/lookuplet.hh | 17 + projects/lookuplet/src/lookuplet_glade.cc | 55 + projects/lookuplet/src/lookuplet_glade.hh | 30 + projects/lookuplet/src/properties.cc | 21 + projects/lookuplet/src/properties.hh | 18 + projects/lookuplet/src/properties_glade.cc | 108 ++ projects/lookuplet/src/properties_glade.hh | 31 + projects/lookuplet/src/python/bindings.py | 75 +- projects/lookuplet/src/python/edit_binding.py | 43 +- projects/lookuplet/src/python/history.py | 38 +- projects/lookuplet/src/python/keyval_util.py | 20 +- projects/lookuplet/src/python/lookuplet | 16 +- projects/lookuplet/src/python/lookuplet.py | 59 +- projects/lookuplet/src/python/properties.py | 106 +- 38 files changed, 2308 insertions(+), 724 deletions(-) create mode 100644 projects/lookuplet/Makefile.am create mode 100644 projects/lookuplet/acconfig.h create mode 100755 projects/lookuplet/autogen.sh create mode 100644 projects/lookuplet/configure.in delete mode 100755 projects/lookuplet/install.sh create mode 100644 projects/lookuplet/src/Makefile create mode 100644 projects/lookuplet/src/Makefile.am create mode 100644 projects/lookuplet/src/Makefile.in create mode 100644 projects/lookuplet/src/about.cc create mode 100644 projects/lookuplet/src/about.hh create mode 100644 projects/lookuplet/src/about_glade.cc create mode 100644 projects/lookuplet/src/about_glade.hh create mode 100644 projects/lookuplet/src/binding.cc create mode 100644 projects/lookuplet/src/binding.hh create mode 100644 projects/lookuplet/src/binding_glade.cc create mode 100644 projects/lookuplet/src/binding_glade.hh create mode 100644 projects/lookuplet/src/lookuplet.cc create mode 100644 projects/lookuplet/src/lookuplet.hh create mode 100644 projects/lookuplet/src/lookuplet_glade.cc create mode 100644 projects/lookuplet/src/lookuplet_glade.hh create mode 100644 projects/lookuplet/src/properties.cc create mode 100644 projects/lookuplet/src/properties.hh create mode 100644 projects/lookuplet/src/properties_glade.cc create mode 100644 projects/lookuplet/src/properties_glade.hh diff --git a/projects/lookuplet/.cvsignore b/projects/lookuplet/.cvsignore index a7a5a151..445684d7 100644 --- a/projects/lookuplet/.cvsignore +++ b/projects/lookuplet/.cvsignore @@ -17,3 +17,6 @@ libtool ltmain.sh po *.tar.gz +*_new +*.gladep +autom4te.cache diff --git a/projects/lookuplet/ChangeLog b/projects/lookuplet/ChangeLog index 3f657770..7197f087 100644 --- a/projects/lookuplet/ChangeLog +++ b/projects/lookuplet/ChangeLog @@ -42,3 +42,33 @@ * projects/lookuplet/src/querybox.c: Prune whitespace from the end of the selection before inserting it into the lookuplet text widget. + +2002/12/1 19:02:48 PST + update files from .glade file + +2002/12/1 19:12:49 PST + update files from .glade file + +2002/12/1 19:29:15 PST + update files from .glade file + +2002/12/1 19:52:51 PST + update files from .glade file + +2002/12/1 19:52:55 PST + update files from .glade file + +2002/12/1 21:01:21 PST + update files from .glade file + +2002/12/1 21:01:25 PST + update files from .glade file + +2002/12/1 21:35:16 PST + update files from .glade file + +2002/12/1 21:53:51 PST + update files from .glade file + +2002/12/1 21:56:20 PST + update files from .glade file diff --git a/projects/lookuplet/Makefile.am b/projects/lookuplet/Makefile.am new file mode 100644 index 00000000..e7c7861e --- /dev/null +++ b/projects/lookuplet/Makefile.am @@ -0,0 +1,8 @@ +# generated 2002/12/1 21:01:25 PST by mdb@baltic.(none) +# using glademm V1.1.3c_cvs +AUTOMAKE_OPTIONS = 1.4 + + +SUBDIRS = src + +EXTRA_DIST = AUTHORS TODO README configure diff --git a/projects/lookuplet/TODO b/projects/lookuplet/TODO index 68cab7d4..0dbbfa18 100644 --- a/projects/lookuplet/TODO +++ b/projects/lookuplet/TODO @@ -1,4 +1,6 @@ TODO: +* Finish C++ rewrite + * Allow configuration of the default action (the one invoked when the user presses return). diff --git a/projects/lookuplet/acconfig.h b/projects/lookuplet/acconfig.h new file mode 100644 index 00000000..b12e65fd --- /dev/null +++ b/projects/lookuplet/acconfig.h @@ -0,0 +1,15 @@ +// generated 2002/12/1 21:01:25 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs + +/* acconfig.h + * This file is in the public domain. + * + * Descriptive text for the C preprocessor macros that + * the distributed Autoconf macros can define. + * These entries are sometimes used by macros + * which glade-- uses. + */ +#undef PACKAGE +#undef VERSION +#undef PACKAGE_DATA_DIR +#undef PACKAGE_SOURCE_DIR diff --git a/projects/lookuplet/autogen.sh b/projects/lookuplet/autogen.sh new file mode 100755 index 00000000..3584e080 --- /dev/null +++ b/projects/lookuplet/autogen.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +PKG_NAME="the package." + +(test -f $srcdir/configure.in) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level directory" + exit 1 +} + +which gnome-autogen.sh || { + echo "You need to install gnome-common from the GNOME CVS" + exit 1 +} +USE_GNOME2_MACROS=1 . gnome-autogen.sh diff --git a/projects/lookuplet/configure.in b/projects/lookuplet/configure.in new file mode 100644 index 00000000..9cb640cf --- /dev/null +++ b/projects/lookuplet/configure.in @@ -0,0 +1,30 @@ +# generated 2002/12/1 21:01:25 PST by mdb@baltic.(none) +# using glademm V1.1.3c_cvs + +AC_INIT(src/lookuplet.cc) +AM_INIT_AUTOMAKE(lookuplet, 0.0) +AM_CONFIG_HEADER(config.h) + +AC_ISC_POSIX +AC_PROG_CC +AM_PROG_CC_STDC +AC_HEADER_STDC +AC_PROG_CPP +AC_PROG_CXX +AC_PROG_CXXCPP +AM_PROG_LIBTOOL + +# GNOME--: +# (These macros are in the 'macros' directory) +# GNOME_INIT sets the GNOME_CONFIG variable, among other things: +GNOME_INIT +GNOME_COMMON_INIT +GNOME_COMPILE_WARNINGS +AC_LANG_CPLUSPLUS + +GNOMEMM_CFLAGS="`pkg-config --cflags libgnomemm-2.0 libgnomeuimm-2.0`" +GNOMEMM_LIBS="`pkg-config --libs libgnomemm-2.0 libgnomeuimm-2.0`" +AC_SUBST(GNOMEMM_CFLAGS) +AC_SUBST(GNOMEMM_LIBS) + +AC_OUTPUT(Makefile src/Makefile ) diff --git a/projects/lookuplet/debian/changelog b/projects/lookuplet/debian/changelog index 823e3bf2..87ed190d 100644 --- a/projects/lookuplet/debian/changelog +++ b/projects/lookuplet/debian/changelog @@ -1,3 +1,9 @@ +lookuplet (1.3-1) unstable; urgency=low + + * New upstream version: updated to work with Gnome 2.0. + + -- Michael Bayne Sun, 24 Nov 2002 21:10:04 -0800 + lookuplet (1.2-1) unstable; urgency=low * New upstream version: rewritten entirely in Python. diff --git a/projects/lookuplet/debian/control b/projects/lookuplet/debian/control index 80f627cd..2aeb30c3 100644 --- a/projects/lookuplet/debian/control +++ b/projects/lookuplet/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.5.6.0 Package: lookuplet Architecture: any -Depends: python-gnome (>= 1.4.1-17) +Depends: python-gnome2 (>= 1.99.13-2) Description: Keystroke conscious query launching utility lookuplet is a graphical utility that allows you to enter query terms and press predefined key-combinations to launch web queries or applications. diff --git a/projects/lookuplet/install.sh b/projects/lookuplet/install.sh deleted file mode 100755 index f2388e0c..00000000 --- a/projects/lookuplet/install.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/sh -# -# $Id: install.sh,v 1.2 2002/03/18 00:17:57 mdb Exp $ -# -# Builds the Debian packages for the release and installs them in the -# appropriate place on my web server for distribution. - -DEBHOST=waywardgeeks.org -DEBDIR=/export/wayward/pages/code/debian - -if [ -z "$1" ]; then - echo "Usage: $0 release_version (e.g. 1.2)" - exit -1 -else - RELEASE=$1 - shift -fi - -TARGET=lookuplet-$RELEASE - -# build the distribution -`dirname $0`/build-dist.sh $TARGET - -# build our excludes file -cat > .excludes < - + - - Lookuplet - lookuplet - - src - pixmaps - C++ - True - True - True - lookuplet.messages - + + - - GtkWindow - lookuplet - False - - destroy - exit_lookuplet - Sat, 16 Mar 2002 21:42:31 GMT - - lookuplet - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - True - False + + lookuplet + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False - - GtkHBox - mainbox - 5 - False - 5 + + + 5 + True + False + 5 - - GtkLabel - query - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - 0 - False - False + + True + Query + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + protected + True + True + True + True + 0 + + True + * + False + + + + + 0 + True + True + + + + + + True + Prefs + True + GTK_RELIEF_NORMAL + + + + 0 + False + False + - - - GtkEntry - query - True - - key_press_event - on_query_key_press_event - Sat, 16 Mar 2002 21:46:25 GMT - - - selection_received - on_query_selection_received - True - Sat, 16 Mar 2002 21:46:37 GMT - - True - True - 0 - - - 0 - True - True - - - - - GtkButton - prefs - - clicked - on_prefs_clicked - Sat, 16 Mar 2002 21:44:18 GMT - - - GTK_RELIEF_NORMAL - - 0 - False - False - - - + - - GnomePropertyBox - properties - False - - apply - on_properties_apply - Sat, 16 Mar 2002 22:00:53 GMT - - Lookuplet Properties - GTK_WIN_POS_NONE - False - False - False - False + + 5 + Edit Binding + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True - - GtkNotebook - GnomePropertyBox:notebook - notebook1 - True - True - True - GTK_POS_TOP - False - 2 - 2 - False - - 0 - True - True - + + + True + False + 8 - - GtkVBox - vbox1 - 5 - False - 5 + + + True + GTK_BUTTONBOX_END - - GtkScrolledWindow - scrolledwindow1 - 200 - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 0 - True - True - - - - GtkCList - bindings - True - - select_row - on_bindings_select_row - Sat, 16 Mar 2002 21:57:08 GMT - - - unselect_row - on_bindings_unselect_row - Sat, 16 Mar 2002 21:57:15 GMT - - 2 - 80,80 - GTK_SELECTION_SINGLE - True - GTK_SHADOW_IN - - - GtkLabel - CList:title - key - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - CList:title - name - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - GtkHBox - hbox2 - False - 5 - - 0 - True - True - - - - GtkButton - delete - False - True - - clicked - on_delete_clicked - Sat, 16 Mar 2002 22:00:28 GMT - - - GTK_RELIEF_NORMAL - 0 - False - False - GTK_PACK_END + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + 0 + + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + 0 + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 5 - - GtkButton - edit - False - True - - clicked - on_edit_clicked - Sat, 16 Mar 2002 22:00:24 GMT - - - GTK_RELIEF_NORMAL - 0 - False - False - GTK_PACK_END + + True + Key: + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + protected + True + True + True + True + 0 + + True + * + False + + + + 0 + True + True + + + + + + True + Name: + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + protected + True + True + True + True + 0 + + True + * + False + + + 0 + True + True + + + 0 + True + True + + + + + + True + Enter the URL to launch or command to invoke when this key combination is pressed: + False + False + GTK_JUSTIFY_CENTER + True + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + False + 5 - - GtkButton - add - True - - clicked - on_add_clicked - Sat, 16 Mar 2002 22:00:20 GMT - - - GTK_RELIEF_NORMAL - 0 - False - False - GTK_PACK_END + + protected + True + True + 0 + + + + True + + + + True + URL + True + + + + + + True + Exec + True + + + + + + + 0 + False + False + + + + + + protected + True + True + True + True + 0 + + True + * + False + + + 0 + True + True + - - - - - GtkLabel - Notebook:tab - blabel - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - GnomeDialog - binding - False - Edit Binding - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - False - False - False - - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END + + 0 + True + True + - - GtkButton - ok - True - True - - clicked - on_ok_clicked - Sat, 16 Mar 2002 22:37:22 GMT - - GNOME_STOCK_BUTTON_OK - - - - GtkButton - cancel - True - True - - clicked - on_cancel_clicked - Sun, 17 Mar 2002 07:00:43 GMT - - GNOME_STOCK_BUTTON_CANCEL - - - - - GtkHBox - hbox3 - False - 5 - 0 - True - True - - - - GtkLabel - klabel - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkEntry - key - True - - key_press_event - on_key_key_press_event - Sun, 17 Mar 2002 08:12:10 GMT - - True - True - 0 - - - 0 - True - True - - - - - GtkLabel - nlabel - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkEntry - name - True - True - True - 0 - - - 0 - True - True - - - - - - GtkLabel - tlabel - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkHBox - hbox4 - False - 5 - - 0 - True - True - - - - GtkOptionMenu - type - True - URL -Exec - - 0 - - 0 - False - False - - - - - GtkEntry - argument - True - True - True - 0 - - - 0 - True - True - - - - - - GtkLabel - tlabel - - GTK_JUSTIFY_FILL - True - 0.5 - 0.5 - 0 - 0 - - 0 - False - False +%U - the URL encoded query terms + False + False + GTK_JUSTIFY_FILL + True + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + - + - - GnomeAbout - about - False - True - (C) 2001-2002 Michael Bayne - Michael Bayne <mdb@samskivert.com> - - This GNOME applet provides a simple means by which web and other queries can be launched with minimal typing. + + False + (C) 2001-2002 Michael Bayne + This GNOME applet provides a simple means by which web and other queries can be launched with minimal typing. - -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 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. + Michael Bayne <mdb@samskivert.com> + + translator_credits - + + 400 + True + Lookuplet Properties + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + + + + 5 + True + False + 5 + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + 5 + True + False + 5 + + + + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + protected + True + True + True + False + False + True + + + + + 0 + True + True + + + + + + True + False + 5 + + + + True + False + True + Delete + True + GTK_RELIEF_NORMAL + + + + 0 + False + False + GTK_PACK_END + + + + + + True + False + True + Edit... + True + GTK_RELIEF_NORMAL + + + + 0 + False + False + GTK_PACK_END + + + + + + True + True + Add... + True + GTK_RELIEF_NORMAL + + + + 0 + False + False + GTK_PACK_END + + + + + 0 + False + True + + + + + False + True + + + + + + True + Bindings + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + tab + + + + + 0 + True + True + + + + + + True + + + 0 + False + True + + + + + + True + GTK_BUTTONBOX_END + 0 + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + + + + + + 0 + False + True + + + + + + + diff --git a/projects/lookuplet/src/.cvsignore b/projects/lookuplet/src/.cvsignore index d7015f13..4b67561b 100644 --- a/projects/lookuplet/src/.cvsignore +++ b/projects/lookuplet/src/.cvsignore @@ -1,2 +1,6 @@ *.pyc lookuplet.messages +*_new +.deps +.libs +lookuplet diff --git a/projects/lookuplet/src/Makefile b/projects/lookuplet/src/Makefile new file mode 100644 index 00000000..932cc9f1 --- /dev/null +++ b/projects/lookuplet/src/Makefile @@ -0,0 +1,410 @@ +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 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. + +# +# $Id: Makefile,v 1.1 2003/11/28 21:34:59 mdb Exp $ + + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/lookuplet +pkglibdir = $(libdir)/lookuplet +pkgincludedir = $(includedir)/lookuplet + +top_builddir = .. + +ACLOCAL = aclocal-1.4 -I /usr/share/aclocal/gnome2-macros +AUTOCONF = autoconf +AUTOMAKE = automake-1.4 +AUTOHEADER = autoheader + +INSTALL = /usr/bin/install -c +INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL} +transform = s,x,x, + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = +host_triplet = i686-pc-linux-gnu +AR = ar +AS = @AS@ +CC = gcc +CPP = gcc -E +CXX = g++ +CXXCPP = g++ -E +DLLTOOL = @DLLTOOL@ +ECHO = echo +EGREP = grep -E +EXEEXT = +F77 = +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ +GNOMEMM_CFLAGS = -DORBIT2=1 -pthread -I/usr/include/libgnomemm-2.0 -I/usr/lib/libgnomemm-2.0/include -I/usr/include/gtkmm-2.0 -I/usr/lib/gtkmm-2.0/include -I/usr/include/libgnome-2.0 -I/usr/include/gtk-2.0 -I/usr/lib/sigc++-1.2/include -I/usr/include/sigc++-1.2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/bonobo-activation-2.0 -I/usr/include/libgnomeuimm-2.0 -I/usr/lib/libgnomeuimm-2.0/include -I/usr/include/libgnomecanvasmm-2.0 -I/usr/lib/libgnomecanvasmm-2.0/include -I/usr/include/gconfmm-2.0 -I/usr/lib/gconfmm-2.0/include -I/usr/include/libglademm-2.0 -I/usr/lib/libglademm-2.0/include -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/libart-2.0 -I/usr/include/libglade-2.0 -I/usr/include/libxml2 -I/usr/include/libbonoboui-2.0 +GNOMEMM_LIBS = -Wl,--export-dynamic -pthread -L/usr/X11R6/lib -lgnomeuimm-2.0 -lgnomemm-2.0 -lgnomecanvasmm-2.0 -lgconfmm-2.0 -lglademm-2.0 -lgnomeui-2 -lSM -lICE -lgtkmm-2.0 -lglade-2.0 -lgdkmm-2.0 -latkmm-1.0 -lpangomm-1.0 -lglibmm-2.0 -lsigc-1.2 -lbonoboui-2 -lxml2 -lpthread -lz -lgnomecanvas-2 -lgnome-2 -lpopt -lart_lgpl_2 -lpangoft2-1.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lbonobo-2 -lgconf-2 -lgnomevfs-2 -lbonobo-activation -lORBit-2 -lgobject-2.0 -lgthread-2.0 -lm -lgmodule-2.0 -ldl -lglib-2.0 +GNOME_ACLOCAL_DIR = /usr/share/aclocal/gnome2-macros +GNOME_ACLOCAL_FLAGS = -I /usr/share/aclocal/gnome2-macros +GTKDOC = @GTKDOC@ +HAVE_GTK_DOC = @HAVE_GTK_DOC@ +HAVE_LIB = @HAVE_LIB@ +LIB = @LIB@ +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LN_S = ln -s +LTLIB = @LTLIB@ +MAKEINFO = makeinfo +OBJDUMP = @OBJDUMP@ +OBJEXT = o +PACKAGE = lookuplet +RANLIB = ranlib +RC = @RC@ +STRIP = strip +VERSION = 0.0 +WARN_CFLAGS = -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations +cxxflags_set = @cxxflags_set@ + +bin_PROGRAMS = lookuplet + +lookuplet_SOURCES = lookuplet_glade.cc lookuplet.cc binding_glade.cc binding.cc about_glade.cc about.cc properties_glade.cc properties.cc + + +noinst_HEADERS = lookuplet_glade.hh lookuplet.hh binding_glade.hh binding.hh about_glade.hh about.hh properties_glade.hh properties.hh + + +CXXFLAGS = -g -O2 -DORBIT2=1 -pthread -I/usr/include/libgnomemm-2.0 -I/usr/lib/libgnomemm-2.0/include -I/usr/include/gtkmm-2.0 -I/usr/lib/gtkmm-2.0/include -I/usr/include/libgnome-2.0 -I/usr/include/gtk-2.0 -I/usr/lib/sigc++-1.2/include -I/usr/include/sigc++-1.2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/bonobo-activation-2.0 -I/usr/include/libgnomeuimm-2.0 -I/usr/lib/libgnomeuimm-2.0/include -I/usr/include/libgnomecanvasmm-2.0 -I/usr/lib/libgnomecanvasmm-2.0/include -I/usr/include/gconfmm-2.0 -I/usr/lib/gconfmm-2.0/include -I/usr/include/libglademm-2.0 -I/usr/lib/libglademm-2.0/include -I/usr/include/libgnomeui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/libart-2.0 -I/usr/include/libglade-2.0 -I/usr/include/libxml2 -I/usr/include/libbonoboui-2.0 +LDFLAGS = + +lookuplet_LDADD = -Wl,--export-dynamic -pthread -L/usr/X11R6/lib -lgnomeuimm-2.0 -lgnomemm-2.0 -lgnomecanvasmm-2.0 -lgconfmm-2.0 -lglademm-2.0 -lgnomeui-2 -lSM -lICE -lgtkmm-2.0 -lglade-2.0 -lgdkmm-2.0 -latkmm-1.0 -lpangomm-1.0 -lglibmm-2.0 -lsigc-1.2 -lbonoboui-2 -lxml2 -lpthread -lz -lgnomecanvas-2 -lgnome-2 -lpopt -lart_lgpl_2 -lpangoft2-1.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lbonobo-2 -lgconf-2 -lgnomevfs-2 -lbonobo-activation -lORBit-2 -lgobject-2.0 -lgthread-2.0 -lm -lgmodule-2.0 -ldl -lglib-2.0 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = lookuplet$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + + +DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I.. +CPPFLAGS = +LIBS = +lookuplet_OBJECTS = lookuplet_glade.$(OBJEXT) lookuplet.$(OBJEXT) \ +binding_glade.$(OBJEXT) binding.$(OBJEXT) about_glade.$(OBJEXT) \ +about.$(OBJEXT) properties_glade.$(OBJEXT) properties.$(OBJEXT) +lookuplet_DEPENDENCIES = +lookuplet_LDFLAGS = +CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ +HEADERS = $(noinst_HEADERS) + +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +DEP_FILES = .deps/about.P .deps/about_glade.P .deps/binding.P \ +.deps/binding_glade.P .deps/lookuplet.P .deps/lookuplet_glade.P \ +.deps/properties.P .deps/properties_glade.P +SOURCES = $(lookuplet_SOURCES) +OBJECTS = $(lookuplet_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .cc .lo .o .obj .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-binPROGRAMS: + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +distclean-binPROGRAMS: + +maintainer-clean-binPROGRAMS: + +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(bin_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +lookuplet$(EXEEXT): $(lookuplet_OBJECTS) $(lookuplet_DEPENDENCIES) + @rm -f lookuplet$(EXEEXT) + $(CXXLINK) $(lookuplet_LDFLAGS) $(lookuplet_OBJECTS) $(lookuplet_LDADD) $(LIBS) +.cc.o: + $(CXXCOMPILE) -c $< +.cc.obj: + $(CXXCOMPILE) -c `cygpath -w $<` +.cc.lo: + $(LTCXXCOMPILE) -c $< + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP)) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp + +%.o: %.cc + @echo '$(CXXCOMPILE) -c $<'; \ + $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.cc + @echo '$(LTCXXCOMPILE) -c $<'; \ + $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-binPROGRAMS +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-binPROGRAMS +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) $(HEADERS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags mostlyclean-depend \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-binPROGRAMS clean-compile clean-libtool clean-tags \ + clean-depend clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-compile distclean-libtool \ + distclean-tags distclean-depend distclean-generic \ + clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-depend \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ +maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir \ +mostlyclean-depend distclean-depend clean-depend \ +maintainer-clean-depend info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +# 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/projects/lookuplet/src/Makefile.am b/projects/lookuplet/src/Makefile.am new file mode 100644 index 00000000..8387f711 --- /dev/null +++ b/projects/lookuplet/src/Makefile.am @@ -0,0 +1,29 @@ +# +# $Id: Makefile.am,v 1.7 2003/11/28 21:34:59 mdb Exp $ + +bin_PROGRAMS = lookuplet + +lookuplet_SOURCES = \ + lookuplet_glade.cc \ + lookuplet.cc \ + binding_glade.cc \ + binding.cc \ + about_glade.cc \ + about.cc \ + properties_glade.cc \ + properties.cc + +noinst_HEADERS = \ + lookuplet_glade.hh \ + lookuplet.hh \ + binding_glade.hh \ + binding.hh \ + about_glade.hh \ + about.hh \ + properties_glade.hh \ + properties.hh + +CXXFLAGS = @CXXFLAGS@ @GNOMEMM_CFLAGS@ +LDFLAGS= @LDFLAGS@ + +lookuplet_LDADD = @LIBS@ @GNOMEMM_LIBS@ diff --git a/projects/lookuplet/src/Makefile.in b/projects/lookuplet/src/Makefile.in new file mode 100644 index 00000000..e3a7fe3f --- /dev/null +++ b/projects/lookuplet/src/Makefile.in @@ -0,0 +1,410 @@ +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 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. + +# +# $Id: Makefile.in,v 1.1 2003/11/28 21:34:59 mdb Exp $ + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ +GNOMEMM_CFLAGS = @GNOMEMM_CFLAGS@ +GNOMEMM_LIBS = @GNOMEMM_LIBS@ +GNOME_ACLOCAL_DIR = @GNOME_ACLOCAL_DIR@ +GNOME_ACLOCAL_FLAGS = @GNOME_ACLOCAL_FLAGS@ +GTKDOC = @GTKDOC@ +HAVE_GTK_DOC = @HAVE_GTK_DOC@ +HAVE_LIB = @HAVE_LIB@ +LIB = @LIB@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIB = @LTLIB@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +RC = @RC@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +cxxflags_set = @cxxflags_set@ + +bin_PROGRAMS = lookuplet + +lookuplet_SOURCES = lookuplet_glade.cc lookuplet.cc binding_glade.cc binding.cc about_glade.cc about.cc properties_glade.cc properties.cc + + +noinst_HEADERS = lookuplet_glade.hh lookuplet.hh binding_glade.hh binding.hh about_glade.hh about.hh properties_glade.hh properties.hh + + +CXXFLAGS = @CXXFLAGS@ @GNOMEMM_CFLAGS@ +LDFLAGS = @LDFLAGS@ + +lookuplet_LDADD = @LIBS@ @GNOMEMM_LIBS@ +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = lookuplet$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LIBS = @LIBS@ +lookuplet_OBJECTS = lookuplet_glade.$(OBJEXT) lookuplet.$(OBJEXT) \ +binding_glade.$(OBJEXT) binding.$(OBJEXT) about_glade.$(OBJEXT) \ +about.$(OBJEXT) properties_glade.$(OBJEXT) properties.$(OBJEXT) +lookuplet_DEPENDENCIES = +lookuplet_LDFLAGS = +CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ +HEADERS = $(noinst_HEADERS) + +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +DEP_FILES = .deps/about.P .deps/about_glade.P .deps/binding.P \ +.deps/binding_glade.P .deps/lookuplet.P .deps/lookuplet_glade.P \ +.deps/properties.P .deps/properties_glade.P +SOURCES = $(lookuplet_SOURCES) +OBJECTS = $(lookuplet_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .cc .lo .o .obj .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-binPROGRAMS: + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +distclean-binPROGRAMS: + +maintainer-clean-binPROGRAMS: + +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(bin_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +lookuplet$(EXEEXT): $(lookuplet_OBJECTS) $(lookuplet_DEPENDENCIES) + @rm -f lookuplet$(EXEEXT) + $(CXXLINK) $(lookuplet_LDFLAGS) $(lookuplet_OBJECTS) $(lookuplet_LDADD) $(LIBS) +.cc.o: + $(CXXCOMPILE) -c $< +.cc.obj: + $(CXXCOMPILE) -c `cygpath -w $<` +.cc.lo: + $(LTCXXCOMPILE) -c $< + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP)) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp + +%.o: %.cc + @echo '$(CXXCOMPILE) -c $<'; \ + $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.cc + @echo '$(LTCXXCOMPILE) -c $<'; \ + $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-binPROGRAMS +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-binPROGRAMS +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) $(HEADERS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags mostlyclean-depend \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-binPROGRAMS clean-compile clean-libtool clean-tags \ + clean-depend clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-compile distclean-libtool \ + distclean-tags distclean-depend distclean-generic \ + clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-depend \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ +maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir \ +mostlyclean-depend distclean-depend clean-depend \ +maintainer-clean-depend info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +# 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/projects/lookuplet/src/about.cc b/projects/lookuplet/src/about.cc new file mode 100644 index 00000000..f4a1918e --- /dev/null +++ b/projects/lookuplet/src/about.cc @@ -0,0 +1,9 @@ +// generated 2002/12/1 21:56:20 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs +// +// newer (non customized) versions of this file go to about.cc_new + +// This file is for your program, I won't touch it again! + +#include "config.h" +#include "about.hh" diff --git a/projects/lookuplet/src/about.hh b/projects/lookuplet/src/about.hh new file mode 100644 index 00000000..3282bed2 --- /dev/null +++ b/projects/lookuplet/src/about.hh @@ -0,0 +1,18 @@ +// generated 2002/12/1 21:56:20 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs +// +// newer (non customized) versions of this file go to about.hh_new + +// you might replace +// class foo : public foo_glade { ... }; +// by +// typedef foo_glade foo; +// if you didn't make any modifications to the widget + +#ifndef _ABOUT_HH +# include "about_glade.hh" +# define _ABOUT_HH +class about : public about_glade +{ +}; +#endif diff --git a/projects/lookuplet/src/about_glade.cc b/projects/lookuplet/src/about_glade.cc new file mode 100644 index 00000000..4d247515 --- /dev/null +++ b/projects/lookuplet/src/about_glade.cc @@ -0,0 +1,30 @@ +// generated 2002/12/1 21:56:20 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs +// +// DO NOT EDIT THIS FILE ! It was created using +// /usr/local/bin/glade-- --gnome2 lookuplet.glade +// for gtk 2.0.9 and gtkmm 2.0.0 +// +// Please modify the corresponding derived classes in ./src/about.cc + +#include "config.h" +#include "about_glade.hh" +#include + +const char * const about_authors[] = +{ "Michael Bayne ", 0 +}; + +about_glade::about_glade( +) : Gnome::UI::About(PACKAGE, VERSION, "(C) 2001-2002 Michael Bayne", about_authors, about_authors, "This GNOME applet provides a simple means by which web and other queries can be launched with minimal typing.\n" + "-\n" + "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.") +{ + + Gnome::UI::About *about = this; + about->show(); +} + +about_glade::~about_glade() +{ +} diff --git a/projects/lookuplet/src/about_glade.hh b/projects/lookuplet/src/about_glade.hh new file mode 100644 index 00000000..e4be3c6a --- /dev/null +++ b/projects/lookuplet/src/about_glade.hh @@ -0,0 +1,24 @@ +// generated 2002/12/1 19:52:51 PST by mdb@baltic.(none) +// using glademm V1.1.0c +// +// DO NOT EDIT THIS FILE ! It was created using +// glade-- /export/home/mdb/projects/lookuplet/lookuplet.glade +// for gtk 2.0.9 and gtkmm 2.0.0 +// +// Please modify the corresponding derived classes in ./src/about.hh and./src/about.cc + +#ifndef _ABOUT_GLADE_HH +# define _ABOUT_GLADE_HH + +#include + +class about_glade : public Gnome::UI::About +{ +protected: + + + about_glade(); + + ~about_glade(); +}; +#endif diff --git a/projects/lookuplet/src/binding.cc b/projects/lookuplet/src/binding.cc new file mode 100644 index 00000000..f70919e4 --- /dev/null +++ b/projects/lookuplet/src/binding.cc @@ -0,0 +1,21 @@ +// generated 2002/12/1 21:56:20 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs +// +// newer (non customized) versions of this file go to binding.cc_new + +// This file is for your program, I won't touch it again! + +#include "config.h" +#include "binding.hh" + +void binding::on_ok_clicked() +{ +} + +void binding::on_cancel_clicked() +{ +} + +bool binding::on_key_key_press_event(GdkEventKey *ev) +{ return 0; +} diff --git a/projects/lookuplet/src/binding.hh b/projects/lookuplet/src/binding.hh new file mode 100644 index 00000000..5775ef7c --- /dev/null +++ b/projects/lookuplet/src/binding.hh @@ -0,0 +1,22 @@ +// generated 2002/12/1 21:56:20 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs +// +// newer (non customized) versions of this file go to binding.hh_new + +// you might replace +// class foo : public foo_glade { ... }; +// by +// typedef foo_glade foo; +// if you didn't make any modifications to the widget + +#ifndef _BINDING_HH +# include "binding_glade.hh" +# define _BINDING_HH +class binding : public binding_glade +{ + + void on_ok_clicked(); + void on_cancel_clicked(); + bool on_key_key_press_event(GdkEventKey *ev); +}; +#endif diff --git a/projects/lookuplet/src/binding_glade.cc b/projects/lookuplet/src/binding_glade.cc new file mode 100644 index 00000000..6173ea4a --- /dev/null +++ b/projects/lookuplet/src/binding_glade.cc @@ -0,0 +1,119 @@ +// generated 2002/12/1 21:56:20 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs +// +// DO NOT EDIT THIS FILE ! It was created using +// /usr/local/bin/glade-- --gnome2 lookuplet.glade +// for gtk 2.0.9 and gtkmm 2.0.0 +// +// Please modify the corresponding derived classes in ./src/binding.cc + +#include "config.h" +#include "binding_glade.hh" +#include +#include +#include +#include +#include +#include + +binding_glade::binding_glade( +) +{ + + Gtk::Dialog *binding = this; + Gtk::Button *ok = manage(new class Gtk::Button(Gtk::StockID("gtk-ok"))); + Gtk::Button *cancel = manage(new class Gtk::Button(Gtk::StockID("gtk-cancel"))); + Gtk::Label *klabel = manage(new class Gtk::Label("Key:")); + _key = manage(new class Gtk::Entry()); + + Gtk::Label *nlabel = manage(new class Gtk::Label("Name:")); + _name = manage(new class Gtk::Entry()); + + Gtk::HBox *hbox3 = manage(new class Gtk::HBox(false, 5)); + Gtk::Label *tlabel = manage(new class Gtk::Label("Enter the URL to launch or command to invoke when this key combination is pressed:")); + Gtk::MenuItem *convertwidget4 = NULL; + Gtk::MenuItem *convertwidget5 = NULL; + Gtk::Menu *convertwidget3 = manage(new class Gtk::Menu()); + _type = manage(new class Gtk::OptionMenu()); + _argument = manage(new class Gtk::Entry()); + + Gtk::HBox *hbox4 = manage(new class Gtk::HBox(false, 5)); + Gtk::Label *blabel = manage(new class Gtk::Label("The following can be used to insert the query terms into the URL or command line:\n" + "\n" + "%T - the plain query terms\n" + "%U - the URL encoded query terms")); + ok->set_flags(Gtk::CAN_FOCUS); + ok->set_relief(Gtk::RELIEF_NORMAL); + cancel->set_flags(Gtk::CAN_FOCUS); + cancel->set_relief(Gtk::RELIEF_NORMAL); + binding->get_action_area()->pack_start(*ok); + binding->get_action_area()->pack_start(*cancel); + klabel->set_alignment(0.5,0.5); + klabel->set_padding(0,0); + klabel->set_justify(Gtk::JUSTIFY_CENTER); + klabel->set_line_wrap(false); + _key->set_flags(Gtk::CAN_FOCUS); + _key->set_editable(true); + _key->set_text(""); + nlabel->set_alignment(0.5,0.5); + nlabel->set_padding(0,0); + nlabel->set_justify(Gtk::JUSTIFY_CENTER); + nlabel->set_line_wrap(false); + _name->set_flags(Gtk::CAN_FOCUS); + _name->set_editable(true); + _name->set_text(""); + hbox3->pack_start(*klabel, Gtk::PACK_SHRINK, 0); + hbox3->pack_start(*_key); + hbox3->pack_start(*nlabel, Gtk::PACK_SHRINK, 0); + hbox3->pack_start(*_name); + tlabel->set_alignment(0.5,0.5); + tlabel->set_padding(0,0); + tlabel->set_justify(Gtk::JUSTIFY_CENTER); + tlabel->set_line_wrap(true); + _type->set_flags(Gtk::CAN_FOCUS); + _type->set_history(0); + _type->set_menu(*convertwidget3); + _argument->set_flags(Gtk::CAN_FOCUS); + _argument->set_editable(true); + _argument->set_text(""); + hbox4->pack_start(*_type, Gtk::PACK_SHRINK, 0); + hbox4->pack_start(*_argument); + blabel->set_alignment(0.5,0.5); + blabel->set_padding(0,0); + blabel->set_justify(Gtk::JUSTIFY_FILL); + blabel->set_line_wrap(true); + binding->get_vbox()->set_homogeneous(false); + binding->get_vbox()->set_spacing(8); + binding->get_vbox()->pack_start(*hbox3); + binding->get_vbox()->pack_start(*tlabel, Gtk::PACK_SHRINK, 0); + binding->get_vbox()->pack_start(*hbox4); + binding->get_vbox()->pack_start(*blabel, Gtk::PACK_SHRINK, 0); + binding->set_border_width(5); + binding->set_title("Edit Binding"); + binding->set_modal(false); + binding->property_window_position().set_value(Gtk::WIN_POS_NONE); + binding->set_resizable(true); + ok->show(); + cancel->show(); + klabel->show(); + _key->show(); + nlabel->show(); + _name->show(); + hbox3->show(); + tlabel->show(); + convertwidget4->show(); + convertwidget5->show(); + convertwidget3->show(); + _type->show(); + _argument->show(); + hbox4->show(); + blabel->show(); + binding->show(); + ok->signal_clicked().connect(SigC::slot(*this, &binding_glade::on_ok_clicked)); + cancel->signal_clicked().connect(SigC::slot(*this, &binding_glade::on_cancel_clicked)); + _key->signal_key_press_event().connect(SigC::slot(*this, &binding_glade::on_key_key_press_event)); +} + +binding_glade::~binding_glade() +{ +} diff --git a/projects/lookuplet/src/binding_glade.hh b/projects/lookuplet/src/binding_glade.hh new file mode 100644 index 00000000..38eef45c --- /dev/null +++ b/projects/lookuplet/src/binding_glade.hh @@ -0,0 +1,34 @@ +// generated 2002/12/1 21:56:20 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs +// +// DO NOT EDIT THIS FILE ! It was created using +// /usr/local/bin/glade-- --gnome2 lookuplet.glade +// for gtk 2.0.9 and gtkmm 2.0.0 +// +// Please modify the corresponding derived classes in ./src/binding.hh and./src/binding.cc + +#ifndef _BINDING_GLADE_HH +# define _BINDING_GLADE_HH + +#include +#include +#include + +class binding_glade : public Gtk::Dialog +{ +protected: + + class Gtk::Entry *_key; + class Gtk::Entry *_name; + class Gtk::OptionMenu *_type; + class Gtk::Entry *_argument; + + binding_glade(); + + ~binding_glade(); +private: + virtual void on_ok_clicked() = 0; + virtual void on_cancel_clicked() = 0; + virtual bool on_key_key_press_event(GdkEventKey *ev) = 0; +}; +#endif diff --git a/projects/lookuplet/src/lookuplet.cc b/projects/lookuplet/src/lookuplet.cc new file mode 100644 index 00000000..aae242b5 --- /dev/null +++ b/projects/lookuplet/src/lookuplet.cc @@ -0,0 +1,60 @@ +// +// $Id: lookuplet.cc,v 1.1 2003/11/28 21:34:59 mdb Exp $ + +#include +#include + +#include +#include +#include +// #include + +#include "lookuplet.hh" +#include "binding.hh" +#include "about.hh" +#include "properties.hh" + +using namespace std; + +bool lookuplet::on_query_key_press_event (GdkEventKey *ev) +{ + return 0; +} + +void lookuplet::on_query_selection_received (GtkSelectionData *data, guint time) +{ +} + +void lookuplet::on_prefs_clicked () +{ + manage(new class properties()); +} + +void lookuplet::exit_lookuplet () +{ +} + +bool Gtk::Widget::on_delete_event (GdkEventAny* event) +{ + exit(0); +} + +int main(int argc, char **argv) +{ + Gnome::Main m(PACKAGE, VERSION, Gnome::UI::module_info_get(), argc, argv); +// Gnome::Bonobo::wrap_init(); + + lookuplet *lookuplet = new class lookuplet(); +// binding *binding = new class binding(); +// about *about = new class about(); +// properties *properties = new class properties(); + + m.run(*lookuplet); + + delete lookuplet; +// delete binding; +// delete about; +// delete properties; + + return 0; +} diff --git a/projects/lookuplet/src/lookuplet.hh b/projects/lookuplet/src/lookuplet.hh new file mode 100644 index 00000000..0fee0593 --- /dev/null +++ b/projects/lookuplet/src/lookuplet.hh @@ -0,0 +1,17 @@ +// +// $Id: lookuplet.hh,v 1.1 2003/11/28 21:34:59 mdb Exp $ + +#ifndef _LOOKUPLET_HH +#include "lookuplet_glade.hh" +#define _LOOKUPLET_HH + +class lookuplet : public lookuplet_glade +{ + friend class lookuplet_glade; + bool on_query_key_press_event(GdkEventKey *ev); + void on_query_selection_received(GtkSelectionData *data, guint time); + void on_prefs_clicked(); + void exit_lookuplet(); +}; + +#endif diff --git a/projects/lookuplet/src/lookuplet_glade.cc b/projects/lookuplet/src/lookuplet_glade.cc new file mode 100644 index 00000000..8eb82e2a --- /dev/null +++ b/projects/lookuplet/src/lookuplet_glade.cc @@ -0,0 +1,55 @@ +// generated 2002/12/1 21:56:20 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs +// +// DO NOT EDIT THIS FILE ! It was created using +// /usr/local/bin/glade-- --gnome2 lookuplet.glade +// for gtk 2.0.9 and gtkmm 2.0.0 +// +// Please modify the corresponding derived classes in ./src/lookuplet.cc + +#include "config.h" +#include "lookuplet_glade.hh" +#include +#include +#include + +lookuplet_glade::lookuplet_glade( +) : Gtk::Window(Gtk::WINDOW_TOPLEVEL) +{ + + Gtk::Window *lookuplet = this; + Gtk::Label *qlabel = manage(new class Gtk::Label("Query")); + _query = manage(new class Gtk::Entry()); + + Gtk::Button *prefs = manage(new class Gtk::Button("Prefs")); + Gtk::HBox *mainbox = manage(new class Gtk::HBox(false, 5)); + qlabel->set_alignment(0.5,0.5); + qlabel->set_padding(0,0); + qlabel->set_justify(Gtk::JUSTIFY_CENTER); + qlabel->set_line_wrap(false); + _query->set_flags(Gtk::CAN_FOCUS); + _query->set_editable(true); + _query->set_text(""); + prefs->set_relief(Gtk::RELIEF_NORMAL); + mainbox->set_border_width(5); + mainbox->pack_start(*qlabel, Gtk::PACK_SHRINK, 0); + mainbox->pack_start(*_query); + mainbox->pack_start(*prefs, Gtk::PACK_SHRINK, 0); + lookuplet->set_title("lookuplet"); + lookuplet->set_modal(false); + lookuplet->property_window_position().set_value(Gtk::WIN_POS_NONE); + lookuplet->set_resizable(true); + lookuplet->add(*mainbox); + qlabel->show(); + _query->show(); + prefs->show(); + mainbox->show(); + lookuplet->show(); + _query->signal_key_press_event().connect(SigC::slot(*this, &lookuplet_glade::on_query_key_press_event)); + _query->signal_selection_received().connect(SigC::slot(*this, &lookuplet_glade::on_query_selection_received), true); + prefs->signal_clicked().connect(SigC::slot(*this, &lookuplet_glade::on_prefs_clicked)); +} + +lookuplet_glade::~lookuplet_glade() +{ +} diff --git a/projects/lookuplet/src/lookuplet_glade.hh b/projects/lookuplet/src/lookuplet_glade.hh new file mode 100644 index 00000000..f11b393d --- /dev/null +++ b/projects/lookuplet/src/lookuplet_glade.hh @@ -0,0 +1,30 @@ +// generated 2002/12/1 21:56:20 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs +// +// DO NOT EDIT THIS FILE ! It was created using +// /usr/local/bin/glade-- --gnome2 lookuplet.glade +// for gtk 2.0.9 and gtkmm 2.0.0 +// +// Please modify the corresponding derived classes in ./src/lookuplet.hh and./src/lookuplet.cc + +#ifndef _LOOKUPLET_GLADE_HH +# define _LOOKUPLET_GLADE_HH + +#include +#include + +class lookuplet_glade : public Gtk::Window +{ +protected: + + class Gtk::Entry *_query; + + lookuplet_glade(); + + ~lookuplet_glade(); +private: + virtual bool on_query_key_press_event(GdkEventKey *ev) = 0; + virtual void on_query_selection_received(GtkSelectionData *selection_data,guint time) = 0; + virtual void on_prefs_clicked() = 0; +}; +#endif diff --git a/projects/lookuplet/src/properties.cc b/projects/lookuplet/src/properties.cc new file mode 100644 index 00000000..8e95b91f --- /dev/null +++ b/projects/lookuplet/src/properties.cc @@ -0,0 +1,21 @@ +// +// $Id: properties.cc,v 1.1 2003/11/28 21:34:59 mdb Exp $ + +#include "config.h" +#include "properties.hh" + +void properties::on_delete_clicked () +{ +} + +void properties::on_edit_clicked () +{ +} + +void properties::on_add_clicked () +{ +} + +void properties::on_close_clicked () +{ +} diff --git a/projects/lookuplet/src/properties.hh b/projects/lookuplet/src/properties.hh new file mode 100644 index 00000000..52410af4 --- /dev/null +++ b/projects/lookuplet/src/properties.hh @@ -0,0 +1,18 @@ +// +// $Id: properties.hh,v 1.1 2003/11/28 21:34:59 mdb Exp $ + +#ifndef _PROPERTIES_HH +#include "properties_glade.hh" +#define _PROPERTIES_HH + +class properties : public properties_glade +{ + friend class properties_glade; + + void on_delete_clicked (); + void on_edit_clicked (); + void on_add_clicked (); + void on_close_clicked (); +}; + +#endif diff --git a/projects/lookuplet/src/properties_glade.cc b/projects/lookuplet/src/properties_glade.cc new file mode 100644 index 00000000..cdde11df --- /dev/null +++ b/projects/lookuplet/src/properties_glade.cc @@ -0,0 +1,108 @@ +// generated 2002/12/1 21:56:20 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs +// +// DO NOT EDIT THIS FILE ! It was created using +// /usr/local/bin/glade-- --gnome2 lookuplet.glade +// for gtk 2.0.9 and gtkmm 2.0.0 +// +// Please modify the corresponding derived classes in ./src/properties.cc + +#include "config.h" +#include "properties_glade.hh" +#include +#include +#include +#include +#include +#include +#include + +properties_glade::properties_glade( +) : Gtk::Window(Gtk::WINDOW_TOPLEVEL) +{ + + Gtk::Window *properties = this; + _bindings = manage(new class Gtk::TreeView()); + + Gtk::ScrolledWindow *scrolledwindow2 = manage(new class Gtk::ScrolledWindow()); + Gtk::Button *del = manage(new class Gtk::Button("Delete")); + Gtk::Button *edit = manage(new class Gtk::Button("Edit...")); + Gtk::Button *add = manage(new class Gtk::Button("Add...")); + Gtk::HBox *hbox5 = manage(new class Gtk::HBox(false, 5)); + Gtk::VBox *vbox4 = manage(new class Gtk::VBox(false, 5)); + Gtk::Label *blabel = manage(new class Gtk::Label("Bindings")); + Gtk::Notebook *notebook = manage(new class Gtk::Notebook()); + Gtk::HSeparator *hseparator1 = manage(new class Gtk::HSeparator()); + Gtk::Button *close = manage(new class Gtk::Button(Gtk::StockID("gtk-close"))); + Gtk::HButtonBox *hbuttonbox1 = manage(new class Gtk::HButtonBox(Gtk::BUTTONBOX_END, 0)); + Gtk::VBox *vbox3 = manage(new class Gtk::VBox(false, 5)); + _bindings->set_flags(Gtk::CAN_FOCUS); + _bindings->set_headers_visible(true); + _bindings->set_rules_hint(false); + _bindings->set_reorderable(false); + _bindings->set_enable_search(true); + scrolledwindow2->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + scrolledwindow2->add(*_bindings); + del->set_sensitive(false); + del->set_flags(Gtk::CAN_FOCUS); + del->set_relief(Gtk::RELIEF_NORMAL); + edit->set_sensitive(false); + edit->set_flags(Gtk::CAN_FOCUS); + edit->set_relief(Gtk::RELIEF_NORMAL); + add->set_flags(Gtk::CAN_FOCUS); + add->set_relief(Gtk::RELIEF_NORMAL); + hbox5->pack_start(*del, Gtk::PACK_SHRINK, 0); + hbox5->pack_start(*edit, Gtk::PACK_SHRINK, 0); + hbox5->pack_start(*add, Gtk::PACK_SHRINK, 0); + vbox4->set_border_width(5); + vbox4->pack_start(*scrolledwindow2); + vbox4->pack_start(*hbox5, Gtk::PACK_SHRINK, 0); + blabel->set_alignment(0.5,0.5); + blabel->set_padding(0,0); + blabel->set_justify(Gtk::JUSTIFY_CENTER); + blabel->set_line_wrap(false); + notebook->set_flags(Gtk::CAN_FOCUS); + notebook->set_show_tabs(true); + notebook->set_show_border(true); + notebook->set_tab_pos(Gtk::POS_TOP); + notebook->set_scrollable(false); + notebook->append_page(*vbox4, *blabel); + notebook->pages().back().set_tab_label_packing(false, true, Gtk::PACK_START); + close->set_flags(Gtk::CAN_FOCUS); + close->set_relief(Gtk::RELIEF_NORMAL); + hbuttonbox1->pack_start(*close); + vbox3->set_border_width(5); + vbox3->set_homogeneous(false); + vbox3->set_spacing(5); + vbox3->pack_start(*notebook); + vbox3->pack_start(*hseparator1, Gtk::PACK_SHRINK, 0); + vbox3->pack_start(*hbuttonbox1, Gtk::PACK_SHRINK, 0); + properties->set_size_request(-1,400); + properties->set_title("Lookuplet Properties"); + properties->set_modal(false); + properties->property_window_position().set_value(Gtk::WIN_POS_NONE); + properties->set_resizable(true); + properties->add(*vbox3); + _bindings->show(); + scrolledwindow2->show(); + del->show(); + edit->show(); + add->show(); + hbox5->show(); + vbox4->show(); + blabel->show(); + notebook->show(); + hseparator1->show(); + close->show(); + hbuttonbox1->show(); + vbox3->show(); + properties->show(); + del->signal_clicked().connect(SigC::slot(*this, &properties_glade::on_delete_clicked)); + edit->signal_clicked().connect(SigC::slot(*this, &properties_glade::on_edit_clicked)); + add->signal_clicked().connect(SigC::slot(*this, &properties_glade::on_add_clicked)); + close->signal_clicked().connect(SigC::slot(*this, &properties_glade::on_close_clicked)); +} + +properties_glade::~properties_glade() +{ +} diff --git a/projects/lookuplet/src/properties_glade.hh b/projects/lookuplet/src/properties_glade.hh new file mode 100644 index 00000000..4c32a2ca --- /dev/null +++ b/projects/lookuplet/src/properties_glade.hh @@ -0,0 +1,31 @@ +// generated 2002/12/1 21:56:20 PST by mdb@baltic.(none) +// using glademm V1.1.3c_cvs +// +// DO NOT EDIT THIS FILE ! It was created using +// /usr/local/bin/glade-- --gnome2 lookuplet.glade +// for gtk 2.0.9 and gtkmm 2.0.0 +// +// Please modify the corresponding derived classes in ./src/properties.hh and./src/properties.cc + +#ifndef _PROPERTIES_GLADE_HH +# define _PROPERTIES_GLADE_HH + +#include +#include + +class properties_glade : public Gtk::Window +{ +protected: + + class Gtk::TreeView *_bindings; + + properties_glade(); + + ~properties_glade(); +private: + virtual void on_delete_clicked() = 0; + virtual void on_edit_clicked() = 0; + virtual void on_add_clicked() = 0; + virtual void on_close_clicked() = 0; +}; +#endif diff --git a/projects/lookuplet/src/python/bindings.py b/projects/lookuplet/src/python/bindings.py index 12a4a6a0..bf449baf 100644 --- a/projects/lookuplet/src/python/bindings.py +++ b/projects/lookuplet/src/python/bindings.py @@ -1,5 +1,5 @@ # -# $Id: bindings.py,v 1.2 2002/03/18 00:03:41 mdb Exp $ +# $Id: bindings.py,v 1.3 2003/11/28 21:34:59 mdb Exp $ # # lookuplet - a utility for quickly looking up information # Copyright (C) 2001 Michael Bayne @@ -23,8 +23,8 @@ import re import string import urllib -import gnome.config -import gnome.url +import gnome +import gconf class Binding: "Contains the configuration for a particular key binding and its \ @@ -61,7 +61,8 @@ class Binding: if (self.type == self.EXEC): posix.system(command) else: - gnome.url.show(command) + # gnome.url_show(command) + posix.system("gnome-mozilla '%s'" % command) def update (self, key, type, name, argument): modified = 0; @@ -90,22 +91,31 @@ class Binding: class BindingSet: "Maintains the set of bindings loading into the program." + # our gconf client instance + gclient = None; + # the list of Binding objects bindings = []; # - # The default constructor. + # The default constructor. Loads up our bindings from GConf. # def __init__ (self): - gnome.config.push_prefix("/lookuplet/"); - count = gnome.config.get_int("lookuplet/bindings/count"); - for b in range(0, count): - key = gnome.config.get_string("lookuplet/bindings/key_%.2u" % b); - type = gnome.config.get_int("lookuplet/bindings/type_%.2u" % b); - name = gnome.config.get_string("lookuplet/bindings/name_%.2u" % b); - arg = gnome.config.get_string("lookuplet/bindings/arg_%.2u" % b); - self.bindings.append(Binding(key, type, name, arg)); - gnome.config.pop_prefix(); + # connect to the gconf server + gclient = gconf.client_get_default(); + gclient.add_dir("/apps/lookuplet", gconf.CLIENT_PRELOAD_NONE); + + count = 0; + +# gnome.config.push_prefix("/lookuplet/"); +# count = gnome.config.get_int("lookuplet/bindings/count"); +# for b in range(0, count): +# key = gnome.config.get_string("lookuplet/bindings/key_%.2u" % b); +# type = gnome.config.get_int("lookuplet/bindings/type_%.2u" % b); +# name = gnome.config.get_string("lookuplet/bindings/name_%.2u" % b); +# arg = gnome.config.get_string("lookuplet/bindings/arg_%.2u" % b); +# self.bindings.append(Binding(key, type, name, arg)); +# gnome.config.pop_prefix(); # if we loaded no bindings, use the defaults if (count == 0): @@ -126,6 +136,11 @@ class BindingSet: self.bindings.append(Binding( "Control-i", Binding.URL, "IMDB Title search", "http://www.imdb.com/Tsearch?title=%U&restrict=Movies+only")); + + # temporary hacked defaults + self.bindings.append(Binding( + "Control-j", Binding.EXEC, "Java doc lookup", + "/home/mdb/bin/quickdoc.pl \"%T\"")); return; # @@ -142,20 +157,20 @@ class BindingSet: # Stores our updated bindings to our GConf preferences. # def flush (self): - gnome.config.push_prefix("/lookuplet/"); - gnome.config.set_int("lookuplet/bindings/count", len(self.bindings)); - b = 0 - for binding in self.bindings: - gnome.config.set_string( - "lookuplet/bindings/key_%.2u" % b, binding.key); - gnome.config.set_int( - "lookuplet/bindings/type_%.2u" % b, binding.type); - gnome.config.set_string( - "lookuplet/bindings/name_%.2u" % b, binding.name); - gnome.config.set_string( - "lookuplet/bindings/arg_%.2u" % b, binding.argument); - b += 1; - gnome.config.sync(); - gnome.config.drop_all(); - gnome.config.pop_prefix(); +# gnome.config.push_prefix("/lookuplet/"); +# gnome.config.set_int("lookuplet/bindings/count", len(self.bindings)); +# b = 0 +# for binding in self.bindings: +# gnome.config.set_string( +# "lookuplet/bindings/key_%.2u" % b, binding.key); +# gnome.config.set_int( +# "lookuplet/bindings/type_%.2u" % b, binding.type); +# gnome.config.set_string( +# "lookuplet/bindings/name_%.2u" % b, binding.name); +# gnome.config.set_string( +# "lookuplet/bindings/arg_%.2u" % b, binding.argument); +# b += 1; +# gnome.config.sync(); +# gnome.config.drop_all(); +# gnome.config.pop_prefix(); return; diff --git a/projects/lookuplet/src/python/edit_binding.py b/projects/lookuplet/src/python/edit_binding.py index 13533a71..700b016b 100644 --- a/projects/lookuplet/src/python/edit_binding.py +++ b/projects/lookuplet/src/python/edit_binding.py @@ -1,5 +1,5 @@ # -# $Id: edit_binding.py,v 1.1 2002/03/17 09:03:06 mdb Exp $ +# $Id: edit_binding.py,v 1.2 2003/11/28 21:34:59 mdb Exp $ # # lookuplet - a utility for quickly looking up information # Copyright (C) 2001 Michael Bayne @@ -18,13 +18,12 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import gtk -import GDK -import gnome.ui -import libglade import string import re +import gtk +import gnome.ui + import bindings import keyval_util @@ -41,8 +40,8 @@ class BindingEditor: # the grab window grabWindow = None; - # the index of the binding we're editing - index = -1; + # the iterator for the binding we're editing + iterator = None; # the binding we're editing binding = None; @@ -62,10 +61,9 @@ class BindingEditor: # the argument entry field argField = None; - def __init__ (self, xmlui, props, bindings): + def __init__ (self, xmlui, props): # keep these around for later self.props = props; - self.bindings = bindings; # get a reference to some widgets self.bindPanel = xmlui.get_widget("binding"); @@ -77,19 +75,18 @@ class BindingEditor: self.argField = xmlui.get_widget("argument"); # wire up our handlers - nameFuncMap = {}; - for key in dir(self.__class__): - nameFuncMap[key] = getattr(self, key); - xmlui.signal_autoconnect(nameFuncMap); + xmlui.signal_connect("on_ok_clicked", self.on_ok_clicked); + xmlui.signal_connect("on_cancel_clicked", self.on_cancel_clicked); + xmlui.signal_connect("on_key_key_press_event", + self.on_key_key_press_event); # # Instructs the binding panel to display itself, configured for # editing the supplied binding. # - def editBinding (self, index): - # keep a reference to the binding - self.index = index; - self.binding = self.bindings.bindings[index]; + def editBinding (self, iterator, binding): + self.iterator = iterator; + self.binding = binding; self.populateAndShow(self.binding); # @@ -97,8 +94,8 @@ class BindingEditor: # available for editing by the user. # def createBinding (self): + self.iterator = None; # create a blank binding and edit it - self.index = -1; self.binding = bindings.Binding("", bindings.Binding.URL, "", ""); self.populateAndShow(self.binding); @@ -106,7 +103,6 @@ class BindingEditor: # A helper function used to populate our widgets and show the dialog. # def populateAndShow (self, binding): - print "populating from binding " + binding.to_string(); # populate our widgets with the binding values self.keyField.set_text(binding.key); self.nameField.set_text(binding.name); @@ -134,10 +130,10 @@ class BindingEditor: # let the props panel know if there were any modifications if (modified): - if (self.index >= 0): - self.props.updated(self.index); - else: + if (self.iterator == None): self.props.created(self.binding); + else: + self.props.updated(self.iterator, self.binding); # hide the binding panel self.bindPanel.hide(); @@ -156,4 +152,5 @@ class BindingEditor: keystr = keyval_util.convert_keyval_state_to_string( event.keyval, event.state); textfield.set_text(keystr); - return gtk.TRUE; + return gtk.TRUE; + return gtk.FALSE; diff --git a/projects/lookuplet/src/python/history.py b/projects/lookuplet/src/python/history.py index e4bbec5a..876d83ab 100644 --- a/projects/lookuplet/src/python/history.py +++ b/projects/lookuplet/src/python/history.py @@ -1,5 +1,5 @@ # -# $Id: history.py,v 1.1 2002/03/17 21:25:20 mdb Exp $ +# $Id: history.py,v 1.2 2003/11/28 21:34:59 mdb Exp $ # # lookuplet - a utility for quickly looking up information # Copyright (C) 2001 Michael Bayne @@ -18,7 +18,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import gnome.config +import gconf class History: "Used to persistently maintain a history of entries for the \ @@ -35,13 +35,13 @@ class History: # operation. # def __init__ (self): - gnome.config.push_prefix("/lookuplet/"); - count = gnome.config.get_int("lookuplet/history/count"); - for h in range(0, count): - self.history.append(gnome.config.get_string( - "lookuplet/history/entry_%.2u" % h)); - # print "loaded %d: %s" % (h, self.history[h]); - gnome.config.pop_prefix(); +# gnome.config.push_prefix("/lookuplet/"); +# count = gnome.config.get_int("lookuplet/history/count"); +# for h in range(0, count): +# self.history.append(gnome.config.get_string( +# "lookuplet/history/entry_%.2u" % h)); +# # print "loaded %d: %s" % (h, self.history[h]); +# gnome.config.pop_prefix(); return; # @@ -61,16 +61,16 @@ class History: self.history.pop(0); # flush our config to the configuration repository - gnome.config.push_prefix("/lookuplet/"); - count = len(self.history); - gnome.config.set_int("lookuplet/history/count", count); - for h in range(0, count): - gnome.config.set_string( - "lookuplet/history/entry_%.2u" % h, self.history[h]); - # print "wrote %d: %s" % (h, self.history[h]); - gnome.config.sync(); - gnome.config.drop_all(); - gnome.config.pop_prefix(); +# gnome.config.push_prefix("/lookuplet/"); +# count = len(self.history); +# gnome.config.set_int("lookuplet/history/count", count); +# for h in range(0, count): +# gnome.config.set_string( +# "lookuplet/history/entry_%.2u" % h, self.history[h]); +# # print "wrote %d: %s" % (h, self.history[h]); +# gnome.config.sync(); +# gnome.config.drop_all(); +# gnome.config.pop_prefix(); # # Scans back from one before the specified index looking for a history diff --git a/projects/lookuplet/src/python/keyval_util.py b/projects/lookuplet/src/python/keyval_util.py index ed208c21..3be80239 100644 --- a/projects/lookuplet/src/python/keyval_util.py +++ b/projects/lookuplet/src/python/keyval_util.py @@ -1,5 +1,5 @@ # -# $Id: keyval_util.py,v 1.2 2002/03/19 00:22:31 mdb Exp $ +# $Id: keyval_util.py,v 1.3 2003/11/28 21:34:59 mdb Exp $ # # lookuplet - a utility for quickly looking up information # Copyright (C) 2001 Michael Bayne @@ -19,12 +19,16 @@ # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import string -import GDK + +import gtk +import gtk.gdk # these are used when doing our conversion; we specifically only care -# about Control, Shift and Mod1; if you want to use other keys in your -# combinations, we don't want you drinking our soda -_CODES = [ GDK.CONTROL_MASK, GDK.SHIFT_MASK, GDK.MOD1_MASK ]; +# about Control, Shift and Mod1 (Alt); if you want to use other keys in +# your combinations, we don't want you drinking our soda +_CODES = [ gtk.gdk.CONTROL_MASK, + gtk.gdk.SHIFT_MASK, + gtk.gdk.MOD1_MASK ]; _NAMES = [ "Control", "Shift", "Mod1" ]; # @@ -38,9 +42,9 @@ def convert_keyval_state_to_string (keyval, state): # start with the empty string modstr = ""; - # we'd like to ask GDK to convert the key itself to a string, but they - # don't wrap those functions. dooh! - # key = GDK.keyval_name(keyval); + # we'd like to ask gtk.gdk to convert the key itself to a string, + # but they don't wrap those functions. dooh! + # key = gtk.gdk_keyval_name(keyval); # so we do this hack instead if (keyval < 0 or keyval > 255): diff --git a/projects/lookuplet/src/python/lookuplet b/projects/lookuplet/src/python/lookuplet index 386e9cf7..a4b62b66 100755 --- a/projects/lookuplet/src/python/lookuplet +++ b/projects/lookuplet/src/python/lookuplet @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# $Id: lookuplet,v 1.2 2002/03/17 10:13:36 mdb Exp $ +# $Id: lookuplet,v 1.3 2003/11/28 21:34:59 mdb Exp $ # # lookuplet - a utility for quickly looking up information # Copyright (C) 2001 Michael Bayne @@ -19,14 +19,18 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import gnome.applet -import gtk -import libglade import string import sys import re import os +import pygtk +pygtk.require('2.0') + +import gnome.applet +import gtk +import gtk.glade + # figure out where we were run from basedir = sys.argv[0]; basedir = re.sub("/lookuplet$", "", basedir); @@ -43,10 +47,10 @@ import properties # load up our glade UI definition try: os.stat(basedir + "/lookuplet.glade"); - xmlui = libglade.GladeXML(basedir + "/lookuplet.glade"); + xmlui = gtk.glade.XML(basedir + "/lookuplet.glade"); except OSError: os.stat(libdir + "/lookuplet.glade"); - xmlui = libglade.GladeXML(libdir + "/lookuplet.glade"); + xmlui = gtk.glade.XML(libdir + "/lookuplet.glade"); # load up our bindings bindings = bindings.BindingSet(); diff --git a/projects/lookuplet/src/python/lookuplet.py b/projects/lookuplet/src/python/lookuplet.py index 38c96b7c..042b2bdd 100644 --- a/projects/lookuplet/src/python/lookuplet.py +++ b/projects/lookuplet/src/python/lookuplet.py @@ -1,5 +1,5 @@ # -# $Id: lookuplet.py,v 1.3 2002/03/17 21:25:20 mdb Exp $ +# $Id: lookuplet.py,v 1.4 2003/11/28 21:34:59 mdb Exp $ # # lookuplet - a utility for quickly looking up information # Copyright (C) 2001 Michael Bayne @@ -18,14 +18,14 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import gnome.applet -import gtk -import GDK -import gnome.ui -import gnome.uiconsts import string import re +import gnome.applet +import gtk +import gtk.keysyms +import gnome.ui + import bindings import history import keyval_util @@ -34,14 +34,10 @@ import properties class Lookuplet: "Handles the primary setup and operation of the lookuplet application." - # in theory these should be defined by GDK but seem not to be - SELECTION_PRIMARY = 1; - CURRENT_TIME = 0; - # our special key definitions - PREV_HISTORY_KEY = GDK.Up - NEXT_HISTORY_KEY = GDK.Down - AUTO_COMPLETE_KEY = GDK.Tab + PREV_HISTORY_KEY = gtk.keysyms.Up + NEXT_HISTORY_KEY = gtk.keysyms.Down + AUTO_COMPLETE_KEY = gtk.keysyms.Tab # a reference to our key bindings bindings = None; @@ -67,16 +63,15 @@ class Lookuplet: def __init__ (self, xmlui, bindings, props, appletMode): window = xmlui.get_widget("lookuplet"); self.about = xmlui.get_widget("about"); - self.string_atom = None; self.bindings = bindings; self.props = props; self.appletMode = appletMode; # wire up our handlers - nameFuncMap = {}; - for key in dir(self.__class__): - nameFuncMap[key] = getattr(self, key); - xmlui.signal_autoconnect(nameFuncMap); + xmlui.signal_connect("on_query_key_press_event", + self.on_query_key_press_event); + xmlui.signal_connect("on_prefs_clicked", self.on_prefs_clicked); + xmlui.signal_connect("exit_lookuplet", self.exit_lookuplet); # create our query history self.history = history.History(); @@ -97,23 +92,22 @@ class Lookuplet: applet.add(mainbox); # register our menu items applet.register_stock_callback( - "properties", gnome.uiconsts.STOCK_MENU_PROP, + "properties", gnome.ui.STOCK_MENU_PROP, "Properties...", self.on_props_selected, None); applet.register_stock_callback( - "about", gnome.uiconsts.STOCK_MENU_ABOUT, + "about", gnome.ui.STOCK_MENU_ABOUT, "About...", self.on_about_selected, None); applet.show(); else: window.show(); - # request the selection - if (self.string_atom == None): - self.string_atom = gtk.atom_intern("STRING", gtk.FALSE); + # obtain the primary selection and stuff that into our entry box + # clip = gtk.clipboard_get(gtk.GDK_SELECTION_PRIMARY); + # selection = gtk.clipboard_wait_for_text(clip); query = xmlui.get_widget("query"); - query.selection_convert(self.SELECTION_PRIMARY, - self.string_atom, - self.CURRENT_TIME); + # self.display_selection(self, query, selection); + # query.paste_clipboard(); # put the focus in the query box query.grab_focus(); @@ -201,7 +195,7 @@ class Lookuplet: self.hisidx = -1; # if they pressed return, map that to a special binding - if (event.keyval == GDK.Return): + if (event.keyval == gtk.keysyms.Return): binding = bindings.Binding("", bindings.Binding.URL, "", "%T"); else: @@ -242,14 +236,17 @@ class Lookuplet: # print "Selection retrieval failed."; return; - if (selection_data.type != GDK.SELECTION_TYPE_STRING): + if (selection_data.type != gtk.keysyms.SELECTION_TYPE_STRING): print "Selection target not returned as a string."; return; - # print "Got selection '%s'." % selection_data.data; + print "Got selection '%s'." % selection_data.data; + display_selection(self, query, selection_data.data); + return; + def display_selection (self, query, text): # prune spaces from the end of the text - text = string.strip(selection_data.data); + text = string.strip(text); # compress whitespace (and convert newlines to spaces) text = re.sub("[ \r\n]+", " ", text); @@ -269,5 +266,7 @@ class Lookuplet: query.select_region(0, len(text)); # print "Selected from %d to %d." % (0, len(text)); + return; + def exit_lookuplet (self, button): gtk.mainquit(); diff --git a/projects/lookuplet/src/python/properties.py b/projects/lookuplet/src/python/properties.py index c3f47189..fd4f0866 100644 --- a/projects/lookuplet/src/python/properties.py +++ b/projects/lookuplet/src/python/properties.py @@ -1,5 +1,5 @@ # -# $Id: properties.py,v 1.2 2002/03/18 00:30:24 mdb Exp $ +# $Id: properties.py,v 1.3 2003/11/28 21:34:59 mdb Exp $ # # lookuplet - a utility for quickly looking up information # Copyright (C) 2001-2002 Michael Bayne @@ -18,13 +18,14 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import gtk -import GDK -import gnome.ui -import libglade import string import re +import gobject +import gtk +import gtk.gdk +import gnome.ui + import edit_binding class Properties: @@ -37,8 +38,8 @@ class Properties: # our binding editor bindEditor = None; - # the bindings list - bindList = None; + # the bindings model + bindModel = None; # the edit button editButton = None; @@ -47,43 +48,61 @@ class Properties: deleteButton = None; # the selected binding index - selection = -1; + selection = None; def __init__ (self, xmlui, bindings): # keep a handle on our bindings self.bindings = bindings; # create our binding editor - self.bindEditor = edit_binding.BindingEditor(xmlui, self, bindings); + self.bindEditor = edit_binding.BindingEditor(xmlui, self); # get a reference to some widgets self.propsPanel = xmlui.get_widget("properties"); self.editButton = xmlui.get_widget("edit"); self.deleteButton = xmlui.get_widget("delete"); - self.bindList = xmlui.get_widget("bindings"); # make our props panel not destroy itself on close self.propsPanel.close_hides(gtk.TRUE); # wire up our handlers - nameFuncMap = {}; - for key in dir(self.__class__): - nameFuncMap[key] = getattr(self, key); - xmlui.signal_autoconnect(nameFuncMap); + xmlui.signal_connect("on_properties_apply", self.on_properties_apply); + xmlui.signal_connect("on_add_clicked", self.on_add_clicked); + xmlui.signal_connect("on_edit_clicked", self.on_edit_clicked); + xmlui.signal_connect("on_delete_clicked", self.on_delete_clicked); + + # set up our tree view + bindList = xmlui.get_widget("bindings"); + renderer = gtk.CellRendererText(); + bindList.append_column(gtk.TreeViewColumn("Key", renderer, text=0)); + bindList.append_column(gtk.TreeViewColumn("Name", renderer, text=1)); + + # create a data model for our bindings list view + self.bindModel = gtk.ListStore(gobject.TYPE_STRING, + gobject.TYPE_STRING, + gobject.TYPE_PYOBJECT); # configure our properties panel with the loaded bindings for binding in bindings.bindings: - self.bindList.append([binding.key, binding.name]); + iter = self.bindModel.append() + self.bindModel.set_value(iter, 0, binding.key); + self.bindModel.set_value(iter, 1, binding.name); + self.bindModel.set_value(iter, 2, binding); + + bindList.set_model(self.bindModel); + + # wire up our selection monitor + selection = bindList.get_selection(); + selection.connect("changed", self.on_bindings_selection_changed); def editProperties (self): self.propsPanel.show(); return; - def updated (self, index): - binding = self.bindings.bindings[index]; + def updated (self, iter, binding): # refresh the display for the specified index - self.bindList.set_text(index, 0, binding.key); - self.bindList.set_text(index, 1, binding.name); + self.bindModel.set_value(iter, 0, binding.key); + self.bindModel.set_value(iter, 1, binding.name); # and make a note that we've updated ourselves self.propsPanel.changed(); @@ -91,31 +110,35 @@ class Properties: # add the new binding to our list self.bindings.bindings.append(binding); # add it to the display - self.bindList.append([binding.key, binding.name]); + iter = self.bindModel.append() + self.bindModel.set_value(iter, 0, binding.key); + self.bindModel.set_value(iter, 1, binding.name); + self.bindModel.set_value(iter, 2, binding); # and make a note that we've updated ourselves self.propsPanel.changed(); + def on_bindings_selection_changed (self, selection): + # make a note of the iterator for the selected binding + model, self.selection = selection.get_selected(); + + # no ?: notation? egads! + if (self.selection == None): + sensitive = gtk.FALSE; + else: + sensitive = gtk.TRUE; + + # enable our buttons + self.editButton.set_sensitive(sensitive); + self.deleteButton.set_sensitive(sensitive); + + # make like they pressed the edit button on a double click + # if (event.type == gtk.gdk._2BUTTON_PRESS): + # self.on_edit_clicked(None); + def on_properties_apply (self, panel, page): if (page == 0): self.bindings.flush(); - def on_bindings_select_row (self, clist, row, column, event): - # enable our buttons - self.editButton.set_sensitive(gtk.TRUE); - self.deleteButton.set_sensitive(gtk.TRUE); - - # make a note of the selected binding index - self.selection = row; - - # make like they pressed the edit button on a double click - if (event.type == GDK._2BUTTON_PRESS): - self.on_edit_clicked(None); - - def on_bindings_unselect_row (self, clist, row, column, event): - # disable our buttons - self.editButton.set_sensitive(gtk.FALSE); - self.deleteButton.set_sensitive(gtk.FALSE); - def on_add_clicked (self, button): # show the binding creation dialog self.bindEditor.createBinding(); @@ -123,14 +146,15 @@ class Properties: def on_edit_clicked (self, button): # tell the binding editor to edit this binding - self.bindEditor.editBinding(self.selection); + binding = self.bindModel.get_value(self.selection, 2); + self.bindEditor.editBinding(self.selection, binding); return; def on_delete_clicked (self, button): # remove the binding from the display and our bindings list - binding = self.bindings.bindings[self.selection]; - self.bindList.remove(self.selection) + binding = self.bindModel.get_value(self.selection, 2); + self.bindModel.remove(self.selection) self.bindings.bindings.remove(binding); - self.selection = -1; + self.selection = None; self.propsPanel.changed(); return;