Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.

BUG:215923


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
toma 16 years ago
commit ce4a32fe52

@ -0,0 +1,7 @@
Look in the appropriate subdirectories or files to get more information
about the authors.
The package is maintained by Kalle Dalheimer <kalle@kde.org>, however
numerous people, too many to count, have contributed to kdelibs as a
whole. If you have a specific question, dig up the appropriate mailing
list address, and ask away.

@ -0,0 +1,137 @@
THIS DOCUMENT DESCRIBES HOW YOU CAN COMPILE KDE WHEN USING SUBVERSION
(If you use source tarballs, you can skip "make -f Makefile.cvs" and
should use "make distclean" instead of "svn-clean")
What you need
=============
Make sure you get the following stuff from the repository:
qt-copy (This is qt-3.3.2)
arts
kdelibs
kdebase (strongly recommended but not strictly necessary)
<any other package you are interested in>
It is important that you compile AND INSTALL the above packages in the
above order.
Further you will need GNU make, autoconf 2.52, automake 1.5 and
a working C++ compiler (eg. gcc 2.95.2)
Preparations
============
Before you start you must decide two things:
1) Where do you want to have Qt installed? Qt is a bit lame in that it
basically installs itself in its own source-tree, but symlinks are your
friend. E.g you could link /usr/local/lib/qt3 to where you keep your Qt
source. Qt libs then end up in /usr/local/lib/qt3/lib.
2) Where do you want to have KDE installed. A good candidate is /usr/local/kde
Make sure you do (if using sh, ksh, or bash):
export KDEDIR=/usr/local/kde
With csh or tcsh the following is more appropriate:
setenv KDEDIR /usr/local/kde
Now you want to make sure that Qt and KDE libraries are picked up correctly.
On systems that respond to environment variables something similar to the
following is appropriate:
export LD_LIBRARY_PATH=$KDEDIR/lib:$QTDIR/lib
On systems whose diety of choice is ldconfig, try:
ldconfig -m $KDEDIR/lib
ldconfig -m $QTDIR/lib
You probably also want to add $KDEDIR/bin and $QTDIR/bin to your path.
See http://www.kde.org/kde2-and-kde3.html for tips about setting up
KDE 3.0 next to KDE 2.x.
Compiling
=========
The magic sequence to compile & install a package is:
gmake -f Makefile.cvs
./configure --enable-debug
gmake
gmake install
(On Linux, GNU make is the default make, and gmake in the above commands
can be replaced with make).
For Qt the magic sequence is:
./configure -debug -shared -qt-gif -thread -sm -system-zlib -system-libpng -system-jpeg
make
Common problems
===============
Wrong Qt paths:
One of the biggest problems is picking up the correct version of Qt,
especially if your system has more version of Qt installed. Be aware
that information about library paths gets saved in the "config.cache"
file, "Makefile.in" as well as "Makefile" files. So it can be that after
some struggle to get QTDIR/KDEDIR setup correctly your setup is actually
correct, but old -incorrect- settings are still lying around.
The best thing to do in such a case is to do a "svn-clean" (from kdesdk/scripts).
This removes all files which aren't stored in the repository. You can then start all over
again with "makefile -f Makefile.cvs". Make sure you don't have any important
files lying around in your source tree any more, they will be deleted!
New directories:
When a new directory gets added to the repository it usually only contains a
Makefile.am but not a Makefile. If you try to compile such a directory
you will get an error like:
Making all in management
make[3]: Entering directory /home/gregturp/KDE/kdelibs/kdeprint/management'
make[3]: *** No rule to make target all'. Stop.
make[3]: Leaving directory /home/gregturp/KDE/kdelibs/kdeprint/management'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory /home/gregturp/KDE/kdelibs/kdeprint'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory /home/gregturp/KDE/kdelibs'
make: *** [all-recursive-am] Error 2
The solution is to redo "make -f Makefile.cvs; ./configure".
You can create a single Makefile from a Makefile.am file with the
kdesdk/scripts/create_makefile script. Make sure to run it from the toplevel
directory. (E.g. /home/gregturp/KDE/kdelibs)
Problems?
=========
See http://www.kde.org/compilationfaq.html for common build problems
and their solution.
If you encounter _LINK_ problems you are probably doing something wrong.
Do a "svn-clean" and start from scratch, usually this solves the problem.
If you encounter missing include files, especially if the files start with
a 'q', you probably have not setup your QTDIR correct or have the wrong
version of Qt.
If you encounter compile errors after updating from SVN, check whether you
need to update kdelibs as well. If the problems persists, wait a few hours,
usually compile errors are fixed shortly after they have been introduced.
If you still have problems read the kde-devel@kde.org mailinglist and/or
post your problem there. You can subscribe by sending mail to
kde-devel-request@kde.org with "subscribe" in the subject.
Have fun!
Cheers,
Waldo Bastian
bastian@kde.org

@ -0,0 +1,130 @@
<html>
<!-- See also developer.kde.org/documentation/other/compiling.html -->
<!-- and www/anoncvs.html -->
<body bgcolor="#FFFFFF">
<h1>THIS DOCUMENT DESCRIBES HOW YOU CAN COMPILE KDE WHEN USING CVS</h1>
<p>(If you use source tarballs, you can skip "make -f Makefile.cvs" and
should use "make distclean" instead of "make cvs-clean")
<p><h3>What you need</h3>
<p>Make sure you get the following stuff from CVS:
<p><ul><li>qt-copy (This is qt-3.3.2)
<li>arts
<li>kdelibs
<li>kdebase (strongly recommended but not strictly necessary)
<li>any other package you are interested in
</ul>
<p>It is important that you compile AND INSTALL the above packages in the
above order.
<p>Further you will need GNU make, autoconf 2.52, automake 1.5 and
a working C++ compiler (eg. gcc 2.95.2)
<p><h3>Preparations</h3>
<p>Before you start you must decide two things:
<p>1) Where do you want to have Qt installed? Qt is a bit lame in that it
basically installs itself in its own source-tree, but symlinks are your
friend. E.g you could link /usr/local/lib/qt3 to where you keep your Qt
source. Qt libs then end up in /usr/local/lib/qt3/lib.
<p>2) Where do you want to have KDE installed. A good candidate is /usr/local/kde
<p>Make sure you do (if using sh, ksh, or bash):
<pre>export KDEDIR=/usr/local/kde</pre>
<p>With csh or tcsh the following is more appropriate:
<pre>setenv KDEDIR /usr/local/kde</pre>
<p>Now you want to make sure that Qt and KDE libraries are picked up correctly.
<p>On systems that respond to environment variables something similar to the
following is appropriate:
<p>export LD_LIBRARY_PATH=$KDEDIR/lib:$QTDIR/lib
<p>On systems whose diety of choice is ldconfig, try:
<pre>ldconfig -m $KDEDIR/lib
ldconfig -m $QTDIR/lib</pre>
<p>You probably also want to add $KDEDIR/bin and $QTDIR/bin to your path.
<p>See http://www.kde.org/kde2-and-kde3.html for tips about setting up
KDE 3.0 next to KDE 2.x.
<p><h3>Preparing CVS modules</h3>
<p>
All KDE modules require an "admin" sub-directory. You can create it by
making a symbolic link from kde-common/admin, make sure to check out the
kde-common module.
<p>
Example:<br>
<pre>
cd kdelibs
ln -s ../kde-common/admin
</pre>
<p><h3>Compiling</h3>
<p>The magic sequence to compile &amp; install a package is:
<pre>gmake -f Makefile.cvs
./configure --enable-debug
gmake
gmake install </pre>
<p>(On Linux, GNU make is the default make, and gmake in the above commands
can be replaced with make).
<p>For Qt the magic sequence is:
<pre>./configure -debug -shared -qt-gif -thread -sm -system-zlib -system-libpng -system-jpeg
make</pre>
<p><h3>Common problems</h3>
<p>One of the biggest problems is picking up the correct version of Qt,
especially if your system has more version of Qt installed. Be aware
that information about library paths gets saved in the "config.cache"
file, "Makefile.in" as well as "Makefile" files. So it can be that after
some struggle to get QTDIR/KDEDIR setup correctly your setup is actually
correct, but old -incorrect- settings are still lying around.
<p>The best thing to do in such a case is to do a "make cvs-clean". This
removes all files which aren't stored in CVS. You can then start all over
again with "makefile -f Makefile.cvs". Make sure you don't have any important
files lying around in your source tree any more, they will be deleted!
<p><h3>Problems?</h3>
<p>See <a href="http://www.kde.org/compilationfaq.html">http://www.kde.org/compilationfaq.html</a> for common build problems and their solution.
<p>If you encounter _LINK_ problems you are probably doing something wrong.
Do a "make cvs-clean" and start from scratch, usually this solves the problem.
<p>If you encounter missing include files, especially if the files start with
a 'q', you probably have not setup your QTDIR correct or have the wrong
version of Qt.
<p>If you encounter compile errors after updating from CVS, check whether you
need to update kdelibs as well. If the problems persists, wait a few hours,
usually compile errors are fixed shortly after they have been introduced.
<p>If you still have problems read the kde-devel@kde.org mailinglist and/or
post your problem there. You can subscribe by sending mail to
kde-devel-request@kde.org with "subscribe" in the subject.
<p>Have fun!
<p>Cheers,<br>
Waldo Bastian<br>
bastian@kde.org<br>
</body>
</html>

@ -0,0 +1,346 @@
NOTE! The GPL below is copyrighted by the Free Software Foundation, but
the instance of code that it refers to (the kde programs) are copyrighted
by the authors who actually wrote it.
---------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, 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.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

@ -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,20 @@
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.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.

@ -0,0 +1,486 @@
NOTE! The LGPL below is copyrighted by the Free Software Foundation, but
the instance of code that it refers to (the kde libraries) are copyrighted
by the authors who actually wrote it.
---------------------------------------------------------------------------
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin Street, 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.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library 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.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

184
DEBUG

@ -0,0 +1,184 @@
Introduction
============
This is a short tutorial on debugging KDE applications. Throughout this
tutorial I will use "kedit" as example application.
Configuring for debugging
=========================
You can use --enable-debug with the configure script, if you want to have
debug code in your KDE libs. If you have the space and can stand code that's
somewhat slower, this is worth it. The extra information really
helps debugging and thus bugfixing.
On the other hand, --disable-debug removes all debug messages, leading
to a faster and cleaner desktop.
Debugging with GDB
==================
The recommended version of gdb to use is version 4.95 or higher, older
versions have problems generating proper backtraces.
There are three ways to debug an application with gdb:
1) You can start the application from within gdb.
2) You can attach gdb to an already running application.
3) You can run gdb after an application has crashed using a core file.
Starting applications from within gdb
=====================================
To start an application with gdb you can start gdb as follows:
> gdb kedit
GNU gdb 4.95.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb)
You can now set the command line arguments that you want to pass to kedit with
the gdb command "set args":
(gdb) set args myfile.txt
(gdb)
gdb has loaded the kedit executable on startup but it hasn't loaded any of
the libraries yet. This means that you can set any breakpoints in the
libraries yet. The easiest way to do that is to set a breakpoint in the
first line of main and then start the program:
(gdb) break main
Breakpoint 1 at 0x804855c
(gdb) run
Starting program: /opt/kde/bin/kedit myfile.txt
Breakpoint 1 at 0x4002cf18: file kedit.cpp, line 1595.
Breakpoint 1, main (argc=2, argv=0xbffff814) at kedit.cpp:1595
1595 bool have_top_window = false;
Current language: auto; currently c++
(gdb)
You can now set breakpoints everywhere. For example lets set a breakpoint
in the KApplication constructor. Unfortunately gdb is not very good in
handling C++ names, so it is not really possible to specify the constructor
directly after the break command. Instead we look up a line of source
code where we want to place the breakpoint. An external editor is of great
use at this point. With the list command we can select the source file we
are interested in and verify that we have found the correct source line:
(gdb) list kapp.cpp:220
215 parseCommandLine( argc, argv );
216 }
217
218 KApplication::KApplication( bool allowStyles, bool GUIenabled ) :
219 QApplication( *KCmdLineArgs::qt_argc(), *KCmdLineArgs::qt_argv(),
220 GUIenabled ),
221 KInstance( KCmdLineArgs::about),
222 d (new KApplicationPrivate)
223 {
224 if (!GUIenabled)
(gdb) break 224
Breakpoint 2 at 0x4048aa7e: file kapp.cpp, line 224.
(gdb)
We can now continue the execution of kedit. Execution will stop when it hits
a breakpoint of when the program exits. In this case execution will stop
in the first line of the KApplication constructor:
(gdb) continue
Continuing.
Qt: gdb: -nograb added to command-line options.
Use the -dograb option to enforce grabbing.
Breakpoint 2, KApplication::KApplication (this=0xbffff6a8, allowStyles=true,
GUIenabled=true) at kapp.cpp:224
224 if (!GUIenabled)
(gdb)
Attaching gdb to already running applications
=============================================
Sometimes it is not practical to start an application from within gdb.
E.g. in those cases where you didn't know the application was about to
crash :-) When you get the friendly DrKonqi dialog informing you about
a crash you are just in time to start your debugger.
First lets attach gdb to an application that hasn't crashed (yet).
You start with finding the process of the application with e.g. "ps -aux":
> ps -aux | grep kedit
bastian 21570 15.1 6.8 13740 8800 pts/6 S 15:34 0:01 kedit
bastian 21582 0.0 0.3 1132 412 pts/6 R 15:34 0:00 grep kedit
From this you learn that kedit has process id 21570. Now you can start gdb as
follows:
> gdb kedit 21570
GNU gdb 4.95.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
/home1/bastian/21570: No such file or directory.
Attaching to program: /opt/kde/bin/kedit, Pid 21570
Reading symbols from /opt/kde/lib/kedit.so.0...done.
Loaded symbols for /opt/kde/lib/kedit.so.0
....
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_compat.so.2...done.
Loaded symbols for /lib/libnss_compat.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
0x40c3d88e in __select () from /lib/libc.so.6
(gdb)
You will usually end up in the middle of a select() call from the event-loop.
This is the place where a KDE application spends most of its time, waiting
for things to happen.
A backtrace will typically look something like this:
(gdb) bt
#0 0x40c3d88e in __select () from /lib/libc.so.6
#1 0x40a22844 in __DTOR_END__ () at fam.c++:356
#2 0x407293bf in QApplication::enter_loop (this=0xbffff6e8)
at kernel/qapplication.cpp:2552
#3 0x406b1d7b in QApplication::exec (this=0xbffff6e8)
at kernel/qapplication_x11.cpp:2217
#4 0x4002d500 in main (argc=1, argv=0xbffff854) at kedit.cpp:1662
#5 0x40bbba5e in __libc_start_main (main=0x8048568 <main>, argc=1,
argv=0xbffff854, init=0x8048514 <_init>, fini=0x80486cc <_fini>,
rtld_fini=0x4000aa20 <_dl_fini>, stack_end=0xbffff84c)
at ../sysdeps/generic/libc-start.c:92
(gdb)
Getting core dumps
==================
If you want to have a core dump after your application crashes you need to
do two things:
1) Disable the KDE crash handler. This can be done either by using the
--nocrashhandler command line option or by setting the KDE_DEBUG environment
variable to some value e.g. KDE_DEBUG=true.
2) Enable core dump generation by changing the so called 'ulimits' with the
following command:
ulimit -c unlimited

@ -0,0 +1,173 @@
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 a while. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Type `make install' to install the programs and any data files and
documentation.
4. 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/kde/bin', `/usr/local/kde/lib', etc. You can specify an
installation prefix other than `/usr/local/kde' 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.
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,925 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML Level 2//EN//2.0">
<HTML>
<HEAD>
<TITLE>Guide to Porting Applications to KDE 2.0</TITLE>
</HEAD>
<BODY>
<H2>Porting Applications to KDE 2.0</H2>
<H3>Last Modified on November 28, 2000</H3>
This document contains the changes you have to apply to programs written for
KDE1.1 when you want to port them to KDE2.0.<P>
As a start you should have a look at doc/porting.doc in the Qt package,
or <a href="http://doc.trolltech.com/porting.html">this page online</a>.<P>
<H3><A NAME="TOC">Table of Contents</A></H3>
<UL>
<LI><A HREF="#gettingstarted">Getting Started</A></LI>
<LI><A HREF="#general">Global changes</A></LI>
<LI><A HREF="#automoc">automoc/am_edit, Makefile.am tags</A></LI>
<LI><A HREF="#KApplication">KApplication</A></LI>
<LI><A HREF="#KCmdLineArgs">KCmdLineArgs</A></LI>
<LI><A HREF="#KLocale">KLocale</A></LI>
<LI><A HREF="#KGlobal">KGlobal: access to KDE global objects.</A></LI>
<LI><A HREF="#KIconLoader">KIconLoader</A></LI>
<LI><A HREF="#KTMainWindow">KTMainWindow</A></LI>
<LI><A HREF="#KHelpMenu">KHelpMenu</A></LI>
<LI><A HREF="#KToolBar">KToolBar</A></LI>
<LI><A HREF="#launching">Starting other programs</A></LI>
<LI><A HREF="#khtmlw">khtmlw</A></LI>
<LI><A HREF="#KIntegerLine">KIntegerLine, KIntLineEdit</A></LI>
<LI><A HREF="#KDNDIcon">KDNDIcon, KDNDDropZone, KDNDWidget, kdecore/drag.h</A></LI>
<LI><A HREF="#KConfigBase">KConfigBase, KConfig, KSimpleConfig</A></LI>
<LI><A HREF="#libkfm">libkfm</A></LI>
<LI><A HREF="#KDialog">KDialog</A></LI>
<LI><A HREF="#kcharsets">kcharsets</A></LI>
<LI><A HREF="#KWizard">KWizard, KNoteBook</A></LI>
<LI><A HREF="#KSpinBox">KSpinBox, KNumericSpinBox</A></LI>
<LI><A HREF="#KClipboard">KClipboard</A></LI>
<LI><A HREF="#KPanner">KPanner, KNewPanner</A></LI>
<LI><A HREF="#KTreeList">KTreeList, KTreeListItem</A></LI>
<LI><A HREF="#KMsgBox">KMsgBox</A></LI>
<LI><A HREF="#KCombo">KCombo</A></LI>
<LI><A HREF="#KQuickHelp">KQuickHelp</A></LI>
<LI><A HREF="#KPixmapgradientFill">KPixmap::gradientFill</A></LI>
<LI><A HREF="#KTabListBox">KTabListBox</A></LI>
<LI><A HREF="#KToolBarButton">KToolBarButton &amp; KRadioGroup</A></LI>
<LI><A HREF="#KAccel">KAccel</A></LI>
<LI><A HREF="#kstring">kstring.h / KString</A></LI>
<LI><A HREF="#ktopwidget">ktopwidget.h / KTopWidget</A></LI>
<LI><A HREF="#kbutton">kbutton.h / KButton</A></LI>
<LI><A HREF="#kbuttonbox">kbuttonbox.h / KButtonBox</A></LI>
<LI><A HREF="#kcolorgroup">kcolorgroup.h / KColorGroup</A></LI>
<LI><A HREF="#kled">kled.h, kledlamp.h / KLed, KLedLamp</A></LI>
<LI><A HREF="#KDockWidget">KDockWidget</A></LI>
<LI><A HREF="#KPixmap">KPixmap, KPixmapEffect</A></LI>
<LI><A HREF="#KControlCenter">KDE Control Center</A></LI>
<LI><A HREF="#KWMModuleApplication">KWMModuleApplication libkdeui/kwmmapp.h</A></LI>
<LI><A HREF="#KDebug">KDebug</A></LI>
<LI><A HREF="#KFileDialog">KFileDialog - General Stuff</A></LI>
<LI><A HREF="#KFileDialogPreview">KFileDialog - Preview Mode</A></LI>
<LI><A HREF="#ImageEffects">Image Effects</A></LI>
<LI><A HREF="#KAudio">KAudio (kaudio.h)</A></LI>
<LI><A HREF="#KImageIO">KImageIO (kimgio.h)</A></LI>
</UL>
<H3><A NAME="gettingstarted">Getting started</A></H3>
The first step to get your KDE application to compile under KDE 2.0,
is to detect KDE 2.0 and Qt 2.x at configure time. The easiest way to
get a working autoconf/automake framework, is to either use
<a href="http://www.kdevelop.org">KDevelop</a> or
<a href="http://home.earthlink.net/~granroth/kapptemplate/index.html">kapptemplate</a>
(available in CVS under the module "kdesdk"), to generate a new
application template. Replace the generated source files by yours
and adapt Makefile.am accordingly.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="general">Global changes</A></H3>
We did our best to clean up the header files of kdelibs, so they do
not include unnecessary bloat for your application. As a consequence, you
may notice that some header files are missing from your source files as
they have been included before by kapp.h for example. There is a script
in kdesdk/scripts called "fixheaders" that takes care of most of these
cases. Just call "make -k 2&gt;&amp;1 | perl .../fixheaders" and it will try
to look after the error messages and add includes as it recognize the
errors.<P>
Also, if your code does not compile and complains about missing member
functions, you should check for methods that started with get...().
These methods have been renamed to xy*() for consistency.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="automoc">automoc/am_edit, Makefile.am tags</A></H3>
On the subject of the compilation framework, automoc has been removed from
the admin directory. It has been replaced by am_edit which provides a lot of
additional features.<P>
METASOURCES=AUTO still does the job of generating the appropriate moc files,
but in addition, you should use KDE_ICON for the icons representing the application
(and naming those icons conforming to lo16-app-&lt;appname&gt;.png), and install
the application-specific icons under $(kde_datadir)/&lt;appname&gt;/pics.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KApplication">KApplication</A></H3>
doesn't hold any longer a KLocale instance. With this getLocale()
and isLocaleInstantiated are now replaced by KGlobal::locale()<P>
it also doesn't hold a KiconLoader instance. As this also getIconLoader()
has been removed. Replace kapp-&gt;getIconLoader()-&gt;loadIcon() with
BarIcon() or use KGlobal::iconLoader() instead of getIconLoader()<P>
kde_*dir() have been removed as they require a unique top level directory
for all applications (KDEDIR). This concept doesn't exist in KDE 2.0
any more, it has been replaced with "multiple levels of directories",
set in KDEDIRS, so that it's possible to have global settings and
group settings, applied before user settings.<P>
Replace code that uses kde_*dir() + filename with calls to
locate(filetype, filename) where filetype is what * used to be
in kde_*dir(). locate is defined as function in kstddirs.h to call
KGlobal::dirs()-&gt;findResource.<P>
Use locateLocal to get the path of a writable file. For instance,
KApplication::localconfigdir()+filename is now locateLocal( "config", filename ),
but for most cases, simply using KGlobal::config() is enough, if you're happy
with saving the application's configuration into appnamerc, or
KSimpleConfig cfg("anothercfgfile") to create a config file with another name.<P>
generalFont() and fixedFont() are deprecated and will be removed soon.
Please use KGlobalSettings::generalFont() and KGlobalSettings::fixedFont() instead.<P>
appName() is deprecated. Please use QApplication::name() or instanceName
instead.<P>
The methods tempSaveName() and checkRecoverFile() return QString
now. The returned values must _not_ be free()d.<P>
helpMenu() has been moved to KMainWindow. aboutKDE(), aboutApp() and
appHelpActivated() have all been removed See section for KMainWindow
for more info.<P>
The KApplication constructor has changed. Command line arguments and
program name should no longer be passed to KApplication but to
KCmdLineArgs. KCmdLineArgs performs command line parsing and a command
line help. See below for more info.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KCmdLineArgs">KCmdLineArgs</A></H3>
KCmdLineArgs is a new class that handles command line parsing and
command line help. It is now required that your application
specifies at least:<P>
<UL>
<LI>Its name.
<LI>A short description what it does. (e.g. 1 line)
<LI>A version.
<LI>All command line options that it supports.
</UL>
KCmdLineArgs itself will add the command line options supported by Qt
and KApplication.<P>
You can also use the KAboutData class to specify name, description and
version.<P>
In return for this information you can query KCmdLineArgs whether an
certain option was specified on the command line and your application
now automatically supports --help and --version. It aborts with a
useful error message when the command line contains a syntax error.
See kdelibs/kdecore/kcmdlineargs.h for more info.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KLocale">KLocale</A></H3>
i18n is no longer a macro<P>
KApplication::getApplication()-&gt;getLocale()-&gt;translate<P>
but a function on its own. klocale is obsolete and replace every call
to klocale-&gt;translate with i18n.<P>
The return value of i18n is also no longer a const char*,
but a unicode QString.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KGlobal">KGlobal: access to KDE global objects.</A></H3>
KGlobal allows centralized access to KDE global objects without including
extraneous headers. object creation is deferred if possible.<P>
All methods are static and headers for returned types are not included. You
must have created a KApplication object before the methods can be used.<P>
<TABLE BORDER="0">
<TR>
<TD COLSPAN="2">
<PRE>
#include &lt;kglobal.h&gt;
#include &lt;kconfig.h&gt; // Needed to use KConfig
#include &lt;klocale.h&gt; // Needed to use KLocale
#include &lt;kiconloader.h&gt; // Needed to use KIconLoader
</PRE>
</TD>
</TR>
<TR>
<TD>
<PRE>
...
KConfig *appcfg = KGlobal::config();
QString mystr = i18n( "This is a string" );
KIconLoader *loader = KGlobal::iconLoader();
</PRE>
</TD>
</TR>
</TABLE>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KIconLoader">KIconLoader</A></H3>
KIconLoader in 1.1 used to mix icons for applications and for toolbars.
This has changed, so you may notice that your application doesn't find
the right icons. loadIcon (used by BarIcon) returns only toolbar icons.<P>
If you need icons for applications, use loadApplicationIcon.<P>
loadMiniIcon and loadApplicationMiniIcon have been removed, instead
loadApplicationIcon now takes a "size" argument where you can specify the
size of the icon (small, medium, large).<P>
The other big change you may notice, is that ICON and Icon have been
removed as they caused big confusion for not loading application icons
(see above). For this we added BarIcon which does the same as ICON before.
The third change in this row is that loadIcon doesn't need the extension
anymore, but looks for standard extensions (png, xpm) itself. If you hard-
coded .xpm, loadIcon will issue a warning at runtime, but will still work
in stripping off the .xpm part<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KTMainWindow">KTMainWindow</A></H3>
KTMainWindow has been replaced with KMainWindow.<p>
The KMainWindow constructor needs a parent widget as first argument.
You can use 0 for this.<p>
setView() has been replaced with setCentralWidget().<p>
view() has been replaced with centralWidget().<p>
addToolBar() has been removed, it is not needed any more.<p>
setMenu(...) has been removed, it is not needed any more.<p>
setStatusBar(...) has been removed, it is not needed any more.<p>
updateRects() has been removed, it is not needed any more.<p>
enableStatusBar(...) has been removed, use statusBar()-&gt;show() and/or
statusBar()-&gt;hide() instead.<p>
enableToolBar(...) has been removed, use toolBar()-&gt;show() and/or
toolBar()-&gt;hide() instead. <p>
view_* public variables do no longer exist. There is really no reason
for an app to use this information. If you do need it anyway, use
mainViewGeometry() instead.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KHelpMenu">KHelpMenu</A></H3>
helpMenu() has been moved to KMainWindow from KApplication (kapp).<P>
Both the "About KDE" and the "About &lt;Application&gt;" dialog boxes
are now modeless. "About KDE" is a completely new widget.<P>
If you used in the toplevel window (that is derived from KMainWindow)
"kapp-&gt;helpMenu( bool, QString )" to get the help menu
you must now change this to "helpMenu( QString )". The QString defaults
to QString::null so it is sufficient to write helpMenu().<P>
The old aboutKDE(), aboutApp() and appHelpActivated() of KApplication
have all been removed. If you need direct access to these or need
access to a help menu in a class that is not derived from
KMainWindow then allocate an instance of the new class KHelpMenu.
See KDE 2.0 API reference or khelpmenu.h (kdeui) for additional info.<P>
Espen Sand &lt;<A HREF="mailto:espen@kde.org">espen@kde.org</A>&gt;<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KToolBar">KToolBar</A></H3>
enable(...) is depreciated, use show()/hide() instead.<p>
enableFloating(...) has been removed, use enableMoving() instead.<p>
setMaxHeight() is depreciated, use setMaximumHeight() instead.<p>
maxHeight() is depreciated, use maximumHeight() instead.<p>
setMaxWidth() is depreciated, use setMaximumWidth() instead.<p>
maxWidth() is depreciated, use maximumWidth() instead.<p>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="launching">Starting other programs</A></H3>
In KDE 2.0 there are several ways to start other programs from within
your application. Here is a short summary of your options with reasons why
you should or should not use them.
<H4>1. fork + exec</H4>
<P>
You never want to use this unless you have a very good reason why it is
impossible to use KProcess.
</P>
<H4>2. KProcess</H4>
<P>
You want to use this if you need to start a new process which needs to be a
child of your process, e.g. because you want to catch stdout/stderr or need
to send it data via stdin. You should never use this to start other KDE
applications unless your application is called kgdb :-) If you need to
send/receive text like data to/from the process, you are probably better
off with KProcIO
</P>
<H4>3. KProcIO</H4>
<P>
Like KProcess. Unlike KProcess, this class actually makes it easy to
send data to and receive data from the process.
</P>
<H4>4. startServiceByDesktopPath</H4>
<P>
Preferred way to launch desktop (KDE/Gnome/X) applications or KDE services.
The application/service must have a .desktop file. It will make use of
KDEinit for increased startup performance and lower memory usage. These
benefits only apply to applications available as KDEinit loadable module (KLM)
</P>
<H4>5. KRun</H4>
<P>
Generic way to open documents/applications/shell commands. Uses
startServiceBy.... where applicable. Offers the additional
benefit of startup-notification.<BR>
KRun can start any application, from the binary or the desktop file,
it will determine the mimetype of a file before running the
preferred handler for it, and it can also start shell commands.
This makes KRun the recommended way to run another program in KDE 2.
</P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="khtmlw">khtmlw</A></H3>
khtmlw has been replaced with khtml.<BR>
<UL>
<LI>KHTMLView has vanished. Just use KHTMLWidget, which does scrollbar
managing for free.
<LI>A lot of the API has changed. If you just want to open a file/URL,
you just need to do:<P>
<PRE>
KHTMLWidget *w = new KHTMLWidget();
w-&gt;openURL(myURL);
</PRE>
<LI>khtml uses QString's instead of char *'s now. This means, that most
of the api has changed. In all functions:<P>
<PRE>
const char * -&gt; QString
QStrList -&gt; QStringList
</PRE>
The only exception for the moment is KHTMLWidget::write(), which does
also exist in a const char * version.<P>
<LI>you won't need the getKHTMLWiget function anymore. Just replace
getKHTMLWidget-&gt;xxx() with xxx()<P>
<LI>xxx(QString) -&gt; xxx(const QString &amp;)<P>
<LI>consistent naming. All getXyz() functions are renamed to xyz()<P>
<LI>replaced/changed functions:<P>
<TABLE BORDER="1">
<TR>
<TD>KHTMLWidget::setDefaultFontBase()</TD>
<TD>-&gt; setFontSizes()</TD>
</TR>
<TR>
<TD>x/yOffset()</TD>
<TD>-&gt; contentsX/Y()</TD>
</TR>
<TR>
<TD>getSelectedText(QString &amp;)</TD>
<TD>-&gt; QString selectedText()</TD>
</TR>
<TR>
<TD COLSPAN="2" ROWSPAN="0">findTextEnd() has vanished. just remove the call from your code</TD>
</TR>
<TR>
<TD>gotoXY(x, y)</TD>
<TD>-&gt; setContentsPos(x, y)</TD>
</TR>
<TR>
<TD>docWidth()</TD>
<TD>-&gt; contentsWidth()</TD>
</TR>
<TR>
<TD>docHeight()</TD>
<TD>-&gt; contentsHeight()</TD>
</TR>
</TABLE><P>
<LI>Don't forget to change the link-flags! (-lkhtml -lkjava instead of -lkhtmlw)
</UL>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KIntegerLine">KIntegerLine, KIntLineEdit</A></H3>
KIntegerLine and KIntLineEdit have been replaced by KIntNumInput.
The new header file is called knuminput.h.<P>
The new KIntNumInput can have an optional slider attached, ensures
that the entered value is in a given range (use MAX_INT or similar
if you don't care about the range) and can maintain a descriptive
label and also a unit for the edited value.<P>
The API is almost the same and it simplifies existing code a bit,
so give it a try. If you need more functionality, please contact
me, Dirk A. Mueller &lt;<A HREF="mailto:mueller@kde.org">mueller@kde.org</A>&gt;.<P>
The additional class KDoubleNumInput gives you the same look &amp; feel,
but allows you to edit floating point numbers.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KDNDIcon">KDNDIcon, KDNDDropZone, KDNDWidget, kdecore/drag.h</A></H3>
KDE Drag and Drop is Dead. Long live Qt Xdnd.<P>
Xdnd is better anyway, because it has been adopted by all the other
major GUI toolkits still under active development (this precludes
Motif, but maybe we can convince the lesstif guys!). Some changes
are necessary to convert your old KDND-based stuff to Qt DND.<P>
<UL>
<LI>Remove drag.h from all of your sources / header files.<P>
<LI>Remove KDNDDropZone object creations. Instead of creating an
object of this type and then connecting it to some arbitrary slot
to handle drops, call "setAcceptDrops(true)" in your widget
constructor and then override the protected methods dragEnterEvent,
dragMoveEvent, dragLeaveEvent, and dropEvent.<P>
<LI>You should be aware that to handle drops, you will either have to
inherit a widget and then override the methods mentioned above,
or install an event handler for the widget in that widget's parent,
and then handle QEvent::DragMove or QEvent::Drop inside there (if
you want to avoid inheritance).<P>
<LI>You can emulate the old DndURL drop-type behavior with the Qt
Drag Object type QUriList.<P>
<LI>You can start a drag from inside your widget's mouseMoveEvent
method if you wish.<P>
<LI>Qt includes a Drag and Drop tutorial. We suggest you read that
now if you are confused.<P>
<LI>QMultiLineEdit has already a DnD interface that accepts text/*
If you want to add support for other mimetypes, you need to
re-implement all DnD-methods (also dragMoveEvent()) and pass
QTextDrag's to the parent methods.<P>
<LI>QTextDrag also accepts text/uri-list, which means that you
always need to check for QUriDrag first if you want to get
both working.<P>
<LI>The mimetype for Uri's is now text/uri-list. If you've used
the proprietary Qt 1.x url/url, you need to adjust that.
</UL>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KConfigBase">KConfigBase, KConfig, KSimpleConfig</A></H3>
These classes have been largely re-implemented. The external API
remains mostly the same, with the single notable change that
the groupIterator and entryIterator methods have been removed and
instead replaced by groupList (which returns a QStringList of groups)
and entryMap(const QString &amp;group) (which returns a QMap of entries
in the specified group). This is due to internal changes in KConfig
which would make providing iterators possibly rather difficult.<P>
Much more extensive documentation on the KConfig and friends API can
be found in the kdoc generated documentation from the header files,
and in kdecore/KCONFIG_DESIGN.<P>
To use the new iterator, you will probably want to do something like
this:<P>
<PRE>
QMap&lt;QString, QString&gt; tmpMap = config-&lt;entryMap(myGroup);
QMap&lt;QString, QString&gt;::Iterator aIt(tmpMap.begin());
for (; aIt != tmpMap.end(); ++aIt) {
// body here. Access iterator key as aIt.key(),
// data as *aIt.
}
</PRE>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="libkfm">libkfm has disappeared</A></H3>
Lots of other functionalities have been taken out of kfm, some being
now in libkio, some in libkonq.<P>
<STRONG> Replacement table :</STRONG><P>
<TABLE BORDER="1">
<TR><TD>KFM::download </TD><TD>-&gt; KIO::NetAccess::download (kdelibs/kio/netaccess.h)</TD></TR>
<TR><TD>KFM::removeTempFile </TD><TD>-&gt; KIO::NetAccess::removeTempFile</TD></TR>
<TR><TD COLSPAN="2" ROWSPAN="0">refreshDesktop, sortDesktop, selectRootIcons : removed; kdesktop handles it</TD></TR>
<TR><TD>KFM::configure </TD><TD>-&gt; see konqueror DCOP interface</TD></TR>
<TR><TD>KFM::openURL </TD><TD>-&gt; "(void) new KRun (url)" (kdelibs/kio/krun.h)</TD></TR>
<TR><TD>KFM::refreshDirectory </TD><TD>-&gt; not needed anymore since konqy/kdesktop use KDirWatch</TD></TR>
<TR><TD>KFM::openProperties </TD><TD>-&gt; "(void) new KPropertiesDialog (url)" (kdelibs/kfile/kpropsdlg.h)</TD></TR>
<TR><TD>KFM::exec </TD><TD>-&gt; "(void) new KRun (url)" (kdelibs/kio/krun.h)</TD></TR>
<TR><TD>KFM::copy, KFM::move </TD><TD>-&gt; KIO::Job (async, see kio/job.h)<BR>
or KIO::NetAccess (sync, see kio/netaccess.h)</TD></TR>
<TR><TD>DlgLocation </TD><TD>-&gt; Use KLineEditDlg (kdeui/klineeditdlg.h) instead</TD></TR>
</TABLE>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KDialog">KDialog</A></H3>
KDialog is no longer defined in kwizard.h. Include kdialog.h instead.<P>
Note that the best way to write new dialogs is to use KDialogBase (see kdialogbase.h)<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kcharsets">kcharsets</A></H3>
The kcharsets class has been completely rewritten, and most of it has
vanished, since support for it moved to Qt.<P>
Most applications will only need to replace kapp-&gt;getKCharsets() with
KGlobal::charsets().<P>
For conversion of various input formats to QStrings, please have a
look at QTextCodec and classes derived from it.<P>
Character entities are now converted from and to QChars. The name has
changed from convertTag to fromEntity and toEntity.<P>
To get a font, which can display a certain charset (if such a font
exists), you can use the KCharsets::setQFont methods. Input is a font and
a charset. Kcharsets tries to find an output font, which matches the
input font most closely, but can display the given charset.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KWizard">KWizard, KNoteBook</A></H3>
KWizard is based on QWizard now. The API has changed. Consult Qt's
documentation and kdelibs/kdetest/kwizardtest.cpp for an example use.<P>
KNoteBook (deeply entwined with the former KWizard) has been removed until
someone is willing to port it to work with the new wizard. If you want to
use it you'll find the necessary files in kdegraphics/kiconedit.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KSpinBox">KSpinBox, KNumericSpinBox</A></H3>
These classes have been replaced by QSpinBox. API is almost the same
HINTS:<P>
<UL>
<LI>valueincreased()/valuedecreased -&gt; valueChanged()
<LI>getValue() -&gt; value()
</UL>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KClipboard">KClipboard</A></H3>
KClipboard has been removed. In case you've been using KClipboard,
QClipboard is the way to go now, as it has all the functionality the K
version had, and more.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KPanner">KPanner, KNewPanner</A></H3>
KPanner and KNewPanner have been removed. QSplitter does everything
KPanner did and more. The api is similar, but not compatible.
Basically to set it up so that you have a vertical splitter between a
listbox, a listview and multi line editor, you would do something like
this:<P>
<TABLE><TR><TD>
QSplitter *split = new QSplitter( parent );<BR>
QListBox *lb = new QListBox( split );<BR>
KListView *lv = new KListView( split );<BR>
QMultiLineEdit *ed = new QMultiLineEdit( split );
</TD></TR></TABLE>
As you can see you are not limited to two children. Additionally, you
do not have to call activate when you are done, and opaque resizing is
possible if you call setOpaqueResize(true).<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KTreeList">KTreeList, KTreeListItem</A></H3>
Use KListView, QListViewItem instead. API is almost the same, you only
need to add a Column (KListView::addColum) before KListView is useable.<P>
KListView has no addChild(), insertItem() and removeItem() calls. Inserting
a root item is done by constructing a QListViewItem with the KListView
passed as the parent widget. adding a child item is done by constructing
a QListViewItem with the parent item as parameter. removeItem() should
be replaced by delete &lt;pointer to item&gt;.<P>
The root items are not shown in a tree fashion by default. to get this,
use KListView::setDecorativeRoot(true).<P>
Expanding and collapsing can by done by using QListViewItem::setOpen(bool).<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KMsgBox">KMsgBox</A></H3>
KMsgBox has been superseded by QMessageBox. Which has been superseded
by KMessageBox.<P>
<UL>
<LI>KMsgBox had return codes starting with 1 for the first button, 2 for
the second, and so on. KMessageBox defines an enum which you should
use instead.
<LI>Please note that you shouldn't add the name of your application
to the caption argument. It is already added automatically.
</UL>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KCombo">KCombo</A></H3>
KCombo has been removed. Use KComboBox instead, it is completely
compatible with the old KCombo API. The method that you may have problems
with is the old KCombo::setText. This has been renamed to
KComboBox::setEditText.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KQuickHelp">KQuickHelp</A></H3>
KQuickHelp, the "super-tooltip" widget, has been replaced by QWhatsThis.
It provides a compatible API and almost the same look and feel, in addition
to some new functionality.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KPixmapgradientFill">KPixmap::gradientFill</A></H3>
Instead of old KPixmap::gradientFill, use:<P>
KPixmapEffect::gradient(KPixmap&amp;, QColor, QColor, enum KPixmapEffect::GradientType, int)<P>
Hence:<P>
pix.gradientFill(ca, cb, direction, ncols)<P>
becomes, for direction == true :<P>
KPixmapEffect::gradient(pix, ca, cb, KPixmapEffect::VerticalGradient, ncols)<P>
There are now:<P>
<TABLE><TR><TD align=top>
KPixmapEffect::<BR></TD>
<TD> [Vertical,<BR>
Horizontal,<BR>
Diagonal,<BR>
CrossDiagonal,<BR>
Rectangle,<BR>
Pyramid,<BR>
PipeCross,<BR>
Elliptic]</TD></TR></TABLE>
Gradients. See kdelibs/kdetest/kgradienttest &amp; kunbalancedgradienttest for
information on how they actually look.<P>
Look further in this document for other info about pixmap effect code
reorganization (essentially, all effects are now in libkdeui.so: gradient(),
unbalancedGradient(), hash(), desaturate(), pattern(), fade(), blend() etc.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KTabListBox">KTabListBox</A></H3>
This widget has been replaced by the almighty KListView. Everything said
about KTreeList could be repeated here. The good thing is, that you now
can combine TreeView's and normal Tablists without problems.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KToolBarButton">KToolBarButton &amp; KRadioGroup</A></H3>
If you need to do anything with KToolBarButton you now need to include
&lt;ktoolbarbutton.h&gt; KRadioGroup has been renamed to KToolBarRadioGroup and
requires you to include &lt;ktoolbarradiogroup.h&gt;<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KAccel">KAccel</A></H3>
The functions keyToString() and stringToKey() which were previously
declared globally in kaccel.h are now static methods in KAccel.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kstring">kstring.h / KString</A></H3>
The KString class is obsolete and is not defined in
kstring.h anymore. The header file only existed for compatibility reasons.
The file has been removed completely, use QString instead. (<A HREF="mailto:mirko@kde.org">mirko@kde.org</A>)<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="ktopwidget">ktopwidget.h / KTopWidget</A></H3>
KMainWindow replaces this class completely. ktopwidget.h does not
exist in KDE 2. (<A HREF="mailto:mirko@kde.org">mirko@kde.org</A>)<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kbutton">kbutton.h / KButton</A></H3>
Since Qt 2.0, the class QToolButton provides the functionality of
buttons that raise when the mouse is moved over them, so there is no
reason to have a class providing the same feature in KDE libs. All
occurrences of KButton in the KDE CVS have been replaced by QToolButtons,
but for applications not in the CVS it has to be done by the respective
developer. (<A HREF="mailto:mirko@kde.org">mirko@kde.org</A>)<P>
<H3><A NAME="kbuttonbox">kbuttonbox.h / KButtonBox</A></H3>
KButtonBox::Orientation has been removed in favor of Qt::Orientation.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kcolorgroup">kcolorgroup.h / KColorGroup</A></H3>
KColorGroup was not used in sources in the KDE CVS, and its
functionality is provided by Qt. It has been removed. (<A HREF="mailto:mirko@kde.org">mirko@kde.org</A>)<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kled">kled.h, kledlamp.h / KLed, KLedLamp</A></H3>
There where two different classes for showing an LED lamp. Both are
merged to the KLed class, but THE USER INTERFACE IS DIFFERENT, as both
where more or less broken.<P>
Please adjust your code accordingly.<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KDockWidget">KDockWidget</A></H3>
KDockWidget inherits form KMainWindow instead of KTMainWindow now.
See <A HREF="KTMainWindow">KTMainWindow</A> for more details.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KPixmap">KPixmap, KPixmapEffect</A></H3>
KPixmap::gradientFill, KPixmap::patternFill, KPixmap::tile and
KPixmap::mapFill have been moved to KPixmapEffect, which is now part
of libkdeui.<P>
KPixmap::tile() has been renamed to KPixmapEffects::createTile().<P>
Dirk A. Mueller &lt;<A HREF="mailto:mueller@kde.org">mueller@kde.org</A>&gt;<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KControlCenter">KDE Control Center</A></H3>
The format for modules for the KDE Control Center has changed quite
a bit. If you want to port your module to the new schema, please
consult<P>
kdebase/kcontrol/README<P>
which explains what needs to be done.<P>
Matthias Hoelzer-Kluepfel &lt;<A HREF="mailto:hoelzer@kde.org">hoelzer@kde.org</A>&gt;<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KWMModuleApplication">KWMModuleApplication libkdeui/kwmmapp.h</A></H3>
The KWMModuleApplication has been removed. Instead, use the class
KWinModule in libkdecore. The API is a bit cleaner but very similar,
so you will feel comfortable immediately. One of the advantages of
KWinModule is that it doesn't require a special KApplication
subclass. This lead to many problems and misunderstandings in the
past. KWinModule is now just an object that emits fancy signals (and
provides some useful lists, like the list of all managed windows).
(<A HREF="mailto:ettrich@kde.org">ettrich@kde.org</A>)<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KDebug">kDebug</A></H3>
Use kdDebug, kdWarning, kdError, kdFatal to log debug output, warnings and
errors in a very flexible way. kdebug has been improved, and the API simplified.
kdesdk/scripts/kDebug2kdDebug.sh provides a script for automating the conversion.
Note that enabling/disabling debug output can now be done with kdebugdialog,
which can be found in kdebase. The hidden dialog on C+S+F12 no longer exists.
<P>
Also, note that qDebug and fprintf aren't disabled by -DNDEBUG, whereas kdDebug is.
One more reason to use kdDebug !
(<A HREF="mailto:faure@kde.org">faure@kde.org</A>)<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KFileDialog">KFileDialog - General Stuff</A></H3>
The new (rewritten) KFileDialog (KFD) is a lot more like the new QFileDialog
but still looks quite different. Normally you may want to use the static
methods provided for convenience (getOpenFileName and getSaveFileName).
If you need special features you can configure the dialog extensively. Just
create an object and use the different methods. <P>
Werner Trobin &lt;<A HREF="mailto:wtrobin@carinthia.com">wtrobin@carinthia.com</A>&gt;<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KFileDialogPreview">KFileDialog - Preview Mode</A></H3>
There is also a new preview mode which is quite different to the one we had in
the KDE 1.x KFD. There are no preview modules you have to register but there
is a single method you can use to set a preview widget. This widget has to
inherit QWidget and you have to implement a slot (showPreview(const KURL &amp;))
in this class. This slot is called each time the selected file/dir changes.
In this slot you have to react appropriate (i.e. show the preview :). The
easiest way this can be done is to derive your class from QWidgetStack and
add a Object (derived from QWidget) for each file type. In the showPreview
method you just raise the matching widget. If you can't find an appropriate
widget just hide() the widget stack.<P>
If you need some "inspiration" on how that could be done, please have a look
at koffice/lib/kofficecore/koFilterManager.cc (PreviewStack).<P>
Werner Trobin &lt;<A HREF="mailto:wtrobin@carinthia.com">wtrobin@carinthia.com</A>&gt;<P>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="ImageEffects">Image effects</A></H3>
The kFSDither class is now gone. Its functionality was moved to
KImageEffect::dither(). Whereas before, you would done:<P>
<TABLE>
<TR>
<TD>
<PRE>
kFSDither dither(palette, ncols);
image = dither.dither(image);
</PRE>
</TD>
</TR>
</TABLE>
<P>
Now do:<BR>
<TABLE>
<TR>
<TD>
<PRE>
KImageEffect::dither(image, palette, ncols);
</PRE>
</TD>
</TR>
</TABLE>
<P>
Kurt Granroth &lt;<A HREF="mailto:granroth@kde.org">granroth@kde.org</A>&gt;
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KAudio">KAudio (kaudio.h)</A></H3>
The KAudio class no longer exists. Here are your options for porting.
<p>
<ul>
<li>notifications like "you have got new mail"
<p>
The way to go for this one is to use the KNotify API, which will allow
users to reconfigure how your application should sound. On the other hand,
they will also be able to disable specific sounds, rather let the events
log to a file, and so on. You can provide an rc file with the default
configuration. (Include "knotifyclient.h" and use the KNotifyClient class).
<p>
<li>very simple cases
<p>
On the other hand, if you just want a really small solution, there is the
KAudioPlayer class (declared kaudioplayer.h), which has a static member
function for playing, like
<p>
<pre>
KAudioPlayer::play("/var/samples/foo.wav");
</pre>
<p>
<li>multimedia apps
<p>
If you are writing "real multimedia apps", you may also have a look at the
even more advanced sound/multimedia support, that using the aRts/MCOP
libraries directly can offer you.
</ul>
Stefan Westerfeld <A HREF="mailto:stefan@space.twc.de">stefan@space.twc.de</A>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="KImageIO">KImageIO (kimgio.h)</A></H3>
<p>
KImageIO has moved from 'kimgio.h' to 'kimageio.h'. LIB_KIMGIO does no longer
exists, you need to link against LIB_KSYCOCA instead.
</p>
<p>
kimgioRegister() has been replaced by KImageIO::registerFormats().
</p>
<p>
Waldo Bastian <A HREF="mailto:bastian@kde.org">bastian@kde.org</A>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
</BODY>
</HTML>

@ -0,0 +1,672 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML Level 2//EN//2.0">
<HTML>
<HEAD>
<TITLE>Guide to Porting Applications to KDE 3.0</TITLE>
</HEAD>
<BODY>
<H2>Porting Applications to KDE 3.0</H2>
This document contains the changes you have to apply to programs written for
KDE 2.x when you want to port them to KDE 3.0.<P>
As a start you should have a look at doc/porting.doc in the Qt package,
or <a href="http://doc.trolltech.com/3.0/porting.html">this page online</a>.<P>
<H3><A NAME="TOC">Table of Contents</A></H3>
<UL>
<LI><A HREF="#gettingstarted">Getting Started</A></LI>
<LI><A HREF="#kab">Changes in kab</A></LI>
<LI><A HREF="#kdecore">Changes in kdecore</A></LI>
<LI><A HREF="#kdeui">Changes in kdeui</A></LI>
<LI><A HREF="#kio">Changes in kio</A></LI>
<LI><A HREF="#kparts">Changes in kparts</A></LI>
<LI><A HREF="#kspell">Changes in kspell</A></LI>
<LI><A HREF="#khtmlpart">API-cleanup in KHTML</A></LI>
<LI><A HREF="#kfile">Changes in kfile</A></LI>
<LI><A HREF="#kcontrol">KDE Control Center</A></LI>
<LI><A HREF="#kicker">Panel Applets and Extensions</A></LI>
</UL>
<H3><A NAME="gettingstarted">Getting started</A></H3>
The first step to get your KDE application to compile under KDE 3.0,
is to detect KDE 3.0 and Qt 3.x at configure time. The easiest way to
get a working autoconf/automake framework, is to either use
<a href="http://www.kdevelop.org">KDevelop</a> or
<a href="http://home.earthlink.net/~granroth/kapptemplate/index.html">kapptemplate</a>
(available in CVS under the module "kdesdk"), to generate a new
application template. Replace the generated source files by yours
and adapt Makefile.am accordingly.
<p>
Please note that we tried to be mostly source-compatible where it
was possible. To accomplish that, we added commonly used but still
deprecated / removed API parts in a #ifndef KDE_NO_COMPAT-block.
That means you can "test" and adjust your application by #defining
KDE_NO_COMPAT for compiling and see where it breaks. This is
recommended, as those backward compatibility "hacks" are not kept for
long.
</p>
<p>
<b>WARNING:</b>In some cases the names or signatures of signals or slots
have changed. Check your source carefully for this since these changes will
not be discovered by your compiler but will result in incorrect runtime
behavior if left uncorrected in your application.
</p>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kab">Changes in kab</A></H3>
<H4>AddressBook</H4>
The <i>getStandardFilename()</i> method has been renamed to <i>getStandardFileName()</i>.
The old name will still work unless KDE_NO_COMPAT is defined.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kdecore">Changes in kdecore</A></H3>
<H4>KDesktopWidget</H4>
KDesktopWidget is obsolete. Include &lt;qdesktopwidget.h&gt; and use QDesktopWidget
instead, everything else is source compatible.
<H4>Header file names</H4>
<UL>
<LI>kapp.h is now kapplication.h</LI>
<LI>kuniqueapp.h is now kuniqueapplication.h</LI>
<LI>kstddirs.h is now kstandarddirs.h</LI>
<LI>kcolorbtn.h is now kcolorbutton.h</LI>
<LI>kxmlgui.h is now kxmlguifactory.h</LI>
<LI>kdatepik.h is now kdatepicker.h</LI>
<LI>kdualcolorbtn.h is now kdualcolorbutton.h</LI>
</UL>
This is to help finding out header files from class names and the other
way round. Compatibility headers have been created. You can use them as
long as you don't compile with KDE_NO_COMPAT.
<H4>DCOP</H4>
The file with the DCOP connection information has been renamed. The new
name is $HOME/.DCOPserver_<hostname>_<display>. The screen part has been
stripped from <display> and the ':' character that separates host and
display-number has been replaced with a '_'. If you access DCOP via
DCOPClient you do not need to change anything.
<p>
It is no longer possible to make calls to an application registered as
"<appid>-<pid>" with "<appid>" only. The full name can be obtained by using
either KApplication::startServiceBy...() or DCOPClient::findObject() or
their command line equivalents "dcopstart" and "dcopfind".
<H4>KLibFactory</H4>
KLibFactory's create method is no more virtual and the createObject method
is now pure virtual. The former was marked as deprecated since KDE 2.0.
All it takes in your component is to rename your existing create implementation
to createObject and remove the 'emit objectCreated( yourObject );' line.
<H4>KDesktopFile</H4>
The <i>filename()</i> method has been renamed to <i>fileName()</i>.
The old name will still work unless KDE_NO_COMPAT is defined.
<H4>KPixmapSplitter</H4>
KPixmapSplitter has now been moved to the new kdefx library.
<H4>KStringHandler</H4>
The <i>matchFilename( const QString& filename, const QString& pattern )</i> method has been
renamed to <br><i>matchFileName( const QString& filename, const QString& pattern )</i>.
The old name will still work unless KDE_NO_COMPAT is defined.
<H4>KStyle</H4>
Due to the major changes in the QStyle API in Qt3, KStyle has been completely
re-written. KStyle is now a thin wrapper around QCommonStyle with a few extra
primitive elements and a simple popupMenu transparency engine. All KStyles can
now style Qt apps like designer and assistant automatically. KStyle is no longer
present in kdecore. It is now in a new library called kdefx to allow Qt apps to
use KDE's styles without having the styles linked to kdecore/kdeui.
<H4>KURL</H4>
The <i>filename( bool _ignore_trailing_slash_in_path = true )</i> method has been
renamed to <br><i>fileName( bool _ignore_trailing_slash_in_path = true )</i>.
The old name will still work unless KDE_NO_COMPAT is defined.
<H4>KMD5</H4>
HASHHEX and HASH has been removed to make this class namespace clean.
They have been replaced by QCString and KMD5::Digest. <br>
The API has been cleaned up, it is no longer necessary to call finalize().
Simply remove any calls to it.
<H4>KLocale</H4>
<li>charset() has been removed. You might want to use encoding() instead.
<li>setCharset(const QString &amp;) has been removed. You might want to use
setEncoding(int) instead.
<li>formatMoney(const QString &amp;) has been removed.
<li>formatNumber(const QString &amp;) has been removed.
<li>languages() has been removed. Use languageList() instead.
<li>All references to monthName(), monthNamePossessive(), and weekDayName()
should be replaced with methods from KLocale::calendar().
<li>Hard coded date handling or date handling with QDate should in most
cases be replaced by methods in KLocale::calendar().
<H4>Accelerators Keys</H4>
<h5>KAccel</h5>
The following methods of been deprecated, and if KDE_NO_COMPAT is defined they will
not be available.
<ul>
<li> KAccel::insertItem() and KAccel::connectItem().
<pre>
- kaccel-&gt;insertItem( i18n("Scroll Up"), "Scroll Up", "Up" );
- kaccel-&gt;connectItem( "Scroll Up", this, SLOT(scrollUp()) );
+ kaccel-&gt;insert( "Scroll Up", i18n("Scroll Up"), QString::null,
Key_Up, this, SLOT(scrollUp()) );
</pre>
Note that a What's This parameter is now a part of the insert function.
You might replace the QString::null parameter with
<pre> i18n("Scroll the current document's contents up by one line.") </pre>
for example.</li>
<li> KAccel::changeMenuAccel() has been deprecated because it was
never used in cvs. If you've used it in your application, the following
can replace it. Note, however, that this would be handled automatically
by using KAction instead.
<pre>
- kaccel-&gt;changeMenuAccel( menu, id, "file_open" );
+ menu-&gt;setAccel( kaccel-&gt;shortcut( "file_open" ).keyCodeQt(), id );
</pre>
</li>
</ul>
The preferred means of defining a shortcut, however, is to use <b>KAction</b>.
<pre>
new KAction( i18n("Scroll Up"), Key_Up,
this, SLOT(scrollUp()), actionCollection(), "Scroll Up" );
</pre>
<h5>KGlobalAccel</h5>
<ul>
<li>Call <i>updateConnections()</i> after all <i>insert()</i> or
<i>insertItem()</i> (deprecated) calls have been made. This function then performs the
actually key grabbing. In order to improve program startup speed,
grabbing is no longer done automatically: usually <i>readSettings()</i>
is called after the actions have been defined, and this may cause
shortcut reassignments, which in turn used to make an expensive ungrab
of the old key and second grab of the new key necessary.</li>
</ul>
<h5>KStdAccel</h5>
<ul>
<li><i>StdAccel::WhatThis</i> has been renamed to <i>StdAccel::WhatsThis</i>.
<li><i>StdAccel::Insert</i> and the corresponding <i>insert()</i>
have been removed. (Nobody on the list knew what its function was
supposed to be.) Calls to <i>insert()</i> and the equivalent
<i>key(KStdAccel::Insert)</i> can be replaced with the former default
of <i>Qt::CTRL+Qt::Key_Insert</i>.</li>
<li>The following functions have been deprecated and will need to be changed if KDE_NO_COMPAT is defined:
<table border=1>
<tr><th>Old</th><th>New</th></tr>
<tr><td>QString action(StdAccel id)</td><td>QString name(StdAccel id)</td></tr>
<tr><td>int defaultKey(StdAccel accel)</td><td>KShortcut shortcutDefault(StdAccel id)</td></tr>
<tr><td>QString description(StdAccel id)</td><td>QString label(StdAccel id)</td></tr>
<tr><td>bool isEqual(const QKeyEvent* pEvent, int keyQt)</td>
<td>The best method for replacing this varies. One possibility is to use
<i>KKey(const QKeyEvent*) == KKey(int)</i>. Another is to use
<i>KShortcut::contains( const KKey&/KKeySequence& )</i>.</td></tr>
<tr><td>int key(StdAccel)</td><td>const KShortcut& shortcut(StdAccel)</td></tr>
</table></li-->
</ul>
<H4>KIconLoader, KIconTheme</H4>
Methods now use KIcon::Group and KIcon::Context instead of int as types for group and context arguments.
The change should affect only code using hardcoded numeric values instead of using the proper enum constants.
This applies to classes KIconLoader, KIconTheme and (in kio and kfile) KMimeType, KService, KIconDialog, KIconButton,
KURLBar and KURLBarItem.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kdeui">Changes in kdeui</A></H3>
<H4>KAccelMenu</H4>
This class has been removed, Qt offers the same functionality.
Use QPopupMenu/KPopupMenu or the XML-UI method for building menus.
<H4>KAction</H4>
<ul>
<li>The following methods have been deprecated and will need to be
replaced if KDE_NO_COMPAT is defined.
<table border=1>
<tr><th>Old</th><th>New</th></tr>
<tr><td>int accel()</td><td>const KShortcut&amp; shortcut()</td></tr>
<tr><td>int menuId()</td><td>int itemId()</td></tr>
<tr><td>void setAccel(int)</td><td>void setShortcut(const KShortcut&amp;)</td></tr>
</table></li>
</ul>
<h4>KActionCollection</h4>
<ul>
<li>When constructing a KActionCollection object, a pointer to the focus widget should be passed.</li>
<li>The insert(), remove(), and take() methods have been deprecated.
If you wish to keep a list of actions, use the KActionPtrList container instead.
If you want to configure the shortcuts from multiple actions collections,
pass each collection to KKeyChooser or KKeyDialog via their insert() methods.</li>
</ul>
<H4>KAlphaPainter</H4>
KAlphaPainter has been dropped, since Qt 3 has native support for
hardware accelerated alpha blending.
<H4>KAnimWidget</H4>
This class no longer supports reading a list of images, instead it uses a
single image-file that has been prepared with the kimage_concat tool.
See kdelibs/pics/hicolor/kde for an example of its use.
<H4>KContainerLayout</H4>
This class has been removed, use Qt layouts instead.
<H4>KCommand</H4>
This class has been made lighter: the name isn't stored into the command anymore,
but must be provided by the inherited class, as the result of the virtual name() function.
This saves storing a QString into each command in memory.
The former behavior is available in the class KNamedCommand, so for a quick port
simply replace KCommand with KNamedCommand.
<H4>KDialogBase</H4>
The deprecated getMainWidget() method has been removed. Use mainWidget() instead.
<H4>KDirectionButton</H4>
...is gone. Use KArrowButton instead, it offers about the same
functionality.
<H4>KDockWidget</H4>
The WidgetList parameter has been renamed to QWidgetList. Behaviour
is identical.
<H4>KEdit</H4>
KEdit is now deprecated. You should use use KTextEditor::Editor or
KTextEdit instead.
<H4>KImageEffect</H4>
KImageEffect has now been moved to the new kdefx library.
<H4>KMessageBox</H4>
KMessageBox now does automatic line-breaking. When using plain-text, you should
remove any mid-sentence linebreaks. Only use line-breaks to indicate the end of
a paragraph.
<H4>KPanelApplet</H4>
A new protected member method 'void reportBug()' was added. It gets called by
Kicker if the 'Report Bug' entry in the context menu gets selected and should
be overridden by applets which support the KPanelApplet::ReportBug action. This
means that you don't have to extend KPanelApplet's generic action dispatcher
void KPanelApplet::action() anymore.
<H4>KPanelMenu</H4>
The old KPanelMenu class has been renamed to KPanelAppMenu. The KPanelMenu
class now corresponds to a new Kicker menu extension that is handled
by the panel in a way similar to other applets (shared library loaded
at run-time). See KDE 3.0 documentation
for more informations on this new extension.
<H4>KPixmapEffect</H4>
PixmapEffect has now been moved to the new kdefx library.
<H4>KProgress</H4>
KProgress is now based on QProgressBar.
This has led to a few API changes. In particular the constructors have been
simplified, you simply need to pass the total number of steps instead of
min / max / initialvalue / orientation. See documentation of both KProgress
and QProgressBar.
<H4>KRootPixmap</H4>
The KRootPixmap class has been extended to make it more flexible, and the
<i>checkAvailable(bool ignored)</i> method has been renamed to <i>isAvailable()</i>.
The old name will still work unless KDE_NO_COMPAT is defined.
<H4>KThemeBase, KThemeStyle</H4>
KThemeBase and KThemeStyle have been ported over to the new QStyle/KStyle API
present in Qt3/KDE3. KThemeBase is no longer in kdeui, but in kstyles/kthemestyle
as its use is basically limited to KThemeStyle.
<H4>KAction, KToolBar, KToolBarButton and icons</H4>
The preferred way for specifying icons is passing the icon names (and the icons will be loaded by KIconLoader),
instead of using QIconSet or QPixmap. This results in always using the correct icon size and allows delayed
on-demand icon loading.
<p>
Method KAction::hasIconSet() has been renamed to KAction::hasIcon(), the old name will still work unless KDE_NO_COMPAT is defined.
KAction::iconSet() now has an argument specifying icon group, the old KAction::iconSet() is still available unless KDE_NO_COMPAT
is defined and returns KIcon::Small iconset, just like in KDE2.
<p>
KToolBarButton methods setPixmap(), setDefaultPixmap(), setDisabledPixmap(), setDefaultIcon() and setDisabledIcon() are deprecated.
Use KToolBarButton::setIcon() (preferred) or KToolBarButton::setIconSet() instead.
<H4>KAction and derived classes</H4>
The protected set* methods have been renamed to update* and they now take only one argument (i.e. setText(int, const QString&)
is now updateText(int) ). Because the former second argument was always the value of the a corresponding data member, you
can simply call the accessor method (i.e. in updateText() call text() to get the text).
<H4>KToggleAction</H4>
exclusiveGroup() is no more virtual. setExclusiveGroup(const
QString&) is not a slot anymore.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kio">Changes in kio</A></H3>
<H4>KPropertiesDialog</H4>
<ul>
<li>The header file has been renamed from kpropsdlg.h to kpropertiesdialog.h.</li>
<li>KPropertiesDialog::KPropertiesDialog(const KURL&, mode_t, QWidget*,
const char*, bool, bool ) has been removed since mode_t was no longer
used. Simply omit the mode_t parameter.</li>
</ul>
<H4>KTarGz/KTarBase/KTarData</H4>
<ul>
<li>The KTarBase and KTarData classes have been removed.</li>
<li>KTarGz is now KTar (#define for source compatibility)</li>
<li>A base class KArchive has been written, to support other archive formats in the future</li>
<li>KTarEntry is now KArchiveEntry, KTarDirectory is now KArchiveDirectory, and KTarFile is now KArchiveFile.</li>
<li>The classes ProgressBase, StatusbarProgress and DefaultProgress have been moved to the KIO namespace.</li>
<li>The signal KDirLister::started(const QString &amp;url) has changed to KDirLister::started(const KURL &amp;url).<li>
<li>KServiceTypeProfile::preferredService( const QString &amp; serviceType, bool needApp ) has been removed, use
KServiceTypeProfile::preferredService( ..., "Application") if needApp was true, or
KServiceTypeProfile::preferredService( ..., QString::null) if needApp was false.
<li>The following functions in KProtocolManager have been replaced:
<ul>
<li>ftpProxy(), use proxyFor("ftp") instead.
<li>httpProxy(), use proxyFor("http") instead.
<li>slaveProtocol(const QString&amp;), use slaveProtocol(const KURL &amp;url, QString &amp;proxy) instead.
<li>defaultReadTimeout(), use DEFAULT_READ_TIMEOUT instead. (See ioslave_defaults.h)
<li>defaultProxyConnectTimeout(), use DEFAULT_PROXY_CONNECT_TIMEOUT instead. (See ioslave_defaults.h)
<li>defaultResponseTimeout(), use DEFAULT_RESPONSE_TIMEOUT instead. (See ioslave_defaults.h)
<li>minimumTimeoutThreshold(), use MIN_TIMEOUT_VALUE instead. (See ioslave_defaults.h)
</ul>
<li>The following functions in KProtocolManager have been removed:
<ul>
<li>setUserAgentList( const QStringList&amp; )
<li>userAgentList();
<li>setReadTimeout()
<li>setConnectTimeout( int )
<li>setProxyConnectTimeout( int )
<li>setResponseTimeout( int )
<li>setMarkPartial( bool )
<li>setMinimumKeepSize( int )
<li>setAutoResume( bool )
<li>setPersistentConnections( bool )
<li>setMaxCacheAge( int )
<li>setUseCache( bool )
<li>setMaxCacheSize( int )
<li>setCacheControl( KIO::CacheControl )
<li>setUseProxy( bool )
<li>setUseReverseProxy( bool )
<li>setProxyType( ProxyType )
<li>setProxyAuthMode( ProxyAuthMode )
<li>setFtpProxy( const QString&amp; )
<li>setHttpProxy( const QString&amp; )
<li>setProxyFor( const QString&amp;, const QString&amp; )
<li>setNoProxyFor( const QString&amp; )
<li>setProxyConfigScript( const QString&amp; )
</ul>
</li>
<li>In order to support files &gt; 4Gb, the file size / file-offset argument
in the signals totalSize, processedSize and canResume, which are used
by the io-slaves and passed along to jobs, has been changed from
<b>unsigned long</b> to <b>KIO::filesize_t</b>.
Make sure to check if you use these signals since your compiler
will typically not generate a compile-time error for these changes,
instead you might get a run-time error when you try to connect to
one of these signals using the old signature.
</li>
</ul>
<H4>KOpenWithHandler / KFileOpenWithHandler</H4>
Those two classes are deprecated, no need to create a KFileOpenWithHandler anymore.
The merging of libkio, libksycoca, libkfile and libkssl into a single libkio has
allowed to fix this dependency problem: KRun can now use the OpenWith dialog directly.
<H4>KMimeType, KService</H4>
Methods now use KIcon::Group and KIcon::Context instead of int as types for group and context arguments.
The change should affect only code using hardcoded numeric values instead of using the proper enum constants.
<H4>KFilterDev</H4>
The createFilterDevice method is deprecated. Use deviceForFile instead.
<H4>KDirWatch</H4>
<ul>
<li>The signal fileDirty( const QString&amp; ) has been removed</li>
<li>The signal created( const QString&amp; ) has been added</li>
<li>The signal deleted( const QString&amp; ) has been added</li>
<li>The signal dirty( const QString&amp; ) may be emitted with a file name, not only
a directory name. This depends on which backend is used but will probably always be
the case in KDE 3.1. You should prepare to receive dirty( dirname ) or dirty( filename )
when a file has changed.
</li>
</ul>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kparts">Changes in kparts</A></H3>
<H4>KParts::Factory</H4>
The createPart method is no more virtual and the createPartObject method
is now pure virtual. The former was marked as deprecated since KDE 2.0.
All it takes in your component is to rename your existing createPart implementation
to createPartObject and remove the 'emit objectCreated( yourObject );' line.
<H4>KParts::Part</H4>
The <code>bool isSelectable() const</code> is no more virtual. So when you want to
change the behavior of the selectable property you don't need to re-implement
both virtual functions, setSelectable and isSelectable, but instead just
re-implementing setSelectable does the job. The very same applies for
the <code>KURL url() const</code> and ReadWritePart's <code>bool isReadWrite const</code>
and <code>bool isModified() const</code> methods.
<p>
The <code>void showProgressInfo(bool)</code>
method has been renamed to <code>bool setProgressInfoEnabled(bool)</code>. The old name will
still work unless KDE_NO_COMPAT is defined.
<H4>KParts::BrowserExtension</H4>
The <code>URLArgs urlArgs()</code> method is no more virtual. So when you want to
change the behavior of the urlArgs property you don't need to re-implement
both virtual functions, setURLArgs and urlArgs, but instead just re-implementing
setURLArgs does the job.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kspell">Changes in kspell</A></H3>
<H4>KSpell</H4>
The API has been cleaned up to be in line with the rest of kdelibs, in particular:
<ul>
<li>suggestions() now returns a QStringList instead of a pointer to a QStringList
<li>intermediateBuffer() now returns a QString instead of a pointer to a QString
<li>The signal <b>misspelling(QString, QStringList *, unsigned)</b> has changed to
misspelling(const QString &amp;, const QStringList &amp;, unsigned int)
<li>The signal <b>corrected(QString, QString, unsigned)</b> has changed to
corrected(const QString &amp;, const QString &amp;, unsigned int)
<li>The signal <b>ignoreall(QString)</b> has changed to
ignoreall(const QString &amp;)
<li>The signal <b>ignoreword(QString)</b> has changed to
ignoreword(const QString &amp;)
<li>The signal <b>addword(QString)</b> has changed to
addword(const QString &amp;)
</ul>
Make sure to check if you use the above signals since your compiler
will typically not generate a compile-time error for these changes,
instead you might get a run-time error when you try to connect to
one of these signals using the old signature.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="khtmlpart">API-cleanups in KHTML</A></H3>
There were a few relatively minor API-adjustements in KHTMLPart. In particular:
<ul><li>enableJScript(bool) has been replaced by setJScriptEnabled(bool)
<li>enableJava(bool) has been replaced by setJavaEnabled(bool)
<li>enablePlugins(bool) has been replaced by setPluginsEnabled(bool)
<li>autoloadImages(bool) has been replaced by setAutoloadImages(bool)
<li>enableMetaRefresh(bool) has been replaced by setMetaRefreshEnabled(bool)
<li>setBaseURL and setBaseTarget have been removed. baseURL(), baseTarget() and
completeURL() are remained for compatibility reasons, but they're deprecated now. use the variants in DOM::HTMLDocument() instead.
<li>the second parameter of KHTMLPart::completeURL is removed. it didn't have
any effect before either.
</ul>
Besides that, all methods previously marked as deprecated or were internal
but accidentally part of the public API are now private or removed.
As they were marked as becoming private already you should not experience
any problems. Backward compatibility exists for the common methods, to
disable this use a #define KDE_NO_COMPAT.
<p>In KHTMLView, the following changes were done:
<ul>
<li>gotoNextLink has been replaced by gotoLink(true);
<li>gotoPrevLink has been replaced by gotoLink(false);
</ul>
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<H3><A NAME="kfile">Changes in kfile</A></H3>
The kfile-library, as used by the KFileDialog provides classes for directory browsing widgets.
Those classes gained some new features, some parts were merged with other existing classes
and in some cases the API was cleaned up/fixed. The library is now built as part of libkio
library (there's no need to modify Makefiles which use $LIB_KFILE instead of hardcoding -lkfile).
<p>
Even if the list of changes is long, the affected code base should be relatively small, as most
parts are rarely used outside of kfile.
<p>
The changes are:
<H4>KFileItem</H4>
The KFileViewItem class is completely replaced with KFileItem from kio. All its functionality has
been merged with its former base class KFileItem. Additionally, some of its methods have been
modified:
<table>
<tr><th>Old:</th><th>New:</th></tr>
<tr><td>access()</td><td>permissionsString()</td></tr>
<tr><td>date()</td><td>timeString()</td></tr>
<tr><td>setViewItem( const KFileView *view, const void *item )</td><td>setExtraData( const void *key, void *value )</td></tr>
<tr><td>pixmap()</td><td>The parameterless method has been removed, use pixmap( int size, int state = 0 ) instead.</td></tr>
</table>
<H4>KFileReader</H4>
This class has been merged with KDirLister from kio.
<H4>KDirOperator</H4>
<table>
<tr><th>Old:</th><th>New:</th></tr>
<tr><td>saveConfig()</td><td>writeConfig()</td></tr>
<tr><td>setFileReader()</td><td>setDirLister()</td></tr>
<tr><td>fileReader()</td><td>dirLister()</td></tr>
<tr><td>activatedMenu( const KFileViewItem * )</td><td>activatedMenu( const KFileItem *, const QPoint& pos )</td></tr>
</table>
<H4>KFileDetailView</H4>
The protected method setSortIndicator() has been removed, it's not needed anymore.
<H4>KFileView</H4>
This is the baseclass for all the views. It changed in many respects to allow for greater
flexibility and efficiency.
<br><br>
Sorting has changed radically. Previously, KFileView had protected methods QuickSort,
compareItems() and mergeLists() to sort directory entries for displaying in the views. Now,
KFileView does not do any sorting anymore. Instead, the view's (i.e. KIconView, KListView)
sorting is utilized by letting its view-items provide a QString key() method. Therefore,
KFileView offers the two methods
<ul>
<li>QString sortingKey( const QString&amp; value, bool isDir, int sortSpec )</li>
<li>QString sortingKey( KIO::filesize_t value, bool isDir, int sortSpec )</li>
</ul>
which the view-classes can use to generate the string for the key() method. The KFile::SortMode
enum has been removed, as QDir::SortSpec is used entirely.
<br><br>
Further changes:
<table>
<tr><th>Old:</th><th>New:</th></tr>
<tr><td>not existant</td><td>virtual void readConfig( KConfig *, const QString&amp; group = QString::null )</td></tr>
<tr><td>not existant</td><td>void writeConfig( KConfig *, const QString&amp; group = QString::null)</td></tr>
<tr><td>virtual void setCurrentItem( const QString&amp; filename, KFileViewItem * )</td><td>Replaced with the two methods below.</td></tr>
<tr><td>&nbsp;</td><td>void setCurrentItem( const QString&amp; filename );</td></tr>
<tr><td>&nbsp;</td><td>virtual void setCurrentItem( const KFileViewItem * ) = 0;</td></tr>
<tr><td>setOperator( QObject * )</td><td>setParentView( KFileView * )</td></tr>
<tr><td>virtual void insertSorted( KFileViewItem *, uint count )</td><td>virtual void insertItem( KFileItem * )</td></tr>
<tr><td>virtual void addItemList( const KFileViewItemList &amp;list )</td><td>not virtual anymore. Sufficient to reimplement insertItem()</td></tr>
</table>
<br><br>
Three more pure virtual methods have been added:
<ul>
<li>virtual KFileItem * firstFileItem() const = 0</li>
<li>virtual KFileItem * nextItem( const KFileItem * ) const = 0</li>
<li>virtual KFileItem * prevItem( const KFileItem * ) const = 0</li>
</ul>
<p>
State-changes are now signaled solely via the KFileViewSignaler object, that every KFileView
has a protected member of ("sig"). The methods activateMenu(), highlight() and select() have
been removed. If you implemented a KFileView, change your code in the following way:
<table>
<tr><th>Old:</th><th>New:</th></tr>
<tr><td>activateMenu( item )</td><td>sig->activateMenu( item, pos )</td></tr>
<tr><td>highlight( item )</td><td>sig->highlightFile( item )</td></tr>
<tr><td>select( item )</td><td>sig->select( item )</td></tr>
</table>
<H4>KFileViewSignaler</H4>
The methods activateDir( const KFileViewItem * ) and activateFile( const KFileViewItem * )
have been merged into the new method activate( const KFileItem * ).
<br><br>
Carsten Pfeiffer <A HREF="mailto:pfeiffer@kde.org">pfeiffer@kde.org</A>
<H4>KIconDialog, KIconButton, KURLBar, KURLBarItem</H4>
Methods now use KIcon::Group and KIcon::Context instead of int as types for group and context arguments.
The change should affect only code using hardcoded numeric values instead of using the proper enum constants.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<p>
<H3><A NAME="kcontrol">Changes in KControl</A></H3>
<H4>Modules that require root permission</H4>
The meaning of the <i>X-KDE-RootOnly</i> flag in the .desktop files has changed.
In KControl 2.0 a message was shown if the user did not press the &quot;modify&quot;
button. With the additional flag <i>X-KDE-HasReadOnlyMode</i> it was possible to show
a disabled version of the module instead of the message. The behavior was inconsistent
and has been changed:
<ul>
<li><i>X-KDE-HasReadOnlyMode</i> is not used anymore and is ignored by KControl &gt; 2.0.
<li><i>X-KDE-RootOnly</i> does now show a disabled preview of the widget and a notification box.
<li>If you want the old behavior back set <i>X-KDE-IsHiddenByDefault</i> along with
<i>X-KDE-RootOnly</i>. Please note that this behavior is deprecated the sake of
usability.
</ul>
For more details please consult the HOWTO file in the kcontrol directory.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<p>
<H3><A NAME="kicker">Panel Applets and Extensions</A></H3>
<p>The API for Kicker panel applets and extensions has changed. Panels can now be
left/top, center, or right/bottom aligned, and applets and extensions may receive
notification about a change in alignment.
<H4>KPanelApplet</H4>
<p>The virtual methods orientationChange() and popupDirectionChange() are deprecated.
Instead you should reimplement positionChange() and alignmentChange() to be
notified of changes in the position and alignment of the panel on which your applet
resides. In addition, the popupDirection() method and the Direction enum are
deprecated. Instead you should use the position() method and Position enum. Applets that use
the deprecated methods will still work with KDE 3, but may not compile or work with
a future version.
<H4>KPanelExtension</H4>
<p>There is a new method alignmentChange() that your extension should reimplement if
it needs to know about changes in alignment.
<H4><P ALIGN="RIGHT"><A HREF="#TOC">Return to the Table of Contents</A></P></H4>
<p>
Dirk Mueller <A HREF="mailto:mueller@kde.org">mueller@kde.org</A>
</BODY>
</HTML>

@ -0,0 +1,83 @@
/**
* @mainpage The KDE API Reference
*
* This section contains the KDE online class reference for the current
* development version of KDE. You can also
* download the complete API documentation from
* <a href="http://api.kde.org/">api.kde.org</a>. Additionally, you
* can subscribe or read the mailing lists for any additions and/or
* modifications to the API.
*
* - <a href="kdecore/html/index.html"><b>kdecore</b></a>
* (<a href="kdecore/html/classes.html">classes</a>)\n
* <i>Core KDE classes that are not related to the user interface.</i>
* - <a href="kdeui/html/index.html"><b>kdeui</b></a>
* (<a href="kdeui/html/classes.html">classes</a>)\n
* <i>KDE User interface classes such as widgets.</i>
* - <a href="khtml/html/index.html"><b>khtml</b></a>
* (<a href="khtml/html/classes.html">classes</a>)\n
* <i>The KDE HTML component.</i>
* - <a href="kjs/html/index.html"><b>kjs</b></a>
* (<a href="kjs/html/classes.html">classes</a>)\n
* <i>Javascript (aka. ECMAScript and JScript) support.</i>
* - <a href="kio/html/index.html"><b>kio</b></a>
* (<a href="kio/kio/html/classes.html">classes</a>)\n
* <i>Low level access to network files. Also provides access to facilities
* such as KDirWatcher which monitors directories for changes.</i>
* - <a href="kparts/html/index.html"><b>kparts</b></a>
* (<a href="kparts/html/classes.html">classes</a>)\n
* <i>Support for re-usable, embeddable, extendable applications.</i>
* - <a href="dcop/html/index.html"><b>dcop</b></a>
* (<a href="dcop/html/classes.html">classes</a>)\n
* <i>The DCOP communications library.</i>
* - <a href="kdefx/html/index.html"><b>kdefx</b></a>
* (<a href="kdefx/html/classes.html">classes</a>)\n
* <i>A library with pixmap effects.</i>
* - <a href="kmdi/html/index.html"><b>kmdi</b></a>
* (<a href="kmdi/html/classes.html">classes</a>)\n
* <i>MultiDocument Interface library.</i>
* - <a href="libkmid/html/index.html"><b>libkmid</b></a>
* (<a href="libkmid/html/classes.html">classes</a>)\n
* <i>Midi library.</i>
* - <a href="kdeprint/html/index.html"><b>kdeprint</b></a>
* (<a href="kdeprint/html/classes.html">classes</a>)\n
* <i>High level printer control functionality.</i>
* - <a href="interfaces/html/index.html"><b>interfaces</b></a>
* (<a href="interfaces/html/classes.html">classes</a>)\n
* <i>Defines interfaces for common components so that new implementations
* can be dropped in.</i>
* - <a href="kabc/html/index.html"><b>kabc</b></a>
* (<a href="kabc/html/classes.html">classes</a>)\n
* <i>Access to the KDE address book.</i>
* - <a href="kresources/html/index.html"><b>kresources</b></a>
* (<a href="kresources/html/classes.html">classes</a>)\n
* <i>The KDE resources system.</i>
* - <a href="kutils/html/index.html"><b>kutils</b></a>
* (<a href="kutils/html/classes.html">classes</a>)\n
* <i>High-level utils, like search/replace support.</i>
* - <a href="arts/html/index.html"><b>arts</b></a>
* (<a href="arts/html/classes.html">classes</a>)\n
* <i>KDE bindings for arts including knotify.</i>
* - <a href="knewstuff/html/index.html"><b>knewstuff</b></a>
* (<a href="knewstuff/html/classes.html">classes</a>)\n
* <i>Upload and download of application data.</i>
* - <a href="dnssd/html/index.html"><b>dnssd</b></a>
* (<a href="dnssd/html/classes.html">classes</a>)\n
* <i>Network sevices publishing and discovery.</i>
* - <a href="kunittest/html/index.html"><b>kunittest</b></a>
* (<a href="kunittest/html/classes.html">classes</a>)\n
* <i>Unit testing framework in KDE.</i>
*
* More information about the KDE architecture in form of tutorials, HOWTOs,
* and FAQs can be found at
* the <a href="http://developer.kde.org">KDE Developer's corner</a>.
*/
/**
* @page search Search the API documentation
*
* <br>Under construction.
*
*/

@ -0,0 +1,116 @@
# This file is part of the KDE libraries
# Copyright (C) 1996-1997 Matthias Kalle Dalheimer (kalle@kde.org)
# (C) 1997,1998 Stephan Kulow (coolo@kde.org)
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
# You should have received a copy of the GNU Library General Public License
# along with this library; see the file COPYING.LIB. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
COMPILE_FIRST = dcop libltdl kdefx kdecore kunittest kdeui kdesu kjs kwallet kio
COMPILE_BEFORE_doc = kdoctools
COMPILE_AFTER_kparts = kspell2 kmdi kdeprint kinit kate interfaces kcert khtml
COMPILE_AFTER_kdeprint = kate khtml
COMPILE_BEFORE_khtml = kutils
COMPILE_BEFORE_kabc = kab kresources
COMPILE_BEFORE_kate = interfaces kutils
COMPILE_BEFORE_kmdi = kutils
COMPILE_BEFORE_kspell2 = kutils
COMPILE_BEFORE_kcmshell = kutils
COMPILE_BEFORE_kdewidgets = kabc khtml
COMPILE_BEFORE_interfaces = arts kabc
$(top_srcdir)/acinclude.m4: $(top_srcdir)/libltdl/ltdl.m4
AUTOMAKE_OPTIONS = foreign 1.6.1
potdir = $(kde_includes)
pot_DATA = kde.pot
messages:
cd kabc/scripts && perl ./makeaddressee
find . -type d | grep -v '\.svn' | sed -e 's,$$,/,' > dirs
mfs=`find . -name Makefile.am | xargs egrep -l '^messages:'` ;\
for dir in $$mfs; do \
if test "$$dir" != "./Makefile.am"; then \
dir=`dirname $$dir` ;\
egrep -v "^$$dir" dirs > dirs.new && mv dirs.new dirs ;\
fi ;\
done
fgrep -v "/tests" dirs > dirs.new && mv dirs.new dirs ;\
dirs=`cat dirs` ;\
find $$dirs -maxdepth 1 -name "*.cpp" -print > files ;\
find $$dirs -maxdepth 1 -name "*.cc" -print >> files ;\
find $$dirs -maxdepth 1 -name "*.h" -print >> files ;\
echo ./kdecore/kde-config.cpp.in >> files ;\
$(EXTRACTRC) `find $$dirs -maxdepth 1 \( -name "*.rc" -o -name "*.ui" \) ` ./dnssd/kcm_kdnssd.kcfg > rc.cpp; \
: > kde.pot ;\
$(XGETTEXT) -ktranslate -x qt-messages.pot rc.cpp `cat files` && cat messages.po qt-messages.pot > $(podir)/kdelibs.pot
$(XGETTEXT) common_texts.cpp -o kde.pot
rm -f dirs
EXTRA_DIST = admin kde.pot \
COMPILING COMPILING.html COPYING.BSD DEBUG \
KDE2PORTING.html NAMING common_texts.cpp kdelibs.lsm kdoc.rules \
qt-messages.pot configure.in.in configure.in.mid configure.in.bot
MAINTAINERCLEANFILES = configure.files subdirs
dist-hook:
cd $(top_distdir) && perl $(top_srcdir)/admin/am_edit -padmin
# Rule for generating HTML documentation [you need kdoc installed]
# Don't forget to run qt2kdoc first (qt2kdoc $QTDIR/doc/html)
# The kdelibs docu will end up in ./srcdoc/
kdedoc:
cd $(top_srcdir) && \
makekdedoc -p'--skip-internal' --outputdir=$(top_builddir)/srcdoc
qtmessages:
if test x$(top_srcdir) = x; then top_srcdir=. ; else top_srcdir=$(top_srcdir); fi ;\
cd $$top_srcdir/../qt-copy/src ;\
sed -e "s,#define,," xml/qxml.cpp > qxml_clean.cpp ;\
find . -name "*.cpp" | grep -v moc_ > list ;\
for file in qfiledialog qcolordialog qprintdialog \
qurloperator qftp qhttp qlocal qerrormessage; do \
grep -v $$file list > list.new && mv list.new list ;\
done ;\
xgettext -C -ktr -kQT_TRANSLATE_NOOP `cat list` ;\
cd ../../kdelibs ;\
mv $$top_srcdir/../qt-copy/src/messages.po $$top_srcdir
echo "remove the header from messages.po and move to qt-messages.pot"
include admin/Doxyfile.am
include admin/deps.am
apidox-am-toplevel-yes: apidox-am-toplevel-kdelibs
apidox-am-toplevel-kdelibs: $(top_builddir)/apidocs/qt/qt.tag
$(top_builddir)/apidocs/qt/qt.tag:
@echo "*** Creating a tag file for the Qt library:"; \
$(mkinstalldirs) $(top_builddir)/apidocs/qt; \
doxytag -t $(top_builddir)/apidocs/qt/qt.tag $(QTDOCDIR)
install-data-local: install-apidox-kdelibs
## install the tag file for the Qt documentation
install-apidox-kdelibs:
if test -f $(top_builddir)/apidocs/qt/qt.tag; then \
$(mkinstalldirs) $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/qt ;\
echo $(INSTALL_DATA) $(top_builddir)/apidocs/qt/qt.tag $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/qt; \
$(INSTALL_DATA) $(top_builddir)/apidocs/qt/qt.tag $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/qt; \
fi
.PHONY: install-apidox-kdelibs apidox-am-toplevel-kdelibs apidox-am-toplevel-yes qtmessages

@ -0,0 +1,15 @@
all:
@echo "This Makefile is only for the SVN repository"
@echo ""
@if test ! -d admin; then \
echo "Please recheckout this module!" ;\
echo "for cvs: use checkout once and after that update again" ;\
echo "for cvsup: checkout kde-common from cvsup and" ;\
echo " link kde-common/admin to ./admin" ;\
exit 1 ;\
fi
$(MAKE) -f admin/Makefile.common cvs
.SILENT:
.PHONY: all

@ -0,0 +1,75 @@
This document describes the naming convention for the various kinds
of DSOs (Dynamic Shared Objects).
NOTE: Files of the format xxxx.la are libtool files that describe the
actual DSO. The DSO itself is usually named xxxx.so or libxxxx.so.
Some platforms require that the name of a DSO starts with "lib". On
those platforms xxxx.la and libxxxx.la both generate DSOs with the
same name "libxxxx.so". Since this leads to problems you should never
use both "xxxx.la" and "libxxxx.la" as names for DSOs!!
*** Since <appname>.la is reserved for KDEInit loadable modules, it is
*** strongly recommended NEVER to use lib<appname>.la as the name of a
*** library.
KDEInit Loadable Modules
========================
Name: <appname>.la
Definition: kdeinit_LTLIBRARIES = <appname>.la
LDFLAGS: -module $(KDE_PLUGIN)
KParts
======
Name: lib<appname>part.la
Definition: kde_module_LTLIBRARIES = lib<appname>part.la
LDFLAGS: -module $(KDE_PLUGIN)
KImageIO plugin
===============
Name: kimg_<imageformat>.la
Definition: kde_module_LTLIBRARIES = kimg_<imageformat>.la
LDFLAGS: -module $(KIMGIO_PLUGIN)
KWin plugin
===========
Name: kwin3_<clientname>.la
Definition: kde_module_LTLIBRARIES = kwin3_<clientname>.la
LDFLAGS: -module $(KDE_PLUGIN)
KIOSlave
========
Name: kio_<protocol>.la
Definition: kde_module_LTLIBRARIES = kio_<protocol>.la
LDFLAGS: -module $(KDE_PLUGIN)
KControl Module
===============
Name: kcm_<modulename>.la
Definition: kde_module_LTLIBRARIES = kcm_<modulename>.la
LDFLAGS: -module $(KDE_PLUGIN)
KDED Module
===========
Name: kded_<modulename>.la
Definition: kde_module_LTLIBRARIES = kded_<modulename>.la
LDFLAGS: -module $(KDE_PLUGIN)
Kicker Applet
=============
Name: <appletname>_panelapplet.la
Definition: kde_module_LTLIBRARIES = <appletname>_panelapplet.la
LDFLAGS: -module $(KDE_PLUGIN)
A definition like kde_module_LTLIBRARIES = <Name>
means that the module is installed under $(kde_moduledir),
which is $prefix/lib/kde3/ in KDE3.

251
README

@ -0,0 +1,251 @@
In this file:
* About kdelibs
* Licensing
* Common Mistakes
* Upgrading
* Compile Problems
* More Info
About kdelibs
-------------
This is version 3.5.10 of the KDE libraries.
This package includes libraries that are central to the development and
execution of a KDE program, as well as internationalization files for these
libraries, misc HTML documentation, theme modules, and regression tests.
Here is an alphabetical list:
* arts
ARTS (analog realtime synthesizer) is a environment of small modules
that one can plug together to process multimedia data. This directory
contains KDE wrapper and KDE user interface elements for ARTS.
* dcop
The desktop communication program allows even shell scripts to
communicate with KDE applications. It's also the base for KParts.
* interfaces
kparts interface for text editors, mediaplayer and scripting.
* kab
OBSOLETE, see kabc: Used to be the address book library, but now only
used to convert kab-Addressbooks into kabc format.
* kabc
The address book library.
* kate
KPart for 'kate', the KDE advanced text editor.
* kcert
Personal certification manager.
* kconf_update
Auto-Updater for config files.
* kdecore
This is the core collection of KDE stuff. Non GUI classes reside here.
* kded
The KDE daemon checks for newly installed software, update files
or hostname changes and takes according actions.
* kdefx
Library with pixmap effects.
* kdeprint
The very versatile printing subsystem of KDE.
* kdesu
Library for password entering and handling
* kdeui
The main collection of misc. user interface classes (widgets).
KSpell and related classes are a frontend to ispell for use within a
GUI app.
* kdewidgets
For developers: KDE's custom widgets for Qt Designer.
* kdoctools
Contains mostly stuff convert XML docbook files via XSLT into
human readable stuff.
* khtml
The next generation HTML rendering widget designed for Konqueror. This
supports HTML 4, CSS, and a variety of other web related standards.
* kimgio
An all purpose extension to the qimgio class that supports various
image formats.
* kinit
Process launcher, used for fast KDE startup
* kio
Classes that fetch and decode URLs are contained here. This library also
contains "ksycoca", the system configure cache containing services,
applications, servicetypes and mimetypes.
* kioslave
I/O subprocesses to handle files, ftp, http, gzip and bzip2 streams.
* kjs
Implementation of ECMAScript (aka JavaScript).
* kparts
KDE component model.
* kstyles
The theme engine lies within. It handles nearly anything relating to
customizing the appearance of widgets.
* kwallet
Client and backend to store values in encrypted files.
* libkmid
MIDI file handling and midi mapper (manages output of midi files to
various devices).
* libkscreensaver
Library for making KDE screensavers.
* libltdl
System independed dlopen() handler.
* licenses
Contains texts of all used licenses.
* mimetypes
Database of mime types.
* pics
Database of icons.
Licensing
---------
The libraries themselves have been covered (since Saturday, June 21st, 1997)
by the GNU Library General Public License (LGPL). Any other programs (such
as the examples) are covered by the GNU General Public License (GPL). All
the gory details for the LGPL reside in COPYING.LIB, and for the GPL reside
in COPYING.
Various parts are also covered under a BSD style license, detailed in
COPYING.BSD. Currently, code covered under such license is copyrighted by
Theo de Raadt.
When in doubt, check the individual file, they should all have license
headings and other identifying marks.
Common Mistakes
---------------
If configure claims Qt cannot be found, look at http://www.trolltech.com
to get a copy of Qt, version 3.3.0 or newer. If you have peeked there
already, grab the SVN module qt-copy from anonsvn.kde.org, or a snapshot
thereof. Alternatively the svn module qt-copy from svn.kde.org can also be
used.
Debugging
---------
You can use --enable-debug with the configure script, if you want to have
debug code in your KDE libs. If you have the space and can stand code that's
somewhat slower, this is worth it. The extra information really
helps debugging and thus bugfixing.
On the other hand, --disable-debug removes all debug messages, leading
to a faster and cleaner desktop.
See also the file DEBUG.
Upgrading
---------
If you have an kdebase older than 3.0 installed, just copy all your .k*rc
files from $HOME to $HOME/.kde/share/config. In the other case, default
values are used for most apps.
Compile Problems
----------------
Often, KDE compile failures are not KDE's faults but the one of the
compiler or the distribution used. For that reason, please have a look at
http://developer.kde.org/build/compilationfaq.html for known issues in certain OS
environments before reporting bugs or going mad :).
gcc 3.0/3.0.1 is not yet able to compile all of KDE without errors, mostly
due to bugs in this version of the compiler. Some older version of gcc 2.96
also have problems compiling KDE due to compiler bugs. Even though
compilation may not report errors with these compiler, the usage of these
compilers may cause crashes when using the resulting executables.
If you are running a FreeBSD system, you will need to make sure that LIBS
is set to "-Wl,-export-dynamic". The easiest way to do this is to prefix
configure with it, i.e.: LIBS="-Wl,-export-dynamic" ./configure. Thanks to
Will Andrews <will@FreeBSD.org> and Arun Sharma <adsharma@sharmas.dhs.org>
for identifying what needed to be done, and how to do it, and such.
If you get odd error such as:
as: Error: /var/tmp/ccK1Cfxa.s, line 2827: Truncating token:
__t4pair2Zt18__rb_tree_iterator3Zt4pair2ZCt12basic_string3ZcZt18string_char_trai
ts1ZcZt24__default_alloc_template2b0i0Zt12basic_string3ZcZt18string_char_traits1
ZcZt24__default_alloc_template2b0i0ZRt4pair2ZCt12basic_string3ZcZt18string_char_
traits1ZcZt24__default_alloc_template2b0i0Zt12basic_string3ZcZt18string_char_tra
its1ZcZt24__default_alloc_template2b0i0ZPt4pair2ZCt12basic_string3ZcZt18string_c
har_traits1ZcZt24__default_alloc_template2b0i0Zt12basic_string3ZcZt18string_char
_traits1ZcZt24__default_alloc_template2b0i0ZbRCt18__rb_tree_iterator3Zt4pair2ZCt
12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Zt12b
asic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0ZRt4pair
2ZCt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Z
t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0ZPt4
pair2ZCt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b
0i0Zt12basic_string3ZcZt18strin!
g_char_traits1ZcZt24__default_al
and you're using egcs, try re-compiling all your C++ libs with -fsquangle,
and then recompiling whatever you were working on with -fsquangle. It
should help, and more information about this is available on the egcs FAQ
available at http://egcs.cygnus.com
How to report
-------------
Reporting bugs is an art. Why? Because bug reports can help and hinder.
They hinder if the developers are just buried in an avalanche of bug reports.
They spend hours figuring out which bug reports are valid and which aren't,
which bug reports are due to bugs or due to installation problems.
They can be of tremendous help to notify developers on problems in areas that
they normally don't have access (e.g. KDE on AIX) to.
So, here are some tips on bug reporting:
* make sure your bug is due to KDE ... and not due to a packaging problem of
your Linux distributor. For example, most "I can not install the XYZ.rpm"
problem are due to packaging issues. Refer with such questions to your
Linux Distributor and his appropriate mailing list or bug reporting tool.
* The chance is high that your bug has already been dealt with ... so look
if there is a newer version of kdelibs available. Reporting bugs for
older, deprecated versions usually don't get that much attention :-)
* Also the chance is high that another one experienced your problem. The
bug report wizard at http://bugs.kde.org will help you to find out if your
problem has already been reported.
* The best bug report for a project based on voluntary work is of course one
that comes with a patch that solves the problem. :-)
More info
---------
http://www.kde.org is a good starting point for info on KDE. If you are a
developer, you may also point your browser to http://developer.kde.org.
There is a plethora of mailing lists available, you can gain an overview
quickly by looking at http://lists.kde.org.

231
TODO

@ -0,0 +1,231 @@
This file is meant to be a place to track of medium to large-scale API changes
that we would like to make for the next binary incompatible release.
- Check for forked classes in kde pim and other modules
- There is no reason why KConfigBase should inherit from QObject, get rid of that.
- Change all FooPrivate *d; -> Private * const d; and place initialization
in the constructor (for classes that would benefit from this). To help catch silly
mistakes since d should never change. Also consider changing to use KStaticDeleter to
help prevent mistakes where developers forget to delete the pointer. Maybe make use of
Qt4 helper macros?
- Move all utility functions away from KApplication. TBD: Make KApplication
a very thin wrapper around QApplication. Ideally, KApplication should go
away completely. The kapp pointer references everywhere must die. Find a
way to make that possible
- Remove all KDE_NO_COMPAT from the KDE2 -> KDE3 port before adding new ones for KDE4.
- Remove the smart-to-dumb-pointer conversion operator from KSharedPtr
and replace it with a T* Get() member function. An implict conversion is
far too dangerous.
See: http://groups.google.com/groups?selm=4ognb0%243cd%40linda.teleport.com&oe=UTF-8&output=gplain
Also free the client from the requirement to inherit from KShared.
- Remove all KSocket, KServerSocket, KSocks and KExtendedSocket references
throughout KDE in favor of KNetwork's socket implementations.
Also, revise the namespace usage.
thiago.macieira@kdemail.net
- Remove all methods marked 'deprecated' in KDE 3.x.
- Clean up the uses of virtual_hook, use normal virtuals instead (e.g. KZip/KArchive)
- Make it possible to create a KSystemTray without a KMainWindow and instead lazily
create the main window on demand.
- Make KSystemTray's Quit option in the context menu call kapp->quit() instead of
closing all windows, so apps that save their window state on exit don't need
workarounds to detect a window close caused by the tray rather than the user.
- Make KSystemTray add its own reference to KApp, so tray apps that adhere to the
style guide can safely close their main window without having to worry about
the app quitting instead.
- Make some long-lasting operations threaded. There are some operations in KDE that
take too long on at least ~500MHz hardware to be done using event loops. Examples
are the use of KLibLoader to dlopen plugins and KRun to fire up other processes.
Konqueror and KMail tend to stall occasionally too, but that's harder to refactor
because the bulk of the work there is X11-related.
- Make it possible to use SSL-ed sockets outside KIO. KSSL isn't very suitable for
reuse, and the certificate dialogs are not even available in public API at all,
leading e.g. to Kopete IRC duplicating a lot of stuff and all KDE Jabber clients
based on libpsi (PSI, Light Hawk and Kopete) using homebrewn solutions. [How
does this have to do with changing KIO? It's just a request to have that
code in a different form....]
- Manually, properly clean up the includes in all of the headers. Remove
unnecessary ones and change pointers to use class foo; decorations and move the
headers into the cpp files. When finished fixkdeincludes shouldn't find
anything (but don't rely on fixkdeinclude, it should be done manually first!)
- Use of the C++ keyword "explicit". Make all ctors explicit which can be used
with one parameter to minimize wrong use of the class (i.e. have a look at
Dirk's work on KURL). Another candidate: KService( KDesktopFile *config ).
KGuiItem has one of these dangerous ctors, too. KUser has a whole bunch
of them.
- Solve need for casting when using bitfield enums (e.g. KProcess::Communication),
if Simon's solution works.
- Merge kdelibs/kdecore/kuser.h and kdeadmin/kuser/kuser.h.
- Simplify memory management with KParts. The part and the widget delete each other,
which in fact makes it more complex to handle. The part owns the widget so it
should delete it, but not the other way round.
- KParts: remove plugin loading from setInstance, add an explicit loadPlugins() call
in all parts that should load plugins (at the end of the derived-part ctor).
- KParts: come up with better names for ReadOnlyPart and ReadWritePart, ReadOnly
is a minimum requirement, but this does not become clear until you dig deeper
into the class. With QTextEdit and QTextBrowser for instance, the inheritance is
the other way around. E.g.: ReaderPart? ViewerPart?
- Other ideas in this thread: http://lists.kde.org/?l=kde-core-devel&m=107608067302571&w=2
(Contributors to that thread, please add specific items here.)
- KConfigBase: For all the read*Entry methods that take a QFont *, QPoint *, QSize *, etc.
for the default value, add overloads that use a const reference, so that one can write
resize( config->readSizeEntry( "Bleh", size() ); for example. Constructing a null
QFont/QPoint/QSize is cheap enough to justify a consistent and usable API (IMHO) .
Keep source compatibility.
- Sort out reference counting of applications and KMainWindows: Add a setRefCountEnabled()
function to KApplication; deref()ing the last reference should only quit the application
if reference counts are enabled, and the reference count should be disabled by default
so apps that don't use a KMainWindow mostly continue to work. Make the KMainWindow
constructor call setRefCountEnabled(true), and make each KMainWindow hold its own
reference to the application. The KMainWindow should drop its app reference on hide, and
regain it on show.
Make KSysTray also hold a reference to the app. Then apps that use more than one main
window and the tray (like KSIrc and Kopete) will quit at the right time without nasty
hacks.
- Change classes that store bool data using strings ("true"/"false") to use bool
calls (readBoolEntry()). Although not technicaly a binary incompatiblity...
just something to bring up for possible change (for the better)
Use KConfigXT instead! /FransE
- Is it really necessary to bother people using the KCM APIs with withFallback? I have
never heard of it failing and when would you not like to have that fallback? I think
a default of 'true' would be fine(and remove the argument in the APIs).
- Do we need to have factory arguments in the KCM API? (who would use it anyway?)
- KCModuleInfo should use d-pointer. Perhaps there is more classes.
- The config options in kdeglobals needs to be cleaned up a little. Perhaps I'm being picky..
* They should be named properly, for example "enableIcons" instead of "EnableIcons". Or atleast
settle on one thing.
* AFAICT it would be the right thing if KWin had its own rc file instead of having its "WM"
section in kdeglobals.
* Shouldn't KSpell have its own rc file instead of kdeglobals?
* Should we allow spaces in option names?
* Some option names are too short for being understandable. fixed->fixedFont; font->systemWideFont
* Perhaps an own font section?
- kpassdlg.h needs to be renamed to kpassworddialog.h - consistent with other classes(it won't
break many apps). The class needs a facelift - see the comments in kpassdlg.{h,cpp}
- KProcess needs a major facelift. Not all of these items need to be BIC, but not needing to
worry about legacy will certainly allow an overall cleaner solution.
- the internals need to be encapsulated properly. many of the virtuals shouldn't be virtual;
lots of protected members should be accessible only via accessors. the current model is
theoretically super-flexible, but in fact it is only super-fragile.
- clear up pipe() vs. socketpair() usage.
- move the draining loop from commClose() to wait()
- add additional "channels" beyond std*, with the built-in capability of passing the fd on the
command line
- redirections, including piping multiple kprocesses together. this should make most cases of
reimplementing commSetupDone{P,C} superflous.
- possibly create KForkProcess that covers most/all of the remaining commSetupDoneC
reimplementations.
- do something about the NoRead comm mode
- add setComm(); remove comm arg from start(). as a side effect, this will allow for using
writeStdin() in Block mode.
- merge KProcIO into KProcess; add setBuffered() for separate channels.
- use QByteArray for writeStdin(). better than the buf+len arg, as it is ref-counted.
- To discuss: Migrate the about dialog to use qhtml or khtml rather then the current
setup of all of the widgets and sub widgets. Might be a lot simpler, require a lot
less code and be much more flexible for additions/enhancments. Sidenote: currently
the about information seems to be duplicated.
- Make API use US English, (eg. KCatalogue -> KCatalog)
- It would be nice if some insan^H^H^H brave soul had a look at the KAccel/KShortcut/KKeyWhatever
classes and cleaned it up.
- KKeyDialog needs to be improved. It should simplify using KKeyChooser by not having to instantiate
KDialogBase without restricting the possibilities of KKeyChooser (for instance, being able to
configure global and application accels in one dialog). If there is only little time, simply
expose the KKeyChooser object instead of making it private and inaccessible.
- Fix the APIs taking Matthias Ettrich's hints into account, most importantly fix the massive
amount of bool-usage in the CTORs (see KDialogBase, for instance)
- Get rid of KXMLClient::conserveMemory() and the conserveMemory argument in createGUI. It created
too many problems in the past. Not worth the trouble.
- Split KProtocolInfo into KProtocolInfoBase in kdecore (with almost everything)
and KProtocolInfo in kio (with the methods taking a KURL, which need KProtocolManager)
- Rename KDirNotify_stub and update API (no need for '*' arguments anymore)
- KWallet::Wallet::* functions - remove the default = 0 argument for mainwindow for the dialog
- Make libkwalletclient part of libkio and get rid of libkwalletclient.
- Get rid of libkdesu dependency in libkio, get rid of SessionData::AuthData*,
get rid of SlaveInterface::authorizationKey and SlaveInterface::delAuthorization
- Make functions in KHelpMenu virtual so they can be overridden (ex: to provide
an alternative help->contents action)
- Replace KPasswordEdit with KLineEdit and adjust KPasswordDialog accordingly.
- Merge KPIM::ClickLineEdit with KLineEdit
- Merge all K*Label classes into one that offers all the features such as ellipsis (this time for
center, middle and right in order to allow for sqeezing the text), links and selectable text
with a consistant API.
- Make sure all GUI classes adopt well to palette changes.
- Rework KPanelExtension and KPanelApplet to have a sane set of global position
enums, make the geometry handling less spaghetti like and extend the API so
requests for things like re-reading the config of a KPanelExtension can be
done by its parent.
- Fix KURLRequester API to use KURL for urls instead of QString to make clear that
we work with URLs and not with paths.
- Dump KPixmapIO class. QPixmap with qt-copy patches #0005 and #0007 can perform just as well,
KPixmapIO can't dither, and it generally doesn't make much sense to have this class.
- KListView: merge setDropHighlighter and setDropVisualizer, add a setDnDMode to choose between
"dnd to move items" (e.g. keditbookmarks) and "dnd onto items" (e.g. kmail). Unless Qt4 does it all :)
- Move KIO::findDeviceMountPoint, findPathMoundPoint, probably_slow_mounted, and testFileSystemFlag to KMountPoint,
to merge that code.
- Refactor the kio/bookmarks code so we don't need to use the static d-pointer trick anymore.
- Rename the parameters to KDEDesktopMimeType::pixmap so that they use meaningful names rather than
just a, b, c, and d. Probably not something that has to wait for KDE 4, but seems like a good idea
to have here for later doing.
- Move KRichTextLabel into kdeui if still required with Qt 4.
- Add the concept of a session to KIO, in particular for KHTML so that it can
have all of its jobs associated in some way (a unique key of sorts). Will
make SSL much easier to implement and allow removal of many hacks, mostly
involving metadata.
- Make KLibLoader default to RTLD_GLOBAL and make necessary changes to make KDE namespace clean.

@ -0,0 +1,9 @@
if include_ARTS
SUBDIRS = kde knotify message
else
SUBDIRS = knotify
endif
DOXYGEN_REFERENCES = kio kdecore kdeui
include ../admin/Doxyfile.am

@ -0,0 +1,75 @@
dnl aRts specific configure tests
dnl
dnl
dnl ensure that the user has aRts-1.1.0 or newer installed
dnl
dnl Check for artsc-config
dnl no need to, AC_BASE_PATH_KDE does it for us already (see also
dnl comment below for mcopidl)
dnl AC_PATH_PROG(ARTSCCONFIG, artsc-config, no)
ARTS_WANT_VERSION_MAJOR=1
ARTS_WANT_VERSION_MINOR=1
ARTS_HAVE_VERSION=none
ARTS_HAVE_PREFIX=none
dnl Check for Glib-2.0
AC_MSG_CHECKING(for aRts-$ARTS_WANT_VERSION_MAJOR.$ARTS_WANT_VERSION_MINOR)
ARTS_OK=no
if test "$build_arts" != "yes"; then
AC_MSG_RESULT(disabled)
else
if test "x$ARTSCCONFIG" != "xno"; then
ARTS_HAVE_VERSION=`$ARTSCCONFIG --arts-version`
ARTS_HAVE_PREFIX=`$ARTSCCONFIG --arts-prefix`
fi
# And delete superfluous '/' to make compares easier
ARTS_HAVE_PREFIX=`echo "$ARTS_HAVE_PREFIX" | sed 's,//*,/,g' | sed -e 's,/$,,'`
ARTS_MAJOR=`echo $ARTS_HAVE_VERSION | sed 's/\.[[0-9]]*\.[[0-9]]*$//'`
ARTS_MINOR=`echo $ARTS_HAVE_VERSION | sed 's/\.[[0-9]]*$//' | sed 's/^[[0-9]]*\.//'`
dnl don't look at the micro version
if test "x$ARTS_MAJOR" != "x" && test "x$ARTS_MINOR" != "x" && test $ARTS_MAJOR -ge $ARTS_WANT_VERSION_MAJOR && test $ARTS_MINOR -ge $ARTS_WANT_VERSION_MINOR; then
realartsprefix=`(cd $ARTS_HAVE_PREFIX; /bin/pwd)`
realprefix=`(cd $prefix; /bin/pwd)`
if test "x$realartsprefix" = "x$realprefix"; then
ARTS_OK=yes
else
AC_MSG_ERROR([aRts $ARTS_WANT_VERSION_MAJOR.$ARTS_WANT_VERSION_MINOR not installed in the same prefix as KDE!
Please reinstall aRts in the same prefix as KDE, different prefixes are not
supported right now.
(kdelibs prefix is $prefix, aRts prefix is $ARTS_HAVE_PREFIX)
])
fi
fi
AC_MSG_RESULT($ARTS_OK)
if test "x$ARTS_OK" = "xno"; then
AC_MSG_ERROR([aRts $ARTS_WANT_VERSION_MAJOR.$ARTS_WANT_VERSION_MINOR not found.
You'll need to install a suitable version of aRts in the same prefix as KDE
before you build kdelibs.
(found
* artsc-config: $ARTSCCONFIG
* kdelibs prefix: $prefix
* aRts prefix: $ARTS_HAVE_PREFIX
* aRts version: $ARTS_HAVE_VERSION (required: $ARTS_WANT_VERSION_MAJOR.$ARTS_WANT_VERSION_MINOR)
)
])
fi
fi
dnl AC_BASE_PATH_KDE already checks for mcopidl, and it does it the
dnl right way using KDE_FIND_PATH
dnl AC_PATH_PROG(MCOPIDL, mcopidl, no)
dnl AC_SUBST(MCOPIDL)

@ -0,0 +1,40 @@
INCLUDES = -I$(top_builddir)/arts/kde \
-I$(top_srcdir) -I$(includedir)/arts $(all_includes)
lib_LTLIBRARIES = libartskde.la
libartskde_la_SOURCES = artskde.cc kioinputstream_impl.cpp kplayobject.cc \
kplayobjectfactory.cc kartsfloatwatch.cpp kartsdispatcher.cc \
kaudiorecordstream.cpp kaudioplaystream.cpp \
kartsserver.cpp kdatarequest_impl.cpp kaudioconverter.cc \
kvideowidget.cpp kplayobjectcreator.cc \
kaudiomanagerplay.cpp
libartskde_la_LIBADD = $(LIB_KIO) -lqtmcop -lsoundserver_idl
libartskde_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 3:0:2
libartskde_la_METASOURCES = AUTO
libartskde_la_COMPILE_FIRST = artskde.h
artskdeincludedir = $(includedir)/arts
artskdeinclude_HEADERS = kplayobject.h kplayobjectfactory.h kartsfloatwatch.h \
artskde.h kartsdispatcher.h \
kaudiorecordstream.h kaudioplaystream.h \
kartsserver.h kvideowidget.h kaudiomanagerplay.h
noinst_HEADERS = kplayobjectcreator.h kplayobjectfactory_p.h
artskde.mcoptype: artskde.h
artskde.mcopclass: artskde.h
MCOPINC = -I$(srcdir)
artskde.cc artskde.h: $(top_srcdir)/arts/kde/artskde.idl $(MCOPIDL)
$(MCOPIDL) -I$(includedir)/arts -t $(MCOPINC) $(top_srcdir)/arts/kde/artskde.idl
DISTCLEANFILES = artskde.cc artskde.h artskde.mcoptype artskde.mcopclass
check_PROGRAMS = kiotest kiotestslow kconverttest
kiotest_SOURCES = kiotest.cc
kiotestslow_SOURCES = kiotestslow.cc
kconverttest_SOURCES = kconverttest.cc
kiotest_LDADD = libartskde.la -lqtmcop -lkmedia2 -lsoundserver_idl
kiotestslow_LDADD = $(kiotest_LDADD)
kconverttest_LDADD = $(kiotest_LDADD)
# vim: ts=8 noet

@ -0,0 +1,51 @@
libartskde Introduction
-----------------------
1. What is libartskde?
libartskde is a simple KDE->aRts wrapper
that allows the developer to use KDE
technology to access aRts.
ie. no need to deal with std::string's anymore
etc.. you can just use QString's or KURL's
to play sound
2. How to use it to play sounds?
<snip>
1 KArtsDispatcher dispatcher;
2 KArtsServer server;
3 KURL file = "file:/home/nikoz/test.mp3";
4 KPlayObjectFactory factory(server.server());
5 KPlayObject *playobj = factory.createPlayObject(file, true);
6 playobj->play();
<snap>
Line:
1 Sets up the a KArtsDispatcher
2 Starts a new SoundServerV2 in the running artsd process
3 Simple test URL to demonstrate the use with KURL
4 Creates a KPlayObjectFactory, parameter: our SoundServerV2
5 Gets a KPlayObject from the factory, containing an Arts::PlayObject
created in our running artsd process
Parameters:
KURL url
(specifies the url to be played)
bool createBUS
(specifies wheter to create a Synth_BUS_UPLINK or not, "false" is only interesting if you want to use EffectsStacks etc..., see Noatun)
6 Play the file
That's it, with 6 LOC a "full" media player :)
To make the example above compile you will also have to add these #includes:
#include <arts/kartsserver.h>
#include <arts/kartsdispatcher.h>
#include <arts/kplayobject.h>
#include <arts/kplayobjectfactory.h>
Enjoy...
Nikolas Zimmermann
<wildfox@kde.org>

@ -0,0 +1,41 @@
#include <kmedia2.idl>
module Arts {
/*
* notification proxy for floats, used internally!
*/
interface KFloatWatchProxy {
attribute float value;
};
/*
* used for deliviering MCOP data to the playobjects
*/
interface KIOInputStream : InputStream {
boolean openURL(string url);
attribute long bufferPackets;
long packetSize();
};
/*
* used for piping raw data to KAudioConverter from the POs
*/
interface KDataRequest : SynthModule {
void goOn();
default in audio stream left, right;
};
/*
* TESTING ONLY
*/
interface KIOTestSlow : SynthModule {
async in byte stream data;
attribute InputStream inputStream;
};
};

@ -0,0 +1,60 @@
/*
Copyright (C) 2001 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include <qiomanager.h>
#include <dispatcher.h>
#include <kdebug.h>
#include "kartsdispatcher.moc"
int KArtsDispatcher::m_refCount = 0;
Arts::Dispatcher *KArtsDispatcher::artsDispatcher = 0;
Arts::QIOManager *KArtsDispatcher::artsQIOManager = 0;
KArtsDispatcher::KArtsDispatcher(QObject *parent, const char *name)
: QObject(parent, name)
{
m_refCount++;
if(artsDispatcher == 0)
{
if (!Arts::Dispatcher::the()) // only if no Arts::Dispatcher is created yet
{
artsQIOManager = new Arts::QIOManager();
artsDispatcher = new Arts::Dispatcher(artsQIOManager);
}
else
kdWarning(400) << "An Arts::Dispatcher() instance exists already while trying to instantiate KArtsDispatcher!" << endl;
}
}
KArtsDispatcher::~KArtsDispatcher()
{
m_refCount--;
if(m_refCount == 0)
{
delete KArtsDispatcher::artsDispatcher;
artsDispatcher = 0;
delete KArtsDispatcher::artsQIOManager;
artsQIOManager = 0;
}
}

@ -0,0 +1,87 @@
/*
Copyright (C) 2001 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KARTSDISPATCHER_H
#define KARTSDISPATCHER_H
#include <qobject.h>
#include <kdelibs_export.h>
namespace Arts
{
class QIOManager;
class Dispatcher;
}
/**
* KArtsDispatcher ensures that an instance of Arts::Dispatcher using an
* Arts::QIOManager exists. When the last KArtsDispatcher is deleted, the
* Arts::Dispatcher is released as well.
*
* Using KArtsDispatcher is especially useful in setups where another plugin
* might also already use an Arts::Dispatcher, for instance in konqueror.
*
* \code
* {
* // old code
* Arts::QIOManager qiomanager;
* Arts::Dispatcher dispatcher(&qiomanager);
*
* Arts::SoundServer server = Arts::Reference("global:Arts_SoundServer");
* server.play("/usr/share/sounds/pop.wav");
* }
* \endcode
*
* \code
* {
* // new code
* KArtsDispatcher dispatcher;
*
* Arts::SoundServer server = Arts::Reference("global:Arts_SoundServer");
* server.play("/usr/share/sounds/pop.wav");
* }
* \endcode
*/
class KDE_EXPORT KArtsDispatcher : public QObject
{
Q_OBJECT
public:
/**
* Constructor.
*
* @param parent the parent Qt object
* @param name the Qt object name of this object
*/
KArtsDispatcher(QObject *parent = 0, const char *name = 0);
/**
* Destructor
*/
~KArtsDispatcher();
private:
static int m_refCount;
static Arts::Dispatcher *artsDispatcher;
static Arts::QIOManager *artsQIOManager;
};
#endif

@ -0,0 +1,64 @@
/*
Copyright (C) 2001 Stefan Westerfeld
stefan@space.twc.de
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "artskde.h"
#include "kartsfloatwatch.moc"
#include "connect.h"
using namespace Arts;
class KArtsFloatWatchPrivate {
public:
KFloatWatchProxy proxy;
};
namespace Arts {
class KFloatWatchProxy_impl : public KFloatWatchProxy_skel {
protected:
KArtsFloatWatch *watch;
public:
KFloatWatchProxy_impl(KArtsFloatWatch *watch) : watch(watch) { };
float value() { return 0.0; /* dummy */ }
void value(float newValue) { watch->change(newValue); }
};
}
KArtsFloatWatch::KArtsFloatWatch(Arts::Object object, const char *stream,
QObject *parent, const char *name) : QObject(parent, name)
{
d = new KArtsFloatWatchPrivate();
d->proxy = KFloatWatchProxy::_from_base(new KFloatWatchProxy_impl(this));
Arts::connect(object, stream, d->proxy, "value");
}
KArtsFloatWatch::~KArtsFloatWatch()
{
delete d;
}
void KArtsFloatWatch::change(float newValue)
{
emit valueChanged(newValue);
}

@ -0,0 +1,82 @@
/*
Copyright (C) 2001 Stefan Westerfeld
stefan@space.twc.de
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "common.h"
#include <qobject.h>
class KArtsFloatWatchPrivate;
namespace Arts { class KFloatWatchProxy_impl; }
/**
* KArtsFloatWatch offers an easy way to watch aRts streams via Qt signals.
* For instance, if you have an object of the following type:
*
* \code
* interface StereoVolumeControl : StereoEffect {
* attribute float scaleFactor;
* readonly attribute float currentVolumeLeft;
* readonly attribute float currentVolumeRight;
* };
* \endcode
*
* and you want to get notified when scaleFactor changes, you could do it
* like this:
*
* \code
* StereoVolumeControl stereoVolumeControl = ...;
* KArtsFloatWatch *w = new KArtsFloatWatch(stereoVolumeControl, "scaleFactor_changed", this);
* connect(w, SIGNAL(valueChanged(float)), this, SLOT(setValue(float)));
* \endcode
*/
class KArtsFloatWatch : public QObject {
Q_OBJECT
private:
KArtsFloatWatchPrivate *d;
friend class Arts::KFloatWatchProxy_impl;
/**
* called by the proxy (internal)
*/
void change(float newValue);
public:
/**
* Constructor.
*
* @param object the aRts object that should be watched
* @param stream the aRts stream that should be watched
* @param parent the parent Qt object
* @param name the Qt object name of this object
*/
KArtsFloatWatch(Arts::Object object, const char *stream, QObject *parent = 0, const char *name = 0);
/**
* Destructor
*/
~KArtsFloatWatch();
signals:
/**
* this signal will be emitted with values of the aRts stream
*/
void valueChanged(float newValue);
};

@ -0,0 +1,111 @@
// Copyright (c) 2000-2001 Charles Samuels <charles@kde.org>
// Neil Stevens <neil@qualityassistant.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIAB\ILITY, WHETHER IN
// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <flowsystem.h>
#include <ksimpleconfig.h>
#include <kprocess.h>
#include <kstandarddirs.h>
#include <qdir.h>
#include <qfile.h>
#include "kartsserver.h"
struct KArtsServer::Data
{
Arts::SoundServerV2 server;
};
KArtsServer::KArtsServer(QObject *parent, const char *name)
: QObject(parent, name)
, d(new Data)
{
d->server = Arts::SoundServerV2::null();
}
KArtsServer::~KArtsServer(void)
{
d->server = Arts::SoundServerV2::null();
delete d;
}
Arts::SoundServerV2 KArtsServer::server(void)
{
bool error = d->server.error();
if( d->server.isNull() || error )
{
d->server = Arts::Reference("global:Arts_SoundServerV2");
if( error && !d->server.isNull() && !d->server.error() )
emit restartedServer();
}
if(!d->server.isNull() && !d->server.error())
return d->server;
// aRts seems not to be running, let's try to run it
// First, let's read the configuration as in kcmarts
KConfig config("kcmartsrc", false /*bReadOnly*/, false /*bUseKDEGlobals*/);
KProcess proc;
config.setGroup("Arts");
bool rt = config.readBoolEntry("StartRealtime", false);
bool x11Comm = config.readBoolEntry("X11GlobalComm", false);
// put the value of x11Comm into .mcoprc
KSimpleConfig X11CommConfig(QDir::homeDirPath()+"/.mcoprc");
if(x11Comm)
X11CommConfig.writeEntry("GlobalComm", "Arts::X11GlobalComm");
else
X11CommConfig.writeEntry("GlobalComm", "Arts::TmpGlobalComm");
X11CommConfig.sync();
proc << QFile::encodeName(KStandardDirs::findExe(QString::fromLatin1("kdeinit_wrapper")));
if(rt)
proc << QFile::encodeName(KStandardDirs::findExe(QString::fromLatin1("artswrapper")));
else
proc << QFile::encodeName(KStandardDirs::findExe(QString::fromLatin1("artsd")));
proc << QStringList::split( " ", config.readEntry( "Arguments", "-F 10 -S 4096 -s 60 -m artsmessage -l 3 -f" ) );
if(proc.start(KProcess::Block) && proc.normalExit())
{
// We could have a race-condition here.
// The correct way to do it is to make artsd fork-and-exit
// after starting to listen to connections (and running artsd
// directly instead of using kdeinit), but this is better
// than nothing.
int time = 0;
do
{
sleep(1);
d->server = Arts::Reference("global:Arts_SoundServerV2");
} while(++time < 5 && (d->server.isNull()));
emit restartedServer();
}
// TODO else what?
return d->server;
}
// vim: sw=4 ts=4 noet
#include "kartsserver.moc"

@ -0,0 +1,75 @@
// Copyright (c) 2000-2001 Charles Samuels <charles@kde.org>
// Neil Stevens <neil@qualityassistant.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIAB\ILITY, WHETHER IN
// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef KARTSSERVER_H
#define KARTSSERVER_H
#include "kmedia2.h"
#include <qobject.h>
#include "soundserver.h"
#include <kdelibs_export.h>
/**
* KArtsServer is a wrapper to conveniently get a reference to a SoundServer,
* and restart artsd when necessary, using the kcontrol settings.
*
* Of course we'd rather that artsd never crashed, and that all users start
* artsd on KDE startup, but at the very least there will always be third
* party PlayObjects that will crash. So, this is necessary.
*/
class KDE_ARTS_EXPORT KArtsServer : public QObject
{
Q_OBJECT
public:
/**
* Create a new KArtsServer. Don't forget to create a KArtsDispatcher
* before using KArtsServer.
*/
KArtsServer(QObject *parent = 0, const char *name = 0);
virtual ~KArtsServer(void);
/**
* Get a verified reference to the SoundServerV2, (re)starting artsd
* using the kcontrol-specified settings if necessary.
*
* If the soundserver has changed since you called this method the last
* time (meaning artsd was restarted) restartedServer() will be emitted.
*/
Arts::SoundServerV2 server(void);
signals:
/**
* This is emitted when the soundserver has been restarted (by this
* KArtsServer instance or outside). It is not
* emitted automatically when the soundserver comes up but only after
* your code calls server().
*/
void restartedServer(void);
private:
KArtsServer(const KArtsServer &rhs);
KArtsServer &operator=(const KArtsServer &rhs);
struct Data;
Data *d;
};
#endif

@ -0,0 +1,198 @@
/*
Copyright (C) 2002 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "artskde.h"
#include "connect.h"
#include "flowsystem.h"
#include "audiosubsys.h"
#include "dynamicrequest.h"
#include "kdatarequest_impl.h"
#include "kioinputstream_impl.h"
#include "kaudioconverter.moc"
#include <iostream>
#include <qfile.h>
#include <qtimer.h>
#include <kurl.h>
#include <kdebug.h>
#include <kmimetype.h>
#include <kapplication.h>
using namespace std;
KAudioConverter::KAudioConverter()
{
m_incoming = 0;
m_started = false;
}
KAudioConverter::~KAudioConverter()
{
delete m_incoming;
}
bool KAudioConverter::setup(int samplingRate)
{
string backupAudioIO = Arts::AudioSubSystem::the()->audioIO();
int backupSamplingRate = Arts::AudioSubSystem::the()->samplingRate();
Arts::AudioSubSystem::the()->audioIO("null");
Arts::AudioSubSystem::the()->samplingRate(samplingRate);
if(!Arts::AudioSubSystem::the()->open())
{
Arts::AudioSubSystem::the()->audioIO(backupAudioIO);
Arts::AudioSubSystem::the()->samplingRate(backupSamplingRate);
return false;
}
return true;
}
void KAudioConverter::slotMimeType(const QString &mimeType)
{
m_mimeType = mimeType;
kapp->exit_loop();
}
void KAudioConverter::requestPlayObject(const KURL &url)
{
string queryInterface = "Arts::PlayObject";
Arts::KIOInputStream inputStream;
if(!url.isLocalFile())
{
Arts::KIOInputStream_impl *inputStreamImpl = new Arts::KIOInputStream_impl();
inputStream = Arts::KIOInputStream::_from_base(inputStreamImpl);
QObject::connect(inputStreamImpl, SIGNAL(mimeTypeFound(const QString &)), SLOT(slotMimeType(const QString &)));
inputStream.openURL(url.url().latin1());
inputStream.streamStart();
// ugly hacks.. :/
kapp->enter_loop();
queryInterface = "Arts::StreamPlayObject";
}
else
{
KMimeType::Ptr mimetype = KMimeType::findByURL(url);
m_mimeType = mimetype->name();
}
Arts::TraderQuery query;
query.supports("Interface", queryInterface);
query.supports("MimeType", string(m_mimeType.latin1()));
string objectType;
vector<Arts::TraderOffer> *offers = query.query();
if(!offers->empty())
objectType = offers->front().interfaceName(); // first offer
delete offers;
if(objectType.empty())
{
m_incoming = 0;
return;
}
if(!url.isLocalFile())
{
Arts::StreamPlayObject result = Arts::SubClass(objectType);
result.streamMedia(inputStream);
result._node()->start();
m_incoming = new KPlayObject(result, true);
}
else
{
Arts::PlayObject result = Arts::SubClass(objectType);
if(result.loadMedia(string(QFile::encodeName(url.path()))))
{
result._node()->start();
m_incoming = new KPlayObject(result, false);
}
else
m_incoming = 0;
}
}
void KAudioConverter::start()
{
if(m_started || !m_incoming)
return;
m_started = true;
emit rawStreamStart();
m_incoming->play();
Arts::KDataRequest_impl *requestImpl = new Arts::KDataRequest_impl();
m_request = Arts::KDataRequest::_from_base(requestImpl);
Arts::connect(m_incoming->object(), "left", m_request, "left");
Arts::connect(m_incoming->object(), "right", m_request, "right");
QObject::connect(requestImpl, SIGNAL(newBlockSize(long)), SIGNAL(newBlockSize(long)));
QObject::connect(requestImpl, SIGNAL(newBlockPointer(long)), SIGNAL(newBlockPointer(long)));
QObject::connect(requestImpl, SIGNAL(newData()), SIGNAL(newData()));
// Special mpeglib case
// TODO: needed at all??
usleep(100000);
if(m_incoming->object()._base()->_isCompatibleWith("DecoderBaseObject"))
if(!Arts::DynamicRequest(m_incoming->object()).method("_set_blocking").param(true).invoke())
cerr << "mpeglib, and blocking attribute can't be changed?" << endl;
m_request.start();
// TODO: Maybe do this async, using QTimer::singleShot
// But jowenn i think jowenn is right -> this would
// lead to problems in slotNewData() when accessing the data
// (could already be overwritten...)
while(m_incoming->state() != Arts::posIdle)
m_request.goOn();
stop();
}
void KAudioConverter::stop()
{
if(!m_started || !m_incoming)
return;
m_incoming->halt();
m_request.streamEnd();
m_started = false;
emit rawStreamFinished();
}

@ -0,0 +1,65 @@
/*
Copyright (C) 2002 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KAUDIOCONVERTER_H
#define KAUDIOCONVERTER_H
#include <qobject.h>
#include "artskde.h"
#include "kplayobject.h"
class KURL;
class QString;
class KAudioConverter : public QObject
{
Q_OBJECT
public:
KAudioConverter();
~KAudioConverter();
bool setup(int samplingRate);
void requestPlayObject(const KURL &url);
void start();
void stop();
signals:
void rawStreamStart();
void newBlockSize(long blockSize);
void newBlockPointer(long blockPointer);
void newData();
void rawStreamFinished();
private slots:
void slotMimeType(const QString &mimeType);
private:
Arts::KDataRequest m_request;
KPlayObject *m_incoming;
QString m_mimeType;
bool m_started;
};
#endif

@ -0,0 +1,90 @@
/* This file is part of the KDE project
Copyright (C) 2003 Matthias Kretz <kretz@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kaudiomanagerplay.h"
#include "kartsserver.h"
#include <soundserver.h>
#include <string>
KAudioManagerPlay::KAudioManagerPlay( KArtsServer * server, const QString & title )
{
d = new PrivateData;
d->amanPlay = Arts::DynamicCast( server->server().createObject( "Arts::Synth_AMAN_PLAY" ) );
d->started = false;
setTitle( title );
}
KAudioManagerPlay::~KAudioManagerPlay()
{
stop();
delete d;
}
Arts::Synth_AMAN_PLAY KAudioManagerPlay::amanPlay()
{
return d->amanPlay;
}
bool KAudioManagerPlay::isNull() const
{
if( !this )
return true;
return d->amanPlay.isNull();
}
void KAudioManagerPlay::setTitle( const QString & title )
{
d->amanPlay.title( std::string( title.local8Bit() ) );
}
QString KAudioManagerPlay::title()
{
return QString::fromLocal8Bit( d->amanPlay.title().c_str() );
}
void KAudioManagerPlay::setAutoRestoreID( const QString & autoRestoreID )
{
d->amanPlay.autoRestoreID( std::string( autoRestoreID.local8Bit() ) );
}
QString KAudioManagerPlay::autoRestoreID()
{
return QString::fromLocal8Bit( d->amanPlay.autoRestoreID().c_str() );
}
void KAudioManagerPlay::start()
{
if( d->started )
return;
d->started = true;
d->amanPlay.start();
}
void KAudioManagerPlay::stop()
{
if( !d->started )
return;
d->started = false;
d->amanPlay.stop();
}
// vim: sw=4 ts=4

@ -0,0 +1,84 @@
/* This file is part of the KDE project
Copyright (C) 2003 Matthias Kretz <kretz@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KAUDIOMANAGERPLAY_H
#define KAUDIOMANAGERPLAY_H
#include <artsflow.h>
#include <qstring.h>
#include <kdelibs_export.h>
class KArtsServer;
class QString;
/**
* KDE Wrapper for Arts::Synth_AMAN_PLAY. Use this class to create an entry in
* the AudioManager - that's the list you see when opening the AudioManager view
* in artscontrol.
*
* @author Matthias Kretz <kretz@kde.org>
* @since 3.2
*/
class KDE_ARTS_EXPORT KAudioManagerPlay
{
public:
KAudioManagerPlay( KArtsServer * server, const QString & title = QString::null );
~KAudioManagerPlay();
/**
* Returns the internal Arts::Synth_AMAN_PLAY
*/
Arts::Synth_AMAN_PLAY amanPlay();
/**
* return true if this == 0 or amanPlay().isNull()
*
* in essence, ((KDE::PlayObject*)0)->isNull() will not
* crash
**/
bool isNull() const;
/**
* Set the name of the output in the AudioManager
*/
void setTitle( const QString & title );
/**
* returns the name of the output as it appears in the AudioManager
*/
QString title();
void setAutoRestoreID( const QString & autoRestoreID );
QString autoRestoreID();
void start();
void stop();
private:
struct PrivateData {
Arts::Synth_AMAN_PLAY amanPlay;
bool started;
};
PrivateData* d;
};
#endif // KAUDIOMANAGERPLAY_H
// vim: sw=4 ts=4

@ -0,0 +1,210 @@
/* This file is part of the KDE project
Copyright (C) 2003 Arnold Krille <arnold@arnoldarts.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kaudioplaystream.h"
#include "kaudioplaystream_p.h"
#include <kartsserver.h>
#include <kaudiomanagerplay.h>
#include <artsflow.h>
#include <soundserver.h>
#include <kglobal.h>
#include <kdebug.h>
#include <qstring.h>
//#include <qptrqueue.h>
//#include <qcstring.h> //QByteArray
#include <string.h> // for strncpy
//#include <assert.h>
KAudioPlayStreamPrivate::KAudioPlayStreamPrivate( KArtsServer* server, const QString title, QObject* p, const char* n )
: QObject( p,n )
, _server( server )
, _play( new KAudioManagerPlay( _server, title ) )
, _effectrack( Arts::StereoEffectStack::null() )
, _polling( true ), _attached( false ), _effects( true )
{
kdDebug( 400 ) << k_funcinfo << endl;
initaRts();
}
KAudioPlayStreamPrivate::~KAudioPlayStreamPrivate()
{
kdDebug( 400 ) << k_funcinfo << endl;
_play->stop();
if ( _effects ) _effectrack.stop();
_bs2a.stop();
}
void KAudioPlayStreamPrivate::initaRts() {
kdDebug( 400 ) << k_funcinfo << endl;
_effectrack = Arts::DynamicCast( _server->server().createObject( "Arts::StereoEffectStack" ) );
if ( _effectrack.isNull() )
{
kdWarning( 400 ) << "Couldn't create EffectStack!" << endl;
_effects = false;
}
_bs2a = Arts::DynamicCast( _server->server().createObject( "Arts::ByteStreamToAudio" ) );
if ( _bs2a.isNull() )
kdFatal( 400 ) << "Couldn't create ByteStreamToAudio" << endl;
if ( _effects )
{
Arts::connect( _effectrack, _play->amanPlay() );
Arts::connect( _bs2a, _effectrack );
} else {
Arts::connect( _bs2a, _play->amanPlay() );
}
_play->start();
if ( _effects ) _effectrack.start();
}
KAudioPlayStream::KAudioPlayStream( KArtsServer* server, const QString title, QObject* p, const char* n )
: QObject( p,n )
, d( new KAudioPlayStreamPrivate( server, title, this ) )
{
kdDebug( 400 ) << k_funcinfo << endl;
}
KAudioPlayStream::~KAudioPlayStream()
{
kdDebug( 400 ) << k_funcinfo << endl;
}
void KAudioPlayStream::setPolling( bool n ) { d->_polling = n; }
bool KAudioPlayStream::polling() const { return d->_polling; }
bool KAudioPlayStream::running() const { return d->_attached; }
Arts::StereoEffectStack KAudioPlayStream::effectStack() const {
return d->_effectrack;
}
void KAudioPlayStream::start( int samplingRate, int bits, int channels )
{
kdDebug( 400 ) << k_funcinfo << "samplingRate: " << samplingRate << " bits: " << bits << " channels: " << channels << endl;
if ( !d->_attached )
{
d->_bs2a.samplingRate( samplingRate );
d->_bs2a.channels( channels );
d->_bs2a.bits( bits );
d->_sender = new KByteSoundProducer( this, d->_server->server().minStreamBufferTime(), samplingRate, bits, channels, "PS" );
d->_artssender = Arts::ByteSoundProducerV2::_from_base( d->_sender );
Arts::connect( d->_artssender, "outdata", d->_bs2a, "indata" );
d->_bs2a.start();
d->_artssender.start();
// // Needed?
Arts::Dispatcher::the()->ioManager()->processOneEvent( false );
d->_attached = true;
emit running( d->_attached );
}
}
void KAudioPlayStream::stop()
{
kdDebug( 400 ) << k_funcinfo << endl;
if ( d->_attached )
{
d->_attached = false;
d->_bs2a.stop();
d->_artssender.stop();
// Shortly stop the play so we dont get clicks and artefacts
d->_play->stop();
d->_play->start();
Arts::disconnect( d->_artssender, d->_bs2a );
d->_artssender = Arts::ByteSoundProducerV2::null();
d->_sender = 0;
emit running( d->_attached );
}
}
void KAudioPlayStream::write( QByteArray& )
{
}
void KAudioPlayStream::fillData( Arts::DataPacket<Arts::mcopbyte> *packet )
{
//kdDebug( 400 ) << k_funcinfo << "packet->size=" << packet->size << endl;
if ( d->_polling )
{
QByteArray bytearray( packet->size );
bytearray.setRawData( ( char* )packet->contents, packet->size );
bytearray.fill( 0 );
emit requestData( bytearray );
bytearray.resetRawData( ( char* )packet->contents, packet->size );
//for ( int i=0; i<10; i++ )
// kdDebug() << packet->contents[ i ] << " : " << bytearray.data()[ i ] << endl;
} else {
/// TODO: Implement a queue and fetching from it...
}
}
// * * * KByteSoundProducer * * *
KByteSoundProducer::KByteSoundProducer( KAudioPlayStream* impl, float minBufferTime, int rate, int bits, int channels, const char * title )
: _samplingRate( rate )
, _channels( channels )
, _bits( bits )
, _packets( 7 )
, _title( title )
, _impl( impl )
{
// Calculate packet count (packetsize is fixed to packetCapacity = 4096
float streamBufferTime;
do {
_packets++;
streamBufferTime = ( float )( _packets * packetCapacity * 1000 )
/ ( float )( _samplingRate * _channels * 2 );
} while ( streamBufferTime < minBufferTime );
//kdDebug( 400 ) << k_funcinfo << "_packets:" << _packets << " packetCapacity:" << packetCapacity << endl;
}
KByteSoundProducer::~KByteSoundProducer()
{
}
void KByteSoundProducer::streamStart() { outdata.setPull( _packets, packetCapacity ); }
void KByteSoundProducer::streamEnd() { outdata.endPull(); }
void KByteSoundProducer::request_outdata( Arts::DataPacket<Arts::mcopbyte> *packet )
{
if ( _impl->running() ) {
_impl->fillData( packet );
packet->send();
}
}
// vim: sw=4 ts=4 tw=80
#include "kaudioplaystream.moc"
#include "kaudioplaystream_p.moc"

@ -0,0 +1,127 @@
/* This file is part of the KDE project
Copyright (C) 2003 Arnold Krille <arnold@arnoldarts.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KAUDIOPLAYSTREAM_H
#define KAUDIOPLAYSTREAM_H
#include <qobject.h>
#include <qcstring.h>
#include <stdsynthmodule.h>
#include <kdelibs_export.h>
class KArtsServer;
namespace Arts { class StereoEffectStack; }
class KAudioPlayStreamPrivate;
/**
* @brief A wrapper around ByteSoundProducer/ByteStreamToAudio/Synth_AMAN_PLAY.
*
* @author Arnold Krille <arnold@arnoldarts.de>
* @since 3.2
*/
class KDE_ARTS_EXPORT KAudioPlayStream : public QObject {
Q_OBJECT
public:
/**
* Creates a KAudioPlayStream on server with a title. You should pass the KArtsServer also
* as parent to be sure this object is deleted before the server is.
*
* @param server The server where it should play to.
* @param title The title that is shown in the AudioManager.
* @param parent You will propably want to pass the server as parent to so this stream gets deleted before the server disappears.
* @param name The name of the stream.
*/
KAudioPlayStream( KArtsServer* server, const QString title, QObject* parent=0, const char* name=0 );
/**
* Destructs the KAudioPlayStream.
*/
~KAudioPlayStream();
/**
* Controls wether this Stream should poll the data from you via the signal requestData()
* or you use write() to fill the inputbuffer.
*
* Default is true
*/
void setPolling( bool );
/**
* Returns the polling state.
* @see setPolling
*/
bool polling() const;
/**
* @return wether this stream is running ("on air") or not.
*/
bool running() const;
/**
* @return The Arts::StereoEffectStack right before the Synth_AMAN_PLAY.
*/
Arts::StereoEffectStack effectStack() const;
public slots:
/**
* Start the stream.
* @param samplingRate how many samples per second ( typically 11000/22050/44100/48000 )
* @param bits how many bits per sample ( 8 / 16 )
* @param channels how many channels ( 1 or 2 )
*/
void start( int samplingRate, int bits, int channels );
/**
* Stops the stream.
*/
void stop();
/**
* Write data into the inputbuffer.
* If you ignore the signal noData() it will play 0 ( silence ).
*/
void write( QByteArray& data );
signals:
/**
* This signal is emitted when audio should be played.
* You have to fill the array with data.
*/
void requestData( QByteArray& );
/**
* Is emitted when the state changes.
*/
void running( bool );
/**
* Is emitted if the inputbuffer runs dry and polling os off.
*/
void noData();
public:
/**
* @internal
*/
void fillData( Arts::DataPacket<Arts::mcopbyte> *packet );
private:
KAudioPlayStreamPrivate* d;
};
#endif // KAUDIOPLAYSTREAM_H
// vim: sw=4 ts=4 tw=80

@ -0,0 +1,84 @@
/* This file is part of the KDE project
Copyright (C) 2003 Arnold Krille <arnold@arnoldarts.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KAUDIOPLAYSTREAM_P_H
#define KAUDIOPLAYSTREAM_P_H
#include <soundserver.h>
#include <stdsynthmodule.h>
#include <qobject.h>
class KArtsServer;
class KAudioManagerPlay;
namespace Arts {
class Synth_AMAN_PLAY;
class StereoEffectStack;
class ByteStreamToAudio;
}
class KAudioPlayStream;
class KByteSoundProducer;
class KAudioPlayStreamPrivate : public QObject {
Q_OBJECT
public:
KAudioPlayStreamPrivate( KArtsServer*, const QString title, QObject*, const char* =0 );
~KAudioPlayStreamPrivate();
KArtsServer* _server;
KAudioManagerPlay* _play;
Arts::StereoEffectStack _effectrack;
Arts::ByteStreamToAudio _bs2a;
KByteSoundProducer* _sender;
Arts::ByteSoundProducerV2 _artssender;
bool _polling, _attached, _effects;
public slots:
void initaRts();
};
class KByteSoundProducer : virtual public Arts::ByteSoundProducerV2_skel
, virtual public Arts::StdSynthModule
{
public:
KByteSoundProducer( KAudioPlayStream*, float minBufferTime, int rate, int bits, int channels, const char * title );
~KByteSoundProducer();
long samplingRate() { return _samplingRate; }
long channels() { return _channels; }
long bits() { return _bits; }
std::string title() { return _title; }
void streamStart();
void streamEnd();
protected:
void request_outdata( Arts::DataPacket<Arts::mcopbyte> *packet );
private:
long _samplingRate, _channels, _bits, _packets;
std::string _title;
enum { packetCapacity = 4096 };
KAudioPlayStream* _impl;
};
#endif // KAUDIOPLAYSTREAM_P_H
// vim: sw=4 ts=4

@ -0,0 +1,269 @@
/*
Copyright (C) 2001, 2002 Matthias Kretz
kretz@kde.org
2003 Arnold Krille
arnold@arnoldarts.de
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kaudiorecordstream.h"
#include "kaudiorecordstream_p.h"
#include "kartsserver.h"
#include <artsflow.h>
#include <soundserver.h>
#include <kglobal.h>
#include <kdebug.h>
#include <qstring.h>
#include <qptrqueue.h>
#include <qcstring.h> //QByteArray
#include <assert.h>
struct KAudioRecordStream::Data
{
Arts::Synth_AMAN_RECORD in;
Arts::AudioToByteStream convert;
Arts::StereoEffectStack effectStack;
Arts::ByteSoundReceiver receiver;
KByteSoundReceiver * receiver_base;
KArtsServer * kserver;
bool attached;
bool blocking;
bool polling;
unsigned int pos;
QPtrQueue<QByteArray> inqueue;
QString title;
};
KAudioRecordStream::KAudioRecordStream( KArtsServer * kserver, const QString & title, QObject * parent, const char * name )
: QObject( parent, name )
, d( new Data )
{
d->kserver = kserver;
d->attached = false;
d->blocking = true;
d->polling = false;
d->pos = 0;
d->inqueue.setAutoDelete( true );
d->title = title;
connect( d->kserver, SIGNAL( restartedServer() ), SLOT( slotRestartedServer() ) );
d->in = Arts::DynamicCast( d->kserver->server().createObject( "Arts::Synth_AMAN_RECORD" ) );
d->effectStack = Arts::DynamicCast( d->kserver->server().createObject( "Arts::StereoEffectStack" ) );
d->convert = Arts::DynamicCast( d->kserver->server().createObject( "Arts::AudioToByteStream" ) );
if( d->in.isNull() )
kdFatal( 400 ) << "couldn't create a Synth_AMAN_RECORD on the aRts server\n";
if( d->effectStack.isNull() )
kdFatal( 400 ) << "couldn't create a StereoEffectStack on the aRts server\n";
if( d->convert.isNull() )
kdFatal( 400 ) << "couldn't create a AudioToByteStream on the aRts server\n";
d->in.title( ( const char * ) d->title.local8Bit() );
Arts::connect( d->in, d->effectStack );
d->in.start();
d->effectStack.start();
}
KAudioRecordStream::~KAudioRecordStream()
{
d->receiver = Arts::ByteSoundReceiver::null();
// don't delete receiver_base because aRts takes care of that (in the line
// above)
d->receiver_base = 0;
delete d;
}
int KAudioRecordStream::read( char * buffer, int size )
{
kdDebug( 400 ) << k_funcinfo << endl;
unsigned int remaining = size;
while( remaining )
{
if( d->blocking )
while( d->inqueue.isEmpty() )
Arts::Dispatcher::the()->ioManager()->processOneEvent( true );
else
{
if( d->inqueue.isEmpty() )
Arts::Dispatcher::the()->ioManager()->processOneEvent( false );
if( d->inqueue.isEmpty() )
return size - remaining;
}
QByteArray * data = d->inqueue.head();
unsigned int tocopy = kMin( remaining, data->size() - d->pos );
memcpy( buffer, data->data() + d->pos, tocopy );
d->pos += tocopy;
buffer += tocopy;
remaining -= tocopy;
if( d->pos == data->size() )
{
d->inqueue.remove();
d->pos = 0;
}
}
return size;
}
void KAudioRecordStream::setBlockingIO( bool blocking )
{
d->blocking = blocking;
}
bool KAudioRecordStream::blockingIO() const
{
return d->blocking;
}
void KAudioRecordStream::usePolling( bool polling )
{
d->polling = polling;
if( ! polling )
flush();
}
bool KAudioRecordStream::polling() const
{
return d->polling;
}
Arts::StereoEffectStack KAudioRecordStream::effectStack() const
{
return d->effectStack;
}
bool KAudioRecordStream::running() const
{
return d->attached;
}
void KAudioRecordStream::stop()
{
kdDebug( 400 ) << k_funcinfo << endl;
if( d->attached )
{
d->receiver.stop();
d->convert.stop();
Arts::disconnect( d->convert, d->receiver );
d->receiver = Arts::ByteSoundReceiver::null();
d->receiver_base = 0;
Arts::disconnect( d->effectStack, d->convert );
d->attached = false;
emit running( false );
}
}
void KAudioRecordStream::start( int samplingRate, int bits, int channels )
{
kdDebug( 400 ) << k_funcinfo << "samplingRate: " << samplingRate << " bits: " << bits << " channels: " << channels << endl;
if( ! d->attached )
{
assert( d->kserver );
if( ( samplingRate < 500 || samplingRate > 2000000 )
|| ( channels != 1 && channels != 2 ) || ( bits != 8 && bits != 16 ) )
{
kdWarning( 400 ) << "invalid stream parameters: rate=" << samplingRate << ", " << bits << " bit, " << channels << " channels\n";
}
else
{
d->convert.samplingRate( samplingRate );
d->convert.channels( channels );
d->convert.bits( bits );
Arts::connect( d->effectStack, d->convert );
d->receiver_base = new KByteSoundReceiver( samplingRate, bits, channels, d->title.local8Bit() );
d->receiver = Arts::ByteSoundReceiver::_from_base( d->receiver_base );
connect( d->receiver_base, SIGNAL( data( const char *, unsigned int ) ),
SLOT( slotData( const char *, unsigned int ) ) );
Arts::connect( d->convert, "outdata", d->receiver, "indata" );
d->convert.start();
d->receiver.start();
//### needed?
Arts::Dispatcher::the()->ioManager()->processOneEvent( false );
d->attached = true;
emit running( true );
}
}
}
void KAudioRecordStream::flush()
{
kdDebug( 400 ) << k_funcinfo << endl;
d->inqueue.clear();
}
void KAudioRecordStream::slotRestartedServer() { }
void KAudioRecordStream::slotData( const char * contents, unsigned int size )
{
//kdDebug( 400 ) << k_funcinfo << endl;
QByteArray * bytearray = new QByteArray( size );
// copy the contents to the bytearray
// this has to be deleted later
bytearray->duplicate( contents, size );
if( d->polling )
{
kdDebug( 400 ) << "enqueue the data\n";
d->inqueue.enqueue( bytearray );
}
else
{
//kdDebug( 400 ) << "emit the data\n";
emit data( *bytearray );
//kdDebug( 400 ) << "delete the data\n";
delete bytearray;
}
}
////////////////////////////////////////
// ---*--- KByteSoundReceiver ---*--- //
////////////////////////////////////////
KByteSoundReceiver::KByteSoundReceiver( int rate, int bits, int channels, const char * title )
: _samplingRate( rate )
, _bits( bits )
, _channels( channels )
, _title( title )
{
}
KByteSoundReceiver::~KByteSoundReceiver()
{
}
void KByteSoundReceiver::process_indata( Arts::DataPacket<Arts::mcopbyte> * inpacket )
{
//kdDebug( 400 ) << k_funcinfo << " size of the packet: " << inpacket->size << endl;
emit data( (char *)inpacket->contents, inpacket->size );
inpacket->processed();
}
// vim:sw=4:ts=4
#include "kaudiorecordstream.moc"
#include "kaudiorecordstream_p.moc"

@ -0,0 +1,165 @@
/*
Copyright (C) 2001,2002 Matthias Kretz
kretz@kde.org
2003 Arnold Krille
arnold@arnoldarts.de
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _KAUDIORECORDSTREAM__H
#define _KAUDIORECORDSTREAM__H
#include <qobject.h>
#include <kdelibs_export.h>
class KArtsServer;
namespace Arts { class StereoEffectStack; }
/**
* @brief A KDE wrapper around Synth_AMAN_RECORD/AudioToByteStream/ByteSoundReceiver
*
* @author Matthias Kretz <kretz@kde.org>
* @since 3.2
*/
class KDE_ARTS_EXPORT KAudioRecordStream : public QObject
{
Q_OBJECT
public:
/**
* Construct a KAudioRecordStream
*
* @param server The server where it should record from.
* @param title The title that is shown in the AudioManager.
* @param parent You will propably want to pass the server as parent to so this stream gets deleted before the server disappears.
* @param name The name of the stream.
*/
KAudioRecordStream( KArtsServer * server, const QString & title, QObject * parent = 0, const char * name = 0 );
~KAudioRecordStream();
/**
* You can read @p size number of bytes. If blockingIO() is set the method
* will return as soon as it has all your data and could possibly block your
* program. The method returns the number of bytes that are actually in the
* buffer.
*
* @see usePolling()
*/
int read( char *, int size );
/**
* If you set blockingIO to true the read method will wait
* until it has enough data to return exactly what you asked for. If
* blockingIO is false you can count on having control back to your
* program soon enough
*/
void setBlockingIO( bool );
/**
* read blocking I/O setting
*
* @see setBlockingIO()
*/
bool blockingIO() const;
/**
* If you want to poll for data using read() set this to true. If
* you'd rather not poll use the data() signal for asynchronous
* I/O. If you set polling to true and don't call read() or
* flush() the inputbuffer will grow endlessly.
*
* The default is false (if you want to use read() set this to true).
*/
void usePolling( bool );
/**
* read whether polling is enabled
*
* @see usePolling()
*/
bool polling() const;
/**
* @return The Effect Stack right after the Synth_AMAN_RECORD.
*/
Arts::StereoEffectStack effectStack() const;
/**
* @return Wether it is running (recording) or not.
* @since 3.2
*/
bool running() const;
public slots:
/**
* Detaches the stream from the soundserver but doesn't remove the Synth_AMAN_RECORD
* so that the entry in the Audiomanager remains.
*/
void stop();
/**
* Attach to the soundserver and start getting data to read. This method
* must be called as soon as you want to receive data. In any case you have
* to call start() before read()
*
* @param samplingRate The sampling rate the stream should be resampled to. Use
* a number between 500 and 2000000.
* @param bits The number of bits the stream should have. Only 8 and
* 16 Bits are supported.
* @param channels The number of channels (mono/stereo). Only 1 and 2 are
* supported.
*/
void start( int samplingRate, int bits, int channels );
/**
* flush input buffer
*/
void flush();
signals:
/**
* Data from the aRts server has arrived. You should copy the data
* because the passed QByteArray will be deleted right after
* returning from your slot(s).
*
* @param data the data from the server
*/
void data( QByteArray & data );
/**
* Wether this RecordStream is recording or not.
* @since 3.2
*/
void running( bool );
private slots:
void slotRestartedServer();
void slotData( const char *, unsigned int );
private:
KAudioRecordStream( const KAudioRecordStream & );
KAudioRecordStream & operator=( const KAudioRecordStream & );
struct Data;
Data * d;
};
#endif //_KAUDIORECORDSTREAM__H

@ -0,0 +1,62 @@
/*
Copyright (C) 2002 Matthias Kretz
kretz@kde.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _KAUDIORECORDSTREAM_P__H
#define _KAUDIORECORDSTREAM_P__H
#include <soundserver.h>
#include <stdsynthmodule.h>
#include <qobject.h>
class KByteSoundReceiver : public QObject,
public Arts::ByteSoundReceiver_skel,
public Arts::StdSynthModule
{
Q_OBJECT
public:
KByteSoundReceiver( int rate, int bits, int channels, const char * title );
~KByteSoundReceiver();
long samplingRate() { return _samplingRate; }
long channels() { return _channels; }
long bits() { return _bits; }
std::string title() { return _title; }
signals:
/**
* new data arrived, the data pointer will be deleted
* after this signal was emitted. So if you want to keep it
* you have to copy it.
*/
void data( const char * data, unsigned int size );
protected:
void process_indata(Arts::DataPacket<Arts::mcopbyte> *);
private:
int _samplingRate, _bits, _channels;
std::string _title;
};
#endif // _KAUDIORECORDSTREAM_P__H

@ -0,0 +1,96 @@
#include <stdio.h>
#include <qfile.h>
#include <qobject.h>
#include <klocale.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <kapplication.h>
#include <flowsystem.h>
#include <kplayobject.h>
#include <kartsdispatcher.h>
#include <kplayobjectfactory.h>
#include <kaudioconverter.h>
#include "kconverttest.moc"
using namespace std;
using namespace Arts;
static KCmdLineOptions options[] =
{
{ "+[URL]", I18N_NOOP("URL to open"), 0 },
KCmdLineLastOption
};
KConvertTest::KConvertTest()
{
}
void KConvertTest::slotRawStreamStart()
{
// cout << "[START]\n\n" << endl;
}
void KConvertTest::slotNewBlockSize(long blockSize)
{
m_blockSize = blockSize;
}
void KConvertTest::slotNewBlockPointer(long blockPointer)
{
m_blockPointer = blockPointer;
}
void KConvertTest::slotNewData()
{
fwrite((void *) m_blockPointer, 1, m_blockSize, stdout);
}
void KConvertTest::slotRawStreamFinished()
{
// cout << "\n\n[END]" << endl;
}
int main(int argc, char **argv)
{
KAboutData aboutData("kconverttest", I18N_NOOP("KConvertTest"), I18N_NOOP("0.1"), "", KAboutData::License_GPL, "");
KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
KURL url;
if(args->count())
url = args->arg(0);
else
exit(1);
args->clear();
KConvertTest *get = new KConvertTest();
KArtsDispatcher dispatcher;
KAudioConverter converter;
// FIXME: crashes
// converter.setup(44100);
converter.requestPlayObject(url);
QObject::connect(&converter, SIGNAL(rawStreamStart()), get, SLOT(slotRawStreamStart()));
QObject::connect(&converter, SIGNAL(newBlockSize(long)), get, SLOT(slotNewBlockSize(long)));
QObject::connect(&converter, SIGNAL(newBlockPointer(long)), get, SLOT(slotNewBlockPointer(long)));
QObject::connect(&converter, SIGNAL(newData()), get, SLOT(slotNewData()));
QObject::connect(&converter, SIGNAL(rawStreamFinished()), get, SLOT(slotRawStreamFinished()));
converter.start();
app.exec();
}

@ -0,0 +1,46 @@
/*
Copyright (C) 2002 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KCONVERTTEST_H
#define KCONVERTTEST_H
#include <qobject.h>
class KConvertTest : public QObject
{
Q_OBJECT
public:
KConvertTest();
public slots:
void slotRawStreamStart();
void slotNewBlockSize(long blockSize);
void slotNewBlockPointer(long blockPointer);
void slotNewData();
void slotRawStreamFinished();
private:
long m_blockSize, m_blockPointer;
};
#endif

@ -0,0 +1,80 @@
/*
Copyright (C) 2002 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include <kdebug.h>
#include "flowsystem.h"
#include "convert.h"
#include "kdatarequest_impl.moc"
using namespace Arts;
KDataRequest_impl::KDataRequest_impl()
{
m_lastBlockSize = 0;
m_outBlock = 0;
}
KDataRequest_impl::~KDataRequest_impl()
{
delete []m_outBlock;
}
void KDataRequest_impl::streamInit()
{
}
void KDataRequest_impl::streamEnd()
{
}
void KDataRequest_impl::calculateBlock(unsigned long samples)
{
long blockSize = samples * 4;
if(m_lastBlockSize != blockSize)
{
delete []m_outBlock;
emit newBlockSize(blockSize);
m_outBlock = new unsigned char[blockSize]; // 2 channels, 16 bit
emit newBlockPointer((long) m_outBlock);
m_lastBlockSize = blockSize;
}
convert_stereo_2float_i16le(samples, left, right, m_outBlock);
emit newData();
}
/*
* this is the most tricky part here - since we will run in a context
* where no audio hardware will play the "give me more data role",
* we'll have to request things ourselves (requireFlow() tells the
* flowsystem that more signal flow should happen, so that
* calculateBlock will get called
*/
void KDataRequest_impl::goOn()
{
_node()->requireFlow();
}
REGISTER_IMPLEMENTATION(KDataRequest_impl);

@ -0,0 +1,59 @@
/*
Copyright (C) 2002 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KDATAREQUEST_IMPL
#define KDATAREQUEST_IMPL
#include <qobject.h>
#include "artskde.h"
#include "stdsynthmodule.h"
namespace Arts
{
class KDataRequest_impl : public QObject, virtual public KDataRequest_skel,
virtual public StdSynthModule
{
Q_OBJECT
public:
KDataRequest_impl();
~KDataRequest_impl();
void streamInit();
void streamEnd();
void calculateBlock(unsigned long samples);
void goOn();
signals:
void newData();
void newBlockSize(long blockSize);
void newBlockPointer(long blockPointer);
private:
long m_lastBlockSize;
unsigned char *m_outBlock;
};
}
#endif

@ -0,0 +1,236 @@
/*
Copyright (C) 2001 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
/*
* How does it work?
* -----------------
*
* First the buffer has to be filled. When it reaches a defined size the outdata
* stream has to start pulling packets. If the buffer reaches a size of zero the
* stream has to stop. If the buffer gets to big the job has to be suspended
* until the buffer is small enough again.
*/
#include <kapplication.h>
#include <kdebug.h>
#include <kio/job.h>
#include <kio/kmimetype.h>
#include <kio/jobclasses.h>
#include <qtimer.h>
#include <qdatastream.h>
#include "artsversion.h"
#include "kioinputstream_impl.moc"
using namespace Arts;
const unsigned int KIOInputStream_impl::PACKET_COUNT = 10;
KIOInputStream_impl::KIOInputStream_impl() : m_packetSize(2048)
{
m_job = 0;
m_finished = false;
m_firstBuffer = false;
m_packetBuffer = 16;
m_streamStarted = false;
m_streamSuspended = false;
m_streamPulled = false;
m_size = 0;
}
KIOInputStream_impl::~KIOInputStream_impl()
{
if(m_job != 0)
m_job->kill();
}
void KIOInputStream_impl::streamStart()
{
// prevent kill/reconnect
if (m_streamStarted) {
kdDebug( 400 ) << "not restarting stream!\n";
if (m_job->isSuspended())
m_job->resume();
return;
}
kdDebug( 400 ) << "(re)starting stream\n";
if(m_job != 0)
m_job->kill();
m_job = KIO::get(m_url, false, false);
m_job->addMetaData("accept", "audio/x-mp3, video/mpeg, application/ogg");
m_job->addMetaData("UserAgent", QString::fromLatin1("aRts/") + QString::fromLatin1(ARTS_VERSION));
QObject::connect(m_job, SIGNAL(data(KIO::Job *, const QByteArray &)),
this, SLOT(slotData(KIO::Job *, const QByteArray &)));
QObject::connect(m_job, SIGNAL(result(KIO::Job *)),
this, SLOT(slotResult(KIO::Job *)));
QObject::connect(m_job, SIGNAL(mimetype(KIO::Job *, const QString &)),
this, SLOT(slotScanMimeType(KIO::Job *, const QString &)));
QObject::connect(m_job, SIGNAL(totalSize( KIO::Job *, KIO::filesize_t)),
this, SLOT(slotTotalSize(KIO::Job *, KIO::filesize_t)));
m_streamStarted = true;
}
void KIOInputStream_impl::streamEnd()
{
kdDebug( 400 ) << "streamEnd()\n";
if(m_job != 0)
{
QObject::disconnect(m_job, SIGNAL(data(KIO::Job *, const QByteArray &)),
this, SLOT(slotData(KIO::Job *, const QByteArray &)));
QObject::disconnect(m_job, SIGNAL(result(KIO::Job *)),
this, SLOT(slotResult(KIO::Job *)));
QObject::disconnect(m_job, SIGNAL(mimetype(KIO::Job *, const QString &)),
this, SLOT(slotScanMimeType(KIO::Job *, const QString &)));
QObject::disconnect(m_job, SIGNAL(totalSize( KIO::Job *, KIO::filesize_t)),
this, SLOT(slotTotalSize(KIO::Job *, KIO::filesize_t)));
if ( m_streamPulled )
outdata.endPull();
m_job->kill();
m_job = 0;
}
m_streamStarted = false;
}
bool KIOInputStream_impl::openURL(const std::string& url)
{
m_url = KURL(url.c_str());
m_size = 0;
return true;
}
void KIOInputStream_impl::slotData(KIO::Job *, const QByteArray &data)
{
if(m_finished)
m_finished = false;
QDataStream dataStream(m_data, IO_WriteOnly | IO_Append);
dataStream.writeRawBytes(data.data(), data.size());
//kdDebug( 400 ) << "STREAMING: buffersize = " << m_data.size() << " bytes" << endl;
processQueue();
}
void KIOInputStream_impl::slotResult(KIO::Job *job)
{
// jobs delete themselves after emitting their result
m_finished = true;
m_streamStarted = false;
m_job = 0;
if(job->error()) {
// break out of the event loop in case of
// connection error
emit mimeTypeFound("application/x-zerosize");
job->showErrorDialog();
}
}
void KIOInputStream_impl::slotScanMimeType(KIO::Job *, const QString &mimetype)
{
kdDebug( 400 ) << "got mimetype: " << mimetype << endl;
emit mimeTypeFound(mimetype);
}
void KIOInputStream_impl::slotTotalSize(KIO::Job *, KIO::filesize_t size)
{
m_size = size;
}
bool KIOInputStream_impl::eof()
{
return (m_finished && m_data.size() == 0);
}
bool KIOInputStream_impl::seekOk()
{
return false;
}
long KIOInputStream_impl::size()
{
return m_size ? m_size : m_data.size();
}
long KIOInputStream_impl::seek(long)
{
return -1;
}
void KIOInputStream_impl::processQueue()
{
if(m_job != 0)
{
if(m_data.size() > (m_packetBuffer * m_packetSize * 2) && !m_job->isSuspended())
{
kdDebug( 400 ) << "STREAMING: suspend job" << endl;
m_job->suspend();
}
else if(m_data.size() < (m_packetBuffer * m_packetSize) && m_job->isSuspended())
{
kdDebug( 400 ) << "STREAMING: resume job" << endl;
m_job->resume();
}
}
if (!m_firstBuffer) {
if(m_data.size() < (m_packetBuffer * m_packetSize * 2) ) {
kdDebug( 400 ) << "STREAMING: Buffering in progress... (Needed bytes before it starts to play: " << ((m_packetBuffer * m_packetSize * 2) - m_data.size()) << ")" << endl;
return;
} else {
m_firstBuffer = true;
m_streamPulled = true;
outdata.setPull(PACKET_COUNT, m_packetSize);
}
}
}
void KIOInputStream_impl::request_outdata(DataPacket<mcopbyte> *packet)
{
processQueue();
packet->size = std::min(m_packetSize, m_data.size());
kdDebug( 400 ) << "STREAMING: Filling one DataPacket with " << packet->size << " bytes of the stream!" << endl;
if (!m_finished) {
if( (unsigned)packet->size < m_packetSize || ! m_firstBuffer) {
m_firstBuffer = false;
packet->size = 0;
outdata.endPull();
}
}
if (packet->size > 0)
{
memcpy(packet->contents, m_data.data(), packet->size);
memmove(m_data.data(), m_data.data() + packet->size, m_data.size() - packet->size);
m_data.resize(m_data.size() - packet->size);
}
packet->send();
}
REGISTER_IMPLEMENTATION(KIOInputStream_impl);

@ -0,0 +1,89 @@
/*
Copyright (C) 2001 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KIOINPUTSTREAM_IMPL
#define KIOINPUTSTREAM_IMPL
#include <qobject.h>
#include <qcstring.h>
#include <kio/jobclasses.h>
#include <kurl.h>
#include "artskde.h"
#include "stdsynthmodule.h"
namespace Arts {
class KIOInputStream_impl : public QObject, virtual public KIOInputStream_skel,
virtual public InputStream_skel,
virtual public StdSynthModule
{
Q_OBJECT
public:
KIOInputStream_impl();
~KIOInputStream_impl();
void streamStart();
void streamEnd();
bool eof();
bool seekOk();
long size();
long seek(long);
bool openURL(const std::string& url);
void processQueue();
void request_outdata(DataPacket<mcopbyte> *packet);
long bufferPackets() { return m_packetBuffer; }
void bufferPackets(long i) { m_packetBuffer = i; }
long packetSize() { return m_packetSize; }
signals:
void mimeTypeFound(const QString & mimetype);
private slots:
void slotData(KIO::Job *, const QByteArray &);
void slotResult(KIO::Job *);
void slotScanMimeType(KIO::Job *, const QString &mimetype);
void slotTotalSize(KIO::Job *, KIO::filesize_t size);
private:
KURL m_url;
KIO::TransferJob *m_job;
QByteArray m_data;
bool m_finished;
bool m_firstBuffer;
bool m_streamStarted;
bool m_streamSuspended;
bool m_streamPulled;
unsigned int m_packetBuffer;
const unsigned int m_packetSize;
KIO::filesize_t m_size;
static const unsigned int PACKET_COUNT;
};
}
#endif

@ -0,0 +1,54 @@
#include <stdio.h>
#include <kmedia2.h>
#include <kcmdlineargs.h>
#include <connect.h>
#include <klocale.h>
#include <kapplication.h>
#include <kaboutdata.h>
#include "qiomanager.h"
#include "artskde.h"
using namespace std;
using namespace Arts;
static KCmdLineOptions options[] =
{
{ "+[URL]", I18N_NOOP("URL to open"), 0 },
KCmdLineLastOption
};
int main(int argc, char **argv)
{
KAboutData aboutData( "kiotest", I18N_NOOP("KIOTest"), I18N_NOOP("0.1"), "", KAboutData::License_GPL, "");
KCmdLineArgs::init(argc,argv,&aboutData);
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;
QIOManager qiomanager;
Dispatcher dispatcher(&qiomanager);
KIOInputStream stream;
StdoutWriter writer;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if(args->count())
{
if(!stream.openURL(args->arg(0)))
{
printf("can't open url");
exit(1);
}
}
else
exit(1);
args->clear();
connect(stream, writer);
writer.start();
stream.start();
app.exec();
}

@ -0,0 +1,131 @@
#include <stdio.h>
#include <kmedia2.h>
#include <kcmdlineargs.h>
#include <connect.h>
#include <klocale.h>
#include <kapplication.h>
#include <kaboutdata.h>
#include <stdsynthmodule.h>
#include "qiomanager.h"
#include "artskde.h"
using namespace std;
using namespace Arts;
namespace Arts {
/* simulate slow receiver */
class KIOTestSlow_impl : public KIOTestSlow_skel,
public TimeNotify,
public StdSynthModule
{
int pos;
list< DataPacket<mcopbyte>* > q;
InputStream _inputStream;
public:
InputStream inputStream() { return _inputStream; }
void inputStream(InputStream i) { _inputStream = i; }
KIOTestSlow_impl()
{
Dispatcher::the()->ioManager()->addTimer(10, this);
pos = 0;
}
void notifyTime()
{
if(!_inputStream.isNull() && _inputStream.eof())
{
printf("\n[*EOF*] remaining = %d packets\n");
_inputStream = InputStream::null();
return;
}
int TODO = 100;
do {
if(q.empty())
return;
DataPacket<mcopbyte> *p = q.front();
char ch = p->contents[pos++];
if(p->size == pos)
{
p->processed();
q.pop_front();
pos = 0;
}
if(ch == '\n')
{
long size = 0;
list<DataPacket<mcopbyte>*>::iterator i;
for(i = q.begin(); i != q.end(); i++)
size += (*i)->size;
printf("\n[queued %8ld] ",size-pos);
}
else
putchar(ch);
} while(TODO-- > 0);
}
void process_data(DataPacket<mcopbyte> *p)
{
if(p->size == 0)
p->processed();
else
q.push_back(p);
}
};
REGISTER_IMPLEMENTATION(KIOTestSlow_impl);
};
static KCmdLineOptions options[] =
{
{ "+[URL]", I18N_NOOP("URL to open"), 0 },
KCmdLineLastOption
};
#undef USE_FILEINPUTSTREAM
int main(int argc, char **argv)
{
KAboutData aboutData( "kiotestslow", I18N_NOOP("KIOTest"), I18N_NOOP("0.1"), "", KAboutData::License_GPL, "");
KCmdLineArgs::init(argc,argv,&aboutData);
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;
QIOManager qiomanager;
Dispatcher dispatcher(&qiomanager);
#ifndef USE_FILEINPUTSTREAM
KIOInputStream stream;
#else
FileInputStream stream;
#endif
KIOTestSlow writer;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if(args->count())
{
#ifdef USE_FILEINPUTSTREAM
if(!stream.open(args->arg(0)))
#else
if(!stream.openURL(args->arg(0)))
#endif
{
printf("can't open url");
exit(1);
}
}
else
exit(1);
args->clear();
writer.inputStream(stream);
connect(stream, writer);
writer.start();
stream.start();
app.exec();
}

@ -0,0 +1,303 @@
/*
Copyright (C) 2001 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kplayobject.h"
#include "kplayobject.moc"
#include "kplayobjectcreator.h"
#include <kdebug.h>
KPlayObject::KPlayObject() : QObject()
{
m_playObject = Arts::PlayObject::null();
m_isStream = false;
}
KPlayObject::KPlayObject(Arts::PlayObject playobject, bool isStream) : QObject()
{
m_playObject = playobject;
m_isStream = isStream;
}
KPlayObject::~KPlayObject()
{
}
void KPlayObject::play()
{
object().play();
}
void KPlayObject::seek(Arts::poTime newTime)
{
if(!m_isStream)
object().seek(newTime);
else
kdDebug( 400 ) << "Seeking in a Stream? huh?" << endl;
}
void KPlayObject::pause()
{
object().pause();
}
void KPlayObject::halt()
{
object().halt();
}
QString KPlayObject::description()
{
return QString::fromLatin1(object().description().c_str());
}
Arts::poTime KPlayObject::currentTime()
{
return object().currentTime();
}
Arts::poTime KPlayObject::overallTime()
{
return object().overallTime();
}
Arts::poCapabilities KPlayObject::capabilities()
{
return object().capabilities();
}
QString KPlayObject::mediaName()
{
return QString::fromLatin1(object().mediaName().c_str());
}
Arts::poState KPlayObject::state()
{
return object().state();
}
Arts::PlayObject KPlayObject::object()
{
return m_playObject;
}
bool KPlayObject::isNull()
{
if( !this )
return true;
return object().isNull();
}
void KPlayObject::setObject(Arts::PlayObject playObject)
{
m_playObject = playObject;
}
bool KPlayObject::stream()
{
return m_isStream;
}
struct KDE::PlayObject::PrivateData
{
PrivateData() : creator( 0 ),
isProxy( false ),
internalState( Arts::posIdle ) {}
~PrivateData() {
delete creator;
}
Arts::SoundServerV2 server;
KDE::PlayObjectCreator* creator;
bool createBUS;
bool isProxy;
Arts::poState internalState;
KURL url;
};
KDE::PlayObject::PlayObject() : QObject()
{
m_playObject = Arts::PlayObject::null();
m_isStream = false;
d = new PrivateData;
}
KDE::PlayObject::PlayObject(Arts::PlayObject playobject, bool isStream) : QObject()
{
m_playObject = playobject;
m_isStream = isStream;
d = new PrivateData;
//very funny! you can't connect to signals before creating
//the object - so nobody will ever receive this signal (mkretz)
//
//emit playObjectCreated();
}
KDE::PlayObject::PlayObject( Arts::SoundServerV2 server, const KURL& url, bool isStream, bool createBUS ) : QObject()
{
kdDebug( 400 ) << "KDE::PlayObject: created as proxy for URL " << url.url()<< endl;
m_playObject = Arts::PlayObject::null();
m_isStream = isStream;
d = new PrivateData;
d->server = server;
d->url = url;
d->createBUS = createBUS;
d->isProxy = true;
}
KDE::PlayObject::~PlayObject()
{
kdDebug( 400 ) << "KDE::PlayObject: destroyed" << endl;
delete d;
}
void KDE::PlayObject::play()
{
kdDebug( 400 ) << "KDE::PlayObject::play()" << endl;
if ( object().isNull() ) {
if ( m_isStream ) {
if ( d->creator )
delete d->creator;
d->creator = new KDE::PlayObjectCreator( d->server );
d->creator->create( d->url, d->createBUS, this, SLOT( attachPlayObject( Arts::PlayObject ) ) );
kdDebug( 400 ) << "KDE::PlayObject::play(): creator called" << endl;
d->internalState = Arts::posPlaying;
}
return;
}
object().play();
}
void KDE::PlayObject::attachPlayObject( Arts::PlayObject playObject )
{
kdDebug( 400 ) << "KDE::PlayObject::attachPlayObject()" << endl;
m_playObject = playObject;
emit playObjectCreated();
if ( object().isNull() )
return;
switch ( d->internalState ) {
case Arts::posIdle:
object().halt();
break;
case Arts::posPaused:
object().pause();
break;
case Arts::posPlaying:
object().play ();
break;
}
}
void KDE::PlayObject::seek(Arts::poTime newTime)
{
if ( object().isNull() )
return;
if(!m_isStream)
object().seek(newTime);
else
kdDebug( 400 ) << "Seeking in a Stream? huh?" << endl;
}
void KDE::PlayObject::pause()
{
if ( !object().isNull() )
object().pause();
d->internalState = Arts::posPaused;
}
void KDE::PlayObject::halt()
{
kdDebug( 400 ) << "KDE::PlayObject::halt()" << endl;
if ( !object().isNull() )
object().halt();
else if ( d->creator ) {
delete d->creator;
d->creator = 0;
kdDebug( 400 ) << "KDE::PlayObject::halt(): creator destroyed" << endl;
}
d->internalState = Arts::posIdle;
}
QString KDE::PlayObject::description()
{
if ( object().isNull() )
return QString();
return QString::fromLatin1(object().description().c_str());
}
Arts::poTime KDE::PlayObject::currentTime()
{
if ( object().isNull() )
return Arts::poTime( 0, 0, -1, "" );
return object().currentTime();
}
Arts::poTime KDE::PlayObject::overallTime()
{
if ( object().isNull() )
return Arts::poTime( 0, 0, -1, "" );
return object().overallTime();
}
Arts::poCapabilities KDE::PlayObject::capabilities()
{
if ( object().isNull() )
return static_cast<Arts::poCapabilities>( 0 );
return object().capabilities();
}
QString KDE::PlayObject::mediaName()
{
if ( object().isNull() )
return QString();
return QString::fromLatin1(object().mediaName().c_str());
}
Arts::poState KDE::PlayObject::state()
{
if ( object().isNull() )
return d->internalState;
return object().state();
}
Arts::PlayObject KDE::PlayObject::object()
{
return m_playObject;
}
bool KDE::PlayObject::isNull()
{
if ( !this )
return true;
if ( d->isProxy )
return false;
return object().isNull();
}
bool KDE::PlayObject::stream()
{
return m_isStream;
}
// vim: sw=4 ts=4 noet

@ -0,0 +1,306 @@
/*
Copyright (C) 2001 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KPLAYOBJECT_H
#define KPLAYOBJECT_H
#include "kmedia2.h"
#include "soundserver.h"
#include <kurl.h>
#include <qobject.h>
class KDE_EXPORT KPlayObject : public QObject
{
Q_OBJECT
public:
KPlayObject();
KPlayObject(Arts::PlayObject playobject, bool isStream);
~KPlayObject();
/**
* Sets the internal Arts::PlayObject
* to @a playObject
*/
void setObject(Arts::PlayObject playObject);
/**
* Returns the internal Arts::PlayObject
*/
Arts::PlayObject object();
/**
* return true if both this != 0, and object.isNull()
*
* in essence, ((KPlayObject*)0)->isNull() will not
* crash
**/
bool isNull();
/**
* returns true if the internally playobject
* is used to play a stream
*/
bool stream();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
void play();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
void seek(Arts::poTime newTime);
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
void pause();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
void halt();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
QString description();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
Arts::poTime currentTime();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
Arts::poTime overallTime();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
Arts::poCapabilities capabilities();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
QString mediaName();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
Arts::poState state();
private:
Arts::PlayObject m_playObject;
bool m_isStream;
};
namespace KDE {
class PlayObjectFactory;
/**
* This class acts as a general interface to the KDE multimedia framework.
* You basically point the Playobject to an URL and say "play", and it will
* automatically decode and play and / or display the file or stream.
* For non-local media, it will make extensive use of KIOInputStream to
* directly play the content from the remote location without having to
* download it to a temporary local file first.
*
* A KDE::PlayObject is never created directly with new, but only through
* a KDE::PlayObjectFactory.
*
* Basically, it is used like this:
* \code
* KArtsDispatcher dispatcher;
* KArtsServer server;
* KDE::PlayObjectFactory factory( server.server() );
* KDE::PlayObject* playobj = factory.createPlayObject( someURL, true );
* playobj->play();
* \endcode
*
* Internally, the KDE::PlayObject acts as a wrapper for an Arts::PlayObject.
*
* Special care needs to be taken for non-local media. In general, you
* cannot safely figure out the mimetype of the remote media content, by
* looking at the URL alone. You need to download some data to analyze
* the content. Since KDE::PlayObject is only a wrapper for an
* Arts::PlayObject, and an Arts::PlayObject needs to know the mimetype
* of the data it plays in order to pick the correct decoder, one cannot
* directly create an Arts::PlayObject and attach it to a stream. Therefore,
* the following approach is used.
*
* Whenever a the factory creates a KDE::PlayObject for a non-local content,
* it first generates a so called "Proxy" Playobject. This is a
* KDE::PlayObject that does not contain a real Arts::PlayObject yet.
* As soon as you invoke the play() method, a connection to the media
* source is made, and as soon as the mimetype is known, the appropriate
* Arts::PlayObject is created.
*
* This has some side effects that developers need to be aware of:
* Until the real Arts::PlayObject got created,
* - the capabilities() method returns "zero" capabilities,
* - description() and mediaName() will return a null QString,
* - currentTime() and overallTime() will return "zero",
* - despite the fact that isNull() returns "false", object().isNull()
* will return "true". If you need to directly access methods of the
* internal Arts::PlayObject, be sure to use object().isNull() to guard
* your access.
*
* A KDE::PlayObject will emit the signal playObjectCreated()
* as soon as the real internal Arts::PlayObject got created. This is also
* true for local media files. So you can generally connect to this signal
* and act on it if your application needs to know about the real capabilities
* of the Arts::PlayObject.
*
* However, KDE::PlayObject will try to act reasonable on calls to play(),
* halt(), pause() and state(). If you call play() and then pause()
* before the connection to the media source was established, it will
* not start playing once the connection got established. Calling halt()
* will cancel the connection process. KDE::PlayObject will maintain
* an internal state variable, and calling state() will return this
* internal state until the real Arts::PlayObject got created, afterwards
* the state of the Arts::PlayObject will be returned.
*/
class KDE_EXPORT PlayObject : public QObject
{
Q_OBJECT
public:
~PlayObject();
/**
* Returns the internal Arts::PlayObject
*/
Arts::PlayObject object();
/**
* return true if this != 0.
*
* in essence, ((KDE::PlayObject*)0)->isNull() will not
* crash
**/
bool isNull();
/**
* returns "true" if the content to play is delivered as a stream.
*/
bool stream();
/**
* causes the PlayObject to start the play back.
*/
void play();
/**
* causes the PlayObject to skip to the time @p newTime.
* You don't need to stop or restart the play back after calling seek.
*/
void seek(Arts::poTime newTime);
/**
* causes the PlayObject to pause play back immediately. It will not
* restart until you call play(). This also works on streams, the
* connection to the media source will be maintained while the
* PlayObject is paused.
*/
void pause();
/**
* immediately stops the play back and resets the media to the
* start of the content. If playing from a stream, halt() causes
* the connection to be canceled.
*/
void halt();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
QString description();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
Arts::poTime currentTime();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
Arts::poTime overallTime();
/**
* returns the capabilities of the PlayObject. The return value is
* a binary OR of Arts::capSeek and Arts::capPause, or 0.
*/
Arts::poCapabilities capabilities();
/**
* Reimplemented (Arts::PlayObject Wrapper)
*/
QString mediaName();
/**
* returns the internal state of the PlayObject. The state can be
* either Arts::posIdle, Arts::posPaused or Arts::posPlaying. A
* PlayObject in state Arts::posIdle is stopped. Once you call
* play(), the state changes to Arts::posPlaying. pause() causes
* the PlayObject to change to Arts::posPaused.
*/
Arts::poState state();
signals:
/**
* this signal is emitted as soon as the internal Arts::PlayObject
* is created and ready to play. It is granted that the Arts::PlayObject
* has not started playing, but KDE::PlayObject will call
* object().play() immediately after emitting this signal, so you
* need not do it yourself.
*/
void playObjectCreated();
private slots:
void attachPlayObject( Arts::PlayObject );
private:
Arts::PlayObject m_playObject;
bool m_isStream;
struct PrivateData;
PrivateData* d;
/* private constructors, to prevent instantiation and copying */
PlayObject();
PlayObject( const PlayObject& ) : QObject() {};
PlayObject(Arts::PlayObject playobject, bool isStream);
PlayObject( Arts::SoundServerV2 server, const KURL& url, bool isStream, bool createBUS );
friend class KDE::PlayObjectFactory;
};
}
#endif

@ -0,0 +1,104 @@
/*
Copyright (C) 2002 Matthias Welwarsky <mwelwarsky@web.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include <kio/kmimetype.h>
#include "artskde.h"
#include "kplayobjectcreator.h"
#include "kplayobjectcreator.moc"
#include "kioinputstream_impl.h"
#include <qfile.h>
#include <kdebug.h>
KDE::PlayObjectCreator::PlayObjectCreator(Arts::SoundServerV2 server)
{
m_server = server;
}
KDE::PlayObjectCreator::~PlayObjectCreator()
{
}
bool KDE::PlayObjectCreator::create(const KURL& url, bool createBUS, const QObject* receiver, const char* slot)
{
// no need to go any further, and I hate deep indentation
if (m_server.isNull() || url.isEmpty() )
return false;
connect( this, SIGNAL( playObjectCreated( Arts::PlayObject ) ),
receiver, slot );
// check if the URL is a local file
if (!url.isLocalFile())
{
m_createBUS = createBUS;
// This is the RightWay(tm) according to stw
Arts::KIOInputStream_impl* instream_impl = new Arts::KIOInputStream_impl();
m_instream = Arts::KIOInputStream::_from_base(instream_impl);
// signal will be called once the ioslave knows the mime-type of the stream
connect(instream_impl, SIGNAL(mimeTypeFound(const QString &)),
this, SLOT(slotMimeType(const QString &)));
// GO!
m_instream.openURL(url.url().latin1());
m_instream.streamStart();
return true;
}
kdDebug( 400 ) << "stream is local file: " << url.url() << endl;
// usual stuff if we have a local file
KMimeType::Ptr mimetype = KMimeType::findByURL(url);
emit playObjectCreated (
m_server.createPlayObjectForURL(std::string(QFile::encodeName(url.path())),
std::string(mimetype->name().latin1()),
createBUS)
);
return true;
}
void KDE::PlayObjectCreator::slotMimeType(const QString& mimetype)
{
kdDebug( 400 ) << "slotMimeType called: " << mimetype << endl;
QString mimetype_copy = mimetype;
if ( mimetype_copy == "application/octet-stream" )
mimetype_copy = QString("audio/x-mp3");
if (mimetype_copy == "application/x-zerosize")
emit playObjectCreated(Arts::PlayObject::null());
playObject = m_server.createPlayObjectForStream(
m_instream,
std::string( mimetype_copy.latin1() ),
m_createBUS );
if ( playObject.isNull() ) {
m_instream.streamEnd();
emit playObjectCreated( Arts::PlayObject::null() );
return;
}
emit playObjectCreated( playObject );
}

@ -0,0 +1,56 @@
/*
Copyright (C) 2002 Matthias Welwarsky <mwelwarsky@web.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KPLAYOBJECTCREATOR_H
#define KPLAYOBJECTCREATOR_H
#include <kurl.h>
#include <qobject.h>
#include "soundserver.h"
#include "kioinputstream_impl.h"
namespace KDE {
class PlayObjectCreator : public QObject
{
Q_OBJECT
public:
PlayObjectCreator(Arts::SoundServerV2 server);
~PlayObjectCreator();
bool create(const KURL& url, bool createBUS, const QObject* receiver, const char* slot);
signals:
void playObjectCreated(Arts::PlayObject playObject);
private slots:
void slotMimeType(const QString &mimetype);
private:
Arts::SoundServerV2 m_server;
Arts::KIOInputStream m_instream;
Arts::PlayObject playObject;
bool m_createBUS;
};
}
#endif

@ -0,0 +1,258 @@
/*
Copyright (C) 2001 Nikolas Zimmermann <wildfox@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include <kio/kmimetype.h>
#include "kplayobject.h"
#include "artskde.h"
#include "kplayobjectfactory.h"
#include "kplayobjectfactory_p.h"
#include "kplayobjectcreator.h"
#include "kioinputstream_impl.h"
#include "kartsdispatcher.h"
#include "kartsserver.h"
#include <qfile.h>
#include <kdebug.h>
#include "kaudiomanagerplay.h"
#include <flowsystem.h>
#include <kio/netaccess.h>
using namespace std;
KPlayObjectFactory::KPlayObjectFactory(Arts::SoundServerV2 server)
{
m_server = server;
m_allowStreaming = true;
m_stream = false;
}
KPlayObjectFactory::KPlayObjectFactory(KArtsServer* server)
{
m_server = server->server();
m_allowStreaming = true;
m_stream = false;
}
KPlayObjectFactory::~KPlayObjectFactory()
{
}
KPlayObject *KPlayObjectFactory::createPlayObject(const KURL& url, bool createBUS)
{
KMimeType::Ptr mimetype = KMimeType::findByURL(url);
return createPlayObject(url, mimetype->name(), createBUS);
}
KPlayObject *KPlayObjectFactory::createPlayObject(const KURL& _url, const QString &mimetype, bool createBUS)
{
// WHY DOES BROKEN KIO_MEDIA GIVE WRONG URLS?
// I hate it
// I hate it
// It sucks
// kio_media please die
KURL url = KIO::NetAccess::mostLocalURL(_url, 0);
if(!m_server.isNull())
{
if(mimetype == "application/octet-stream" && m_allowStreaming)
{
Arts::KIOInputStream instream;
instream.openURL(url.url().latin1());
m_stream = true;
// TODO: what else than hardcoding audio/x-mp3 ?
return new KPlayObject(m_server.createPlayObjectForStream(instream, string("audio/x-mp3"), createBUS), true);
}
else
return new KPlayObject(m_server.createPlayObjectForURL(string(QFile::encodeName(url.path())), string(mimetype.latin1()), createBUS), false);
}
else
return new KPlayObject();
}
//
KDE::PlayObjectFactory::PlayObjectFactory(Arts::SoundServerV2 server)
{
d = new PrivateData;
d->server = server;
d->amanPlay = 0;
d->helper = 0;
d->allowStreaming = true;
d->isStream = false;
}
KDE::PlayObjectFactory::PlayObjectFactory(KArtsServer* server)
{
d = new PrivateData;
d->server = server->server();
d->amanPlay = 0;
d->helper = 0;
d->allowStreaming = true;
d->isStream = false;
}
KDE::PlayObjectFactory::~PlayObjectFactory()
{
delete d->helper;
delete d;
}
void KDE::PlayObjectFactory::setAudioManagerPlay( KAudioManagerPlay * amanPlay )
{
d->amanPlay = amanPlay;
if( ! d->helper )
d->helper = new POFHelper;
}
KDE::PlayObject *KDE::PlayObjectFactory::createPlayObject(const KURL& url, bool createBUS)
{
KMimeType::Ptr mimetype = KMimeType::findByURL(url);
return createPlayObject(url, mimetype->name(), createBUS);
}
KDE::PlayObject *KDE::PlayObjectFactory::createPlayObject(const KURL& _url, const QString &mimetype, bool createBUS)
{
// WHY DOES BROKEN KIO_MEDIA GIVE WRONG URLS?
// I hate it
// I hate it
// It sucks
// kio_media please die