Moved to separate repository.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1620 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2005-03-13 22:42:32 +00:00
parent e9d198ee16
commit c764fe84cc
64 changed files with 0 additions and 5696 deletions
-22
View File
@@ -1,22 +0,0 @@
Makefile
Makefile.in
aclocal.m4
config.cache
config.h
config.h.in
config.log
config.status
configure
stamp-h
stamp-h.in
ABOUT-NLS
config.guess
config.sub
intl
libtool
ltmain.sh
po
*.tar.gz
*_new
*.gladep
autom4te.cache
-1
View File
@@ -1 +0,0 @@
Michael Bayne <mdb@samskivert.com>
-280
View File
@@ -1,280 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
-74
View File
@@ -1,74 +0,0 @@
2002-03-17 Michael Bayne <mdb@samskivert.com>
* src/history.py: Added persistent history support and tab
completion (from the history) to the query box text field. Yay!
* various: Rewrote the whole business in Python, using Glade to
create the user interface. Oh, the joy of being rid of C.
2001-08-21 Michael Bayne <mdb@samskivert.com>
* src/querybox.c: Massage the selection somewhat by converting
newlines to spaces and if we believe that we're looking at a URL,
by removing spaces.
2001-08-17 Michael Bayne <mdb@samskivert.com>
* src/lookuplet.c: Got support for running as an applet working
again and modified the code to autodetect whether we're being run
as an applet.
2001-08-16 Michael Bayne <mdb@samskivert.com>
* projects/lookuplet/src/lookuplet.c:
Now that we're not an applet, we need to call gnome_init() rather than
gtk_init(). Also slipped in some conditionals for the NLS stuff.
* projects/lookuplet/acconfig.h, projects/lookuplet/configure.in:
Minor configuration to make things work. I dislike the cargo cult nature
of my approach toward autoconf, but I can't be bothered to dive deeply
enough into the whole business to sort out all the jockeying that GNOME
and the various other layers are doing with it.
* projects/lookuplet/.cvsignore, projects/lookuplet/Makefile.am, projects/lookuplet/acconfig.h, projects/lookuplet/configure.in, projects/lookuplet/src/Makefile.am:
Modifications to build lookuplet like a GNOME app rather than an applet.
2001-03-10 Michael Bayne <mdb@samskivert.com>
* projects/lookuplet/src/querybox.c:
Exit after launching unless we're being compiled in applet mode (which
isn't fully reinstated yet anyway).
* 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
-46
View File
@@ -1,46 +0,0 @@
Building lookuplet
------------------
lookuplet is in the process of being rewritten in C++ using GLADE to
autogenerate code for the UI. As such you will need a variety of libraries
installed to build the program.
I use Debian Woody and I believe apt-get installing the following packages
will get you to where you need to be:
gnome-common
automake
autoconf
libgtk2.0-dev
libgnomemm2.0-dev
libgnomeuimm2.0-dev
I'm not sure whether there will be some missed dependencies, let me know
if you start from scratch and find some.
With that installed, invoke:
% ./autogen.sh
which will do a bunch of stuff and eventually run ./configure. You can
pass arguments to ./autogen.sh like --prefix to install somewhere other
than /usr/local. Then you can:
% make
which should build lookuplet which you can attempt to run like so:
% ./src/lookuplet
If that seems to work, then you can install it with:
% make install
Please let me know if you find that I've overlooked some build
requirements or instructions.
Thanks,
Michael Bayne <mdb@samskivert.com>
$Id: INSTALL,v 1.6 2003/11/28 21:38:13 mdb Exp $
-8
View File
@@ -1,8 +0,0 @@
# 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
-22
View File
@@ -1,22 +0,0 @@
* lookuplet-1.2 (2002-03-17)
- Added history support along with tab completion from the history.
- Rewrote the whole thing in Python.
- Convert newlines to spaces when grabbing the selection. If we think that
the selection is a URL (it starts with http: etc.), then we remove
spaces as well.
* lookuplet-1.1 (2001-08-17)
- Fixed support for running as an applet and made the code automatically
figure out whether or not do so.
- Sorted out building things as a Debian package.
* lookuplet-1.0 (2001-08-16)
- Initial release.
$Id: NEWS,v 1.5 2002/03/17 21:30:19 mdb Exp $
-72
View File
@@ -1,72 +0,0 @@
lookuplet
---------
This GNOME application provides a unified interface for looking things up.
There are many applications (desktop and web-based) in which you enter
some text and they return some information based on that text. Examples
include:
* Looking a word up in a dictionary
* Performing a web search
* Performing a more specific search (searching Debian packages or on
freshmeat.net, etc.)
* Looking up an address in a mapping service
The lookuplet aims to make all of those services readily accessible in as
efficient a manner as possible.
Using lookuplet
---------------
When invoked, lookuplet grabs the current selection and sticks it into a
text field for potential editing. You then press a key combination that
you have previously configured and the text is sent either as an argument
to an application or URL encoded and substituted into a URL which is then
opened with your preferred web browser.
This interface is based on the emacs principle of typing as few characters
as possible to perform tasks that are done frequently. I find myself
looking things up in various applications all of the time and the overhead
of creating a new browser window, selecting a bookmark, clicking into the
text entry field, entering the text and then pressing submit struck me as
tremendously inefficient.
The expectation is that you'll configure your window manager to launch
lookuplet at the press of some key combination so that from any
application, you can simply highlight text, press the lookuplet key
combination and then press the key combination of your desired service.
With such a configuration, the process of looking up information becomes
extremely efficient in terms of key presses and mouse clicks.
lookuplet can also be loaded into the GNOME toolbar as an applet instead
of being run standalone. In that configuration it doesn't grab the
selection when it starts up, but instead assumes you'll be pasting text
into it's text field before pressing a key combination.
The key combinations used by lookuplet and the associated launch
configuration are maintained via a simple graphical user interface.
Building lookuplet
------------------
Look at the INSTALL file for build instructions.
Distribution
------------
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.
Contact Information
-------------------
Feedback on the program is welcome. Additional information and the latest
release is available at <http://www.waywardgeeks.org/code/lookuplet/>.
Enjoy,
Michael Bayne <mdb@samskivert.com>
$Id: README,v 1.4 2001/08/18 02:39:36 mdb Exp $
-6
View File
@@ -1,6 +0,0 @@
TODO:
* Finish C++ rewrite
* Allow configuration of the default action (the one invoked when the user
presses return).
-15
View File
@@ -1,15 +0,0 @@
// 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
-19
View File
@@ -1,19 +0,0 @@
#!/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
-30
View File
@@ -1,30 +0,0 @@
# 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 )
-23
View File
@@ -1,23 +0,0 @@
lookuplet (1.3-1) unstable; urgency=low
* New upstream version: updated to work with Gnome 2.0.
-- Michael Bayne <mdb@samskivert.com> Sun, 24 Nov 2002 21:10:04 -0800
lookuplet (1.2-1) unstable; urgency=low
* New upstream version: rewritten entirely in Python.
-- Michael Bayne <mdb@samskivert.com> Sun, 17 Mar 2002 02:10:12 -0800
lookuplet (1.1-1) unstable; urgency=low
* New upstream version; supports operation as GNOME applet.
-- Michael Bayne <mdb@samskivert.com> Fri, 17 Aug 2001 19:48:08 -0700
lookuplet (1.0-1) unstable; urgency=low
* Initial Release.
-- Michael Bayne <mdb@samskivert.com> Fri, 17 Aug 2001 13:00:58 -0800
-13
View File
@@ -1,13 +0,0 @@
Source: lookuplet
Build-Depends: debhelper
Section: net
Priority: optional
Maintainer: Michael Bayne <mdb@samskivert.com>
Standards-Version: 3.5.6.0
Package: lookuplet
Architecture: any
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.
-19
View File
@@ -1,19 +0,0 @@
lookuplet - a utility for quickly looking up information
Copyright (C) 2001 Michael Bayne
This 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, or (at your option) any later
version.
This 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 with
your Debian GNU/Linux system, in /usr/share/common-licenses/GPL, or with the
lookuplet source package as the file COPYING. If not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
-3
View File
@@ -1,3 +0,0 @@
usr/bin
usr/share/lookuplet
usr/share/doc/lookuplet
-1
View File
@@ -1 +0,0 @@
NEWS README
-2
View File
@@ -1,2 +0,0 @@
?package(lookuplet):needs=X11 section=Apps/Tools\
title="lookuplet" command="/usr/bin/lookuplet"
-52
View File
@@ -1,52 +0,0 @@
#!/usr/bin/make -f
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Cristoph Lameter.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
clean:
dh_testdir
dh_testroot
# Add here commands to clean up after the build process.
-$(MAKE) clean
dh_clean
build:
# Nothing to do here
# Build architecture-independent files here.
binary-indep:
# dh_testversion
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the files into debian/tmp
$(MAKE) DESTDIR=`pwd`/debian/tmp install
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installinit
# dh_installcron
# dh_installmanpages
dh_undocumented lookuplet.1
dh_installchangelogs
# dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
# dh_makeshlibs
dh_md5sums
dh_builddeb
binary: binary-indep
.PHONY: clean build binary-indep binary
-559
View File
@@ -1,559 +0,0 @@
<?xml version="1.0" standalone="no"?>
<glade-interface>
<requires lib="gnome"/>
<widget class="GtkWindow" id="lookuplet">
<property name="title" translatable="yes">lookuplet</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<child>
<widget class="GtkHBox" id="mainbox">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">5</property>
<child>
<widget class="GtkLabel" id="qlabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Query</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="_query">
<property agent="glademm" name="cxx_visibility">protected</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
<signal name="key_press_event" handler="on_query_key_press_event"/>
<signal name="selection_received" handler="on_query_selection_received" after="yes"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="prefs">
<property name="visible">True</property>
<property name="label" translatable="yes">Prefs</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_prefs_clicked"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkDialog" id="binding">
<property name="border_width">5</property>
<property name="title" translatable="yes">Edit Binding</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">8</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="ok">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_ok_clicked"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="cancel">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_cancel_clicked"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">5</property>
<child>
<widget class="GtkLabel" id="klabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Key:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="_key">
<property agent="glademm" name="cxx_visibility">protected</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
<signal name="key_press_event" handler="on_key_key_press_event"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="nlabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Name:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="_name">
<property agent="glademm" name="cxx_visibility">protected</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="tlabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Enter the URL to launch or command to invoke when this key combination is pressed:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox4">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">5</property>
<child>
<widget class="GtkOptionMenu" id="_type">
<property agent="glademm" name="cxx_visibility">protected</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="history">0</property>
<child internal-child="menu">
<widget class="GtkMenu" id="convertwidget3">
<property name="visible">True</property>
<child>
<widget class="GtkMenuItem" id="convertwidget4">
<property name="visible">True</property>
<property name="label" translatable="yes">URL</property>
<property name="use_underline">True</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="convertwidget5">
<property name="visible">True</property>
<property name="label" translatable="yes">Exec</property>
<property name="use_underline">True</property>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="_argument">
<property agent="glademm" name="cxx_visibility">protected</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="blabel">
<property name="visible">True</property>
<property name="label" translatable="yes">The following can be used to insert the query terms into the URL or command line:
%T - the plain query terms
%U - the URL encoded query terms</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_FILL</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GnomeAbout" id="about">
<property name="destroy_with_parent">False</property>
<property name="copyright" translatable="yes">(C) 2001-2002 Michael Bayne</property>
<property name="comments" translatable="yes">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.</property>
<property name="authors">Michael Bayne &lt;mdb@samskivert.com&gt;
</property>
<property name="translator_credits" translatable="yes">translator_credits</property>
</widget>
<widget class="GtkWindow" id="properties">
<property name="height_request">400</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Lookuplet Properties</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<child internal-child="notebook">
<widget class="GtkVBox" id="vbox3">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">5</property>
<child internal-child="notebook">
<widget class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">True</property>
<property name="show_border">True</property>
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property>
<property name="enable_popup">False</property>
<child>
<widget class="GtkVBox" id="vbox4">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">5</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="_bindings">
<property agent="glademm" name="cxx_visibility">protected</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox5">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">5</property>
<child>
<widget class="GtkButton" id="del">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Delete</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_delete_clicked"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="edit">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Edit...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_edit_clicked"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="add">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Add...</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_add_clicked"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="blabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Bindings</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">0</property>
<child>
<widget class="GtkButton" id="close">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_close_clicked" last_modification_time="Mon, 02 Dec 2002 02:42:07 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>
-6
View File
@@ -1,6 +0,0 @@
*.pyc
lookuplet.messages
*_new
.deps
.libs
lookuplet
-410
View File
@@ -1,410 +0,0 @@
# 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:
-29
View File
@@ -1,29 +0,0 @@
#
# $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@
-410
View File
@@ -1,410 +0,0 @@
# 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:
-9
View File
@@ -1,9 +0,0 @@
// 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"
-18
View File
@@ -1,18 +0,0 @@
// 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
-30
View File
@@ -1,30 +0,0 @@
// 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 <vector>
const char * const about_authors[] =
{ "Michael Bayne <mdb@samskivert.com>", 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()
{
}
-24
View File
@@ -1,24 +0,0 @@
// 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 <libgnomeuimm/about.h>
class about_glade : public Gnome::UI::About
{
protected:
about_glade();
~about_glade();
};
#endif
-21
View File
@@ -1,21 +0,0 @@
// 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;
}
-22
View File
@@ -1,22 +0,0 @@
// 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
-119
View File
@@ -1,119 +0,0 @@
// 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 <gtkmm/button.h>
#include <gtkmm/buttonbox.h>
#include <gtkmm/label.h>
#include <gtkmm/box.h>
#include <gtkmm/menuitem.h>
#include <gtkmm/menu.h>
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()
{
}
-34
View File
@@ -1,34 +0,0 @@
// 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 <gtkmm/dialog.h>
#include <gtkmm/entry.h>
#include <gtkmm/optionmenu.h>
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
-209
View File
@@ -1,209 +0,0 @@
/**
* $Id: binding.c,v 1.2 2001/08/16 20:25:09 mdb Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 <gnome.h>
#include "binding.h"
static gchar* DEFAULT_BINDING_KEYS[] =
{
"Control-g",
"Control-d",
"Control-Shift-d",
"Control-f",
};
static LkBindingType DEFAULT_BINDING_TYPES[] =
{
URL,
EXEC,
URL,
URL,
URL,
};
static gchar* DEFAULT_BINDING_NAMES[] =
{
"Google search",
"Dictionary lookup",
"Debian package search",
"Freshmeat search",
"IMDB Title search",
};
static gchar* DEFAULT_BINDING_ARGUMENTS[] =
{
"http://www.google.com/search?client=googlet&q=%U",
"gdict -a %T",
"http://cgi.debian.org/cgi-bin/search_contents.pl?word=%U&case=insensitive&version=unstable&arch=i386&directories=yes",
"http://freshmeat.net/search/?q=%U",
"http://www.imdb.com/Tsearch?title=%U&restrict=Movies+only"
};
#define DEFAULT_BINDING_COUNT \
(sizeof(DEFAULT_BINDING_TYPES)/sizeof(LkBindingType))
LkBinding*
lk_binding_new (void)
{
LkBinding* binding = (LkBinding*)g_malloc(sizeof(LkBinding));
binding->key = g_strdup("");
binding->name = g_strdup("");
binding->argument = g_strdup("");
return binding;
}
LkBinding*
lk_binding_new_with_values (const gchar* key, LkBindingType type,
const gchar* name, const gchar* argument)
{
LkBinding* binding = (LkBinding*)g_malloc(sizeof(LkBinding));
binding->key = g_strdup(key);
binding->type = type;
binding->name = g_strdup(name);
binding->argument = g_strdup(argument);
return binding;
}
void
lk_binding_destroy (LkBinding* binding)
{
g_free(binding->key);
g_free(binding->name);
g_free(binding->argument);
g_free(binding);
}
void
lk_binding_init (LkBinding* binding, const gchar* key,
LkBindingType type, const gchar* name, const gchar* argument)
{
g_free(binding->key);
binding->key = g_strdup(key);
binding->type = type;
g_free(binding->name);
binding->name = g_strdup(name);
g_free(binding->argument);
binding->argument = g_strdup(argument);
}
static gchar*
config_get_string (const gchar* field, gint index)
{
gchar gkey[100];
gchar* value;
/* construct the path */
g_snprintf(gkey, sizeof(gkey),
"lookuplet/bindings/%s_%.2u", field, index);
/* fetch the value and deal with non-existent values */
value = gnome_config_get_string(gkey);
if (value == NULL) {
value = g_strdup("");
}
return value;
}
void
lk_binding_load_bindings (GPtrArray* bindings)
{
gchar gkey[100];
int count, i;
gnome_config_push_prefix("/lookuplet/");
count = gnome_config_get_int("lookuplet/bindings/count");
/* if we have bindings defined, load those */
if (count > 0) {
for (i = 0; i < count; i++) {
gchar* key, *name, *argument;
LkBindingType type = URL;
key = config_get_string("key", i);
g_snprintf(gkey, sizeof(gkey), "lookuplet/bindings/type_%.2u", i);
type = (LkBindingType)gnome_config_get_int(gkey);
name = config_get_string("name", i);
argument = config_get_string("arg", i);
g_ptr_array_add(bindings, lk_binding_new_with_values(
key, type, name, argument));
g_free(key);
g_free(name);
g_free(argument);
}
} else {
/* otherwise use the default bindings */
for (i = 0; i < DEFAULT_BINDING_COUNT; i++) {
LkBinding* binding =
lk_binding_new_with_values(DEFAULT_BINDING_KEYS[i],
DEFAULT_BINDING_TYPES[i],
DEFAULT_BINDING_NAMES[i],
DEFAULT_BINDING_ARGUMENTS[i]);
g_ptr_array_add(bindings, binding);
}
}
gnome_config_pop_prefix();
}
void
lk_binding_save_bindings (GPtrArray* bindings)
{
gchar gkey[100];
int i;
gnome_config_push_prefix("/lookuplet/");
/* save the total number of bindings */
gnome_config_set_int("lookuplet/bindings/count", bindings->len);
/* save each binding */
for (i = 0; i < bindings->len; i++) {
LkBinding* binding = LK_BINDING(g_ptr_array_index(bindings, i));
g_snprintf(gkey, sizeof(gkey),
"lookuplet/bindings/key_%.2u", i);
gnome_config_set_string(gkey, binding->key);
g_snprintf(gkey, sizeof(gkey),
"lookuplet/bindings/type_%.2u", i);
gnome_config_set_int(gkey, binding->type);
g_snprintf(gkey, sizeof(gkey),
"lookuplet/bindings/name_%.2u", i);
gnome_config_set_string(gkey, binding->name);
g_snprintf(gkey, sizeof(gkey),
"lookuplet/bindings/arg_%.2u", i);
gnome_config_set_string(gkey, binding->argument);
}
/* write our new settings to disk */
gnome_config_sync();
/* cargo cult programming! i dunno, the other guy did this too */
gnome_config_drop_all();
gnome_config_pop_prefix();
}
-68
View File
@@ -1,68 +0,0 @@
/**
* $Id: binding.h,v 1.2 2001/08/16 20:25:09 mdb Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 _BINDING_H_
#define _BINDING_H_
#include <glib.h>
#define MAX_BINDING_LENGTH 250
typedef enum _LkBindingType LkBindingType;
typedef struct _LkBinding LkBinding;
enum _LkBindingType
{
URL = 0,
EXEC = 1
};
struct _LkBinding
{
gchar* key;
LkBindingType type;
gchar* name;
gchar* argument;
};
#define LK_BINDING(b) ((LkBinding*)b)
extern LkBinding*
lk_binding_new (void);
extern LkBinding*
lk_binding_new_with_values (const gchar* key, LkBindingType type,
const gchar* name, const gchar* argument);
extern void
lk_binding_destroy (LkBinding* binding);
extern void
lk_binding_init (LkBinding* binding, const gchar* key,
LkBindingType type, const gchar* name, const gchar* argument);
extern void
lk_binding_load_bindings (GPtrArray* bindings);
extern void
lk_binding_save_bindings (GPtrArray* bindings);
#endif /* _BINDING_H_ */
-118
View File
@@ -1,118 +0,0 @@
/**
* $Id: history.c,v 1.1 2002/03/14 16:45:26 shaper Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 <gnome.h>
#include "history.h"
/* the array of historical entries */
static gchar** _history;
/* the last entry index retrieved */
static int _ridx = 0;
/* the insertion index for new history items */
static int _iidx = 0;
/* the number of entries saved in the text entry history */
#define HISTORY_COUNT (10)
void
lk_init_history (void)
{
/* allocate and initialize the array of history entries */
size_t size = sizeof(gchar*) * HISTORY_COUNT;
_history = g_malloc(size);
memset(_history, (int)NULL, size);
}
const gchar*
lk_get_history (gboolean next)
{
int actidx;
/* make sure the array is available */
if (_history == NULL) {
return NULL;
}
/* determine the sought-after index */
actidx = _ridx + ((next) ? -1 : 1);
/* make sure the index is valid and an entry exists */
if (actidx < 0 || actidx >= HISTORY_COUNT || _history[actidx] == NULL) {
return NULL;
}
/* update the retrieved index */
_ridx = actidx;
return _history[actidx];
}
const gchar*
lk_get_history_expand (const gchar* entry)
{
int i, len;
if (_history == NULL || entry == NULL) {
return NULL;
}
len = strlen(entry);
for (i = _iidx; i >= 0; i--) {
gchar* str = _history[i];
if (str != NULL && !g_strncasecmp(str, entry, len)) {
/* update the retrieved index for potential subsequent retrievals */
_ridx = i;
return str;
}
}
return NULL;
}
void
lk_add_history (const gchar* entry)
{
/* make sure the array is available and the entry is valid */
if (_history == NULL || entry == NULL) {
return;
}
/* if there's no space remaining, shift off the oldest entry */
if (_iidx == HISTORY_COUNT - 1 && _history[_iidx] != NULL) {
g_free(_history[0]);
memmove(_history, _history + 1, sizeof(gchar*) * (HISTORY_COUNT - 1));
_history[_iidx] = NULL;
}
/* remember the new entry */
_history[_iidx] = g_strdup(entry);
/* increment the insertion and retrieved index */
if (_iidx < HISTORY_COUNT - 1) {
_iidx++;
_ridx = _iidx;
} else {
_ridx = HISTORY_COUNT;
}
}
-59
View File
@@ -1,59 +0,0 @@
/**
* $Id: history.h,v 1.1 2002/03/14 16:45:26 shaper Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 _HISTORY_H_
#define _HISTORY_H_
#include <glib.h>
/**
* Initializes the history storage.
*/
void
lk_init_history (void);
/**
* Returns the next history entry if next is true, else returns the
* previous history entry.
*/
const gchar*
lk_get_history (gboolean next);
/**
* Returns the most recent history entry that matches the specified
* partial entry text, or NULL if there are no matches. String
* comparisons are case-insensitive as this is intended for use in
* effecting auto-completion of sloppily-inputted partial entries. If a
* matching entry is found, the current history item index is set to point
* to that entry such that subsequent history entry retrievals will
* automagically pick up from that point.
*/
const gchar*
lk_get_history_expand (const gchar* entry);
/**
* Adds an entry to the history and resets the current history item index
* to point to the new entry.
*/
void
lk_add_history (const gchar* entry);
#endif /* _HISTORY_H_ */
-165
View File
@@ -1,165 +0,0 @@
/**
* $Id: keysym-util.c,v 1.2 2001/08/16 20:25:09 mdb Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 <gnome.h>
#include "keysym-util.h"
static gboolean
string_empty (const char* string)
{
return (string == NULL ||
string[0] == '\0');
}
gboolean
convert_string_to_keysym_state (const char* string,
guint* keysym,
guint* state)
{
char* s, *p;
g_return_val_if_fail(keysym != NULL, FALSE);
g_return_val_if_fail(state != NULL, FALSE);
*state = 0;
*keysym = 0;
if (string_empty(string) ||
strcmp(string, "Disabled") == 0 ||
strcmp(string, _("Disabled")) == 0) {
return FALSE;
}
s = g_strdup(string);
gdk_error_trap_push();
p = strtok(s, "-");
while (p != NULL) {
if (strcmp(p, "Control")==0) {
*state |= GDK_CONTROL_MASK;
} else if (strcmp(p, "Lock")==0) {
*state |= GDK_LOCK_MASK;
} else if (strcmp(p, "Shift")==0) {
*state |= GDK_SHIFT_MASK;
} else if (strcmp(p, "Mod1")==0) {
*state |= GDK_MOD1_MASK;
} else if (strcmp(p, "Mod2")==0) {
*state |= GDK_MOD2_MASK;
} else if (strcmp(p, "Mod3")==0) {
*state |= GDK_MOD3_MASK;
} else if (strcmp(p, "Mod4")==0) {
*state |= GDK_MOD4_MASK;
} else if (strcmp(p, "Mod5")==0) {
*state |= GDK_MOD5_MASK;
} else {
*keysym = gdk_keyval_from_name(p);
if (*keysym == 0) {
gdk_flush();
gdk_error_trap_pop();
g_free(s);
return FALSE;
}
}
p = strtok(NULL, "-");
}
gdk_flush();
gdk_error_trap_pop();
g_free(s);
return (*keysym != 0);
}
char*
convert_keysym_state_to_string (guint keysym,
guint state)
{
GString* gs;
char* sep = "";
char* key;
if (keysym == 0) {
return g_strdup(_("Disabled"));
}
gdk_error_trap_push();
key = gdk_keyval_name(keysym);
gdk_flush();
gdk_error_trap_pop();
if (key == NULL) {
return NULL;
}
gs = g_string_new(NULL);
if (state & GDK_CONTROL_MASK) {
g_string_append(gs, "Control");
sep = "-";
}
if (state & GDK_LOCK_MASK) {
g_string_append(gs, sep);
g_string_append(gs, "Lock");
sep = "-";
}
if (state & GDK_SHIFT_MASK) {
g_string_append(gs, sep);
g_string_append(gs, "Shift");
sep = "-";
}
if (state & GDK_MOD1_MASK) {
g_string_append(gs, sep);
g_string_append(gs, "Mod1");
sep = "-";
}
if (state & GDK_MOD2_MASK) {
g_string_append(gs, sep);
g_string_append(gs, "Mod2");
sep = "-";
}
if (state & GDK_MOD3_MASK) {
g_string_append(gs, sep);
g_string_append(gs, "Mod3");
sep = "-";
}
if (state & GDK_MOD4_MASK) {
g_string_append(gs, sep);
g_string_append(gs, "Mod4");
sep = "-";
}
if (state & GDK_MOD5_MASK) {
g_string_append(gs, sep);
g_string_append(gs, "Mod5");
sep = "-";
}
g_string_append(gs, sep);
g_string_append(gs, key);
{
char *ret = gs->str;
g_string_free(gs, FALSE);
return ret;
}
}
-36
View File
@@ -1,36 +0,0 @@
/**
* $Id: keysym-util.h,v 1.2 2001/08/16 20:25:09 mdb Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 _KEYSYM_UTIL_H_
#define _KEYSYM_UTIL_H_
#include <glib.h>
gboolean
convert_string_to_keysym_state (const char* string,
guint* keysym,
guint* state);
char*
convert_keysym_state_to_string (guint keysym,
guint state);
#endif /* _KEYSYM_UTIL_H_ */
-160
View File
@@ -1,160 +0,0 @@
/**
* $Id: launcher.c,v 1.3 2001/08/16 20:25:09 mdb Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 <string.h>
#include <ctype.h>
#include <config.h>
#include <glib.h>
#include <gnome.h>
#include "launcher.h"
#define DEFAULT_COMMAND "%T"
#define DEFAULT_TYPE URL
#define ESC_CHAR '%'
static const gchar*
escape (gchar value)
{
static char buffer[] = "%xx";
static char* xlate = "0123456789ABCDEF";
buffer[0] = ESC_CHAR;
buffer[1] = xlate[(value >> 4) & 0xF];
buffer[2] = xlate[value & 0xF];
return buffer;
}
/**
* URL encodes the supplied text. The result must be freed by the caller
* using g_free().
*/
static gchar*
url_encode (const gchar* text)
{
GString* result;
guint tlen, i;
gchar* retval;
tlen = strlen(text);
result = g_string_sized_new(tlen);
for (i = 0; i < tlen; i++) {
if (!isalnum(text[i]) || text[i] == ESC_CHAR) {
g_string_append(result, escape(text[i]));
} else {
g_string_append_c(result, text[i]);
}
}
retval = result->str;
g_string_free(result, FALSE);
return retval;
}
/**
* Replaces all instances of before with after in the supplied source
* string.
*
* @return the number of replacements made.
*/
static
guint g_string_replace (GString* source, const gchar* before,
const gchar* after)
{
gchar* pos;
gchar* spot;
guint beflen = strlen(before);
guint aftlen = strlen(after);
guint replacements = 0;
/* sanity checks */
g_return_val_if_fail(source != NULL, 0);
g_return_val_if_fail(before != NULL, 0);
g_return_val_if_fail(after != NULL, 0);
g_return_val_if_fail(beflen > 0, 0);
pos = source->str;
while ((spot = strstr(pos, before)) != NULL) {
replacements++;
/* erase the match and insert the new stuff */
g_string_erase(source, spot-source->str, beflen);
g_string_insert(source, spot-source->str, after);
/* move the pointer on up */
pos += spot-source->str + aftlen;
}
return replacements;
}
#define TOKEN_START '%'
#define TERM_TOKEN 'T'
#define ENCODED_TERM_TOKEN "U"
/**
* Either displays a URL or invokes an command line with the supplied
* terms appropriately embedded.
*/
void
lk_launcher_launch (const LkBinding* binding, const gchar* terms)
{
char cwdbuf[1024];
GString* cmd;
gchar* uterms, *command;
LkBindingType type;
/* figure out what we're supposed to do */
if (binding == NULL) {
command = DEFAULT_COMMAND;
type = DEFAULT_TYPE;
} else {
command = binding->argument;
type = binding->type;
}
/* construct the actual command from it by replacing instances of %T
* with the terms and %U with the URL encoded terms. */
cmd = g_string_new(command);
/* first replace %U because we know that won't result in any '%T's
* being inserted into the string because the url encoded terms
* encode all %s */
uterms = url_encode(terms);
g_string_replace(cmd, "%U", uterms);
g_free(uterms);
g_string_replace(cmd, "%T", terms);
/* now we either invoke a program or launch a URL */
switch (type) {
case EXEC:
gnome_execute_shell(getcwd(cwdbuf, 1024), cmd->str);
break;
default:
case URL:
gnome_url_show(cmd->str);
break;
}
g_string_free(cmd, TRUE);
}
-32
View File
@@ -1,32 +0,0 @@
/**
* $Id: launcher.h,v 1.4 2001/08/16 20:52:40 mdb Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 _LAUNCHER_H_
#define _LAUNCHER_H_
#include <glib.h>
#include "binding.h"
extern void
lk_launcher_launch (const LkBinding* binding, const gchar* terms);
#endif /* _LAUNCHER_H_ */
-146
View File
@@ -1,146 +0,0 @@
/**
* $Id: lookuplet.c,v 1.7 2002/03/14 16:45:26 shaper Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <config.h>
#include <applet-widget.h>
#include <gnome.h>
#include "querybox.h"
#include "preferences.h"
/* Used to track whether or not we're being run as an applet or
* standalone. */
int applet_mode = 0;
static void
exit_lookuplet (GtkWidget* widget, gpointer data)
{
gtk_main_quit();
}
static void
about_box_cb (AppletWidget *applet, gpointer data)
{
static GtkWidget* about_box = NULL;
const gchar* authors[] = {
(gchar*) "Michael Bayne <mdb@samskivert.com>", (gchar*)NULL };
if (about_box != NULL) {
gdk_window_show(about_box->window);
gdk_window_raise(about_box->window);
return;
}
about_box = gnome_about_new(
_("lookuplet"), VERSION, "(C) 2001 Michael Bayne", authors,
_("This GNOME applet provides a simple means by which web and "
"other queries can be launched with minimal typing.\n\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."),
(gchar*)NULL);
gtk_signal_connect(GTK_OBJECT(about_box), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed), &about_box);
gtk_widget_show(about_box);
}
int
main (int argc, char** argv)
{
GtkWidget* top;
GtkWidget* contents;
int i;
/* figure out if we're running as an applet */
for (i = 0; i < argc; i++) {
if (strstr(argv[i], "activate-goad-server")) {
applet_mode = 1;
}
}
#ifdef ENABLE_NLS
/* initialize the i18n stuff */
bindtextdomain(PACKAGE, GNOMELOCALEDIR);
textdomain(PACKAGE);
#endif
if (applet_mode) {
/* initialize; this will basically set up the applet, corba and
call gnome_init() */
applet_widget_init(PACKAGE, VERSION, argc, argv, NULL, 0, NULL);
/* create our applet_widget */
if (!(top = applet_widget_new(PACKAGE))) {
g_error("Can't create applet widget.\n");
exit(1);
}
} else {
/* initialize gnome */
gnome_init(PACKAGE, VERSION, argc, argv);
/* create a new window */
top = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_signal_connect(GTK_OBJECT(top), "destroy",
GTK_SIGNAL_FUNC(exit_lookuplet), NULL);
}
/* initialize our preferences */
lk_prefs_init();
/* create our contents and set them up real proper like */
contents = lk_querybox_create();
if (applet_mode) {
applet_widget_add(APPLET_WIDGET(top), contents);
} else {
/* we only want a border if we're not an applet */
gtk_container_set_border_width(GTK_CONTAINER(top), GNOME_PAD_SMALL);
gtk_container_add(GTK_CONTAINER(top), contents);
}
gtk_widget_show_all(contents);
gtk_widget_show(top);
/* set up our applet menu */
if (applet_mode) {
applet_widget_register_stock_callback(
APPLET_WIDGET(top), "properties", GNOME_STOCK_MENU_PROP,
_("Properties..."), lk_prefs_display_applet, NULL);
applet_widget_register_stock_callback(
APPLET_WIDGET(top), "about", GNOME_STOCK_MENU_ABOUT,
_("About..."), about_box_cb, NULL);
}
/* initialize the querybox (which handles about everything) */
lk_querybox_init();
/* main loop */
if (applet_mode) {
applet_widget_gtk_main();
} else {
gtk_main();
}
return 0;
}
-28
View File
@@ -1,28 +0,0 @@
/**
* $Id: lookuplet.h,v 1.1 2001/08/18 02:34:06 mdb Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 _LOOKUPLET_H_
#define _LOOKUPLET_H_
/* Used to indicate whether or not we're running in applet mode. */
extern int applet_mode;
#endif /* _LOOKUPLET_H_ */
-461
View File
@@ -1,461 +0,0 @@
/**
* $Id: preferences.c,v 1.3 2001/08/18 02:34:06 mdb Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 <gnome.h>
#include <gdk/gdkx.h>
#include "keysym-util.h"
#include "binding.h"
#include "preferences.h"
static GtkWidget* _grabDialog;
static GtkWidget* _bindList;
static GtkWidget* _prefBox = NULL;
static GPtrArray* _bindings;
static GtkWidget* _keyEntry;
static LkBindingType _type;
static GtkWidget* _nameEntry;
static GtkWidget* _argEntry;
static GtkWidget* _edit;
static gint _selection = -1;
static GdkFilterReturn
grab_key_filter (GdkXEvent* gdk_xevent, GdkEvent* event, gpointer data)
{
XEvent* xevent = (XEvent*)gdk_xevent;
GtkEntry* entry;
char* key;
/* skip non-keypress events */
if (xevent->type != KeyPress && xevent->type != KeyRelease) {
return GDK_FILTER_CONTINUE;
}
/* convert the keysym into a string and stick it into the text entry
* that the user would otherwise type into */
key = convert_keysym_state_to_string(event->key.keyval, event->key.state);
entry = GTK_ENTRY(data);
gtk_entry_set_text(entry, key ? key : "");
g_free(key);
/* clean up after ourselves */
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
gtk_widget_destroy(_grabDialog);
_grabDialog = NULL;
gdk_window_remove_filter(GDK_ROOT_PARENT(), grab_key_filter, data);
return GDK_FILTER_REMOVE;
}
static void
grab_button_pressed (GtkButton* button, gpointer data)
{
GtkWidget* frame;
GtkWidget* box;
GtkWidget* label;
_grabDialog = gtk_window_new(GTK_WINDOW_POPUP);
gdk_keyboard_grab(GDK_ROOT_PARENT(), TRUE, GDK_CURRENT_TIME);
gdk_window_add_filter(GDK_ROOT_PARENT(), grab_key_filter, data);
gtk_window_set_policy(GTK_WINDOW(_grabDialog), FALSE, FALSE, TRUE);
gtk_window_set_position(GTK_WINDOW(_grabDialog), GTK_WIN_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(_grabDialog), TRUE);
frame = gtk_frame_new(NULL);
gtk_container_add(GTK_CONTAINER(_grabDialog), frame);
box = gtk_hbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(box), GNOME_PAD_BIG);
gtk_container_add(GTK_CONTAINER(frame), box);
label = gtk_label_new(_("Press a key..."));
gtk_container_add(GTK_CONTAINER(box), label);
gtk_widget_show_all(_grabDialog);
}
static void
pop_down_edit_binding (GtkWidget* button, gpointer arg)
{
_keyEntry = NULL;
_nameEntry = NULL;
_argEntry = NULL;
gtk_widget_destroy(GTK_WIDGET(arg));
}
static void
select_type (GtkWidget* menuitem, gpointer data)
{
_type = (LkBindingType)GPOINTER_TO_INT(data);
}
static void
row_selected (GtkCList* clist, gint row, gint column, GdkEventButton* event,
gpointer user_data)
{
_selection = row;
gtk_widget_set_sensitive(_edit, TRUE);
}
static void
row_deselected (GtkCList* clist, gint row, gint column, GdkEventButton* event,
gpointer user_data)
{
_selection = -1;
gtk_widget_set_sensitive(_edit, FALSE);
}
static void
populate_binding (GtkWidget* button, gpointer arg)
{
LkBinding* binding = LK_BINDING(arg);
gchar* key = gtk_entry_get_text(GTK_ENTRY(_keyEntry));
gchar* name = gtk_entry_get_text(GTK_ENTRY(_nameEntry));
gchar* argument = gtk_entry_get_text(GTK_ENTRY(_argEntry));
/* only update the binding if we modified something */
if (strcmp(key, binding->key) || _type != binding->type ||
strcmp(name, binding->name) || strcmp(argument, binding->argument)) {
/* update the binding instance */
lk_binding_init(binding, key, _type, name, argument);
/* let the prefs system know that something has changed */
gnome_property_box_changed(GNOME_PROPERTY_BOX(_prefBox));
}
}
static void
lk_prefs_edit_binding (LkBinding* binding, GtkSignalFunc okedFunc,
GtkSignalFunc cancelledFunc)
{
GtkWidget* dialog;
GtkWidget* vbox, *hbox;
GtkWidget* label, *button;
GtkWidget* optmenu, *menu, *menuitem;
gchar* types[] = { _("URL"), _("Exec"), NULL };
int i;
dialog = gtk_dialog_new();
gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
vbox = GTK_DIALOG(dialog)->vbox;
gtk_container_set_border_width(GTK_CONTAINER(vbox),
GNOME_PAD_SMALL);
gtk_box_set_spacing(GTK_BOX(vbox), GNOME_PAD_SMALL);
/* create the key line */
hbox = gtk_hbox_new(FALSE, GNOME_PAD_SMALL);
/* create the key input */
label = gtk_label_new(_("Key:"));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
_keyEntry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(_keyEntry), binding->key);
gtk_box_pack_start(GTK_BOX(hbox), _keyEntry, FALSE, FALSE, 0);
button = gtk_button_new_with_label(_("Grab..."));
gtk_signal_connect(GTK_OBJECT(button), "clicked",
grab_button_pressed, _keyEntry);
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
/* create the name input */
label = gtk_label_new(_("Name:"));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
_nameEntry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(_nameEntry), binding->name);
gtk_box_pack_start(GTK_BOX(hbox), _nameEntry, FALSE, FALSE, 0);
/* pack the line into the dialog */
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
/* create the command line */
hbox = gtk_hbox_new(FALSE, GNOME_PAD_SMALL);
optmenu = gtk_option_menu_new();
menu = gtk_menu_new();
for (i = 0; types[i] != NULL; i++) {
menuitem = gtk_menu_item_new_with_label(types[i]);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
select_type, GINT_TO_POINTER(i));
gtk_widget_show(menuitem);
gtk_menu_append(GTK_MENU(menu), menuitem);
}
gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu),
(int)binding->type);
_type = binding->type;
gtk_box_pack_start(GTK_BOX(hbox), optmenu, FALSE, FALSE, 0);
_argEntry = gtk_entry_new_with_max_length(MAX_BINDING_LENGTH);
gtk_entry_set_text(GTK_ENTRY(_argEntry), binding->argument);
gtk_box_pack_start(GTK_BOX(hbox), _argEntry, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
/* create and wire up the cancel button */
hbox = GTK_DIALOG(dialog)->action_area;
button = gtk_button_new_with_label(_("Cancel"));
gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
if (cancelledFunc != NULL) {
gtk_signal_connect(GTK_OBJECT(button), "clicked",
cancelledFunc, binding);
}
gtk_signal_connect(GTK_OBJECT(button), "clicked",
pop_down_edit_binding, dialog);
/* create and wire up the ok button */
button = gtk_button_new_with_label(_("OK"));
gtk_signal_connect(GTK_OBJECT(button), "clicked",
populate_binding, binding);
if (okedFunc != NULL) {
gtk_signal_connect(GTK_OBJECT(button), "clicked",
okedFunc, binding);
}
gtk_signal_connect(GTK_OBJECT(button), "clicked",
pop_down_edit_binding, dialog);
gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_window_set_default_size(GTK_WINDOW(dialog), 400, 10);
gtk_widget_show_all(dialog);
}
static void
add_binding_oked (GtkWidget* button, gpointer arg)
{
LkBinding* binding = LK_BINDING(arg);
gchar* data[2];
/* add this binding to our bindings array */
g_ptr_array_add(_bindings, binding);
/* and add it to the bindings list */
data[0] = binding->key;
data[1] = binding->name;
gtk_clist_append(GTK_CLIST(_bindList), data);
gtk_clist_columns_autosize(GTK_CLIST(_bindList));
/* indicate our change of properties */
gnome_property_box_changed(GNOME_PROPERTY_BOX(_prefBox));
}
static void
add_binding_cancelled (GtkWidget* button, gpointer arg)
{
lk_binding_destroy(LK_BINDING(arg));
}
static void
add_clicked (GtkButton* button, gpointer user_data)
{
LkBinding* binding = lk_binding_new();
lk_prefs_edit_binding(binding, add_binding_oked, add_binding_cancelled);
}
static void
edit_binding_oked (GtkWidget* button, gpointer arg)
{
LkBinding* binding = LK_BINDING(arg);
/* update the table display (the _selection is guaranteed not to have
* changed because the edit dialog is modal) */
gtk_clist_set_text(GTK_CLIST(_bindList), _selection, 0, binding->key);
gtk_clist_set_text(GTK_CLIST(_bindList), _selection, 1, binding->name);
gtk_clist_columns_autosize(GTK_CLIST(_bindList));
}
static void
edit_clicked (GtkButton* button, gpointer user_data)
{
/* only do something if there's a selection */
if (_selection != -1) {
LkBinding* binding =
LK_BINDING(g_ptr_array_index(_bindings, _selection));
/* make sure things aren't crazily out of sync */
if (binding != NULL) {
lk_prefs_edit_binding(binding, edit_binding_oked, NULL);
}
}
}
static void
delete_clicked (GtkButton* button, gpointer user_data)
{
/* only do something if there's a selection */
if (_selection != -1) {
/* remove the binding from our bindings list */
LkBinding* binding =
LK_BINDING(g_ptr_array_remove_index(_bindings, _selection));
/* make sure things are crazily out of sync */
if (binding != NULL) {
lk_binding_destroy(binding);
}
/* and remove that row from the clist */
gtk_clist_remove(GTK_CLIST(_bindList), _selection);
/* clear out the selection */
_selection = -1;
/* let the world know we've made changes */
gnome_property_box_changed(GNOME_PROPERTY_BOX(_prefBox));
}
}
void
lk_prefs_init (void)
{
if (_bindings == NULL) {
_bindings = g_ptr_array_new();
/* load up our bindings */
lk_binding_load_bindings(_bindings);
}
}
GPtrArray*
lk_prefs_get_bindings (void)
{
return _bindings;
}
void
lk_prefs_cleanup (void)
{
int i;
/* free our preferences panel */
gtk_widget_destroy(_prefBox);
_prefBox = NULL;
for (i = 0; i < _bindings->len; i++) {
lk_binding_destroy(LK_BINDING(g_ptr_array_index(_bindings, i)));
}
g_ptr_array_free(_bindings, FALSE);
}
static void
populate_bindings ()
{
gchar* data[2];
int i;
/* clear out any old stuff */
gtk_clist_clear(GTK_CLIST(_bindList));
/* add an entry for each binding */
for (i = 0; i < _bindings->len; i++) {
LkBinding* binding = LK_BINDING(g_ptr_array_index(_bindings, i));
data[0] = binding->key;
data[1] = binding->name;
gtk_clist_append(GTK_CLIST(_bindList), data);
}
/* fit the display to the contents */
gtk_clist_columns_autosize(GTK_CLIST(_bindList));
}
static void
apply_preferences (GnomePropertyBox* pbox, gint page, gpointer data)
{
/* save our bindings */
lk_binding_save_bindings(_bindings);
}
void
lk_prefs_display ()
{
GtkWidget* vbox, *bbox, *scrolled;
GtkWidget* label;
GtkWidget* add, *delete;
gchar* titles[] = { _("Key"), _("Name") };
/* just display the existing window if it's already open */
if (_prefBox != NULL) {
populate_bindings();
gdk_window_show(GTK_WIDGET(_prefBox)->window);
gdk_window_raise(GTK_WIDGET(_prefBox)->window);
return;
}
/* create and configure our prefs ui */
_prefBox = gnome_property_box_new();
gtk_window_set_title(GTK_WINDOW(_prefBox), _("Lookuplet Properties"));
gtk_signal_connect(GTK_OBJECT(_prefBox), "destroy",
gtk_widget_destroyed, &_prefBox);;
vbox = gtk_vbox_new(FALSE, GNOME_PAD_SMALL);
gtk_container_set_border_width(GTK_CONTAINER(vbox),
GNOME_PAD_SMALL);
label = gtk_label_new(_("Configure bindings..."));
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
/* create a scrolled window in which our clist will live */
scrolled = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
_bindList = gtk_clist_new_with_titles(2, titles);
gtk_clist_set_selection_mode(GTK_CLIST(_bindList), GTK_SELECTION_SINGLE);
gtk_signal_connect(GTK_OBJECT(_bindList), "select-row",
GTK_SIGNAL_FUNC(row_selected), NULL);
gtk_signal_connect(GTK_OBJECT(_bindList), "unselect-row",
GTK_SIGNAL_FUNC(row_deselected), NULL);
gtk_container_add(GTK_CONTAINER(scrolled), _bindList);
/* instruct the scrolled window not to assume teeny dimensions */
gtk_widget_set_usize(scrolled, 300, 200);
populate_bindings();
gtk_box_pack_start(GTK_BOX(vbox), scrolled, TRUE, TRUE, 0);
/* create the control buttons */
bbox = gtk_hbox_new(FALSE, GNOME_PAD_SMALL);
delete = gtk_button_new_with_label(_("Delete"));
gtk_box_pack_end(GTK_BOX(bbox), delete, FALSE, FALSE, 0);
_edit = gtk_button_new_with_label(_("Edit..."));
gtk_widget_set_sensitive(_edit, FALSE);
gtk_box_pack_end(GTK_BOX(bbox), _edit, FALSE, FALSE, 0);
add = gtk_button_new_with_label(_("Add..."));
gtk_box_pack_end(GTK_BOX(bbox), add, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
/* wire them up */
gtk_signal_connect(GTK_OBJECT(add), "clicked",
GTK_SIGNAL_FUNC(add_clicked), NULL);
gtk_signal_connect(GTK_OBJECT(_edit), "clicked",
GTK_SIGNAL_FUNC(edit_clicked), NULL);
gtk_signal_connect(GTK_OBJECT(delete), "clicked",
GTK_SIGNAL_FUNC(delete_clicked), NULL);
/* add our page to the property box */
gnome_property_box_append_page(GNOME_PROPERTY_BOX(_prefBox),
vbox, gtk_label_new(_("Bindings")));
/* wire up some signals */
gtk_signal_connect(GTK_OBJECT(_prefBox), "apply",
GTK_SIGNAL_FUNC(apply_preferences), NULL);
/* and finally show our property box */
gtk_widget_show_all(_prefBox);
}
void
lk_prefs_display_applet (AppletWidget* applet, gpointer data)
{
lk_prefs_display();
}
-43
View File
@@ -1,43 +0,0 @@
/**
* $Id: preferences.h,v 1.4 2001/08/18 02:34:06 mdb Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 _PREFERENCES_H_
#define _PREFERENCES_H_
#include <applet-widget.h>
#include <gnome.h>
extern void
lk_prefs_init (void);
extern GPtrArray*
lk_prefs_get_bindings (void);
extern void
lk_prefs_cleanup (void);
extern void
lk_prefs_display (void);
extern void
lk_prefs_display_applet (AppletWidget* applet, gpointer data);
#endif /* _PREFERENCES_H_ */
-287
View File
@@ -1,287 +0,0 @@
/**
* $Id: querybox.c,v 1.9 2002/03/14 16:45:26 shaper Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <config.h>
#include <glib.h>
#include <gnome.h>
#include <ctype.h>
#include <string.h>
#include "binding.h"
#include "launcher.h"
#include "history.h"
#include "keysym-util.h"
#include "preferences.h"
#include "lookuplet.h"
#include "querybox.h"
/* the query text entry field */
static GtkWidget* _query;
/* used by url_p */
#define MATCH_PREFIX(text, prefix) !strncmp(text, prefix, sizeof(prefix)-1)
/* key codes for navigating the entry history */
#define NEXT_HISTORY_KEY (GDK_Up)
#define PREVIOUS_HISTORY_KEY (GDK_Down)
/* key code for auto-completion of a partial entry */
#define AUTO_COMPLETE_KEY (GDK_Tab)
/**
* A very primitive function to try to determine if the selection is a URL
* of some sort.
*/
static int
url_p (const char* text)
{
return (MATCH_PREFIX(text, "http://") ||
MATCH_PREFIX(text, "ftp://") ||
MATCH_PREFIX(text, "https://") ||
MATCH_PREFIX(text, "file:/"));
}
static void
selection_received (GtkWidget* widget, GtkSelectionData* selection_data,
gpointer data)
{
int length = selection_data->length;
int is_url;
/* make sure some selection was provided */
if (length > 0) {
gchar* start, *end, *pos;
gchar* search_text =
gtk_editable_get_chars(GTK_EDITABLE(widget), 0, -1);
/* prune spaces from the end of the text */
for (start = search_text; isspace(*start); start++);
for (end = search_text + length - 1; isspace(*end); end--);
end++; *end = '\0';
/* check to see if we're looking at a url here */
is_url = url_p(start);
/* do some whitespace processing */
for (pos = start; *pos != '\0'; pos++) {
/* convert newlines to spaces */
if ((*pos == '\n') || (*pos == '\r')) {
*pos = ' ';
}
/* if this is a URL, we want to eat whitespace */
if (*pos == ' ' && is_url) {
memmove(pos, pos+1, strlen(pos));
}
}
/* only set the new text if we changed anything */
if (length != strlen(start)) {
length = strlen(start);
gtk_entry_set_text(GTK_ENTRY(widget), start);
}
g_free(search_text);
/* select the text in the entry so that it can be easily replaced */
gtk_editable_select_region(GTK_EDITABLE(_query), 0, length);
}
}
static gint
handle_special_keys (GtkWidget* widget, GdkEventKey* ek)
{
const gchar* entry = NULL;
switch (ek->keyval) {
case NEXT_HISTORY_KEY:
case PREVIOUS_HISTORY_KEY:
/* retrieve the sought-after historical entry */
entry = lk_get_history(ek->keyval == NEXT_HISTORY_KEY);
break;
case AUTO_COMPLETE_KEY: {
/* get the terms from the query box */
gchar* text = gtk_editable_get_chars(GTK_EDITABLE(widget), 0, -1);
/* seek an expanded historical entry for the current text */
entry = lk_get_history_expand(text);
}
break;
}
/* if we've an entry, fill it in and we're done */
if (entry != NULL) {
/* place the entry in the text field */
gtk_entry_set_text(GTK_ENTRY(widget), entry);
/* select the text in the entry so that it can be easily replaced */
gtk_editable_select_region(GTK_EDITABLE(_query), 0, strlen(entry));
return TRUE;
}
return FALSE;
}
static gint
key_pressed (GtkWidget* widget, GdkEvent* event, gpointer callback_data)
{
GdkEventKey* ek = (GdkEventKey*)event;
GPtrArray* bindings;
gint handled = FALSE, i;
gchar* keystr;
/* handle special keystrokes such as history and auto-complete */
if (handle_special_keys(widget, ek)) {
return TRUE;
}
/* ignore plain or shifted keystrokes */
if (ek->state <= 1) {
return FALSE;
}
/* otherwise convert the key combo to a name and look it up */
keystr = convert_keysym_state_to_string(ek->keyval, ek->state);
if (keystr == NULL) {
return FALSE;
}
bindings = lk_prefs_get_bindings();
for (i = 0; i < bindings->len; i++) {
LkBinding* binding = LK_BINDING(g_ptr_array_index(bindings, i));
if (!strcmp(keystr, binding->key)) {
/* get the terms from the query box */
gchar* search_text =
gtk_editable_get_chars(GTK_EDITABLE(widget), 0, -1);
/* save this entry in the history */
lk_add_history(search_text);
/* launch the appropriate thing */
lk_launcher_launch(binding, search_text);
g_free(search_text);
if (applet_mode) {
/* clear out the contents of the entry box */
gtk_entry_set_text(GTK_ENTRY(widget), "");
} else {
gtk_exit(0);
}
handled = TRUE;
break;
}
}
g_free(keystr);
return handled;
}
static void
prefs_clicked (GtkWidget* widget, gpointer data)
{
lk_prefs_display();
}
static void
launch (GtkWidget* widget, gpointer data)
{
/* pass the contents of the querybox on to the launcher for display
* (specifying NULL for the qualifier since they just pressed return
* instead of pressing some special key combination) */
gchar* search_text = gtk_editable_get_chars(GTK_EDITABLE(widget), 0, -1);
lk_launcher_launch(NULL, search_text);
if (applet_mode) {
/* save this entry in the history */
lk_add_history(search_text);
g_free(search_text);
/* clear out the contents of the entry box */
gtk_entry_set_text(GTK_ENTRY(widget), "");
} else {
gtk_exit(0);
}
}
GtkWidget*
lk_querybox_create (void)
{
GtkWidget* hbox;
GtkWidget* label;
GtkWidget* prefs;
/* create the widget we are going to put on the applet */
label = gtk_label_new(_("Query"));
/* make the query text box and attach the "activate" signal handler */
_query = gtk_entry_new();
/* Connect "return" in the search box to the launch func. */
gtk_signal_connect(GTK_OBJECT(_query), "activate",
GTK_SIGNAL_FUNC(launch), NULL);
/* create a horizontal box to hold our query input box and the
* label */
hbox = gtk_hbox_new(FALSE, GNOME_PAD_SMALL);
/* pack the query box and label into the hbox */
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), _query, TRUE, TRUE, 0);
/* create our preferences button (only if we're not an applet, if
* we're an applet we'll have a preferences menu item instead) */
if (!applet_mode) {
prefs = gtk_button_new_with_label(_("Prefs"));
gtk_signal_connect (GTK_OBJECT(prefs), "clicked",
GTK_SIGNAL_FUNC(prefs_clicked), NULL);
gtk_box_pack_start(GTK_BOX(hbox), prefs, FALSE, FALSE, 0);
}
/* create the array of history commands */
lk_init_history();
return hbox;
}
void
lk_querybox_init (void)
{
static GdkAtom targets_atom = GDK_NONE;
/* wire up our key press event handler */
gtk_signal_connect(GTK_OBJECT(_query), "key_press_event",
GTK_SIGNAL_FUNC(key_pressed), NULL);
/* if we're not an applet, we want to request focus and grab the
current X selection */
if (!applet_mode) {
/* focus the text entry box */
gtk_widget_grab_focus(_query);
/* register a signal handler that will select the selection when
it arrives */
gtk_signal_connect_after(GTK_OBJECT(_query), "selection_received",
GTK_SIGNAL_FUNC(selection_received), NULL);
/* request the selection as type "STRING" */
if (targets_atom == GDK_NONE) {
targets_atom = gdk_atom_intern ("STRING", FALSE);
}
gtk_selection_convert(_query, GDK_SELECTION_PRIMARY, targets_atom,
GDK_CURRENT_TIME);
}
}
-33
View File
@@ -1,33 +0,0 @@
/**
* $Id: querybox.h,v 1.3 2001/08/16 20:25:09 mdb Exp $
*
* lookuplet - a utility for quickly looking up information
* Copyright (C) 2001 Michael Bayne
*
* 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.1 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 _QUERYBOX_H_
#define _QUERYBOX_H_
#include <glib.h>
extern GtkWidget*
lk_querybox_create (void);
extern void
lk_querybox_init (void);
#endif /* _QUERYBOX_H_ */
-103
View File
@@ -1,103 +0,0 @@
/* XPM */
static char * paw_small_xpm[] = {
"14 18 82 1",
" c None",
". c #FEFEFE",
"+ c #FDFDFD",
"@ c #A4A4A4",
"# c #BEBEBE",
"$ c #E3E3E3",
"% c #767676",
"& c #FFFFFF",
"* c #858585",
"= c #5E5E5E",
"- c #E0E0E0",
"; c #9E9E9E",
"> c #292929",
", c #0D0D0D",
"' c #000000",
") c #2E2E2E",
"! c #DDDDDD",
"~ c #181818",
"{ c #717171",
"] c #F6F6F6",
"^ c #909090",
"/ c #777777",
"( c #131313",
"_ c #F9F9F9",
": c #D1D1D1",
"< c #B8B8B8",
"[ c #555555",
"} c #414141",
"| c #878787",
"1 c #DADADA",
"2 c #808080",
"3 c #757575",
"4 c #464646",
"5 c #222222",
"6 c #B4B4B4",
"7 c #212121",
"8 c #151515",
"9 c #D9D9D9",
"0 c #9A9A9A",
"a c #656565",
"b c #303030",
"c c #0C0C0C",
"d c #0F0F0F",
"e c #BFBFBF",
"f c #1B1B1B",
"g c #7A7A7A",
"h c #4B4B4B",
"i c #010101",
"j c #8B8B8B",
"k c #BABABA",
"l c #F0F0F0",
"m c #F5F5F5",
"n c #929292",
"o c #3D3D3D",
"p c #3B3B3B",
"q c #444444",
"r c #AEAEAE",
"s c #3E3E3E",
"t c #737373",
"u c #4D4D4D",
"v c #969696",
"w c #B5B5B5",
"x c #070707",
"y c #030303",
"z c #CCCCCC",
"A c #BBBBBB",
"B c #DEDEDE",
"C c #161616",
"D c #060606",
"E c #C3C3C3",
"F c #CECECE",
"G c #FBFBFB",
"H c #A8A8A8",
"I c #CDCDCD",
"J c #373737",
"K c #454545",
"L c #DFDFDF",
"M c #AAAAAA",
"N c #7F7F7F",
"O c #FCFCFC",
"P c #5A5A5A",
"Q c #EBEBEB",
" + @ ",
" #$ % ",
" *=- ;>$ ",
" -,')!~'{ ",
"] ^'''/''(_ : ",
"<$['''}'''] | ",
"123'''4''56789",
"0'ab'(-cdef''g",
"h'ijkl m-n'''o",
"p''q rs%&t'''o",
"u''vwx'y0z)''0",
"AybBC'''DE+FFG",
" HIJ'''''K ",
" w'''''''L ",
" ^'''''''* ",
" M'''''''N ",
" OP''''''N ",
" GtssssaQ "};
-71
View File
@@ -1,71 +0,0 @@
//
// $Id: lookuplet.cc,v 1.2 2003/11/30 23:50:18 mdb Exp $
#include <cstdlib>
#include <iostream>
#include <config.h>
#include <gtk/gtk.h>
#include <libgnomemm/main.h>
#include <libgnomeuimm/init.h>
// #include <bonobomm/widgets/wrap_init.h>
#include "lookuplet.hh"
#include "binding.hh"
#include "about.hh"
#include "properties.hh"
using namespace std;
static void got_clip_text (
GtkClipboard* clipboard, const gchar* text, gpointer data)
{
((lookuplet*)data)->on_clip_text_received(text);
}
bool lookuplet::on_query_key_press_event (GdkEventKey* ev)
{
printf("key pressed %d %d\n", ev->type, ev->keyval);
return 0;
}
void lookuplet::on_clip_text_received (const gchar* text)
{
_query->set_text(text);
}
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();
GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
gtk_clipboard_request_text(clip, &got_clip_text, lookuplet);
m.run(*lookuplet);
delete lookuplet;
// delete binding;
// delete about;
// delete properties;
return 0;
}
-7
View File
@@ -1,7 +0,0 @@
[Desktop Entry]
Name=Lookuplet
Comment=Look things up on the web and elsewhere
Exec=lookuplet --activate-goad-server=lookuplet
Icon=gnome-lookuplet.xpm
Terminal=0
Type=Application
-5
View File
@@ -1,5 +0,0 @@
[lookuplet]
type=exe
repo_id=IDL:GNOME/Applet:1.0
description=Looks things up on the web and elsewhere
location_info=lookuplet
-18
View File
@@ -1,18 +0,0 @@
//
// $Id: lookuplet.hh,v 1.2 2003/11/30 23:50:18 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_prefs_clicked();
void exit_lookuplet();
public:
void on_clip_text_received(const gchar* text);
};
#endif
-54
View File
@@ -1,54 +0,0 @@
// 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 <gtkmm/label.h>
#include <gtkmm/button.h>
#include <gtkmm/box.h>
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));
prefs->signal_clicked().connect(SigC::slot(*this, &lookuplet_glade::on_prefs_clicked));
}
lookuplet_glade::~lookuplet_glade()
{
}
-29
View File
@@ -1,29 +0,0 @@
// 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 <gtkmm/window.h>
#include <gtkmm/entry.h>
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_prefs_clicked() = 0;
};
#endif
-21
View File
@@ -1,21 +0,0 @@
//
// $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 ()
{
}
-18
View File
@@ -1,18 +0,0 @@
//
// $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
-108
View File
@@ -1,108 +0,0 @@
// 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 <gtkmm/scrolledwindow.h>
#include <gtkmm/button.h>
#include <gtkmm/box.h>
#include <gtkmm/label.h>
#include <gtkmm/notebook.h>
#include <gtkmm/separator.h>
#include <gtkmm/buttonbox.h>
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()
{
}
@@ -1,31 +0,0 @@
// 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 <gtkmm/window.h>
#include <gtkmm/treeview.h>
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
-176
View File
@@ -1,176 +0,0 @@
#
# $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
#
# 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.1 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
import posix
import re
import string
import urllib
import gnome
import gconf
class Binding:
"Contains the configuration for a particular key binding and its \
associated query mapping."
# constants defining which type of binding this is
URL = 0;
EXEC = 1;
# the key combination associated with this binding
key = "";
# the type of binding (URL or Exec)
type = URL;
# the human readable name of the binding
name = "";
# the URL or command line assosciated with the binding
argument = "";
#
# Constructs a binding with its requisite parameters.
#
def __init__ (self, key, type, name, argument):
self.key = key;
self.type = type;
self.name = name;
self.argument = argument;
def invoke (self, terms):
command = re.sub("%T", terms, self.argument);
command = re.sub("%U", urllib.quote(terms), command);
if (self.type == self.EXEC):
posix.system(command)
else:
# gnome.url_show(command)
posix.system("gnome-mozilla '%s'" % command)
def update (self, key, type, name, argument):
modified = 0;
if (cmp(key, self.key)):
self.key = key;
modified = 1;
if (type != self.type):
self.type = type;
modified = 1;
if (cmp(name, self.name)):
self.name = name;
modified = 1;
if (cmp(argument, self.argument)):
self.argument = argument;
modified = 1;
return modified;
def to_string (self):
return "[key=%s, type=%d, name=%s, arg=%s]" % (
self.key, self.type, self.name, self.argument);
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. Loads up our bindings from GConf.
#
def __init__ (self):
# 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):
self.bindings.append(Binding(
"Control-g", Binding.URL, "Google search",
"http://www.google.com/search?client=googlet&q=%U"));
self.bindings.append(Binding(
"Control-d", Binding.EXEC, "Dictionary lookup",
"gdict -a '%T'"));
self.bindings.append(Binding(
"Control-Shift-d", Binding.URL, "Debian package search",
"http://cgi.debian.org/cgi-bin/search_contents.pl?word=%U" +
"&case=insensitive&version=unstable&arch=i386" +
"&directories=yes"));
self.bindings.append(Binding(
"Control-f", Binding.URL, "Freshmeat search",
"http://freshmeat.net/search/?q=%U"));
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;
#
# Returns the binding with a keysym matching the specified keysym or
# None if no binding matches.
#
def get_match (self, keysym):
for binding in self.bindings:
if (binding.key == keysym):
return binding
return None;
#
# 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();
return;
@@ -1,156 +0,0 @@
#
# $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
#
# 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.1 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
import string
import re
import gtk
import gnome.ui
import bindings
import keyval_util
class BindingEditor:
# the properties instance for which we're editing bindings
props = None;
# our bindings set
bindings = None;
# the binding editor panel
bindPanel = None;
# the grab window
grabWindow = None;
# the iterator for the binding we're editing
iterator = None;
# the binding we're editing
binding = None;
# the key entry field
keyField = None;
# the name entry field
nameField = None;
# the argument type selector
argTypeSel = None;
# the URL menu item of the arg selection widget
urlItem = None;
# the argument entry field
argField = None;
def __init__ (self, xmlui, props):
# keep these around for later
self.props = props;
# get a reference to some widgets
self.bindPanel = xmlui.get_widget("binding");
self.grabWindow = xmlui.get_widget("grab");
self.keyField = xmlui.get_widget("key");
self.nameField = xmlui.get_widget("name");
self.argTypeSel = xmlui.get_widget("type");
self.urlItem = self.argTypeSel.get_menu().get_active();
self.argField = xmlui.get_widget("argument");
# wire up our handlers
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, iterator, binding):
self.iterator = iterator;
self.binding = binding;
self.populateAndShow(self.binding);
#
# Instructs the binding panel to create a blank binding and make that
# available for editing by the user.
#
def createBinding (self):
self.iterator = None;
# create a blank binding and edit it
self.binding = bindings.Binding("", bindings.Binding.URL, "", "");
self.populateAndShow(self.binding);
#
# A helper function used to populate our widgets and show the dialog.
#
def populateAndShow (self, binding):
# populate our widgets with the binding values
self.keyField.set_text(binding.key);
self.nameField.set_text(binding.name);
self.argTypeSel.set_history(binding.type);
self.argField.set_text(binding.argument);
# and show the bind dialog
self.bindPanel.show();
#
# A callback, called when the OK button is clicked.
#
def on_ok_clicked (self, button):
# figure out which type menu item is selected; what a hack
active = self.argTypeSel.get_menu().get_active();
if (active == self.urlItem):
type = bindings.Binding.URL;
else:
type = bindings.Binding.EXEC;
# repopulate our binding
modified = self.binding.update(self.keyField.get_text(), type,
self.nameField.get_text(),
self.argField.get_text());
# let the props panel know if there were any modifications
if (modified):
if (self.iterator == None):
self.props.created(self.binding);
else:
self.props.updated(self.iterator, self.binding);
# hide the binding panel
self.bindPanel.hide();
#
# A callback, called when the cancel button is clicked.
#
def on_cancel_clicked (self, button):
# hide the binding panel
self.bindPanel.hide();
def on_key_key_press_event (self, textfield, event):
# ignore plain or shifted keystrokes
if (event.state > 1):
# convert the key press into a string
keystr = keyval_util.convert_keyval_state_to_string(
event.keyval, event.state);
textfield.set_text(keystr);
return gtk.TRUE;
return gtk.FALSE;
-90
View File
@@ -1,90 +0,0 @@
#
# $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
#
# 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.1 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
import gconf
class History:
"Used to persistently maintain a history of entries for the \
lookuplet query text field."
# the maximum history size
HISTORY_SIZE = 10;
# the actual history entries
history = [];
#
# Loads up the history from persistent preferences and prepares for
# 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();
return;
#
# Adds an entry to the history.
#
def append (self, entry):
# if this entry is already in the history list, we simply want to
# move it to the end
if (entry in self.history):
self.history.remove(entry);
# add our entry
self.history.append(entry);
# trim the history if it's too big
if (len(self.history) > self.HISTORY_SIZE):
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();
#
# Scans back from one before the specified index looking for a history
# entry that matches the specified prefix, returning its index if one
# is found or -1 if one is not.
#
def match (self, prefix, index):
count = len(self.history);
for offset in range(1, count+1):
# do some funny math to always ensure a positive value
pos = (index - offset + count) % count;
# print "scanning %s for %s." % (self.history[pos], prefix);
if (self.history[pos].find(prefix) == 0):
# print "found it at %d." % pos;
return pos;
# print "didn't find it.";
return -1;
@@ -1,62 +0,0 @@
#
# $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
#
# 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.1 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
import string
import gtk
import gtk.gdk
# these are used when doing our conversion; we specifically only care
# 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" ];
#
# Converts a (keyval, state) pair to a human readable string.
#
def convert_keyval_state_to_string (keyval, state):
# bail if we've got an invalid kesym
if (keyval == 0):
return "None";
# start with the empty string
modstr = "";
# 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):
return "None";
key = string.lower(chr(keyval));
# we have to handle the modifiers ourselves
i = 0;
for code in _CODES:
if (state & code):
modstr += _NAMES[i];
modstr += "-";
i += 1;
return modstr + key;
-71
View File
@@ -1,71 +0,0 @@
#!/usr/bin/env python
#
# $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
#
# 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.1 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
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);
basedir = re.sub("/bin$", "", basedir);
libdir = basedir + "/share/lookuplet";
# add our library directory to the system path
sys.path.append(libdir);
import bindings
import lookuplet
import properties
# load up our glade UI definition
try:
os.stat(basedir + "/lookuplet.glade");
xmlui = gtk.glade.XML(basedir + "/lookuplet.glade");
except OSError:
os.stat(libdir + "/lookuplet.glade");
xmlui = gtk.glade.XML(libdir + "/lookuplet.glade");
# load up our bindings
bindings = bindings.BindingSet();
# figure out if we're an applet or not
appletMode = 0;
for arg in sys.argv:
if (arg.find("activate-goad-server") != -1):
appletMode = 1
# create our properties manager
props = properties.Properties(xmlui, bindings);
# create our primary user interface
lookuplet = lookuplet.Lookuplet(xmlui, bindings, props, appletMode);
# let GTK do its business
gtk.mainloop();
-272
View File
@@ -1,272 +0,0 @@
#
# $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
#
# 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.1 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
import string
import re
import gnome.applet
import gtk
import gtk.keysyms
import gnome.ui
import bindings
import history
import keyval_util
import properties
class Lookuplet:
"Handles the primary setup and operation of the lookuplet application."
# our special key definitions
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;
# our about box
about = None;
# a reference to the properties manager
props = None;
# whether or not we're running as a Gnome applet
appletMode = 0;
# our query box history
history = None;
# where we are if we're scanning the history
hisidx = -1;
# the prefix we're using to match if we're matching on a prefix
hispref = None;
def __init__ (self, xmlui, bindings, props, appletMode):
window = xmlui.get_widget("lookuplet");
self.about = xmlui.get_widget("about");
self.bindings = bindings;
self.props = props;
self.appletMode = appletMode;
# wire up our handlers
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();
# if we're in applet mode, extract the UI and stick it into an
# applet widget
if (appletMode):
applet = gnome.applet.AppletWidget("lookuplet");
mainbox = xmlui.get_widget("mainbox");
# lose the border
mainbox.set_border_width(0);
# and hide the prefs button
prefs = xmlui.get_widget("prefs");
prefs.hide();
# remove everything from the window
window.remove(mainbox);
# and add it to the applet
applet.add(mainbox);
# register our menu items
applet.register_stock_callback(
"properties", gnome.ui.STOCK_MENU_PROP,
"Properties...", self.on_props_selected, None);
applet.register_stock_callback(
"about", gnome.ui.STOCK_MENU_ABOUT,
"About...", self.on_about_selected, None);
applet.show();
else:
window.show();
# 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");
# self.display_selection(self, query, selection);
# query.paste_clipboard();
# put the focus in the query box
query.grab_focus();
def on_props_selected (self, one, two):
self.props.editProperties();
def on_about_selected (self, one, two):
self.about.show();
def on_prefs_clicked (self, button):
self.props.editProperties();
def handle_special_keys (self, query, event):
# we'll need this later
count = len(self.history.history);
# handle special keystrokes such as history and auto-complete
if (event.keyval == self.NEXT_HISTORY_KEY):
if (self.hisidx >= 0 and self.hisidx < count):
self.hisidx += 1;
else:
return gtk.TRUE;
elif (event.keyval == self.PREV_HISTORY_KEY):
if (self.hisidx > 0):
self.hisidx -= 1;
elif (self.hisidx == -1):
# if we haven't grabbed a prefix as of yet, grab what we've got
if (self.hispref == None):
self.hispref = query.get_text();
# print "set prefix: %s" % self.hispref;
self.hisidx = count-1;
else:
return gtk.TRUE;
elif (event.keyval == self.AUTO_COMPLETE_KEY):
# if we haven't grabbed a prefix as of yet, grab what we've got
if (self.hispref == None):
self.hispref = query.get_text();
# print "set prefix: %s" % self.hispref;
# if our history prefix has not yet been set, set it and start
# scanning through the history
if (self.hisidx == -1):
self.hisidx = count;
self.hisidx = self.history.match(self.hispref, self.hisidx);
else:
return gtk.FALSE;
# if we found something scrolling or autocompleting, show it
if (self.hisidx > -1 and self.hisidx < count):
# print "displaying history entry %d." % self.hisidx;
text = self.history.history[self.hisidx];
self.set_query(query, text);
return gtk.TRUE;
# otherwise go back to whatever we were editing
if (self.hispref != None):
# print "restoring prefix %s" % self.hispref;
self.set_query(query, self.hispref);
# we always want to claim to have handled the keypress if it was
# the autocomplete key, otherwise GTK will move the focus from our
# query box widget
if (event.keyval == self.AUTO_COMPLETE_KEY):
return gtk.TRUE
else:
return gtk.FALSE;
def set_query (self, query, text):
# display text in the query box and select it for easy erasal
query.set_text(text);
query.select_region(0, len(text));
def on_query_key_press_event (self, query, event):
# handle history browsing and auto-completion
if (self.handle_special_keys(query, event) == gtk.TRUE):
return gtk.TRUE;
# clear out our history prefix because it's in the text field now
# and we'll grab it again if we need it
self.hispref = None;
self.hisidx = -1;
# if they pressed return, map that to a special binding
if (event.keyval == gtk.keysyms.Return):
binding = bindings.Binding("", bindings.Binding.URL, "", "%T");
else:
# ignore plain or shifted keystrokes
if (event.state <= 1):
return gtk.FALSE;
# convert the key press into a string
keystr = keyval_util.convert_keyval_state_to_string(
event.keyval, event.state);
# look up a binding for that key string
binding = self.bindings.get_match(keystr);
# if we found one, invoke it
if (binding != None):
text = query.get_text();
binding.invoke(text);
# append this entry to our history
self.history.append(text);
# and either bail or get ready for the next go
if (self.appletMode):
query.set_text("");
else:
gtk.mainquit();
return gtk.TRUE;
else:
# otherwise, let GTK know that we didn't handle the key press
return gtk.FALSE;
def url_p (self, text):
return (re.match("^http:", text) or
re.match("^ftp:", text) or
re.match("^https:", text) or
re.match("^file:", text));
def on_query_selection_received (self, query, selection_data, data):
if (selection_data.length < 0):
# print "Selection retrieval failed.";
return;
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;
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(text);
# compress whitespace (and convert newlines to spaces)
text = re.sub("[ \r\n]+", " ", text);
# make sure some selection was provided
if (len(text) > 0):
# check to see if we're looking at a url here
is_url = self.url_p(text);
# if this is a URL, we want to eat whitespace
if (is_url):
text = re.sub(" ", "", text);
if (cmp(text, selection_data.data)):
# print "Setting trimmed text '" + text + "'.";
query.set_text(text);
query.select_region(0, len(text));
# print "Selected from %d to %d." % (0, len(text));
return;
def exit_lookuplet (self, button):
gtk.mainquit();
-160
View File
@@ -1,160 +0,0 @@
#
# $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
#
# 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.1 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
import string
import re
import gobject
import gtk
import gtk.gdk
import gnome.ui
import edit_binding
class Properties:
# our configured key bindings
bindings = None;
# the properties panel
propsPanel = None;
# our binding editor
bindEditor = None;
# the bindings model
bindModel = None;
# the edit button
editButton = None;
# the delete button
deleteButton = None;
# the selected binding index
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);
# get a reference to some widgets
self.propsPanel = xmlui.get_widget("properties");
self.editButton = xmlui.get_widget("edit");
self.deleteButton = xmlui.get_widget("delete");
# make our props panel not destroy itself on close
self.propsPanel.close_hides(gtk.TRUE);
# wire up our handlers
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:
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, iter, binding):
# refresh the display for the specified index
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();
def created (self, binding):
# add the new binding to our list
self.bindings.bindings.append(binding);
# add it to the display
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_add_clicked (self, button):
# show the binding creation dialog
self.bindEditor.createBinding();
return;
def on_edit_clicked (self, button):
# tell the binding editor to edit this binding
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.bindModel.get_value(self.selection, 2);
self.bindModel.remove(self.selection)
self.bindings.bindings.remove(binding);
self.selection = None;
self.propsPanel.changed();
return;