Added old abandoned KDE3 version of Konversation
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/konversation@1092922 283d02a7-25f6-0310-bc7c-ecb5cbfe19dav3.5.13-sru
commit
ee0d2e6e19
@ -0,0 +1,7 @@
|
||||
Dario Abatianni <eisfuchs@tigress.com>
|
||||
Peter Simonsson <psn@linux.se>
|
||||
Eike Hein <hein@kde.org>
|
||||
Shintaro Matsuoka <shin@shoegazed.org>
|
||||
Eli MacKenzie <argonel@gmail.com>
|
||||
İsmail Dönmez <ismail@kde.org.tr>
|
||||
John Tapsell <johnflux@gmail.com>
|
@ -0,0 +1,397 @@
|
||||
GNU Free Documentation License
|
||||
Version 1.2, November 2002
|
||||
|
||||
|
||||
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
0. PREAMBLE
|
||||
|
||||
The purpose of this License is to make a manual, textbook, or other
|
||||
functional and useful document "free" in the sense of freedom: to
|
||||
assure everyone the effective freedom to copy and redistribute it,
|
||||
with or without modifying it, either commercially or noncommercially.
|
||||
Secondarily, this License preserves for the author and publisher a way
|
||||
to get credit for their work, while not being considered responsible
|
||||
for modifications made by others.
|
||||
|
||||
This License is a kind of "copyleft", which means that derivative
|
||||
works of the document must themselves be free in the same sense. It
|
||||
complements the GNU General Public License, which is a copyleft
|
||||
license designed for free software.
|
||||
|
||||
We have designed this License in order to use it for manuals for free
|
||||
software, because free software needs free documentation: a free
|
||||
program should come with manuals providing the same freedoms that the
|
||||
software does. But this License is not limited to software manuals;
|
||||
it can be used for any textual work, regardless of subject matter or
|
||||
whether it is published as a printed book. We recommend this License
|
||||
principally for works whose purpose is instruction or reference.
|
||||
|
||||
|
||||
1. APPLICABILITY AND DEFINITIONS
|
||||
|
||||
This License applies to any manual or other work, in any medium, that
|
||||
contains a notice placed by the copyright holder saying it can be
|
||||
distributed under the terms of this License. Such a notice grants a
|
||||
world-wide, royalty-free license, unlimited in duration, to use that
|
||||
work under the conditions stated herein. The "Document", below,
|
||||
refers to any such manual or work. Any member of the public is a
|
||||
licensee, and is addressed as "you". You accept the license if you
|
||||
copy, modify or distribute the work in a way requiring permission
|
||||
under copyright law.
|
||||
|
||||
A "Modified Version" of the Document means any work containing the
|
||||
Document or a portion of it, either copied verbatim, or with
|
||||
modifications and/or translated into another language.
|
||||
|
||||
A "Secondary Section" is a named appendix or a front-matter section of
|
||||
the Document that deals exclusively with the relationship of the
|
||||
publishers or authors of the Document to the Document's overall subject
|
||||
(or to related matters) and contains nothing that could fall directly
|
||||
within that overall subject. (Thus, if the Document is in part a
|
||||
textbook of mathematics, a Secondary Section may not explain any
|
||||
mathematics.) The relationship could be a matter of historical
|
||||
connection with the subject or with related matters, or of legal,
|
||||
commercial, philosophical, ethical or political position regarding
|
||||
them.
|
||||
|
||||
The "Invariant Sections" are certain Secondary Sections whose titles
|
||||
are designated, as being those of Invariant Sections, in the notice
|
||||
that says that the Document is released under this License. If a
|
||||
section does not fit the above definition of Secondary then it is not
|
||||
allowed to be designated as Invariant. The Document may contain zero
|
||||
Invariant Sections. If the Document does not identify any Invariant
|
||||
Sections then there are none.
|
||||
|
||||
The "Cover Texts" are certain short passages of text that are listed,
|
||||
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
|
||||
the Document is released under this License. A Front-Cover Text may
|
||||
be at most 5 words, and a Back-Cover Text may be at most 25 words.
|
||||
|
||||
A "Transparent" copy of the Document means a machine-readable copy,
|
||||
represented in a format whose specification is available to the
|
||||
general public, that is suitable for revising the document
|
||||
straightforwardly with generic text editors or (for images composed of
|
||||
pixels) generic paint programs or (for drawings) some widely available
|
||||
drawing editor, and that is suitable for input to text formatters or
|
||||
for automatic translation to a variety of formats suitable for input
|
||||
to text formatters. A copy made in an otherwise Transparent file
|
||||
format whose markup, or absence of markup, has been arranged to thwart
|
||||
or discourage subsequent modification by readers is not Transparent.
|
||||
An image format is not Transparent if used for any substantial amount
|
||||
of text. A copy that is not "Transparent" is called "Opaque".
|
||||
|
||||
Examples of suitable formats for Transparent copies include plain
|
||||
ASCII without markup, Texinfo input format, LaTeX input format, SGML
|
||||
or XML using a publicly available DTD, and standard-conforming simple
|
||||
HTML, PostScript or PDF designed for human modification. Examples of
|
||||
transparent image formats include PNG, XCF and JPG. Opaque formats
|
||||
include proprietary formats that can be read and edited only by
|
||||
proprietary word processors, SGML or XML for which the DTD and/or
|
||||
processing tools are not generally available, and the
|
||||
machine-generated HTML, PostScript or PDF produced by some word
|
||||
processors for output purposes only.
|
||||
|
||||
The "Title Page" means, for a printed book, the title page itself,
|
||||
plus such following pages as are needed to hold, legibly, the material
|
||||
this License requires to appear in the title page. For works in
|
||||
formats which do not have any title page as such, "Title Page" means
|
||||
the text near the most prominent appearance of the work's title,
|
||||
preceding the beginning of the body of the text.
|
||||
|
||||
A section "Entitled XYZ" means a named subunit of the Document whose
|
||||
title either is precisely XYZ or contains XYZ in parentheses following
|
||||
text that translates XYZ in another language. (Here XYZ stands for a
|
||||
specific section name mentioned below, such as "Acknowledgements",
|
||||
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
|
||||
of such a section when you modify the Document means that it remains a
|
||||
section "Entitled XYZ" according to this definition.
|
||||
|
||||
The Document may include Warranty Disclaimers next to the notice which
|
||||
states that this License applies to the Document. These Warranty
|
||||
Disclaimers are considered to be included by reference in this
|
||||
License, but only as regards disclaiming warranties: any other
|
||||
implication that these Warranty Disclaimers may have is void and has
|
||||
no effect on the meaning of this License.
|
||||
|
||||
|
||||
2. VERBATIM COPYING
|
||||
|
||||
You may copy and distribute the Document in any medium, either
|
||||
commercially or noncommercially, provided that this License, the
|
||||
copyright notices, and the license notice saying this License applies
|
||||
to the Document are reproduced in all copies, and that you add no other
|
||||
conditions whatsoever to those of this License. You may not use
|
||||
technical measures to obstruct or control the reading or further
|
||||
copying of the copies you make or distribute. However, you may accept
|
||||
compensation in exchange for copies. If you distribute a large enough
|
||||
number of copies you must also follow the conditions in section 3.
|
||||
|
||||
You may also lend copies, under the same conditions stated above, and
|
||||
you may publicly display copies.
|
||||
|
||||
|
||||
3. COPYING IN QUANTITY
|
||||
|
||||
If you publish printed copies (or copies in media that commonly have
|
||||
printed covers) of the Document, numbering more than 100, and the
|
||||
Document's license notice requires Cover Texts, you must enclose the
|
||||
copies in covers that carry, clearly and legibly, all these Cover
|
||||
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
|
||||
the back cover. Both covers must also clearly and legibly identify
|
||||
you as the publisher of these copies. The front cover must present
|
||||
the full title with all words of the title equally prominent and
|
||||
visible. You may add other material on the covers in addition.
|
||||
Copying with changes limited to the covers, as long as they preserve
|
||||
the title of the Document and satisfy these conditions, can be treated
|
||||
as verbatim copying in other respects.
|
||||
|
||||
If the required texts for either cover are too voluminous to fit
|
||||
legibly, you should put the first ones listed (as many as fit
|
||||
reasonably) on the actual cover, and continue the rest onto adjacent
|
||||
pages.
|
||||
|
||||
If you publish or distribute Opaque copies of the Document numbering
|
||||
more than 100, you must either include a machine-readable Transparent
|
||||
copy along with each Opaque copy, or state in or with each Opaque copy
|
||||
a computer-network location from which the general network-using
|
||||
public has access to download using public-standard network protocols
|
||||
a complete Transparent copy of the Document, free of added material.
|
||||
If you use the latter option, you must take reasonably prudent steps,
|
||||
when you begin distribution of Opaque copies in quantity, to ensure
|
||||
that this Transparent copy will remain thus accessible at the stated
|
||||
location until at least one year after the last time you distribute an
|
||||
Opaque copy (directly or through your agents or retailers) of that
|
||||
edition to the public.
|
||||
|
||||
It is requested, but not required, that you contact the authors of the
|
||||
Document well before redistributing any large number of copies, to give
|
||||
them a chance to provide you with an updated version of the Document.
|
||||
|
||||
|
||||
4. MODIFICATIONS
|
||||
|
||||
You may copy and distribute a Modified Version of the Document under
|
||||
the conditions of sections 2 and 3 above, provided that you release
|
||||
the Modified Version under precisely this License, with the Modified
|
||||
Version filling the role of the Document, thus licensing distribution
|
||||
and modification of the Modified Version to whoever possesses a copy
|
||||
of it. In addition, you must do these things in the Modified Version:
|
||||
|
||||
A. Use in the Title Page (and on the covers, if any) a title distinct
|
||||
from that of the Document, and from those of previous versions
|
||||
(which should, if there were any, be listed in the History section
|
||||
of the Document). You may use the same title as a previous version
|
||||
if the original publisher of that version gives permission.
|
||||
B. List on the Title Page, as authors, one or more persons or entities
|
||||
responsible for authorship of the modifications in the Modified
|
||||
Version, together with at least five of the principal authors of the
|
||||
Document (all of its principal authors, if it has fewer than five),
|
||||
unless they release you from this requirement.
|
||||
C. State on the Title page the name of the publisher of the
|
||||
Modified Version, as the publisher.
|
||||
D. Preserve all the copyright notices of the Document.
|
||||
E. Add an appropriate copyright notice for your modifications
|
||||
adjacent to the other copyright notices.
|
||||
F. Include, immediately after the copyright notices, a license notice
|
||||
giving the public permission to use the Modified Version under the
|
||||
terms of this License, in the form shown in the Addendum below.
|
||||
G. Preserve in that license notice the full lists of Invariant Sections
|
||||
and required Cover Texts given in the Document's license notice.
|
||||
H. Include an unaltered copy of this License.
|
||||
I. Preserve the section Entitled "History", Preserve its Title, and add
|
||||
to it an item stating at least the title, year, new authors, and
|
||||
publisher of the Modified Version as given on the Title Page. If
|
||||
there is no section Entitled "History" in the Document, create one
|
||||
stating the title, year, authors, and publisher of the Document as
|
||||
given on its Title Page, then add an item describing the Modified
|
||||
Version as stated in the previous sentence.
|
||||
J. Preserve the network location, if any, given in the Document for
|
||||
public access to a Transparent copy of the Document, and likewise
|
||||
the network locations given in the Document for previous versions
|
||||
it was based on. These may be placed in the "History" section.
|
||||
You may omit a network location for a work that was published at
|
||||
least four years before the Document itself, or if the original
|
||||
publisher of the version it refers to gives permission.
|
||||
K. For any section Entitled "Acknowledgements" or "Dedications",
|
||||
Preserve the Title of the section, and preserve in the section all
|
||||
the substance and tone of each of the contributor acknowledgements
|
||||
and/or dedications given therein.
|
||||
L. Preserve all the Invariant Sections of the Document,
|
||||
unaltered in their text and in their titles. Section numbers
|
||||
or the equivalent are not considered part of the section titles.
|
||||
M. Delete any section Entitled "Endorsements". Such a section
|
||||
may not be included in the Modified Version.
|
||||
N. Do not retitle any existing section to be Entitled "Endorsements"
|
||||
or to conflict in title with any Invariant Section.
|
||||
O. Preserve any Warranty Disclaimers.
|
||||
|
||||
If the Modified Version includes new front-matter sections or
|
||||
appendices that qualify as Secondary Sections and contain no material
|
||||
copied from the Document, you may at your option designate some or all
|
||||
of these sections as invariant. To do this, add their titles to the
|
||||
list of Invariant Sections in the Modified Version's license notice.
|
||||
These titles must be distinct from any other section titles.
|
||||
|
||||
You may add a section Entitled "Endorsements", provided it contains
|
||||
nothing but endorsements of your Modified Version by various
|
||||
parties--for example, statements of peer review or that the text has
|
||||
been approved by an organization as the authoritative definition of a
|
||||
standard.
|
||||
|
||||
You may add a passage of up to five words as a Front-Cover Text, and a
|
||||
passage of up to 25 words as a Back-Cover Text, to the end of the list
|
||||
of Cover Texts in the Modified Version. Only one passage of
|
||||
Front-Cover Text and one of Back-Cover Text may be added by (or
|
||||
through arrangements made by) any one entity. If the Document already
|
||||
includes a cover text for the same cover, previously added by you or
|
||||
by arrangement made by the same entity you are acting on behalf of,
|
||||
you may not add another; but you may replace the old one, on explicit
|
||||
permission from the previous publisher that added the old one.
|
||||
|
||||
The author(s) and publisher(s) of the Document do not by this License
|
||||
give permission to use their names for publicity for or to assert or
|
||||
imply endorsement of any Modified Version.
|
||||
|
||||
|
||||
5. COMBINING DOCUMENTS
|
||||
|
||||
You may combine the Document with other documents released under this
|
||||
License, under the terms defined in section 4 above for modified
|
||||
versions, provided that you include in the combination all of the
|
||||
Invariant Sections of all of the original documents, unmodified, and
|
||||
list them all as Invariant Sections of your combined work in its
|
||||
license notice, and that you preserve all their Warranty Disclaimers.
|
||||
|
||||
The combined work need only contain one copy of this License, and
|
||||
multiple identical Invariant Sections may be replaced with a single
|
||||
copy. If there are multiple Invariant Sections with the same name but
|
||||
different contents, make the title of each such section unique by
|
||||
adding at the end of it, in parentheses, the name of the original
|
||||
author or publisher of that section if known, or else a unique number.
|
||||
Make the same adjustment to the section titles in the list of
|
||||
Invariant Sections in the license notice of the combined work.
|
||||
|
||||
In the combination, you must combine any sections Entitled "History"
|
||||
in the various original documents, forming one section Entitled
|
||||
"History"; likewise combine any sections Entitled "Acknowledgements",
|
||||
and any sections Entitled "Dedications". You must delete all sections
|
||||
Entitled "Endorsements".
|
||||
|
||||
|
||||
6. COLLECTIONS OF DOCUMENTS
|
||||
|
||||
You may make a collection consisting of the Document and other documents
|
||||
released under this License, and replace the individual copies of this
|
||||
License in the various documents with a single copy that is included in
|
||||
the collection, provided that you follow the rules of this License for
|
||||
verbatim copying of each of the documents in all other respects.
|
||||
|
||||
You may extract a single document from such a collection, and distribute
|
||||
it individually under this License, provided you insert a copy of this
|
||||
License into the extracted document, and follow this License in all
|
||||
other respects regarding verbatim copying of that document.
|
||||
|
||||
|
||||
7. AGGREGATION WITH INDEPENDENT WORKS
|
||||
|
||||
A compilation of the Document or its derivatives with other separate
|
||||
and independent documents or works, in or on a volume of a storage or
|
||||
distribution medium, is called an "aggregate" if the copyright
|
||||
resulting from the compilation is not used to limit the legal rights
|
||||
of the compilation's users beyond what the individual works permit.
|
||||
When the Document is included in an aggregate, this License does not
|
||||
apply to the other works in the aggregate which are not themselves
|
||||
derivative works of the Document.
|
||||
|
||||
If the Cover Text requirement of section 3 is applicable to these
|
||||
copies of the Document, then if the Document is less than one half of
|
||||
the entire aggregate, the Document's Cover Texts may be placed on
|
||||
covers that bracket the Document within the aggregate, or the
|
||||
electronic equivalent of covers if the Document is in electronic form.
|
||||
Otherwise they must appear on printed covers that bracket the whole
|
||||
aggregate.
|
||||
|
||||
|
||||
8. TRANSLATION
|
||||
|
||||
Translation is considered a kind of modification, so you may
|
||||
distribute translations of the Document under the terms of section 4.
|
||||
Replacing Invariant Sections with translations requires special
|
||||
permission from their copyright holders, but you may include
|
||||
translations of some or all Invariant Sections in addition to the
|
||||
original versions of these Invariant Sections. You may include a
|
||||
translation of this License, and all the license notices in the
|
||||
Document, and any Warranty Disclaimers, provided that you also include
|
||||
the original English version of this License and the original versions
|
||||
of those notices and disclaimers. In case of a disagreement between
|
||||
the translation and the original version of this License or a notice
|
||||
or disclaimer, the original version will prevail.
|
||||
|
||||
If a section in the Document is Entitled "Acknowledgements",
|
||||
"Dedications", or "History", the requirement (section 4) to Preserve
|
||||
its Title (section 1) will typically require changing the actual
|
||||
title.
|
||||
|
||||
|
||||
9. TERMINATION
|
||||
|
||||
You may not copy, modify, sublicense, or distribute the Document except
|
||||
as expressly provided for under this License. Any other attempt to
|
||||
copy, modify, sublicense or distribute the Document 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.
|
||||
|
||||
|
||||
10. FUTURE REVISIONS OF THIS LICENSE
|
||||
|
||||
The Free Software Foundation may publish new, revised versions
|
||||
of the GNU Free Documentation 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. See
|
||||
http://www.gnu.org/copyleft/.
|
||||
|
||||
Each version of the License is given a distinguishing version number.
|
||||
If the Document specifies that a particular numbered version of this
|
||||
License "or any later version" applies to it, you have the option of
|
||||
following the terms and conditions either of that specified version or
|
||||
of any later version that has been published (not as a draft) by the
|
||||
Free Software Foundation. If the Document does not specify a version
|
||||
number of this License, you may choose any version ever published (not
|
||||
as a draft) by the Free Software Foundation.
|
||||
|
||||
|
||||
ADDENDUM: How to use this License for your documents
|
||||
|
||||
To use this License in a document you have written, include a copy of
|
||||
the License in the document and put the following copyright and
|
||||
license notices just after the title page:
|
||||
|
||||
Copyright (c) YEAR YOUR NAME.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
A copy of the license is included in the section entitled "GNU
|
||||
Free Documentation License".
|
||||
|
||||
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
|
||||
replace the "with...Texts." line with this:
|
||||
|
||||
with the Invariant Sections being LIST THEIR TITLES, with the
|
||||
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
|
||||
|
||||
If you have Invariant Sections without Cover Texts, or some other
|
||||
combination of the three, merge those two alternatives to suit the
|
||||
situation.
|
||||
|
||||
If your document contains nontrivial examples of program code, we
|
||||
recommend releasing these examples in parallel under your choice of
|
||||
free software license, such as the GNU General Public License,
|
||||
to permit their use in free software.
|
@ -0,0 +1,181 @@
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made.
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
|
@ -0,0 +1,5 @@
|
||||
AUTOMAKE_OPTIONS = foreign 1.6.1
|
||||
|
||||
include admin/deps.am
|
||||
include admin/Doxyfile.am
|
||||
SUBDIRS=$(TOPSUBDIRS)
|
@ -0,0 +1,4 @@
|
||||
AUTOMAKE_OPTIONS = foreign 1.6.1
|
||||
|
||||
include admin/deps.am
|
||||
include admin/Doxyfile.am
|
@ -0,0 +1,4 @@
|
||||
Konversation website: http://konversation.kde.org/
|
||||
Konversation wiki: http://konversation.kde.org/wiki
|
||||
Bug tracker: http://bugs.kde.org/
|
||||
IRC channel: #konversation on irc.freenode.org
|
@ -0,0 +1,3 @@
|
||||
See http://konversation.kde.org/wiki/Developer_Central and the
|
||||
KDE bug tracker (http://bugs.kde.org) for a list of outstanding
|
||||
todo items and discussion of future development.
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,910 @@
|
||||
# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This file 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.
|
||||
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||
m4_if(AC_AUTOCONF_VERSION, [2.61],,
|
||||
[m4_warning([this file was generated for autoconf 2.61.
|
||||
You have another version of autoconf. It may work, but is not guaranteed to.
|
||||
If you have problems, you may need to regenerate the build system entirely.
|
||||
To do so, use the procedure documented by the package, typically `autoreconf'.])])
|
||||
|
||||
# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# AM_AUTOMAKE_VERSION(VERSION)
|
||||
# ----------------------------
|
||||
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
||||
# generated from the m4 files accompanying Automake X.Y.
|
||||
# (This private macro should not be called outside this file.)
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION],
|
||||
[am__api_version='1.10'
|
||||
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
||||
dnl require some minimum version. Point them to the right macro.
|
||||
m4_if([$1], [1.10.1], [],
|
||||
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
||||
])
|
||||
|
||||
# _AM_AUTOCONF_VERSION(VERSION)
|
||||
# -----------------------------
|
||||
# aclocal traces this macro to find the Autoconf version.
|
||||
# This is a private macro too. Using m4_define simplifies
|
||||
# the logic in aclocal, which can simply ignore this definition.
|
||||
m4_define([_AM_AUTOCONF_VERSION], [])
|
||||
|
||||
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
||||
# -------------------------------
|
||||
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.10.1])dnl
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||
_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
||||
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
||||
#
|
||||
# Of course, Automake must honor this variable whenever it calls a
|
||||
# tool from the auxiliary directory. The problem is that $srcdir (and
|
||||
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
||||
# depending on how configure is run. This is pretty annoying, since
|
||||
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
||||
# source directory, any form will work fine, but in subdirectories a
|
||||
# relative path needs to be adjusted first.
|
||||
#
|
||||
# $ac_aux_dir/missing
|
||||
# fails when called from a subdirectory if $ac_aux_dir is relative
|
||||
# $top_srcdir/$ac_aux_dir/missing
|
||||
# fails if $ac_aux_dir is absolute,
|
||||
# fails when called from a subdirectory in a VPATH build with
|
||||
# a relative $ac_aux_dir
|
||||
#
|
||||
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
||||
# are both prefixed by $srcdir. In an in-source build this is usually
|
||||
# harmless because $srcdir is `.', but things will broke when you
|
||||
# start a VPATH build or use an absolute $srcdir.
|
||||
#
|
||||
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
||||
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
||||
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
||||
# and then we would define $MISSING as
|
||||
# MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# This will work as long as MISSING is not called from configure, because
|
||||
# unfortunately $(top_srcdir) has no meaning in configure.
|
||||
# However there are other variables, like CC, which are often used in
|
||||
# configure, and could therefore not use this "fixed" $ac_aux_dir.
|
||||
#
|
||||
# Another solution, used here, is to always expand $ac_aux_dir to an
|
||||
# absolute PATH. The drawback is that using absolute paths prevent a
|
||||
# configured tree to be moved without reconfiguration.
|
||||
|
||||
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||
[dnl Rely on autoconf to set up CDPATH properly.
|
||||
AC_PREREQ([2.50])dnl
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
])
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||
# -------------------------------------
|
||||
# Define a conditional.
|
||||
AC_DEFUN([AM_CONDITIONAL],
|
||||
[AC_PREREQ(2.52)dnl
|
||||
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
||||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
||||
AC_SUBST([$1_TRUE])dnl
|
||||
AC_SUBST([$1_FALSE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi
|
||||
AC_CONFIG_COMMANDS_PRE(
|
||||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
||||
AC_MSG_ERROR([[conditional "$1" was never defined.
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 9
|
||||
|
||||
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
||||
# written in clear, in which case automake, when reading aclocal.m4,
|
||||
# will think it sees a *use*, and therefore will trigger all it's
|
||||
# C support machinery. Also note that it means that autoscan, seeing
|
||||
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
||||
|
||||
|
||||
# _AM_DEPENDENCIES(NAME)
|
||||
# ----------------------
|
||||
# See how the compiler implements dependency checking.
|
||||
# NAME is "CC", "CXX", "GCJ", or "OBJC".
|
||||
# We try a few techniques and use that to set a single cache variable.
|
||||
#
|
||||
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
|
||||
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
|
||||
# dependency, and given that the user is not expected to run this macro,
|
||||
# just rely on AC_PROG_CC.
|
||||
AC_DEFUN([_AM_DEPENDENCIES],
|
||||
[AC_REQUIRE([AM_SET_DEPDIR])dnl
|
||||
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
||||
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
||||
AC_REQUIRE([AM_DEP_TRACK])dnl
|
||||
|
||||
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
||||
[$1], CXX, [depcc="$CXX" am_compiler_list=],
|
||||
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
|
||||
[$1], UPC, [depcc="$UPC" am_compiler_list=],
|
||||
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
|
||||
[depcc="$$1" am_compiler_list=])
|
||||
|
||||
AC_CACHE_CHECK([dependency style of $depcc],
|
||||
[am_cv_$1_dependencies_compiler_type],
|
||||
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
||||
# We make a subdir and do the tests there. Otherwise we can end up
|
||||
# making bogus files that we don't know about and never remove. For
|
||||
# instance it was reported that on HP-UX the gcc test will end up
|
||||
# making a dummy file named `D' -- because `-MD' means `put the output
|
||||
# in D'.
|
||||
mkdir conftest.dir
|
||||
# Copy depcomp to subdir because otherwise we won't find it if we're
|
||||
# using a relative directory.
|
||||
cp "$am_depcomp" conftest.dir
|
||||
cd conftest.dir
|
||||
# We will build objects and dependencies in a subdirectory because
|
||||
# it helps to detect inapplicable dependency modes. For instance
|
||||
# both Tru64's cc and ICC support -MD to output dependencies as a
|
||||
# side effect of compilation, but ICC will put the dependencies in
|
||||
# the current directory while Tru64 will put them in the object
|
||||
# directory.
|
||||
mkdir sub
|
||||
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
if test "$am_compiler_list" = ""; then
|
||||
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
||||
fi
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
||||
# Solaris 8's {/usr,}/bin/sh.
|
||||
touch sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
# after this tag, mechanisms are not by side-effect, so they'll
|
||||
# only be used when explicitly requested
|
||||
if test "x$enable_dependency_tracking" = xyes; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
none) break ;;
|
||||
esac
|
||||
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
cd ..
|
||||
rm -rf conftest.dir
|
||||
else
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
fi
|
||||
])
|
||||
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
|
||||
AM_CONDITIONAL([am__fastdep$1], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
|
||||
])
|
||||
|
||||
|
||||
# AM_SET_DEPDIR
|
||||
# -------------
|
||||
# Choose a directory name for dependency files.
|
||||
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
||||
AC_DEFUN([AM_SET_DEPDIR],
|
||||
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
||||
])
|
||||
|
||||
|
||||
# AM_DEP_TRACK
|
||||
# ------------
|
||||
AC_DEFUN([AM_DEP_TRACK],
|
||||
[AC_ARG_ENABLE(dependency-tracking,
|
||||
[ --disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors])
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
am_depcomp="$ac_aux_dir/depcomp"
|
||||
AMDEPBACKSLASH='\'
|
||||
fi
|
||||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
AC_SUBST([AMDEPBACKSLASH])dnl
|
||||
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
|
||||
])
|
||||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
#serial 3
|
||||
|
||||
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[for mf in $CONFIG_FILES; do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named `Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# Grep'ing the whole file is not good either: AIX grep has a line
|
||||
# limit of 2048, but all sed's we know have understand at least 4000.
|
||||
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
|
||||
dirpart=`AS_DIRNAME("$mf")`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running `make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# When using ansi2knr, U may be empty or an underscore; expand it
|
||||
U=`sed -n 's/^U = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`AS_DIRNAME(["$file"])`
|
||||
AS_MKDIR_P([$dirpart/$fdir])
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
done
|
||||
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
|
||||
|
||||
# AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# -----------------------------
|
||||
# This macro should only be invoked once -- use via AC_REQUIRE.
|
||||
#
|
||||
# This code is only required when automatic dependency tracking
|
||||
# is enabled. FIXME. This creates each `.P' file that we will
|
||||
# need in order to bootstrap the dependency handling code.
|
||||
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AC_CONFIG_COMMANDS([depfiles],
|
||||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||
])
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
|
||||
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005, 2006, 2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 13
|
||||
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||
# -----------------------------------------------
|
||||
# The call with PACKAGE and VERSION arguments is the old style
|
||||
# call (pre autoconf-2.50), which is being phased out. PACKAGE
|
||||
# and VERSION should now be passed to AC_INIT and removed from
|
||||
# the call to AM_INIT_AUTOMAKE.
|
||||
# We support both call styles for the transition. After
|
||||
# the next Automake release, Autoconf can make the AC_INIT
|
||||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.60])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`"; then
|
||||
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
|
||||
# is not polluted with repeated "-I."
|
||||
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
|
||||
# test to see if srcdir already configured
|
||||
if test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
fi
|
||||
|
||||
# test whether we have cygpath
|
||||
if test -z "$CYGPATH_W"; then
|
||||
if (cygpath --version) >/dev/null 2>/dev/null; then
|
||||
CYGPATH_W='cygpath -w'
|
||||
else
|
||||
CYGPATH_W=echo
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([CYGPATH_W])
|
||||
|
||||
# Define the identity of the package.
|
||||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
[_AM_SET_OPTIONS([$1])dnl
|
||||
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
|
||||
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
|
||||
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
|
||||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
||||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
||||
|
||||
_AM_IF_OPTION([no-define],,
|
||||
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
|
||||
|
||||
# Some tools Automake needs.
|
||||
AC_REQUIRE([AM_SANITY_CHECK])dnl
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo)
|
||||
AM_PROG_INSTALL_SH
|
||||
AM_PROG_INSTALL_STRIP
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
||||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
|
||||
[_AM_DEPENDENCIES(OBJC)],
|
||||
[define([AC_PROG_OBJC],
|
||||
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp files are numbered to have different names.
|
||||
|
||||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[# Compute $1's index in $config_headers.
|
||||
_am_arg=$1
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$_am_arg | $_am_arg:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# AM_PROG_INSTALL_SH
|
||||
# ------------------
|
||||
# Define $install_sh.
|
||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
|
||||
AC_SUBST(install_sh)])
|
||||
|
||||
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 2
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
[rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
|
||||
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
|
||||
# From Jim Meyering
|
||||
|
||||
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 4
|
||||
|
||||
AC_DEFUN([AM_MAINTAINER_MODE],
|
||||
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
||||
dnl maintainer-mode is disabled by default
|
||||
AC_ARG_ENABLE(maintainer-mode,
|
||||
[ --enable-maintainer-mode enable make rules and dependencies not useful
|
||||
(and sometimes confusing) to the casual installer],
|
||||
USE_MAINTAINER_MODE=$enableval,
|
||||
USE_MAINTAINER_MODE=no)
|
||||
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
|
||||
AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
|
||||
MAINT=$MAINTAINER_MODE_TRUE
|
||||
AC_SUBST(MAINT)dnl
|
||||
]
|
||||
)
|
||||
|
||||
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 3
|
||||
|
||||
# AM_MAKE_INCLUDE()
|
||||
# -----------------
|
||||
# Check to see how make treats includes.
|
||||
AC_DEFUN([AM_MAKE_INCLUDE],
|
||||
[am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# We grep out `Entering directory' and `Leaving directory'
|
||||
# messages which can occur if `w' ends up in MAKEFLAGS.
|
||||
# In particular we don't look at `^make:' because GNU make might
|
||||
# be invoked under some other name (usually "gmake"), in which
|
||||
# case it prints its new name instead of `make'.
|
||||
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
fi
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_MISSING_PROG(NAME, PROGRAM)
|
||||
# ------------------------------
|
||||
AC_DEFUN([AM_MISSING_PROG],
|
||||
[AC_REQUIRE([AM_MISSING_HAS_RUN])
|
||||
$1=${$1-"${am_missing_run}$2"}
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# AM_MISSING_HAS_RUN
|
||||
# ------------------
|
||||
# Define MISSING if not defined so far and test if it supports --run.
|
||||
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([missing])dnl
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# AM_PROG_MKDIR_P
|
||||
# ---------------
|
||||
# Check for `mkdir -p'.
|
||||
AC_DEFUN([AM_PROG_MKDIR_P],
|
||||
[AC_PREREQ([2.60])dnl
|
||||
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
|
||||
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
|
||||
dnl while keeping a definition of mkdir_p for backward compatibility.
|
||||
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
|
||||
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
|
||||
dnl Makefile.ins that do not define MKDIR_P, so we do our own
|
||||
dnl adjustment using top_builddir (which is defined more often than
|
||||
dnl MKDIR_P).
|
||||
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
|
||||
case $mkdir_p in
|
||||
[[\\/$]]* | ?:[[\\/]]*) ;;
|
||||
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 3
|
||||
|
||||
# _AM_MANGLE_OPTION(NAME)
|
||||
# -----------------------
|
||||
AC_DEFUN([_AM_MANGLE_OPTION],
|
||||
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
# _AM_SET_OPTION(NAME)
|
||||
# ------------------------------
|
||||
# Set option NAME. Presently that only means defining a flag for this option.
|
||||
AC_DEFUN([_AM_SET_OPTION],
|
||||
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
||||
|
||||
# _AM_SET_OPTIONS(OPTIONS)
|
||||
# ----------------------------------
|
||||
# OPTIONS is a space-separated list of Automake options.
|
||||
AC_DEFUN([_AM_SET_OPTIONS],
|
||||
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
||||
|
||||
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
||||
# -------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_SANITY_CHECK
|
||||
# ---------------
|
||||
AC_DEFUN([AM_SANITY_CHECK],
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftest.file
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
||||
if test "$[*]" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftest.file`
|
||||
fi
|
||||
rm -f conftest.file
|
||||
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "$[2]" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# AM_PROG_INSTALL_STRIP
|
||||
# ---------------------
|
||||
# One issue with vendor `install' (even GNU) is that you can't
|
||||
# specify the program used to strip binaries. This is especially
|
||||
# annoying in cross-compiling environments, where the build's strip
|
||||
# is unlikely to handle the host's binaries.
|
||||
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
||||
# always use install-sh in `make install-strip', and initialize
|
||||
# STRIPPROG with the value of the STRIP variable (set by the user).
|
||||
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
||||
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
||||
if test "$cross_compiling" != no; then
|
||||
AC_CHECK_TOOL([STRIP], [strip], :)
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# _AM_SUBST_NOTMAKE(VARIABLE)
|
||||
# ---------------------------
|
||||
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
|
||||
# This macro is traced by Automake.
|
||||
AC_DEFUN([_AM_SUBST_NOTMAKE])
|
||||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 2
|
||||
|
||||
# _AM_PROG_TAR(FORMAT)
|
||||
# --------------------
|
||||
# Check how to create a tarball in format FORMAT.
|
||||
# FORMAT should be one of `v7', `ustar', or `pax'.
|
||||
#
|
||||
# Substitute a variable $(am__tar) that is a command
|
||||
# writing to stdout a FORMAT-tarball containing the directory
|
||||
# $tardir.
|
||||
# tardir=directory && $(am__tar) > result.tar
|
||||
#
|
||||
# Substitute a variable $(am__untar) that extract such
|
||||
# a tarball read from stdin.
|
||||
# $(am__untar) < result.tar
|
||||
AC_DEFUN([_AM_PROG_TAR],
|
||||
[# Always define AMTAR for backward compatibility.
|
||||
AM_MISSING_PROG([AMTAR], [tar])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of `-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([acinclude.m4])
|
@ -0,0 +1,252 @@
|
||||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
|
||||
#undef HAVE_CARBON_CARBON_H
|
||||
|
||||
/* Define if you have the CoreAudio API */
|
||||
#undef HAVE_COREAUDIO
|
||||
|
||||
/* Define to 1 if you have the <crt_externs.h> header file. */
|
||||
#undef HAVE_CRT_EXTERNS_H
|
||||
|
||||
/* Defines if your system has the crypt function */
|
||||
#undef HAVE_CRYPT
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if you have Kimiface headers */
|
||||
#undef HAVE_KIMIFACE
|
||||
|
||||
/* Define if you have libjpeg */
|
||||
#undef HAVE_LIBJPEG
|
||||
|
||||
/* Define if you have libpng */
|
||||
#undef HAVE_LIBPNG
|
||||
|
||||
/* Define if you have a working libpthread (will enable threaded code) */
|
||||
#undef HAVE_LIBPTHREAD
|
||||
|
||||
/* Define if you have libz */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if your system needs _NSGetEnviron to set up the environment */
|
||||
#undef HAVE_NSGETENVIRON
|
||||
|
||||
/* Define if you have res_init */
|
||||
#undef HAVE_RES_INIT
|
||||
|
||||
/* Define if you have the res_init prototype */
|
||||
#undef HAVE_RES_INIT_PROTO
|
||||
|
||||
/* Define if you have a STL implementation by SGI */
|
||||
#undef HAVE_SGI_STL
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have strlcat */
|
||||
#undef HAVE_STRLCAT
|
||||
|
||||
/* Define if you have the strlcat prototype */
|
||||
#undef HAVE_STRLCAT_PROTO
|
||||
|
||||
/* Define if you have strlcpy */
|
||||
#undef HAVE_STRLCPY
|
||||
|
||||
/* Define if you have the strlcpy prototype */
|
||||
#undef HAVE_STRLCPY_PROTO
|
||||
|
||||
/* Define to 1 if you have the <sys/bitypes.h> header file. */
|
||||
#undef HAVE_SYS_BITYPES_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <tgmath.h> header file. */
|
||||
#undef HAVE_TGMATH_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
/* Define if you have the XScreenSaver extension */
|
||||
#undef HAVE_XSCREENSAVER
|
||||
|
||||
/* Suffix for lib directories */
|
||||
#undef KDELIBSUFF
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* The size of `char *', as computed by sizeof. */
|
||||
#undef SIZEOF_CHAR_P
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#undef SIZEOF_SHORT
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#undef SIZEOF_SIZE_T
|
||||
|
||||
/* The size of `unsigned long', as computed by sizeof. */
|
||||
#undef SIZEOF_UNSIGNED_LONG
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* If we use arts volume */
|
||||
#undef USE_ARTS
|
||||
|
||||
/* Define if you have KNotify */
|
||||
#undef USE_KNOTIFY
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Defined if compiling without arts */
|
||||
#undef WITHOUT_ARTS
|
||||
|
||||
/*
|
||||
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
|
||||
* headers and I'm too lazy to write a configure test as long as only
|
||||
* unixware is related
|
||||
*/
|
||||
#ifdef _UNIXWARE
|
||||
#define HAVE_BOOLEAN
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
|
||||
* that defines bzero.
|
||||
*/
|
||||
|
||||
#if defined(_AIX)
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
|
||||
# include <sys/time.h>
|
||||
# include <crt_externs.h>
|
||||
# define environ (*_NSGetEnviron())
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_RES_INIT_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int res_init(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_STRLCAT_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
unsigned long strlcat(char*, const char*, unsigned long);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_STRLCPY_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
unsigned long strlcpy(char*, const char*, unsigned long);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* On HP-UX, the declaration of vsnprintf() is needed every time !
|
||||
*/
|
||||
|
||||
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int snprintf(char *str, size_t n, char const *fmt, ...);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(__SVR4) && !defined(__svr4__)
|
||||
#define __svr4__ 1
|
||||
#endif
|
||||
|
||||
|
||||
/* type to use in place of socklen_t if not defined */
|
||||
#undef kde_socklen_t
|
||||
|
||||
/* type to use in place of socklen_t if not defined (deprecated, use
|
||||
kde_socklen_t) */
|
||||
#undef ksize_t
|
@ -0,0 +1,3 @@
|
||||
./admin/configure.in.min
|
||||
configure.in.in
|
||||
./konversation/configure.in.in
|
@ -0,0 +1,234 @@
|
||||
dnl =======================================================
|
||||
dnl FILE: ./admin/configure.in.min
|
||||
dnl =======================================================
|
||||
|
||||
dnl This file is part of the KDE libraries/packages
|
||||
dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
|
||||
|
||||
dnl This file is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Library General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2 of the License, or (at your option) any later version.
|
||||
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Library General Public License for more details.
|
||||
|
||||
dnl You should have received a copy of the GNU Library General Public License
|
||||
dnl along with this library; see the file COPYING.LIB. If not, write to
|
||||
dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
dnl Boston, MA 02110-1301, USA.
|
||||
|
||||
# Original Author was Kalle@kde.org
|
||||
# I lifted it in some mater. (Stephan Kulow)
|
||||
# I used much code from Janos Farkas
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT(acinclude.m4) dnl a source file from your sub dir
|
||||
|
||||
dnl This is so we can use kde-common
|
||||
AC_CONFIG_AUX_DIR(admin)
|
||||
|
||||
dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
|
||||
unset CDPATH
|
||||
|
||||
dnl Checking host/target/build systems, for make, install etc.
|
||||
AC_CANONICAL_SYSTEM
|
||||
dnl Perform program name transformation
|
||||
AC_ARG_PROGRAM
|
||||
|
||||
dnl Automake doc recommends to do this only here. (Janos)
|
||||
AM_INIT_AUTOMAKE(konversation-1.1, "3.5.9") dnl searches for some needed programs
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
KDE_SET_PREFIX
|
||||
|
||||
dnl generate the config header
|
||||
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_CHECK_COMPILERS
|
||||
AC_ENABLE_SHARED(yes)
|
||||
AC_ENABLE_STATIC(no)
|
||||
KDE_PROG_LIBTOOL
|
||||
|
||||
dnl for NLS support. Call them in this order!
|
||||
dnl WITH_NLS is for the po files
|
||||
AM_KDE_WITH_NLS
|
||||
|
||||
KDE_USE_QT(3.2)
|
||||
AC_PATH_KDE
|
||||
dnl =======================================================
|
||||
dnl FILE: configure.in.in
|
||||
dnl =======================================================
|
||||
|
||||
#MIN_CONFIG(3.2)
|
||||
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"
|
||||
|
||||
if test "$build_arts" = "yes"; then
|
||||
AC_DEFINE(USE_ARTS, 1, [If we use arts volume])
|
||||
LIB_ARTS="-lartskde"
|
||||
AC_SUBST(LIB_ARTS)
|
||||
fi
|
||||
|
||||
KDE_INIT_DOXYGEN([KEG Network API Reference], [Version $VERSION])
|
||||
|
||||
dnl =======================================================
|
||||
dnl FILE: ./konversation/configure.in.in
|
||||
dnl =======================================================
|
||||
|
||||
#MIN_CONFIG(3.2)
|
||||
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"
|
||||
|
||||
KDE_CHECK_HEADER(knotifyclient.h,
|
||||
[
|
||||
AC_DEFINE(USE_KNOTIFY, 1, [Define if you have KNotify] )
|
||||
])
|
||||
|
||||
|
||||
KDE_CHECK_HEADER(kimiface.h,
|
||||
[
|
||||
AC_DEFINE(HAVE_KIMIFACE, 1, [Define if you have Kimiface headers] )
|
||||
LIB_KIMIFACE="-lkimproxy"
|
||||
AC_SUBST(LIB_KIMIFACE)
|
||||
])
|
||||
|
||||
# Check for XScreenSaver
|
||||
AC_CHECK_HEADERS(tgmath.h)xss_save_ldflags="$LDFLAGS"
|
||||
LDFLAGS="$X_LDFLAGS"
|
||||
|
||||
LIB_XSS=
|
||||
|
||||
KDE_CHECK_HEADER(X11/extensions/scrnsaver.h,
|
||||
[
|
||||
AC_CHECK_LIB(Xext,XScreenSaverQueryInfo,
|
||||
[
|
||||
AC_DEFINE(HAVE_XSCREENSAVER, 1, [Define if you have the XScreenSaver extension])
|
||||
LIB_XSS="-lXext"
|
||||
],
|
||||
[
|
||||
ld_shared_flag=
|
||||
KDE_CHECK_COMPILER_FLAG(shared, [ld_shared_flag="-shared"])
|
||||
AC_CHECK_LIB(Xss,XScreenSaverQueryInfo,
|
||||
[
|
||||
AC_DEFINE(HAVE_XSCREENSAVER, 1, [Define if you have the XScreenSaver extension])
|
||||
LIB_XSS="-lXss"
|
||||
],
|
||||
[],
|
||||
[ $ld_shared_flag $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS ])
|
||||
],
|
||||
[ $X_PRE_LIBS -lX11 $X_EXTRA_LIBS ])
|
||||
], [],
|
||||
[
|
||||
#include <X11/Xlib.h>
|
||||
] )
|
||||
|
||||
AC_SUBST(LIB_XSS)
|
||||
LDFLAGS="$xss_save_ldflags"
|
||||
KDE_CREATE_SUBDIRSLIST
|
||||
AM_CONDITIONAL(doc_SUBDIR_included, test "x$doc_SUBDIR_included" = xyes)
|
||||
AM_CONDITIONAL(konversation_SUBDIR_included, test "x$konversation_SUBDIR_included" = xyes)
|
||||
AM_CONDITIONAL(po_SUBDIR_included, test "x$po_SUBDIR_included" = xyes)
|
||||
AC_CONFIG_FILES([ Makefile ])
|
||||
AC_CONFIG_FILES([ doc/Makefile ])
|
||||
AC_CONFIG_FILES([ doc/da/Makefile ])
|
||||
AC_CONFIG_FILES([ doc/es/Makefile ])
|
||||
AC_CONFIG_FILES([ doc/et/Makefile ])
|
||||
AC_CONFIG_FILES([ doc/it/Makefile ])
|
||||
AC_CONFIG_FILES([ doc/konversation/Makefile ])
|
||||
AC_CONFIG_FILES([ doc/pt/Makefile ])
|
||||
AC_CONFIG_FILES([ doc/ru/Makefile ])
|
||||
AC_CONFIG_FILES([ doc/sv/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/images/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/images/icons/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/images/nickicons/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/images/nickicons/alternative/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/images/nickicons/christmas/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/images/nickicons/classic/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/images/nickicons/default/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/images/nickicons/oxygen/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/images/nickicons/smiling/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/images/nickicons/square/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/scripts/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/src/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/src/blowfish/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/src/config/Makefile ])
|
||||
AC_CONFIG_FILES([ konversation/src/linkaddressbook/Makefile ])
|
||||
AC_CONFIG_FILES([ po/Makefile ])
|
||||
AC_CONFIG_FILES([ po/ar/Makefile ])
|
||||
AC_CONFIG_FILES([ po/bg/Makefile ])
|
||||
AC_CONFIG_FILES([ po/ca/Makefile ])
|
||||
AC_CONFIG_FILES([ po/da/Makefile ])
|
||||
AC_CONFIG_FILES([ po/de/Makefile ])
|
||||
AC_CONFIG_FILES([ po/el/Makefile ])
|
||||
AC_CONFIG_FILES([ po/en_GB/Makefile ])
|
||||
AC_CONFIG_FILES([ po/es/Makefile ])
|
||||
AC_CONFIG_FILES([ po/et/Makefile ])
|
||||
AC_CONFIG_FILES([ po/fi/Makefile ])
|
||||
AC_CONFIG_FILES([ po/fr/Makefile ])
|
||||
AC_CONFIG_FILES([ po/gl/Makefile ])
|
||||
AC_CONFIG_FILES([ po/he/Makefile ])
|
||||
AC_CONFIG_FILES([ po/hu/Makefile ])
|
||||
AC_CONFIG_FILES([ po/it/Makefile ])
|
||||
AC_CONFIG_FILES([ po/ja/Makefile ])
|
||||
AC_CONFIG_FILES([ po/ka/Makefile ])
|
||||
AC_CONFIG_FILES([ po/ko/Makefile ])
|
||||
AC_CONFIG_FILES([ po/pa/Makefile ])
|
||||
AC_CONFIG_FILES([ po/pt/Makefile ])
|
||||
AC_CONFIG_FILES([ po/ru/Makefile ])
|
||||
AC_CONFIG_FILES([ po/sr/Makefile ])
|
||||
AC_CONFIG_FILES([ po/sr@Latn/Makefile ])
|
||||
AC_CONFIG_FILES([ po/sv/Makefile ])
|
||||
AC_CONFIG_FILES([ po/tr/Makefile ])
|
||||
AC_CONFIG_FILES([ po/zh_CN/Makefile ])
|
||||
AC_CONFIG_FILES([ po/zh_TW/Makefile ])
|
||||
AC_OUTPUT
|
||||
# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
|
||||
if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
|
||||
# And if so, warn when they don't match
|
||||
if test "$kde_libs_prefix" != "$given_prefix"; then
|
||||
# And if kde doesn't know about the prefix yet
|
||||
echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
|
||||
if test $? -ne 0; then
|
||||
echo ""
|
||||
echo "Warning: you chose to install this package in $given_prefix,"
|
||||
echo "but KDE was found in $kde_libs_prefix."
|
||||
echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
|
||||
echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
|
||||
echo "Then restart KDE."
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
|
||||
echo ""
|
||||
echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
|
||||
echo "was not included. Therefore, GCC symbol visibility support remains disabled."
|
||||
echo ""
|
||||
echo "For better performance, consider including the Qt visibility supporting patch"
|
||||
echo "located at:"
|
||||
echo ""
|
||||
echo "http://bugs.kde.org/show_bug.cgi?id=109386"
|
||||
echo ""
|
||||
echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
|
||||
echo "everything will continue to work just fine without it."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if test "$all_tests" = "bad"; then
|
||||
if test ! "$cache_file" = "/dev/null"; then
|
||||
echo ""
|
||||
echo "Please remove the file $cache_file after changing your setup"
|
||||
echo "so that configure will find the changes next time."
|
||||
echo ""
|
||||
fi
|
||||
else
|
||||
echo ""
|
||||
echo "Good - your configure finished. Start make now"
|
||||
echo ""
|
||||
fi
|
@ -0,0 +1,11 @@
|
||||
#MIN_CONFIG(3.2)
|
||||
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"
|
||||
|
||||
if test "$build_arts" = "yes"; then
|
||||
AC_DEFINE(USE_ARTS, 1, [If we use arts volume])
|
||||
LIB_ARTS="-lartskde"
|
||||
AC_SUBST(LIB_ARTS)
|
||||
fi
|
||||
|
||||
KDE_INIT_DOXYGEN([KEG Network API Reference], [Version $VERSION])
|
||||
|
@ -0,0 +1,5 @@
|
||||
|
||||
KDE_LANG = en
|
||||
KDE_DOCS = AUTO
|
||||
SUBDIRS = $(AUTODIRS)
|
||||
|
@ -0,0 +1,2 @@
|
||||
KDE_LANG = da
|
||||
KDE_DOCS = konversation
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,2 @@
|
||||
KDE_LANG = es
|
||||
KDE_DOCS = konversation
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
KDE_LANG = et
|
||||
KDE_DOCS = konversation
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,2 @@
|
||||
KDE_LANG = it
|
||||
KDE_DOCS = konversation
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,9 @@
|
||||
####### kdevelop will overwrite this part!!! (begin)##########
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
####### kdevelop will overwrite this part!!! (end)############
|
||||
|
||||
KDE_LANG = en
|
||||
KDE_DOCS = konversation
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
KDE_LANG = pt
|
||||
KDE_DOCS = konversation
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,2 @@
|
||||
KDE_LANG = ru
|
||||
KDE_DOCS = konversation
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,2 @@
|
||||
KDE_LANG = sv
|
||||
KDE_DOCS = konversation
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,19 @@
|
||||
SUBDIRS = src images scripts
|
||||
EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README TODO
|
||||
|
||||
messages: rc.cpp
|
||||
$(EXTRACTRC) `find . -name "*.rc" -o -name "*.ui" -o -name "*.kcfg"` > rc.cpp
|
||||
# we haven't got a tips file atm, so there isn't a lot of point in making one...
|
||||
# maybe someone will document the process of writing tips files, or tell me that
|
||||
# it needs to be done
|
||||
# $(PREPARETIPS) > tips.cpp
|
||||
LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name *.cxx -o -name \*.ecpp -o -name \*.C`; \
|
||||
if test -n "$$LIST"; then \
|
||||
$(XGETTEXT) $$LIST -o $(podir)/konversation.pot; \
|
||||
fi
|
||||
# rm -f tips.cpp
|
||||
rm -f rc.cpp
|
||||
|
||||
|
||||
include $(top_srcdir)/admin/Doxyfile.am
|
||||
|
@ -0,0 +1,5 @@
|
||||
Mon Jul 14 08:40:00 CEST 2008
|
||||
- Konversation now depends on KDE 3.5
|
||||
|
||||
Tue Jan 17 16:11:00 CEST 2006
|
||||
- Konversation now depends on KDE 3.4
|
@ -0,0 +1,3 @@
|
||||
./admin/configure.in.min
|
||||
configure.in.in
|
||||
|
@ -0,0 +1,48 @@
|
||||
#MIN_CONFIG(3.2)
|
||||
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"
|
||||
|
||||
KDE_CHECK_HEADER(knotifyclient.h,
|
||||
[
|
||||
AC_DEFINE(USE_KNOTIFY, 1, [Define if you have KNotify] )
|
||||
])
|
||||
|
||||
|
||||
KDE_CHECK_HEADER(kimiface.h,
|
||||
[
|
||||
AC_DEFINE(HAVE_KIMIFACE, 1, [Define if you have Kimiface headers] )
|
||||
LIB_KIMIFACE="-lkimproxy"
|
||||
AC_SUBST(LIB_KIMIFACE)
|
||||
])
|
||||
|
||||
# Check for XScreenSaver
|
||||
AC_CHECK_HEADERS(tgmath.h)xss_save_ldflags="$LDFLAGS"
|
||||
LDFLAGS="$X_LDFLAGS"
|
||||
|
||||
LIB_XSS=
|
||||
|
||||
KDE_CHECK_HEADER(X11/extensions/scrnsaver.h,
|
||||
[
|
||||
AC_CHECK_LIB(Xext,XScreenSaverQueryInfo,
|
||||
[
|
||||
AC_DEFINE(HAVE_XSCREENSAVER, 1, [Define if you have the XScreenSaver extension])
|
||||
LIB_XSS="-lXext"
|
||||
],
|
||||
[
|
||||
ld_shared_flag=
|
||||
KDE_CHECK_COMPILER_FLAG(shared, [ld_shared_flag="-shared"])
|
||||
AC_CHECK_LIB(Xss,XScreenSaverQueryInfo,
|
||||
[
|
||||
AC_DEFINE(HAVE_XSCREENSAVER, 1, [Define if you have the XScreenSaver extension])
|
||||
LIB_XSS="-lXss"
|
||||
],
|
||||
[],
|
||||
[ $ld_shared_flag $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS ])
|
||||
],
|
||||
[ $X_PRE_LIBS -lX11 $X_EXTRA_LIBS ])
|
||||
], [],
|
||||
[
|
||||
#include <X11/Xlib.h>
|
||||
] )
|
||||
|
||||
AC_SUBST(LIB_XSS)
|
||||
LDFLAGS="$xss_save_ldflags"
|
@ -0,0 +1 @@
|
||||
SUBDIRS = icons nickicons
|
@ -0,0 +1 @@
|
||||
KDE_ICON = AUTO
|
@ -0,0 +1,5 @@
|
||||
These are the icons that are shown in kaddressbook, kmail etc for konversation contacts.
|
||||
This icons are provided via the kimiface dcop interface.
|
||||
|
||||
The icons were created by Seba y Loretito (aka segfault2k).
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
||||
SUBDIRS = alternative christmas classic default smiling square oxygen
|
@ -0,0 +1,3 @@
|
||||
konversationicondir = $(kde_datadir)/konversation/themes/alternative
|
||||
konversationicon_DATA = irc_admin.png irc_away.png irc_halfop.png irc_normal.png irc_op.png \
|
||||
irc_owner.png irc_voice.png index.desktop
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
konversationicondir = $(kde_datadir)/konversation/themes/christmas
|
||||
konversationicon_DATA = irc_admin.png irc_away.png irc_halfop.png irc_normal.png irc_op.png \
|
||||
irc_owner.png irc_voice.png index.desktop
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
konversationicondir = $(kde_datadir)/konversation/themes/classic
|
||||
konversationicon_DATA = irc_admin.png irc_away.png irc_halfop.png irc_normal.png irc_op.png \
|
||||
irc_owner.png irc_voice.png index.desktop
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
konversationicondir = $(kde_datadir)/konversation/themes/default
|
||||
konversationicon_DATA = irc_admin.png irc_away.png irc_halfop.png irc_normal.png irc_op.png \
|
||||
irc_owner.png irc_voice.png index.desktop
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
konversationicondir = $(kde_datadir)/konversation/themes/oxygen
|
||||
konversationicon_DATA = irc_admin.png irc_away.png irc_halfop.png irc_normal.png irc_op.png \
|
||||
irc_owner.png irc_voice.png index.desktop
|
@ -0,0 +1,22 @@
|
||||
[Desktop Entry]
|
||||
Type=Theme
|
||||
Name=Oxygen Theme
|
||||
Name[da]=Oxygen-tema
|
||||
Name[de]=Oxygen-Design
|
||||
Name[et]=Oxygeni teema
|
||||
Name[it]=Tema Oxygen
|
||||
Name[ja]=Oxygen テーマ
|
||||
Name[sr]=Кисеоник тема
|
||||
Name[sr@Latn]=Kiseonik tema
|
||||
Name[sv]=Oxygen-tema
|
||||
Name[zh_TW]=Oxygen 主題
|
||||
Comment="Oxygen" by Nuno Pinheiro
|
||||
Comment[da]="Oxygen" af Nuno Pinheiro
|
||||
Comment[de]="Oxygen" von Nuno Pinheiro
|
||||
Comment[et]="Oxygen" (autor Nuno Pinheiro)
|
||||
Comment[it]=«Oxygen» di Nuno Pinheiro
|
||||
Comment[ja]=Nuno Pinheiro 作の Oxygen テーマ
|
||||
Comment[sr]=„Кисеоник“ од Нуна Пињеира
|
||||
Comment[sr@Latn]=„Kiseonik“ od Nuna Pinjeira
|
||||
Comment[sv]="Oxygen" av Nuno Pinheiro
|
||||
Comment[zh_TW]="Oxygen",由 Nuno Pinheiro 提供
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
konversationicondir = $(kde_datadir)/konversation/themes/smiling
|
||||
konversationicon_DATA = irc_admin.png irc_away.png irc_halfop.png irc_normal.png irc_op.png \
|
||||
irc_owner.png irc_voice.png index.desktop
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@
|
||||
konversationicondir = $(kde_datadir)/konversation/themes/square
|
||||
konversationicon_DATA = irc_admin.png irc_away.png irc_halfop.png irc_normal.png irc_op.png \
|
||||
irc_owner.png irc_voice.png index.desktop
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
scriptsdir=$(kde_datadir)/konversation/scripts
|
||||
scripts_SCRIPTS=bug fortune gauge uptime kdeversion cmd sayclip weather sysinfo media mail tinyurl
|
||||
scripts_DATA=fortunes.dat
|
||||
|
@ -0,0 +1,55 @@
|
||||
Here are some scripts that can help you in everyday life with konvi.
|
||||
|
||||
They are usually put in ~/.kde/share/apps/konversation/scripts/ and executed by
|
||||
typing /exec <scriptname> in konversation.
|
||||
|
||||
Since scripts are executed by system, they should have 'executable' flag on.
|
||||
This is most easily achieved by running chmod +x <scriptname>
|
||||
|
||||
Please add descriptions here as new scripts appear:
|
||||
|
||||
bug Opens up konqueror with kde bugzilla on specified bug number.
|
||||
usage: /bug 65090
|
||||
|
||||
gauge Displays funny "beer load" meter. Author: Eisfuchs, Idea: berkus.
|
||||
usage: /gauge 55
|
||||
|
||||
|
||||
uptime Displays the system uptime on the current channel.
|
||||
usage: /uptime
|
||||
|
||||
fortune Displays a random fortune cookie
|
||||
usage: /fortune
|
||||
|
||||
kdeversion Displays the Qt/KDE version.
|
||||
usage: /kdeversion
|
||||
|
||||
cmd Prints the output of a given command.
|
||||
usage: /cmd command
|
||||
|
||||
sayclip Prints the contents of the clipboard on the current channel
|
||||
with flood protection. Klipper must be running.
|
||||
usage: /sayclip [pause-time]
|
||||
|
||||
weather Displays current weather using KWeather applet.
|
||||
usage: /weather
|
||||
|
||||
colorizer Randomly colorizes the message.
|
||||
usage: /colorize message
|
||||
|
||||
media Plays the currently played media.
|
||||
Supports amaroK,JuK,Noatun,Kaffeine
|
||||
Usage: /media
|
||||
|
||||
mail Print the number of unread emails in your inbox folder in
|
||||
kmail. Kmail or kontact must be running.
|
||||
Usage: /mail [folder-substring]
|
||||
|
||||
google Use Google services
|
||||
Usage: /google (--search) <query> # Search <query> in Google
|
||||
/google --spell <word> # Spellcheck <word> using Google
|
||||
/google -b|--browser <query> # Launch konqueror with google search for <query>
|
||||
|
||||
qurl Display a short version of the url using qurl.net
|
||||
Requires Ruby.
|
||||
usage: /qurl http://some.very.long.url.com/
|
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
PORT=$1
|
||||
SERVER=$2
|
||||
TARGET=$3
|
||||
BUG=$4
|
||||
|
||||
if [ ! $TARGET ]
|
||||
then
|
||||
dcop $PORT default error "Can't write into status view."
|
||||
else
|
||||
if [ -z $BUG ]
|
||||
then
|
||||
dcop $PORT default error "You forgot the bug number!"
|
||||
else
|
||||
kfmclient openURL http://bugs.kde.org/show_bug.cgi?id=$4
|
||||
fi
|
||||
fi
|
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env perl
|
||||
# Copyright (C) 2004 by İsmail Dönmez
|
||||
# Licensed under GPL v2 or later at your option
|
||||
|
||||
$PORT= shift;
|
||||
$SERVER= shift;
|
||||
$TARGET= shift;
|
||||
|
||||
my $i;
|
||||
my $command;
|
||||
|
||||
if( $ARGV[0] eq "yes" ){
|
||||
exec 'dcop', $PORT, 'default', 'error', 'Requested command is not executed!';
|
||||
}
|
||||
|
||||
foreach $word (@ARGV) {
|
||||
$command = $command." ".$word;
|
||||
}
|
||||
|
||||
$ARG_MESSAGE = `exec $command`;
|
||||
|
||||
foreach $entry (split(/\n/, $ARG_MESSAGE)) {
|
||||
chomp $entry;
|
||||
$i=1;
|
||||
$entry =~ s/^\//\/\//;
|
||||
system 'dcop', $PORT, 'default', 'say', $SERVER, $TARGET, $entry;
|
||||
}
|
||||
|
||||
unless($i) {
|
||||
exec 'dcop', $PORT, 'default', 'error', "Command @ARGV doesn't exist";
|
||||
}
|
@ -0,0 +1,680 @@
|
||||
%
|
||||
Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing.
|
||||
%
|
||||
Let's call it an accidental feature.
|
||||
-- Larry Wall
|
||||
%
|
||||
I did this 'cause Linux gives me a woody. It doesn't generate revenue.
|
||||
-- Dave '-ddt->` Taylor, announcing DOOM for Linux
|
||||
%
|
||||
Feel free to contact me (flames about my english and the useless of this
|
||||
driver will be redirected to /dev/null, oh no, it's full...).
|
||||
-- Michael Beck, describing the PC-speaker sound device
|
||||
%
|
||||
lp1 on fire
|
||||
-- One of the more obfuscated kernel messages
|
||||
%
|
||||
A Linux machine! Because a 486 is a terrible thing to waste!
|
||||
-- Joe Sloan, jjs@wintermute.ucr.edu
|
||||
%
|
||||
Microsoft is not the answer.
|
||||
Microsoft is the question.
|
||||
NO (or Linux) is the answer.
|
||||
-- Taken from a .signature from someone from the UK, source unknown
|
||||
%
|
||||
In most countries selling harmful things like drugs is punishable.
|
||||
Then howcome people can sell Microsoft software and go unpunished?
|
||||
-- Hasse Skrifvars, hasku@rost.abo.fi,
|
||||
%
|
||||
Windows without the X is like making love without a partner.
|
||||
Sex, Drugs & Linux Rules
|
||||
win-nt from the people who invented edlin.
|
||||
Apples have meant trouble since eden.
|
||||
Linux, the way to get rid of boot viruses
|
||||
-- MaDsen Wikholm, mwikholm@at8.abo.fi
|
||||
%
|
||||
Once upon a time there was a DOS user who saw Unix, and saw that it was
|
||||
good. After typing cp on his DOS machine at home, he downloaded GNU's
|
||||
unix tools ported to DOS and installed them. He rm'd, cp'd, and mv'd
|
||||
happily for many days, and upon finding elvis, he vi'd and was happy. After
|
||||
a long day at work (on a Unix box) he came home, started editing a file,
|
||||
and couldn't figure out why he couldn't suspend vi (w/ ctrl-z) to do
|
||||
a compile.
|
||||
-- Erik Troan, ewt@tipper.oit.unc.edu
|
||||
%
|
||||
We are MicroSoft. You will be assimilated. Resistance is futile.
|
||||
-- Attributed to B.G., Gill Bates
|
||||
%
|
||||
Avoid the Gates of Hell. Use Linux
|
||||
-- unknown source
|
||||
%
|
||||
Intel engineering seem to have misheard Intel marketing strategy. The
|
||||
phrase was "Divide and conquer" not "Divide and cock up"
|
||||
-- Alan Cox, iialan@www.linux.org.uk
|
||||
%
|
||||
Linux! Guerrilla UNIX Development Venimus, Vidimus, Dolavimus.
|
||||
-- Mark A. Horton KA4YBR, mah@ka4ybr.com
|
||||
%
|
||||
"Who is General Failure and why is he reading my hard disk?"
|
||||
Microsoft spel chekar vor sail, worgs grate !!
|
||||
-- Felix von Leitner, leitner@inf.fu-berlin.de
|
||||
%
|
||||
Personally, I think my choice in the mostest-superlative-computer wars has to
|
||||
be the HP-48 series of calculators. They'll run almost anything. And if they
|
||||
can't, while I'll just plug a Linux box into the serial port and load up the
|
||||
HP-48 VT-100 emulator.
|
||||
-- Jeff Dege, jdege@winternet.com
|
||||
%
|
||||
There are no threads in a.b.p.erotica, so there's no gain in using a
|
||||
threaded news reader.
|
||||
-- unknown source
|
||||
%
|
||||
/*
|
||||
* Oops. The kernel tried to access some bad page. We'll have to
|
||||
* terminate things with extreme prejudice.
|
||||
*/
|
||||
die_if_kernel("Oops", regs, error_code);
|
||||
-- From linux/arch/i386/mm/fault.c
|
||||
%
|
||||
Linux: because a PC is a terrible thing to waste
|
||||
-- ksh@cis.ufl.edu put this on Tshirts in '93
|
||||
%
|
||||
Linux: the choice of a GNU generation
|
||||
-- ksh@cis.ufl.edu put this on Tshirts in '93
|
||||
%
|
||||
There are two types of Linux developers - those who can spell, and
|
||||
those who can't. There is a constant pitched battle between the two.
|
||||
-- From one of the post-1.1.54 kernel update messages posted to c.o.l.a
|
||||
%
|
||||
When you say "I wrote a program that crashed Windows", people just stare at
|
||||
you blankly and say "Hey, I got those with the system, *for free*".
|
||||
-- Linus Torvalds
|
||||
%
|
||||
We come to bury DOS, not to praise it.
|
||||
-- Paul Vojta, vojta@math.berkeley.edu
|
||||
%
|
||||
Be warned that typing killall name may not have the desired
|
||||
effect on non-Linux systems, especially when done by a privileged user.
|
||||
-- From the killall manual page
|
||||
%
|
||||
Note that if I can get you to "su and say" something just by asking,
|
||||
you have a very serious security problem on your system and you should
|
||||
look into it.
|
||||
-- Paul Vixie, vixie-cron 3.0.1 installation notes
|
||||
%
|
||||
How should I know if it works? That's what beta testers are for. I
|
||||
only coded it.
|
||||
-- Attributed to Linus Torvalds, somewhere in a posting
|
||||
%
|
||||
I develop for Linux for a living, I used to develop for DOS.
|
||||
Going from DOS to Linux is like trading a glider for an F117.
|
||||
-- Lawrence Foard, entropy@world.std.com
|
||||
%
|
||||
Absolutely nothing should be concluded from these figures except that
|
||||
no conclusion can be drawn from them.
|
||||
-- Joseph L. Brothers, Linux/PowerPC Project)
|
||||
%
|
||||
If the future navigation system [for interactive networked services on
|
||||
the NII] looks like something from Microsoft, it will never work.
|
||||
-- Chairman of Walt Disney Television & Telecommunications
|
||||
%
|
||||
Problem solving under Linux has never been the circus that it is under
|
||||
AIX.
|
||||
-- Pete Ehlke in comp.unix.aix
|
||||
%
|
||||
I don't know why, but first C programs tend to look a lot worse than
|
||||
first programs in any other language (maybe except for fortran, but then
|
||||
I suspect all fortran programs look like `firsts')
|
||||
-- Olaf Kirch
|
||||
%
|
||||
On a normal ascii line, the only safe condition to detect is a 'BREAK'
|
||||
- everything else having been assigned functions by Gnu EMACS.
|
||||
-- Tarl Neustaedter
|
||||
%
|
||||
By golly, I'm beginning to think Linux really *is* the best thing since
|
||||
sliced bread.
|
||||
-- Vance Petree, Virginia Power
|
||||
%
|
||||
I'd crawl over an acre of 'Visual This++' and 'Integrated Development
|
||||
That' to get to gcc, Emacs, and gdb. Thank you.
|
||||
-- Vance Petree, Virginia Power
|
||||
%
|
||||
Oh, I've seen copies [of Linux Journal] around the terminal room at The Labs.
|
||||
-- Dennis Ritchie
|
||||
%
|
||||
If you want to travel around the world and be invited to speak at a lot
|
||||
of different places, just write a Unix operating system.
|
||||
-- Linus Torvalds
|
||||
%
|
||||
...and scantily clad females, of course. Who cares if it's below zero
|
||||
outside.
|
||||
-- Linus Torvalds
|
||||
%
|
||||
...you might as well skip the Xmas celebration completely, and instead
|
||||
sit in front of your linux computer playing with the all-new-and-improved
|
||||
linux kernel version.
|
||||
-- Linus Torvalds
|
||||
%
|
||||
Besides, I think Slackware sounds better than 'Microsoft,' don't you?
|
||||
-- Patrick Volkerding
|
||||
%
|
||||
All language designers are arrogant. Goes with the territory...
|
||||
-- Larry Wall
|
||||
%
|
||||
And the next time you consider complaining that running Lucid Emacs
|
||||
19.05 via NFS from a remote Linux machine in Paraguay doesn't seem to
|
||||
get the background colors right, you'll know who to thank.
|
||||
-- Matt Welsh
|
||||
%
|
||||
Are Linux users lemmings collectively jumping off of the cliff of
|
||||
reliable, well-engineered commercial software?
|
||||
-- Matt Welsh
|
||||
%
|
||||
Even more amazing was the realization that God has Internet access. I
|
||||
wonder if He has a full newsfeed?
|
||||
-- Matt Welsh
|
||||
%
|
||||
I once witnessed a long-winded, month-long flamewar over the use of
|
||||
mice vs. trackballs... It was very silly.
|
||||
-- Matt Welsh
|
||||
%
|
||||
Linux poses a real challenge for those with a taste for late-night
|
||||
hacking (and/or conversations with God).
|
||||
-- Matt Welsh
|
||||
%
|
||||
What you end up with, after running an operating system concept through
|
||||
these many marketing coffee filters, is something not unlike plain hot
|
||||
water.
|
||||
-- Matt Welsh
|
||||
%
|
||||
...Deep Hack Mode -- that mysterious and frightening state of
|
||||
consciousness where Mortal Users fear to tread.
|
||||
-- Matt Welsh
|
||||
%
|
||||
...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and
|
||||
the Ugly).
|
||||
-- Matt Welsh
|
||||
%
|
||||
...very few phenomena can pull someone out of Deep Hack Mode, with two
|
||||
noted exceptions: being struck by lightning, or worse, your *computer*
|
||||
being struck by lightning.
|
||||
-- Matt Welsh
|
||||
%
|
||||
..you could spend *all day* customizing the title bar. Believe me. I
|
||||
speak from experience.
|
||||
-- Matt Welsh
|
||||
%
|
||||
[In 'Doctor' mode], I spent a good ten minutes telling Emacs what I
|
||||
thought of it. (The response was, 'Perhaps you could try to be less
|
||||
abusive.')
|
||||
-- Matt Welsh
|
||||
%
|
||||
I would rather spend 10 hours reading someone else's source code than
|
||||
10 minutes listening to Musak waiting for technical support which isn't.
|
||||
-- Dr. Greg Wettstein, Roger Maris Cancer Center
|
||||
%
|
||||
...[Linux's] capacity to talk via any medium except smoke signals.
|
||||
-- Dr. Greg Wettstein, Roger Maris Cancer Center
|
||||
%
|
||||
Whip me. Beat me. Make me maintain AIX.
|
||||
-- Stephan Zielinski
|
||||
%
|
||||
Your job is being a professor and researcher: That's one hell of a good excuse
|
||||
for some of the brain-damages of minix.
|
||||
-- Linus Torvalds to Andrew Tanenbaum
|
||||
%
|
||||
I still maintain the point that designing a monolithic kernel in 1991 is a
|
||||
fundamental error. Be thankful you are not my student. You would not get a
|
||||
high grade for such a design :-)
|
||||
-- Andrew Tanenbaum to Linus Torvalds
|
||||
%
|
||||
We use Linux for all our mission-critical applications. Having the source code
|
||||
means that we are not held hostage by anyone's support department.
|
||||
-- Russell Nelson, President of Crynwr Software
|
||||
%
|
||||
Linux is obsolete
|
||||
-- Andrew Tanenbaum
|
||||
%
|
||||
Dijkstra probably hates me.
|
||||
-- Linus Torvalds, in kernel/sched.c
|
||||
%
|
||||
And 1.1.81 is officially BugFree(tm), so if you receive any bug-reports
|
||||
on it, you know they are just evil lies.
|
||||
-- Linus Torvalds
|
||||
%
|
||||
We are Pentium of Borg. Division is futile. You will be approximated.
|
||||
-- seen in someone's .signature
|
||||
%
|
||||
Linux: the operating system with a CLUE... Command Line User Environment.
|
||||
-- seen in a posting in comp.software.testing
|
||||
%
|
||||
quit When the quit statement is read, the bc processor
|
||||
is terminated, regardless of where the quit state-
|
||||
ment is found. For example, "if (0 == 1) quit"
|
||||
will cause bc to terminate.
|
||||
-- seen in the manpage for "bc". Note the "if" statement's logic
|
||||
%
|
||||
Sic transit discus mundi
|
||||
-- From the System Administrator's Guide, by Lars Wirzenius
|
||||
%
|
||||
Sigh. I like to think it's just the Linux people who want to be on
|
||||
the "leading edge" so bad they walk right off the precipice.
|
||||
-- Craig E. Groeschel
|
||||
%
|
||||
We all know Linux is great... it does infinite loops in 5 seconds.
|
||||
- Linus Torvalds about the superiority of Linux on the Amterdam Linux Symposium
|
||||
%
|
||||
Waving away a cloud of smoke, I look up, and am blinded by a bright, white
|
||||
light. It's God. No, not Richard Stallman, or Linus Torvalds, but God. In
|
||||
a booming voice, He says: "THIS IS A SIGN. USE LINUX, THE FREE UNIX SYSTEM
|
||||
FOR THE 386.
|
||||
-- Matt Welsh
|
||||
%
|
||||
The chat program is in public domain. This is not the GNU public license.
|
||||
If it breaks then you get to keep both pieces.
|
||||
-- Copyright notice for the chat program
|
||||
%
|
||||
'Mounten' wird fr drei Dinge benutzt: 'Aufsitzen' auf Pferde, 'einklinken'
|
||||
von Festplatten in Dateisysteme, und, nun, 'besteigen' beim Sex.
|
||||
-- Christa Keil
|
||||
%
|
||||
Manchmal stehe nachts auf und installier's mir einfach...
|
||||
-- H0arry @ IRC
|
||||
%
|
||||
'Mounting' is used for three things: climbing on a horse, linking in a
|
||||
hard disk unit in data systems, and, well, mounting during sex.
|
||||
-- Christa Keil
|
||||
%
|
||||
We are using Linux daily to UP our productivity - so UP yours!
|
||||
-- Adapted from Pat Paulsen by Joe Sloan
|
||||
%
|
||||
But what can you do with it?
|
||||
-- ubiquitous cry from Linux-user partner
|
||||
%
|
||||
/*
|
||||
* [...] Note that 120 sec is defined in the protocol as the maximum
|
||||
* possible RTT. I guess we'll have to use something other than TCP
|
||||
* to talk to the University of Mars.
|
||||
* PAWS allows us longer timeouts and large windows, so once implemented
|
||||
* ftp to mars will work nicely.
|
||||
*/
|
||||
-- from /usr/src/linux/net/inet/tcp.c, concerning RTT [round trip time]
|
||||
%
|
||||
DOS: n., A small annoying boot virus that causes random spontaneous system
|
||||
crashes, usually just before saving a massive project. Easily cured by
|
||||
UNIX. See also MS-DOS, IBM-DOS, DR-DOS.
|
||||
-- David Vicker's .plan
|
||||
%
|
||||
MSDOS didn't get as bad as it is overnight -- it took over ten years
|
||||
of careful development.
|
||||
-- dmeggins@aix1.uottawa.ca
|
||||
%
|
||||
LILO, you've got me on my knees!
|
||||
-- David Black, dblack@pilot.njin.net, with apologies to Derek and the
|
||||
Dominos, and Werner Almsberger
|
||||
%
|
||||
I've run DOOM more in the last few days than I have the last few
|
||||
months. I just love debugging ;-)
|
||||
-- Linus Torvalds
|
||||
%
|
||||
Microsoft Corp., concerned by the growing popularity of the free 32-bit
|
||||
operating system for Intel systems, Linux, has employed a number of top
|
||||
programmers from the underground world of virus development. Bill Gates stated
|
||||
yesterday: "World domination, fast -- it's either us or Linus". Mr. Torvalds
|
||||
was unavailable for comment ...
|
||||
-- Robert Manners, rjm@swift.eng.ox.ac.uk, in comp.os.linux.setup
|
||||
%
|
||||
The only "intuitive" interface is the nipple. After that, it's all learned.
|
||||
-- Bruce Ediger, bediger@teal.csn.org, on X interfaces
|
||||
%
|
||||
After watching my newly-retired dad spend two weeks learning how to make a new
|
||||
folder, it became obvious that "intuitive" mostly means "what the writer or
|
||||
speaker of intuitive likes".
|
||||
-- Bruce Ediger, bediger@teal.csn.org, on X the intuitiveness of a Mac interface
|
||||
%
|
||||
Now I know someone out there is going to claim, "Well then, UNIX is intuitive,
|
||||
because you only need to learn 5000 commands, and then everything else follows
|
||||
from that! Har har har!"
|
||||
-- Andy Bates on "intuitive interfaces", slightly defending Macs
|
||||
%
|
||||
> No manual is ever necessary.
|
||||
May I politely interject here: BULLSHIT. That's the biggest Apple lie of all!
|
||||
-- Discussion in comp.os.linux.misc on the intuitiveness of interfaces
|
||||
%
|
||||
How do I type "for i in *.dvi do xdvi $i done" in a GUI?
|
||||
-- Discussion in comp.os.linux.misc on the intuitiveness of interfaces
|
||||
%
|
||||
>Ever heard of .cshrc?
|
||||
That's a city in Bosnia. Right?
|
||||
-- Discussion in comp.os.linux.misc on the intuitiveness of commands
|
||||
%
|
||||
Who wants to remember that escape-x-alt-control-left shift-b puts you into
|
||||
super-edit-debug-compile mode?
|
||||
-- Discussion on the intuitiveness of commands, especially Emacs
|
||||
%
|
||||
Anyone who thinks UNIX is intuitive should be forced to write 5000 lines of
|
||||
code using nothing but vi or emacs. AAAAACK!
|
||||
-- Discussion on the intuitiveness of commands, especially Emacs
|
||||
%
|
||||
Now, it we had this sort of thing:
|
||||
yield -a for yield to all traffic
|
||||
yield -t for yield to trucks
|
||||
yield -f for yield to people walking (yield foot)
|
||||
yield -d t* for yield on days starting with t
|
||||
|
||||
...you'd have a lot of dead people at intersections, and traffic jams you
|
||||
wouldn't believe...
|
||||
-- Discussion on the intuitiveness of commands
|
||||
%
|
||||
Actually, typing random strings in the Finder does the equivalent of
|
||||
filename completion.
|
||||
-- Discussion on file completion vs. the Mac Finder
|
||||
%
|
||||
Not me, guy. I read the Bash man page each day like a Jehovah's Witness reads
|
||||
the Bible. No wait, the Bash man page IS the bible. Excuse me...
|
||||
-- More on confusing aliases, taken from comp.os.linux.misc
|
||||
%
|
||||
On the Internet, no one knows you're using Windows NT
|
||||
-- Submitted by Ramiro Estrugo, restrugo@fateware.com
|
||||
%
|
||||
> I'm an idiot.. At least this [bug] took about 5 minutes to find..
|
||||
Disquieting ...
|
||||
-- Gonzalo Tornaria in response to Linus Torvalds's
|
||||
%
|
||||
> I'm an idiot.. At least this [bug] took about 5 minutes to find..
|
||||
We need to find some new terms to describe the rest of us mere mortals
|
||||
then.
|
||||
-- Craig Schlenter in response to Linus Torvalds's
|
||||
%
|
||||
> I'm an idiot.. At least this [bug] took about 5 minutes to find..
|
||||
Surely, Linus is talking about the kind of idiocy that others aspire to :-).
|
||||
-- Bruce Perens in response to Linus Torvalds's
|
||||
%
|
||||
Never make any mistaeks.
|
||||
-- Anonymous, in a mail discussion about to a kernel bug report
|
||||
%
|
||||
+#if defined(__alpha__) && defined(CONFIG_PCI)
|
||||
+ /*
|
||||
+ * The meaning of life, the universe, and everything. Plus
|
||||
+ * this makes the year come out right.
|
||||
+ */
|
||||
+ year -= 42;
|
||||
+#endif
|
||||
-- From the patch for 1.3.2: (kernel/time.c), submitted by Marcus Meissner
|
||||
%
|
||||
As usual, this being a 1.3.x release, I haven't even compiled this
|
||||
kernel yet. So if it works, you should be doubly impressed.
|
||||
-- Linus Torvalds, announcing kernel 1.3.3
|
||||
%
|
||||
People disagree with me. I just ignore them.
|
||||
-- Linus Torvalds, regarding the use of C++ for the Linux kernel
|
||||
%
|
||||
It's now the GNU Emacs of all terminal emulators.
|
||||
-- Linus Torvalds, regarding the fact that Linux started off as a terminal emulator
|
||||
%
|
||||
Audience: What will become of Linux when the Hurd is ready?
|
||||
Eric Youngdale: Err... is Richard Stallman here?
|
||||
-- From the Linux conference in spring '95, Berlin
|
||||
%
|
||||
Linux: The OS people choose without $200,000,000 of persuasion.
|
||||
-- Mike Coleman
|
||||
%
|
||||
The memory management on the PowerPC can be used to frighten small children.
|
||||
-- Linus Torvalds
|
||||
%
|
||||
... faster BogoMIPS calculations (yes, it now boots 2 seconds faster than
|
||||
it used to: we're considering changing the name from "Linux" to "InstaBOOT"
|
||||
-- Linus, in the announcement for 1.3.26
|
||||
%
|
||||
... of course, this probably only happens for tcsh which uses wait4(),
|
||||
which is why I never saw it. Serves people who use that abomination
|
||||
right 8^)
|
||||
-- Linus Torvalds, about a patch that fixes getrusage for 1.3.26
|
||||
%
|
||||
It's a bird..
|
||||
It's a plane..
|
||||
No, it's KernelMan, faster than a speeding bullet, to your rescue.
|
||||
Doing new kernel versions in under 5 seconds flat..
|
||||
-- Linus, in the announcement for 1.3.27
|
||||
%
|
||||
Eh, that's it, I guess. No 300 million dollar unveiling event for this
|
||||
kernel, I'm afraid, but you're still supposed to think of this as the
|
||||
"happening of the century" (at least until the next kernel comes along).
|
||||
-- Linus, in the announcement for 1.3.27
|
||||
%
|
||||
Oh, and this is another kernel in that great and venerable "BugFree(tm)"
|
||||
series of kernels. So be not afraid of bugs, but go out in the streets
|
||||
and deliver this message of joy to the masses.
|
||||
-- Linus, in the announcement for 1.3.27
|
||||
%
|
||||
When you say 'I wrote a program that crashed Windows', people just stare at
|
||||
you blankly and say 'Hey, I got those with the system, *for free*'.
|
||||
-- Linus Torvalds
|
||||
%
|
||||
Never trust an operating system you don't have sources for. ;-)
|
||||
-- Unknown source
|
||||
%
|
||||
> Linux is not user-friendly.
|
||||
It _is_ user-friendly. It is not ignorant-friendly and idiot-friendly.
|
||||
-- Seen somewhere on the net
|
||||
%
|
||||
Keep me informed on the behaviour of this kernel.. As the "BugFree(tm)"
|
||||
series didn't turn out too well, I'm starting a new series called the
|
||||
"ItWorksForMe(tm)" series, of which this new kernel is yet another
|
||||
shining example.
|
||||
-- Linus, in the announcement for 1.3.29
|
||||
%
|
||||
Seriously, the way I did this was by using a special /sbin/loader binary
|
||||
with debugging hooks that I made ("dd" is your friend: binary editors
|
||||
are for wimps).
|
||||
-- Linus Torvalds, in an article on a dnserver
|
||||
%
|
||||
(I tried to get some documentation out of Digital on this, but as far as
|
||||
I can tell even _they_ don't have it ;-)
|
||||
-- Linus Torvalds, in an article on a dnserver
|
||||
%
|
||||
Q: Why shouldn't I simply delete the stuff I never use, it's just taking up
|
||||
space?
|
||||
A: This question is in the category of Famous Last Words..
|
||||
-- From the Frequently Unasked Questions
|
||||
%
|
||||
Q: What's the big deal about rm, I have been deleting stuff for years? And
|
||||
never lost anything.. oops!
|
||||
A: ...
|
||||
-- From the Frequently Unasked Questions
|
||||
%
|
||||
Linux is addictive, I'm hooked!
|
||||
-- MaDsen Wikholm's .sig
|
||||
%
|
||||
panic("Foooooooood fight!");
|
||||
-- In the kernel source aha1542.c, after detecting a bad segment list
|
||||
%
|
||||
Convention organizer to Linus Torvalds: "You might like to come with us
|
||||
to some licensed[1] place, and have some pizza."
|
||||
|
||||
Linus: "Oh, I did not know that you needed a license to eat pizza".
|
||||
|
||||
[1] Licenced - refers in Australia to a restaurant which has government
|
||||
licence to sell liquor.
|
||||
-- Linus at a talk at the Melbourne University
|
||||
%
|
||||
Footnotes are for things you believe don't really belong in LDP manuals,
|
||||
but want to include anyway.
|
||||
-- Joel N. Weber II discussing the 'make' chapter of LPG
|
||||
%
|
||||
Eh, that's it, I guess. No 300 million dollar unveiling event for this
|
||||
kernel, I'm afraid, but you're still supposed to think of this as the
|
||||
"happening of the century" (at least until the next kernel comes along).
|
||||
Oh, and this is another kernel in that great and venerable "BugFree(tm)"
|
||||
series of kernels. So be not afraid of bugs, but go out in the streets
|
||||
and deliver this message of joy to the masses.
|
||||
-- Linus Torvalds, on releasing 1.3.27
|
||||
%
|
||||
Ok, I'm just uploading the new version of the kernel, v1.3.33, also
|
||||
known as "the buggiest kernel ever".
|
||||
-- Linus Torvalds
|
||||
%
|
||||
Go not unto the Usenet for advice, for you will be told both yea and nay (and
|
||||
quite a few things that just have nothing at all to do with the question).
|
||||
-- seen in a .sig somewhere
|
||||
%
|
||||
Those who don't understand Linux are doomed to reinvent it, poorly.
|
||||
-- unidentified source
|
||||
%
|
||||
Look, I'm about to buy me a double barreled sawed off shotgun and show
|
||||
Linus what I think about backspace and delete not working.
|
||||
-- some anonymous .signature
|
||||
%
|
||||
We apologize for the inconvenience, but we'd still like yout to test out
|
||||
this kernel.
|
||||
-- Linus Torvalds, announcing another kernel patch
|
||||
%
|
||||
The new Linux anthem will be "He's an idiot, but he's ok", as performed by
|
||||
Monthy Python. You'd better start practicing.
|
||||
-- Linus Torvalds, announcing another kernel patch
|
||||
%
|
||||
How do you power off this machine?
|
||||
-- Linus, when upgrading linux.cs.helsinki.fi, and after using the machine for several months
|
||||
%
|
||||
Excusing bad programming is a shooting offence, no matter _what_ the
|
||||
circumstances.
|
||||
-- Linus Torvalds, to the linux-kernel list
|
||||
%
|
||||
Linus? Whose that?
|
||||
-- clueless newbie on #Linux
|
||||
%
|
||||
Whoa...I did a 'zcat /vmlinuz > /dev/audio' and I think I heard God...
|
||||
-- mikecd on #Linux
|
||||
%
|
||||
Some people have told me they don't think a fat penguin really embodies the
|
||||
grace of Linux, which just tells me they have never seen a angry penguin
|
||||
charging at them in excess of 100mph. They'd be a lot more careful about what
|
||||
they say if they had.
|
||||
-- Linus Torvalds, announcing Linux v2.0
|
||||
%
|
||||
MS-DOS, you can't live with it, you can live without it.
|
||||
-- from Lars Wirzenius' .sig
|
||||
%
|
||||
.. I used to get in more fights with SCO than I did my girlfriend, but
|
||||
now, thanks to Linux, she has more than happily accepted her place back at
|
||||
number one antagonist in my life..
|
||||
-- Jason Stiefel, krypto@s30.nmex.com
|
||||
%
|
||||
I mean, well, if it were not for Linux I might be roaming the streets looking
|
||||
for drugs or prostitutes or something. Hannu and Linus have my highest
|
||||
admiration (apple polishing mode off).
|
||||
-- Phil Lewis, plewis@nyx.nyx.net
|
||||
%
|
||||
> What does ELF stand for (in respect to Linux?)
|
||||
ELF is the first rock group that Ronnie James Dio performed with back in
|
||||
the early 1970's. In constrast, a.out is a misspelling of the French word
|
||||
for the month of August. What the two have in common is beyond me, but
|
||||
Linux users seem to use the two words together.
|
||||
-- seen on c.o.l.misc
|
||||
%
|
||||
"Linux was made by foreign terrorists to take money from true US companies
|
||||
like Microsoft." - Some AOL'er.
|
||||
"To this end we dedicate ourselves..." -Don
|
||||
-- From the sig of "Don", don@cs.byu.edu
|
||||
%
|
||||
Shoot me again.
|
||||
Just proving that the quickest way to solve the problem is to post a
|
||||
whine to the newsgroups: within moments the solution presents itself to
|
||||
me, and meanwhile my ass is hanging out on the Net... *sigh*...
|
||||
-- Dave Phillips, dlphilp@bright.net, about problem solving via news
|
||||
%
|
||||
Besides, its really not worthwhile to use more than two times your physical
|
||||
ram in swap (except in a select few situations). The performance of the system
|
||||
becomes so abysmal you'd rather heat pins under your toenails while reciting
|
||||
Windows95 source code and staring at porn flicks of Bob Dole than actually try
|
||||
to type something.
|
||||
-- seen on c.o.l.development.system, about the size of the swap space
|
||||
%
|
||||
Only wimps use tape backup: _real_ men just upload their important stuff
|
||||
on ftp, and let the rest of the world mirror it ;)
|
||||
-- Linus Torvalds, about his failing hard drive on linux.cs.helsinki.fi
|
||||
%
|
||||
One of the things that hamper Linux's climb to world domination is the
|
||||
shortage of bad Computer Role Playing Games, or CRaPGs. No operating system
|
||||
can be considered respectable without one.
|
||||
-- Brian O'Donnell, odonnllb@tcd.ie
|
||||
%
|
||||
The game, anoraks.2.0.0.tgz, will be available from sunsite until somebody
|
||||
responsible notices it and deletes it, and shortly from
|
||||
ftp.mee.tcd.ie/pub/Brian, though they don't know that yet.
|
||||
-- Brian O'Donnell, odonnllb@tcd.ie
|
||||
%
|
||||
'Ooohh.. "FreeBSD is faster over loopback, when compared to Linux
|
||||
over the wire". Film at 11.'
|
||||
-- Linus Torvalds
|
||||
%
|
||||
Q: Would you like to see the WINE list?
|
||||
A: What's on it, anything expensive?
|
||||
Q: No, just Solitaire and MineSweeper for now, but the WINE is free.
|
||||
-- Kevin M. Bealer, about the WINdows Emulator
|
||||
%
|
||||
So in the future, one 'client' at a time or you'll be spending CPU time with
|
||||
lots of little 'child processes'.
|
||||
-- Kevin M. Bealer, commenting on the private life of a Linux nerd
|
||||
%
|
||||
By the way, I can hardly feel sorry for you... All last night I had to listen
|
||||
to her tears, so great they were redirected to a stream. What? Of _course_
|
||||
you didn't know. You and your little group no longer have any permissions
|
||||
around here. She changed her .lock files, too.
|
||||
-- Kevin M. Bealer, commenting on the private life of a Linux nerd
|
||||
%
|
||||
We should start referring to processes which run in the background by their
|
||||
correct technical name... paenguins.
|
||||
-- Kevin M. Bealer, commenting on the penguin Linux logo
|
||||
%
|
||||
We can use symlinks of course... syslogd would be a symlink to syslogp and
|
||||
ftpd and ircd would be linked to ftpp and ircp... and of course the
|
||||
point-to-point protocal paenguin.
|
||||
-- Kevin M. Bealer, commenting on the penguin Linux logo
|
||||
%
|
||||
This is a logical analogy too... anyone who's been around, knows the world is
|
||||
run by paenguins. Always a paenguin behind the curtain, really getting things
|
||||
done. And paenguins in politics--who can deny it?
|
||||
-- Kevin M. Bealer, commenting on the penguin Linux logo
|
||||
%
|
||||
Linux: Where Don't We Want To Go Today?
|
||||
-- Submitted by Pancrazio De Mauro, paraphrasing some well-known sales talk
|
||||
%
|
||||
The most important design issue... is the fact that Linux is supposed to
|
||||
be fun...
|
||||
-- Linus Torvalds at the First Dutch International Symposium on Linux
|
||||
%
|
||||
In short, at least give the penguin a fair viewing. If you still don't
|
||||
like it, that's ok: that's why I'm boss. I simply know better than you do.
|
||||
-- Linus "what, me arrogant?" Torvalds, on c.o.l.advocacy
|
||||
%
|
||||
<SomeLamer> what's the difference between chattr and chmod?
|
||||
<SomeGuru> SomeLamer: man chattr > 1; man chmod > 2; diff -u 1 2 | less
|
||||
-- Seen on #linux on irc
|
||||
%
|
||||
The linuX Files -- The Source is Out There.
|
||||
-- Sent in by Craig S. Bell, goat@aracnet.com
|
||||
%
|
||||
"... being a Linux user is sort of like living in a house inhabited
|
||||
by a large family of carpenters and architects. Every morning when
|
||||
you wake up, the house is a little different. Maybe there is a new
|
||||
turret, or some walls have moved. Or perhaps someone has temporarily
|
||||
removed the floor under your bed." - Unix for Dummies, 2nd Edition
|
||||
-- found in the .sig of Rob Riggs, rriggs@tesser.com
|
||||
%
|
||||
C is quirky, flawed, and an enormous success
|
||||
-- Dennis M. Ritchie
|
||||
%
|
||||
If Bill Gates is the Devil then Linus Torvalds must be the Messiah.
|
||||
-- Unknown source
|
||||
%
|
||||
Vini, vidi, Linux!
|
||||
-- Unknown source
|
||||
%
|
||||
The good thing about standards is that there are so many to choose from.
|
||||
-- Andrew S. Tanenbaum
|
||||
%
|
||||
I'm telling you that the kernel is stable not because it's a kernel,
|
||||
but because I refuse to listen to arguments like this.
|
||||
-- Linus Torvalds
|
||||
%
|
@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PORT=$1
|
||||
SERVER=$2
|
||||
TARGET=$3
|
||||
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
|
||||
PERCENTAGE=$1
|
||||
|
||||
if [ ! $TARGET ]
|
||||
then
|
||||
dcop $PORT default error "Can't write into status view."
|
||||
else
|
||||
if [ ! $PERCENTAGE ]
|
||||
then
|
||||
dcop $PORT default error "USAGE: $0 <percentage>"
|
||||
else
|
||||
PERCENTAGE=`echo $PERCENTAGE | sed 's/^0\+//'`
|
||||
LEFT=$(($PERCENTAGE/5))
|
||||
RIGHT=$((20-$LEFT))
|
||||
|
||||
if [[ $PERCENTAGE -lt 0 ]]; then
|
||||
dcop $PORT default error "Percentage has to be bigger than 0"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ $PERCENTAGE -gt 100 ]]; then
|
||||
dcop $PORT default error "Percentage has to be smaller than 100"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
if [ $PERCENTAGE = 50 ]
|
||||
then
|
||||
METER="|"
|
||||
else
|
||||
if [[ $PERCENTAGE -lt 50 ]]
|
||||
then
|
||||
METER="\\"
|
||||
else
|
||||
METER="/"
|
||||
fi
|
||||
fi
|
||||
|
||||
for (( i=$LEFT ; $i != 0 ; i-- ))
|
||||
do
|
||||
OUTPUT="$OUTPUT,"
|
||||
done
|
||||
|
||||
OUTPUT="$OUTPUT$METER"
|
||||
|
||||
for (( i=$RIGHT ; $i != 0 ; i-- ))
|
||||
do
|
||||
OUTPUT="$OUTPUT,"
|
||||
done
|
||||
|
||||
OUTPUT=`echo $OUTPUT | sed 's/,/ /g'`
|
||||
|
||||
OUTPUT="[$OUTPUT] $PERCENTAGE%"
|
||||
|
||||
if [ $PERCENTAGE = 100 ]
|
||||
then
|
||||
OUTPUT="$OUTPUT *ding*"
|
||||
fi
|
||||
|
||||
dcop $PORT default say $SERVER "$TARGET" "Beer load $OUTPUT"
|
||||
fi
|
||||
fi
|
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Prints the KDE version.
|
||||
|
||||
PORT=$1;
|
||||
SERVER=$2;
|
||||
TARGET=$3;
|
||||
|
||||
kde-config --version | while read line; do dcop $PORT default say $SERVER "$TARGET" "$line"; done
|
@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Licensed under GPL v2 or later at your option
|
||||
# Copyright 2005 by John Tapsell <john.tapsell@kdemail.net>
|
||||
|
||||
PORT=$1;
|
||||
SERVER=$2;
|
||||
TARGET=$3;
|
||||
|
||||
FOLDER=$4;
|
||||
|
||||
|
||||
if [ "$FOLDER" = "" ] ; then
|
||||
FOLDER="inbox"
|
||||
fi
|
||||
|
||||
|
||||
getmails()
|
||||
{
|
||||
|
||||
dcop kmail > /dev/null || {
|
||||
dcop $PORT default info "Sorry kmail is not running"
|
||||
exit
|
||||
}
|
||||
|
||||
for f in $(dcop kmail KMailIface folderList) ; do
|
||||
MAILFOLDER=$(dcop $(dcop kmail KMailIface getFolder $f) "displayPath" | grep -i $FOLDER)
|
||||
if [ "$MAILFOLDER" != "" ] ; then
|
||||
FOUNDFOLDER=1
|
||||
MAILCOUNT=$(dcop $(dcop kmail KMailIface getFolder $f ) "unreadMessages()" )
|
||||
MAILTOTALCOUNT=$(dcop $(dcop kmail KMailIface getFolder $f ) "messages()" )
|
||||
MAILTOTALCOUNT=$(($MAILCOUNT + $MAILTOTALCOUNT))
|
||||
if [[ -z "$MAILCOUNT" ]] ; then MAILCOUNT = "0" ; fi
|
||||
if [ "$MAILCOUNT" != 0 ] ; then
|
||||
FOUNDEMAIL=1
|
||||
echo "Email folder %B$MAILFOLDER%B has %B$MAILCOUNT%B unread messages, out of %B$MAILTOTALCOUNT%B"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z "$FOUNDEMAIL" ]] ; then
|
||||
if [[ -z "$FOUNDFOLDER" ]] ; then
|
||||
dcop $PORT default info "No email folders were found that had a name containing '$FOLDER'"
|
||||
exit
|
||||
else
|
||||
echo "No new emails in any folders matching '$FOLDER'"
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [[ -z "$3" ]] ; then
|
||||
echo "Scripts are not meant to be called from the command line."
|
||||
echo "This script should be installed to $KDEDIR/share/apps/konversation/scripts"
|
||||
echo "Then executed with /script from the konversation"
|
||||
echo
|
||||
echo The output is:
|
||||
getmails
|
||||
exit
|
||||
fi
|
||||
|
||||
#LINECOUNT=$(getmails | wc -l)
|
||||
#if [[ "$LINECOUNT" -gt 5 ]] ; then
|
||||
# dcop $PORT default info "There are more than 5 matches. Cancelling to avoid flooding the server"
|
||||
# exit
|
||||
#fi
|
||||
|
||||
getmails | head -n 3 | while read line; do dcop $PORT default say $SERVER "$TARGET" "$line"; done
|
||||
|
@ -0,0 +1,484 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
#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.
|
||||
|
||||
# Copyright 2006 Eli J. MacKenzie
|
||||
# Inspired by `media` (Copyright 2005 İsmail Dönmez)
|
||||
|
||||
|
||||
# If you wish to customize the formatting strings, do so in this table.
|
||||
# Do not change the numbers unless you're changing the logic.
|
||||
# Title, artist, and album will be set once the player is queried.
|
||||
# See Player.format() for how these are used.
|
||||
|
||||
|
||||
#Changing these 3 values will likely cause the script to fail
|
||||
Title =4
|
||||
Artist=2
|
||||
Album =1
|
||||
|
||||
#To disable self-titled (eponymous) checking, subtract 8
|
||||
SelfTitled=11
|
||||
|
||||
outputFormat="/me $intro $info [$player]"
|
||||
formatStrings = {
|
||||
Title+SelfTitled : "$title by $artist (eponymous)",
|
||||
SelfTitled : "${artist}'s self-titled album",
|
||||
Title+Artist+Album : "$title by $artist on $album", #7,15
|
||||
Title+Artist : "$title by $artist", #6,14
|
||||
Title+Album : "$title from $album", #5,13
|
||||
Album+Artist : "$album by $artist", #3,11
|
||||
Title : "$title", #4,12
|
||||
Artist : "$artist", #2,10
|
||||
Album : "$album", #1,9
|
||||
}
|
||||
|
||||
#Intro defaults to first type the player supports when a specific type was not demanded
|
||||
formatVariables={'audio': 'is listening to', 'video': 'is watching'}
|
||||
|
||||
## Static player ranking list
|
||||
## If you add a new player, you must add it here or it won't get checked when in audio-only or video-only modes.
|
||||
playerRankings= {
|
||||
'video' :['kaffeine','kmplayer', 'kplayer', 'noatun', 'kdetv'],
|
||||
'audio' :['amarok', 'MPD' 'juk', 'noatun', 'kscd', 'kaffeine', 'kmplayer', 'Audacious', 'xmms', 'yammi']
|
||||
}
|
||||
|
||||
## Title, album and artist fields to be quoted depending on contents
|
||||
# List the possible trigger characters here.
|
||||
# If you want a '-', it must be first. if you want a '^', it must be last.
|
||||
SIMPLE_FIXUP = '' #I use ' '
|
||||
|
||||
# If you want to use a regex for the above, specify it here in which case it will be used
|
||||
REGEX_FIXUP = ''
|
||||
|
||||
# Quote chars to use:
|
||||
QUOTE_BEFORE = '"'
|
||||
QUOTE_AFTER = '"'
|
||||
|
||||
|
||||
###############################
|
||||
## The Real work is done below
|
||||
#############################
|
||||
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
import string
|
||||
|
||||
try:
|
||||
APP_ID = sys.argv[1]
|
||||
IRC_SERVER = sys.argv[2]
|
||||
TARGET = sys.argv[3]
|
||||
except IndexError:
|
||||
print >>sys.stderr, "This script is intended to be run from within Konversation."
|
||||
sys.exit(0)
|
||||
|
||||
if (sys.hexversion >> 16) < 0x0204:
|
||||
err="The media script requires Python 2.4."
|
||||
os.popen('dcop %s default error "%s"' %(APP_ID,err))
|
||||
sys.exit(err)
|
||||
|
||||
import subprocess
|
||||
|
||||
# Python 2.5 has this ...
|
||||
try:
|
||||
any(())
|
||||
except NameError:
|
||||
def any(data):
|
||||
"""Return true of any of the items in the sequence 'data' are true.
|
||||
|
||||
(ie non-zero or not empty)"""
|
||||
try:
|
||||
return reduce(lambda x,y: bool(x) or bool(y), data)
|
||||
except TypeError:
|
||||
return False
|
||||
|
||||
def tell(data, feedback='info'):
|
||||
"""Report back to the user"""
|
||||
l=['dcop', APP_ID, 'default', feedback]
|
||||
if type(data) is type(''):
|
||||
l.append(data)
|
||||
else:
|
||||
l.extend(data)
|
||||
subprocess.Popen(l).communicate()
|
||||
|
||||
class Player(object):
|
||||
def __init__(self, display_name, playerType=None):
|
||||
if playerType is None:
|
||||
self.type = "audio"
|
||||
else:
|
||||
self.type=playerType
|
||||
self.displayName=display_name
|
||||
self.running = False
|
||||
d={}
|
||||
d.update(formatVariables)
|
||||
d['player']=self.displayName
|
||||
self._format = d
|
||||
|
||||
def get(self, mode):
|
||||
data=self.getData()
|
||||
if any(data):
|
||||
self._format['info']=self.format(*data)
|
||||
if mode and mode != self.displayName:
|
||||
self._format['intro']=self._format[mode]
|
||||
else:
|
||||
self._format['intro']=self._format[self.type.replace(',','').split()[0]]
|
||||
return string.Template(outputFormat).safe_substitute(self._format)
|
||||
return ''
|
||||
|
||||
def format(self, title='', artist='', album=''):
|
||||
"""Return a 'pretty-printed' info string for the track.
|
||||
|
||||
Uses formatStrings from above."""
|
||||
#Update args last to prevent non-sensical override in formatVariables
|
||||
x={'title':title, 'artist':artist, 'album':album}
|
||||
if FIXUP:
|
||||
for i,j in x.items():
|
||||
if re.search(FIXUP,j):
|
||||
x[i]='%s%s%s'%(QUOTE_BEFORE,j,QUOTE_AFTER)
|
||||
self._format.update(x)
|
||||
n=0
|
||||
if title:
|
||||
n|=4 #Still binary to make you read the code ;p
|
||||
if artist:
|
||||
if artist == album:
|
||||
n|=SelfTitled
|
||||
else:
|
||||
n|=2
|
||||
if album:
|
||||
n|=1
|
||||
if n:
|
||||
return string.Template(formatStrings[n]).safe_substitute(self._format)
|
||||
return ''
|
||||
|
||||
def getData(self):
|
||||
"""Implement this to do the work"""
|
||||
return ''
|
||||
|
||||
def reEncodeString(self, input):
|
||||
if input:
|
||||
try:
|
||||
input = input.decode('utf-8')
|
||||
except UnicodeError:
|
||||
try:
|
||||
input = input.decode('latin-1')
|
||||
except UnicodeError:
|
||||
input = input.decode('ascii', 'replace')
|
||||
except NameError:
|
||||
pass
|
||||
return input.encode('utf-8')
|
||||
|
||||
def test_format(self, title='', artist='', album=''):
|
||||
s=[]
|
||||
l=["to","by","on"]
|
||||
if title:
|
||||
s.append(title)
|
||||
else:
|
||||
album,artist=artist,album
|
||||
l.pop()
|
||||
if artist:
|
||||
s.append(artist)
|
||||
else:
|
||||
del l[1]
|
||||
if album:
|
||||
s.append(album)
|
||||
else:
|
||||
l.pop()
|
||||
t=["is listening"]
|
||||
while l:
|
||||
t.append(l.pop(0))
|
||||
t.append(s.pop(0))
|
||||
return ' '.join(t)
|
||||
|
||||
def isRunning(self):
|
||||
return self.running
|
||||
|
||||
class DCOPPlayer(Player):
|
||||
def __init__(self, display_name, service_name, getTitle='', getArtist='', getAlbum='',playerType=None):
|
||||
Player.__init__(self, display_name, playerType)
|
||||
self.serviceName=service_name
|
||||
self._title=getTitle
|
||||
self._artist=getArtist
|
||||
self._album=getAlbum
|
||||
self.DCOP=""
|
||||
|
||||
def getData(self):
|
||||
self.getService()
|
||||
return (self.grab(self._title), self.grab(self._artist), self.grab(self._album))
|
||||
|
||||
def getService(self):
|
||||
if self.DCOP:
|
||||
return self.DCOP
|
||||
running = re.findall('^' + self.serviceName + "(?:-\\d*)?$", DCOP_ITEMS, re.M)
|
||||
if type(running) is list:
|
||||
try:
|
||||
running=running[0]
|
||||
except IndexError:
|
||||
running=''
|
||||
self.DCOP=running.strip()
|
||||
self.running=bool(self.DCOP)
|
||||
return self.DCOP
|
||||
|
||||
def grab(self, item):
|
||||
if item and self.isRunning():
|
||||
return self.reEncodeString(os.popen("dcop %s %s"%(self.DCOP, item)).readline().rstrip('\n'))
|
||||
return ''
|
||||
|
||||
def isRunning(self):
|
||||
self.getService()
|
||||
return self.running
|
||||
|
||||
class AmarokPlayer(DCOPPlayer):
|
||||
def __init__(self):
|
||||
DCOPPlayer.__init__(self,'Amarok','amarok','player title','player artist','player album')
|
||||
|
||||
def getData(self):
|
||||
data=DCOPPlayer.getData(self)
|
||||
if not any(data):
|
||||
data=(self.grab('player nowPlaying'),'','')
|
||||
if not data[0]:
|
||||
return ''
|
||||
return data
|
||||
|
||||
#class Amarok2Player(Player):
|
||||
# def __init__(self):
|
||||
# Player.__init__(self, 'Amarok2', 'audio')
|
||||
# self.isRunning()
|
||||
#
|
||||
# def getData(self):
|
||||
# playing=os.popen("qdbus org.mpris.amarok /Player PositionGet").readline().strip() != "0"
|
||||
# if playing and self.isRunning():
|
||||
# for line in os.popen("qdbus org.mpris.amarok /Player GetMetadata").readlines():
|
||||
# if re.match("^title", line):
|
||||
# title=self.reEncodeString(line.strip().split(None,1)[1])
|
||||
# if re.match("^artist", line):
|
||||
# artist=self.reEncodeString(line.strip().split(None,1)[1])
|
||||
# if re.match("^album", line):
|
||||
# album=self.reEncodeString(line.strip().split(None,1)[1])
|
||||
# return (title, artist, album)
|
||||
# else:
|
||||
# return ''
|
||||
#
|
||||
# def isRunning(self):
|
||||
# qdbus_items=subprocess.Popen(['qdbus'], stdout=subprocess.PIPE).communicate()[0]
|
||||
# running=re.findall('^ org.mpris.amarok$', qdbus_items, re.M)
|
||||
# if type(running) is list:
|
||||
# try:
|
||||
# running=running[0]
|
||||
# except IndexError:
|
||||
# running=''
|
||||
# self.running=bool(running.strip())
|
||||
# return self.running
|
||||
|
||||
import socket
|
||||
|
||||
class MPD(Player):
|
||||
def __init__(self, display_name):
|
||||
Player.__init__(self, display_name)
|
||||
|
||||
self.host = "localhost"
|
||||
self.port = 6600
|
||||
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.sock.settimeout(0.5)
|
||||
|
||||
try:
|
||||
self.sock.connect((self.host, self.port))
|
||||
# just welcome message, we don't need it
|
||||
self.sock.recv(1024)
|
||||
self.running = True
|
||||
except socket.error:
|
||||
self.running = False
|
||||
|
||||
def getData(self):
|
||||
if not self.running:
|
||||
return ''
|
||||
try:
|
||||
self.sock.send("currentsong\n")
|
||||
data = self.sock.recv(1024)
|
||||
except socket.error:
|
||||
return ''
|
||||
|
||||
# mpd sends OK always, so if nothing to show, we should seek for at least 3 chars
|
||||
if len(data) < 4:
|
||||
return ''
|
||||
else:
|
||||
# if there is Artist, Title and Album, get it
|
||||
data=data.splitlines()
|
||||
d={}
|
||||
for i in data:
|
||||
if ':' not in i:
|
||||
continue
|
||||
k,v=i.split(':',1)
|
||||
d[k.lower()]=self.reEncodeString(v.strip())
|
||||
data=(d.get('title',''),d.get('artist',''),d.get('album',''))
|
||||
if not any(data):
|
||||
return d.get('file','')
|
||||
return data
|
||||
|
||||
class StupidPlayer(DCOPPlayer):
|
||||
def getData(self):
|
||||
data=DCOPPlayer.getData(self)[0]
|
||||
if data:
|
||||
if data.startswith('URL'):
|
||||
# KMPlayer window titles in the form of "URL - file:///path/to/<media file> - KMPlayer"
|
||||
data=data.split(None,2)[2].rsplit(None,2)[0].rsplit('/')[-1]
|
||||
else:
|
||||
# KPlayer window titles in the form of "<media file> - KPlayer"
|
||||
data=data.rsplit(None,2)[0]
|
||||
return (data,'','')
|
||||
return ''
|
||||
|
||||
try:
|
||||
import xmms.common
|
||||
class XmmsPlayer(Player):
|
||||
def __init__(self, display_name):
|
||||
Player.__init__(self, display_name)
|
||||
|
||||
def isRunning(self):
|
||||
self.running = xmms.control.is_running()
|
||||
return self.running
|
||||
|
||||
def getData(self):
|
||||
if self.isRunning() and xmms.control.is_playing():
|
||||
# get the position in the playlist for current playing track
|
||||
index = xmms.control.get_playlist_pos();
|
||||
# get the title of the currently playing track
|
||||
return (self.reEncodeString(xmms.control.get_playlist_title(index)),'','')
|
||||
return ''
|
||||
|
||||
except ImportError:
|
||||
XmmsPlayer=Player
|
||||
|
||||
class AudaciousPlayer(Player):
|
||||
def __init__(self, display_name):
|
||||
Player.__init__(self, display_name)
|
||||
|
||||
def isRunning(self):
|
||||
self.running = not os.system('audtool current-song')
|
||||
return self.running
|
||||
|
||||
def getData(self):
|
||||
if self.isRunning() and not os.system('audtool playback-playing'):
|
||||
# get the title of the currently playing track
|
||||
data = os.popen('audtool current-song').read().strip()
|
||||
data_list = data.split(' - ')
|
||||
list_length = len(data_list)
|
||||
if list_length == 1:
|
||||
return (self.reEncodeString(data_list[0]),'','')
|
||||
elif list_length == 3:
|
||||
return (self.reEncodeString(data_list[-1]),data_list[0],data_list[1])
|
||||
else:
|
||||
return (self.reEncodeString(data),'','')
|
||||
else:
|
||||
return ''
|
||||
|
||||
|
||||
def playing(playerList, mode=None):
|
||||
for i in playerList:
|
||||
s=i.get(mode)
|
||||
if s:
|
||||
tell([IRC_SERVER, TARGET, s], 'say' )
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def handleErrors(playerList, kind):
|
||||
if kind:
|
||||
kind=kind.strip()
|
||||
kind=kind.center(len(kind)+2)
|
||||
else:
|
||||
kind= ' supported '
|
||||
x=any([i.running for i in playerList])
|
||||
if x:
|
||||
l=[i.displayName for i in playerList if i.isRunning()]
|
||||
err= "Nothing is playing in %s."%(', '.join(l))
|
||||
else:
|
||||
err= "No%splayers are running."%(kind,)
|
||||
tell(err,'error')
|
||||
|
||||
def run(kind):
|
||||
if not kind:
|
||||
kind = ''
|
||||
play=PLAYERS
|
||||
else:
|
||||
if kind in ['audio', 'video']:
|
||||
unsorted=dict([(i.displayName.lower(),i) for i in PLAYERS if kind in i.type])
|
||||
play=[unsorted.pop(i.lower(),Player("ImproperlySupported")) for i in playerRankings[kind]]
|
||||
if len(unsorted):
|
||||
play.extend(unsorted.values())
|
||||
else:
|
||||
play=[i for i in PLAYERS if i.displayName.lower() == kind]
|
||||
try:
|
||||
kind=play[0].displayName
|
||||
except IndexError:
|
||||
tell("%s is not a supported player."%(kind,),'error')
|
||||
sys.exit(0)
|
||||
|
||||
if not playing(play, kind):
|
||||
handleErrors(play, kind)
|
||||
|
||||
|
||||
#It would be so nice to just keep this pipe open and use it for all the dcop action,
|
||||
#but of course you're supposed to use the big iron (language bindings) instead of
|
||||
#the command line tools. One could consider `dcop` the bash dcop language binding,
|
||||
#but of course when using shell you don't need to be efficient at all, right?
|
||||
|
||||
DCOP_ITEMS=subprocess.Popen(['dcop'], stdout=subprocess.PIPE).communicate()[0] #re.findall("^amarok(?:-\\d*)?$",l,re.M)
|
||||
|
||||
# Add your new players here. No more faulty logic due to copy+paste.
|
||||
|
||||
PLAYERS = [
|
||||
AmarokPlayer(),
|
||||
DCOPPlayer("JuK","juk","Player trackProperty Title","Player trackProperty Artist","Player trackProperty Album"),
|
||||
DCOPPlayer("Noatun",'noatun',"Noatun title",playerType='audio, video'),
|
||||
DCOPPlayer("Kaffeine","kaffeine","KaffeineIface title","KaffeineIface artist","KaffeineIface album",playerType='video, audio'),
|
||||
StupidPlayer("KMPlayer","kmplayer","kmplayer-mainwindow#1 caption",playerType="video audio"),
|
||||
StupidPlayer("KPlayer","kplayer","kplayer-mainwindow#1 caption",playerType="video audio"),
|
||||
DCOPPlayer("KsCD","kscd","CDPlayer currentTrackTitle","CDPlayer currentArtist","CDPlayer currentAlbum"),
|
||||
DCOPPlayer("kdetv","kdetv","KdetvIface channelName",playerType='video'),
|
||||
AudaciousPlayer('Audacious'), XmmsPlayer('XMMS'),
|
||||
DCOPPlayer("Yammi","yammi","YammiPlayer songTitle","YammiPlayer songArtist","YammiPlayer songAlbum"),
|
||||
MPD('MPD')
|
||||
]
|
||||
|
||||
# Get rid of players that didn't get subclassed so they don't appear in the available players list
|
||||
for i in PLAYERS[:]:
|
||||
if type(i) is Player:
|
||||
PLAYERS.remove(i)
|
||||
|
||||
if REGEX_FIXUP:
|
||||
FIXUP=REGEX_FIXUP
|
||||
elif SIMPLE_FIXUP:
|
||||
FIXUP="[%s]"%(SIMPLE_FIXUP)
|
||||
else:
|
||||
FIXUP=''
|
||||
|
||||
# It all comes together right here
|
||||
if __name__=="__main__":
|
||||
|
||||
if not TARGET:
|
||||
s="""media v2.0.1 for Konversation 1.0. One media command to rule them all, inspired from Kopete's now listening plugin.
|
||||
Usage:
|
||||
"\00312/media\017" - report what the first player found is playing
|
||||
"\00312/media\017 [ '\00312audio\017' | '\00312video\017' ]" - report what is playing in a supported audio or video player
|
||||
"\00312/media\017 { \00312Player\017 }" - report what is playing in \00312Player\017 if it is supported
|
||||
|
||||
Available players are:
|
||||
""" + ', '.join([("%s (%s)"%(i.displayName,i.type)) for i in PLAYERS])
|
||||
|
||||
for i in s.splitlines():
|
||||
tell(i)
|
||||
#tell("%s"%(len(s.splitlines()),))
|
||||
# called from the server tab
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
kind = sys.argv[4].lower()
|
||||
except IndexError:
|
||||
kind = None
|
||||
|
||||
run(kind)
|
||||
|
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Prints the contents of the clipbaord into Konversation with flood protection.
|
||||
# Klipper must be running.
|
||||
# Usage: /exec sayclip [pause-time]
|
||||
# Pause time defaults to 1 second.
|
||||
# By Gary Cramblitt (garycramblitt@comcast.net)
|
||||
# Use however you wish.
|
||||
|
||||
PORT=$1;
|
||||
SERVER=$2;
|
||||
TARGET=$3;
|
||||
PAUSETIME="1s";
|
||||
if [ -n "$4" ]
|
||||
then
|
||||
PAUSETIME="$4"
|
||||
fi
|
||||
|
||||
dcop klipper klipper getClipboardContents | while read line; do dcop $PORT default say $SERVER "$TARGET" " $line"; sleep $PAUSETIME; done
|
@ -0,0 +1,86 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Licensed under GPL v2 or later at your option
|
||||
# Copyright 2004 by Michiel de Boer <infobash@rebelhomicide.demon.nl>
|
||||
# Copyright 2006 by Emil Obermayr <nobs@tigress.com>
|
||||
#
|
||||
# this version is stripped down to no-color
|
||||
#
|
||||
# get full original version at http://rebelhomicide.demon.nl/scripts/
|
||||
|
||||
PORT=$1;
|
||||
SERVER=$2;
|
||||
TARGET=$3;
|
||||
|
||||
export LC_ALL="C"
|
||||
|
||||
HN="$(hostname)"
|
||||
OSKERN="$(uname -s) $(uname -r)"
|
||||
if [ "$KDE_FULL_SESSION" = "true" ]; then
|
||||
if [ "$KDE_SESSION_VERSION" = 4 ]; then
|
||||
KDE="$(kde4-config --version | sed -n '2p' | sed 's/://;s/ *$//')"
|
||||
else
|
||||
KDE="$(kde-config --version | sed -n '2p' | sed 's/://;s/ *$//')"
|
||||
fi
|
||||
fi
|
||||
|
||||
CPU=$(awk -F':' '/model name/{name=$2}
|
||||
/cpu MHz/{mhz=int($2)}
|
||||
/bogomips/ {bogo=int($2)
|
||||
}
|
||||
END{
|
||||
gsub (/ *\(tm\) */, " ", name);
|
||||
gsub (/ *\(TM\) */, " ", name);
|
||||
gsub (/ *Processor */, " ", name);
|
||||
gsub (/ *$/, "", name);
|
||||
gsub (/^ */, "", name);
|
||||
printf "CPU: %s at %d MHz (%d bogomips)", name, mhz, bogo;
|
||||
}
|
||||
' /proc/cpuinfo )
|
||||
|
||||
HDD=$(df -lP| awk '($1~/\/dev/){
|
||||
use+=$3/1024^2;
|
||||
tot+=$2/1024^2;
|
||||
}
|
||||
END{print "HD: " int(use) "/" int(tot) "GB"}')
|
||||
|
||||
MEM=$(awk '($1=="MemTotal:"){tot=int($2/1024)}
|
||||
($1=="MemFree:"){free=int($2/1024)}
|
||||
END{
|
||||
use=tot-free
|
||||
print "RAM: " use "/" tot "MB"}
|
||||
' /proc/meminfo)
|
||||
|
||||
PROC="$(($(ps aux | wc -l)-1))"
|
||||
|
||||
UPT=$(awk '{u="s";
|
||||
n=$1;
|
||||
if (n>60){
|
||||
n2=n%60;
|
||||
n/=60;
|
||||
u="min";
|
||||
if (n>60){
|
||||
n2=n%60;
|
||||
n/=60;
|
||||
u="h";
|
||||
if (n>24){
|
||||
n2=n%24;
|
||||
n/=24;
|
||||
u="d";
|
||||
}
|
||||
}
|
||||
}
|
||||
printf ("%d.%d%s up",n, n2, u);
|
||||
}' /proc/uptime )
|
||||
|
||||
out="Sysinfo for '$HN': $OSKERN running $KDE, $CPU, $HDD, $MEM, $PROC proc's, ${UPT}"
|
||||
|
||||
if [ "x$PORT" = "x" ] ; then
|
||||
echo "$out"
|
||||
else
|
||||
if [ "x$TARGET" = "x" ] ; then
|
||||
dcop $PORT default error "$out"
|
||||
else
|
||||
dcop $PORT default say $SERVER "$TARGET" "$out"
|
||||
fi
|
||||
fi
|
@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Creates a TinyURL from a long URL
|
||||
# Licensed under GPL v2 or later at your option
|
||||
# Copyright 2007 Terence Simpson
|
||||
|
||||
PORT=$1
|
||||
SERVER=$2
|
||||
TARGET=$3
|
||||
export URL="$4"
|
||||
NICK="$5"
|
||||
|
||||
if test ! -z $URL; then
|
||||
if test $(which curl); then
|
||||
TINYURL="$(curl -s -i http://tinyurl.com/create.php?url=$URL|grep "The following URL" -A3|tail -1|awk -F\> '{print $3}'|sed 's,</b,,')"
|
||||
else
|
||||
TINYURL="$(wget -T10 -t2 -qO- http://tinyurl.com/create.php?url=$URL|grep "The following URL" -A3|tail -1|awk -F\> '{print $3}'|sed 's,</b,,')"
|
||||
fi
|
||||
else dcop $PORT default error "No url given: usage is \"/tinyurl URL [NickName]\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z $TINYURL; then
|
||||
dcop $PORT default error "Unable run tinyurl script, please make sure you have curl or wget installed"
|
||||
else
|
||||
if test ! -z $NICK; then
|
||||
dcop $PORT default say $SERVER "$TARGET" "${NICK}: $TINYURL"
|
||||
else
|
||||
dcop $PORT default say $SERVER "$TARGET" "$TINYURL"
|
||||
fi
|
||||
fi
|
@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
# Uptime script for Konversation
|
||||
# made by Magnus Romnes (gromnes@online.no)
|
||||
# The script might be uncompatible with other unix variants than linux.
|
||||
# only tested on Debian GNU/Linux Sid
|
||||
# use the code for whatever you wish :-)
|
||||
|
||||
|
||||
$PORT = shift;
|
||||
$SERVER = shift;
|
||||
$TARGET = shift;
|
||||
|
||||
$PLATFORM = `uname -s`;
|
||||
chomp($PLATFORM);
|
||||
if($PLATFORM eq "FreeBSD") {
|
||||
$BOOTTIME = `sysctl kern.boottime`;
|
||||
$BOOTTIME =~ s/.* sec = ([0-9]+).*/\1/;
|
||||
$TIMENOW = `date +%s`;
|
||||
$seconds = $TIMENOW - $BOOTTIME;
|
||||
} else {
|
||||
$UPTIME = `cat /proc/uptime`;
|
||||
if (not $UPTIME) {
|
||||
exec 'dcop', $PORT, 'default', 'info', 'Could not read uptime. Check that /proc/uptime exists.';
|
||||
}
|
||||
@uparray = split(/\./, $UPTIME);
|
||||
$seconds = $uparray[0];
|
||||
}
|
||||
|
||||
if($seconds >= 86400)
|
||||
{
|
||||
$days = int($seconds/86400);
|
||||
$seconds = $seconds-($days*86400);
|
||||
}
|
||||
if($seconds >= 3600)
|
||||
{
|
||||
$hours = int($seconds/3600);
|
||||
$seconds = $seconds-($hours*3600);
|
||||
}
|
||||
if($seconds > 60)
|
||||
{
|
||||
$minutes = int($seconds/60);
|
||||
}
|
||||
if( $days && $hours ) {
|
||||
exec 'dcop', $PORT, 'default', 'say', $SERVER, $TARGET, "Uptime: $days days, $hours hours and $minutes minutes";
|
||||
}
|
||||
elsif( !$days && $hours ) {
|
||||
exec 'dcop', $PORT, 'default', 'say', $SERVER, $TARGET, "Uptime: $hours hours and $minutes minutes";
|
||||
}
|
||||
elsif( $days && !$hours ) {
|
||||
exec 'dcop', $PORT, 'default', 'say', $SERVER, $TARGET, "Uptime: $days days and $minutes minutes";
|
||||
}
|
||||
elsif( !$days && !$hours ) {
|
||||
exec 'dcop', $PORT, 'default', 'say', $SERVER, $TARGET, "Uptime: $minutes minutes";
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2005,2007 by İsmail Dönmez <ismail@pardus.org.tr>
|
||||
# Licensed under GPL v2 or later at your option
|
||||
|
||||
import sys
|
||||
from subprocess import *
|
||||
|
||||
port = sys.argv[1]
|
||||
server = sys.argv[2]
|
||||
target = sys.argv[3]
|
||||
|
||||
msg_template = "Current weather for %%B%s%%B : Temperature: %%B%s%%B, Pressure: %%B%s%%B, Wind: %%B%s%%B"
|
||||
msg_detailed_template = "Current weather for %%B%s%%B : %%B%s%%B, Temperature: %%B%s%%B, Pressure: %%B%s%%B, Wind: %%B%s%%B"
|
||||
|
||||
def printMessage(message=None):
|
||||
Popen(['dcop', port, 'default', 'say', server, target, message]).communicate()
|
||||
|
||||
def printError(message=None):
|
||||
Popen(['dcop', port, 'default', 'error', message]).communicate()
|
||||
|
||||
def getData(section, station=None):
|
||||
if station:
|
||||
data = Popen(['dcop','KWeatherService','WeatherService', section, station], stdout=PIPE).communicate()[0].rstrip("\n")
|
||||
else:
|
||||
data = Popen(['dcop','KWeatherService','WeatherService', section], stdout=PIPE).communicate()[0].rstrip("\n")
|
||||
|
||||
return data
|
||||
|
||||
def stationMessage(station):
|
||||
city = getData("stationName", station)
|
||||
temperature = getData("temperature", station)
|
||||
pressure = getData("pressure", station)
|
||||
wind = getData("wind", station)
|
||||
detail = getData("weather", station)
|
||||
detail2 = getData("cover", station)
|
||||
|
||||
if detail2:
|
||||
if detail:
|
||||
detail = detail+', '+detail2
|
||||
else:
|
||||
detail = detail2
|
||||
|
||||
if detail:
|
||||
return msg_detailed_template % (city,detail,temperature,pressure,wind)
|
||||
else:
|
||||
return msg_template % (city,temperature,pressure,wind)
|
||||
|
||||
def printWeather(index):
|
||||
stations = getData("listStations").split("\n")
|
||||
|
||||
if index != None:
|
||||
if index <= 0:
|
||||
printError("Station index should be bigger than zero!")
|
||||
elif index > len(stations):
|
||||
printError("Station index is out of range")
|
||||
else:
|
||||
printMessage(stationMessage(stations[index-1]))
|
||||
else:
|
||||
for station in stations:
|
||||
printMessage(stationMessage(station))
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
index = int(sys.argv[4])
|
||||
except IndexError:
|
||||
index = None
|
||||
|
||||
printWeather(index)
|
@ -0,0 +1,73 @@
|
||||
SUBDIRS = config linkaddressbook blowfish .
|
||||
|
||||
METASOURCES = AUTO
|
||||
|
||||
bin_PROGRAMS = konversation
|
||||
|
||||
konversation_SOURCES = konviface.skel konviconfigdialog.cpp konversationstatusbar.cpp \
|
||||
konvisettingsdialog.cpp viewcontainer.cpp viewtree.cpp viewtreeitem.cpp konversationmainwindow.cpp \
|
||||
valuelistviewitem.cpp urlcatcher.cpp scriptlauncher.cpp rawlog.cpp konvdcop.cpp channellistpanel.cpp \
|
||||
konsolepanel.cpp identity.cpp statuspanel.cpp dccrecipientdialog.cpp topiccombobox.cpp nicksonline.cpp \
|
||||
dcctransferpanel.cpp dcctransferpanelitem.cpp highlight.cpp highlightviewitem.cpp modebutton.cpp \
|
||||
ignore_preferencesui.ui ignore_preferences.cpp ignore.cpp nicklistview.cpp ircinput.cpp \
|
||||
channeloptionsui.ui channeloptionsdialog.cpp ignorelistviewitem.cpp images.cpp quickbutton.cpp \
|
||||
chatwindow.cpp outputfilter.cpp logfilereader.cpp query.cpp konversationapplication.cpp nick.cpp \
|
||||
inputfilter.cpp channel.cpp ircview.cpp server.cpp main.cpp dcc_preferencesui.ui log_preferences.ui \
|
||||
tabs_preferencesui.ui tabs_preferences.cpp chatwindowappearance_preferences.ui irccolorchooserui.ui \
|
||||
colorsappearance_preferences.ui irccolorchooser.cpp channellistviewitem.cpp osd.cpp trayicon.cpp \
|
||||
dccchat.cpp multilineedit.cpp nickinfo.cpp dccresumedialog.cpp konversationsound.cpp quickconnectdialog.cpp \
|
||||
serverlistdialog.cpp dcctransfersend.cpp dcctransferrecv.cpp channelnick.cpp insertchardialog.cpp \
|
||||
irccharsets.cpp editnotifydialog.cpp common.cpp serverison.cpp sslsocket.cpp servergroupsettings.cpp \
|
||||
serversettings.cpp servergroupdialog.cpp ssllabel.cpp serverdialog.cpp channeldialog.cpp identitydialog.cpp \
|
||||
topiclabel.cpp notificationhandler.cpp joinchannelui.ui joinchanneldialog.cpp emoticon.cpp \
|
||||
chatwindowbehaviour_preferences.ui alias_preferencesui.ui osd_preferencesui.ui theme_preferencesui.ui \
|
||||
highlight_preferencesui.ui warnings_preferencesui.ui warnings_preferences.cpp quickbuttons_preferencesui.ui \
|
||||
watchednicknames_preferencesui.ui generalbehavior_preferences.ui connectionbehavior_preferences.ui \
|
||||
fontappearance_preferences.ui nicklistbehavior_preferencesui.ui konvibookmarkhandler.cpp konvibookmarkmenu.cpp \
|
||||
ircviewbox.cpp searchbar.cpp osd_preferences.cpp theme_preferences.cpp dcc_preferences.cpp \
|
||||
alias_preferences.cpp highlight_preferences.cpp watchednicknames_preferences.cpp quickbuttons_preferences.cpp \
|
||||
nicklistbehavior_preferences.cpp tabnotifications_preferences.ui multilinetextedit.cpp serverlistview.cpp \
|
||||
nicksonlineitem.cpp searchbarbase.ui autoreplace_preferencesui.ui autoreplace_preferences.cpp \
|
||||
servergroupdialogui.ui dcctransfer.cpp dcctransfermanager.cpp dcctransferdetailedinfopanelui.ui \
|
||||
dcctransferdetailedinfopanel.cpp dcccommon.cpp queuetunerbase.ui queuetuner.cpp ircqueue.cpp \
|
||||
connectionsettings.cpp connectionmanager.cpp awaymanager.cpp
|
||||
|
||||
konversation_COMPILE_FIRST = config/preferences_base.h
|
||||
konversation_LDADD = $(LIB_KIO) $(LIB_XSS) $(LIB_KABC) $(LIB_KIMIFACE) linkaddressbook/liblinkaddressbookui.la blowfish/libblowfish.la config/libkonversationconfig.la
|
||||
|
||||
xdg_apps_DATA = konversation.desktop
|
||||
|
||||
# set the include path for X, qt and KDE
|
||||
INCLUDES= -Ilinkaddressbook -I$(srcdir)/linkaddressbook -Iblowfish -I$(srcdir)/blowfish\
|
||||
-Iconfig -I$(srcdir)/config $(all_includes)
|
||||
# the library search path.
|
||||
konversation_LDFLAGS = $(all_libraries) $(KDE_RPATH)
|
||||
|
||||
rcdir = $(kde_datadir)/konversation
|
||||
rc_DATA = konversationui.rc eventsrc
|
||||
|
||||
kdelnk_DATA = konvirc.protocol konvirc6.protocol
|
||||
kdelnkdir = $(kde_servicesdir)
|
||||
|
||||
updatedir = $(kde_datadir)/kconf_update
|
||||
update_DATA = konversation.upd
|
||||
update_SCRIPTS = konversation-0.19-colors.pl konversation-0.19-sortorder.pl konversation-0.19-appearance.pl \
|
||||
konversation-0.19-tabplacement.pl konversation-0.19-custombrowser.pl \
|
||||
konversation-0.19-colorcodes.pl konversation-0.19-notifylists.pl \
|
||||
konversation-0.20-quickbuttons.pl konversation-0.20-customfonts.pl
|
||||
|
||||
messages: rc.cpp
|
||||
LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
|
||||
if test -n "$$LIST"; then \
|
||||
$(XGETTEXT) $$LIST -o $(podir)/konversation.pot; \
|
||||
fi
|
||||
|
||||
noinst_HEADERS = serverlistdialog.h dcctransfersend.h dcctransferrecv.h \
|
||||
insertchardialog.h editnotifydialog.h serverison.h \
|
||||
servergroupsettings.h serversettings.h servergroupdialog.h serverdialog.h channeldialog.h \
|
||||
identitydialog.h topiclabel.h channeloptionsdialog.h joinchanneldialog.h \
|
||||
highlight_preferences.h watchednicknames_preferences.h quickbuttons_preferences.h \
|
||||
nicklistbehavior_preferences.h konvisettingspage.h nicksonlineitem.h
|
||||
|
||||
# User might still have these in src/ instead of src/config, so remove these in that case
|
||||
CLEANFILES = preferences_base.h preferences_base.cpp watchednicknamesconfigcontroller.*
|
@ -0,0 +1,223 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (C) 2006 Dario Abatianni <eisfuchs@tigress.com>
|
||||
Copyright (C) 2006 John Tapsell <johnflux@gmail.com>
|
||||
*/
|
||||
|
||||
#include "alias_preferences.h"
|
||||
#include "config/preferences.h"
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qheader.h>
|
||||
|
||||
#include <kapplication.h>
|
||||
#include <kdebug.h>
|
||||
#include <kconfig.h>
|
||||
#include <klocale.h>
|
||||
#include <klineedit.h>
|
||||
#include <klistview.h>
|
||||
|
||||
|
||||
Alias_Config::Alias_Config(QWidget* parent, const char* name)
|
||||
: Alias_ConfigUI(parent, name)
|
||||
{
|
||||
// reset flag to defined state (used to block signals when just selecting a new item)
|
||||
m_newItemSelected = false;
|
||||
|
||||
// populate listview
|
||||
loadSettings();
|
||||
|
||||
// make items react to drag & drop
|
||||
aliasListView->setSorting(-1,false);
|
||||
aliasListView->header()->setMovingEnabled(false);
|
||||
|
||||
connect(aliasListView, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(entrySelected(QListViewItem*)));
|
||||
connect(aliasListView, SIGNAL(clicked(QListViewItem*)), this, SLOT(entrySelected(QListViewItem*)) );
|
||||
connect(aliasListView, SIGNAL(moved()), this, SIGNAL(modified()));
|
||||
|
||||
connect(aliasInput, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
|
||||
connect(replacementInput, SIGNAL(textChanged(const QString&)), this, SLOT(actionChanged(const QString&)));
|
||||
|
||||
connect(newButton, SIGNAL(clicked()), this, SLOT(addEntry()));
|
||||
connect(removeButton, SIGNAL(clicked()), this, SLOT(removeEntry()));
|
||||
}
|
||||
|
||||
Alias_Config::~Alias_Config()
|
||||
{
|
||||
}
|
||||
|
||||
void Alias_Config::loadSettings()
|
||||
{
|
||||
setAliasListView(Preferences::aliasList());
|
||||
}
|
||||
|
||||
void Alias_Config::saveSettings()
|
||||
{
|
||||
QStringList newList=currentAliasList();
|
||||
Preferences::setAliasList(newList);
|
||||
|
||||
// saved list is now old list, to check for changes
|
||||
m_oldAliasList=newList;
|
||||
}
|
||||
|
||||
void Alias_Config::restorePageToDefaults()
|
||||
{
|
||||
aliasListView->clear();
|
||||
setAliasListView(Preferences::defaultAliasList());
|
||||
}
|
||||
|
||||
bool Alias_Config::hasChanged()
|
||||
{
|
||||
return (currentAliasList() != m_oldAliasList);
|
||||
}
|
||||
|
||||
void Alias_Config::setAliasListView(const QStringList& aliasList)
|
||||
{
|
||||
aliasListView->clear();
|
||||
|
||||
// Insert alias items backwards to get them sorted properly
|
||||
for(int index=aliasList.count(); index!=0; index--)
|
||||
{
|
||||
QString item=aliasList[index-1];
|
||||
new KListViewItem(aliasListView,item.section(' ',0,0),item.section(' ',1));
|
||||
}
|
||||
|
||||
aliasListView->setSelected(aliasListView->firstChild(), true);
|
||||
// remember alias list
|
||||
m_oldAliasList=aliasList;
|
||||
}
|
||||
|
||||
QStringList Alias_Config::currentAliasList()
|
||||
{
|
||||
QStringList newList;
|
||||
|
||||
QListViewItem* item=aliasListView->itemAtIndex(0);
|
||||
while(item)
|
||||
{
|
||||
newList.append(item->text(0)+' '+item->text(1));
|
||||
item=item->itemBelow();
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
// what to do when the user selects an item
|
||||
void Alias_Config::entrySelected(QListViewItem* aliasEntry)
|
||||
{
|
||||
// play it safe, assume disabling all widgets first
|
||||
bool enabled = false;
|
||||
|
||||
// check if there really was an item selected
|
||||
if (aliasEntry)
|
||||
{
|
||||
// remember to enable the editing widgets
|
||||
enabled = true;
|
||||
// tell the editing widgets not to emit modified() on signals now
|
||||
m_newItemSelected = true;
|
||||
// update editing widget contents
|
||||
aliasInput->setText(aliasEntry->text(0));
|
||||
replacementInput->setText(aliasEntry->text(1));
|
||||
// re-enable modified() signal on text changes in edit widgets
|
||||
m_newItemSelected = false;
|
||||
}
|
||||
// enable or disable editing widgets
|
||||
removeButton->setEnabled(enabled);
|
||||
aliasLabel->setEnabled(enabled);
|
||||
aliasInput->setEnabled(enabled);
|
||||
replacementLabel->setEnabled(enabled);
|
||||
replacementInput->setEnabled(enabled);
|
||||
}
|
||||
|
||||
// what to do when the user change the name of a quick button
|
||||
void Alias_Config::nameChanged(const QString& newName)
|
||||
{
|
||||
// get possible first selected item
|
||||
QListViewItem* item = aliasListView->selectedItem();
|
||||
|
||||
// sanity check
|
||||
if (item)
|
||||
{
|
||||
// rename item
|
||||
item->setText(0,newName);
|
||||
// tell the config system that something has changed
|
||||
if (!m_newItemSelected) emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
// what to do when the user change the action definition of a quick button
|
||||
void Alias_Config::actionChanged(const QString& newAction)
|
||||
{
|
||||
// get possible first selected item
|
||||
QListViewItem* item = aliasListView->selectedItem();
|
||||
|
||||
// sanity check
|
||||
if (item)
|
||||
{
|
||||
// rename item
|
||||
item->setText(1,newAction);
|
||||
// tell the config system that something has changed
|
||||
if(!m_newItemSelected) emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
// add button pressed
|
||||
void Alias_Config::addEntry()
|
||||
{
|
||||
// add new item at the bottom of list view
|
||||
KListViewItem* newItem = new KListViewItem(aliasListView,aliasListView->lastChild(),i18n("New"),QString());
|
||||
// if successful ...
|
||||
if (newItem)
|
||||
{
|
||||
// select new item and make it the current one
|
||||
aliasListView->setSelected(newItem,true);
|
||||
aliasListView->setCurrentItem(newItem);
|
||||
// set input focus on item name edit
|
||||
aliasInput->setFocus();
|
||||
// select all text to make overwriting easier
|
||||
aliasInput->selectAll();
|
||||
// tell the config system that something has changed
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
// remove button pressed
|
||||
void Alias_Config::removeEntry()
|
||||
{
|
||||
// get possible first selected item
|
||||
QListViewItem* item = aliasListView->selectedItem();
|
||||
|
||||
// sanity check
|
||||
if (item)
|
||||
{
|
||||
// get item below the current one
|
||||
QListViewItem* nextItem = item->itemBelow();
|
||||
// if there was none, get the one above
|
||||
if(!nextItem) nextItem = item->itemAbove();
|
||||
|
||||
// remove the item from the list
|
||||
delete item;
|
||||
|
||||
// check if we found the next item
|
||||
if (nextItem)
|
||||
{
|
||||
// select the item and make it the current ite,
|
||||
aliasListView->setSelected(nextItem,true);
|
||||
aliasListView->setCurrentItem(nextItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
// no next item found, this means the list is empty
|
||||
entrySelected(0);
|
||||
}
|
||||
// tell the config system that somethig has changed
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
#include "alias_preferences.moc"
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (C) 2006 Dario Abatianni <eisfuchs@tigress.com>
|
||||
Copyright (C) 2006 John Tapsell <johnflux@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef EXALIASPREFERENCES_H
|
||||
#define EXALIASPREFERENCES_H
|
||||
|
||||
#include "alias_preferencesui.h"
|
||||
#include "konvisettingspage.h"
|
||||
|
||||
class Alias_Config : public Alias_ConfigUI, public KonviSettingsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Alias_Config(QWidget* parent, const char* name = 0);
|
||||
~Alias_Config();
|
||||
|
||||
virtual void saveSettings();
|
||||
virtual void loadSettings();
|
||||
virtual void restorePageToDefaults();
|
||||
virtual bool hasChanged();
|
||||
|
||||
signals:
|
||||
void modified();
|
||||
|
||||
protected slots:
|
||||
void entrySelected(QListViewItem* aliasEntry);
|
||||
void nameChanged(const QString& newName);
|
||||
void actionChanged(const QString& newAction);
|
||||
void addEntry();
|
||||
void removeEntry();
|
||||
|
||||
protected:
|
||||
void setAliasListView(const QStringList& aliasList);
|
||||
|
||||
bool m_newItemSelected;
|
||||
|
||||
QStringList m_oldAliasList;
|
||||
QStringList currentAliasList();
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,174 @@
|
||||
<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
|
||||
<class>Alias_ConfigUI</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>Alias_ConfigUI</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>292</width>
|
||||
<height>206</height>
|
||||
</rect>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout7</cstring>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLabel" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>aliasLabel</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Alias:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>replacementLabel</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Replacement:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KLineEdit" row="0" column="1">
|
||||
<property name="name">
|
||||
<cstring>aliasInput</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KLineEdit" row="1" column="1">
|
||||
<property name="name">
|
||||
<cstring>replacementInput</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<widget class="KListView" row="0" column="0">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Alias</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Replacement</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<property name="name">
|
||||
<cstring>aliasListView</cstring>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="hScrollBarMode">
|
||||
<enum>Auto</enum>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="fullWidth">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="itemsRenameable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget" row="0" column="1" rowspan="2" colspan="1">
|
||||
<property name="name">
|
||||
<cstring>layout8</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>newButton</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&New...</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>removeButton</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer18</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>350</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>aliasListView</tabstop>
|
||||
<tabstop>aliasInput</tabstop>
|
||||
<tabstop>replacementInput</tabstop>
|
||||
<tabstop>newButton</tabstop>
|
||||
<tabstop>removeButton</tabstop>
|
||||
</tabstops>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
|
||||
<includehints>
|
||||
<includehint>klineedit.h</includehint>
|
||||
<includehint>klineedit.h</includehint>
|
||||
<includehint>klistview.h</includehint>
|
||||
</includehints>
|
||||
</UI>
|
@ -0,0 +1,403 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (C) 2006 Dario Abatianni <eisfuchs@tigress.com>
|
||||
Copyright (C) 2006 Eike Hein <hein@kde.org>
|
||||
*/
|
||||
|
||||
#include "autoreplace_preferences.h"
|
||||
#include "config/preferences.h"
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qheader.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qdialog.h>
|
||||
|
||||
#include <kapplication.h>
|
||||
#include <kdebug.h>
|
||||
#include <kconfig.h>
|
||||
#include <klocale.h>
|
||||
#include <klineedit.h>
|
||||
#include <klistview.h>
|
||||
#include <kparts/componentfactory.h>
|
||||
#include <kregexpeditorinterface.h>
|
||||
|
||||
#define DIRECTION_OUTPUT 0
|
||||
#define DIRECTION_INPUT 1
|
||||
#define DIRECTION_BOTH 2
|
||||
|
||||
|
||||
Autoreplace_Config::Autoreplace_Config(QWidget* parent, const char* name)
|
||||
: Autoreplace_ConfigUI(parent, name)
|
||||
{
|
||||
// reset flag to defined state (used to block signals when just selecting a new item)
|
||||
m_newItemSelected=false;
|
||||
|
||||
//Check if the regexp editor is installed
|
||||
bool installed = !KTrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty();
|
||||
|
||||
if(installed)
|
||||
{
|
||||
regExpEditorButton->setEnabled(true);
|
||||
QToolTip::add(regExpEditorButton, i18n("Click to run Regular Expression Editor (KRegExpEditor)"));
|
||||
}
|
||||
else
|
||||
{
|
||||
regExpEditorButton->setEnabled(false);
|
||||
QToolTip::add(regExpEditorButton, i18n("The Regular Expression Editor (KRegExpEditor) is not installed"));
|
||||
}
|
||||
|
||||
// populate combobox
|
||||
directionCombo->insertItem(i18n("Outgoing"),DIRECTION_OUTPUT);
|
||||
directionCombo->insertItem(i18n("Incoming"),DIRECTION_INPUT);
|
||||
directionCombo->insertItem(i18n("Both"),DIRECTION_BOTH);
|
||||
|
||||
// make items react to drag & drop
|
||||
patternListView->setSorting(-1,false);
|
||||
patternListView->setShowSortIndicator(true);
|
||||
patternListView->setShadeSortColumn(true);
|
||||
patternListView->header()->setMovingEnabled(false);
|
||||
|
||||
// populate listview
|
||||
loadSettings();
|
||||
|
||||
connect(patternListView, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(entrySelected(QListViewItem*)));
|
||||
connect(patternListView, SIGNAL(clicked(QListViewItem*)), this, SLOT(entrySelected(QListViewItem*)));
|
||||
connect(patternListView, SIGNAL(moved()), SIGNAL(modified()));
|
||||
|
||||
connect(patternListView, SIGNAL(aboutToMove()), SLOT(disableSort()));
|
||||
connect(patternListView->header(), SIGNAL(clicked(int)), SLOT(sort(int)));
|
||||
|
||||
connect(directionCombo, SIGNAL(activated(int)), this, SLOT(directionChanged(int)));
|
||||
|
||||
connect(patternInput, SIGNAL(textChanged(const QString&)), this, SLOT(patternChanged(const QString&)));
|
||||
connect(regExpEditorButton, SIGNAL(clicked()), this, SLOT(showRegExpEditor()));
|
||||
connect(replacementInput, SIGNAL(textChanged(const QString&)), this, SLOT(replacementChanged(const QString&)));
|
||||
|
||||
connect(newButton, SIGNAL(clicked()), this, SLOT(addEntry()));
|
||||
connect(removeButton, SIGNAL(clicked()), this, SLOT(removeEntry()));
|
||||
}
|
||||
|
||||
Autoreplace_Config::~Autoreplace_Config()
|
||||
{
|
||||
}
|
||||
|
||||
void Autoreplace_Config::loadSettings()
|
||||
{
|
||||
setAutoreplaceListView(Preferences::autoreplaceList());
|
||||
|
||||
// remember autoreplace list for hasChanged()
|
||||
m_oldAutoreplaceList=Preferences::autoreplaceList();
|
||||
}
|
||||
|
||||
// fill listview with autoreplace definitions
|
||||
void Autoreplace_Config::setAutoreplaceListView(const QStringList &autoreplaceList)
|
||||
{
|
||||
// clear listView
|
||||
patternListView->clear();
|
||||
// go through the list
|
||||
for(unsigned int index=autoreplaceList.count();index!=0;index--)
|
||||
{
|
||||
// get autoreplace definition
|
||||
QString definition=autoreplaceList[index-1];
|
||||
// cut definition apart in name and action, and create a new listview item
|
||||
QCheckListItem* newItem=new QCheckListItem(patternListView,QString(),QCheckListItem::CheckBox);
|
||||
// Regular expression?
|
||||
if(definition.section(',',0,0)=="1") newItem->setOn(true);
|
||||
// direction input/output/both
|
||||
if(definition.section(',',1,1)=="i") newItem->setText(1,directionCombo->text(DIRECTION_INPUT));
|
||||
else if(definition.section(',',1,1)=="o") newItem->setText(1,directionCombo->text(DIRECTION_OUTPUT));
|
||||
else if(definition.section(',',1,1)=="io") newItem->setText(1,directionCombo->text(DIRECTION_BOTH));
|
||||
// pattern
|
||||
newItem->setText(2,definition.section(',',2,2));
|
||||
// replacement
|
||||
newItem->setText(3,definition.section(',',3));
|
||||
// hidden column, so we are independent of the i18n()ed display string
|
||||
newItem->setText(4,definition.section(',',1,1));
|
||||
} // for
|
||||
patternListView->setSelected(patternListView->firstChild(), true);
|
||||
}
|
||||
|
||||
// save autoreplace entries to configuration
|
||||
void Autoreplace_Config::saveSettings()
|
||||
{
|
||||
// get configuration object
|
||||
KConfig* config=kapp->config();
|
||||
|
||||
// delete all patterns
|
||||
config->deleteGroup("Autoreplace List");
|
||||
// create new empty autoreplace group
|
||||
config->setGroup("Autoreplace List");
|
||||
|
||||
// create empty list
|
||||
QStringList newList=currentAutoreplaceList();
|
||||
|
||||
// check if there are any patterns in the list view
|
||||
if(newList.count())
|
||||
{
|
||||
// go through all patterns and save them into the configuration
|
||||
for(unsigned int index=0;index<newList.count();index++)
|
||||
{
|
||||
// write the current entry's pattern and replacement (adds a "#" to preserve blanks at the end of the line)
|
||||
config->writeEntry(QString("Autoreplace%1").arg(index),newList[index]+'#');
|
||||
} // for
|
||||
}
|
||||
// if there were no entries at all, write a dummy entry to prevent KConfigXT from "optimizing"
|
||||
// the group out, which would in turn make konvi restore the default entries
|
||||
else
|
||||
config->writeEntry("Empty List",QString());
|
||||
|
||||
// set internal autoreplace list
|
||||
Preferences::setAutoreplaceList(newList);
|
||||
|
||||
// remember autoreplace list for hasChanged()
|
||||
m_oldAutoreplaceList=newList;
|
||||
}
|
||||
|
||||
void Autoreplace_Config::restorePageToDefaults()
|
||||
{
|
||||
setAutoreplaceListView(Preferences::defaultAutoreplaceList());
|
||||
}
|
||||
|
||||
QStringList Autoreplace_Config::currentAutoreplaceList()
|
||||
{
|
||||
// get first item of the autoreplace listview
|
||||
QListViewItem* item=patternListView->firstChild();
|
||||
// create empty list
|
||||
QStringList newList;
|
||||
|
||||
// go through all items and save them into the configuration
|
||||
while(item)
|
||||
{
|
||||
QString checked="0";
|
||||
if(static_cast<QCheckListItem*>(item)->isOn()) checked="1";
|
||||
|
||||
// remember entry in internal list (col 4 is hidden for input/output)
|
||||
newList.append(checked+','+item->text(4)+','+item->text(2)+','+item->text(3));
|
||||
// get next item in the listview
|
||||
item=item->itemBelow();
|
||||
} // while
|
||||
|
||||
// return list
|
||||
return newList;
|
||||
}
|
||||
|
||||
bool Autoreplace_Config::hasChanged()
|
||||
{
|
||||
return(m_oldAutoreplaceList!=currentAutoreplaceList());
|
||||
}
|
||||
|
||||
// slots
|
||||
|
||||
// what to do when the user selects an item
|
||||
void Autoreplace_Config::entrySelected(QListViewItem* autoreplaceEntry)
|
||||
{
|
||||
// play it safe, assume disabling all widgets first
|
||||
bool enabled=false;
|
||||
|
||||
// check if there really was an item selected
|
||||
if(autoreplaceEntry)
|
||||
{
|
||||
// remember to enable the editing widgets
|
||||
enabled=true;
|
||||
|
||||
// tell the editing widgets not to emit modified() on signals now
|
||||
m_newItemSelected=true;
|
||||
// update editing widget contents
|
||||
patternInput->setText(autoreplaceEntry->text(2));
|
||||
replacementInput->setText(autoreplaceEntry->text(3));
|
||||
|
||||
// set combobox to selected item
|
||||
int itemIndex=0;
|
||||
QString direction=autoreplaceEntry->text(4);
|
||||
if(direction=="i") itemIndex=DIRECTION_INPUT;
|
||||
else if(direction=="o") itemIndex=DIRECTION_OUTPUT;
|
||||
else if(direction=="io") itemIndex=DIRECTION_BOTH;
|
||||
directionCombo->setCurrentItem(itemIndex);
|
||||
// re-enable modified() signal on text changes in edit widgets
|
||||
m_newItemSelected=false;
|
||||
}
|
||||
// enable or disable editing widgets
|
||||
removeButton->setEnabled(enabled);
|
||||
directionLabel->setEnabled(enabled);
|
||||
directionCombo->setEnabled(enabled);
|
||||
patternLabel->setEnabled(enabled);
|
||||
patternInput->setEnabled(enabled);
|
||||
replacementLabel->setEnabled(enabled);
|
||||
replacementInput->setEnabled(enabled);
|
||||
|
||||
if(!KTrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty())
|
||||
{
|
||||
regExpEditorButton->setEnabled(enabled);
|
||||
}
|
||||
|
||||
// make checkboxes work
|
||||
emit modified();
|
||||
}
|
||||
|
||||
// what to do when the user changes the direction of an entry
|
||||
void Autoreplace_Config::directionChanged(int newDirection)
|
||||
{
|
||||
// get possible selected item
|
||||
QListViewItem* item=patternListView->selectedItem();
|
||||
|
||||
// sanity check
|
||||
if(item)
|
||||
{
|
||||
// prepare hidden identifier string
|
||||
QString id;
|
||||
// find the direction strings to set up in the item
|
||||
if(newDirection==DIRECTION_INPUT) id="i";
|
||||
else if(newDirection==DIRECTION_OUTPUT) id="o";
|
||||
else if(newDirection==DIRECTION_BOTH) id="io";
|
||||
// rename direction
|
||||
item->setText(1,directionCombo->text(newDirection));
|
||||
item->setText(4,id);
|
||||
// tell the config system that something has changed
|
||||
if(!m_newItemSelected) emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
// what to do when the user changes the pattern of an entry
|
||||
void Autoreplace_Config::patternChanged(const QString& newPattern)
|
||||
{
|
||||
// get possible selected item
|
||||
QListViewItem* item=patternListView->selectedItem();
|
||||
|
||||
// sanity check
|
||||
if(item)
|
||||
{
|
||||
// rename pattern
|
||||
item->setText(2,newPattern);
|
||||
// tell the config system that something has changed
|
||||
if(!m_newItemSelected) emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
// what to do when the user changes the replacement of an entry
|
||||
void Autoreplace_Config::replacementChanged(const QString& newReplacement)
|
||||
{
|
||||
// get possible selected item
|
||||
QListViewItem* item=patternListView->selectedItem();
|
||||
|
||||
// sanity check
|
||||
if(item)
|
||||
{
|
||||
// rename item
|
||||
item->setText(3,newReplacement);
|
||||
// tell the config system that something has changed
|
||||
if(!m_newItemSelected) emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
// add button pressed
|
||||
void Autoreplace_Config::addEntry()
|
||||
{
|
||||
disableSort();
|
||||
|
||||
// add new item at the bottom of list view
|
||||
QCheckListItem* newItem=new QCheckListItem(patternListView,QString(),QCheckListItem::CheckBox);
|
||||
// if successful ...
|
||||
if(newItem)
|
||||
{
|
||||
// set default direction
|
||||
newItem->setText(1,directionCombo->text(DIRECTION_OUTPUT));
|
||||
// set default pattern name
|
||||
newItem->setText(2,i18n("New"));
|
||||
// set default direction
|
||||
newItem->setText(4,"o");
|
||||
// select new item and make it the current one
|
||||
patternListView->setSelected(newItem,true);
|
||||
patternListView->setCurrentItem(newItem);
|
||||
// set input focus on item pattern edit
|
||||
patternInput->setFocus();
|
||||
// select all text to make overwriting easier
|
||||
patternInput->selectAll();
|
||||
// tell the config system that something has changed
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
// remove button pressed
|
||||
void Autoreplace_Config::removeEntry()
|
||||
{
|
||||
// get possible first selected item
|
||||
QListViewItem* item=patternListView->selectedItem();
|
||||
|
||||
// sanity check
|
||||
if(item)
|
||||
{
|
||||
// get item below the current one
|
||||
QListViewItem* nextItem=item->itemBelow();
|
||||
// if there was none, get the one above
|
||||
if(!nextItem) nextItem=item->itemAbove();
|
||||
|
||||
// remove the item from the list
|
||||
delete item;
|
||||
|
||||
// check if we found the next item
|
||||
if(nextItem)
|
||||
{
|
||||
// select the item and make it the current item
|
||||
patternListView->setSelected(nextItem,true);
|
||||
patternListView->setCurrentItem(nextItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
// no next item found, this means the list is empty
|
||||
entrySelected(0);
|
||||
}
|
||||
// tell the config system that somethig has changed
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void Autoreplace_Config::sort(int column)
|
||||
{
|
||||
bool ascending = true;
|
||||
|
||||
if (patternListView->sortColumn() != -1)
|
||||
ascending = (patternListView->sortOrder() == Qt::Ascending);
|
||||
|
||||
patternListView->setSorting(column, ascending);
|
||||
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void Autoreplace_Config::disableSort()
|
||||
{
|
||||
patternListView->setSorting(-1);
|
||||
}
|
||||
|
||||
void Autoreplace_Config::showRegExpEditor()
|
||||
{
|
||||
QDialog *editorDialog =
|
||||
KParts::ComponentFactory::createInstanceFromQuery<QDialog>( "KRegExpEditor/KRegExpEditor" );
|
||||
|
||||
if(editorDialog)
|
||||
{
|
||||
// kdeutils was installed, so the dialog was found. Fetch the editor interface.
|
||||
KRegExpEditorInterface *reEditor =
|
||||
static_cast<KRegExpEditorInterface *>(editorDialog->qt_cast( "KRegExpEditorInterface" ) );
|
||||
Q_ASSERT(reEditor); // This should not fail!
|
||||
reEditor->setRegExp(patternInput->text());
|
||||
int dlgResult = editorDialog->exec();
|
||||
|
||||
if(dlgResult == QDialog::Accepted)
|
||||
{
|
||||
QString re = reEditor->regExp();
|
||||
patternInput->setText(re);
|
||||
}
|
||||
|
||||
delete editorDialog;
|
||||
}
|
||||
}
|
||||
|
||||
#include "autoreplace_preferences.moc"
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (C) 2006 Dario Abatianni <eisfuchs@tigress.com>
|
||||
Copyright (C) 2006 Eike Hein <hein@kde.org>
|
||||
*/
|
||||
|
||||
#ifndef AUTOREPLACECONFIG_H
|
||||
#define AUTOREPLACECONFIG_H
|
||||
|
||||
#include "autoreplace_preferencesui.h"
|
||||
#include "konvisettingspage.h"
|
||||
|
||||
|
||||
class Autoreplace_Config : public Autoreplace_ConfigUI, public KonviSettingsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Autoreplace_Config(QWidget* parent, const char* name=NULL);
|
||||
~Autoreplace_Config();
|
||||
|
||||
virtual void saveSettings();
|
||||
virtual void loadSettings();
|
||||
virtual void restorePageToDefaults();
|
||||
|
||||
virtual bool hasChanged();
|
||||
|
||||
signals:
|
||||
void modified();
|
||||
|
||||
protected slots:
|
||||
void entrySelected(QListViewItem* autoreplaceEntry);
|
||||
void directionChanged(int newDirection);
|
||||
void patternChanged(const QString& newPattern);
|
||||
void replacementChanged(const QString& newReplacement);
|
||||
void addEntry();
|
||||
void removeEntry();
|
||||
void sort(int column);
|
||||
void disableSort();
|
||||
void showRegExpEditor();
|
||||
|
||||
protected:
|
||||
void setAutoreplaceListView(const QStringList &autoreplaceList);
|
||||
|
||||
bool m_newItemSelected;
|
||||
|
||||
QStringList m_oldAutoreplaceList;
|
||||
QStringList currentAutoreplaceList();
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,292 @@
|
||||
<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
|
||||
<class>Autoreplace_ConfigUI</class>
|
||||
<author>Dario Abatianni</author>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>Autoreplace_ConfigUI</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>586</width>
|
||||
<height>576</height>
|
||||
</rect>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="1" rowspan="2" colspan="1">
|
||||
<property name="name">
|
||||
<cstring>layout6</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>newButton</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ne&w</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>removeButton</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>R&emove</string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer1</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>506</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</vbox>
|
||||
</widget>
|
||||
<widget class="KListView" row="0" column="0">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>RegEx</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Replace In</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Find</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Replace With</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<property name="name">
|
||||
<cstring>patternListView</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>7</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="fullWidth">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="itemsRenameable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget" row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout16</cstring>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QPushButton" row="1" column="2">
|
||||
<property name="name">
|
||||
<cstring>regExpEditorButton</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>directionLabel</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Replace in:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KLineEdit" row="1" column="1">
|
||||
<property name="name">
|
||||
<cstring>patternInput</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KLineEdit" row="2" column="1" rowspan="1" colspan="2">
|
||||
<property name="name">
|
||||
<cstring>replacementInput</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>patternLabel</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Find:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" row="2" column="0">
|
||||
<property name="name">
|
||||
<cstring>replacementLabel</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Replace with:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" row="0" column="1" rowspan="1" colspan="2">
|
||||
<property name="name">
|
||||
<cstring>directionCombo</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>patternListView</tabstop>
|
||||
<tabstop>directionCombo</tabstop>
|
||||
<tabstop>patternInput</tabstop>
|
||||
<tabstop>regExpEditorButton</tabstop>
|
||||
<tabstop>replacementInput</tabstop>
|
||||
<tabstop>newButton</tabstop>
|
||||
<tabstop>removeButton</tabstop>
|
||||
</tabstops>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<includehints>
|
||||
<includehint>klistview.h</includehint>
|
||||
<includehint>klineedit.h</includehint>
|
||||
<includehint>klineedit.h</includehint>
|
||||
</includehints>
|
||||
</UI>
|
@ -0,0 +1,372 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 1999 Martin R. Jones <mjones@kde.org>
|
||||
Copyright (C) 2008 Eike Hein <hein@kde.org>
|
||||
*/
|
||||
|
||||
#include "awaymanager.h"
|
||||
#include "konversationapplication.h"
|
||||
#include "konversationmainwindow.h"
|
||||
#include "connectionmanager.h"
|
||||
#include "server.h"
|
||||
#include "preferences.h"
|
||||
|
||||
#include <qtimer.h>
|
||||
|
||||
#include <dcopref.h>
|
||||
#include <kaction.h>
|
||||
#include <klocale.h>
|
||||
|
||||
#include <kdebug.h>
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xresource.h>
|
||||
#include <X11/Xutil.h>
|
||||
#ifdef HAVE_XSCREENSAVER
|
||||
#define HasScreenSaver
|
||||
#include <X11/extensions/scrnsaver.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Don't use XIdle for now, it's experimental.
|
||||
#undef HAVE_XIDLE
|
||||
#undef HasXidle
|
||||
|
||||
|
||||
struct AwayManagerPrivate
|
||||
{
|
||||
int mouseX;
|
||||
int mouseY;
|
||||
unsigned int mouseMask;
|
||||
#ifdef Q_WS_X11
|
||||
Window root;
|
||||
Screen* screen;
|
||||
Time xIdleTime;
|
||||
#endif
|
||||
bool useXidle;
|
||||
bool useMit;
|
||||
};
|
||||
|
||||
AwayManager::AwayManager(QObject* parent) : QObject(parent)
|
||||
{
|
||||
int dummy = 0;
|
||||
dummy = dummy;
|
||||
|
||||
d = new AwayManagerPrivate;
|
||||
|
||||
d->mouseX = d->mouseY = 0;
|
||||
d->mouseMask = 0;
|
||||
d->useXidle = false;
|
||||
d->useMit = false;
|
||||
|
||||
m_connectionManager = static_cast<KonversationApplication*>(kapp)->getConnectionManager();
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
Display* display = qt_xdisplay();
|
||||
d->root = DefaultRootWindow(display);
|
||||
d->screen = ScreenOfDisplay(display, DefaultScreen (display));
|
||||
|
||||
d->xIdleTime = 0;
|
||||
#endif
|
||||
|
||||
#ifdef HasXidle
|
||||
d->useXidle = XidleQueryExtension(qt_xdisplay(), &dummy, &dummy);
|
||||
#endif
|
||||
|
||||
#ifdef HasScreenSaver
|
||||
if (!d->useXidle)
|
||||
d->useMit = XScreenSaverQueryExtension(qt_xdisplay(), &dummy, &dummy);
|
||||
#endif
|
||||
|
||||
m_activityTimer = new QTimer(this, "AwayTimer");
|
||||
connect(m_activityTimer, SIGNAL(timeout()), this, SLOT(checkActivity()));
|
||||
|
||||
m_idleTime.start();
|
||||
}
|
||||
|
||||
AwayManager::~AwayManager()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
void AwayManager::identitiesChanged()
|
||||
{
|
||||
QValueList<int> newIdentityList;
|
||||
|
||||
QPtrList<Server> serverList = m_connectionManager->getServerList();
|
||||
Server* server = 0;
|
||||
|
||||
for (server = serverList.first(); server; server = serverList.next())
|
||||
{
|
||||
IdentityPtr identity = server->getIdentity();
|
||||
|
||||
if (identity && identity->getAutomaticAway() && server->isConnected())
|
||||
newIdentityList.append(identity->id());
|
||||
}
|
||||
|
||||
m_identitiesOnAutoAway = newIdentityList;
|
||||
|
||||
toggleTimer();
|
||||
}
|
||||
|
||||
void AwayManager::identityOnline(int identityId)
|
||||
{
|
||||
IdentityPtr identity = Preferences::identityById(identityId);
|
||||
|
||||
if (identity && identity->getAutomaticAway() &&
|
||||
!m_identitiesOnAutoAway.contains(identityId))
|
||||
{
|
||||
m_identitiesOnAutoAway.append(identityId);
|
||||
|
||||
toggleTimer();
|
||||
}
|
||||
}
|
||||
|
||||
void AwayManager::identityOffline(int identityId)
|
||||
{
|
||||
if (m_identitiesOnAutoAway.contains(identityId))
|
||||
{
|
||||
m_identitiesOnAutoAway.remove(identityId);
|
||||
|
||||
toggleTimer();
|
||||
}
|
||||
}
|
||||
|
||||
void AwayManager::toggleTimer()
|
||||
{
|
||||
if (m_identitiesOnAutoAway.count() > 0)
|
||||
{
|
||||
if (!m_activityTimer->isActive())
|
||||
m_activityTimer->start(Preferences::autoAwayPollInterval() * 1000);
|
||||
}
|
||||
else if (m_activityTimer->isActive())
|
||||
m_activityTimer->stop();
|
||||
}
|
||||
|
||||
void AwayManager::checkActivity()
|
||||
{
|
||||
// Allow the event loop to be called, to avoid deadlock.
|
||||
static bool rentrencyProtection = false;
|
||||
if (rentrencyProtection) return;
|
||||
|
||||
rentrencyProtection = true;
|
||||
|
||||
DCOPRef screenSaver("kdesktop", "KScreensaverIface");
|
||||
DCOPReply isBlanked = screenSaver.callExt("isBlanked", DCOPRef::UseEventLoop, 10);
|
||||
|
||||
rentrencyProtection = false;
|
||||
|
||||
if (!(isBlanked.isValid() && isBlanked.type == "bool" && ((bool)isBlanked)))
|
||||
implementIdleAutoAway(Xactivity());
|
||||
}
|
||||
|
||||
bool AwayManager::Xactivity()
|
||||
{
|
||||
bool activity = false;
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
Display* display = qt_xdisplay();
|
||||
Window dummyW;
|
||||
int dummyC;
|
||||
unsigned int mask;
|
||||
int rootX;
|
||||
int rootY;
|
||||
|
||||
if (!XQueryPointer (display, d->root, &(d->root), &dummyW, &rootX, &rootY,
|
||||
&dummyC, &dummyC, &mask))
|
||||
{
|
||||
// Figure out which screen the pointer has moved to.
|
||||
for (int i = 0; i < ScreenCount(display); i++)
|
||||
{
|
||||
if (d->root == RootWindow(display, i))
|
||||
{
|
||||
d->screen = ScreenOfDisplay (display, i);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Time xIdleTime = 0;
|
||||
|
||||
#ifdef HasXidle
|
||||
if (d->useXidle)
|
||||
XGetIdleTime(display, &xIdleTime);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef HasScreenSaver
|
||||
if (d->useMit)
|
||||
{
|
||||
static XScreenSaverInfo* mitInfo = 0;
|
||||
if (!mitInfo) mitInfo = XScreenSaverAllocInfo();
|
||||
XScreenSaverQueryInfo (display, d->root, mitInfo);
|
||||
xIdleTime = mitInfo->idle;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (rootX != d->mouseX || rootY != d->mouseY || mask != d->mouseMask
|
||||
|| ((d->useXidle || d->useMit) && xIdleTime < d->xIdleTime + 2000))
|
||||
{
|
||||
// Set by setManagedIdentitiesAway() to skip X-based activity checking for one
|
||||
// round, to avoid jumping on residual mouse activity after manual screensaver
|
||||
// activation.
|
||||
if (d->mouseX != -1) activity = true;
|
||||
|
||||
d->mouseX = rootX;
|
||||
d->mouseY = rootY;
|
||||
d->mouseMask = mask;
|
||||
d->xIdleTime = xIdleTime;
|
||||
}
|
||||
#endif
|
||||
|
||||
return activity;
|
||||
}
|
||||
|
||||
void AwayManager::implementIdleAutoAway(bool activity)
|
||||
{
|
||||
if (activity)
|
||||
{
|
||||
m_idleTime.start();
|
||||
|
||||
QPtrList<Server> serverList = m_connectionManager->getServerList();
|
||||
Server* server = 0;
|
||||
|
||||
for (server = serverList.first(); server; server = serverList.next())
|
||||
{
|
||||
IdentityPtr identity = server->getIdentity();
|
||||
|
||||
if (m_identitiesOnAutoAway.contains(identity->id()) && identity->getAutomaticUnaway()
|
||||
&& server->isConnected() && server->isAway())
|
||||
{
|
||||
server->requestUnaway();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
long int idleTime = m_idleTime.elapsed() / 1000;
|
||||
|
||||
QValueList<int> identitiesIdleTimeExceeded;
|
||||
QValueList<int>::ConstIterator it;
|
||||
|
||||
for (it = m_identitiesOnAutoAway.begin(); it != m_identitiesOnAutoAway.end(); ++it)
|
||||
{
|
||||
if (idleTime >= Preferences::identityById((*it))->getAwayInactivity() * 60)
|
||||
identitiesIdleTimeExceeded.append((*it));
|
||||
}
|
||||
|
||||
QPtrList<Server> serverList = m_connectionManager->getServerList();
|
||||
Server* server = 0;
|
||||
|
||||
for (server = serverList.first(); server; server = serverList.next())
|
||||
{
|
||||
int identityId = server->getIdentity()->id();
|
||||
|
||||
if (identitiesIdleTimeExceeded.contains(identityId) && server->isConnected() && !server->isAway())
|
||||
server->requestAway();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AwayManager::setManagedIdentitiesAway()
|
||||
{
|
||||
// Used to skip X-based activity checking for one round, to avoid jumping
|
||||
// on residual mouse activity after manual screensaver activation.
|
||||
d->mouseX = -1;
|
||||
|
||||
QPtrList<Server> serverList = m_connectionManager->getServerList();
|
||||
Server* server = 0;
|
||||
|
||||
for (server = serverList.first(); server; server = serverList.next())
|
||||
{
|
||||
if (m_identitiesOnAutoAway.contains(server->getIdentity()->id()) && server->isConnected() && !server->isAway())
|
||||
server->requestAway();
|
||||
}
|
||||
}
|
||||
|
||||
void AwayManager::setManagedIdentitiesUnaway()
|
||||
{
|
||||
QPtrList<Server> serverList = m_connectionManager->getServerList();
|
||||
Server* server = 0;
|
||||
|
||||
for (server = serverList.first(); server; server = serverList.next())
|
||||
{
|
||||
IdentityPtr identity = server->getIdentity();
|
||||
|
||||
if (m_identitiesOnAutoAway.contains(identity->id()) && identity->getAutomaticUnaway()
|
||||
&& server->isConnected() && server->isAway())
|
||||
{
|
||||
server->requestUnaway();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AwayManager::requestAllAway(const QString& reason)
|
||||
{
|
||||
QPtrList<Server> serverList = m_connectionManager->getServerList();
|
||||
Server* server = 0;
|
||||
|
||||
for (server = serverList.first(); server; server = serverList.next())
|
||||
if (server->isConnected()) server->requestAway(reason);
|
||||
}
|
||||
|
||||
void AwayManager::requestAllUnaway()
|
||||
{
|
||||
QPtrList<Server> serverList = m_connectionManager->getServerList();
|
||||
Server* server = 0;
|
||||
|
||||
for (server = serverList.first(); server; server = serverList.next())
|
||||
if (server->isConnected() && server->isAway()) server->requestUnaway();
|
||||
}
|
||||
|
||||
void AwayManager::toggleGlobalAway(bool away)
|
||||
{
|
||||
if (away)
|
||||
requestAllAway();
|
||||
else
|
||||
requestAllUnaway();
|
||||
}
|
||||
|
||||
void AwayManager::updateGlobalAwayAction(bool away)
|
||||
{
|
||||
KonversationApplication* konvApp = static_cast<KonversationApplication*>(kapp);
|
||||
KToggleAction* awayAction = static_cast<KToggleAction*>(konvApp->getMainWindow()->actionCollection()->action("toggle_away"));
|
||||
|
||||
if (!awayAction) return;
|
||||
|
||||
if (away)
|
||||
{
|
||||
QPtrList<Server> serverList = m_connectionManager->getServerList();
|
||||
Server* server = 0;
|
||||
uint awayCount = 0;
|
||||
|
||||
for (server = serverList.first(); server; server = serverList.next())
|
||||
{
|
||||
if (server->isAway())
|
||||
awayCount++;
|
||||
}
|
||||
|
||||
if (awayCount == serverList.count())
|
||||
{
|
||||
awayAction->setChecked(true);
|
||||
awayAction->setIcon("konversationaway");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
awayAction->setChecked(false);
|
||||
awayAction->setIcon("konversationavailable");
|
||||
}
|
||||
}
|
||||
|
||||
#include "awaymanager.moc"
|
@ -0,0 +1,73 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (C) 2008 Eike Hein <hein@kde.org>
|
||||
*/
|
||||
|
||||
#ifndef AWAYMANAGER_H
|
||||
#define AWAYMANAGER_H
|
||||
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qdatetime.h>
|
||||
|
||||
|
||||
class ConnectionManager;
|
||||
|
||||
class QTimer;
|
||||
|
||||
|
||||
struct AwayManagerPrivate;
|
||||
|
||||
|
||||
class AwayManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AwayManager(QObject* parent = 0);
|
||||
~AwayManager();
|
||||
|
||||
|
||||
public slots:
|
||||
void identitiesChanged();
|
||||
|
||||
void identityOnline(int identityId);
|
||||
void identityOffline(int identityId);
|
||||
|
||||
void requestAllAway(const QString& reason = "");
|
||||
void requestAllUnaway();
|
||||
|
||||
void setManagedIdentitiesAway();
|
||||
void setManagedIdentitiesUnaway();
|
||||
|
||||
void toggleGlobalAway(bool away);
|
||||
void updateGlobalAwayAction(bool away);
|
||||
|
||||
|
||||
private slots:
|
||||
void checkActivity();
|
||||
|
||||
|
||||
private:
|
||||
void toggleTimer();
|
||||
bool Xactivity();
|
||||
|
||||
void implementIdleAutoAway(bool activity);
|
||||
|
||||
AwayManagerPrivate* d;
|
||||
|
||||
QTime m_idleTime;
|
||||
QTimer* m_activityTimer;
|
||||
|
||||
QValueList<int> m_identitiesOnAutoAway;
|
||||
|
||||
ConnectionManager* m_connectionManager;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,654 @@
|
||||
/*
|
||||
Public Domain. Without any warranty.
|
||||
|
||||
Copyright (C) George Anescu <unknown@unknown>
|
||||
Copyright (C) mouser <fvarick@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//The implementation of blowfish for CBC mode is from http://www.thecodeproject.com/cpp/blowfish.asp by George Anescu
|
||||
// I removed exception handling, so it is callers responsibility to insure
|
||||
// that strings are length multiples of 8 bytes
|
||||
// -mouser 1/08/05
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Mouser 1/14/05
|
||||
// I'm not sure this implementation of cbc is exactly the same as other cbc
|
||||
// algorithms you may find, though the different is insignificant and just
|
||||
// requires you to call your other algorithm slightly differently.
|
||||
// This blowfish cbc class basically pretends that the IV is 00000000 but
|
||||
// but that the first 8byte block of the plaintext to encrypt is treated
|
||||
// like the IV (ie its a random nonce).
|
||||
// In other words, it does not accept a separate IV, but expects the first
|
||||
// 8bytes to be the IV (this is a slight difference from textbook cbc since
|
||||
// the encrypted IV is now part of the ciphertext).
|
||||
// This actually works out well for us since we want to send the IV to
|
||||
// our recipient as part of our message.
|
||||
// ANYWAY, bottom line is, if you have a blowfish implementation that takes
|
||||
// an explicit IV parameter as its input, just pass it 0 as the IV, and
|
||||
// when encrypting, prefix your plaintext with an 8 byte random nonce, and
|
||||
// you will have a compatible algorithm. Remember its not that this
|
||||
// algorithm uses a fixed IV of 0, but rather that the IV is the first
|
||||
// block of the test to encrypt.
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
///
|
||||
// BlowFish.cpp
|
||||
//
|
||||
// Implementation of Bruce Schneier's BLOWFISH algorithm from "Applied
|
||||
// Cryptography", Second Edition.
|
||||
|
||||
#include "BlowfishCbc.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <memory.h>
|
||||
|
||||
//#include <exception>
|
||||
|
||||
//Initialization with a fixed string which consists of the hexadecimal digits of PI (less the initial 3)
|
||||
//P-array, 18 32-bit subkeys
|
||||
const unsigned int CBlowFish::scm_auiInitP[18] = {
|
||||
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
|
||||
0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
|
||||
0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
|
||||
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
|
||||
0x9216d5d9, 0x8979fb1b
|
||||
};
|
||||
|
||||
//Four 32-bit S-boxes with 256 entries each
|
||||
const unsigned int CBlowFish::scm_auiInitS[4][256] = {
|
||||
//0
|
||||
{0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
|
||||
0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
|
||||
0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
|
||||
0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
|
||||
0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
|
||||
0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
|
||||
0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
|
||||
0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
|
||||
0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
|
||||
0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
|
||||
0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
|
||||
0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
|
||||
0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
|
||||
0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
|
||||
0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
|
||||
0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
|
||||
0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
|
||||
0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
|
||||
0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
|
||||
0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
|
||||
0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
|
||||
0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
|
||||
0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
|
||||
0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
|
||||
0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
|
||||
0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
|
||||
0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
|
||||
0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
|
||||
0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
|
||||
0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
|
||||
0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
|
||||
0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
|
||||
0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
|
||||
0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
|
||||
0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
|
||||
0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
|
||||
0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
|
||||
0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
|
||||
0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
|
||||
0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
|
||||
0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
|
||||
0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
|
||||
0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
|
||||
0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
|
||||
0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
|
||||
0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
|
||||
0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
|
||||
0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
|
||||
0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
|
||||
0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
|
||||
0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
|
||||
0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
|
||||
0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
|
||||
0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
|
||||
0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
|
||||
0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
|
||||
0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
|
||||
0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
|
||||
0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
|
||||
0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
|
||||
0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
|
||||
0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
|
||||
0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
|
||||
0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a},
|
||||
|
||||
//1
|
||||
{0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
|
||||
0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
|
||||
0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
|
||||
0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
|
||||
0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
|
||||
0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
|
||||
0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
|
||||
0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
|
||||
0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
|
||||
0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
|
||||
0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
|
||||
0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
|
||||
0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
|
||||
0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
|
||||
0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
|
||||
0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
|
||||
0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
|
||||
0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
|
||||
0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
|
||||
0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
|
||||
0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
|
||||
0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
|
||||
0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
|
||||
0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
|
||||
0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
|
||||
0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
|
||||
0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
|
||||
0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
|
||||
0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
|
||||
0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
|
||||
0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
|
||||
0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
|
||||
0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
|
||||
0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
|
||||
0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
|
||||
0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
|
||||
0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
|
||||
0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
|
||||
0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
|
||||
0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
|
||||
0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
|
||||
0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
|
||||
0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
|
||||
0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
|
||||
0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
|
||||
0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
|
||||
0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
|
||||
0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
|
||||
0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
|
||||
0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
|
||||
0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
|
||||
0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
|
||||
0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
|
||||
0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
|
||||
0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
|
||||
0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
|
||||
0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
|
||||
0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
|
||||
0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
|
||||
0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
|
||||
0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
|
||||
0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
|
||||
0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
|
||||
0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7},
|
||||
|
||||
//2
|
||||
{0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
|
||||
0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
|
||||
0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
|
||||
0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
|
||||
0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
|
||||
0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
|
||||
0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
|
||||
0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
|
||||
0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
|
||||
0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
|
||||
0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
|
||||
0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
|
||||
0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
|
||||
0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
|
||||
0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
|
||||
0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
|
||||
0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
|
||||
0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
|
||||
0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
|
||||
0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
|
||||
0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
|
||||
0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
|
||||
0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
|
||||
0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
|
||||
0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
|
||||
0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
|
||||
0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
|
||||
0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
|
||||
0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
|
||||
0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
|
||||
0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
|
||||
0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
|
||||
0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
|
||||
0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
|
||||
0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
|
||||
0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
|
||||
0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
|
||||
0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
|
||||
0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
|
||||
0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
|
||||
0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
|
||||
0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
|
||||
0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
|
||||
0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
|
||||
0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
|
||||
0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
|
||||
0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
|
||||
0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
|
||||
0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
|
||||
0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
|
||||
0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
|
||||
0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
|
||||
0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
|
||||
0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
|
||||
0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
|
||||
0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
|
||||
0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
|
||||
0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
|
||||
0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
|
||||
0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
|
||||
0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
|
||||
0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
|
||||
0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
|
||||
0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0},
|
||||
|
||||
//3
|
||||
{0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
|
||||
0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
|
||||
0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
|
||||
0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
|
||||
0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
|
||||
0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
|
||||
0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
|
||||
0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
|
||||
0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
|
||||
0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
|
||||
0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
|
||||
0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
|
||||
0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
|
||||
0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
|
||||
0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
|
||||
0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
|
||||
0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
|
||||
0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
|
||||
0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
|
||||
0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
|
||||
0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
|
||||
0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
|
||||
0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
|
||||
0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
|
||||
0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
|
||||
0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
|
||||
0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
|
||||
0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
|
||||
0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
|
||||
0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
|
||||
0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
|
||||
0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
|
||||
0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
|
||||
0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
|
||||
0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
|
||||
0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
|
||||
0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
|
||||
0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
|
||||
0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
|
||||
0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
|
||||
0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
|
||||
0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
|
||||
0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
|
||||
0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
|
||||
0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
|
||||
0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
|
||||
0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
|
||||
0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
|
||||
0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
|
||||
0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
|
||||
0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
|
||||
0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
|
||||
0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
|
||||
0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
|
||||
0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
|
||||
0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
|
||||
0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
|
||||
0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
|
||||
0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
|
||||
0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
|
||||
0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
|
||||
0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
|
||||
0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
|
||||
0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6}
|
||||
};
|
||||
|
||||
//Constructor - Initialize the P and S boxes for a given Key
|
||||
CBlowFish::CBlowFish(unsigned char* ucKey, size_t keysize, const SBlock& roChain) : m_oChain0(roChain), m_oChain(roChain)
|
||||
{
|
||||
if(keysize<1)
|
||||
// throw exception("Incorrect key length");
|
||||
return;
|
||||
|
||||
|
||||
//Check the Key - the key length should be between 1 and 56 bytes
|
||||
if(keysize>56)
|
||||
keysize = 56;
|
||||
unsigned char aucLocalKey[56];
|
||||
unsigned int i, j;
|
||||
memcpy(aucLocalKey, ucKey, keysize);
|
||||
//Reflexive Initialization of the Blowfish.
|
||||
//Generating the Subkeys from the Key flood P and S boxes with PI
|
||||
memcpy(m_auiP, scm_auiInitP, sizeof m_auiP);
|
||||
memcpy(m_auiS, scm_auiInitS, sizeof m_auiS);
|
||||
//Load P boxes with key bytes
|
||||
const unsigned char* p = aucLocalKey;
|
||||
unsigned int x=0;
|
||||
//Repeatedly cycle through the key bits until the entire P array has been XORed with key bits
|
||||
unsigned int iCount = 0;
|
||||
for(i=0; i<18; i++)
|
||||
{
|
||||
x=0;
|
||||
for(int n=4; n--; )
|
||||
{
|
||||
//int iVal = (int)(*p);
|
||||
x <<= 8;
|
||||
x |= *(p++);
|
||||
iCount++;
|
||||
if(iCount == keysize)
|
||||
{
|
||||
//All bytes used, so recycle bytes
|
||||
iCount = 0;
|
||||
p = aucLocalKey;
|
||||
}
|
||||
}
|
||||
m_auiP[i] ^= x;
|
||||
}
|
||||
//Reflect P and S boxes through the evolving Blowfish
|
||||
SBlock block(0UL,0UL); //all-zero block
|
||||
for(i=0; i<18; )
|
||||
Encrypt(block), m_auiP[i++] = block.m_uil, m_auiP[i++] = block.m_uir;
|
||||
for(j=0; j<4; j++)
|
||||
for(int k=0; k<256; )
|
||||
Encrypt(block), m_auiS[j][k++] = block.m_uil, m_auiS[j][k++] = block.m_uir;
|
||||
}
|
||||
|
||||
//Sixteen Round Encipher of Block
|
||||
void CBlowFish::Encrypt(SBlock& block)
|
||||
{
|
||||
unsigned int uiLeft = block.m_uil;
|
||||
unsigned int uiRight = block.m_uir;
|
||||
uiLeft ^= m_auiP[0];
|
||||
uiRight ^= F(uiLeft)^m_auiP[1]; uiLeft ^= F(uiRight)^m_auiP[2];
|
||||
uiRight ^= F(uiLeft)^m_auiP[3]; uiLeft ^= F(uiRight)^m_auiP[4];
|
||||
uiRight ^= F(uiLeft)^m_auiP[5]; uiLeft ^= F(uiRight)^m_auiP[6];
|
||||
uiRight ^= F(uiLeft)^m_auiP[7]; uiLeft ^= F(uiRight)^m_auiP[8];
|
||||
uiRight ^= F(uiLeft)^m_auiP[9]; uiLeft ^= F(uiRight)^m_auiP[10];
|
||||
uiRight ^= F(uiLeft)^m_auiP[11]; uiLeft ^= F(uiRight)^m_auiP[12];
|
||||
uiRight ^= F(uiLeft)^m_auiP[13]; uiLeft ^= F(uiRight)^m_auiP[14];
|
||||
uiRight ^= F(uiLeft)^m_auiP[15]; uiLeft ^= F(uiRight)^m_auiP[16];
|
||||
uiRight ^= m_auiP[17];
|
||||
block.m_uil = uiRight;
|
||||
block.m_uir = uiLeft;
|
||||
}
|
||||
|
||||
//Sixteen Round Decipher of SBlock
|
||||
void CBlowFish::Decrypt(SBlock& block)
|
||||
{
|
||||
unsigned int uiLeft = block.m_uil;
|
||||
unsigned int uiRight = block.m_uir;
|
||||
uiLeft ^= m_auiP[17];
|
||||
uiRight ^= F(uiLeft)^m_auiP[16]; uiLeft ^= F(uiRight)^m_auiP[15];
|
||||
uiRight ^= F(uiLeft)^m_auiP[14]; uiLeft ^= F(uiRight)^m_auiP[13];
|
||||
uiRight ^= F(uiLeft)^m_auiP[12]; uiLeft ^= F(uiRight)^m_auiP[11];
|
||||
uiRight ^= F(uiLeft)^m_auiP[10]; uiLeft ^= F(uiRight)^m_auiP[9];
|
||||
uiRight ^= F(uiLeft)^m_auiP[8]; uiLeft ^= F(uiRight)^m_auiP[7];
|
||||
uiRight ^= F(uiLeft)^m_auiP[6]; uiLeft ^= F(uiRight)^m_auiP[5];
|
||||
uiRight ^= F(uiLeft)^m_auiP[4]; uiLeft ^= F(uiRight)^m_auiP[3];
|
||||
uiRight ^= F(uiLeft)^m_auiP[2]; uiLeft ^= F(uiRight)^m_auiP[1];
|
||||
uiRight ^= m_auiP[0];
|
||||
block.m_uil = uiRight;
|
||||
block.m_uir = uiLeft;
|
||||
}
|
||||
|
||||
//Semi-Portable Byte Shuffling
|
||||
inline void BytesToBlock(unsigned char const* p, SBlock& b)
|
||||
{
|
||||
unsigned int y;
|
||||
//Left
|
||||
b.m_uil = 0;
|
||||
y = *p++;
|
||||
y <<= 24;
|
||||
b.m_uil |= y;
|
||||
y = *p++;
|
||||
y <<= 16;
|
||||
b.m_uil |= y;
|
||||
y = *p++;
|
||||
y <<= 8;
|
||||
b.m_uil |= y;
|
||||
y = *p++;
|
||||
b.m_uil |= y;
|
||||
//Right
|
||||
b.m_uir = 0;
|
||||
y = *p++;
|
||||
y <<= 24;
|
||||
b.m_uir |= y;
|
||||
y = *p++;
|
||||
y <<= 16;
|
||||
b.m_uir |= y;
|
||||
y = *p++;
|
||||
y <<= 8;
|
||||
b.m_uir |= y;
|
||||
y = *p++;
|
||||
b.m_uir |= y;
|
||||
}
|
||||
|
||||
inline void BlockToBytes(SBlock const& b, unsigned char* p)
|
||||
{
|
||||
unsigned int y;
|
||||
//Right
|
||||
y = b.m_uir;
|
||||
*--p = Byte(y);
|
||||
y = b.m_uir >> 8;
|
||||
*--p = Byte(y);
|
||||
y = b.m_uir >> 16;
|
||||
*--p = Byte(y);
|
||||
y = b.m_uir >> 24;
|
||||
*--p = Byte(y);
|
||||
//Left
|
||||
y = b.m_uil;
|
||||
*--p = Byte(y);
|
||||
y = b.m_uil >> 8;
|
||||
*--p = Byte(y);
|
||||
y = b.m_uil >> 16;
|
||||
*--p = Byte(y);
|
||||
y = b.m_uil >> 24;
|
||||
*--p = Byte(y);
|
||||
}
|
||||
|
||||
//Encrypt Buffer in Place
|
||||
//Returns false if n is multiple of 8
|
||||
void CBlowFish::Encrypt(unsigned char* buf, size_t n, int iMode)
|
||||
{
|
||||
//Check the buffer's length - should be > 0 and multiple of 8
|
||||
if((n==0)||(n%8!=0))
|
||||
//throw exception("Incorrect buffer length");
|
||||
return;
|
||||
|
||||
SBlock work;
|
||||
if(iMode == CBC) //CBC mode, using the Chain
|
||||
{
|
||||
SBlock chain(m_oChain);
|
||||
for(; n >= 8; n -= 8)
|
||||
{
|
||||
BytesToBlock(buf, work);
|
||||
work ^= chain;
|
||||
Encrypt(work);
|
||||
chain = work;
|
||||
BlockToBytes(work, buf+=8);
|
||||
}
|
||||
}
|
||||
else if(iMode == CFB) //CFB mode, using the Chain
|
||||
{
|
||||
SBlock chain(m_oChain);
|
||||
for(; n >= 8; n -= 8)
|
||||
{
|
||||
Encrypt(chain);
|
||||
BytesToBlock(buf, work);
|
||||
work ^= chain;
|
||||
chain = work;
|
||||
BlockToBytes(work, buf+=8);
|
||||
}
|
||||
}
|
||||
else //ECB mode, not using the Chain
|
||||
{
|
||||
for(; n >= 8; n -= 8)
|
||||
{
|
||||
BytesToBlock(buf, work);
|
||||
Encrypt(work);
|
||||
BlockToBytes(work, buf+=8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Decrypt Buffer in Place
|
||||
//Returns false if n is multiple of 8
|
||||
void CBlowFish::Decrypt(unsigned char* buf, size_t n, int iMode)
|
||||
{
|
||||
//Check the buffer's length - should be > 0 and multiple of 8
|
||||
if((n==0)||(n%8!=0))
|
||||
//throw exception("Incorrect buffer length");
|
||||
return;
|
||||
|
||||
SBlock work;
|
||||
if(iMode == CBC) //CBC mode, using the Chain
|
||||
{
|
||||
SBlock crypt, chain(m_oChain);
|
||||
for(; n >= 8; n -= 8)
|
||||
{
|
||||
BytesToBlock(buf, work);
|
||||
crypt = work;
|
||||
Decrypt(work);
|
||||
work ^= chain;
|
||||
chain = crypt;
|
||||
BlockToBytes(work, buf+=8);
|
||||
}
|
||||
}
|
||||
else if(iMode == CFB) //CFB mode, using the Chain, not using Decrypt()
|
||||
{
|
||||
SBlock crypt, chain(m_oChain);
|
||||
for(; n >= 8; n -= 8)
|
||||
{
|
||||
BytesToBlock(buf, work);
|
||||
Encrypt(chain);
|
||||
crypt = work;
|
||||
work ^= chain;
|
||||
chain = crypt;
|
||||
BlockToBytes(work, buf+=8);
|
||||
}
|
||||
}
|
||||
else //ECB mode, not using the Chain
|
||||
{
|
||||
for(; n >= 8; n -= 8)
|
||||
{
|
||||
BytesToBlock(buf, work);
|
||||
Decrypt(work);
|
||||
BlockToBytes(work, buf+=8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Encrypt from Input Buffer to Output Buffer
|
||||
//Returns false if n is multiple of 8
|
||||
void CBlowFish::Encrypt(const unsigned char* in, unsigned char* out, size_t n, int iMode)
|
||||
{
|
||||
//Check the buffer's length - should be > 0 and multiple of 8
|
||||
if((n==0)||(n%8!=0))
|
||||
//throw exception("Incorrect buffer length");
|
||||
return;
|
||||
|
||||
SBlock work;
|
||||
if(iMode == CBC) //CBC mode, using the Chain
|
||||
{
|
||||
SBlock chain(m_oChain);
|
||||
for(; n >= 8; n -= 8, in += 8)
|
||||
{
|
||||
BytesToBlock(in, work);
|
||||
work ^= chain;
|
||||
Encrypt(work);
|
||||
chain = work;
|
||||
BlockToBytes(work, out+=8);
|
||||
}
|
||||
}
|
||||
else if(iMode == CFB) //CFB mode, using the Chain
|
||||
{
|
||||
SBlock chain(m_oChain);
|
||||
for(; n >= 8; n -= 8, in += 8)
|
||||
{
|
||||
Encrypt(chain);
|
||||
BytesToBlock(in, work);
|
||||
work ^= chain;
|
||||
chain = work;
|
||||
BlockToBytes(work, out+=8);
|
||||
}
|
||||
}
|
||||
else //ECB mode, not using the Chain
|
||||
{
|
||||
for(; n >= 8; n -= 8, in += 8)
|
||||
{
|
||||
BytesToBlock(in, work);
|
||||
Encrypt(work);
|
||||
BlockToBytes(work, out+=8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Decrypt from Input Buffer to Output Buffer
|
||||
//Returns false if n is multiple of 8
|
||||
void CBlowFish::Decrypt(const unsigned char* in, unsigned char* out, size_t n, int iMode)
|
||||
{
|
||||
//Check the buffer's length - should be > 0 and multiple of 8
|
||||
if((n==0)||(n%8!=0))
|
||||
//throw exception("Incorrect buffer length");
|
||||
return;
|
||||
|
||||
SBlock work;
|
||||
if(iMode == CBC) //CBC mode, using the Chain
|
||||
{
|
||||
SBlock crypt, chain(m_oChain);
|
||||
for(; n >= 8; n -= 8, in += 8)
|
||||
{
|
||||
BytesToBlock(in, work);
|
||||
crypt = work;
|
||||
Decrypt(work);
|
||||
work ^= chain;
|
||||
chain = crypt;
|
||||
BlockToBytes(work, out+=8);
|
||||
}
|
||||
}
|
||||
else if(iMode == CFB) //CFB mode, using the Chain, not using Decrypt()
|
||||
{
|
||||
SBlock crypt, chain(m_oChain);
|
||||
for(; n >= 8; n -= 8, in += 8)
|
||||
{
|
||||
BytesToBlock(in, work);
|
||||
Encrypt(chain);
|
||||
crypt = work;
|
||||
work ^= chain;
|
||||
chain = crypt;
|
||||
BlockToBytes(work, out+=8);
|
||||
}
|
||||
}
|
||||
else //ECB mode, not using the Chain
|
||||
{
|
||||
for(; n >= 8; n -= 8, in += 8)
|
||||
{
|
||||
BytesToBlock(in, work);
|
||||
Decrypt(work);
|
||||
BlockToBytes(work, out+=8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,228 @@
|
||||
/*
|
||||
Public Domain. Without any warranty.
|
||||
|
||||
Copyright (C) George Anescu <unknown@unknown>
|
||||
Copyright (C) mouser <fvarick@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//The implementation of blowfish for CBC mode is from http://www.thecodeproject.com/cpp/blowfish.asp by George Anescu
|
||||
// I removed exception handling, so it is callers responsibility to insure
|
||||
// that strings are length multiples of 8 bytes
|
||||
// -mouser 1/08/05
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Mouser 1/14/05
|
||||
// I'm not sure this implementation of cbc is exactly the same as other cbc
|
||||
// algorithms you may find, though the difference is insignificant and just
|
||||
// requires you to call your other algorithm slightly differently.
|
||||
// This blowfish cbc class basically pretends that the IV is 00000000 but
|
||||
// but that the first 8byte block of the plaintext to encrypt is treated
|
||||
// like the IV (ie its a random nonce).
|
||||
// In other words, it does not accept a separate IV, but expects the first
|
||||
// 8bytes to be the IV (this is a slight difference from textbook cbc since
|
||||
// the encrypted IV is now part of the ciphertext).
|
||||
// This actually works out well for us since we want to send the IV to
|
||||
// our recipient as part of our message.
|
||||
// ANYWAY, bottom line is, if you have a blowfish implementation that takes
|
||||
// an explicit IV parameter as its input, just pass it 0 as the IV, and
|
||||
// when encrypting, prefix your plaintext with an 8 byte random nonce, and
|
||||
// you will have a compatible algorithm. Remember its not that this
|
||||
// algorithm uses a fixed IV of 0, but rather that the IV is the first
|
||||
// block of the test to encrypt.
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
///
|
||||
// Blowfish.h Header File
|
||||
//
|
||||
// BLOWFISH ENCRYPTION ALGORITHM
|
||||
//
|
||||
// Encryption and Decryption of Byte Strings using the Blowfish Encryption Algorithm.
|
||||
// Blowfish is a block cipher that encrypts data in 8-byte blocks. The algorithm consists
|
||||
// of two parts: a key-expansion part and a data-ancryption part. Key expansion converts a
|
||||
// variable key of at least 1 and at most 56 bytes into several subkey arrays totaling
|
||||
// 4168 bytes. Blowfish has 16 rounds. Each round consists of a key-dependent permutation,
|
||||
// and a key and data-dependent substitution. All operations are XORs and additions on 32-bit words.
|
||||
// The only additional operations are four indexed array data lookups per round.
|
||||
// Blowfish uses a large number of subkeys. These keys must be precomputed before any data
|
||||
// encryption or decryption. The P-array consists of 18 32-bit subkeys: P0, P1,...,P17.
|
||||
// There are also four 32-bit S-boxes with 256 entries each: S0,0, S0,1,...,S0,255;
|
||||
// S1,0, S1,1,...,S1,255; S2,0, S2,1,...,S2,255; S3,0, S3,1,...,S3,255;
|
||||
//
|
||||
// The Electronic Code Book (ECB), Cipher Block Chaining (CBC) and Cipher Feedback modes
|
||||
// are used:
|
||||
//
|
||||
// In ECB mode if the same block is encrypted twice with the same key, the resulting
|
||||
// ciphertext blocks are the same.
|
||||
//
|
||||
// In CBC Mode a ciphertext block is obtained by first xoring the
|
||||
// plaintext block with the previous ciphertext block, and encrypting the resulting value.
|
||||
//
|
||||
// In CFB mode a ciphertext block is obtained by encrypting the previous ciphertext block
|
||||
// and xoring the resulting value with the plaintext
|
||||
//
|
||||
// The previous ciphertext block is usually stored in an Initialization Vector (IV).
|
||||
// An Initialization Vector of zero is commonly used for the first block, though other
|
||||
// arrangements are also in use.
|
||||
|
||||
/*
|
||||
http://www.counterpane.com/vectors.txt
|
||||
Test vectors by Eric Young. These tests all assume Blowfish with 16
|
||||
rounds.
|
||||
|
||||
All data is shown as a hex string with 012345 loading as
|
||||
data[0]=0x01;
|
||||
data[1]=0x23;
|
||||
data[2]=0x45;
|
||||
ecb test data (taken from the DES validation tests)
|
||||
|
||||
key bytes clear bytes cipher bytes
|
||||
0000000000000000 0000000000000000 4EF997456198DD78
|
||||
FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF 51866FD5B85ECB8A
|
||||
3000000000000000 1000000000000001 7D856F9A613063F2 ???
|
||||
1111111111111111 1111111111111111 2466DD878B963C9D
|
||||
0123456789ABCDEF 1111111111111111 61F9C3802281B096
|
||||
1111111111111111 0123456789ABCDEF 7D0CC630AFDA1EC7
|
||||
0000000000000000 0000000000000000 4EF997456198DD78
|
||||
FEDCBA9876543210 0123456789ABCDEF 0ACEAB0FC6A0A28D
|
||||
7CA110454A1A6E57 01A1D6D039776742 59C68245EB05282B
|
||||
0131D9619DC1376E 5CD54CA83DEF57DA B1B8CC0B250F09A0
|
||||
07A1133E4A0B2686 0248D43806F67172 1730E5778BEA1DA4
|
||||
3849674C2602319E 51454B582DDF440A A25E7856CF2651EB
|
||||
04B915BA43FEB5B6 42FD443059577FA2 353882B109CE8F1A
|
||||
0113B970FD34F2CE 059B5E0851CF143A 48F4D0884C379918
|
||||
0170F175468FB5E6 0756D8E0774761D2 432193B78951FC98
|
||||
43297FAD38E373FE 762514B829BF486A 13F04154D69D1AE5
|
||||
07A7137045DA2A16 3BDD119049372802 2EEDDA93FFD39C79
|
||||
04689104C2FD3B2F 26955F6835AF609A D887E0393C2DA6E3
|
||||
37D06BB516CB7546 164D5E404F275232 5F99D04F5B163969
|
||||
1F08260D1AC2465E 6B056E18759F5CCA 4A057A3B24D3977B
|
||||
584023641ABA6176 004BD6EF09176062 452031C1E4FADA8E
|
||||
025816164629B007 480D39006EE762F2 7555AE39F59B87BD
|
||||
49793EBC79B3258F 437540C8698F3CFA 53C55F9CB49FC019
|
||||
4FB05E1515AB73A7 072D43A077075292 7A8E7BFA937E89A3
|
||||
49E95D6D4CA229BF 02FE55778117F12A CF9C5D7A4986ADB5
|
||||
018310DC409B26D6 1D9D5C5018F728C2 D1ABB290658BC778
|
||||
1C587F1C13924FEF 305532286D6F295A 55CB3774D13EF201
|
||||
0101010101010101 0123456789ABCDEF FA34EC4847B268B2
|
||||
1F1F1F1F0E0E0E0E 0123456789ABCDEF A790795108EA3CAE
|
||||
E0FEE0FEF1FEF1FE 0123456789ABCDEF C39E072D9FAC631D
|
||||
0000000000000000 FFFFFFFFFFFFFFFF 014933E0CDAFF6E4
|
||||
FFFFFFFFFFFFFFFF 0000000000000000 F21E9A77B71C49BC
|
||||
0123456789ABCDEF 0000000000000000 245946885754369A
|
||||
FEDCBA9876543210 FFFFFFFFFFFFFFFF 6B5C5A9C5D9E0A5A
|
||||
|
||||
set_key test data
|
||||
data[8]= FEDCBA9876543210
|
||||
c=F9AD597C49DB005E k[ 1]=F0
|
||||
c=E91D21C1D961A6D6 k[ 2]=F0E1
|
||||
c=E9C2B70A1BC65CF3 k[ 3]=F0E1D2
|
||||
c=BE1E639408640F05 k[ 4]=F0E1D2C3
|
||||
c=B39E44481BDB1E6E k[ 5]=F0E1D2C3B4
|
||||
c=9457AA83B1928C0D k[ 6]=F0E1D2C3B4A5
|
||||
c=8BB77032F960629D k[ 7]=F0E1D2C3B4A596
|
||||
c=E87A244E2CC85E82 k[ 8]=F0E1D2C3B4A59687
|
||||
c=15750E7A4F4EC577 k[ 9]=F0E1D2C3B4A5968778
|
||||
c=122BA70B3AB64AE0 k[10]=F0E1D2C3B4A596877869
|
||||
c=3A833C9AFFC537F6 k[11]=F0E1D2C3B4A5968778695A
|
||||
c=9409DA87A90F6BF2 k[12]=F0E1D2C3B4A5968778695A4B
|
||||
c=884F80625060B8B4 k[13]=F0E1D2C3B4A5968778695A4B3C
|
||||
c=1F85031C19E11968 k[14]=F0E1D2C3B4A5968778695A4B3C2D
|
||||
c=79D9373A714CA34F k[15]=F0E1D2C3B4A5968778695A4B3C2D1E ???
|
||||
c=93142887EE3BE15C k[16]=F0E1D2C3B4A5968778695A4B3C2D1E0F
|
||||
c=03429E838CE2D14B k[17]=F0E1D2C3B4A5968778695A4B3C2D1E0F00
|
||||
c=A4299E27469FF67B k[18]=F0E1D2C3B4A5968778695A4B3C2D1E0F0011
|
||||
c=AFD5AED1C1BC96A8 k[19]=F0E1D2C3B4A5968778695A4B3C2D1E0F001122
|
||||
c=10851C0E3858DA9F k[20]=F0E1D2C3B4A5968778695A4B3C2D1E0F00112233
|
||||
c=E6F51ED79B9DB21F k[21]=F0E1D2C3B4A5968778695A4B3C2D1E0F0011223344
|
||||
c=64A6E14AFD36B46F k[22]=F0E1D2C3B4A5968778695A4B3C2D1E0F001122334455
|
||||
c=80C7D7D45A5479AD k[23]=F0E1D2C3B4A5968778695A4B3C2D1E0F00112233445566
|
||||
c=05044B62FA52D080 k[24]=F0E1D2C3B4A5968778695A4B3C2D1E0F0011223344556677
|
||||
|
||||
chaining mode test data
|
||||
key[16] = 0123456789ABCDEFF0E1D2C3B4A59687
|
||||
iv[8] = FEDCBA9876543210
|
||||
data[29] = "7654321 Now is the time for " (includes trailing '\0')
|
||||
data[29] = 37363534333231204E6F77206973207468652074696D6520666F722000
|
||||
cbc cipher text
|
||||
cipher[32]= 6B77B4D63006DEE605B156E27403979358DEB9E7154616D959F1652BD5FF92CC
|
||||
cfb64 cipher text cipher[29]=
|
||||
E73214A2822139CAF26ECF6D2EB9E76E3DA3DE04D1517200519D57A6C3
|
||||
ofb64 cipher text cipher[29]=
|
||||
E73214A2822139CA62B343CC5B65587310DD908D0C241B2263C2CF80DA
|
||||
|
||||
*/
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// includes for size_t
|
||||
#include <stddef.h>
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef BLOWFISH_H
|
||||
#define BLOWFISH_H
|
||||
|
||||
//Block Structure
|
||||
struct SBlock
|
||||
{
|
||||
//Constructors
|
||||
SBlock(unsigned int l=0, unsigned int r=0) : m_uil(l), m_uir(r) {}
|
||||
//Copy Constructor
|
||||
SBlock(const SBlock& roBlock) : m_uil(roBlock.m_uil), m_uir(roBlock.m_uir) {}
|
||||
SBlock& operator^=(SBlock& b) { m_uil ^= b.m_uil; m_uir ^= b.m_uir; return *this; }
|
||||
unsigned int m_uil, m_uir;
|
||||
};
|
||||
|
||||
class CBlowFish
|
||||
{
|
||||
public:
|
||||
enum { ECB=0, CBC=1, CFB=2 };
|
||||
|
||||
//Constructor - Initialize the P and S boxes for a given Key
|
||||
CBlowFish(unsigned char* ucKey, size_t n, const SBlock& roChain = SBlock(0UL,0UL));
|
||||
|
||||
//Resetting the chaining block
|
||||
void ResetChain() { m_oChain = m_oChain0; }
|
||||
|
||||
// Encrypt/Decrypt Buffer in Place
|
||||
void Encrypt(unsigned char* buf, size_t n, int iMode=ECB);
|
||||
void Decrypt(unsigned char* buf, size_t n, int iMode=ECB);
|
||||
|
||||
// Encrypt/Decrypt from Input Buffer to Output Buffer
|
||||
void Encrypt(const unsigned char* in, unsigned char* out, size_t n, int iMode=ECB);
|
||||
void Decrypt(const unsigned char* in, unsigned char* out, size_t n, int iMode=ECB);
|
||||
|
||||
//Private Functions
|
||||
private:
|
||||
unsigned int F(unsigned int ui);
|
||||
void Encrypt(SBlock&);
|
||||
void Decrypt(SBlock&);
|
||||
|
||||
private:
|
||||
//The Initialization Vector, by default {0, 0}
|
||||
SBlock m_oChain0;
|
||||
SBlock m_oChain;
|
||||
unsigned int m_auiP[18];
|
||||
unsigned int m_auiS[4][256];
|
||||
static const unsigned int scm_auiInitP[18];
|
||||
static const unsigned int scm_auiInitS[4][256];
|
||||
};
|
||||
|
||||
//Extract low order byte
|
||||
inline unsigned char Byte(unsigned int ui)
|
||||
{
|
||||
return (unsigned char)(ui & 0xff);
|
||||
}
|
||||
|
||||
//Function F
|
||||
inline unsigned int CBlowFish::F(unsigned int ui)
|
||||
{
|
||||
return ((m_auiS[0][Byte(ui>>24)] + m_auiS[1][Byte(ui>>16)]) ^ m_auiS[2][Byte(ui>>8)]) + m_auiS[3][Byte(ui)];
|
||||
}
|
||||
|
||||
#endif // __BLOWFISH_H__
|
||||
|
@ -0,0 +1,7 @@
|
||||
AM_CPPFLAGS = $(all_includes) -I$(srcdir)/../
|
||||
|
||||
noinst_LTLIBRARIES = libblowfish.la
|
||||
noinst_HEADERS = b64stuff.h BlowfishCbc.h blowfish.h mc_blowfish.h newblowfish.h oldblowfish1.h oldblowfish2.h
|
||||
|
||||
libblowfish_la_SOURCES = b64stuff.cpp BlowfishCbc.cpp blowfish.cpp mc_blowfish.cpp newblowfish.cpp oldblowfish.cpp
|
||||
libblowfish_la_LDFLAGS = $(all_libraries) -no-undefined
|
@ -0,0 +1,3 @@
|
||||
b64stuff.{h,cpp} is public domain
|
||||
blowfish.{cpp,h} is written by İsmail Dönmez <ismail@kde.org> and licensed under GPLv2
|
||||
Rest of the code is from Mircryption v1.11.27 ( http://mircryption.sourceforge.net/ ) project and licensed under GPLv2
|
@ -0,0 +1,218 @@
|
||||
/*
|
||||
Copyright (C) John Viega <viega@viega.org>
|
||||
Copyright (C) Matt Messier <mmessier@prilnari.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the <OWNER> nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include "b64stuff.h"
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//static char b64table[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
// "abcdefghijklmnopqrstuvwxyz"
|
||||
// "0123456789+/";
|
||||
static char b64table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
/* Accepts a binary buffer with an associated size.
|
||||
* Returns a base64-encoded, NULL-terminated string.
|
||||
*/
|
||||
unsigned char *spc_base64_encode(unsigned char *input, size_t len, int wrap) {
|
||||
unsigned char *output, *p;
|
||||
size_t i = 0, mod = len % 3, toalloc;
|
||||
|
||||
// ATTN: WTF is this allocation function - does it fail sometimes?)
|
||||
//toalloc = (len / 3) * 4 + (3 - mod) % 3 + 1;
|
||||
toalloc = (len / 3) * 4 + (3 - mod) % 3 + 1 + 8;
|
||||
|
||||
if (wrap) {
|
||||
toalloc += len / 57;
|
||||
if (len % 57) toalloc++;
|
||||
}
|
||||
|
||||
if (toalloc < len) return 0;
|
||||
|
||||
//p = output = (unsigned char *)malloc(toalloc);
|
||||
p = output = new unsigned char [toalloc];
|
||||
|
||||
if (!p) return 0;
|
||||
|
||||
while (i < len - mod) {
|
||||
*p++ = b64table[input[i++] >> 2];
|
||||
*p++ = b64table[((input[i - 1] << 4) | (input[i] >> 4)) & 0x3f];
|
||||
*p++ = b64table[((input[i] << 2) | (input[i + 1] >> 6)) & 0x3f];
|
||||
*p++ = b64table[input[i + 1] & 0x3f];
|
||||
i += 2;
|
||||
if (wrap && !(i % 57)) *p++ = '\n';
|
||||
}
|
||||
if (!mod) {
|
||||
if (wrap && i % 57) *p++ = '\n';
|
||||
*p = 0;
|
||||
return output;
|
||||
} else {
|
||||
*p++ = b64table[input[i++] >> 2];
|
||||
*p++ = b64table[((input[i - 1] << 4) | (input[i] >> 4)) & 0x3f];
|
||||
if (mod == 1) {
|
||||
*p++ = '=';
|
||||
*p++ = '=';
|
||||
if (wrap) *p++ = '\n';
|
||||
*p = 0;
|
||||
return output;
|
||||
} else {
|
||||
*p++ = b64table[(input[i] << 2) & 0x3f];
|
||||
*p++ = '=';
|
||||
if (wrap) *p++ = '\n';
|
||||
*p = 0;
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
static char b64revtb[256] = {
|
||||
-3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*0-15*/
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*16-31*/
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, /*32-47*/
|
||||
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1, /*48-63*/
|
||||
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, /*64-79*/
|
||||
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, /*80-95*/
|
||||
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, /*96-111*/
|
||||
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, /*112-127*/
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*128-143*/
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*144-159*/
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*160-175*/
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*176-191*/
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*192-207*/
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*208-223*/
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /*224-239*/
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 /*240-255*/
|
||||
};
|
||||
|
||||
static unsigned int raw_base64_decode(unsigned char *in, unsigned char *out,
|
||||
int strict, int *err) {
|
||||
unsigned int result = 0;
|
||||
int x;
|
||||
unsigned char buf[3], *p = in, pad = 0;
|
||||
|
||||
*err = 0;
|
||||
while (!pad) {
|
||||
switch ((x = b64revtb[*p++])) {
|
||||
case -3: /* NULL TERMINATOR */
|
||||
if (((p - 1) - in) % 4) *err = 1;
|
||||
return result;
|
||||
case -2: /* PADDING CHARACTER. INVALID HERE */
|
||||
if (((p - 1) - in) % 4 < 2) {
|
||||
*err = 1;
|
||||
return result;
|
||||
} else if (((p - 1) - in) % 4 == 2) {
|
||||
/* Make sure there's appropriate padding */
|
||||
if (*p != '=') {
|
||||
*err = 1;
|
||||
return result;
|
||||
}
|
||||
buf[2] = 0;
|
||||
pad = 2;
|
||||
result++;
|
||||
break;
|
||||
} else {
|
||||
pad = 1;
|
||||
result += 2;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
case -1:
|
||||
if (strict) {
|
||||
*err = 2;
|
||||
return result;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
switch (((p - 1) - in) % 4) {
|
||||
case 0:
|
||||
buf[0] = x << 2;
|
||||
break;
|
||||
case 1:
|
||||
buf[0] |= (x >> 4);
|
||||
buf[1] = x << 4;
|
||||
break;
|
||||
case 2:
|
||||
buf[1] |= (x >> 2);
|
||||
buf[2] = x << 6;
|
||||
break;
|
||||
case 3:
|
||||
buf[2] |= x;
|
||||
result += 3;
|
||||
for (x = 0; x < 3 - pad; x++) *out++ = buf[x];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (x = 0; x < 3 - pad; x++) *out++ = buf[x];
|
||||
return result;
|
||||
}
|
||||
|
||||
/* If err is non-zero on exit, then there was an incorrect padding error. We
|
||||
* allocate enough space for all circumstances, but when there is padding, or
|
||||
* there are characters outside the character set in the string (which we are
|
||||
* supposed to ignore), then we end up allocating too much space. You can
|
||||
* realloc() to the correct length if you wish.
|
||||
*/
|
||||
|
||||
unsigned char *spc_base64_decode(unsigned char *buf, size_t *len, int strict, int *err) {
|
||||
unsigned char *outbuf;
|
||||
|
||||
// outbuf = (unsigned char *)malloc(3 * (strlen(buf) / 4 + 1));
|
||||
// ATTN: WTF is this allocation function - does it fail sometimes?)
|
||||
//outbuf = (unsigned char *)malloc(3 * (strlen((char*)buf) / 4 + 1));
|
||||
//outbuf = (unsigned char *)malloc(3 * (strlen((char*)buf)+1));
|
||||
//outbuf = new unsigned char [3 * (strlen((char*)buf)+1)];
|
||||
outbuf = new unsigned char [3 * (strlen((char*)buf) / 4 + 1 + 8)];
|
||||
|
||||
if (!outbuf) {
|
||||
*err = -3;
|
||||
*len = 0;
|
||||
return 0;
|
||||
}
|
||||
*len = raw_base64_decode(buf, outbuf, strict, err);
|
||||
if (*err) {
|
||||
//free(outbuf);
|
||||
delete [] outbuf;
|
||||
*len = 0;
|
||||
outbuf = 0;
|
||||
}
|
||||
return outbuf;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
Copyright (C) John Viega <viega@viega.org>
|
||||
Copyright (C) Matt Messier <mmessier@prilnari.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the <OWNER> nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// To prevent multiple includes
|
||||
#ifndef _b64stuffh
|
||||
#define _b64stuffh
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
unsigned char *spc_base64_encode(unsigned char *input, size_t len, int wrap);
|
||||
unsigned char *spc_base64_decode(unsigned char *buf, size_t *len, int strict, int *err);
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
//---------------------------------------------------------------------------
|
@ -0,0 +1,129 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (C) 2005 İsmail Dönmez <ismail@kde.org>
|
||||
*/
|
||||
|
||||
#include "blowfish.h"
|
||||
#include "mc_blowfish.h"
|
||||
#include "server.h"
|
||||
#include "channel.h"
|
||||
|
||||
#include <qcstring.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
|
||||
namespace Konversation
|
||||
{
|
||||
// Find n'th occurrence of separator in input and return the index
|
||||
int findOccurrence(const QCString& input, const QCString& separator, int nth)
|
||||
{
|
||||
int j=1;
|
||||
uint i;
|
||||
|
||||
for(i=0; i < input.length(); ++i)
|
||||
{
|
||||
if((input.mid(i,1) == separator))
|
||||
{
|
||||
if (j == nth)
|
||||
return i;
|
||||
else
|
||||
++j;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
void decrypt(const QString& recipient, QCString& cipher, Server* server)
|
||||
{
|
||||
QCString key = server->getKeyForRecipient(recipient);
|
||||
|
||||
if(!key.isEmpty())
|
||||
{
|
||||
int index = findOccurrence(cipher, ":", 2);
|
||||
QCString backup = cipher.mid(0,index+1);
|
||||
QCString tmp = cipher.mid(index+1);
|
||||
char* tmp2;
|
||||
|
||||
if(server->identifyMsgEnabled()) // Workaround braindead Freenode prefixing messages with +
|
||||
tmp = tmp.mid(1);
|
||||
|
||||
if( !(tmp.mid(0,4) == "+OK ") && !(tmp.mid(0,5) == "mcps ") )
|
||||
return;
|
||||
else
|
||||
cipher = tmp;
|
||||
|
||||
if(cipher.mid(0,5) == "mcps ")
|
||||
cipher = cipher.mid(5);
|
||||
else
|
||||
cipher = cipher.mid(4);
|
||||
|
||||
QCString ckey( key.length()+2 );
|
||||
QCString result( cipher.length()+1 );
|
||||
qstrncpy(result.data(), cipher.data(), cipher.length());
|
||||
qstrncpy(ckey.data(), key.data(), key.length()+1);
|
||||
tmp2 = decrypt_string(ckey.data(),result.data());
|
||||
const char *pfx="(e) ";
|
||||
// If it's a CTCP we don't want to have the (e) interfering with the processing
|
||||
if (tmp2[0] == 1)
|
||||
pfx = "\x0";
|
||||
cipher = backup+pfx+tmp2+' '+'\n'; // FIXME(??) why is there an added space here?
|
||||
free(tmp2);
|
||||
}
|
||||
}
|
||||
|
||||
void decryptTopic(const QString& recipient, QCString& cipher, Server* server)
|
||||
{
|
||||
QCString key = server->getKeyForRecipient(recipient);
|
||||
|
||||
if(!key.isEmpty())
|
||||
{
|
||||
int index = findOccurrence(cipher, ":", 2);
|
||||