author | zecke <zecke> | 2003-08-27 12:47:27 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-08-27 12:47:27 (UTC) |
commit | ea7aa8c3779be1e5aadb550559b3a463859ba104 (patch) (side-by-side diff) | |
tree | c6d1154d284b0d79ecaf8be4985e0a50298b7fbd | |
parent | 81175f54968c0cd749492d3fe43b7243b71c2d5d (diff) | |
download | opie-ea7aa8c3779be1e5aadb550559b3a463859ba104.zip opie-ea7aa8c3779be1e5aadb550559b3a463859ba104.tar.gz opie-ea7aa8c3779be1e5aadb550559b3a463859ba104.tar.bz2 |
Opiefy it
-rw-r--r-- | core/tools/quicklauncher/.cvsignore | 4 | ||||
-rw-r--r-- | core/tools/quicklauncher/Makefile | 238 | ||||
-rw-r--r-- | core/tools/quicklauncher/Makefile.in | 106 | ||||
-rw-r--r-- | core/tools/quicklauncher/dropins.h | 61 | ||||
-rw-r--r-- | core/tools/quicklauncher/main.cpp | 12 | ||||
-rw-r--r-- | core/tools/quicklauncher/quicklauncher.pro | 10 |
6 files changed, 81 insertions, 350 deletions
diff --git a/core/tools/quicklauncher/.cvsignore b/core/tools/quicklauncher/.cvsignore new file mode 100644 index 0000000..2a38e61 --- a/dev/null +++ b/core/tools/quicklauncher/.cvsignore @@ -0,0 +1,4 @@ +Makefile +*.moc +.moc/ +.obj/
\ No newline at end of file diff --git a/core/tools/quicklauncher/Makefile b/core/tools/quicklauncher/Makefile deleted file mode 100644 index 23b2fd0..0000000 --- a/core/tools/quicklauncher/Makefile +++ b/dev/null @@ -1,238 +0,0 @@ -############################################################################# -# Automatically generated from tools/quicklauncher/Makefile.in -# Build options from -############################################################################# - -default: all # package - -CONTROL = tools/quicklauncher/qpe-quicklauncher.control - -# Compiling -INTERFACE_DECL_PATH = . -SYSCONF_CXX = g++ -SYSCONF_CC = gcc -DASHCROSS = - -# Compiling with support libraries -SYSCONF_CXXFLAGS_X11 = -SYSCONF_CXXFLAGS_QT = -I$(QTDIR)/include -SYSCONF_CXXFLAGS_QTOPIA = -I$(QPEDIR)/include -SYSCONF_CFLAGS_QTOPIA = -I$(QPEDIR)/include -SYSCONF_CXXFLAGS_OPENGL = -I/usr/X11R6/include - -# Compiling YACC output -SYSCONF_CXXFLAGS_YACC = -Wno-unused -Wno-parentheses - -# Linking with support libraries -SYSCONF_RPATH_X11 = -SYSCONF_RPATH_QT = -Wl,-rpath,$(QTDIR)/lib -SYSCONF_RPATH_QTOPIA = -Wl,-rpath,$(QPEDIR)/lib -SYSCONF_RPATH_OPENGL = -Wl,-rpath,/usr/X11R6/lib - -# Linking with support libraries -# X11 -SYSCONF_LFLAGS_X11 = -SYSCONF_LIBS_X11 = -# Qt, Qt+OpenGL -SYSCONF_LFLAGS_QT = -L$(QTDIR)/lib -SYSCONF_LFLAGS_QTOPIA = -L$(QPEDIR)/lib -SYSCONF_LIBS_QT = -lqte$(QT_THREAD_SUFFIX) -SYSCONF_LIBS_QT_OPENGL = -SYSCONF_LIBS_QTOPIA = -lqtopia -# OpenGL -SYSCONF_LFLAGS_OPENGL = -L/usr/X11R6/lib -SYSCONF_LIBS_OPENGL = -# Yacc -SYSCONF_LIBS_YACC = - -# Linking applications -SYSCONF_LINK = gcc -SYSCONF_LFLAGS = -SYSCONF_LIBS = - -# Link flags for shared objects -SYSCONF_LFLAGS_SHOBJ = -shared - -# Flags for threading -SYSCONF_CFLAGS_THREAD = -D_REENTRANT -SYSCONF_CXXFLAGS_THREAD = -D_REENTRANT -SYSCONF_LFLAGS_THREAD = -SYSCONF_LIBS_THREAD = -lpthread - -# Meta-object compiler -SYSCONF_MOC = $(QTDIR)/bin/moc - -# UI compiler -SYSCONF_UIC = $(QTDIR)/bin/uic - -# Linking shared libraries -# - Build the $(TARGET) library, eg. lib$(TARGET).so.2.2.2 -# - Place target in $(DESTDIR) - which has a trailing / -# - Usually needs to incorporate $(VER_MAJ), $(VER_MIN) and $(VER_PATCH) -# -SYSCONF_LINK_SHLIB = gcc -SYSCONF_LINK_TARGET_SHARED = lib$(TARGET).so.$(VER_MAJ).$(VER_MIN).$(VER_PATCH) -SYSCONF_LINK_LIB_SHARED = $(SYSCONF_LINK_SHLIB) -shared -Wl,-soname,lib$(TARGET).so.$(VER_MAJ) \ - $(LFLAGS) -o $(SYSCONF_LINK_TARGET_SHARED) \ - $(OBJECTS) $(OBJMOC) $(LIBS) && \ - mv $(SYSCONF_LINK_TARGET_SHARED) $(DESTDIR); \ - cd $(DESTDIR) && \ - rm -f lib$(TARGET).so lib$(TARGET).so.$(VER_MAJ) lib$(TARGET).so.$(VER_MAJ).$(VER_MIN); \ - ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so; \ - ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so.$(VER_MAJ); \ - ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so.$(VER_MAJ).$(VER_MIN) - -# Linking static libraries -# - Build the $(TARGET) library, eg. lib$(TARGET).a -# - Place target in $(DESTDIR) - which has a trailing / -# -SYSCONF_AR = ar cqs -SYSCONF_LINK_TARGET_STATIC = lib$(TARGET).a -SYSCONF_LINK_LIB_STATIC = rm -f $(DESTDIR)$(SYSCONF_LINK_TARGET_STATIC) ; \ - $(SYSCONF_AR) $(DESTDIR)$(SYSCONF_LINK_TARGET_STATIC) $(OBJECTS) $(OBJMOC) -# Compiling application source -SYSCONF_CXXFLAGS = -pipe -DQWS -fno-exceptions -fno-rtti -O2 -Wall -W -DNO_DEBUG -SYSCONF_CFLAGS = -pipe -O2 -Wall -W -# Default link type (static linking is still be used where required) -SYSCONF_LINK_LIB = $(SYSCONF_LINK_LIB_SHARED) -SYSCONF_LINK_TARGET = $(SYSCONF_LINK_TARGET_SHARED) -# Compiling library source -SYSCONF_CXXFLAGS_LIB = -fPIC -SYSCONF_CFLAGS_LIB = -fPIC -# Compiling shared-object source -SYSCONF_CXXFLAGS_SHOBJ = -fPIC -SYSCONF_CFLAGS_SHOBJ = -fPIC -# Linking Qt -SYSCONF_LIBS_QTLIB = $(SYSCONF_LFLAGS_X11) $(QT_LIBS_MT) $(QT_LIBS_OPT) -# Linking Qt applications -SYSCONF_LIBS_QTAPP = - -# Platform output directories -MOC_DIR = .moc/linux-generic-g++/ -OBJECTS_DIR = .obj/linux-generic-g++/ - -############################################################################# - -####### Compiler, tools and options - -CXX = $(SYSCONF_CXX) $(QT_CXX_MT) -CXXFLAGS= $(SYSCONF_CXXFLAGS_QTOPIA) $(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS) -DQTOPIA_APP_INTERFACE -CC = $(SYSCONF_CC) $(QT_C_MT) -CFLAGS = $(SYSCONF_CFLAGS_QTOPIA) $(SYSCONF_CFLAGS) -DQTOPIA_APP_INTERFACE -INCPATH = -I$(MOC_DIR) -LFLAGS = $(SYSCONF_LFLAGS_QTOPIA) $(SYSCONF_RPATH_QTOPIA) $(SYSCONF_LFLAGS_QT) $(SYSCONF_RPATH_QT) $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT) -LIBS = $(SUBLIBS) -lqpepim -lpthread -lqpe $(SYSCONF_LIBS_QTOPIA) $(SYSCONF_LIBS_QT) $(SYSCONF_LIBS) $(SYSCONF_LIBS_QTAPP) -MOC = $(SYSCONF_MOC) -UIC = $(SYSCONF_UIC) - -####### Target - -DESTDIR = $(QPEDIR)/bin/ -VER_MAJ = 1 -VER_MIN = 0 -VER_PATCH = 0 -TARGET = quicklauncher -TARGET1 = lib$(TARGET).so.$(VER_MAJ) - -####### Files - -HEADERS = -SOURCES = main.cpp -OBJECTS = $(OBJECTS_DIR)/main.o -INTERFACES = -UICDECLS = -UICIMPLS = -SRCMOC = $(MOC_DIR)/main.moc -OBJMOC = - - -####### Implicit rules - -.SUFFIXES: .cpp .cxx .cc .C .c - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.cxx.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.cc.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.C.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.c.o: - $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< - -####### Build rules - - -all: $(DESTDIR)$(TARGET) - -$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) - $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) - -moc: $(SRCMOC) - -tmake: - tmake quicklauncher.pro - -clean: - -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) - -rm -f *~ core - -rm -f allmoc.cpp - -####### Extension Modules - -listpromodules: - @echo - -listallmodules: - @echo - -listaddonpromodules: - @echo - -listaddonentmodules: - @echo - - -REQUIRES= - -####### Sub-libraries - - -###### Combined headers - - - -####### Compile - -$(OBJECTS_DIR)/main.o: main.cpp \ - $(MOC_DIR)/main.moc - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/main.o main.cpp - -$(MOC_DIR)/main.moc: main.cpp - $(MOC) main.cpp -o $(MOC_DIR)/main.moc - - - -lupdate-check: - @true - -lupdate: - @true - -lrelease: - @echo "No TRANSLATIONS" - - -ipkg: $(DESTDIR)$(TARGET) # among other things... - CTL="$(CONTROL)"; for ctrl in $$CTL; do cd $(QPEDIR)/ipkg; ../bin/mkipks -platform generic $(QPEDIR)/src/$$ctrl ; done - -package: ipkg - cd $(QPEDIR)/ipkg; ../bin/mkPackages - -Makefile: quicklauncher.pro - cd $(QPEDIR)/src; ./configure -platform generic -make tools/quicklauncher diff --git a/core/tools/quicklauncher/Makefile.in b/core/tools/quicklauncher/Makefile.in deleted file mode 100644 index 8c7892a..0000000 --- a/core/tools/quicklauncher/Makefile.in +++ b/dev/null @@ -1,106 +0,0 @@ -############################################################################# - -####### Compiler, tools and options - -CXX = $(SYSCONF_CXX) $(QT_CXX_MT) -CXXFLAGS= $(SYSCONF_CXXFLAGS_QTOPIA) $(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS) -DQTOPIA_APP_INTERFACE -CC = $(SYSCONF_CC) $(QT_C_MT) -CFLAGS = $(SYSCONF_CFLAGS_QTOPIA) $(SYSCONF_CFLAGS) -DQTOPIA_APP_INTERFACE -INCPATH = -I$(MOC_DIR) -LFLAGS = $(SYSCONF_LFLAGS_QTOPIA) $(SYSCONF_RPATH_QTOPIA) $(SYSCONF_LFLAGS_QT) $(SYSCONF_RPATH_QT) $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT) -LIBS = $(SUBLIBS) -lqpepim -lpthread -lqpe $(SYSCONF_LIBS_QTOPIA) $(SYSCONF_LIBS_QT) $(SYSCONF_LIBS) $(SYSCONF_LIBS_QTAPP) -MOC = $(SYSCONF_MOC) -UIC = $(SYSCONF_UIC) - -####### Target - -DESTDIR = $(QPEDIR)/bin/ -VER_MAJ = 1 -VER_MIN = 0 -VER_PATCH = 0 -TARGET = quicklauncher -TARGET1 = lib$(TARGET).so.$(VER_MAJ) - -####### Files - -HEADERS = -SOURCES = main.cpp -OBJECTS = $(OBJECTS_DIR)/main.o -INTERFACES = -UICDECLS = -UICIMPLS = -SRCMOC = $(MOC_DIR)/main.moc -OBJMOC = - - -####### Implicit rules - -.SUFFIXES: .cpp .cxx .cc .C .c - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.cxx.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.cc.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.C.o: - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< - -.c.o: - $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< - -####### Build rules - - -all: $(DESTDIR)$(TARGET) - -$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) - $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) - -moc: $(SRCMOC) - -tmake: - tmake quicklauncher.pro - -clean: - -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) - -rm -f *~ core - -rm -f allmoc.cpp - -####### Extension Modules - -listpromodules: - @echo - -listallmodules: - @echo - -listaddonpromodules: - @echo - -listaddonentmodules: - @echo - - -REQUIRES= - -####### Sub-libraries - - -###### Combined headers - - - -####### Compile - -$(OBJECTS_DIR)/main.o: main.cpp \ - $(MOC_DIR)/main.moc - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/main.o main.cpp - -$(MOC_DIR)/main.moc: main.cpp - $(MOC) main.cpp -o $(MOC_DIR)/main.moc - - diff --git a/core/tools/quicklauncher/dropins.h b/core/tools/quicklauncher/dropins.h new file mode 100644 index 0000000..ac8d8cc --- a/dev/null +++ b/core/tools/quicklauncher/dropins.h @@ -0,0 +1,61 @@ + +#include <qstring.h> +#include <qtopia/qcom.h> +#include <qtopia/qlibrary.h> +#include <qtopia/applicationinterface.h> +#include <qtopia/resource.h> + +#include <opie/owait.h> + +#include <qmetaobject.h> +#include <qmap.h> + +namespace Opie { + + struct PluginLoader { + PluginLoader( const char* ) { + } + + QRESULT queryInterface( const QString& app, const QUuid&, QUnknownInterface** ); + void releaseInterface( QUnknownInterface* ); + QMap<QUnknownInterface*, QLibrary*> libs; + }; + + /* + * We can skip installing a Translator here because Opies QPEApplication + * will do that in initApp for us as well + */ + QRESULT PluginLoader::queryInterface( const QString& libFile, const QUuid& uuid, QUnknownInterface** iface ) { + QRESULT res = QS_FALSE; + *iface = 0; + + // Below lines from TT then mine again + QString name = libFile; + if ( libFile.findRev(".so") == (int)libFile.length()-3 ) { + name = libFile.left( libFile.length()-3 ); + if ( name.find( "lib" ) == 0 ) + name = name.mid( 3 ); + } + QString path = QPEApplication::qpeDir() + "/plugins/applications/lib"+name+".so"; + + QLibrary *lib = new QLibrary( path ); + if ( lib->queryInterface( uuid, iface ) == QS_OK && iface ) { + libs.insert( *iface, lib ); + res = QS_OK; + } + + return res; + } + + void PluginLoader::releaseInterface( QUnknownInterface* iface ) { + if ( libs.contains( iface ) ) { + iface->release(); + delete libs[iface]; + libs.remove( iface ); // we only handle pointers so even if the object is not valid the address-space is + } + } + +} + +/* small hack ;) */ +using namespace Opie; diff --git a/core/tools/quicklauncher/main.cpp b/core/tools/quicklauncher/main.cpp index e509908..7d368ab 100644 --- a/core/tools/quicklauncher/main.cpp +++ b/core/tools/quicklauncher/main.cpp @@ -25,8 +25,5 @@ #include <qcopchannel_qws.h> #define QTOPIA_INTERNAL_INITAPP -#include <qtopia/timezone.h> #include <qtopia/qpeapplication.h> -#include <qtopia/resource.h> -#include <qtopia/pluginloader.h> #include <stdio.h> #include <stdlib.h> @@ -35,4 +32,6 @@ #include <unistd.h> +#include "dropins.h" + static QPEApplication *app = 0; static PluginLoader *loader = 0; @@ -211,9 +210,16 @@ int main( int argc, char** argv ) // initialization to be performed. This may mean allocating // memory that is not needed by all applications. +#if 0 TimeZone::current().isValid(); // popuplate timezone cache TimeString::currentDateFormat(); // create internal structures TimeString::currentAMPM(); +#endif Resource::loadIconSet("new"); // do internal init + /* make sure libopie gets lined in */ + { + OWait item; + } + // Create a widget to force initialization of title bar images, etc. QObject::disconnect(app, SIGNAL(lastWindowClosed()), app, SLOT(hideOrQuit())); diff --git a/core/tools/quicklauncher/quicklauncher.pro b/core/tools/quicklauncher/quicklauncher.pro index 52e2106..6ab5fc8 100644 --- a/core/tools/quicklauncher/quicklauncher.pro +++ b/core/tools/quicklauncher/quicklauncher.pro @@ -1,11 +1,15 @@ TEMPLATE = app CONFIG += qtopia warn_on release -DESTDIR = $(QPEDIR)/bin +DESTDIR = $(OPIEDIR)/bin -HEADERS = +HEADERS = dropins.h SOURCES = main.cpp INTERFACES = -unix:LIBS += -lqpepim -lpthread +INCLUDEPATH += $(OPIEDIR)/include +LIBS += -lqpe -lopie TARGET = quicklauncher + + +include ( $(OPIEDIR)/include.pro )
\ No newline at end of file |