Browse Source

Conversion to the cmake building system.

Signed-off-by: gregory guy <gregory-tde@laposte.net>
pull/1/head
gregory guy 3 months ago
parent
commit
0b2288da16
No known key found for this signature in database GPG Key ID: 3BCCA0F7AB4536F4
67 changed files with 992 additions and 1568 deletions
  1. +79
    -0
      CMakeLists.txt
  2. +49
    -0
      ConfigureChecks.cmake
  3. +0
    -0
      FAQ
  4. +29
    -0
      INSTALL
  5. +0
    -17
      PKGBUILD
  6. +1
    -47
      README
  7. +0
    -168
      SConstruct
  8. +0
    -0
      TODO
  9. +12
    -0
      config.h.cmake
  10. +0
    -87
      configure
  11. +1
    -0
      doc/CMakeLists.txt
  12. +1
    -0
      doc/en/CMakeLists.txt
  13. +437
    -0
      doc/en/index.docbook
  14. BIN
      doc/en/main.png
  15. +5
    -0
      doc/man/CMakeLists.txt
  16. +94
    -0
      doc/man/codeine.1
  17. +31
    -0
      misc/CMakeLists.txt
  18. +0
    -60
      po/messages.sh
  19. +0
    -101
      scons/codeine.py
  20. +0
    -95
      scons/generic.py
  21. +0
    -771
      scons/kde.py
  22. BIN
      scons/scons-mini.tar.bz2
  23. +2
    -0
      src/CMakeLists.txt
  24. +0
    -21
      src/SConscript
  25. +54
    -0
      src/app/CMakeLists.txt
  26. +0
    -59
      src/app/SConscript
  27. +3
    -3
      src/app/actions.cpp
  28. +5
    -5
      src/app/adjustSizeButton.cpp
  29. +1
    -1
      src/app/adjustSizeButton.h
  30. +7
    -5
      src/app/analyzer.cpp
  31. +3
    -3
      src/app/analyzer.h
  32. +9
    -9
      src/app/captureFrame.cpp
  33. +0
    -0
      src/app/codeineConfig.h
  34. +1
    -1
      src/app/fullScreenAction.cpp
  35. +1
    -1
      src/app/insertAspectRatioMenuItems.cpp
  36. +3
    -3
      src/app/main.cpp
  37. +15
    -10
      src/app/mainWindow.cpp
  38. +1
    -1
      src/app/mainWindow.h
  39. +8
    -6
      src/app/playDialog.cpp
  40. +1
    -1
      src/app/playDialog.h
  41. +5
    -5
      src/app/playlistFile.cpp
  42. +8
    -6
      src/app/slider.cpp
  43. +1
    -1
      src/app/slider.h
  44. +7
    -7
      src/app/stateChange.cpp
  45. +1
    -1
      src/app/theStream.cpp
  46. +3
    -3
      src/app/theStream.h
  47. +4
    -4
      src/app/videoSettings.cpp
  48. +1
    -1
      src/app/videoSettings.h
  49. +4
    -4
      src/app/videoWindow.cpp
  50. +8
    -6
      src/app/volumeAction.cpp
  51. +10
    -10
      src/app/xineConfig.cpp
  52. +1
    -1
      src/app/xineConfig.h
  53. +8
    -7
      src/app/xineEngine.cpp
  54. +3
    -3
      src/app/xineEngine.h
  55. +2
    -2
      src/debug.h
  56. +1
    -1
      src/mxcl.library.cpp
  57. +1
    -1
      src/mxcl.library.h
  58. +36
    -0
      src/part/CMakeLists.txt
  59. +0
    -12
      src/part/SConscript
  60. +4
    -4
      src/part/part.cpp
  61. +3
    -3
      src/part/toolbar.cpp
  62. +4
    -4
      src/part/videoWindow.cpp
  63. +2
    -2
      src/part/videoWindow.h
  64. +7
    -5
      src/part/xineEngine.cpp
  65. +1
    -0
      translations/CMakeLists.txt
  66. +14
    -0
      translations/messages/CMakeLists.txt
  67. +0
    -0
      translations/messages/codeine.pot

+ 79
- 0
CMakeLists.txt View File

@@ -0,0 +1,79 @@
############################################
# #
# Improvements and feedbacks are welcome #
# #
# This file is released under GPL >= 3 #
# #
############################################


cmake_minimum_required( VERSION 2.8 )


#### general package setup

project( codeine )
set( VERSION R14.1.0 )


#### include essential cmake modules

include( FindPkgConfig )
include( CheckFunctionExists )
include( CheckSymbolExists )
include( CheckIncludeFile )
include( CheckLibraryExists )
include( CheckCSourceCompiles )
include( CheckCXXSourceCompiles )


#### include our cmake modules

set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )


##### setup install paths

include( TDESetupPaths )
tde_setup_paths( )


##### optional stuff

option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )


##### user requested modules

option( BUILD_ALL "Build all" ON )
option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )


##### configure checks

include( ConfigureChecks.cmake )


###### global compiler settings

add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST )

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )


##### directories

add_subdirectory( src )
add_subdirectory( misc )
tde_conditional_add_subdirectory( BUILD_DOC doc )
tde_conditional_add_subdirectory( BUILD_TRANSLATIONS translations )


##### write configure files

configure_file( config.h.cmake config.h @ONLY )

+ 49
- 0
ConfigureChecks.cmake View File

@@ -0,0 +1,49 @@
###########################################
# #
# Improvements and feedback are welcome #
# #
# This file is released under GPL >= 3 #
# #
###########################################

# required stuff
find_package( TQt )
find_package( TDE )

tde_setup_architecture_flags( )

include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)

tde_setup_largefiles( )


##### check for gcc visibility support

if( WITH_GCC_VISIBILITY )
tde_setup_gcc_visibility( )
endif( WITH_GCC_VISIBILITY )


##### look for X11

find_package( X11 )


##### look for XTest and xcb-util-keysyms

pkg_search_module( X11_XTEST xtst )
pkg_search_module( X11_KEYSIM xcb-keysyms )

if( (NOT X11_XTest_FOUND) OR (NOT X11_KEYSIM_FOUND) )
set( NO_XTEST_EXTENSION 1 )
endif()


#### xine-engine

pkg_search_module( XINE libxine )

if( NOT XINE_FOUND )
tde_message_fatal( "Xine-lib is required but was not found on your system" )
endif( NOT XINE_FOUND )

src/FAQ → FAQ View File


+ 29
- 0
INSTALL View File

@@ -0,0 +1,29 @@
Basic Installation
==================

codeine relies on cmake to build.

Here are suggested default options:

-DCMAKE_INSTALL_PREFIX="/opt/trinity" \
-DCONFIG_INSTALL_DIR="/etc/trinity" \
-DSYSCONF_INSTALL_DIR="/etc/trinity" \
-DXDG_MENU_INSTALL_DIR="/etc/xdg/menus" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_VERBOSE_MAKEFILE="ON" \
-DCMAKE_SKIP_RPATH="OFF" \
-DBUILD_ALL="ON" \
-DWITH_ALL_OPTIONS="ON"


Requirements:
=============

- xine-lib


Optional:
=========

- XTest
- xcb-util-keysyms

+ 0
- 17
PKGBUILD View File

@@ -1,17 +0,0 @@
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
}

+ 1
- 47
README View File

@@ -1,48 +1,2 @@
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 :-)
Codeine - a very simple xine-based media player.

+ 0
- 168
SConstruct View File

@@ -1,168 +0,0 @@
#!/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 \"*.tdevelop.*\" | 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)

src/TODO → TODO View File


+ 12
- 0
config.h.cmake View File

@@ -0,0 +1,12 @@
#define VERSION "@VERSION@"

// Defined if you have fvisibility and fvisibility-inlines-hidden support.
#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@

/* Defined if you don't have either the XTest headers or
the xcb-util-keysyms headers */
#cmakedefine NO_XTEST_EXTENSION 1

+ 0
- 87
configure View File

@@ -1,87 +0,0 @@
#! /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


+ 1
- 0
doc/CMakeLists.txt View File

@@ -0,0 +1 @@
tde_auto_add_subdirectories( )

+ 1
- 0
doc/en/CMakeLists.txt View File

@@ -0,0 +1 @@
tde_create_handbook( DESTINATION ${PROJECT_NAME} )

+ 437
- 0
doc/en/index.docbook View File

@@ -0,0 +1,437 @@
<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.0//EN" "dtd/kdex.dtd" [
<!ENTITY kappname "&codeine;">
<!ENTITY codeine "<application>Codeine</application>">

<!ENTITY % addindex "IGNORE">
<!ENTITY % English "INCLUDE"><!-- change language only here -->
]>


<!-- The language must NOT be changed here. -->

<book lang="&language;">

<!-- This header contains all of the meta-information for the document such
as Authors, publish date, the abstract, and Keywords -->

<bookinfo>
<title>The &codeine; Handbook</title>

<authorgroup>
<author>
<firstname>Mike</firstname>
<surname>Diehl</surname>
<affiliation>
<address><email>madpenguin8@yahoo.com</email></address>
</affiliation>
</author>
</authorgroup>

<!-- TRANS:ROLES_OF_TRANSLATORS -->

<copyright>
<year>2004</year>
<holder>Mike Diehl</holder>
</copyright>
<!-- Translators: put here the copyright notice of the translation -->
<!-- Put here the FDL notice. Read the explanation in fdl-notice.docbook
and in the FDL itself on how to use it. -->
<legalnotice>&FDLNotice;</legalnotice>

<!-- Date and version information of the documentation
Don't forget to include this last date and this last revision number, we
need them for translation coordination !
Please respect the format of the date (DD/MM/YYYY) and of the version
(V.MM.LL), it could be used by automation scripts.
Do NOT change these in the translation. -->

<date>10/19/2004</date>
<releaseinfo>1</releaseinfo>

<!-- Abstract about this handbook -->

<abstract>
<para>
&codeine; is a simple media player for the TRINITY Desktop Environment. &codeine; is a front end to the xine multi-media player.
</para>
</abstract>

<!-- This is a set of Keywords for indexing by search engines.
Please at least include KDE, the KDE package it is in, the name
of your application, and a few relevant keywords. -->

<keywordset>
<keyword>KDE</keyword>
<keyword>Codeine</keyword>
<keyword>xine</keyword>
<keyword>video</keyword>
<keyword>multi-media</keyword>
</keywordset>

</bookinfo>

<!-- The contents of the documentation begin here. Label
each chapter so with the id attribute. This is necessary for two reasons: it
allows you to easily reference the chapter from other chapters of your
document, and if there is no ID, the name of the generated HTML files will vary
from time to time making it hard to manage for maintainers and for the CVS
system. Any chapter labelled (OPTIONAL) may be left out at the author's
discretion. Other chapters should not be left out in order to maintain a
consistent documentation style across all KDE apps. -->

<chapter id="introduction">
<title>Introduction</title>

<screenshot>
<screeninfo>&codeine; Screenshot</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="main.png" format="PNG"/></imageobject>
<textobject><phrase>Screenshot</phrase></textobject>
</mediaobject>
</screenshot>


<para>
&codeine; is a simple media player using the xine backend. &codeine; is a no frills media player that is especially usefull for short video clips where most other media players would just get in the way.
</para>

</chapter>


<chapter id="configuring">
<title>Configuring &codeine;</title>

<para></para>

</chapter>


<chapter id="using">
<title>Using &codeine;</title>

<sect1 id="starting">
<title>Starting &codeine;</title>
<para>&codeine; can be started from the K-Menu, or from the command-line</para>

<sect2 id="starting-from-the-menu">
<title>From the K-Menu</title>

<para>
Open the &kde; program menu by clicking on the <guiicon>big K</guiicon> icon on your panel. This will raise the <guimenu>program menu</guimenu>. Move your cursor up the menu to the <guimenu>Multimedia</guimenu> menu item. Choose <guimenuitem>&codeine;</guimenuitem>.
</para>

</sect2>


<sect2 id="starting-from-the-command-line">
<title>From the Command Line</title>

<para>
You can start &codeine; by typing it's name on the command line. If you include a file name it will play the file.
</para>

<informalexample>
<screen>
<prompt>%</prompt><userinput><command>codeine</command> <option><replaceable>movie.avi</replaceable></option></userinput>
</screen>
</informalexample>

</sect2>
</sect1>


</chapter>



<chapter id="commands">
<title>Menu and Command Reference</title>

<sect1 id="play_menu">
<title>The Play Menu</title>
<variablelist>
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>o</keycap></keycombo>
</shortcut>
<guimenu>Play</guimenu>
<guimenuitem>Play File..</guimenuitem>
</menuchoice></term>
<listitem><para><action>Opens a file dialog to choose a file to play.</action></para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Play</guimenu>
<guimenuitem>Play Audio-CD</guimenuitem>
</menuchoice></term>
<listitem><para><action>Plays an Audio-CD that is in your CD-Rom drive.</action></para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Play</guimenu>
<guimenuitem>Play DVD</guimenuitem>
</menuchoice></term>
<listitem><para><action>Plays a DVD that is in your DVD drive.</action></para></listitem>
</varlistentry>


<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Ctrl</keycap><keycap>q</keycap></keycombo>
</shortcut>
<guimenu>Play</guimenu>
<guimenuitem>Quit</guimenuitem>
</menuchoice></term>
<listitem><para><action>Quits &codeine;.</action></para></listitem>
</varlistentry>

</variablelist>
</sect1>


<sect1 id="settings_menu">
<title>The Settings Menu</title>
<variablelist>


<varlistentry>
<term><menuchoice>
<guimenu>Settings</guimenu>
<guisubmenu>Toolbars</guisubmenu>
<guimenuitem>Show Main Toolbar</guimenuitem>
</menuchoice></term>
<listitem><para><action>Enables or disable the main application toolbar.</action></para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Settings</guimenu>
<guisubmenu>Toolbars</guisubmenu>
<guimenuitem>Show DVD Toolbar</guimenuitem>
</menuchoice></term>
<listitem><para><action>Enables or disable the DVD toolbar.</action></para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Settings</guimenu>
<guimenuitem>Configure Shortcuts...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Allows you to configure the &codeine; shortcuts.</action></para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Settings</guimenu>
<guimenuitem>Configure Toolbars...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Allows you to configure the &codeine; toolbar options.</action></para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Settings</guimenu>
<guimenuitem>Configure Video...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Opens a dialog for configuring the video output settings. The settings include: contrast, brightness, saturation, and hue.</action></para></listitem>
</varlistentry>

</variablelist>
</sect1>

<sect1 id="help_menu">
<title>The Help Menu</title>
<variablelist>

<varlistentry>
<term><menuchoice>
<guimenu>Help</guimenu>
<guimenuitem>&codeine; Handbook</guimenuitem>
</menuchoice></term>
<listitem><para><action>Opens this help document.</action></para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo><keycap>Shift</keycap><keycap>F1</keycap></keycombo>
</shortcut>
<guimenu>Help</guimenu>
<guimenuitem>What's This?</guimenuitem>
</menuchoice></term>
<listitem><para><action>Activates the "What's This?" mouse cursor allowing you to click an object to get a "What's this?" tooltip.</action></para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Help</guimenu>
<guimenuitem>Report Bug...</guimenuitem>
</menuchoice></term>
<listitem><para><action>Starts the bug report tool dialog window.</action></para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Help</guimenu>
<guimenuitem>About &codeine;</guimenuitem>
</menuchoice></term>
<listitem><para><action>Starts the About &codeine; dialog window.</action></para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Help</guimenu>
<guimenuitem>About KDE</guimenuitem>
</menuchoice></term>
<listitem><para><action>Starts the About &kde; dialog window.</action></para></listitem>
</varlistentry>

</variablelist>
</sect1>


</chapter>

<!--
<chapter id="faq">
<title>Questions and Answers</title>

(OPTIONAL but recommended) This chapter should include all of the silly
(and not-so-silly) newbie questions that fill up your mailbox. This chapter
should be reserved for BRIEF questions and answers! If one question uses more
than a page or so then it should probably be part of the
"Using this Application" chapter instead. You should use links to
cross-reference questions to the parts of your documentation that answer them.
This is also a great place to provide pointers to other FAQ's if your users
must do some complicated configuration on other programs in order for your
application work.

&reporting.bugs;
&updating.documentation;

<qandaset id="faqlist">
<qandaentry>
<question>
<para>My Mouse doesn't work. How do I quit &filelight;?</para>
</question>
<answer>
<para>You silly goose! Check out the <link linkend="commands">Commands
Section</link> for the answer.</para>
</answer>
</qandaentry>
<qandaentry>
<question>
<para>Why can't I twiddle my documents?</para>
</question>
<answer>
<para>You can only twiddle your documents if you have the foobar.lib
installed.</para>
</answer>
</qandaentry>
</qandaset>
</chapter>
-->



<chapter id="credits">

<!-- Include credits for the programmers, documentation writers, and
contributors here. The license for your software should then be included below
the credits with a reference to the appropriate license file included in the KDE
distribution. -->

<title>Credits and License</title>

<sect1 id="kapp">
<title>&codeine;</title>
<para>Program copyright 2004 Max B. Howell <email>max.howell@methylblue.com</email></para>

&underGPL;

</sect1>
<sect1 id="Documentation">

<title>Documentation</title>

<para>
Documentation copyright 2004 Mike Diehl <email>madpenguin8@yahoo.com</email>
</para>

&underFDL;

</sect1>

</chapter>

<chapter id="requirements">
<title>Requirements</title>

<para>&codeine; requires the installation of some software packages. The required packages are listed below.</para>


<itemizedlist>
<title>Required:</title>
<listitem><para>tdelibs <ulink url="https://mirror.git.trinitydesktop.org/gitea/TDE/tdelibs"></ulink></para></listitem>
<listitem><para>xine-lib <ulink url="https://sourceforge.net/projects/xine/"></ulink></para></listitem>
</itemizedlist>
<itemizedlist>
<title>Optional:</title>
<listitem><para>XTest Library</para></listitem>
<listitem><para>xcb-util-keysyms</para></listitem>
</itemizedlist>

<note><para>If you obtain these dependencies via a packaging system, you must
also install the devel versions of these packages!</para></note>

</chapter>


<appendix id="installation">
<title>Installation</title>

<sect1 id="getting-codeine">
<title>How to obtain &codeine;</title>

<para>
&codeine; is now part of the TDE project, it can be found at:
<ulink url="http://trinitydesktop.org/">http://trinitydesktop.org/</ulink>.
</para>
</sect1>

<sect1 id="compilation">
<title>Compilation and Installation</title>

<para>
In order to compile and install &codeine; on your system, type the following in the base directory; distribution:
<screen width="40">
<prompt>%</prompt> <userinput>mkdir -p build</userinput>
<prompt>%</prompt> <userinput>cd build</userinput>
<prompt>%</prompt> <userinput>cmake ../</userinput>
<prompt>%</prompt> <userinput>make</userinput>
<prompt>%</prompt> <userinput>make install</userinput>
</screen>
</para>

<para>Since &codeine; uses cmake you should have not trouble compiling it. Default options for cmake build are available in the INSTALL file.</para>

</sect1>

</appendix>

&documentation.index;
</book>
<!--
Local Variables:
mode: sgml
sgml-minimize-attributes:nil
sgml-general-insert-case:lower
sgml-indent-step:0
sgml-indent-data:nil
End:
-->

BIN
doc/en/main.png View File

Before After
Width: 346  |  Height: 178  |  Size: 12 KiB

+ 5
- 0
doc/man/CMakeLists.txt View File

@@ -0,0 +1,5 @@
INSTALL(
FILES ${PROJECT_NAME}.1
DESTINATION ${MAN_INSTALL_DIR}/man1
COMPONENT doc
)

+ 94
- 0
doc/man/codeine.1 View File

@@ -0,0 +1,94 @@
'\" -*- coding: us-ascii -*-
.if \n(.g .ds T< \\FC
.if \n(.g .ds T> \\F[\n[.fam]]
.de URL
\\$2 \(la\\$1\(ra\\$3
..
.if \n(.g .mso www.tmac
.TH codeine 1 2006-05-12 "" ""
.SH NAME
codeine \- video player for TDE, designed to be as simple as possible
.SH SYNOPSIS
'nh
.fi
.ad l
\fBcodeine\fR \kx
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
'in \n(.iu+\nxu
[
\fB\fIQt-options\fB\fR
] [
\fB\fTDE-options\fB\fR
] [
\fB\fIURL|file\fB\fR
] [
--play-dvd
]
'in \n(.iu-\nxu
.ad b
'hy
.SH DESCRIPTION
Video player with a different philosophy: Simple, uncluttered interface
.PP
Features:
.TP 0.2i
\(bu
Plays DVDs, VCDs, all video formats supported by Xine
.TP 0.2i
\(bu
Bundled with a simple web-page KPart
.TP 0.2i
\(bu
Starts quickly
.SH OPTIONS
All TDE and TQt
programs accept a some common command-line options. codeine has no
application-specific options.
.PP
.TP
\*(T<\fB\-\-help\fR\*(T>
Show help about options
.TP
\*(T<\fB\-\-help\-qt\fR\*(T>
Show TQt specific options
.TP
\*(T<\fB\-\-help\-tde\fR\*(T>
Show TDE specific options
.TP
\*(T<\fB\-\-help\-all\fR\*(T>
Show all options
.TP
\*(T<\fB\-\-author\fR\*(T>
Show author information
.TP
\*(T<\fB\-v\fR\*(T>, \*(T<\fB\-\-version\fR\*(T>
Show version information
.TP
\*(T<\fB\-\-license\fR\*(T>
Show license information
.TP
\*(T<\fB\-\-\fR\*(T>
Indicates end of options
.TP
\*(T<\fBURL|file\fR\*(T>
URL to or filename of a video
.TP
\*(T<\fB\-\-play\-dvd\fR\*(T>
Play DVD Video
.SH AUTHOR
Codeine was written by Max Howell <\*(T<max.howell@methylblue.com\*(T>>
Homepage:
.URL "" https://mirror.git.trinitydesktop.org/gitea/TDE/codeine/
.SH COPYRIGHT
This manual page was written by Achim Bohnet <\*(T<ach@mpe.mpg.de\*(T>>,
based on work of Anthony Mercatante
<\*(T<anthony.mercatante@laposte.net\*(T>>, for the
Debian system (but may be used by others).
Tom Albers <\*(T<tomalbers@kde.nl\*(T>> documented the play-dvd part.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU General Public License,
Version 2 or any later version published by the Free Software Foundation.
.PP
On Debian systems, the complete text of the GNU General Public Version 2
License can be found in
\*(T<\fI/usr/share/common\-licenses/GPL\-2\fR\*(T>.

+ 31
- 0
misc/CMakeLists.txt View File

@@ -0,0 +1,31 @@
##### icons

tde_install_icons( ${PROJECT_NAME} )


##### other data

install(
FILES ${PROJECT_NAME}ui.rc
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
)

install(
FILES ${PROJECT_NAME}rc
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
)

install(
FILES ${PROJECT_NAME}.desktop
DESTINATION ${XDG_APPS_INSTALL_DIR}
)

install(
FILES ${PROJECT_NAME}_part.desktop
DESTINATION ${SERVICES_INSTALL_DIR}
)

install(
FILES ${PROJECT_NAME}_play_dvd.desktop
DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus
)

+ 0
- 60
po/messages.sh View File

@@ -1,60 +0,0 @@
#!/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

TDEDIR=`tde-config --prefix`
EXTRACTRC=extractrc
KDEPOT=`tde-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"


+ 0
- 101
scons/codeine.py View File

@@ -1,101 +0,0 @@
## 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 <ntqstring.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("tde-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 = 'tqt-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()

+ 0
- 95
scons/generic.py View File

@@ -1,95 +0,0 @@
## 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)


+ 0
- 771
scons/kde.py View File

@@ -1,771 +0,0 @@
# 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/tde on debian, ...)
* qtincludes : same punishment, for qt includes (/usr/include/qt on debian, ...)

* tdelibs : 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 tde-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)
tdelibs = env['ARGS'].get('tdelibs', 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 tde-config : ",
kde_config = os.popen("which tde-config 2>/dev/null").read().strip()
if len(kde_config):
print GREEN + "tde-config was found" + NORMAL
else:
print RED + "tde-config was NOT found in your PATH"+ NORMAL
print "Make sure kde is installed properly"
print "(missing package tdebase-devel?)"
# TODO : prompt the user for the path of tde-config ?
sys.exit(1)
env['TDEDIR'] = os.popen('tde-config -prefix').read().strip()

print "Checking for kde version : ",
kde_version = os.popen("tde-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 `tde-config --expandvars --install lib`' + '/libtdeui.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 + "/ntqlayout.h"):
# The user told where to look for and it looks valid
print GREEN + "ok " + qtincludes + NORMAL
else:
if os.path.isfile(qtdir + "/include/ntqlayout.h"):
# Automatic detection
print GREEN + "ok " + qtdir + "/include/ " + NORMAL
qtincludes = qtdir + "/include/"
elif os.path.isfile("/usr/include/qt3/ntqlayout.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("tde-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/tde/klineedit.h"):
# Debian, Fedora probably
print YELLOW + "the kde headers were found in " + kdeprefix + "/include/tde/" + NORMAL
kdeincludes = kdeprefix + "/include/tde/"
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('tde-config --install exe').read().strip())
env['KDEAPPS'] = subst_vars(os.popen('tde-config --install apps').read().strip())
env['KDEDATA'] = subst_vars(os.popen('tde-config --install data').read().strip())
env['KDEMODULE']= subst_vars(os.popen('tde-config --install module').read().strip())
env['KDELOCALE']= subst_vars(os.popen('tde-config --install locale').read().strip())
env['KDEDOC'] = subst_vars( debian_fix(os.popen('tde-config --install html').read().strip()) )
env['KDEKCFG'] = subst_vars(os.popen('tde-config --install kcfg').read().strip())
env['KDEXDG'] = subst_vars(os.popen('tde-config --install xdgdata-apps').read().strip())
env['KDEMENU'] = subst_vars(os.popen('tde-config --install apps').read().strip())
env['KDEMIME'] = subst_vars(os.popen('tde-config --install mime').read().strip())
env['KDEICONS'] = subst_vars(os.popen('tde-config --install icon').read().strip())
env['KDESERV'] = subst_vars(os.popen('tde-config --install services').read().strip())
else:
# the user has given no prefix, install as a normal kde app
env['PREFIX'] = os.popen('tde-config --prefix').read().strip()
env['KDEBIN'] = os.popen('tde-config --expandvars --install exe').read().strip()
env['KDEAPPS'] = os.popen('tde-config --expandvars --install apps').read().strip()
env['KDEDATA'] = os.popen('tde-config --expandvars --install data').read().strip()
env['KDEMODULE']= os.popen('tde-config --expandvars --install module').read().strip()
env['KDELOCALE']= os.popen('tde-config --expandvars --install locale').read().strip()
env['KDEDOC'] = os.popen('tde-config --expandvars --install html').read().strip()
env['KDEKCFG'] = os.popen('tde-config --expandvars --install kcfg').read().strip()
env['KDEXDG'] = os.popen('tde-config --expandvars --install xdgdata-apps').read().strip()
env['KDEMENU'] = os.popen('tde-config --expandvars --install apps').read().strip()
env['KDEMIME'] = os.popen('tde-config --expandvars --install mime').read().strip()
env['KDEICONS'] = os.popen('tde-config --expandvars --install icon').read().strip()
env['KDESERV'] = os.popen('tde-config --expandvars --install services').read().strip()

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

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

## 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/tde on debian, ...)
"""+BOLD+"""* qtincludes """+NORMAL+""": same punishment, for qt includes (/usr/include/qt on debian, ...)
"""+BOLD+"""* tdelibs """+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'),
( 'TDEDIR', '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('TDEDIR'):
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'] = 'tqt-mt'
env['LIBTOOL_FLAGS'] = '--silent --mode=compile --tag=CXX'
env['QT_UICIMPLPREFIX'] = ''
env['QT_UICIMPLSUFFIX'] = '.cpp'
env['QT_MOCHPREFIX'] = ''
env['QT_MOCHSUFFIX'] = '.moc'
env['KDE_KCFG_IMPLPREFIX'] = ''
env['KDE_KCFG_IMPL_HSUFFIX'] = '.h'
env['KDE_KCFG_IMPL_CSUFFIX'] = '.cpp'
env['KDE_SKEL_IMPL_SUFFIX'] = '.skel'
env['MEINPROC'] = 'meinproc'
env['MSGFMT'] = 'msgfmt'


###### ui file processing
def uicGenerator(target, source, env, for_signature):
act=[]
act.append('$QT_UIC $QT_UIC_HFLAGS -o '+target[0].path+' '+source[0].path)
act.append('rm -f ' +target[1].path)
act.append('echo \'#include <tdelocale.h>\' >> '+target[1].path)
act.append('echo \'#include <kdialog.h>\' >> '+target[1].path)
act.append('$QT_UIC $QT_UIC_CFLAGS -impl '+target[0].path+' -o '+target[1].path+'.tmp '+source[0].path)
act.append('cat '+target[1].path+'.tmp >> '+target[1].path)
act.append('rm -f '+target[1].path+'.tmp')
act.append('echo \'#include "' + target[2].name + '"\' >> '+target[1].path)
act.append('$QT_MOC -o '+target[2].path+' '+target[0].path)
return act
def uicEmitter(target, source, env):
adjustixes = SCons.Util.adjustixes
bs = SCons.Util.splitext(str(source[0].name))[0]
bs = os.path.join(str(target[0].get_dir()),bs)
# first target is automatically added by builder (.h file)
if len(target) < 2:
# second target is .cpp file
target.append(adjustixes(bs,
env.subst('$QT_UICIMPLPREFIX'),
env.subst('$QT_UICIMPLSUFFIX')))
if len(target) < 3:
# third target is .moc file
target.append(adjustixes(bs,
env.subst('$QT_MOCHPREFIX'),
env.subst('$QT_MOCHSUFFIX')))
return target, source
UIC_BUILDER = Builder(
generator = uicGenerator,
emitter = uicEmitter,
suffix = '.h',
src_suffix = '.ui' )
###### moc file processing
env['QT_MOCCOM'] = ('$QT_MOC -o ${TARGETS[0]} $SOURCE')
MOC_BUILDER = Builder(
action = '$QT_MOCCOM',
suffix = '.moc',
src_suffix = '.h' )
MOCCPP_BUILDER = Builder(
action = '$QT_MOCCOM',
suffix = '_moc.cpp',
src_suffix = '.h' )
###### kcfg file processing
def kcfgGenerator(target, source, env, for_signature):
act=[]
act.append('tdeconfig_compiler -d'+str(source[0].get_dir())+' '+source[1].path+' '+source[0].path)
return act
def kcfgEmitter(target, source, env):
adjustixes = SCons.Util.adjustixes
bs = SCons.Util.splitext(str(source[0].name))[0]
bs = os.path.join(str(target[0].get_dir()),bs)
# first target is automatically added by builder (.h file)
if len(target) < 2:
# second target is .cpp file
target.append(adjustixes(bs, env.subst('$KDE_KCFG_IMPLPREFIX'), env.subst('$KDE_KCFG_IMPL_CSUFFIX')))
# find_file(kcfgfile, (source[0].get_dir(),) ,SCons.Node.FS.default_fs)
if len(source) <2:
if not os.path.isfile(str(source[0])):
print RED+'kcfg file given'+str(source[0])+' does not exist !'+NORMAL
return target, source
kfcgfilename = ""
kcfgFileDeclRx = re.compile("^[fF]ile\s*=\s*(.+)\s*$")
for line in file(str(source[0]), "r").readlines():
match = kcfgFileDeclRx.match(line.strip())
if match:
kcfgfilename = match.group(1)
break
source.append( str(source[0].get_dir())+'/'+kcfgfilename )
return target, source

KCFG_BUILDER = Builder(
generator = kcfgGenerator,
emitter = kcfgEmitter,
suffix = '.h',
src_suffix = '.kcfgc' )
###### dcop processing
def dcopGenerator(target, source, env, for_signature):
act=[]
act.append('dcopidl '+source[0].path+' > '+target[1].path+'|| ( rm -f '+target[1].path+' ; false )')
act.append('dcopidl2cpp --c++-suffix cpp --no-signals --no-stub '+target[1].path)
return act

def dcopEmitter(target, source, env):
bs = SCons.Util.splitext(str(source[0].name))[0]
bs = os.path.join(str(target[0].get_dir()),bs)
target.append(bs+'.kidl')
#target.append(bs+'_skel.cpp')
return target, source

DCOP_BUILDER = Builder(
generator = dcopGenerator,
emitter = dcopEmitter,
suffix = '_skel.cpp',
src_suffix = '.h' )

###### documentation (meinproc) processing
MEINPROC_BUILDER = Builder(
action = '$MEINPROC --check --cache $TARGET $SOURCE',
suffix = '.cache.bz2',
src_suffix = '.docbook' )

###### translation files builder
TRANSFILES_BUILDER = Builder(
action = '$MSGFMT $SOURCE -o $TARGET',
suffix = '.gmo',
src_suffix = '.po' )

###### libtool file builder
def laGenerator(target, source, env, for_signature):
act=[]
act.append('echo "dlname=\''+source[0].name+'\'" > '+target[0].path)
act.append('echo "library_names=\''+source[0].name+' '+source[0].name+' '+source[0].name+'\'" >> '+target[0].path)
act.append('echo "old_library=\'\'">> '+target[0].path)
act.append('echo "dependency_libs=\'\'">> '+target[0].path)
act.append('echo "current=0">> '+target[0].path)
act.append('echo "age=0">> '+target[0].path)
act.append('echo "revision=0">> '+target[0].path)
act.append('echo "installed=yes">> '+target[0].path)
act.append('echo "shouldnotlink=no">> '+target[0].path)
act.append('echo "dlopen=\'\'">> '+target[0].path)
act.append('echo "dlpreopen=\'\'">> '+target[0].path)
act.append('echo "libdir=\''+env['KDEMODULE']+'\'" >> '+target[0].path)
return act
LA_BUILDER = Builder(
generator = laGenerator,
suffix = '.la',
src_suffix = '.so' )
####### TODO : real libtool builder (but i hate libtool - ita)
# def libtoolGenerator(target, source, env, for_signature):
# act=[]
# act.append('libtool $LIBTOOL_FLAGS $CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o '+target[0].path+' '+source[0].path)
# return act
# LIBTOOL_BUILDER = Builder(
# generator = libtoolGenerator,
# suffix = '.lo',
# src_suffix = '.cpp' )

##### register the builders
env['BUILDERS']['Uic'] = UIC_BUILDER
env['BUILDERS']['Moc'] = MOC_BUILDER
env['BUILDERS']['Moccpp'] = MOCCPP_BUILDER
env['BUILDERS']['Dcop'] = DCOP_BUILDER
env['BUILDERS']['Kcfg'] = KCFG_BUILDER
env['BUILDERS']['LaFile'] = LA_BUILDER
#env['BUILDERS']['Libtool'] = LIBTOOL_BUILDER
env['BUILDERS']['Meinproc'] = MEINPROC_BUILDER
env['BUILDERS']['Transfiles'] = TRANSFILES_BUILDER

static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
static_obj.src_builder.append('Uic')
shared_obj.src_builder.append('Uic')
static_obj.src_builder.append('Kcfg')
shared_obj.src_builder.append('Kcfg')
static_obj.src_builder.append('LaFile')
shared_obj.src_builder.append('LaFile')
static_obj.src_builder.append('Meinproc')
shared_obj.src_builder.append('Meinproc')
static_obj.src_builder.append('Transfiles')
shared_obj.src_builder.append('Transfiles')

## find the files to moc, dcop, and link against kde and qt
env.AppendUnique(PROGEMITTER = [MetasourcesStatic], SHLIBEMITTER=[MetasourcesShared], LIBEMITTER =[MetasourcesStatic])

###########################################
## Handy helpers for building kde programs
## You should not have to modify them ..

import SCons.Util
skel_ext = [".skel", ".SKEL"]
def KDEfiles(target, source, env):
"""
Returns a list of files for scons (handles kde tricks like .skel)
It also makes custom checks against double includes like : ['file.ui', 'file.cpp']
(file.cpp is already included because of file.ui)
"""
src=[]
ui_files=[]
kcfg_files=[]
skel_files=[]
other_files=[]

# For each file, check wether it is a dcop file or not, and create the complete list of sources
for file in source:
bs = SCons.Util.splitext(file)[0]
ext = SCons.Util.splitext(file)[1]
if ext in skel_ext:
env.Dcop(bs+'.h')
src.append(bs+'_skel.cpp')
else:
src.append(file)

if ext == '.ui':
ui_files.append(bs)
elif ext == '.kcfgc':
kcfg_files.append(bs)
elif ext == '.skel':
skel_files.append(bs)
else:
other_files.append(bs)
# Now check against newbie errors
for file in ui_files:
for ofile in other_files:
if ofile == file:
print RED+"WARNING: You have included "+file+".ui and another file of the same prefix"+NORMAL
print "Files generated by uic (file.h, file.cpp must not be included"
for file in kcfg_files:
for ofile in other_files:
if ofile == file:
print RED+"WARNING: You have included "+file+".kcfg and another file of the same prefix"+NORMAL
print "Files generated by tdeconfig_compiler (settings.h, settings.cpp) must not be included"
#for file in skel_files:
# for ofile in other_files:
# if ofile == file:
# print RED+"WARNING: source contain "+file+".skel and another file of the same prefix"+NORMAL
# print "Files generated automatically from .skel file must not be included (file.h, file.idl)"
<