added Hello, World! minimal implementation of the GUI

just as a start...
This commit is contained in:
maroy 2004-11-16 14:16:42 +00:00
parent ca278cecdd
commit 46d249a1a1
11 changed files with 1844 additions and 0 deletions

View File

@ -0,0 +1,87 @@
#!/bin/sh
#-------------------------------------------------------------------------------
# Copyright (c) 2004 Media Development Loan Fund
#
# This file is part of the LiveSupport project.
# http://livesupport.campware.org/
# To report bugs, send an e-mail to bugs@campware.org
#
# LiveSupport 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.
#
# LiveSupport 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 LiveSupport; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.1 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/bin/autogen.sh,v $
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Run this to set up the build system: configure, makefiles, etc.
# (based on the version in enlightenment's cvs)
#-------------------------------------------------------------------------------
package="gLiveSupport"
# assume we're in $basedir/bin
basedir=`dirname $0`/..
test -z "$basedir" && basedir=.
tmpdir=$basedir/tmp
cd "$tmpdir"
DIE=0
# look at all other directories as seen from ${basedir}/tmp
tmpdir=.
bindir=../bin
etcdir=../etc
(autoheader --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile $package."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile $package."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
fi
echo "Generating configuration files for $package, please wait...."
configure_ac=${etcdir}/configure.ac
configure=${tmpdir}/configure
#echo " aclocal $ACLOCAL_FLAGS"
#aclocal $ACLOCAL_FLAGS
echo " autoheader ${configure_ac}"
autoheader ${configure_ac}
echo " autoconf -o ${configure} ${configure_ac}"
autoconf -o ${configure} ${configure_ac}
${configure} "$@" && echo

View File

@ -0,0 +1,80 @@
#!/bin/sh
#-------------------------------------------------------------------------------
# Copyright (c) 2004 Media Development Loan Fund
#
# This file is part of the LiveSupport project.
# http://livesupport.campware.org/
# To report bugs, send an e-mail to bugs@campware.org
#
# LiveSupport 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.
#
# LiveSupport 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 LiveSupport; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.1 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/bin/gen_coverage_data.sh,v $
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# This script generates code coverage data for the module
#-------------------------------------------------------------------------------
module="LiveSupport GUI"
reldir=`dirname $0`/..
basedir=`cd $reldir; pwd; cd -`
bindir=$basedir/bin
docdir=$basedir/doc
tmpdir=$basedir/tmp
usrdir=`cd $basedir/../../usr; pwd; cd -`
coverage_report_dir=$docdir/coverage
raw_coverage_file=$tmpdir/raw_coverage.info
coverage_file=$tmpdir/coverage.info
lcov=$usrdir/bin/lcov
genhtml=$usrdir/bin/genhtml
cd $basedir
#-------------------------------------------------------------------------------
# Re-configure with covarege collection enabled, compile and run the tests
#-------------------------------------------------------------------------------
$bindir/autogen.sh --enable-coverage
make clean
make check
#-------------------------------------------------------------------------------
# Generate some symlinks so that the sources are visible from tmpdir
#-------------------------------------------------------------------------------
ln -s $basedir/include $tmpdir/include
ln -s $basedir/src $tmpdir/src
#-------------------------------------------------------------------------------
# Use lcov to generate an HTML report on the coverage data
#-------------------------------------------------------------------------------
$lcov -d $tmpdir -c > $raw_coverage_file
$lcov -e $raw_coverage_file "$tmpdir/*" > $coverage_file
rm -rf $coverage_report_dir
mkdir -p $coverage_report_dir
$genhtml -t "$module" -o $coverage_report_dir $coverage_file
#-------------------------------------------------------------------------------
# Clean up
#-------------------------------------------------------------------------------
rm -f $tmpdir/include
rm -f $tmpdir/src

View File

@ -0,0 +1 @@
keep me

View File

@ -0,0 +1,190 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2004 Media Development Loan Fund
#
# This file is part of the LiveSupport project.
# http://livesupport.campware.org/
# To report bugs, send an e-mail to bugs@campware.org
#
# LiveSupport 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.
#
# LiveSupport 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 LiveSupport; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.1 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/etc/Makefile.in,v $
#
# @configure_input@
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# General command definitions
#-------------------------------------------------------------------------------
MKDIR = mkdir -p
RM = rm -f
RMDIR = rm -rf
DOXYGEN = doxygen
#-------------------------------------------------------------------------------
# Basic directory and file definitions
#-------------------------------------------------------------------------------
BASE_DIR = @builddir@
DOC_DIR = ${BASE_DIR}/doc
DOXYGEN_DIR = ${DOC_DIR}/doxygen
COVERAGE_DIR = ${DOC_DIR}/coverage
ETC_DIR = ${BASE_DIR}/etc
SRC_DIR = ${BASE_DIR}/src
TMP_DIR = ${BASE_DIR}/tmp
USR_DIR = ${BASE_DIR}/../../usr
USR_INCLUDE_DIR = ${USR_DIR}/include
USR_LIB_DIR = ${USR_DIR}/lib
BOOST_INCLUDE_DIR = ${USR_INCLUDE_DIR}/boost-1_31
LIBXMLPP_INCLUDE_DIR = ${USR_INCLUDE_DIR}/libxml++-1.0
VPATH = ${SRC_DIR}
MODULES_DIR = ${BASE_DIR}/../../modules
CORE_DIR = ${MODULES_DIR}/core
CORE_INCLUDE_DIR = ${CORE_DIR}/include
CORE_LIB_DIR = ${CORE_DIR}/lib
CORE_LIB = livesupport_core
CORE_LIB_FILE = ${CORE_LIB_DIR}/lib${CORE_LIB}.a
STORAGE_DIR = ${MODULES_DIR}/storage
STORAGE_INCLUDE_DIR = ${STORAGE_DIR}/include
STORAGE_LIB_DIR = ${STORAGE_DIR}/lib
STORAGE_LIB = livesupport_storage
STORAGE_LIB_FILE = ${STORAGE_LIB_DIR}/lib${STORAGE_LIB}.a
GTKMM_CFLAGS=`pkg-config gtkmm-2.0 --cflags`
GTKMM_LIBS=`pkg-config gtkmm-2.0 --libs`
TEST_RESULTS = ${DOC_DIR}/testResults.xml
# the text result XSLT has to be relative to the test result file, e.g. TMP_DIR
TEST_XSLT = ../etc/testResultToHtml.xsl
G_LIVESUPPORT_EXE = ${TMP_DIR}/gLiveSupport
G_LIVESUPPORT_CFG = ${ETC_DIR}/gLiveSupport.xml
TEST_RUNNER = ${TMP_DIR}/testRunner
DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config
#-------------------------------------------------------------------------------
# Configuration parameters
#-------------------------------------------------------------------------------
CPPFLAGS = @CPPFLAGS@
CXXFLAGS = @CXXFLAGS@ @DEFS@ @COVERAGE_CXXFLAGS@ \
-pedantic -Wall -Wno-long-long \
${GTKMM_CFLAGS} \
-I${USR_INCLUDE_DIR} \
-I${BOOST_INCLUDE_DIR} \
-I${LIBXMLPP_INCLUDE_DIR} \
-I${CORE_INCLUDE_DIR} \
-I${STORAGE_INCLUDE_DIR} \
-I${TMP_DIR}
LDFLAGS = @LDFLAGS@ -L${USR_LIB_DIR} \
-L${CORE_LIB_DIR} \
-L${STORAGE_LIB_DIR}
#-------------------------------------------------------------------------------
# Dependencies
#-------------------------------------------------------------------------------
G_LIVESUPPORT_OBJS = ${TMP_DIR}/HelloWorld.o
G_LIVESUPPORT_EXE_OBJS = ${G_LIVESUPPORT_OBJS} \
${TMP_DIR}/main.o
G_LIVESUPPORT_EXE_LIBS = -l${STORAGE_LIB} -l${CORE_LIB} \
${GTKMM_LIBS} \
-lboost_date_time-gcc \
-lxmlrpc++ -lssl -lxml++-1.0
TEST_RUNNER_OBJS = ${G_LIVESUPPORT_OBJS} \
${TMP_DIR}/TestRunner.o
TEST_RUNNER_LIBS = ${G_LIVESUPPORT_EXE_LIBS} -lcppunit -ldl
#-------------------------------------------------------------------------------
# Targets
#-------------------------------------------------------------------------------
.PHONY: all dir_setup doc clean docclean depclean distclean
.PHONY: install start run_tests stop uninstall
all: dir_setup ${G_LIVESUPPORT_EXE}
dir_setup: ${TMP_DIR} ${DOXYGEN_DIR}
doc:
${DOXYGEN} ${DOXYGEN_CONFIG}
clean:
${RM} ${G_LIVESUPPORT_EXE_OBJS} ${G_LIVESUPPORT_EXE}
${RM} ${TEST_RUNNER_OBJS} ${TEST_RUNNER}
${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da ${TMP_DIR}/*.info
docclean:
${RMDIR} ${DOXYGEN_DIR}/html
${RMDIR} ${COVERAGE_DIR}/*
${RM} ${TEST_RESULTS}
depclean: clean
${MAKE} -C ${STORAGE_DIR} clean
${MAKE} -C ${CORE_DIR} clean
distclean: clean docclean
${RMDIR} ${TMP_DIR}/config* ${TMP_DIR}/autom4te*
check: all ${TEST_RUNNER} run_tests
run_tests: ${TEST_RUNNER}
LD_LIBRARY_PATH=${USR_LIB_DIR} ${TEST_RUNNER} \
-o ${TEST_RESULTS} -s ${TEST_XSLT}
run: ${G_LIVESUPPORT_EXE}
LD_LIBRARY_PATH=${USR_LIB_DIR} ${G_LIVESUPPORT_EXE}
#-------------------------------------------------------------------------------
# Specific targets
#-------------------------------------------------------------------------------
${G_LIVESUPPORT_EXE}: ${CORE_LIB_FILE} ${STORAGE_LIB_FILE} \
${G_LIVESUPPORT_EXE_OBJS}
${CXX} ${LDFLAGS} -o $@ $^ ${G_LIVESUPPORT_EXE_LIBS}
${TMP_DIR}:
${MKDIR} ${TMP_DIR}
${DOXYGEN_DIR}:
${MKDIR} ${DOXYGEN_DIR}
${TEST_RUNNER}: ${CORE_LIB_FILE} ${STORAGE_LIB_FILE} \
${TEST_RUNNER_OBJS}
${CXX} ${LDFLAGS} -o $@ ${TEST_RUNNER_OBJS} ${TEST_RUNNER_LIBS}
${CORE_LIB_FILE}:
${MAKE} -C ${CORE_DIR}
${STORAGE_LIB_FILE}:
${MAKE} -C ${STORAGE_DIR}
#-------------------------------------------------------------------------------
# Pattern rules
#-------------------------------------------------------------------------------
${TMP_DIR}/%.o : ${SRC_DIR}/%.cxx
${CXX} ${CPPFLAGS} ${CXXFLAGS} -c -o $@ $<

View File

@ -0,0 +1,67 @@
dnl-----------------------------------------------------------------------------
dnl Copyright (c) 2004 Media Development Loan Fund
dnl
dnl This file is part of the LiveSupport project.
dnl http://livesupport.campware.org/
dnl To report bugs, send an e-mail to bugs@campware.org
dnl
dnl LiveSupport is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl LiveSupport is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with LiveSupport; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
dnl
dnl Author : $Author: maroy $
dnl Version : $Revision: 1.1 $
dnl Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/etc/configure.ac,v $
dnl-----------------------------------------------------------------------------
dnl-----------------------------------------------------------------------------
dnl NOTE: Run all configure related scripts from the tmp directory of the
dnl project.
dnl This is due to the fact that configure spreads a lot of trash around,
dnl like atom4te cache directories, config.* files, etc. into the directory
dnl it is being run from. We clearly don't want these in our base directory.
dnl-----------------------------------------------------------------------------
AC_INIT(gLiveSupport, 0.1, bugs@campware.org)
AC_PREREQ(2.59)
AC_COPYRIGHT([Copyright (c) 2004 Media Development Loan Fund under the GNU GPL])
AC_REVISION($Revision: 1.1 $)
AC_CONFIG_SRCDIR(../src/main.cxx)
AC_CONFIG_HEADERS(configure.h)
AC_PROG_CXX()
AC_CHECK_HEADERS(sys/types.h unistd.h getopt.h signal.h sys/stat.h time.h)
AC_CHECK_HEADERS(stdio.h fcntl.h pthread.h sys/time.h)
dnl-----------------------------------------------------------------------------
dnl enable compilaton for code coverage data
dnl-----------------------------------------------------------------------------
AC_SUBST(COVERAGE_CXXFLAGS)
AC_ARG_ENABLE( coverage,
[ --enable-coverage enable code coverage data generaton (no) ],
ENABLE_COVERAGE=${enableval}, ENABLE_COVERAGE="no" )
if test "x${ENABLE_COVERAGE}" == "xyes" ; then
COVERAGE_CXXFLAGS="-fprofile-arcs -ftest-coverage"
AC_MSG_RESULT([compiling in code coverage mode])
else
AC_MSG_RESULT([not compiling in code coverage mode])
fi
AC_CONFIG_FILES(../Makefile:../etc/Makefile.in)
AC_OUTPUT()

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
keep me

View File

@ -0,0 +1,95 @@
/*------------------------------------------------------------------------------
Copyright (c) 2004 Media Development Loan Fund
This file is part of the LiveSupport project.
http://livesupport.campware.org/
To report bugs, send an e-mail to bugs@campware.org
LiveSupport 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.
LiveSupport 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 LiveSupport; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/HelloWorld.cxx,v $
------------------------------------------------------------------------------*/
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include <iostream>
#include "HelloWorld.h"
using namespace LiveSupport::GLiveSupport;
/* =================================================== local data structures */
/* ================================================ local constants & macros */
/**
* The Hello, World! string
*/
static std::string helloWorld("Hello, World!");
/* =============================================== local function prototypes */
/* ============================================================= module code */
/*------------------------------------------------------------------------------
* Constructor.
*----------------------------------------------------------------------------*/
HelloWorld :: HelloWorld (void) throw ()
: button(helloWorld)
{
// Sets the border width of the window.
set_border_width(10);
// Register the signal handler for the button getting clicked.
button.signal_clicked().connect(slot(*this, &HelloWorld::onButtonClicked));
// This packs the button into the Window (a container).
add(button);
// The final step is to display this newly created widget...
button.show();
}
/*------------------------------------------------------------------------------
* Destructor.
*----------------------------------------------------------------------------*/
HelloWorld :: ~HelloWorld (void) throw ()
{
}
/*------------------------------------------------------------------------------
* Event handler for the button getting clicked.
*----------------------------------------------------------------------------*/
void
HelloWorld :: onButtonClicked (void) throw ()
{
std::cout << helloWorld << std::endl;
}

View File

@ -0,0 +1,103 @@
/*------------------------------------------------------------------------------
Copyright (c) 2004 Media Development Loan Fund
This file is part of the LiveSupport project.
http://livesupport.campware.org/
To report bugs, send an e-mail to bugs@campware.org
LiveSupport 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.
LiveSupport 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 LiveSupport; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/HelloWorld.h,v $
------------------------------------------------------------------------------*/
#ifndef HelloWorld_h
#define HelloWorld_h
#ifndef __cplusplus
#error This is a C++ include file
#endif
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include <gtkmm/button.h>
#include <gtkmm/window.h>
namespace LiveSupport {
namespace GLiveSupport {
/* ================================================================ constants */
/* =================================================================== macros */
/* =============================================================== data types */
/**
* A simple window, just saying "Hello, World!"
*
* @author $Author: maroy $
* @version $Revision: 1.1 $
*/
class HelloWorld : public Gtk::Window
{
protected:
/**
* The only button in the window.
*/
Gtk::Button button;
/**
* Signal handler for the only button clicked.
*/
virtual void
onButtonClicked(void) throw ();
public:
/**
* Constructor.
*/
HelloWorld(void) throw ();
/**
* Virtual destructor.
*/
virtual
~HelloWorld(void) throw ();
};
/* ================================================= external data structures */
/* ====================================================== function prototypes */
} // namespace GLiveSupport
} // namespace LiveSupport
#endif // HelloWorld_h

View File

@ -0,0 +1,74 @@
/*------------------------------------------------------------------------------
Copyright (c) 2004 Media Development Loan Fund
This file is part of the LiveSupport project.
http://livesupport.campware.org/
To report bugs, send an e-mail to bugs@campware.org
LiveSupport 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.
LiveSupport 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 LiveSupport; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Author : $Author: maroy $
Version : $Revision: 1.1 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/main.cxx,v $
------------------------------------------------------------------------------*/
/** @file
* This file contains the main entry point to the Scheduler daemon.
*/
/* ============================================================ include files */
#ifdef HAVE_CONFIG_H
#include "configure.h"
#endif
#include <gtkmm/main.h>
#include "HelloWorld.h"
using namespace LiveSupport::GLiveSupport;
/* =================================================== local data structures */
/* ================================================ local constants & macros */
/* =============================================== local function prototypes */
/* ============================================================= module code */
/**
* Program entry point.
*
* @param argc the number of command line arguments passed by the user.
* @param argv the command line arguments passed by the user.
* @return 0 on success, non-0 on failure.
*/
int main ( int argc,
char * argv[] )
{
Gtk::Main kit(argc, argv);
HelloWorld helloworld;
// Shows the window and returns when it is closed.
Gtk::Main::run(helloworld);
return 0;
}

View File

@ -0,0 +1 @@
keep me