Browse Source

Initial code import from debian snapshot

https://snapshot.debian.org/package/codeine/1.0.1-3.dfsg-3.1/

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/1/head
Michele Calgaro 3 months ago
commit
5f44f7b187
Signed by: MicheleC GPG Key ID: 2A75B7CA8ADED5CF
78 changed files with 9005 additions and 0 deletions
  1. +340
    -0
      COPYING
  2. +52
    -0
      ChangeLog
  3. +17
    -0
      PKGBUILD
  4. +48
    -0
      README
  5. +168
    -0
      SConstruct
  6. +1
    -0
      VERSION
  7. +87
    -0
      configure
  8. +9
    -0
      misc/codeine.desktop
  9. +10
    -0
      misc/codeine_part.desktop
  10. +39
    -0
      misc/codeine_play_dvd.desktop
  11. +10
    -0
      misc/codeinerc
  12. +33
    -0
      misc/codeineui.rc
  13. BIN
      misc/cr128-app-codeine.png
  14. BIN
      misc/cr16-app-codeine.png
  15. BIN
      misc/cr22-app-codeine.png
  16. BIN
      misc/cr32-app-codeine.png
  17. BIN
      misc/cr48-app-codeine.png
  18. BIN
      misc/cr64-app-codeine.png
  19. +484
    -0
      po/codeine.pot
  20. +60
    -0
      po/messages.sh
  21. +101
    -0
      scons/codeine.py
  22. +95
    -0
      scons/generic.py
  23. +771
    -0
      scons/kde.py
  24. BIN
      scons/scons-mini.tar.bz2
  25. +13
    -0
      src/FAQ
  26. +21
    -0
      src/SConscript
  27. +38
    -0
      src/TODO
  28. +59
    -0
      src/app/SConscript
  29. +27
    -0
      src/app/actions.cpp
  30. +26
    -0
      src/app/actions.h
  31. +125
    -0
      src/app/adjustSizeButton.cpp
  32. +37
    -0
      src/app/adjustSizeButton.h
  33. +131
    -0
      src/app/analyzer.cpp
  34. +75
    -0
      src/app/analyzer.h
  35. +296
    -0
      src/app/captureFrame.cpp
  36. +20
    -0
      src/app/config.h
  37. +28
    -0
      src/app/extern.h
  38. +262
    -0
      src/app/fht.cpp
  39. +126
    -0
      src/app/fht.h
  40. +96
    -0
      src/app/fullScreenAction.cpp
  41. +27
    -0
      src/app/fullScreenAction.h
  42. +24
    -0
      src/app/insertAspectRatioMenuItems.cpp
  43. +39
    -0
      src/app/listView.cpp
  44. +52
    -0
      src/app/main.cpp
  45. +714
    -0
      src/app/mainWindow.cpp
  46. +75
    -0
      src/app/mainWindow.h
  47. +114
    -0
      src/app/playDialog.cpp
  48. +36
    -0
      src/app/playDialog.h
  49. +123
    -0
      src/app/playlistFile.cpp
  50. +36
    -0
      src/app/playlistFile.h
  51. +145
    -0
      src/app/slider.cpp
  52. +52
    -0
      src/app/slider.h
  53. +195
    -0
      src/app/stateChange.cpp
  54. +144
    -0
      src/app/theStream.cpp
  55. +50
    -0
      src/app/theStream.h
  56. +135
    -0
      src/app/videoSettings.cpp
  57. +26
    -0
      src/app/videoSettings.h
  58. +380
    -0
      src/app/videoWindow.cpp
  59. +114
    -0
      src/app/volumeAction.cpp
  60. +29
    -0
      src/app/volumeAction.h
  61. +321
    -0
      src/app/xineConfig.cpp
  62. +69
    -0
      src/app/xineConfig.h
  63. +876
    -0
      src/app/xineEngine.cpp
  64. +159
    -0
      src/app/xineEngine.h
  65. +148
    -0
      src/app/xineScope.c
  66. +38
    -0
      src/app/xineScope.h
  67. +43
    -0
      src/codeine.h
  68. +263
    -0
      src/debug.h
  69. +19
    -0
      src/mxcl.library.cpp
  70. +28
    -0
      src/mxcl.library.h
  71. +12
    -0
      src/part/SConscript
  72. +83
    -0
      src/part/part.cpp
  73. +38
    -0
      src/part/part.h
  74. +44
    -0
      src/part/toolbar.cpp
  75. +18
    -0
      src/part/toolbar.h
  76. +192
    -0
      src/part/videoWindow.cpp
  77. +94
    -0
      src/part/videoWindow.h
  78. +345
    -0
      src/part/xineEngine.cpp

+ 340
- 0
COPYING View File

@@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Preamble

The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.

When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.

We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.

b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.

c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,

b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,

c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.

9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

END OF TERMS AND CONDITIONS
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) <year> <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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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) year 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.

+ 52
- 0
ChangeLog View File

@@ -0,0 +1,52 @@
1.0.1
Mute button for KPart
Play DVD entry for KDE 3.5 + media:/ when DVD inserted
DVD-Menu-Toggle is no longer a KToggleAction because I can't detect when DVD menus change, but it still acts as a toggle button
Made record work for systems other than mine! (hard-coded path)
Made record shortcut CTRL-R so it doesn't conflict with the DVD-Root-Menu toggle
videoWindow doesn't judder when toolbar appears in fullscreen anymore
dvd-toolbar is gone, instead root menu button appears when dvd is playing
toolbar in fullscreen mode shows on mouse move
toolbar in fullscreen mode respects user-positioning
media kioslave support
double-clicking the video toggles fullscreen
don't show part in K-Menu
a volume toolbar button, - available from the configure-toolbar dialog, it's not very good yet
1.0-rc2
Seek fixes
Improved error messages
KPart crash on exit fix
1.0-beta6
Frame capture function
Aspect Ratio setting
Snap for videoSettings dialog sliders
Polish to all dialogs, menus
Hide cursor in fullscreen mode bug fixed
Many other fixes and lots of polish
1.0-beta3
Made Codeine single-window
Removed Pause KAction, instead toggling play pauses
Made it remember all details about how you like to view videos (eg.
contrast, brightness, size)
Shows toolbar when mouse is a screen-top in fullscreen mode
Bug fixes
1.0-beta2
Fixed fullscreen not covering Kicker
Added stop KAction
Added "You must install!" message after make does linking
Set busy cursor during unresponsive init period
Made the GUI detect lack of a ui file and show a useful message
If you quit during playback, the track volume fades out
Various feel/feedback fixes
Recent-files list in initial definately doesn't have duplicates anymore, sort order is also corrected
Routed out some nasty freeze bugs
Automatic frame format change handling
Stream recording
Many little bug-fixes and improvements
1.0-beta1
Initial release

+ 17
- 0
PKGBUILD View File

@@ -0,0 +1,17 @@
pkgname=codeine
pkgver=1.0.1
pkgrel=1
pkgdesc="A simple xine-based video player"
url="http://www.methylblue.com/codeine/"

build() {
echo -e "\033[0;34m==>\033[0;0;1m Configure \033[0;0m"
cd "$startdir"
./configure prefix=/opt/kde

echo -e "\033[0;34m==>\033[0;0;1m Make \033[0;0m"
make || return 1

echo -e "\033[0;34m==>\033[0;0;1m Install \033[0;0m"
DESTDIR="$startdir/pkg" make install
}

+ 48
- 0
README View File

@@ -0,0 +1,48 @@
INTRODUCTION
Codeine is a very simple xine-based media player.

I make the following promises:

* I will not add any substantial features after version 1.0.0
* After then, improvements will only be in the realm of usability and bug
fixes

You can rely on Codeine for now and until xine is obsolete to be a simple
no-frills video(/media) player.

Visit #codeine on freenode.net!

Max Howell


REQUIREMENTS
You will need at least:

* Qt 3.3.0 (Qt 3.2.x may work, it is just not tested)
* KDElibs 3.3.0
* xine-lib 1.0.0-rc4

You also need python installed in order to build Codeine.


INSTALLATION
I use scons + bksys as the build system. But you can still do the following:

% ./configure && make && su -c "make install"

Or if you have scons installed, simply:

% scons && su -c "scons install"

Note that scons is a little silly and this kind of thing doesn't work:

% ./configure --prefix=/foo/bar --debug=full

Instead do:

% ./configure prefix=/foo/bar debug=full


TRANSLATIONS
I will make the po file available for translation at the 1.0-rc1 stage, if
you want to make a translation I thank you in advance :-)

+ 168
- 0
SConstruct View File

@@ -0,0 +1,168 @@
#!/usr/bin/python

###########################################
## Common section, for loading the tools

## Load the builders in config
env = Environment(TARGS=COMMAND_LINE_TARGETS, ARGS=ARGUMENTS, tools=['default', 'generic', 'kde', 'codeine'], toolpath=['./scons/'])


## the configuration should be done by now, quit
if 'configure' in COMMAND_LINE_TARGETS:
env.Exit(0)



"""
Overview of the module system :

Each module (kde.py, generic.py, sound.py..) tries to load a stored
configuration when run. If the stored configuration does not exist
or if 'configure' is given on the command line (scons configure),
the module launches the verifications and detectioins and stores
the results. Modules also call exit when the detection fail.

For example, kde.py stores its config into kde.cache.py

This has several advantages for both developers and users :
- Users do not have to run ./configure to compile
- The build is insensitive to environment changes
- The cache maintains the objects so the config can be changed often
- Each module adds its own help via env.Help("message")
"""

## Use the variables available in the environment - unsafe, but moc, meinproc need it :-/
import os
env.AppendUnique( ENV = os.environ )
## If you do not want to copy the whole environment, you can use this instead (HOME is necessary for uic):
#env.AppendUnique( ENV = {'PATH' : os.environ['PATH'], 'HOME' : os.environ['HOME']} )

## The target make dist requires the python module shutil which is in 2.3
env.EnsurePythonVersion(2, 3)

## Bksys requires scons 0.96
env.EnsureSConsVersion(0, 96)

"""
Explanation of the 'env = Environment...' line :
* the command line arguments and targets are stored in env['TARGS'] and env['ARGS'] for use by the tools
* the part 'tools=['default', 'generic ..' detect and load the necessary functions for doing the things
* the part "toolpath=['./']" tells that the tools can be found in the current directory (generic.py, kde.py ..)
"""

"""
To load more configuration modules one should only have to add the appropriate tool
ie: to detect alsa and add the proper cflags, ldflags ..
a file alsa.py file will be needed, and one should then use :
env = Environment(TARGS=COMMAND_LINE_TARGETS, ARGS=ARGUMENTS, tools=['default', 'generic', 'kde', 'alsa'], toolpath=['./'])

You can also load environments that are targetted to different platforms
ie: if os.sys.platform = "darwin":
env = Environment(...
elsif os.sys.platform = "linux":
env = Environment(...

"""

## Setup the cache directory - this avoids recompiling the same files over and over again
## this is very handy when working with cvs
env.CacheDir('cache')
env.SConsignFile('scons/signatures')

## If you need more libs and they rely on pkg-config
## ie: add support for GTK (source: the scons wiki on www.scons.org)
# env.ParseConfig('pkg-config --cflags --libs gtk+-2.0')

"""
This tell scons that there are no rcs or sccs files - this trick
can speed up things a bit when having lots of #include
in the source code and for network file systems
"""
env.SourceCode(".", None)
dirs = [ '.', 'src', 'src/part', 'src/app' ]
for dir in dirs:
env.SourceCode(dir, None)

## If we had only one program (named kvigor) to build,
## we could add before exporting the env (some kde
## helpers in kde.py need it) :
# env['APPNAME'] = 'kvigor'

## Use this define if you are using the kde translation scheme (.po files)
env.Append( CPPFLAGS = ['-DQT_NO_TRANSLATION'] )

## Uncomment the following if you need threading support threading
#env.Append( CPPFLAGS = ['-DQT_THREAD_SUPPORT', '-D_REENTRANT'] )
#if os.uname()[0] == "FreeBSD":
# env.Append(LINKFLAGS=["-pthread"])

## Important : export the environment so that SConscript files can the
## configuration and builders in it
Export("env")


def string_it(target, source, env):
print "Visit #codeine on irc.freenode.net!"
return 0

env.AddPostAction( "install", string_it )

env.SConscript( "src/SConscript", build_dir='build', duplicate=0 )


if 'dist' in COMMAND_LINE_TARGETS:

APPNAME = 'codeine'
VERSION = os.popen("cat VERSION").read().rstrip()
FOLDER = APPNAME+'-'+VERSION
ARCHIVE = FOLDER+'.tar.bz2'

GREEN ="\033[92m"
NORMAL ="\033[0m"

import shutil
import glob

## check if the temporary directory already exists
if os.path.isdir(FOLDER):
shutil.rmtree(FOLDER)

## create a temporary directory
startdir = os.getcwd()
# TODO copying the cache takes forever! delete it first
shutil.copytree(startdir, FOLDER)

## remove the unnecessary files
os.popen("find "+FOLDER+" -name \"{arch}\" | xargs rm -rf")
os.popen("find "+FOLDER+" -name \".arch-ids\" | xargs rm -rf")
os.popen("find "+FOLDER+" -name \".arch-inventory\" | xargs rm -f")
os.popen("find "+FOLDER+" -name \".scon*\" | xargs rm -rf")
os.popen("find "+FOLDER+" -name \"kdiss*-data\" | xargs rm -rf")
os.popen("find "+FOLDER+" -name \"*.pyc\" | xargs rm -f")
os.popen("find "+FOLDER+" -name \"*.cache.py\" | xargs rm -f")
os.popen("find "+FOLDER+" -name \"*.log\" | xargs rm -f")
os.popen("find "+FOLDER+" -name \"*.kdevelop.*\" | xargs rm -f")
os.popen("find "+FOLDER+" -name \"*~\" | xargs rm -f")

os.popen("rm -rf "+FOLDER+"/autopackage")
os.popen("rm -rf "+FOLDER+"/build")
os.popen("rm -rf "+FOLDER+"/cache")
os.popen("rm -f " +FOLDER+"/codeine-*.tar.bz2")
os.popen("rm -f " +FOLDER+"/config.py*")
os.popen("rm -f " +FOLDER+"/src/configure.h")
os.popen("rm -f " +FOLDER+"/Doxyfile")
os.popen("rm -f " +FOLDER+"/Makefile")
os.popen("rm -rf "+FOLDER+"/packages")
os.popen("rm -rf "+FOLDER+"/screenshots")
os.popen("rm -f " +FOLDER+"/scons/signatures.dblite")

## make the tarball
print GREEN+"Writing archive "+ARCHIVE+NORMAL
os.popen("tar cjf "+ARCHIVE+" "+FOLDER)

## remove the temporary directory
if os.path.isdir(FOLDER):
shutil.rmtree(FOLDER)

env.Default(None)
env.Exit(0)

+ 1
- 0
VERSION View File

@@ -0,0 +1 @@
1.0.1

+ 87
- 0
configure View File

@@ -0,0 +1,87 @@
#! /bin/sh
# TODO parse each passed argument and remove any "--" prefix

BOLD="\033[1m"
RED="\033[91m"
GREEN="\033[92m"
YELLOW="\033[93m"
CYAN="\033[96m"
NORMAL="\033[0m"

if command -v scons >/dev/null 2>&1;
then
SCONS=scons
else
if [ ! -e "scons/scons" ]; then
echo ""
echo -ne "Unpacking mini-scons..."$RED

pushd scons >/dev/null 2>&1
tar xjvf scons-mini.tar.bz2 > /dev/null 2>&1

if [[ "$?" == "0" ]]; then
echo -e $GREEN"done"$NORMAL
else
echo -e $RED"failed!"$NORMAL
exit 2
fi

popd > /dev/null
fi

SCONS=scons/scons
fi

if [[ "$1" == "--help" ]]; then
$SCONS -Q configure --help
exit
fi

echo ""
echo "Configuring Codeine "`cat VERSION`"..."
echo ""

#TODO remove all prefixed "--"

$SCONS -Q configure $@ || exit 1

echo ""
echo -e "Your configure completed "$GREEN"successfully"$NORMAL", now type "$BOLD"make"$NORMAL
echo ""

cat > Makefile << EOF
## Makefile automatically generated by unpack_local_scons.sh

SCONS=$SCONS

# scons : compile
# scons -c : clean
# scons install : install
# scons -c install : uninstall and clean

# default target : use scons to build the programs
all:
\$(SCONS) -Q

### There are several possibilities to help debugging :
# scons --debug=explain, scons --debug=tree ..
#
### To optimize the runtime, use
# scons --max-drift=1 --implicit-deps-unchanged
debug:
\$(SCONS) -Q --debug=tree

clean:
\$(SCONS) -c

install:
\$(SCONS) install

uninstall:
\$(SCONS) -c install

## this target creates a tarball of the project
dist:
\$(SCONS) dist
EOF


+ 9
- 0
misc/codeine.desktop View File

@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Codeine
Exec=codeine %u
Icon=codeine
Type=Application
Encoding=UTF-8
MimeType=video/x-theora;video/x-ogm;video/x-ms-wmv;video/x-msvideo;video/x-ms-asf;video/x-matroska;video/mpeg;video/avi;video/quicktime;video/vnd.rn-realvideo;video/x-flic;
Categories=Qt;KDE;AudioVideo;Player
GenericName=Video Player

+ 10
- 0
misc/codeine_part.desktop View File

@@ -0,0 +1,10 @@
[Desktop Entry]
Encoding=UTF-8
Icon=codeine
MimeType=video/x-theora;video/x-ogm;video/x-ms-wmv;video/x-msvideo;video/x-ms-asf;video/x-matroska;video/mpeg;video/avi;video/quicktime;video/vnd.rn-realvideo;video/x-flic;
Name=Codeine
Comment=Embeddable Video Player
ServiceTypes=KParts/ReadOnlyPart
Type=Service
X-KDE-Library=libcodeine
InitialPreference=9

+ 39
- 0
misc/codeine_play_dvd.desktop View File

@@ -0,0 +1,39 @@
[Desktop Entry]
ServiceTypes=media/dvdvideo
Actions=Play;
Encoding=UTF-8
X-KDE-Priority=TopLevel

[Desktop Action Play]
Name=Play DVD with Codeine
Name[bg]=Възпроизвеждане на DVD с Codeine
Name[bn]=ক্যাফিন দিয়ে ডিভিডি চালাও
Name[br]=Seniñ an DVD gant Codeine
Name[ca]=Reprodueix DVD amb Codeine
Name[cs]=Přehrát DVD v Codeine
Name[da]=Spil dvd med Codeine
Name[de]=DVD mit Codeine abspielen
Name[el]=Αναπαραγωγή DVD με το Codeine
Name[es]=Reproducir DVD con Codeine
Name[et]=Esita DVD Codeine'is
Name[fi]=Toista dvd-levy Codeinessa
Name[fr]=Lire le DVD avec Codeine
Name[ga]=Seinn DVD le Codeine
Name[he]=נגן תקליטור DVD עם Codeine
Name[it]=Riproduci DVD con Codeine
Name[ja]=CodeineでDVDを再生
Name[nb]=Spill DVD med Codeine
Name[nl]=DVD met Codeine afspelen
Name[nn]=Spel DVD med Codeine
Name[pa]=ਕੈਫੀਨ ਨਾਲ DVD ਚਲਾਓ
Name[pl]=Odtwarzaj DVD w Codeine
Name[pt]=Ver o DVD com o Codeine
Name[pt_BR]=Reproduzir o DVD com o Codeine
Name[sr]=Пусти DVD Codeine-ом
Name[sr@Latn]=Pusti DVD Codeine-om
Name[sv]=Spela dvd med Codeine
Name[tr]=DVD'yi Codeine ile oynat
Name[xx]=xxPlay DVD with Codeinexx
Name[zh_CN]=用 Codeine 播放 DVD
Icon=codeine
Exec=codeine --play-dvd %u

+ 10
- 0
misc/codeinerc View File

@@ -0,0 +1,10 @@
[KFileDialog Settings]
ShowPreviews=false

[MainWindow Toolbar dvdToolBar]
Hidden=true
IconText=IconTextRight
Index=0

[MainWindow Toolbar mainToolBar]
Index=1

+ 33
- 0
misc/codeineui.rc View File

@@ -0,0 +1,33 @@
<!DOCTYPE kpartgui>
<kpartgui name="codeine" version="4">
<MenuBar>
<Menu name="file" noMerge="1"><text>&amp;Play</text>
<Action name="play_media"/>
<Separator/>
<Action name="play"/>
<Action name="stop"/>
<Separator/>
<Action name="file_quit"/>
</Menu>
<Menu name="settings" noMerge="1"><text>&amp;Settings</text>
<Separator/><!-- this seperator doesn't show :( -->
<Action name="fullscreen"/>
<Separator/><!-- this seperator doesn't show :( -->
<Action name="options_configure_keybinding"/>
<Action name="options_configure_toolbars"/>
<Separator/>
<Action name="video_settings"/>
<Action name="xine_settings"/>
</Menu>
</MenuBar>

<ToolBar name="mainToolBar"><text>Main Toolbar</text>
<Action name="play"/>
<Separator lineSeparator="false"/>
<Action name="position_slider"/>
<Separator lineSeparator="false"/>
<Action name="toggle_dvd_menu"/>
<Action name="fullscreen"/>
</ToolBar>

</kpartgui>

BIN
misc/cr128-app-codeine.png View File

Before After
Width: 128  |  Height: 128  |  Size: 7.3 KiB

BIN
misc/cr16-app-codeine.png View File

Before After
Width: 16  |  Height: 16  |  Size: 870 B

BIN
misc/cr22-app-codeine.png View File

Before After
Width: 22  |  Height: 22  |  Size: 1.2 KiB

BIN
misc/cr32-app-codeine.png View File

Before After
Width: 32  |  Height: 32  |  Size: 1.7 KiB

BIN
misc/cr48-app-codeine.png View File

Before After
Width: 48  |  Height: 48  |  Size: 2.6 KiB

BIN
misc/cr64-app-codeine.png View File

Before After
Width: 64  |  Height: 64  |  Size: 3.5 KiB

+ 484
- 0
po/codeine.pot View File

@@ -0,0 +1,484 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2005-08-01 17:30+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: ../src/app/videoSettings.cpp:91
msgid "Video Settings"
msgstr ""

#: ../src/app/playDialog.cpp:27
msgid "Play Media"
msgstr ""

#: ../src/app/playDialog.cpp:33
msgid "What media would you like to play?"
msgstr ""

#: ../src/app/playDialog.cpp:38
msgid "Play File..."
msgstr ""

#: ../src/app/playDialog.cpp:42
msgid "Play VCD"
msgstr ""

#: ../src/app/playDialog.cpp:46
msgid "Play DVD"
msgstr ""

#: ../src/app/playDialog.cpp:73
msgid "Recently Played Media"
msgstr ""

#: ../src/app/xineConfig.cpp:60
msgid "Configure xine"
msgstr ""

#: ../src/app/xineConfig.cpp:84
msgid ""
"xine's defaults are usually sensible and should not require modification. "
"However, full configurability is provided for your pleasure ;-)."
msgstr ""

#: ../src/app/adjustSizeButton.cpp:31
msgid "Preferred Scale"
msgstr ""

#: ../src/app/adjustSizeButton.cpp:35
msgid "Scale 100%"
msgstr ""

#: ../src/app/adjustSizeButton.cpp:41
msgid "<b>Adjust video scale?"
msgstr ""

#: ../src/app/insertAspectRatioMenuItems.cpp:15
msgid "Determine &Automatically"
msgstr ""

#: ../src/app/insertAspectRatioMenuItems.cpp:17
msgid "&Square (1:1)"
msgstr ""

#: ../src/app/insertAspectRatioMenuItems.cpp:18
msgid "&4:3"
msgstr ""

#: ../src/app/insertAspectRatioMenuItems.cpp:19
msgid "Ana&morphic (16:9)"
msgstr ""

#: ../src/app/insertAspectRatioMenuItems.cpp:20
msgid "&DVB (2.11:1)"
msgstr ""

#: ../src/app/main.cpp:14
msgid "A video player that has a usability focus"
msgstr ""

#: ../src/app/main.cpp:15
msgid "Copyright 2005, Max Howell"
msgstr ""

#: ../src/app/main.cpp:19
msgid "Play 'URL'"
msgstr ""

#: ../src/app/main.cpp:28
msgid "Handbook"
msgstr ""

#: ../src/app/main.cpp:29
msgid "Great reference code"
msgstr ""

#: ../src/app/main.cpp:30
msgid "The current Codeine icon"
msgstr ""

#: ../src/app/main.cpp:31
msgid "The video for \"Call on Me\" encouraged plenty of debugging! ;)"
msgstr ""

#: ../src/app/playlistFile.cpp:32
msgid "The file is not a playlist"
msgstr ""

#: ../src/app/playlistFile.cpp:39
msgid "Codeine could not download the remote playlist: %1"
msgstr ""

#: ../src/app/playlistFile.cpp:54
msgid ""
"<qt>The playlist, <i>'%1'</i>, could not be interpreted. Perhaps it is empty?"
msgstr ""

#: ../src/app/playlistFile.cpp:58
msgid "Codeine could not open the file: %1"
msgstr ""

#: ../src/app/stateChange.cpp:83
msgid "&Pause"
msgstr ""

#: ../src/app/stateChange.cpp:83
msgid "&Play"
msgstr ""

#: ../src/app/stateChange.cpp:147
msgid "No media loaded"
msgstr ""

#: ../src/app/stateChange.cpp:150
msgid "Paused"
msgstr ""

#: ../src/app/actions.cpp:13 ../src/part/part.cpp:38
msgid "Play"
msgstr ""

#: ../src/app/xineEngine.cpp:127 ../src/part/xineEngine.cpp:50
msgid "xine was unable to initialize any video-drivers."
msgstr ""

#: ../src/app/xineEngine.cpp:129 ../src/part/xineEngine.cpp:48
msgid "xine was unable to initialize any audio-drivers."
msgstr ""

#: ../src/app/xineEngine.cpp:231
msgid "Loading media: %1"
msgstr ""

#: ../src/app/xineEngine.cpp:333
msgid "Recording to: %1"
msgstr ""

#: ../src/app/xineEngine.cpp:364
msgid "Playback paused"
msgstr ""

#: ../src/app/xineEngine.cpp:369
msgid "Playback resumed"
msgstr ""

#: ../src/app/xineEngine.cpp:382
msgid "There is no input plugin that can read: %1."
msgstr ""

#: ../src/app/xineEngine.cpp:385
msgid "There is no demux plugin available for %1."
msgstr ""

#: ../src/app/xineEngine.cpp:388
msgid "Demuxing failed for %1."
msgstr ""

#: ../src/app/xineEngine.cpp:393
msgid "Internal error while attempting to play %1."
msgstr ""

#: ../src/app/xineEngine.cpp:433
msgid "xine cannot currently seek in flac media"
msgstr ""

#: ../src/app/xineEngine.cpp:585 ../src/app/xineEngine.cpp:593
msgid "Channel %1"
msgstr ""

#: ../src/app/xineEngine.cpp:692 ../src/part/xineEngine.cpp:282
msgid "The source is encrypted and can not be decrypted."
msgstr ""

#: ../src/app/xineEngine.cpp:694 ../src/part/xineEngine.cpp:284
msgid "The host is unknown for the URL: <i>%1</i>"
msgstr ""

#: ../src/app/xineEngine.cpp:696 ../src/part/xineEngine.cpp:286
msgid "The device name you specified seems invalid."
msgstr ""

#: ../src/app/xineEngine.cpp:698 ../src/part/xineEngine.cpp:288
msgid "The network appears unreachable."
msgstr ""

#: ../src/app/xineEngine.cpp:700 ../src/part/xineEngine.cpp:290
msgid "Audio output unavailable; the device is busy."
msgstr ""

#: ../src/app/xineEngine.cpp:702 ../src/part/xineEngine.cpp:292
msgid "The connection was refused for the URL: <i>%1</i>"
msgstr ""

#: ../src/app/xineEngine.cpp:704 ../src/part/xineEngine.cpp:294
msgid "xine could not find the URL: <i>%1</i>"
msgstr ""

#: ../src/app/xineEngine.cpp:706 ../src/part/xineEngine.cpp:296
msgid "Access was denied for the URL: <i>%1</i>"
msgstr ""

#: ../src/app/xineEngine.cpp:708 ../src/part/xineEngine.cpp:298
msgid "The source cannot be read for the URL: <i>%1</i>"
msgstr ""

#: ../src/app/xineEngine.cpp:710 ../src/part/xineEngine.cpp:300
msgid "A problem occurred while loading a library or decoder."
msgstr ""

#: ../src/app/xineEngine.cpp:737 ../src/part/xineEngine.cpp:327
msgid "Sorry, no additional information is available."
msgstr ""

#: ../src/app/captureFrame.cpp:82
msgid "Capture - %1"
msgstr ""

#: ../src/app/captureFrame.cpp:98
msgid ""
"*.png|PNG Format\n"
"*.jpeg|JPEG Format"
msgstr ""

#: ../src/app/captureFrame.cpp:100
msgid "Save Frame"
msgstr ""

#: ../src/app/captureFrame.cpp:111
msgid "%1 saved successfully"
msgstr ""

#: ../src/app/captureFrame.cpp:113
msgid "Sorry, could not save %1"
msgstr ""

#: ../src/app/fullScreenAction.cpp:31
msgid "Exit F&ull Screen Mode"
msgstr ""

#: ../src/app/fullScreenAction.cpp:37
msgid "F&ull Screen Mode"
msgstr ""

#: ../src/app/mainWindow.cpp:94
msgid "&Subtitles"
msgstr ""

#: ../src/app/mainWindow.cpp:95
msgid "A&udio Channels"
msgstr ""

#: ../src/app/mainWindow.cpp:96
msgid "Aspect &Ratio"
msgstr ""

#: ../src/app/mainWindow.cpp:106
msgid "<qt>"
msgstr ""

#: ../src/app/mainWindow.cpp:106
msgid " could not load its interface, this probably means that "
msgstr ""

#: ../src/app/mainWindow.cpp:106
msgid ""
" is not installed to the correct prefix. If you installed from packages "
"please contact the packager, if you installed from source please try running "
"the <b>configure</b> script again like this: <pre> % ./configure --"
"prefix=`kde-config --prefix`</pre>"
msgstr ""

#: ../src/app/mainWindow.cpp:139
msgid "<qt>xine could not be successfully initialised. "
msgstr ""

#: ../src/app/mainWindow.cpp:139
msgid ""
" will now exit. You can try to identify what is wrong with your xine "
"installation using the <b>xine-check</b> command at a command-prompt."
msgstr ""

#: ../src/app/mainWindow.cpp:208
msgid "Play &Media..."
msgstr ""

#: ../src/app/mainWindow.cpp:214
msgid "Record"
msgstr ""

#: ../src/app/mainWindow.cpp:216
msgid "Reset Video Scale"
msgstr ""

#: ../src/app/mainWindow.cpp:217 ../src/app/mainWindow.cpp:423
msgid "Media Information"
msgstr ""

#: ../src/app/mainWindow.cpp:218
msgid "Menu Toggle"
msgstr ""

#: ../src/app/mainWindow.cpp:219
msgid "&Capture Frame"
msgstr ""

#: ../src/app/mainWindow.cpp:221
msgid "Video Settings..."
msgstr ""

#: ../src/app/mainWindow.cpp:222
msgid "Configure xine..."
msgstr ""

#: ../src/app/mainWindow.cpp:224
msgid "Position Slider"
msgstr ""

#: ../src/app/mainWindow.cpp:317
msgid "Codeine was asked to open an empty URL; it cannot."
msgstr ""

#: ../src/app/mainWindow.cpp:366
msgid "Supported Media Formats"
msgstr ""

#: ../src/app/mainWindow.cpp:366
msgid "All Files"
msgstr ""

#: ../src/app/mainWindow.cpp:367
msgid "Select A File To Play"
msgstr ""

#: ../src/app/mainWindow.cpp:438
msgid "&Determine Automatically"
msgstr ""

#: ../src/app/mainWindow.cpp:450
msgid "&Off"
msgstr ""

#: ../src/app/mainWindow.cpp:492
msgid "Sorry, no media was found in the drop"
msgstr ""

#: ../src/app/theStream.cpp:107
msgid "Metadata"
msgstr ""

#: ../src/app/theStream.cpp:109
msgid "Title"
msgstr ""

#: ../src/app/theStream.cpp:110
msgid "Comment"
msgstr ""

#: ../src/app/theStream.cpp:111
msgid "Artist"
msgstr ""

#: ../src/app/theStream.cpp:112
msgid "Genre"
msgstr ""

#: ../src/app/theStream.cpp:113
msgid "Album"
msgstr ""

#: ../src/app/theStream.cpp:114
msgid "Year"
msgstr ""

#: ../src/app/theStream.cpp:116
msgid "Audio Properties"
msgstr ""

#: ../src/app/theStream.cpp:118
msgid "Bitrate"
msgstr ""

#: ../src/app/theStream.cpp:118
msgid "%1 bps"
msgstr ""

#: ../src/app/theStream.cpp:119
msgid "Sample-rate"
msgstr ""

#: ../src/app/theStream.cpp:119
msgid "%1 Hz"
msgstr ""

#: ../src/app/theStream.cpp:121
msgid "Technical Information"
msgstr ""

#: ../src/app/theStream.cpp:123
msgid "Video Codec"
msgstr ""

#: ../src/app/theStream.cpp:124
msgid "Audio Codec"
msgstr ""

#: ../src/app/theStream.cpp:125
msgid "System Layer"
msgstr ""

#: ../src/app/theStream.cpp:126
msgid "Input Plugin"
msgstr ""

#: ../src/app/theStream.cpp:127
msgid "CDINDEX_DISCID"
msgstr ""

#: ../src/app/videoWindow.cpp:140
msgid "Pause"
msgstr ""

#: ../src/part/xineEngine.cpp:159
msgid "The Codeine video player could not find an input plugin for '%1'."
msgstr ""

#: ../src/part/xineEngine.cpp:162
msgid "The Codeine video player could not find a demux plugin for '%1'."
msgstr ""

#: ../src/part/xineEngine.cpp:165
msgid ""
"The Codeine video player failed to demux '%1'; please check your xine "
"installation."
msgstr ""

#: ../src/part/xineEngine.cpp:170
msgid ""
"The Codeine video player reports an internal error; please check your xine "
"installation."
msgstr ""

#: ../src/_translatorinfo.cpp:1
msgid ""
"_: NAME OF TRANSLATORS\n"
"Your names"
msgstr ""

#: ../src/_translatorinfo.cpp:3
msgid ""
"_: EMAIL OF TRANSLATORS\n"
"Your emails"
msgstr ""

+ 60
- 0
po/messages.sh View File

@@ -0,0 +1,60 @@
#!/bin/sh

# Inspired by Makefile.common from coolo
# this script is used to update the .po files

# To update the translations, you will need a specific gettext
# patched for kde and a lot of patience, tenacity, luck, time ..


# I guess one should only update the .po files when all .cpp files
# are generated (after a make or scons)

# If you have a better way to do this, do not keep that info
# for yourself and help me to improve this script, thanks
# (tnagyemail-mail tat yahoo d0tt fr)

SRCDIR=../src # srcdir is the directory containing the source code
TIPSDIR=$SRCDIR # tipsdir is the directory containing the tips

KDEDIR=`kde-config --prefix`
EXTRACTRC=extractrc
KDEPOT=`kde-config --prefix`/include/kde.pot
XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale -x $KDEPOT "

## check that kde.pot is available
if ! test -e $KDEPOT; then
echo "$KDEPOT does not exist, there is something wrong with your installation!"
XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale "
fi

> rc.cpp

## extract the strings
echo "extracting the strings"

# process the .ui and .rc files
$EXTRACTRC `find $SRCDIR -iname *.rc` >> rc.cpp
$EXTRACTRC `find $SRCDIR -iname *.ui` >> rc.cpp
echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > $SRCDIR/_translatorinfo.cpp

# process the tips - $SRCDIR is supposed to be where the tips are living
pushd $TIPSDIR; preparetips >tips.cpp; popd

$XGETTEXT `find $SRCDIR -name "*.cpp"` -o codeine.pot

# remove the intermediate files
rm -f $TIPSDIR/tips.cpp
rm -f rc.cpp
rm -f $SRCDIR/_translatorinfo.cpp

## now merge the .po files ..
echo "merging the .po files"

for i in `ls *.po`; do
msgmerge $i kdissert.pot -o $i || exit 1
done

## finished
echo "Done"


+ 101
- 0
scons/codeine.py View File

@@ -0,0 +1,101 @@
## Max Howell, 2005

BOLD ="\033[1m"
RED ="\033[91m"
GREEN ="\033[92m"
YELLOW ="\033[93m"
CYAN ="\033[96m"
NORMAL ="\033[0m"

import os

def exists( env ):
return true

def generate( env ):

if 'configure' in env['TARGS']:
xine_lib_test_source_file = """
#include <qstring.h>
#include <xine.h>

int main( int argc, char **argv )
{
if( XINE_MAJOR_VERSION < 1 )
return 1;

const QString version( XINE_VERSION );

// eg. VERSION 1.0
if( version[1] == '.' )
return 0;

if( version == "1-cvs" )
return 0;

if( version.startsWith( "1-rc" ) && QString(version[4]).toInt() > 3 )
return 0;

return 2; //too old
}"""

def CheckKdeLibs( context ):
# ideally should be able to tell bksys what version we need
context.Message( 'Checking for KDElibs 3.3...' )
kde_version = os.popen("kde-config --version|grep KDE").read().strip().split()[1]
result = int( kde_version[0] ) == 3 and int( kde_version[2] ) >= 3
context.Result( result )
return result

def CheckXineLib( context ):
context.Message('Checking for xine-lib 1.0...')
result = context.TryLink(xine_lib_test_source_file, '.cpp')
context.Result(result)
return result


# prolly best to use a fresh env
# this seems to import the user's CXXFLAGS, etc., which may break
confenv = env.Copy()
configure = confenv.Configure(custom_tests = {'CheckXineLib' : CheckXineLib, 'CheckKdeLibs' : CheckKdeLibs}, log_file='configure.log')
confenv.AppendUnique(LIBS = 'qt-mt')
confenv.AppendUnique(LINKFLAGS = '-L/usr/X11R6/lib')

if not configure.CheckKdeLibs():
print # 1 2 3 4 5 6 7 8'
print 'Configure could not detect KDElibs 3.3, which is required for Codeine to '
print 'compile.'
print
confenv.Exit( 1 )

if not configure.CheckLibWithHeader( 'xine', 'xine.h', 'c++' ):
print # 1 2 3 4 5 6 7 8'
print 'Configure could not find either the xine library or header on your system. You '
print 'should ammend the relevant paths. If you know which ones please email me so I '
print 'can update this message!'
print
confenv.Exit( 2 )

if not configure.CheckXineLib():
print # 1 2 3 4 5 6 7 8'
print 'Your xine-lib is either too old, or can not be linked against. Sorry for not '
print 'being more specific..'
print
confenv.Exit( 3 )

if not configure.CheckLibWithHeader( 'Xtst', 'X11/extensions/XTest.h', 'c' ):
print # 1 2 3 4 5 6 7 8'
print 'libxtst was not found, this means the screensaver cannot be disabled during '
print 'playback. YOU CAN STILL BUILD CODEINE! :)'
print

file = open ( 'src/configure.h', 'w' )
file.write( "#define NO_XTEST_EXTENSION\n" )
file.close()
else:
# FIXME - thus only one thing can be in configure.h - lol
file = open ( 'src/configure.h', 'w' )
file.write( "" )
file.close()

env = configure.Finish()

+ 95
- 0
scons/generic.py View File

@@ -0,0 +1,95 @@
## Thomas Nagy, 2005

"""
Detect and store the most common options
* kdecxxflags : debug=1 (-g) or debug=full (-g3, slower)
else use the user CXXFLAGS if any, - or -O2 by default
* prefix : the installation path
* extraincludes : a list of paths separated by ':'
ie: scons configure debug=full prefix=/usr/local extraincludes=/tmp/include:/usr/local
"""

BOLD ="\033[1m"
RED ="\033[91m"
GREEN ="\033[92m"
YELLOW ="\033[93m"
CYAN ="\033[96m"
NORMAL ="\033[0m"

import os

def exists(env):
return true

def generate(env):
env.Help("""
"""+BOLD+
"""*** Generic options ***
-----------------------"""+NORMAL+"""
"""+BOLD+"""* debug """+NORMAL+""": debug=1 (-g) or debug=full (-g3, slower) else use environment CXXFLAGS, or -O2 by default
"""+BOLD+"""* prefix """+NORMAL+""": the installation path
"""+BOLD+"""* extraincludes """+NORMAL+""": a list of paths separated by ':'
ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/include:/usr/local
"""+NORMAL)

# load the options
from SCons.Options import Options, PathOption
opts = Options('generic.cache.py')
opts.AddOptions(
( 'KDECXXFLAGS', 'debug level for the project : full or just anything' ),
( 'PREFIX', 'prefix for installation' ),
( 'EXTRAINCLUDES', 'extra include paths for the project' ),
)
opts.Update(env)

# use this to avoid an error message 'how to make target configure ?'
env.Alias('configure', None)

# configure the environment if needed
if 'configure' in env['TARGS'] or not env.has_key('KDECXXFLAGS'):
# need debugging ?
if env.has_key('KDECXXFLAGS'):
env.__delitem__('KDECXXFLAGS')
if env['ARGS'].get('debug', None):
debuglevel = env['ARGS'].get('debug', None)
print CYAN+'** Enabling debug for the project **' + NORMAL
if (debuglevel == "full"):
env['KDECXXFLAGS'] = ['-DDEBUG', '-ggdb', '-pipe', '-Wall']
else:
env['KDECXXFLAGS'] = ['-DDEBUG', '-g']
else:
if os.environ.has_key('CXXFLAGS'):
# user-defined flags (gentooers will be delighted)
import SCons.Util
env['KDECXXFLAGS'] = SCons.Util.CLVar( os.environ['CXXFLAGS'] )
env.Append( KDECXXFLAGS = ['-DNDEBUG', '-DNO_DEBUG'] )
else:
env.Append(KDECXXFLAGS = ['-O2', '-DNDEBUG', '-DNO_DEBUG'])

# user-specified prefix
if env['ARGS'].get('prefix', None):
env['PREFIX'] = env['ARGS'].get('prefix', None)
print CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL
elif env.has_key('PREFIX'):
env.__delitem__('PREFIX')

# user-specified include paths
env['EXTRAINCLUDES'] = env['ARGS'].get('extraincludes', None)
if env['ARGS'].get('extraincludes', None):
print CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL
elif env.has_key('EXTRAINCLUDES'):
env.__delitem__('EXTRAINCLUDES')

# and finally save the options in a cache
opts.Save('generic.cache.py', env)

if env.has_key('KDECXXFLAGS'):
# load the flags
env.AppendUnique( CPPFLAGS = env['KDECXXFLAGS'] )

if env.has_key('EXTRAINCLUDES'):
incpaths = []
for dir in str(env['EXTRAINCLUDES']).split(':'):
incpaths.append( dir )
env.Append(CPPPATH = incpaths)


+ 771
- 0
scons/kde.py View File

@@ -0,0 +1,771 @@
# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation
#
# 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 OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 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.
#

# Shamelessly stolen from qt.py and (heavily) modified into kde.py :)
# Thomas Nagy, 2004, 2005 <tnagy2^8@yahoo.fr>

"""
Here follow the basic rules for building kde programs
The detection is done in detect_kde when needed
We wan to use the cached variables as much as possible

The variables used when configuring are :
* prefix : base install path, eg: /usr/local
* execprefix : install path for binaries, eg: /usr/bin
* datadir : install path for the data, eg: /usr/local/share
* libdir : install path for the libs, eg: /usr/lib

* libsuffix : for those who need /usr/lib64 and the like ..

* kdeincludes: path to the kde includes (/usr/include/kde on debian, ...)
* qtincludes : same punishment, for qt includes (/usr/include/qt on debian, ...)

* kdelibs : path to the kde libs, for linking the programs
* qtlibs : same punishment, for qt libraries

eg: scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
"""

BOLD ="\033[1m"
RED ="\033[91m"
GREEN ="\033[92m"
YELLOW ="\033[93m"
CYAN ="\033[96m"
NORMAL ="\033[0m"

def exists(env):
return True

def detect_kde(env):
""" Detect the qt and kde environment using kde-config mostly """
import os, sys, re

prefix = env['ARGS'].get('prefix', None)
execprefix = env['ARGS'].get('execprefix', None)
datadir = env['ARGS'].get('datadir', None)
libdir = env['ARGS'].get('libdir', None)
libsuffix = env['ARGS'].get('libsuffix', '')
kdeincludes = env['ARGS'].get('kdeincludes', None)
kdelibs = env['ARGS'].get('kdelibs', None)
qtincludes = env['ARGS'].get('qtincludes', None)
qtlibs = env['ARGS'].get('qtlibs', None)

if libdir:
libdir = libdir+libsuffix

## Detect the kde libraries
print "Checking for kde-config : ",
kde_config = os.popen("which kde-config 2>/dev/null").read().strip()
if len(kde_config):
print GREEN + "kde-config was found" + NORMAL
else:
print RED + "kde-config was NOT found in your PATH"+ NORMAL
print "Make sure kde is installed properly"
print "(missing package kdebase-devel?)"
# TODO : prompt the user for the path of kde-config ?
sys.exit(1)
env['KDEDIR'] = os.popen('kde-config -prefix').read().strip()

print "Checking for kde version : ",
kde_version = os.popen("kde-config --version|grep KDE").read().strip().split()[1]
if int(kde_version[0]) != 3 or int(kde_version[2]) < 2:
print RED + kde_version
print RED + "Your kde version can be too old" + NORMAL
print RED + "Please make sure kde is at least 3.2" + NORMAL
else:
print GREEN + kde_version + NORMAL

## Detect the qt library
print "Checking for the qt library : ",
qtdir = os.getenv("QTDIR")
if qtdir:
print GREEN + "qt is in " + qtdir + NORMAL
else:
m = re.search('(.*)/lib/libqt.*', os.popen('ldd `kde-config --expandvars --install lib`' + '/libkdeui.so.4 | grep libqt').read().strip().split()[2])
if m:
qtdir = m.group(1)
print YELLOW + "qt was found as " + m.group(1) + NORMAL
else:
print RED + "qt was not found" + NORMAL
print RED + "Please set QTDIR first (/usr/lib/qt3?)" + NORMAL
sys.exit(1)
env['QTDIR'] = qtdir.strip()

## Find the necessary programs uic and moc
print "Checking for uic : ",
uic = qtdir + "/bin/uic"
if os.path.isfile(uic):
print GREEN + "uic was found as " + uic + NORMAL
else:
uic = os.popen("which uic 2>/dev/null").read().strip()
if len(uic):
print YELLOW + "uic was found as " + uic + NORMAL
else:
uic = os.popen("which uic 2>/dev/null").read().strip()
if len(uic):
print YELLOW + "uic was found as " + uic + NORMAL
else:
print RED + "uic was not found - set QTDIR put it in your PATH ?" + NORMAL
sys.exit(1)
env['QT_UIC'] = uic

print "Checking for moc : ",
moc = qtdir + "/bin/moc"
if os.path.isfile(moc):
print GREEN + "moc was found as " + moc + NORMAL
else:
moc = os.popen("which moc 2>/dev/null").read().strip()
if len(moc):
print YELLOW + "moc was found as " + moc + NORMAL
elif os.path.isfile("/usr/share/qt3/bin/moc"):
moc = "/usr/share/qt3/bin/moc"
print YELLOW + "moc was found as " + moc + NORMAL
else:
print RED + "moc was not found - set QTDIR or put it in your PATH ?" + NORMAL
sys.exit(1)
env['QT_MOC'] = moc

## check for the qt and kde includes
print "Checking for the qt includes : ",
if qtincludes and os.path.isfile(qtincludes + "/qlayout.h"):
# The user told where to look for and it looks valid
print GREEN + "ok " + qtincludes + NORMAL
else:
if os.path.isfile(qtdir + "/include/qlayout.h"):
# Automatic detection
print GREEN + "ok " + qtdir + "/include/ " + NORMAL
qtincludes = qtdir + "/include/"
elif os.path.isfile("/usr/include/qt3/qlayout.h"):
# Debian probably
print YELLOW + "the qt headers were found in /usr/include/qt3/ " + NORMAL
qtincludes = "/usr/include/qt3"
else:
print RED + "the qt headers were not found" + NORMAL
sys.exit(1)

print "Checking for the kde includes : ",
kdeprefix = os.popen("kde-config --prefix").read().strip()
if not kdeincludes:
kdeincludes = kdeprefix+"/include/"
if os.path.isfile(kdeincludes + "/klineedit.h"):
print GREEN + "ok " + kdeincludes + NORMAL
else:
if os.path.isfile(kdeprefix+"/include/kde/klineedit.h"):
# Debian, Fedora probably
print YELLOW + "the kde headers were found in " + kdeprefix + "/include/kde/" + NORMAL
kdeincludes = kdeprefix + "/include/kde/"
else:
print RED + "The kde includes were NOT found" + NORMAL
sys.exit(1)

if prefix:
## use the user-specified prefix
if not execprefix:
execprefix = prefix
if not datadir:
datadir = prefix + "/share"
if not libdir:
libdir = execprefix + "/lib"+libsuffix

subst_vars = lambda x: x.replace('${exec_prefix}', execprefix).replace('${datadir}',
datadir).replace('${libdir}', libdir)
debian_fix = lambda x: x.replace('/usr/share', '${datadir}')
env['KDEBIN'] = subst_vars(os.popen('kde-config --install exe').read().strip())
env['KDEAPPS'] = subst_vars(os.popen('kde-config --install apps').read().strip())
env['KDEDATA'] = subst_vars(os.popen('kde-config --install data').read().strip())
env['KDEMODULE']= subst_vars(os.popen('kde-config --install module').read().strip())
env['KDELOCALE']= subst_vars(os.popen('kde-config --install locale').read().strip())
env['KDEDOC'] = subst_vars( debian_fix(os.popen('kde-config --install html').read().strip()) )
env['KDEKCFG'] = subst_vars(os.popen('kde-config --install kcfg').read().strip())
env['KDEXDG'] = subst_vars(os.popen('kde-config --install xdgdata-apps').read().strip())
env['KDEMENU'] = subst_vars(os.popen('kde-config --install apps').read().strip())
env['KDEMIME'] = subst_vars(os.popen('kde-config --install mime').read().strip())
env['KDEICONS'] = subst_vars(os.popen('kde-config --install icon').read().strip())
env['KDESERV'] = subst_vars(os.popen('kde-config --install services').read().strip())
else:
# the user has given no prefix, install as a normal kde app
env['PREFIX'] = os.popen('kde-config --prefix').read().strip()
env['KDEBIN'] = os.popen('kde-config --expandvars --install exe').read().strip()
env['KDEAPPS'] = os.popen('kde-config --expandvars --install apps').read().strip()
env['KDEDATA'] = os.popen('kde-config --expandvars --install data').read().strip()
env['KDEMODULE']= os.popen('kde-config --expandvars --install module').read().strip()
env['KDELOCALE']= os.popen('kde-config --expandvars --install locale').read().strip()
env['KDEDOC'] = os.popen('kde-config --expandvars --install html').read().strip()
env['KDEKCFG'] = os.popen('kde-config --expandvars --install kcfg').read().strip()
env['KDEXDG'] = os.popen('kde-config --expandvars --install xdgdata-apps').read().strip()
env['KDEMENU'] = os.popen('kde-config --expandvars --install apps').read().strip()
env['KDEMIME'] = os.popen('kde-config --expandvars --install mime').read().strip()
env['KDEICONS'] = os.popen('kde-config --expandvars --install icon').read().strip()
env['KDESERV'] = os.popen('kde-config --expandvars --install services').read().strip()

env['QTPLUGINS']=os.popen('kde-config --expandvars --install qtplugins').read().strip()

## kde libs and includes
env['KDEINCLUDEPATH']= kdeincludes
if not kdelibs:
kdelibs = os.popen('kde-config --expandvars --install lib').read().strip()
env['KDELIBPATH']= kdelibs

## qt libs and includes
env['QTINCLUDEPATH']= qtincludes
if not qtlibs:
qtlibs = qtdir+ "/lib"
env['QTLIBPATH']= qtlibs


def generate(env):
""""Set up the qt and kde environment and builders - the moc part is difficult to understand """

env.Help("""
"""+BOLD+
"""*** KDE options ***
-------------------"""
+NORMAL+"""
"""+BOLD+"""* prefix """+NORMAL+""": base install path, ie: /usr/local
"""+BOLD+"""* execprefix """+NORMAL+""": install path for binaries, ie: /usr/bin
"""+BOLD+"""* datadir """+NORMAL+""": install path for the data, ie: /usr/local/share
"""+BOLD+"""* libdir """+NORMAL+""": install path for the libs, ie: /usr/lib
"""+BOLD+"""* libsuffix """+NORMAL+""": suffix of libraries on amd64, ie: 64, 32
"""+BOLD+"""* kdeincludes"""+NORMAL+""": path to the kde includes (/usr/include/kde on debian, ...)
"""+BOLD+"""* qtincludes """+NORMAL+""": same punishment, for qt includes (/usr/include/qt on debian, ...)
"""+BOLD+"""* kdelibs """+NORMAL+""": path to the kde libs, for linking the programs
"""+BOLD+"""* qtlibs """+NORMAL+""": same punishment, for qt libraries
ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
"""+NORMAL)

import os.path
import re

import SCons.Defaults
import SCons.Tool
import SCons.Util

ui_extensions = [".ui", ".Ui", ".UI"]
header_extensions = [".h", ".hxx", ".hpp", ".hh", ".H", ".HH"]
source_extensions = [".cpp", ".cxx", ".cc", ".CPP", ".CXX", ".CC"]

def find_file(filename, paths, node_factory):
retval = None
for dir in paths:
node = node_factory(filename, dir)
if node.rexists():
return node
return None

class _Metasources:
""" Callable class, which works as an emitter for Programs, SharedLibraries
and StaticLibraries."""
def __init__(self, objBuilderName):
self.objBuilderName = objBuilderName
def __call__(self, target, source, env):
""" Smart autoscan function. Gets the list of objects for the Program
or Lib. Adds objects and builders for the special qt files. """
try:
if int(env.subst('$QT_AUTOSCAN')) == 0:
return target, source
except ValueError:
pass

try:
qtdebug = int(env.subst('$QT_DEBUG'))
except ValueError:
qtdebug = 0

# some shortcuts used in the scanner
FS = SCons.Node.FS.default_fs
splitext = SCons.Util.splitext
objBuilder = getattr(env, self.objBuilderName)
# some regular expressions:
# Q_OBJECT detection
q_object_search = re.compile(r'[^A-Za-z0-9]Q_OBJECT[^A-Za-z0-9]')

# cxx and c comment 'eater'
#comment = re.compile(r'(//.*)|(/\*(([^*])|(\*[^/]))*\*/)')
# CW: something must be wrong with the regexp. See also bug #998222
# CURRENTLY THERE IS NO TEST CASE FOR THAT

# The following is kind of hacky to get builders working properly (FIXME)
objBuilderEnv = objBuilder.env
objBuilder.env = env
mocBuilderEnv = env.Moc.env
env.Moc.env = env

# make a deep copy for the result; MocH objects will be appended
out_sources = source[:]

for obj in source:
if not obj.has_builder():
# binary obj file provided
if qtdebug:
print "scons: qt: '%s' seems to be a binary. Discarded." % str(obj)
continue
cpp = obj.sources[0]
if not splitext(str(cpp))[1] in source_extensions:
if qtdebug:
print "scons: qt: '%s' is no cxx file. Discarded." % str(cpp)
# c or fortran source
continue
#cpp_contents = comment.sub('', cpp.get_contents())
cpp_contents = cpp.get_contents()
h = None
ui = None
for ui_ext in ui_extensions:
# try to find the ui file in the corresponding source directory
uiname = splitext(cpp.name)[0] + ui_ext
ui = find_file(uiname, (cpp.get_dir(),), FS.File)
if ui:
if qtdebug:
print "scons: qt: found .ui file of header" #% (str(h), str(cpp))
#h_contents = comment.sub('', h.get_contents())
break
# if we have a .ui file, do not continue, it is automatically handled by Uic
if ui:
continue

for h_ext in header_extensions:
# try to find the header file in the corresponding source
# directory
hname = splitext(cpp.name)[0] + h_ext
h = find_file(hname, (cpp.get_dir(),), FS.File)
if h:
if qtdebug:
print "scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp))
#h_contents = comment.sub('', h.get_contents())
h_contents = h.get_contents()
break
if not h and qtdebug:
print "scons: qt: no header for '%s'." % (str(cpp))
if h and q_object_search.search(h_contents):
# h file with the Q_OBJECT macro found -> add .moc or _moc.cpp file
moc_cpp = None

if env.has_key('NOMOCSCAN'):
moc_cpp = env.Moc(h)
else:
reg = '\n\s*#include\s+"'+splitext(cpp.name)[0]+'.moc"'
meta_object_search = re.compile(reg)
if meta_object_search.search(cpp_contents):
moc_cpp = env.Moc(h)
else:
moc_cpp = env.Moccpp(h)
moc_o = objBuilder(moc_cpp)
out_sources.append(moc_o)
if qtdebug:
print "scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp[0]))
if cpp and q_object_search.search(cpp_contents):
print "error, bksys cannot handle cpp files with Q_OBJECT classes"
print "if you are sure this is a feature worth the effort, "
print "report this to the authors tnagyemail-mail yahoo.fr"

# restore the original env attributes (FIXME)
objBuilder.env = objBuilderEnv
env.Moc.env = mocBuilderEnv

return (target, out_sources)
MetasourcesShared = _Metasources('SharedObject')
MetasourcesStatic = _Metasources('StaticObject')

CLVar = SCons.Util.CLVar
splitext = SCons.Util.splitext
Builder = SCons.Builder.Builder
# Detect the environment - replaces ./configure implicitely
# and store the options into a cache
from SCons.Options import Options
opts = Options('kde.cache.py')
opts.AddOptions(
( 'QTDIR', 'root of qt directory' ),
( 'QTLIBPATH', 'path to the qt libraries' ),
( 'QTINCLUDEPATH', 'path to the qt includes' ),
( 'QT_UIC', 'moc directory'),
( 'QT_MOC', 'moc executable command'),
( 'QTPLUGINS', 'uic executable command'),
( 'KDEDIR', 'root of kde directory' ),
( 'KDELIBPATH', 'path to the kde libs' ),
( 'KDEINCLUDEPATH', 'path to the kde includes' ),

( 'PREFIX', 'root of the program installation'),

( 'KDEBIN', 'installation path of the kde binaries'),
( 'KDEMODULE', 'installation path of the parts and libs'),
( 'KDEAPPS', ''),
( 'KDEDATA', 'installation path of the application data'),
( 'KDELOCALE', ''),
( 'KDEDOC', 'installation path of the application documentation'),
( 'KDEKCFG', 'installation path of the .kcfg files'),
( 'KDEXDG', 'installation path of the service types'),
( 'KDEMENU', ''),
( 'KDEMIME', 'installation path of to the mimetypes'),
( 'KDEICONS', ''),
( 'KDESERV', ''),
)
opts.Update(env)

# reconfigure when things are missing
if 'configure' in env['TARGS'] or not env.has_key('QTDIR') or not env.has_key('KDEDIR'):
detect_kde(env)

# finally save the configuration
opts.Save('kde.cache.py', env)

## set default variables, one can override them in sconscript files
env.Append(CXXFLAGS = ['-I'+env['KDEINCLUDEPATH'], '-I'+env['QTINCLUDEPATH'] ])
env.Append(LIBPATH = [env['KDELIBPATH'], env['QTLIBPATH'] ])
env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
env['QT_AUTOSCAN'] = 1
env['QT_DEBUG'] = 0
env['QT_UIC_HFLAGS'] = '-L $QTPLUGINS -nounload'
env['QT_UIC_CFLAGS'] = '$QT_UIC_HFLAGS -tr tr2i18n'
env['QT_LIBS'] = 'qt-mt'
env['LIBTOOL_FLAGS'] = '--silent --mode=compile --tag=CXX'