From 39e919c5b915934a81a1fa5143df813d3dda801b Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 25 Jan 2011 17:16:40 +0100 Subject: updated --- src/.cproject | 141 ++++++++++++++++++++++++++++++++++ src/.project | 88 ++++++++++++++++++++++ src/Makefile.Debug | 179 ++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.Release | 179 ++++++++++++++++++++++++++++++++++++++++++++ src/debug/fbbrowser.o | Bin 0 -> 229592 bytes src/debug/main.o | Bin 0 -> 296420 bytes src/debug/moc_fbbrowser.cpp | 69 +++++++++++++++++ src/debug/moc_fbbrowser.o | Bin 0 -> 237684 bytes src/fbbrowser.cpp | 89 ++++++++++++++++++++++ src/fbbrowser.h | 40 ++++++++++ src/fbbrowser.ui | 19 +++++ src/fbgui.cpp | 83 ++++++++++++++++++++ src/fbgui.h | 28 +++++++ src/fbgui.pro | 12 +++ src/fbgui.qrc | 5 ++ src/html/errorPage.html | 32 ++++++++ src/testApp.sh | 22 ++++++ 17 files changed, 986 insertions(+) create mode 100644 src/.cproject create mode 100644 src/.project create mode 100644 src/Makefile.Debug create mode 100644 src/Makefile.Release create mode 100644 src/debug/fbbrowser.o create mode 100644 src/debug/main.o create mode 100644 src/debug/moc_fbbrowser.cpp create mode 100644 src/debug/moc_fbbrowser.o create mode 100644 src/fbbrowser.cpp create mode 100644 src/fbbrowser.h create mode 100644 src/fbbrowser.ui create mode 100644 src/fbgui.cpp create mode 100644 src/fbgui.h create mode 100644 src/fbgui.pro create mode 100644 src/fbgui.qrc create mode 100644 src/html/errorPage.html create mode 100755 src/testApp.sh (limited to 'src') diff --git a/src/.cproject b/src/.cproject new file mode 100644 index 0000000..08a2b7b --- /dev/null +++ b/src/.cproject @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + make + + release + false + false + true + + + make + + debug + false + false + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/.project b/src/.project new file mode 100644 index 0000000..477155b --- /dev/null +++ b/src/.project @@ -0,0 +1,88 @@ + + + fbbrowser + + + + + + com.trolltech.qtcppproject.QtMakefileGenerator + + + + + org.eclipse.cdt.make.core.makeBuilder + clean,full,incremental, + + + org.eclipse.cdt.core.errorOutputParser + org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.MakeErrorParser; + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.build.arguments + + + + org.eclipse.cdt.make.core.build.command + make + + + org.eclipse.cdt.make.core.build.target.auto + debug + + + org.eclipse.cdt.make.core.build.target.clean + clean + + + org.eclipse.cdt.make.core.build.target.inc + debug + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.enabledIncrementalBuild + true + + + org.eclipse.cdt.make.core.environment + PATH=/usr/local/Trolltech/QtEmbedded-4.7.1/bin:${env_var:PATH}:${env_var:PATH}| + + + org.eclipse.cdt.make.core.stopOnError + false + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + false + + + + + org.eclipse.cdt.make.core.ScannerConfigBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.make.core.makeNature + org.eclipse.cdt.make.core.ScannerConfigNature + com.trolltech.qtcppproject.QtNature + + diff --git a/src/Makefile.Debug b/src/Makefile.Debug new file mode 100644 index 0000000..6758861 --- /dev/null +++ b/src/Makefile.Debug @@ -0,0 +1,179 @@ +############################################################################# +# Makefile for building: fbbrowser +# Generated by qmake (2.01a) (Qt 4.7.1) on: Wed Jan 12 12:12:05 2011 +# Project: fbbrowser.pro +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) +CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT $(DEFINES) +INCPATH = -I/usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/qws/linux-x86-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.7.1/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.7.1/include/QtNetwork -I/usr/local/Trolltech/QtEmbedded-4.7.1/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.7.1/include -Idebug -I. +LINK = g++ +LFLAGS = -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.7.1/lib +LIBS = $(SUBLIBS) -L/usr/local/Trolltech/QtEmbedded-4.7.1/lib -lQtGui -L/usr/local/Trolltech/QtEmbedded-4.7.1/lib -lQtNetwork -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/local/Trolltech/QtEmbedded-4.7.1/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = debug/ + +####### Files + +SOURCES = main.cpp \ + fbbrowser.cpp debug/moc_fbbrowser.cpp +OBJECTS = debug/main.o \ + debug/fbbrowser.o \ + debug/moc_fbbrowser.o +DIST = /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/common/g++.conf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/common/unix.conf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/common/linux.conf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/common/qws.conf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/qconfig.pri \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/modules/qt_webkit_version.pri \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/qt_functions.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/qt_config.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/exclusive_builds.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/default_pre.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/debug.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/debug_and_release.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/default_post.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/build_pass.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/warn_on.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/qt.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/unix/thread.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/moc.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/resources.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/uic.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/yacc.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/lex.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/include_source_dir.prf \ + fbbrowser.pro +QMAKE_TARGET = fbbrowser +DESTDIR = +TARGET = fbbrowser + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile.Debug $(TARGET) + +$(TARGET): ui_fbbrowser.h $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +qmake: FORCE + @$(QMAKE) CONFIG+=debug_and_release -o Makefile.Debug fbbrowser.pro + +dist: + @$(CHK_DIR_EXISTS) debug/fbbrowser1.0.0 || $(MKDIR) debug/fbbrowser1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) debug/fbbrowser1.0.0/ && $(COPY_FILE) --parents fbbrowser.h debug/fbbrowser1.0.0/ && $(COPY_FILE) --parents main.cpp fbbrowser.cpp debug/fbbrowser1.0.0/ && $(COPY_FILE) --parents fbbrowser.ui debug/fbbrowser1.0.0/ && (cd `dirname debug/fbbrowser1.0.0` && $(TAR) fbbrowser1.0.0.tar fbbrowser1.0.0 && $(COMPRESS) fbbrowser1.0.0.tar) && $(MOVE) `dirname debug/fbbrowser1.0.0`/fbbrowser1.0.0.tar.gz . && $(DEL_FILE) -r debug/fbbrowser1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile.Debug + + +check: first + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +compiler_moc_header_make_all: debug/moc_fbbrowser.cpp +compiler_moc_header_clean: + -$(DEL_FILE) debug/moc_fbbrowser.cpp +debug/moc_fbbrowser.cpp: ui_fbbrowser.h \ + fbbrowser.h + /usr/local/Trolltech/QtEmbedded-4.7.1/bin/moc $(DEFINES) $(INCPATH) fbbrowser.h -o debug/moc_fbbrowser.cpp + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_image_collection_make_all: qmake_image_collection.cpp +compiler_image_collection_clean: + -$(DEL_FILE) qmake_image_collection.cpp +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: ui_fbbrowser.h +compiler_uic_clean: + -$(DEL_FILE) ui_fbbrowser.h +ui_fbbrowser.h: fbbrowser.ui + /usr/local/Trolltech/QtEmbedded-4.7.1/bin/uic fbbrowser.ui -o ui_fbbrowser.h + +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_moc_header_clean compiler_uic_clean + +####### Compile + +debug/main.o: main.cpp fbbrowser.h \ + ui_fbbrowser.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/main.o main.cpp + +debug/fbbrowser.o: fbbrowser.cpp fbbrowser.h \ + ui_fbbrowser.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/fbbrowser.o fbbrowser.cpp + +debug/moc_fbbrowser.o: debug/moc_fbbrowser.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_fbbrowser.o debug/moc_fbbrowser.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/src/Makefile.Release b/src/Makefile.Release new file mode 100644 index 0000000..cbe28a3 --- /dev/null +++ b/src/Makefile.Release @@ -0,0 +1,179 @@ +############################################################################# +# Makefile for building: fbbrowser +# Generated by qmake (2.01a) (Qt 4.7.1) on: Wed Jan 12 12:12:05 2011 +# Project: fbbrowser.pro +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) +CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) +INCPATH = -I/usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/qws/linux-x86-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.7.1/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.7.1/include/QtNetwork -I/usr/local/Trolltech/QtEmbedded-4.7.1/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.7.1/include -Irelease -I. +LINK = g++ +LFLAGS = -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.7.1/lib +LIBS = $(SUBLIBS) -L/usr/local/Trolltech/QtEmbedded-4.7.1/lib -lQtGui -L/usr/local/Trolltech/QtEmbedded-4.7.1/lib -lQtNetwork -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/local/Trolltech/QtEmbedded-4.7.1/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = release/ + +####### Files + +SOURCES = main.cpp \ + fbbrowser.cpp release/moc_fbbrowser.cpp +OBJECTS = release/main.o \ + release/fbbrowser.o \ + release/moc_fbbrowser.o +DIST = /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/common/g++.conf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/common/unix.conf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/common/linux.conf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/common/qws.conf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/qconfig.pri \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/modules/qt_webkit_version.pri \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/qt_functions.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/qt_config.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/exclusive_builds.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/default_pre.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/release.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/debug_and_release.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/default_post.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/build_pass.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/warn_on.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/qt.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/unix/thread.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/moc.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/resources.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/uic.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/yacc.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/lex.prf \ + /usr/local/Trolltech/QtEmbedded-4.7.1/mkspecs/features/include_source_dir.prf \ + fbbrowser.pro +QMAKE_TARGET = fbbrowser +DESTDIR = +TARGET = fbbrowser + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile.Release $(TARGET) + +$(TARGET): ui_fbbrowser.h $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +qmake: FORCE + @$(QMAKE) CONFIG+=debug_and_release -o Makefile.Release fbbrowser.pro + +dist: + @$(CHK_DIR_EXISTS) release/fbbrowser1.0.0 || $(MKDIR) release/fbbrowser1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) release/fbbrowser1.0.0/ && $(COPY_FILE) --parents fbbrowser.h release/fbbrowser1.0.0/ && $(COPY_FILE) --parents main.cpp fbbrowser.cpp release/fbbrowser1.0.0/ && $(COPY_FILE) --parents fbbrowser.ui release/fbbrowser1.0.0/ && (cd `dirname release/fbbrowser1.0.0` && $(TAR) fbbrowser1.0.0.tar fbbrowser1.0.0 && $(COMPRESS) fbbrowser1.0.0.tar) && $(MOVE) `dirname release/fbbrowser1.0.0`/fbbrowser1.0.0.tar.gz . && $(DEL_FILE) -r release/fbbrowser1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile.Release + + +check: first + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +compiler_moc_header_make_all: release/moc_fbbrowser.cpp +compiler_moc_header_clean: + -$(DEL_FILE) release/moc_fbbrowser.cpp +release/moc_fbbrowser.cpp: ui_fbbrowser.h \ + fbbrowser.h + /usr/local/Trolltech/QtEmbedded-4.7.1/bin/moc $(DEFINES) $(INCPATH) fbbrowser.h -o release/moc_fbbrowser.cpp + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_image_collection_make_all: qmake_image_collection.cpp +compiler_image_collection_clean: + -$(DEL_FILE) qmake_image_collection.cpp +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: ui_fbbrowser.h +compiler_uic_clean: + -$(DEL_FILE) ui_fbbrowser.h +ui_fbbrowser.h: fbbrowser.ui + /usr/local/Trolltech/QtEmbedded-4.7.1/bin/uic fbbrowser.ui -o ui_fbbrowser.h + +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_moc_header_clean compiler_uic_clean + +####### Compile + +release/main.o: main.cpp fbbrowser.h \ + ui_fbbrowser.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/main.o main.cpp + +release/fbbrowser.o: fbbrowser.cpp fbbrowser.h \ + ui_fbbrowser.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/fbbrowser.o fbbrowser.cpp + +release/moc_fbbrowser.o: release/moc_fbbrowser.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_fbbrowser.o release/moc_fbbrowser.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/src/debug/fbbrowser.o b/src/debug/fbbrowser.o new file mode 100644 index 0000000..82acc90 Binary files /dev/null and b/src/debug/fbbrowser.o differ diff --git a/src/debug/main.o b/src/debug/main.o new file mode 100644 index 0000000..dd2b6c9 Binary files /dev/null and b/src/debug/main.o differ diff --git a/src/debug/moc_fbbrowser.cpp b/src/debug/moc_fbbrowser.cpp new file mode 100644 index 0000000..0282b32 --- /dev/null +++ b/src/debug/moc_fbbrowser.cpp @@ -0,0 +1,69 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'fbbrowser.h' +** +** Created: Wed Jan 12 12:12:08 2011 +** by: The Qt Meta Object Compiler version 62 (Qt 4.7.1) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "../fbbrowser.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'fbbrowser.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 62 +#error "This file was generated using the moc from 4.7.1. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_fbbrowser[] = { + + // content: + 5, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +static const char qt_meta_stringdata_fbbrowser[] = { + "fbbrowser\0" +}; + +const QMetaObject fbbrowser::staticMetaObject = { + { &QWidget::staticMetaObject, qt_meta_stringdata_fbbrowser, + qt_meta_data_fbbrowser, 0 } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &fbbrowser::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *fbbrowser::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *fbbrowser::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_fbbrowser)) + return static_cast(const_cast< fbbrowser*>(this)); + return QWidget::qt_metacast(_clname); +} + +int fbbrowser::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/src/debug/moc_fbbrowser.o b/src/debug/moc_fbbrowser.o new file mode 100644 index 0000000..55373e8 Binary files /dev/null and b/src/debug/moc_fbbrowser.o differ diff --git a/src/fbbrowser.cpp b/src/fbbrowser.cpp new file mode 100644 index 0000000..50fc86a --- /dev/null +++ b/src/fbbrowser.cpp @@ -0,0 +1,89 @@ +#include "fbbrowser.h" +#include +#include +#include + +void fbbrowser::httpReadyRead() +{ + // This slot listens to readyRead() signal from our QNetworkReply. + qDebug() << "readyRead() signal emmited!" << endl; + if(reply->error() == QNetworkReply::NoError) + { + qDebug() << "No error, loading given URL..."; + view->load(url); + } +} + +fbbrowser::fbbrowser(const QUrl & url) +{ + view = new QWebView(this); + + // Create QNetworkAccessManager which is needed to send/receive requests. + manager = new QNetworkAccessManager(this); + // Create a QNetworkRequest object and set its URL. + // QNetworkRequest request; + request.setUrl(url); + + // Check Internet connection + // Let the manager send the request and receive the reply. + // QNetworkReply *reply = manager->get(request); + *reply = manager->get(request); + connect(reply, SIGNAL(readyRead()), this, SLOT(httpReadyRead())); + //connect(reply, SIGNAL(finished()), this, SLOT()); + + // Check if the reply is an error message. + qDebug() << "QNetworkReply error code: " << reply->error(); + + // TODO: error differentiation + // reply->error() returns 0 even for invalid URL. + // A possibility to check for validity, is to listen to readyRead() + // signal, haven't found a better way yet ... + //if(reply->error() == QNetworkReply::NoError) + //{ + // qDebug() << "No error, loading given URL..."; + // view->load(url); + //} + //else + //{ + // qDebug() << "Error occured, loading error page..."; + // view->load(QUrl("qrc:/html/errorPage.html")); + //} + + //remove the window decoration + this->setWindowFlags(Qt::SplashScreen); + + //enable JavaScript access to qt objects + QObject::connect(view->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addJSObject())); + + //set form to fullscreen + this->showFullScreen(); + + setCentralWidget(view); +} + +// Destructor +fbbrowser::~fbbrowser() +{ +} + +// +void fbbrowser::addJSObject() +{ + view->page()->mainFrame()->addToJavaScriptWindowObject(QString("webkitTest"), this); +} + +void fbbrowser::writeText(QString text) +{ + QFile file("out.txt"); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) + return; + + QTextStream out(&file); + out << text << "\n"; +} + +// This function needed now ? +void fbbrowser::quitAll() +{ + //emit lastWindowClosed(); +} diff --git a/src/fbbrowser.h b/src/fbbrowser.h new file mode 100644 index 0000000..c869197 --- /dev/null +++ b/src/fbbrowser.h @@ -0,0 +1,40 @@ +#ifndef FBBROWSER_H +#define FBBROWSER_H + +#include +#include "ui_fbbrowser.h" +#include + +class QWebView; +//QT_BEGIN_NAMESPACE +//class QLineEdit; +//QT_END_NAMESPACE + +class fbbrowser : public QMainWindow +{ + Q_OBJECT + +public: + fbbrowser(const QUrl& url); + ~fbbrowser(); + void printusage(); + Q_INVOKABLE void writeText(QString text); //used for writing web content into a file + Q_INVOKABLE void quitAll(); + +private: + QUrl url; + QNetworkRequest request; + QNetworkReply *reply; + QWebView * view; + QNetworkAccessManager * manager; + //QApplication * app(int & argc, char ** argv); + +private slots: + void httpReadyRead(); + void addJSObject(); + +signals: + void signalQuitAll(); +}; + +#endif // FBBROWSER_H diff --git a/src/fbbrowser.ui b/src/fbbrowser.ui new file mode 100644 index 0000000..a02b1ab --- /dev/null +++ b/src/fbbrowser.ui @@ -0,0 +1,19 @@ + + fbbrowserClass + + + + 0 + 0 + 400 + 300 + + + + fbbrowser + + + + + + diff --git a/src/fbgui.cpp b/src/fbgui.cpp new file mode 100644 index 0000000..fe67b79 --- /dev/null +++ b/src/fbgui.cpp @@ -0,0 +1,83 @@ +#include "fbbrowser.h" + +#include +#include +#include +#include +#include + + +void printUsage() +{ + // Prints usage information, incomplete. + // Q: How is the -qws option handled, mention it here or not? + QTextStream qout(stdout); + qout << QObject::tr("Usage: ./fbgui [OPTIONS] ") << endl; + qout << QObject::tr("Options:") << endl; + qout << "-h or --help " << QObject::tr("Prints usage information.") << endl; + qout << "-qws " << QObject::tr("Set this application to also be the server application.") << endl; + qout << " " << QObject::tr("Skip this option if you have a QT server application") << endl; + exit(1); +} + +QString getPath(const char* c) +{ + QString appPath = c; + // Locate last '/' in the full path and remove all the chars after it. + appPath.chop(appPath.length() - 1 + - appPath.lastIndexOf("/", appPath.length()-1)); + qDebug() << "Application path: " << appPath; + return appPath; +} + +int main(int argc, char *argv[]) +{ + // Parse command line arguments. + int opt = 0; + int longIndex = 0; + // Declare the short options as a char*, these have exactly one - followed by letter from optString. + // For example: ./fbbrowser -h + // Declare the long options in the const struct, these have two - followed by a string found in longOpts[]. + // Same as: ./fbbrowser --help + // Note: I included 'qws' here to not have errors, when setting fbbrowser to be the server app aswell. + static const char *optString = "hqws"; + static const struct option longOpts[] = + { + // If an option requires parameters, write this number instead of no_argument. + // The last argument, is the corresponding char to the option string. + {"help", no_argument, NULL, 'h'} + }; + // getopt_long returns the index of the next argument to be read, -1 if there are no more arguments. + opt = getopt_long(argc, argv, optString, longOpts, &longIndex); + while (opt != -1) + { + switch(opt) + { + case 'h': + printUsage(); + break; + } + opt = getopt_long(argc, argv, optString, longOpts, &longIndex); + } + // This is the main object of a QT Application. + QApplication a(argc, argv); + // Is this really needed, since we kill the app through the fbbrowser object? + QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); + // Get the application path. + QString appPath = getPath(argv[0]); + // This part reads the URL to load from the arguments given through the commandline. + QUrl url; + if (argc > 1) + url = QUrl(argv[1]); + else //Default URL to load + url = QUrl("http://132.230.4.3/webkitTest.html"); + // Create a new Framebuffer-Browser object for displaying the given URL. + fbbrowser *fbb = new fbbrowser(url); + // Listen to the signalQuitAll() Signal to kill the app from within the browser. + QObject::connect(fbb, SIGNAL(signalQuitAll()), &a, SLOT(quit())); + // Display the browser. + fbb->show(); + + // Exit the application. + return a.exec(); +} diff --git a/src/fbgui.h b/src/fbgui.h new file mode 100644 index 0000000..c65a31f --- /dev/null +++ b/src/fbgui.h @@ -0,0 +1,28 @@ +#ifndef FBGUI_H +#define FBGUI_H + +#include + + +//QT_BEGIN_NAMESPACE +//QT_END_NAMESPACE + +class fbgui : public QMainWindow +{ + Q_OBJECT + +public: + fbgui(); + ~fbgui(); + void printUsage(); + QString getPath(const char* c); + +//private: + +//private slots: + +//signals: + +}; + +#endif // FBGUI_H diff --git a/src/fbgui.pro b/src/fbgui.pro new file mode 100644 index 0000000..c1bcf82 --- /dev/null +++ b/src/fbgui.pro @@ -0,0 +1,12 @@ +TEMPLATE = app +TARGET = fbgui +CONFIG += qt debug +QT += core \ + gui \ + webkit \ + network +HEADERS += fbbrowser.h +SOURCES += fbgui.cpp \ + fbbrowser.cpp +FORMS += fbbrowser.ui +RESOURCES += fbgui.qrc diff --git a/src/fbgui.qrc b/src/fbgui.qrc new file mode 100644 index 0000000..da051a4 --- /dev/null +++ b/src/fbgui.qrc @@ -0,0 +1,5 @@ + + + html/errorPage.html + + diff --git a/src/html/errorPage.html b/src/html/errorPage.html new file mode 100644 index 0000000..271d9fe --- /dev/null +++ b/src/html/errorPage.html @@ -0,0 +1,32 @@ + + + + + + + + +

ERROR

+ +

+No Internet Connection or Server is down. + + +Please contact your Administrator. +

+ +
+

+ +

+
+ + + diff --git a/src/testApp.sh b/src/testApp.sh new file mode 100755 index 0000000..0995695 --- /dev/null +++ b/src/testApp.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# This script now needs to have the URL to load as an argument. +if [ $# = 0 ]; then + echo "No URL passed, exiting..." + exit +fi +# Start QT's virtual framebuffer +/usr/local/Trolltech/Qt-4.7.1/bin/qvfb -width 800 -height 600 & +# Wait for it to load (needed?) +sleep 1 +# Start the fbbrowser app. +# This requires the fbgui git repository to be in the user's home directory. +export PATH=~/fbgui/fbbrowser/:$PATH +fbgui -qws $1 +# Check if fbbrowser is not running, if so kill the qvfb. +if [ $(ps aux | grep -v grep | grep -c fbgui) -eq 1 ] +then + echo "fbgui is still running ..." +else + echo "fbgui stopped running, killing qvfb ..." + killall qvfb +fi -- cgit v1.2.3-55-g7522