diff --git a/ports/src/app/arora/target.mk b/ports/src/app/arora/target.mk index b7eac4e33..ca24276b0 100644 --- a/ports/src/app/arora/target.mk +++ b/ports/src/app/arora/target.mk @@ -1,214 +1,39 @@ ARORA = arora-0.11.0 -# build with QtCore and QtGui support by default -# (can be overridden in the qmake project file) -QT = core gui +# identify the qt4 repository by searching for a file that is unique for qt4 +QT4_REP_DIR := $(call select_from_repositories,lib/import/import-qt4.inc) +QT4_REP_DIR := $(realpath $(dir $(QT4_REP_DIR))../..) -# find out the name of the project directory -PROJECT_DIR_NAME = $(notdir $(abspath $(PRG_DIR))) +include $(QT4_REP_DIR)/src/app/tmpl/target_defaults.inc -INC_DIR += $(PRG_DIR) +HEADERS_FILTER_OUT = \ + adblockschemeaccesshandler.h \ + adblockrule.h \ + arorawebplugin.h \ + bookmarknode.h \ + clicktoflashplugin.h \ + networkcookiejar_p.h \ + nitpickerplugin.h \ + networkproxyfactory.h \ + opensearchenginedelegate.h \ + opensearchreader.h \ + opensearchwriter.h \ + schemeaccesshandler.h \ + twoleveldomains_p.h \ + trie_p.h \ + xbelreader.h \ + xbelwriter.h -###### start of editable part ###### +QT_MAIN_STACK_SIZE = 768*1024 -# include the qmake project file -# -> change the filename if it differs from the project dir name +LIBS += libc_lwip libc_lwip_nic_dhcp qpluginwidget -QMAKE_PROJECT_FILE = $(realpath $(PRG_DIR)/$(PROJECT_DIR_NAME).pro) - -ifneq ($(strip $(QMAKE_PROJECT_FILE)),) -include $(QMAKE_PROJECT_FILE) -endif - -# -# The following files don't need to be moc'ed, -# so exclude them from $(SOURCES) and $(HEADERS). -# -NO_MOC_SOURCES = aboutdialog.cpp \ - acceptlanguagedialog.cpp \ - adblockblockednetworkreply.cpp \ - adblockdialog.cpp \ - adblockmanager.cpp \ - adblockmodel.cpp \ - adblocknetwork.cpp \ - adblockpage.cpp \ - adblockrule.cpp \ - adblockschemeaccesshandler.cpp \ - adblocksubscription.cpp \ - addbookmarkdialog.cpp \ - arorawebplugin.cpp \ - autofilldialog.cpp \ - autofillmanager.cpp \ - autosaver.cpp \ - bookmarknode.cpp \ - bookmarksdialog.cpp \ - bookmarksmanager.cpp \ - bookmarksmenu.cpp \ - bookmarksmodel.cpp \ - bookmarkstoolbar.cpp \ - browserapplication.cpp \ - browsermainwindow.cpp \ - clearbutton.cpp \ - clearprivatedata.cpp \ - clicktoflash.cpp \ - clicktoflashplugin.cpp \ - cookiedialog.cpp \ - cookieexceptionsdialog.cpp \ - cookieexceptionsmodel.cpp \ - cookiejar.cpp \ - cookiemodel.cpp \ - downloadmanager.cpp \ - editlistview.cpp \ - edittableview.cpp \ - edittreeview.cpp \ - fileaccesshandler.cpp \ - history.cpp \ - historycompleter.cpp \ - historymanager.cpp \ - languagemanager.cpp \ - lineedit.cpp \ - locationbar.cpp \ - locationbarsiteicon.cpp \ - main.cpp \ - modelmenu.cpp \ - modeltoolbar.cpp \ - networkaccessmanager.cpp \ - networkaccessmanagerproxy.cpp \ - networkcookiejar.cpp \ - networkdiskcache.cpp \ - networkproxyfactory.cpp \ - nitpickerplugin.cpp \ - nitpickerpluginwidget.cpp \ - opensearchdialog.cpp \ - opensearchengine.cpp \ - opensearchengineaction.cpp \ - opensearchenginedelegate.cpp \ - opensearchenginemodel.cpp \ - opensearchmanager.cpp \ - opensearchreader.cpp \ - opensearchwriter.cpp \ - plaintexteditsearch.cpp \ - privacyindicator.cpp \ - schemeaccesshandler.cpp \ - searchbar.cpp \ - searchbutton.cpp \ - searchlineedit.cpp \ - settings.cpp \ - singleapplication.cpp \ - sourcehighlighter.cpp \ - sourceviewer.cpp \ - squeezelabel.cpp \ - tabbar.cpp \ - tabwidget.cpp \ - toolbarsearch.cpp \ - treesortfilterproxymodel.cpp \ - useragentmenu.cpp \ - webactionmapper.cpp \ - webpage.cpp \ - webpageproxy.cpp \ - webpluginfactory.cpp \ - webview.cpp \ - webviewsearch.cpp \ - xbelreader.cpp \ - xbelwriter.cpp - -NO_MOC_HEADER = adblockschemeaccesshandler.h \ - adblockrule.h \ - arorawebplugin.h \ - bookmarknode.h \ - clicktoflashplugin.h \ - networkcookiejar_p.h \ - nitpickerplugin.h \ - networkproxyfactory.h \ - opensearchenginedelegate.h \ - opensearchreader.h \ - opensearchwriter.h \ - schemeaccesshandler.h \ - twoleveldomains_p.h \ - trie_p.h \ - xbelreader.h \ - xbelwriter.h - -SOURCES := $(filter-out $(NO_MOC_SOURCES), $(SOURCES)) -HEADERS := $(filter-out $(NO_MOC_HEADER), $(HEADERS)) -SRC_CC = $(NO_MOC_SOURCES) - -# how to name the generated executable -# (if not already defined in the qmake project file) -# -> change if it shall not be the name of the project dir - -ifndef TARGET -TARGET = $(PROJECT_DIR_NAME) -endif - -CC_CXX_OPT += -DQT_MAIN_STACK_SIZE=768*1024 +RESOURCES += demo_html.qrc # # Prevent contrib code from causing warnings with our toolchain compiler # -CC_CXX_OPT += -Wno-unused-but-set-variable - -###### end of editable part ###### - -LIBS += libc libc_lwip libc_lwip_nic_dhcp qpluginwidget -RESOURCES += demo_html.qrc - -# static Qt plugins -ifeq ($(findstring qgif, $(QT_PLUGIN)), qgif) -LIBS += qgif -endif -ifeq ($(findstring qjpeg, $(QT_PLUGIN)), qjpeg) -LIBS += qjpeg -endif - -# QtCore stuff -ifeq ($(findstring core, $(QT)), core) -QT_DEFINES += -DQT_CORE_LIB -LIBS += qt_core -endif - -# QtGui stuff -ifeq ($(findstring gui, $(QT)), gui) -QT_DEFINES += -DQT_GUI_LIB -LIBS += qt_gui dejavusans -endif - -# QtNetwork stuff -ifeq ($(findstring network, $(QT)), network) -LIBS += qt_network -endif - -# QtScript stuff -ifeq ($(findstring script, $(QT)), script) -LIBS += qt_script -endif - -# QtScriptTools stuff -ifeq ($(findstring scripttools, $(QT)), scripttools) -LIBS += qt_scripttools -endif - -# QtSvg stuff -ifeq ($(findstring svg, $(QT)), svg) -LIBS += qt_svg -endif - -# QtXml stuff -ifeq ($(findstring xml, $(QT)), xml) -LIBS += qt_xml -endif - -# QtUiTools stuff -ifeq ($(findstring uitools, $(CONFIG)), uitools) -LIBS += qt_ui_tools -endif - -# QtWebKit stuff -ifeq ($(findstring webkit, $(QT)), webkit) -LIBS += qt_webcore -endif - -#endif # $(QMAKE_PROJECT_FILE) +CC_WARN += -Wno-unused-but-set-variable vpath % $(PRG_DIR) vpath % $(PRG_DIR)/adblock @@ -249,3 +74,5 @@ vpath % $(REP_DIR)/contrib/$(ARORA)/src/qwebplugins/clicktoflash vpath % $(REP_DIR)/contrib/$(ARORA)/src/qwebplugins/nitpicker vpath % $(REP_DIR)/contrib/$(ARORA)/src/useragent vpath % $(REP_DIR)/contrib/$(ARORA)/src/utils + +include $(QT4_REP_DIR)/src/app/tmpl/target_final.inc diff --git a/qt4/Makefile b/qt4/Makefile index b9a4af7bb..489bd9089 100644 --- a/qt4/Makefile +++ b/qt4/Makefile @@ -11,8 +11,11 @@ DOWNLOAD_DIR = download CONTRIB_DIR = contrib PATCHES_DIR = ../../src/lib/qt4 +REP_DIR := $(realpath .) + +include $(REP_DIR)/lib/mk/qt_version.inc + QT4_URL = ftp://ftp.trolltech.com/qt/source -QT4 = qt-everywhere-opensource-src-4.7.4 QT4_TGZ = $(QT4).tar.gz QTSCRIPTCLASSIC_URL = http://get.qt.nokia.com/qt/solutions/lgpl diff --git a/qt4/lib/import/import-qgif.mk b/qt4/lib/import/import-qgif.mk new file mode 100644 index 000000000..ec79bf453 --- /dev/null +++ b/qt4/lib/import/import-qgif.mk @@ -0,0 +1,3 @@ +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) + +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qjpeg.mk b/qt4/lib/import/import-qjpeg.mk new file mode 100644 index 000000000..ec79bf453 --- /dev/null +++ b/qt4/lib/import/import-qjpeg.mk @@ -0,0 +1,3 @@ +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) + +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt4.mk b/qt4/lib/import/import-qt4.inc similarity index 91% rename from qt4/lib/import/import-qt4.mk rename to qt4/lib/import/import-qt4.inc index a95d61730..6542711e0 100644 --- a/qt4/lib/import/import-qt4.mk +++ b/qt4/lib/import/import-qt4.inc @@ -1,15 +1,15 @@ # prevent import file to be included twice, for example via import-qt_gui.mk -# and import-QtCore.mk +# and import-qt_core.mk ifeq ($(QT4_IMPORTED),) QT4_IMPORTED = true -QT4 = qt-everywhere-opensource-src-4.7.4 - # identify the qt4 repository by searching for a file that is unique for qt4 -QT4_REP_DIR := $(call select_from_repositories,lib/import/import-qt4.mk) +QT4_REP_DIR := $(call select_from_repositories,lib/import/import-qt4.inc) QT4_REP_DIR := $(realpath $(dir $(QT4_REP_DIR))../..) +include $(QT4_REP_DIR)/lib/mk/qt_version.inc + QT4_INC_DIR := $(QT4_REP_DIR)/src/lib/qt4/mkspecs/qws/genode-x86-g++ \ $(QT4_REP_DIR)/include/qt4 \ $(QT4_REP_DIR)/contrib/$(QT4)/include \ @@ -56,14 +56,16 @@ QT_DEFINES += -U__linux__ CC_CXX_OPT += $(QT_DEFINES) +SOURCES_FILTERED = $(filter-out $(SOURCES_FILTER_OUT), $(SOURCES)) +HEADERS_FILTERED = $(filter-out $(HEADERS_FILTER_OUT), $(HEADERS)) + # add sources defined in qmake project files -SRC_CC += $(SOURCES) +SRC_CC += $(SOURCES_FILTERED) # handle moc-headers, resources and ui descriptions -$(SRC_CC:.cpp=.o): $(SOURCES:.cpp=.moc) \ - $(addprefix ui_,$(FORMS:.ui=.h)) +$(SRC_CC:.cpp=.o): $(addprefix ui_,$(FORMS:.ui=.h)) -SRC_CC_QT_GENERATED = $(addprefix moc_,$(HEADERS:.h=.cpp)) \ +SRC_CC_QT_GENERATED = $(addprefix moc_,$(HEADERS_FILTERED:.h=.cpp)) \ $(addprefix qrc_,$(RESOURCES:.qrc=.cpp)) .SECONDARY: $(SRC_CC_QT_GENERATED) @@ -138,6 +140,6 @@ endif clean cleanall: clean_rule clean_rule: $(VERBOSE)$(RM) -f $(SRC_CC_QT_GENERATED) - $(VERBOSE)$(RM) -f $(SOURCES:.cpp=.moc) + $(VERBOSE)$(RM) -f $(SOURCES_FILTERED:.cpp=.moc) $(VERBOSE)$(RM) -f $(addprefix ui_,$(FORMS:.ui=.h)) endif diff --git a/qt4/lib/import/import-qt_core.mk b/qt4/lib/import/import-qt_core.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_core.mk +++ b/qt4/lib/import/import-qt_core.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt_gui.mk b/qt4/lib/import/import-qt_gui.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_gui.mk +++ b/qt4/lib/import/import-qt_gui.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt_javascriptcore.mk b/qt4/lib/import/import-qt_javascriptcore.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_javascriptcore.mk +++ b/qt4/lib/import/import-qt_javascriptcore.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt_jscore.mk b/qt4/lib/import/import-qt_jscore.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_jscore.mk +++ b/qt4/lib/import/import-qt_jscore.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt_network.mk b/qt4/lib/import/import-qt_network.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_network.mk +++ b/qt4/lib/import/import-qt_network.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt_script.mk b/qt4/lib/import/import-qt_script.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_script.mk +++ b/qt4/lib/import/import-qt_script.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt_scriptclassic.mk b/qt4/lib/import/import-qt_scriptclassic.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_scriptclassic.mk +++ b/qt4/lib/import/import-qt_scriptclassic.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt_scripttools.mk b/qt4/lib/import/import-qt_scripttools.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_scripttools.mk +++ b/qt4/lib/import/import-qt_scripttools.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt_svg.mk b/qt4/lib/import/import-qt_svg.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_svg.mk +++ b/qt4/lib/import/import-qt_svg.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt_ui_tools.mk b/qt4/lib/import/import-qt_ui_tools.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_ui_tools.mk +++ b/qt4/lib/import/import-qt_ui_tools.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt_webcore.mk b/qt4/lib/import/import-qt_webcore.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_webcore.mk +++ b/qt4/lib/import/import-qt_webcore.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/import/import-qt_xml.mk b/qt4/lib/import/import-qt_xml.mk index 0454abb26..ec79bf453 100644 --- a/qt4/lib/import/import-qt_xml.mk +++ b/qt4/lib/import/import-qt_xml.mk @@ -1,3 +1,3 @@ -IMPORT_QT4_MK=$(call select_from_repositories,lib/import/import-qt4.mk) +IMPORT_QT4_INC=$(call select_from_repositories,lib/import/import-qt4.inc) -include $(IMPORT_QT4_MK) +include $(IMPORT_QT4_INC) diff --git a/qt4/lib/mk/qgif.mk b/qt4/lib/mk/qgif.mk index a957ee8ec..f07749cf5 100644 --- a/qt4/lib/mk/qgif.mk +++ b/qt4/lib/mk/qgif.mk @@ -1,4 +1,4 @@ -include $(REP_DIR)/lib/import/import-qt4.mk +include $(REP_DIR)/lib/import/import-qgif.mk SRC_CC = main.cpp qgifhandler.cpp diff --git a/qt4/lib/mk/qjpeg.mk b/qt4/lib/mk/qjpeg.mk index cd047adba..f126c9dc6 100644 --- a/qt4/lib/mk/qjpeg.mk +++ b/qt4/lib/mk/qjpeg.mk @@ -1,4 +1,4 @@ -include $(REP_DIR)/lib/import/import-qt4.mk +include $(REP_DIR)/lib/import/import-qjpeg.mk SRC_CC = main.cpp qjpeghandler.cpp diff --git a/qt4/lib/mk/qt_version.inc b/qt4/lib/mk/qt_version.inc new file mode 100644 index 000000000..68326740a --- /dev/null +++ b/qt4/lib/mk/qt_version.inc @@ -0,0 +1 @@ +QT4 := qt-everywhere-opensource-src-4.7.4 diff --git a/qt4/run/calculatorform.run b/qt4/run/calculatorform.run new file mode 100644 index 000000000..bd95ec3fb --- /dev/null +++ b/qt4/run/calculatorform.run @@ -0,0 +1,125 @@ +# +# Build +# + +build { + core + init + drivers/input/ps2 + drivers/pci + drivers/framebuffer + drivers/timer + server/nitpicker + app/examples/calculatorform +} + +create_boot_directory + +# +# Generate config +# + +set config { + + + + + + + + + + + + + + + + } + +append_if [have_spec sdl] config { + + + + + + + } + +append_if [have_spec pci] config { + + + + } + +append_if [have_spec vesa] config { + + + + } + +append_if [have_spec pl11x] config { + + + + } + +append_if [have_spec ps2] config { + + + + } + +append config { + + + + + + + + + + + + +} + +install_config $config + +# +# Boot modules +# + +# generic modules +set boot_modules { + core + init + timer + nitpicker + calculatorform + dejavusans.lib.so + freetype.lib.so + ld.lib.so + libc.lib.so + libc_lock_pipe.lib.so + libm.lib.so + libpng.lib.so + jpeg.lib.so + qt_core.lib.so + qt_gui.lib.so + zlib.lib.so +} + +# platform-specific modules +lappend_if [have_spec linux] boot_modules fb_sdl +lappend_if [have_spec pci] boot_modules pci_drv +lappend_if [have_spec vesa] boot_modules vesa_drv +lappend_if [have_spec ps2] boot_modules ps2_drv +lappend_if [have_spec pl11x] boot_modules pl11x_drv + +build_boot_image $boot_modules + +append qemu_args " -m 128" + +run_genode_until forever diff --git a/qt4/run/previewer.run b/qt4/run/previewer.run new file mode 100644 index 000000000..6e77aac5c --- /dev/null +++ b/qt4/run/previewer.run @@ -0,0 +1,128 @@ +# +# Build +# + +build { + core + init + drivers/input/ps2 + drivers/pci + drivers/framebuffer + drivers/timer + server/nitpicker + app/examples/previewer +} + +create_boot_directory + +# +# Generate config +# + +set config { + + + + + + + + + + + + + + + + } + +append_if [have_spec sdl] config { + + + + + + + } + +append_if [have_spec pci] config { + + + + } + +append_if [have_spec vesa] config { + + + + } + +append_if [have_spec pl11x] config { + + + + } + +append_if [have_spec ps2] config { + + + + } + +append config { + + + + + + + + + + + + +} + +install_config $config + +# +# Boot modules +# + +# generic modules +set boot_modules { + core + init + timer + nitpicker + previewer + dejavusans.lib.so + freetype.lib.so + ld.lib.so + libc.lib.so + libc_lock_pipe.lib.so + libm.lib.so + libpng.lib.so + jpeg.lib.so + qt_core.lib.so + qt_gui.lib.so + qt_jscore.lib.so + qt_network.lib.so + qt_webcore.lib.so + zlib.lib.so +} + +# platform-specific modules +lappend_if [have_spec linux] boot_modules fb_sdl +lappend_if [have_spec pci] boot_modules pci_drv +lappend_if [have_spec vesa] boot_modules vesa_drv +lappend_if [have_spec ps2] boot_modules ps2_drv +lappend_if [have_spec pl11x] boot_modules pl11x_drv + +build_boot_image $boot_modules + +append qemu_args " -m 128" + +run_genode_until forever diff --git a/qt4/run/tetrix.run b/qt4/run/tetrix.run new file mode 100644 index 000000000..673808b63 --- /dev/null +++ b/qt4/run/tetrix.run @@ -0,0 +1,128 @@ +# +# Build +# + +build { + core + init + drivers/input/ps2 + drivers/pci + drivers/framebuffer + drivers/timer + server/nitpicker + app/examples/tetrix +} + +create_boot_directory + +# +# Generate config +# + +set config { + + + + + + + + + + + + + + + + } + +append_if [have_spec sdl] config { + + + + + + + } + +append_if [have_spec pci] config { + + + + } + +append_if [have_spec vesa] config { + + + + } + +append_if [have_spec pl11x] config { + + + + } + +append_if [have_spec ps2] config { + + + + } + +append config { + + + + + + + + + + + + +} + +install_config $config + +# +# Boot modules +# + +# generic modules +set boot_modules { + core + init + timer + nitpicker + tetrix + dejavusans.lib.so + freetype.lib.so + ld.lib.so + libc.lib.so + libc_lock_pipe.lib.so + libm.lib.so + libpng.lib.so + jpeg.lib.so + qt_core.lib.so + qt_gui.lib.so + qt_script.lib.so + qt_ui_tools.lib.so + qt_xml.lib.so + zlib.lib.so +} + +# platform-specific modules +lappend_if [have_spec linux] boot_modules fb_sdl +lappend_if [have_spec pci] boot_modules pci_drv +lappend_if [have_spec vesa] boot_modules vesa_drv +lappend_if [have_spec ps2] boot_modules ps2_drv +lappend_if [have_spec pl11x] boot_modules pl11x_drv + +build_boot_image $boot_modules + +append qemu_args " -m 128" + +run_genode_until forever diff --git a/qt4/run/textedit.run b/qt4/run/textedit.run new file mode 100644 index 000000000..0c312d4c8 --- /dev/null +++ b/qt4/run/textedit.run @@ -0,0 +1,125 @@ +# +# Build +# + +build { + core + init + drivers/input/ps2 + drivers/pci + drivers/framebuffer + drivers/timer + server/nitpicker + app/examples/textedit +} + +create_boot_directory + +# +# Generate config +# + +set config { + + + + + + + + + + + + + + + + } + +append_if [have_spec sdl] config { + + + + + + + } + +append_if [have_spec pci] config { + + + + } + +append_if [have_spec vesa] config { + + + + } + +append_if [have_spec pl11x] config { + + + + } + +append_if [have_spec ps2] config { + + + + } + +append config { + + + + + + + + + + + + +} + +install_config $config + +# +# Boot modules +# + +# generic modules +set boot_modules { + core + init + timer + nitpicker + textedit + dejavusans.lib.so + freetype.lib.so + ld.lib.so + libc.lib.so + libc_lock_pipe.lib.so + libm.lib.so + libpng.lib.so + jpeg.lib.so + qt_core.lib.so + qt_gui.lib.so + zlib.lib.so +} + +# platform-specific modules +lappend_if [have_spec linux] boot_modules fb_sdl +lappend_if [have_spec pci] boot_modules pci_drv +lappend_if [have_spec vesa] boot_modules vesa_drv +lappend_if [have_spec ps2] boot_modules ps2_drv +lappend_if [have_spec pl11x] boot_modules pl11x_drv + +build_boot_image $boot_modules + +append qemu_args " -m 128" + +run_genode_until forever diff --git a/qt4/src/app/examples/calculatorform/calculatorform.cpp b/qt4/src/app/examples/calculatorform/calculatorform.cpp deleted file mode 100644 index 7c21e391b..000000000 --- a/qt4/src/app/examples/calculatorform/calculatorform.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2005-2007 Trolltech ASA. All rights reserved. -** -** This file is part of the example classes of the Qt Toolkit. -** -** This file may be used under the terms of the GNU General Public -** License version 2.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of -** this file. Please review the following information to ensure GNU -** General Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/ -** -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** In addition, as a special exception, Trolltech gives you certain -** additional rights. These rights are described in the Trolltech GPL -** Exception version 1.0, which can be found at -** http://www.trolltech.com/products/qt/gplexception/ and in the file -** GPL_EXCEPTION.txt in this package. -** -** In addition, as a special exception, Trolltech, as the sole copyright -** holder for Qt Designer, grants users of the Qt/Eclipse Integration -** plug-in the right for the Qt/Eclipse Integration to link to -** functionality provided by Qt Designer and its related libraries. -** -** Trolltech reserves all rights not expressly granted herein. -** -** Trolltech ASA (c) 2007 -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -****************************************************************************/ - -#include - -#include "calculatorform.h" - -CalculatorForm::CalculatorForm(QWidget *parent) - : QWidget(parent) -{ - ui.setupUi(this); -} - -void CalculatorForm::on_inputSpinBox1_valueChanged(int value) -{ - ui.outputWidget->setText(QString::number(value + ui.inputSpinBox2->value())); -} - -void CalculatorForm::on_inputSpinBox2_valueChanged(int value) -{ - ui.outputWidget->setText(QString::number(value + ui.inputSpinBox1->value())); -} diff --git a/qt4/src/app/examples/calculatorform/calculatorform.h b/qt4/src/app/examples/calculatorform/calculatorform.h deleted file mode 100644 index d6ab220f3..000000000 --- a/qt4/src/app/examples/calculatorform/calculatorform.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2005-2007 Trolltech ASA. All rights reserved. -** -** This file is part of the example classes of the Qt Toolkit. -** -** This file may be used under the terms of the GNU General Public -** License version 2.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of -** this file. Please review the following information to ensure GNU -** General Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/ -** -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** In addition, as a special exception, Trolltech gives you certain -** additional rights. These rights are described in the Trolltech GPL -** Exception version 1.0, which can be found at -** http://www.trolltech.com/products/qt/gplexception/ and in the file -** GPL_EXCEPTION.txt in this package. -** -** In addition, as a special exception, Trolltech, as the sole copyright -** holder for Qt Designer, grants users of the Qt/Eclipse Integration -** plug-in the right for the Qt/Eclipse Integration to link to -** functionality provided by Qt Designer and its related libraries. -** -** Trolltech reserves all rights not expressly granted herein. -** -** Trolltech ASA (c) 2007 -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -****************************************************************************/ - -#ifndef CALCULATORFORM_H -#define CALCULATORFORM_H - -#include "ui_calculatorform.h" - -class CalculatorForm : public QWidget -{ - Q_OBJECT - -public: - CalculatorForm(QWidget *parent = 0); - -private slots: - void on_inputSpinBox1_valueChanged(int value); - void on_inputSpinBox2_valueChanged(int value); - -private: - Ui::CalculatorForm ui; -}; - -#endif diff --git a/qt4/src/app/examples/calculatorform/calculatorform.pro b/qt4/src/app/examples/calculatorform/calculatorform.pro deleted file mode 100644 index b1abdc0ed..000000000 --- a/qt4/src/app/examples/calculatorform/calculatorform.pro +++ /dev/null @@ -1,8 +0,0 @@ -HEADERS = calculatorform.h -FORMS = calculatorform.ui - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorform -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/designer/calculatorform -INSTALLS += target sources diff --git a/qt4/src/app/examples/calculatorform/calculatorform.ui b/qt4/src/app/examples/calculatorform/calculatorform.ui deleted file mode 100644 index 3a956399a..000000000 --- a/qt4/src/app/examples/calculatorform/calculatorform.ui +++ /dev/null @@ -1,284 +0,0 @@ - - - - - CalculatorForm - - - CalculatorForm - - - - 0 - 0 - 400 - 300 - - - - - 5 - 5 - 0 - 0 - - - - Calculator Form - - - - - - - 9 - - - 6 - - - - - horizontalSpacer - - - - 239 - 9 - 152 - 52 - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - label_3_2 - - - - 169 - 9 - 20 - 52 - - - - = - - - Qt::AlignCenter - - - - - - - - - - 1 - - - 6 - - - - - label_2_2_2 - - - - 1 - 1 - 36 - 17 - - - - Output - - - - - - - outputWidget - - - - 1 - 24 - 36 - 27 - - - - QFrame::Box - - - QFrame::Sunken - - - 0 - - - Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask - - - - - - - - - verticalSpacer - - - - 89 - 67 - 20 - 224 - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - 1 - - - 6 - - - - - label_2 - - - - 1 - 1 - 46 - 19 - - - - Input 2 - - - - - - - inputSpinBox2 - - - - 1 - 26 - 46 - 25 - - - - - - - - - - label_3 - - - - 63 - 9 - 20 - 52 - - - - + - - - Qt::AlignCenter - - - - - - - - - - 1 - - - 6 - - - - - label - - - - 1 - 1 - 46 - 19 - - - - Input 1 - - - - - - - inputSpinBox1 - - - - 1 - 26 - 46 - 25 - - - - - - - - - - - - diff --git a/qt4/src/app/examples/calculatorform/font.qrc b/qt4/src/app/examples/calculatorform/font.qrc deleted file mode 100644 index e175b3778..000000000 --- a/qt4/src/app/examples/calculatorform/font.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - -../../../../contrib/qt-everywhere-opensource-src-4.7.4/lib/fonts/helvetica_120_50.qpf - - diff --git a/qt4/src/app/examples/calculatorform/main.cpp b/qt4/src/app/examples/calculatorform/main.cpp deleted file mode 100644 index ffb0fc15c..000000000 --- a/qt4/src/app/examples/calculatorform/main.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2005-2007 Trolltech ASA. All rights reserved. -** -** This file is part of the example classes of the Qt Toolkit. -** -** This file may be used under the terms of the GNU General Public -** License version 2.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of -** this file. Please review the following information to ensure GNU -** General Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/ -** -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** In addition, as a special exception, Trolltech gives you certain -** additional rights. These rights are described in the Trolltech GPL -** Exception version 1.0, which can be found at -** http://www.trolltech.com/products/qt/gplexception/ and in the file -** GPL_EXCEPTION.txt in this package. -** -** In addition, as a special exception, Trolltech, as the sole copyright -** holder for Qt Designer, grants users of the Qt/Eclipse Integration -** plug-in the right for the Qt/Eclipse Integration to link to -** functionality provided by Qt Designer and its related libraries. -** -** Trolltech reserves all rights not expressly granted herein. -** -** Trolltech ASA (c) 2007 -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -****************************************************************************/ - -#include - -#include "calculatorform.h" - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - CalculatorForm calculator; - calculator.show(); - return app.exec(); -} - diff --git a/qt4/src/app/examples/calculatorform/target.mk b/qt4/src/app/examples/calculatorform/target.mk index 77ecbc1e0..2f31a6e48 100644 --- a/qt4/src/app/examples/calculatorform/target.mk +++ b/qt4/src/app/examples/calculatorform/target.mk @@ -1,77 +1,14 @@ -# build with QtCore and QtGui support by default -# (can be overridden in the qmake project file) -QT = core gui +# identify the qt4 repository by searching for a file that is unique for qt4 +QT4_REP_DIR := $(call select_from_repositories,lib/import/import-qt4.inc) +QT4_REP_DIR := $(realpath $(dir $(QT4_REP_DIR))../..) -# find out the name of the project directory -PROJECT_DIR_NAME = $(notdir $(abspath $(PRG_DIR))) +include $(QT4_REP_DIR)/lib/mk/qt_version.inc -INC_DIR += $(PRG_DIR) +QMAKE_PROJECT_PATH = $(realpath $(QT4_REP_DIR)/contrib/$(QT4)/examples/designer/calculatorform) +QMAKE_PROJECT_FILE = $(QMAKE_PROJECT_PATH)/calculatorform.pro -SRC_CC = calculatorform.cpp main.cpp +vpath % $(QMAKE_PROJECT_PATH) -###### start of editable part ###### +include $(QT4_REP_DIR)/src/app/tmpl/target_defaults.inc -# include the qmake project file -# -> change the filename if it differs from the project dir name - -QMAKE_PROJECT_FILE = $(realpath $(PRG_DIR)/$(PROJECT_DIR_NAME).pro) - -ifneq ($(strip $(QMAKE_PROJECT_FILE)),) -include $(QMAKE_PROJECT_FILE) -endif - -# how to name the generated executable -# (if not already defined in the qmake project file) -# -> change if it shall not be the name of the project dir - -ifndef TARGET -TARGET = $(PROJECT_DIR_NAME) -endif - -CC_CXX_OPT += -DQT_MAIN_STACK_SIZE=512*1024 - -###### end of editable part ###### - -LIBS += libc libm cxx - -# QtCore stuff -ifeq ($(findstring core, $(QT)), core) -QT_DEFINES += -DQT_CORE_LIB -LIBS += qt_core -endif - -# QtGui stuff -ifeq ($(findstring gui, $(QT)), gui) -QT_DEFINES += -DQT_GUI_LIB -LIBS += qt_gui -ifneq ($(findstring font.qrc, $(RESOURCES)), font.qrc) -RESOURCES += font.qrc -endif -endif - -# QtScript stuff -ifeq ($(findstring script, $(QT)), script) -LIBS += qt_script -endif - -# QtScriptTools stuff -ifeq ($(findstring scripttools, $(QT)), scripttools) -LIBS += qt_scripttools -endif - -# QtSvg stuff -ifeq ($(findstring svg, $(QT)), svg) -LIBS += qt_svg -endif - -# QtXml stuff -ifeq ($(findstring xml, $(QT)), xml) -LIBS += qt_xml -endif - -# QtUiTools stuff -ifeq ($(findstring uitools, $(CONFIG)), uitools) -LIBS += qt_ui_tools -endif - -#endif # $(QMAKE_PROJECT_FILE) +include $(QT4_REP_DIR)/src/app/tmpl/target_final.inc diff --git a/qt4/src/app/examples/previewer/target.mk b/qt4/src/app/examples/previewer/target.mk index 16cec8774..2ed36210d 100644 --- a/qt4/src/app/examples/previewer/target.mk +++ b/qt4/src/app/examples/previewer/target.mk @@ -1,101 +1,14 @@ -# build with QtCore and QtGui support by default -# (can be overridden in the qmake project file) -QT = core gui +# identify the qt4 repository by searching for a file that is unique for qt4 +QT4_REP_DIR := $(call select_from_repositories,lib/import/import-qt4.inc) +QT4_REP_DIR := $(realpath $(dir $(QT4_REP_DIR))../..) -# find out the name of the project directory -PROJECT_DIR_NAME = $(notdir $(abspath $(PRG_DIR))) +include $(QT4_REP_DIR)/lib/mk/qt_version.inc -INC_DIR += $(PRG_DIR) +QMAKE_PROJECT_PATH = $(realpath $(QT4_REP_DIR)/contrib/$(QT4)/examples/webkit/previewer) +QMAKE_PROJECT_FILE = $(QMAKE_PROJECT_PATH)/previewer.pro -###### start of editable part ###### +vpath % $(QMAKE_PROJECT_PATH) -# include the qmake project file -# -> change the filename if it differs from the project dir name +include $(QT4_REP_DIR)/src/app/tmpl/target_defaults.inc -QT4 = qt-everywhere-opensource-src-4.7.4 - -#QMAKE_PROJECT_FILE = $(realpath $(PRG_DIR)/$(PROJECT_DIR_NAME).pro) -QMAKE_PROJECT_FILE = $(realpath $(REP_DIR)/contrib/$(QT4)/examples/webkit/previewer/previewer.pro) - -ifneq ($(strip $(QMAKE_PROJECT_FILE)),) -include $(QMAKE_PROJECT_FILE) -endif - -# -# The following files don't need to be moc'ed, -# so exclude them from $(SOURCES) and $(HEADERS). -# -NO_MOC_SOURCES = previewer.cpp main.cpp mainwindow.cpp -SOURCES := $(filter-out $(NO_MOC_SOURCES), $(SOURCES)) -SRC_CC = $(NO_MOC_SOURCES) - - -# how to name the generated executable -# (if not already defined in the qmake project file) -# -> change if it shall not be the name of the project dir - -ifndef TARGET -TARGET = $(PROJECT_DIR_NAME) -endif - -CC_CXX_OPT += -DQT_MAIN_STACK_SIZE=512*1024 - -vpath % $(REP_DIR)/contrib/$(QT4)/examples/webkit/previewer - -###### end of editable part ###### - -LIBS += cxx libc - -# static Qt plugins -ifeq ($(findstring qjpeg, $(QT_PLUGIN)), qjpeg) -LIBS += qjpeg -endif - -# QtCore stuff -ifeq ($(findstring core, $(QT)), core) -QT_DEFINES += -DQT_CORE_LIB -LIBS += qt_core -endif - -# QtGui stuff -ifeq ($(findstring gui, $(QT)), gui) -QT_DEFINES += -DQT_GUI_LIB -LIBS += qt_gui dejavusans -endif - -# QtNetwork stuff -ifeq ($(findstring network, $(QT)), network) -LIBS += qt_network -endif - -# QtScript stuff -ifeq ($(findstring script, $(QT)), script) -LIBS += qt_script -endif - -# QtScriptTools stuff -ifeq ($(findstring scripttools, $(QT)), scripttools) -LIBS += qt_scripttools -endif - -# QtSvg stuff -ifeq ($(findstring svg, $(QT)), svg) -LIBS += qt_svg -endif - -# QtXml stuff -ifeq ($(findstring xml, $(QT)), xml) -LIBS += qt_xml -endif - -# QtUiTools stuff -ifeq ($(findstring uitools, $(CONFIG)), uitools) -LIBS += qt_ui_tools -endif - -# QtWebKit stuff -ifeq ($(findstring webkit, $(QT)), webkit) -LIBS += qt_webcore -endif - -#endif # $(QMAKE_PROJECT_FILE) +include $(QT4_REP_DIR)/src/app/tmpl/target_final.inc diff --git a/qt4/src/app/examples/tetrix/font.qrc b/qt4/src/app/examples/tetrix/font.qrc deleted file mode 100644 index e175b3778..000000000 --- a/qt4/src/app/examples/tetrix/font.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - -../../../../contrib/qt-everywhere-opensource-src-4.7.4/lib/fonts/helvetica_120_50.qpf - - diff --git a/qt4/src/app/examples/tetrix/main.cpp b/qt4/src/app/examples/tetrix/main.cpp deleted file mode 100644 index 06eae92b7..000000000 --- a/qt4/src/app/examples/tetrix/main.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2007-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the example classes of the Qt Toolkit. -** -** This file may be used under the terms of the GNU General Public -** License versions 2.0 or 3.0 as published by the Free Software -** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Alternatively you may (at -** your option) use any later version of the GNU General Public -** License if such license has been publicly approved by Trolltech ASA -** (or its successors, if any) and the KDE Free Qt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. If -** you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** In addition, as a special exception, Trolltech, as the sole -** copyright holder for Qt Designer, grants users of the Qt/Eclipse -** Integration plug-in the right for the Qt/Eclipse Integration to -** link to functionality provided by Qt Designer and its related -** libraries. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly -** granted herein. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -****************************************************************************/ - -#include "tetrixboard.h" - -#include -#include -#include - -struct QtMetaObject : private QObject -{ -public: - static const QMetaObject *get() - { return &static_cast(0)->staticQtMetaObject; } -}; - -//! [0] -class TetrixUiLoader : public QUiLoader -{ -public: - TetrixUiLoader(QObject *parent = 0) - : QUiLoader(parent) - { } - virtual QWidget *createWidget(const QString &className, QWidget *parent = 0, - const QString &name = QString()) - { - if (className == QLatin1String("TetrixBoard")) { - QWidget *board = new TetrixBoard(parent); - board->setObjectName(name); - return board; - } - return QUiLoader::createWidget(className, parent, name); - } -}; -//! [0] - -static QScriptValue evaluateFile(QScriptEngine &engine, const QString &fileName) -{ - QFile file(fileName); - file.open(QIODevice::ReadOnly); - return engine.evaluate(file.readAll(), fileName); -} - -int main(int argc, char *argv[]) -{ - Q_INIT_RESOURCE(tetrix); -//! [1] - QApplication app(argc, argv); - QScriptEngine engine; - - QScriptValue Qt = engine.newQMetaObject(QtMetaObject::get()); - Qt.setProperty("App", engine.newQObject(&app)); - engine.globalObject().setProperty("Qt", Qt); -//! [1] - -//! [2] - evaluateFile(engine, ":/tetrixpiece.js"); - evaluateFile(engine, ":/tetrixboard.js"); - evaluateFile(engine, ":/tetrixwindow.js"); -//! [2] - -//! [3] - TetrixUiLoader loader; - QFile uiFile(":/tetrixwindow.ui"); - uiFile.open(QIODevice::ReadOnly); - QWidget *ui = loader.load(&uiFile); - uiFile.close(); - - QScriptValue ctor = engine.evaluate("TetrixWindow"); - QScriptValue scriptUi = engine.newQObject(ui, QScriptEngine::ScriptOwnership); - QScriptValue tetrix = ctor.construct(QScriptValueList() << scriptUi); -//! [3] - -//! [4] - ui->move(250, 250); - ui->resize(550, 370); - ui->show(); - - qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); - return app.exec(); -//! [4] -} diff --git a/qt4/src/app/examples/tetrix/target.mk b/qt4/src/app/examples/tetrix/target.mk index faf09b081..f01c258a7 100644 --- a/qt4/src/app/examples/tetrix/target.mk +++ b/qt4/src/app/examples/tetrix/target.mk @@ -1,77 +1,16 @@ -# build with QtCore and QtGui support by default -# (can be overridden in the qmake project file) -QT = core gui +# identify the qt4 repository by searching for a file that is unique for qt4 +QT4_REP_DIR := $(call select_from_repositories,lib/import/import-qt4.inc) +QT4_REP_DIR := $(realpath $(dir $(QT4_REP_DIR))../..) -# find out the name of the project directory -PROJECT_DIR_NAME = $(notdir $(abspath $(PRG_DIR))) +include $(QT4_REP_DIR)/lib/mk/qt_version.inc -INC_DIR += $(PRG_DIR) +QMAKE_PROJECT_PATH = $(realpath $(QT4_REP_DIR)/contrib/$(QT4)/examples/script/qstetrix) +QMAKE_PROJECT_FILE = $(QMAKE_PROJECT_PATH)/qstetrix.pro -SRC_CC = main.cpp tetrixboard.cpp +vpath % $(QMAKE_PROJECT_PATH) -###### start of editable part ###### +include $(QT4_REP_DIR)/src/app/tmpl/target_defaults.inc -# include the qmake project file -# -> change the filename if it differs from the project dir name +CC_CXX_OPT += -DQT_NO_SCRIPTTOOLS -QMAKE_PROJECT_FILE = $(realpath $(PRG_DIR)/$(PROJECT_DIR_NAME).pro) - -ifneq ($(strip $(QMAKE_PROJECT_FILE)),) -include $(QMAKE_PROJECT_FILE) -endif - -# how to name the generated executable -# (if not already defined in the qmake project file) -# -> change if it shall not be the name of the project dir - -ifndef TARGET -TARGET = $(PROJECT_DIR_NAME) -endif - -CC_CXX_OPT += -DQT_MAIN_STACK_SIZE=512*1024 - -###### end of editable part ###### - -LIBS += libc libm cxx - -# QtCore stuff -ifeq ($(findstring core, $(QT)), core) -QT_DEFINES += -DQT_CORE_LIB -LIBS += qt_core -endif - -# QtGui stuff -ifeq ($(findstring gui, $(QT)), gui) -QT_DEFINES += -DQT_GUI_LIB -LIBS += qt_gui -ifneq ($(findstring font.qrc, $(RESOURCES)), font.qrc) -RESOURCES += font.qrc -endif -endif - -# QtScript stuff -ifeq ($(findstring script, $(QT)), script) -LIBS += qt_script -endif - -# QtScriptTools stuff -ifeq ($(findstring scripttools, $(QT)), scripttools) -LIBS += qt_scripttools -endif - -# QtSvg stuff -ifeq ($(findstring svg, $(QT)), svg) -LIBS += qt_svg -endif - -# QtXml stuff -ifeq ($(findstring xml, $(QT)), xml) -LIBS += qt_xml -endif - -# QtUiTools stuff -ifeq ($(findstring uitools, $(CONFIG)), uitools) -LIBS += qt_ui_tools -endif - -#endif # $(QMAKE_PROJECT_FILE) +include $(QT4_REP_DIR)/src/app/tmpl/target_final.inc diff --git a/qt4/src/app/examples/tetrix/tetrix.pro b/qt4/src/app/examples/tetrix/tetrix.pro deleted file mode 100644 index c7afa766d..000000000 --- a/qt4/src/app/examples/tetrix/tetrix.pro +++ /dev/null @@ -1,11 +0,0 @@ -QT += script -CONFIG += uitools -FORMS = tetrixwindow.ui -RESOURCES = tetrix.qrc -HEADERS = tetrixboard.h - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/script/tetrix -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS tetrix.pro *.js -sources.path = $$[QT_INSTALL_EXAMPLES]/script/tetrix -INSTALLS += target sources diff --git a/qt4/src/app/examples/tetrix/tetrix.qrc b/qt4/src/app/examples/tetrix/tetrix.qrc deleted file mode 100644 index 58d085aac..000000000 --- a/qt4/src/app/examples/tetrix/tetrix.qrc +++ /dev/null @@ -1,8 +0,0 @@ - - - tetrixwindow.js - tetrixwindow.ui - tetrixboard.js - tetrixpiece.js - - diff --git a/qt4/src/app/examples/tetrix/tetrixboard.cpp b/qt4/src/app/examples/tetrix/tetrixboard.cpp deleted file mode 100644 index 86da324b5..000000000 --- a/qt4/src/app/examples/tetrix/tetrixboard.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2007-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the example classes of the Qt Toolkit. -** -** This file may be used under the terms of the GNU General Public -** License versions 2.0 or 3.0 as published by the Free Software -** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Alternatively you may (at -** your option) use any later version of the GNU General Public -** License if such license has been publicly approved by Trolltech ASA -** (or its successors, if any) and the KDE Free Qt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. If -** you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** In addition, as a special exception, Trolltech, as the sole -** copyright holder for Qt Designer, grants users of the Qt/Eclipse -** Integration plug-in the right for the Qt/Eclipse Integration to -** link to functionality provided by Qt Designer and its related -** libraries. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly -** granted herein. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -****************************************************************************/ - -#include "tetrixboard.h" - -#include - -Q_DECLARE_METATYPE(QPainter*) - -TetrixBoard::TetrixBoard(QWidget *parent) - : QFrame(parent) -{ - timer = new QTimer(this); - qMetaTypeId(); -} - -void TetrixBoard::setNextPieceLabel(QWidget *label) -{ - nextPieceLabel = qobject_cast(label); -} - -QObject *TetrixBoard::getTimer() -{ - return timer; -} - -QSize TetrixBoard::minimumSizeHint() const -{ - return QSize(BoardWidth * 5 + frameWidth() * 2, - BoardHeight * 5 + frameWidth() * 2); -} - -void TetrixBoard::paintEvent(QPaintEvent *event) -{ - QFrame::paintEvent(event); - - QPainter painter(this); - QRect rect = contentsRect(); - int boardTop = rect.bottom() - BoardHeight*squareHeight(); - painter.translate(rect.left(), boardTop); - - emit paintRequested(&painter); -} - -void TetrixBoard::keyPressEvent(QKeyEvent *event) -{ - emit keyPressed(event->key()); -} - -void TetrixBoard::showNextPiece(int width, int height) -{ - if (!nextPieceLabel) - return; - - QPixmap pixmap(width * squareWidth(), height * squareHeight()); - QPainter painter(&pixmap); - painter.fillRect(pixmap.rect(), nextPieceLabel->palette().background()); - - emit paintNextPieceRequested(&painter); - - nextPieceLabel->setPixmap(pixmap); -} - -void TetrixBoard::drawPauseScreen(QPainter *painter) -{ - painter->drawText(contentsRect(), Qt::AlignCenter, tr("Pause")); -} - -void TetrixBoard::drawSquare(QPainter *painter, int x, int y, int shape) -{ - static const QRgb colorTable[8] = { - 0x000000, 0xCC6666, 0x66CC66, 0x6666CC, - 0xCCCC66, 0xCC66CC, 0x66CCCC, 0xDAAA00 - }; - - x = x*squareWidth(); - y = y*squareHeight(); - - QColor color = colorTable[shape]; - painter->fillRect(x + 1, y + 1, squareWidth() - 2, squareHeight() - 2, - color); - - painter->setPen(color.light()); - painter->drawLine(x, y + squareHeight() - 1, x, y); - painter->drawLine(x, y, x + squareWidth() - 1, y); - - painter->setPen(color.dark()); - painter->drawLine(x + 1, y + squareHeight() - 1, - x + squareWidth() - 1, y + squareHeight() - 1); - painter->drawLine(x + squareWidth() - 1, y + squareHeight() - 1, - x + squareWidth() - 1, y + 1); -} diff --git a/qt4/src/app/examples/tetrix/tetrixboard.h b/qt4/src/app/examples/tetrix/tetrixboard.h deleted file mode 100644 index 5829a7417..000000000 --- a/qt4/src/app/examples/tetrix/tetrixboard.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2007-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the example classes of the Qt Toolkit. -** -** This file may be used under the terms of the GNU General Public -** License versions 2.0 or 3.0 as published by the Free Software -** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Alternatively you may (at -** your option) use any later version of the GNU General Public -** License if such license has been publicly approved by Trolltech ASA -** (or its successors, if any) and the KDE Free Qt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. If -** you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** In addition, as a special exception, Trolltech, as the sole -** copyright holder for Qt Designer, grants users of the Qt/Eclipse -** Integration plug-in the right for the Qt/Eclipse Integration to -** link to functionality provided by Qt Designer and its related -** libraries. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly -** granted herein. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -****************************************************************************/ - -#ifndef TETRIXBOARD_H -#define TETRIXBOARD_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE -class QLabel; -QT_END_NAMESPACE - -class TetrixBoard : public QFrame -{ - Q_OBJECT - Q_PROPERTY(QObject* timer READ getTimer) - -public: - TetrixBoard(QWidget *parent = 0); - - void setNextPieceLabel(QWidget *label); - void setBoardWidth(int width); - void setBoardHeight(int height); - QSize minimumSizeHint() const; - - QObject *getTimer(); - -signals: - void scoreChanged(int score); - void levelChanged(int level); - void linesRemovedChanged(int numLines); - -#if !defined(Q_MOC_RUN) -private: // can only be emitted by TetrixBoard -#endif - void keyPressed(int key); - void paintRequested(QPainter *painter); - void paintNextPieceRequested(QPainter *painter); - -protected: - void paintEvent(QPaintEvent *event); - void keyPressEvent(QKeyEvent *event); - -protected slots: - void showNextPiece(int width, int height); - void drawPauseScreen(QPainter *painter); - void drawSquare(QPainter *painter, int x, int y, int shape); - -private: - enum { BoardWidth = 10, BoardHeight = 22 }; - - int squareWidth() { return contentsRect().width() / BoardWidth; } - int squareHeight() { return contentsRect().height() / BoardHeight; } - - QTimer *timer; - QPointer nextPieceLabel; -}; - -#endif diff --git a/qt4/src/app/examples/tetrix/tetrixboard.js b/qt4/src/app/examples/tetrix/tetrixboard.js deleted file mode 100644 index 05569e75e..000000000 --- a/qt4/src/app/examples/tetrix/tetrixboard.js +++ /dev/null @@ -1,249 +0,0 @@ -function TetrixBoard(ui) -{ - this.ui = ui; - - this.isStarted = false; - this.isPaused = false; - - this._board = new Array(TetrixBoard.BoardWidth * TetrixBoard.BoardHeight); - this.clearBoard(); - - this.curPiece = new TetrixPiece(); - this.nextPiece = new TetrixPiece(); - this.nextPiece.setRandomShape(); - - ui.timer.timeout.connect(this, this.onTimer); - ui.keyPressed.connect(this, this.onKeyPress); - ui.paintRequested.connect(this, this.onPaint); - ui.paintNextPieceRequested.connect(this, this.onPaintNextPiece); -} - -TetrixBoard.BoardWidth = 10; -TetrixBoard.BoardHeight = 22; - -TetrixBoard.prototype.start = function() { - if (this.isPaused) - return; - - this.isStarted = true; - this.isWaitingAfterLine = false; - this.numLinesRemoved = 0; - this.numPiecesDropped = 0; - this.score = 0; - this.level = 1; - this.clearBoard(); - - this.ui.linesRemovedChanged(this.numLinesRemoved); - this.ui.scoreChanged(this.score); - this.ui.levelChanged(this.level); - - this.newPiece(); - this.ui.timer.start(this.timeoutTime()); -} - -TetrixBoard.prototype.pause = function() { - if (!this.isStarted) - return; - - this.isPaused = !this.isPaused; - if (this.isPaused) { - this.ui.timer.stop(); - } else { - this.ui.timer.start(this.timeoutTime()); - } - this.ui.update(); -} - -TetrixBoard.prototype.getShapeAt = function(x, y) { - return this._board[(y * TetrixBoard.BoardWidth) + x]; -} - -TetrixBoard.prototype.setShapeAt = function(x, y, newShape) { - this._board[(y * TetrixBoard.BoardWidth) + x] = newShape; -} - -TetrixBoard.prototype.clearBoard = function() { - for (var i = 0; i < TetrixBoard.BoardHeight * TetrixBoard.BoardWidth; ++i) - this._board[i] = TetrixShape.NoShape; -} - -TetrixBoard.prototype.dropDown = function() { - var dropHeight = 0; - var newY = this.curY; - while (newY > 0) { - if (!this.tryMove(this.curPiece, this.curX, newY - 1)) - break; - --newY; - ++dropHeight; - } - this.pieceDropped(dropHeight); -} - -TetrixBoard.prototype.oneLineDown = function() { - if (!this.tryMove(this.curPiece, this.curX, this.curY - 1)) - this.pieceDropped(0); -} - -TetrixBoard.prototype.pieceDropped = function(dropHeight) { - for (var i = 0; i < 4; ++i) { - var x = this.curX + this.curPiece.getX(i); - var y = this.curY - this.curPiece.getY(i); - this.setShapeAt(x, y, this.curPiece.shape); - } - - ++this.numPiecesDropped; - if ((this.numPiecesDropped % 25) == 0) { - ++this.level; - this.ui.timer.start(this.timeoutTime()); - this.ui.levelChanged(this.level); - } - - this.score += dropHeight + 7; - this.ui.scoreChanged(this.score); - this.removeFullLines(); - - if (!this.isWaitingAfterLine) - this.newPiece(); -} - -TetrixBoard.prototype.removeFullLines = function() { - var numFullLines = 0; - - for (var i = TetrixBoard.BoardHeight - 1; i >= 0; --i) { - var lineIsFull = true; - - for (var j = 0; j < TetrixBoard.BoardWidth; ++j) { - if (this.getShapeAt(j, i) == TetrixShape.NoShape) { - lineIsFull = false; - break; - } - } - - if (lineIsFull) { - ++numFullLines; - for (var k = i; k < TetrixBoard.BoardHeight - 1; ++k) { - for (var j = 0; j < TetrixBoard.BoardWidth; ++j) - this.setShapeAt(j, k, this.getShapeAt(j, k + 1)); - } - for (var j = 0; j < TetrixBoard.BoardWidth; ++j) - this.setShapeAt(j, TetrixBoard.BoardHeight - 1, TetrixShape.NoShape); - } - } - - if (numFullLines > 0) { - this.numLinesRemoved += numFullLines; - this.score += 10 * numFullLines; - this.ui.linesRemovedChanged(this.numLinesRemoved); - this.ui.scoreChanged(this.score); - - this.ui.timer.start(500); - this.isWaitingAfterLine = true; - this.curPiece.shape = TetrixShape.NoShape; - this.ui.update(); - } -} - -TetrixBoard.prototype.newPiece = function() { - this.curPiece = this.nextPiece; - this.nextPiece = new TetrixPiece(); - this.nextPiece.setRandomShape(); - this.ui.showNextPiece(this.nextPiece.maxX - this.nextPiece.minX + 1, - this.nextPiece.maxY - this.nextPiece.minY + 1); - this.curX = TetrixBoard.BoardWidth / 2 + 1; - this.curY = TetrixBoard.BoardHeight - 1 + this.curPiece.minY; - - if (!this.tryMove(this.curPiece, this.curX, this.curY)) { - this.curPiece.shape = TetrixShape.NoShape; - this.ui.timer.stop(); - this.isStarted = false; - } -} - -TetrixBoard.prototype.tryMove = function(newPiece, newX, newY) { - for (var i = 0; i < 4; ++i) { - var x = newX + newPiece.getX(i); - var y = newY - newPiece.getY(i); - if ((x < 0) || (x >= TetrixBoard.BoardWidth) || (y < 0) || (y >= TetrixBoard.BoardHeight)) - return false; - if (this.getShapeAt(x, y) != TetrixShape.NoShape) - return false; - } - - this.curPiece = newPiece; - this.curX = newX; - this.curY = newY; - this.ui.update(); - return true; -} - -TetrixBoard.prototype.onPaint = function(painter) { - if (this.isPaused) { - this.ui.drawPauseScreen(painter); - return; - } - - for (var i = 0; i < TetrixBoard.BoardHeight; ++i) { - for (var j = 0; j < TetrixBoard.BoardWidth; ++j) { - var shape = this.getShapeAt(j, TetrixBoard.BoardHeight - i - 1); - if (shape != TetrixShape.NoShape) - this.ui.drawSquare(painter, j, i, shape); - } - } - - if (this.curPiece.shape != TetrixShape.NoShape) { - for (var i = 0; i < 4; ++i) { - var x = this.curX + this.curPiece.getX(i); - var y = this.curY - this.curPiece.getY(i); - this.ui.drawSquare(painter, x, TetrixBoard.BoardHeight - y - 1, - this.curPiece.shape); - } - } -} - -TetrixBoard.prototype.onPaintNextPiece = function(painter) { - for (var i = 0; i < 4; ++i) { - var x = this.nextPiece.getX(i) - this.nextPiece.minX; - var y = this.nextPiece.getY(i) - this.nextPiece.minY; - this.ui.drawSquare(painter, x, y, this.nextPiece.shape); - } -} - -TetrixBoard.prototype.onKeyPress = function(key) { - if (!this.isStarted || this.isPaused || (this.curPiece.shape == TetrixShape.NoShape)) - return; - - switch (key) { - case Qt.Key_Left: - this.tryMove(this.curPiece, this.curX - 1, this.curY); - break; - case Qt.Key_Right: - this.tryMove(this.curPiece, this.curX + 1, this.curY); - break; - case Qt.Key_Down: - this.tryMove(this.curPiece.rotatedRight(), this.curX, this.curY); - break; - case Qt.Key_Up: - this.tryMove(this.curPiece.rotatedLeft(), this.curX, this.curY); - break; - case Qt.Key_Space: - this.dropDown(); - break; - case Qt.Key_D: - this.oneLineDown(); - break; - } -} - -TetrixBoard.prototype.onTimer = function() { - if (this.isWaitingAfterLine) { - this.isWaitingAfterLine = false; - this.newPiece(); - this.ui.timer.start(this.timeoutTime()); - } else { - this.oneLineDown(); - } -} - -TetrixBoard.prototype.timeoutTime = function() { - return 1000 / (1 + this.level); -} diff --git a/qt4/src/app/examples/tetrix/tetrixpiece.js b/qt4/src/app/examples/tetrix/tetrixpiece.js deleted file mode 100644 index e99fa8a17..000000000 --- a/qt4/src/app/examples/tetrix/tetrixpiece.js +++ /dev/null @@ -1,131 +0,0 @@ -TetrixShape = { - NoShape:0, - ZShape:1, - SShape:2, - LineShape:3, - TShape:4, - SquareShape:5, - LShape:6, - MirroredLShape:7 -} - -TetrixCoordsTable = [ - [ [ 0, 0 ], [ 0, 0 ], [ 0, 0 ], [ 0, 0 ] ], - [ [ 0, -1 ], [ 0, 0 ], [ -1, 0 ], [ -1, 1 ] ], - [ [ 0, -1 ], [ 0, 0 ], [ 1, 0 ], [ 1, 1 ] ], - [ [ 0, -1 ], [ 0, 0 ], [ 0, 1 ], [ 0, 2 ] ], - [ [ -1, 0 ], [ 0, 0 ], [ 1, 0 ], [ 0, 1 ] ], - [ [ 0, 0 ], [ 1, 0 ], [ 0, 1 ], [ 1, 1 ] ], - [ [ -1, -1 ], [ 0, -1 ], [ 0, 0 ], [ 0, 1 ] ], - [ [ 1, -1 ], [ 0, -1 ], [ 0, 0 ], [ 0, 1 ] ] -] - -function TetrixPiece() -{ - this.shape = TetrixShape.NoShape; -} - -TetrixPiece.prototype.__defineGetter__( - "shape", - function() { - return this._shape; - } -); - -TetrixPiece.prototype.__defineSetter__( - "shape", - function(shape) { - this._shape = shape; - this._coords = new Array(4); - for (var i = 0; i < 4; ++i) - this._coords[i] = TetrixCoordsTable[shape][i].slice(); - } -); - -TetrixPiece.prototype.setRandomShape = function() { - this.shape = Math.floor(((Math.random() * 100000) % 7) + 1); -} - -TetrixPiece.prototype.getX = function(index) { - return this._coords[index][0]; -} - -TetrixPiece.prototype.getY = function(index) { - return this._coords[index][1]; -} - -TetrixPiece.prototype._setX = function(index, x) { - this._coords[index][0] = x; -} - -TetrixPiece.prototype._setY = function(index, y) { - this._coords[index][1] = y; -} - -TetrixPiece.prototype.__defineGetter__( - "minX", - function() { - var min = this._coords[0][0]; - for (var i = 1; i < 4; ++i) - min = Math.min(min, this._coords[i][0]); - return min; - } -); - -TetrixPiece.prototype.__defineGetter__( - "maxX", - function() { - var max = this._coords[0][0]; - for (var i = 1; i < 4; ++i) - max = Math.max(max, this._coords[i][0]); - return max; - } -); - -TetrixPiece.prototype.__defineGetter__( - "minY", - function() { - var min = this._coords[0][1]; - for (var i = 1; i < 4; ++i) - min = Math.min(min, this._coords[i][1]); - return min; - } -); - -TetrixPiece.prototype.__defineGetter__( - "maxY", - function() { - var max = this._coords[0][1]; - for (var i = 1; i < 4; ++i) - max = Math.max(max, this._coords[i][1]); - return max; - } -); - -TetrixPiece.prototype.rotatedLeft = function() { - var result = new TetrixPiece(); - if (this._shape == TetrixShape.SquareShape) { - result.shape = this._shape; - return result; - } - result._shape = this._shape; - for (var i = 0; i < 4; ++i) { - result._setX(i, this.getY(i)); - result._setY(i, -this.getX(i)); - } - return result; -} - -TetrixPiece.prototype.rotatedRight = function() { - var result = new TetrixPiece(); - if (this._shape == TetrixShape.SquareShape) { - result.shape = this._shape; - return result; - } - result._shape = this._shape; - for (var i = 0; i < 4; ++i) { - result._setX(i, -this.getY(i)); - result._setY(i, this.getX(i)); - } - return result; -} diff --git a/qt4/src/app/examples/tetrix/tetrixwindow.js b/qt4/src/app/examples/tetrix/tetrixwindow.js deleted file mode 100644 index 6157a8ce3..000000000 --- a/qt4/src/app/examples/tetrix/tetrixwindow.js +++ /dev/null @@ -1,16 +0,0 @@ -function TetrixWindow(ui) -{ - this.ui = ui; - - var boardUi = ui.findChild("board"); - boardUi.nextPieceLabel = ui.findChild("nextPieceLabel"); - - this.board = new TetrixBoard(boardUi); - - ui.findChild("startButton").clicked.connect(this.board, this.board.start); - ui.findChild("quitButton").clicked.connect(Qt.App.quit); - ui.findChild("pauseButton").clicked.connect(this.board, this.board.pause); - boardUi.scoreChanged.connect(ui.findChild("scoreLcd")["display(int)"]); - boardUi.levelChanged.connect(ui.findChild("levelLcd")["display(int)"]); - boardUi.linesRemovedChanged.connect(ui.findChild("linesLcd")["display(int)"]); -} diff --git a/qt4/src/app/examples/tetrix/tetrixwindow.ui b/qt4/src/app/examples/tetrix/tetrixwindow.ui deleted file mode 100644 index a13f538aa..000000000 --- a/qt4/src/app/examples/tetrix/tetrixwindow.ui +++ /dev/null @@ -1,164 +0,0 @@ - - TetrixWindow - - - - 0 - 0 - 537 - 475 - - - - Tetrix - - - - 9 - - - 6 - - - - - 0 - - - 6 - - - - - Qt::NoFocus - - - &Start - - - - - - - QLCDNumber::Filled - - - - - - - LINES REMOVED - - - Qt::AlignBottom|Qt::AlignHCenter - - - - - - - Qt::NoFocus - - - &Pause - - - - - - - QLCDNumber::Filled - - - - - - - Qt::StrongFocus - - - QFrame::Panel - - - QFrame::Sunken - - - - - - - LEVEL - - - Qt::AlignBottom|Qt::AlignHCenter - - - - - - - NEXT - - - Qt::AlignBottom|Qt::AlignHCenter - - - - - - - QLCDNumber::Filled - - - - - - - SCORE - - - Qt::AlignBottom|Qt::AlignHCenter - - - - - - - QFrame::Box - - - QFrame::Raised - - - - - - Qt::AlignCenter - - - - - - - Qt::NoFocus - - - &Quit - - - - - - - - - - TetrixBoard - QFrame -
tetrixboard.h
- 1 -
-
- - -
diff --git a/qt4/src/app/examples/textedit/target.mk b/qt4/src/app/examples/textedit/target.mk index bcde9ac04..d2be91ee4 100644 --- a/qt4/src/app/examples/textedit/target.mk +++ b/qt4/src/app/examples/textedit/target.mk @@ -1,100 +1,14 @@ -# build with QtCore and QtGui support by default -# (can be overridden in the qmake project file) -QT = core gui +# identify the qt4 repository by searching for a file that is unique for qt4 +QT4_REP_DIR := $(call select_from_repositories,lib/import/import-qt4.inc) +QT4_REP_DIR := $(realpath $(dir $(QT4_REP_DIR))../..) -# find out the name of the project directory -PROJECT_DIR_NAME = $(notdir $(abspath $(PRG_DIR))) +include $(QT4_REP_DIR)/lib/mk/qt_version.inc -INC_DIR += $(PRG_DIR) +QMAKE_PROJECT_PATH = $(realpath $(QT4_REP_DIR)/contrib/$(QT4)/demos/textedit) +QMAKE_PROJECT_FILE = $(QMAKE_PROJECT_PATH)/textedit.pro -###### start of editable part ###### +vpath % $(QMAKE_PROJECT_PATH) -# include the qmake project file -# -> change the filename if it differs from the project dir name +include $(QT4_REP_DIR)/src/app/tmpl/target_defaults.inc -QT4 = qt-everywhere-opensource-src-4.7.4 - -#QMAKE_PROJECT_FILE = $(realpath $(PRG_DIR)/$(PROJECT_DIR_NAME).pro) -QMAKE_PROJECT_FILE = $(realpath $(REP_DIR)/contrib/$(QT4)/demos/textedit/textedit.pro) - -ifneq ($(strip $(QMAKE_PROJECT_FILE)),) -include $(QMAKE_PROJECT_FILE) -endif - -# -# The following files don't need to be moc'ed, -# so exclude them from $(SOURCES) and $(HEADERS). -# -NO_MOC_SOURCES = main.cpp textedit.cpp -SOURCES := $(filter-out $(NO_MOC_SOURCES), $(SOURCES)) -SRC_CC = $(NO_MOC_SOURCES) - -# how to name the generated executable -# (if not already defined in the qmake project file) -# -> change if it shall not be the name of the project dir - -ifndef TARGET -TARGET = $(PROJECT_DIR_NAME) -endif - -CC_CXX_OPT += -DQT_MAIN_STACK_SIZE=512*1024 - -vpath % $(REP_DIR)/contrib/$(QT4)/demos/textedit - -###### end of editable part ###### - -LIBS += cxx libc - -# static Qt plugins -ifeq ($(findstring qjpeg, $(QT_PLUGIN)), qjpeg) -LIBS += qjpeg -endif - -# QtCore stuff -ifeq ($(findstring core, $(QT)), core) -QT_DEFINES += -DQT_CORE_LIB -LIBS += qt_core -endif - -# QtGui stuff -ifeq ($(findstring gui, $(QT)), gui) -QT_DEFINES += -DQT_GUI_LIB -LIBS += qt_gui dejavusans -endif - -# QtNetwork stuff -ifeq ($(findstring network, $(QT)), network) -LIBS += qt_network -endif - -# QtScript stuff -ifeq ($(findstring script, $(QT)), script) -LIBS += qt_script -endif - -# QtScriptTools stuff -ifeq ($(findstring scripttools, $(QT)), scripttools) -LIBS += qt_scripttools -endif - -# QtSvg stuff -ifeq ($(findstring svg, $(QT)), svg) -LIBS += qt_svg -endif - -# QtXml stuff -ifeq ($(findstring xml, $(QT)), xml) -LIBS += qt_xml -endif - -# QtUiTools stuff -ifeq ($(findstring uitools, $(CONFIG)), uitools) -LIBS += qt_ui_tools -endif - -# QtWebKit stuff -ifeq ($(findstring webkit, $(QT)), webkit) -LIBS += qt_webcore -endif - -#endif # $(QMAKE_PROJECT_FILE) +include $(QT4_REP_DIR)/src/app/tmpl/target_final.inc diff --git a/qt4/src/app/qt_launchpad/font.qrc b/qt4/src/app/qt_launchpad/font.qrc deleted file mode 100644 index 0bcccddc7..000000000 --- a/qt4/src/app/qt_launchpad/font.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - -../../../contrib/qt-everywhere-opensource-src-4.7.4/lib/fonts/helvetica_120_50.qpf - - diff --git a/qt4/src/app/qt_launchpad/qt_launchpad.pro b/qt4/src/app/qt_launchpad/qt_launchpad.pro index 8e3e1aabe..0546c53e0 100644 --- a/qt4/src/app/qt_launchpad/qt_launchpad.pro +++ b/qt4/src/app/qt_launchpad/qt_launchpad.pro @@ -1,11 +1,15 @@ TEMPLATE = app TARGET = qt_launchpad -QT += core gui -HEADERS += kbyte_loadbar.h \ - child_entry.h \ +QT = core gui +HEADERS += child_entry.h \ + kbyte_loadbar.h \ launch_entry.h \ qt_launchpad.h +SOURCES += child_entry.cpp \ + kbyte_loadbar.cpp \ + launch_entry.cpp \ + main.cpp \ + qt_launchpad.cpp FORMS += child_entry.ui \ launch_entry.ui \ qt_launchpad.ui -RESOURCES += font.qrc diff --git a/qt4/src/app/qt_launchpad/target.mk b/qt4/src/app/qt_launchpad/target.mk index cfd3f7556..dd31da322 100644 --- a/qt4/src/app/qt_launchpad/target.mk +++ b/qt4/src/app/qt_launchpad/target.mk @@ -1,83 +1,7 @@ -# build with QtCore and QtGui support by default -# (can be overridden in the qmake project file) -QT = core gui +# identify the qt4 repository by searching for a file that is unique for qt4 +QT4_REP_DIR := $(call select_from_repositories,lib/import/import-qt4.inc) +QT4_REP_DIR := $(realpath $(dir $(QT4_REP_DIR))../..) -# find out the name of the project directory -PROJECT_DIR_NAME = $(notdir $(abspath $(PRG_DIR))) +include $(QT4_REP_DIR)/src/app/tmpl/target_defaults.inc -INC_DIR += $(PRG_DIR) - -SRC_CC = child_entry.cpp \ - kbyte_loadbar.cpp \ - launch_entry.cpp \ - main.cpp \ - qt_launchpad.cpp - -###### start of editable part ###### - -# include the qmake project file -# -> change the filename if it differs from the project dir name - -QMAKE_PROJECT_FILE = $(realpath $(PRG_DIR)/$(PROJECT_DIR_NAME).pro) - -ifneq ($(strip $(QMAKE_PROJECT_FILE)),) -include $(QMAKE_PROJECT_FILE) -endif - -# how to name the generated executable -# (if not already defined in the qmake project file) -# -> change if it shall not be the name of the project dir - -ifndef TARGET -TARGET = $(PROJECT_DIR_NAME) -endif - -CC_CXX_OPT += -DQT_MAIN_STACK_SIZE=512*1024 - -LIBS += cxx server process launchpad - -###### end of editable part ###### - -LIBS += libc - -# QtCore stuff -ifeq ($(findstring core, $(QT)), core) -QT_DEFINES += -DQT_CORE_LIB -LIBS += qt_core -endif - -# QtGui stuff -ifeq ($(findstring gui, $(QT)), gui) -QT_DEFINES += -DQT_GUI_LIB -LIBS += qt_gui -ifneq ($(findstring font.qrc, $(RESOURCES)), font.qrc) -RESOURCES += font.qrc -endif -endif - -# QtScript stuff -ifeq ($(findstring script, $(QT)), script) -LIBS += qt_script -endif - -# QtScriptTools stuff -ifeq ($(findstring scripttools, $(QT)), scripttools) -LIBS += qt_scripttools -endif - -# QtSvg stuff -ifeq ($(findstring svg, $(QT)), svg) -LIBS += qt_svg -endif - -# QtXml stuff -ifeq ($(findstring xml, $(QT)), xml) -LIBS += qt_xml -endif - -# QtUiTools stuff -ifeq ($(findstring uitools, $(CONFIG)), uitools) -LIBS += qt_ui_tools -endif - -#endif # $(QMAKE_PROJECT_FILE) +include $(QT4_REP_DIR)/src/app/tmpl/target_final.inc diff --git a/qt4/src/app/tmpl/target.mk.example b/qt4/src/app/tmpl/target.mk.example index 0190bf87a..dd31da322 100644 --- a/qt4/src/app/tmpl/target.mk.example +++ b/qt4/src/app/tmpl/target.mk.example @@ -1,85 +1,7 @@ -# build with QtCore and QtGui support by default -# (can be overridden in the qmake project file) -QT = core gui +# identify the qt4 repository by searching for a file that is unique for qt4 +QT4_REP_DIR := $(call select_from_repositories,lib/import/import-qt4.inc) +QT4_REP_DIR := $(realpath $(dir $(QT4_REP_DIR))../..) -# find out the name of the project directory -PROJECT_DIR_NAME = $(notdir $(abspath $(PRG_DIR))) +include $(QT4_REP_DIR)/src/app/tmpl/target_defaults.inc -INC_DIR += $(PRG_DIR) - -###### start of editable part ###### - -# include the qmake project file -# -> change the filename if it differs from the project dir name - -QMAKE_PROJECT_FILE = $(realpath $(PRG_DIR)/$(PROJECT_DIR_NAME).pro) - -ifneq ($(strip $(QMAKE_PROJECT_FILE)),) -include $(QMAKE_PROJECT_FILE) -endif - -# how to name the generated executable -# (if not already defined in the qmake project file) -# -> change if it shall not be the name of the project dir - -ifndef TARGET -TARGET = $(PROJECT_DIR_NAME) -endif - -CC_CXX_OPT += -DQT_MAIN_STACK_SIZE=512*1024 - -###### end of editable part ###### - -LIBS += libc - -# static Qt plugins -ifeq ($(findstring qgif, $(QT_PLUGIN)), qgif) -LIBS += qgif -endif -ifeq ($(findstring qjpeg, $(QT_PLUGIN)), qjpeg) -LIBS += qjpeg -endif - -# QtCore stuff -ifeq ($(findstring core, $(QT)), core) -QT_DEFINES += -DQT_CORE_LIB -LIBS += qt_core -endif - -# QtGui stuff -ifeq ($(findstring gui, $(QT)), gui) -QT_DEFINES += -DQT_GUI_LIB -LIBS += qt_gui dejavusans -endif - -# QtNetwork stuff -ifeq ($(findstring network, $(QT)), network) -LIBS += qt_network -endif - -# QtScript stuff -ifeq ($(findstring script, $(QT)), script) -LIBS += qt_script -endif - -# QtScriptTools stuff -ifeq ($(findstring scripttools, $(QT)), scripttools) -LIBS += qt_scripttools -endif - -# QtSvg stuff -ifeq ($(findstring svg, $(QT)), svg) -LIBS += qt_svg -endif - -# QtXml stuff -ifeq ($(findstring xml, $(QT)), xml) -LIBS += qt_xml -endif - -# QtUiTools stuff -ifeq ($(findstring uitools, $(CONFIG)), uitools) -LIBS += qt_ui_tools -endif - -#endif # $(QMAKE_PROJECT_FILE) +include $(QT4_REP_DIR)/src/app/tmpl/target_final.inc diff --git a/qt4/src/app/tmpl/target_defaults.inc b/qt4/src/app/tmpl/target_defaults.inc new file mode 100644 index 000000000..a3a42736d --- /dev/null +++ b/qt4/src/app/tmpl/target_defaults.inc @@ -0,0 +1,31 @@ +# build with QtCore and QtGui support by default +# - can be overridden in the qmake project file + +QT = core gui + +# find out the name of the project directory + +PROJECT_DIR_NAME = $(notdir $(abspath $(PRG_DIR))) + +# include the qmake project file +# - if the qmake project file has a different name than the project directory, +# set QMAKE_PROJECT_FILE in target.mk before the inclusion of this file + +QMAKE_PROJECT_FILE ?= $(realpath $(PRG_DIR)/$(PROJECT_DIR_NAME).pro) + +ifneq ($(strip $(QMAKE_PROJECT_FILE)),) +include $(QMAKE_PROJECT_FILE) +endif + +# how to name the generated executable +# (if not already defined in the qmake project file) +# - can be overridden in target.mk after inclusion of this file + +ifndef TARGET +TARGET = $(PROJECT_DIR_NAME) +endif + +# default stack size of the main thread +# - can be overridden anywhere in target.mk + +QT_MAIN_STACK_SIZE ?= 512*1024 diff --git a/qt4/src/app/tmpl/target_final.inc b/qt4/src/app/tmpl/target_final.inc new file mode 100644 index 000000000..77a9fa81e --- /dev/null +++ b/qt4/src/app/tmpl/target_final.inc @@ -0,0 +1,61 @@ +INC_DIR += $(PRG_DIR) + +LIBS += libc + +# set the stack size of the main thread +CC_CXX_OPT += -DQT_MAIN_STACK_SIZE=$(QT_MAIN_STACK_SIZE) + +# static Qt plugins +ifeq ($(findstring qgif, $(QT_PLUGIN)), qgif) +LIBS += qgif +endif +ifeq ($(findstring qjpeg, $(QT_PLUGIN)), qjpeg) +LIBS += qjpeg +endif + +# QtCore +ifeq ($(findstring core, $(QT)), core) +QT_DEFINES += -DQT_CORE_LIB +LIBS += qt_core +endif + +# QtGui +ifeq ($(findstring gui, $(QT)), gui) +QT_DEFINES += -DQT_GUI_LIB +LIBS += qt_gui dejavusans +endif + +# QtNetwork +ifeq ($(findstring network, $(QT)), network) +LIBS += qt_network +endif + +# QtScript +ifeq ($(findstring script, $(QT)), script) +LIBS += qt_script +endif + +# QtScriptTools +ifeq ($(findstring scripttools, $(QT)), scripttools) +LIBS += qt_scripttools +endif + +# QtSvg +ifeq ($(findstring svg, $(QT)), svg) +LIBS += qt_svg +endif + +# QtXml +ifeq ($(findstring xml, $(QT)), xml) +LIBS += qt_xml +endif + +# QtUiTools +ifeq ($(findstring uitools, $(CONFIG)), uitools) +LIBS += qt_ui_tools +endif + +# QtWebKit +ifeq ($(findstring webkit, $(QT)), webkit) +LIBS += qt_webcore +endif diff --git a/qt4/tool/Makefile b/qt4/tool/Makefile index e8112bcf5..986121c40 100644 --- a/qt4/tool/Makefile +++ b/qt4/tool/Makefile @@ -5,10 +5,10 @@ # \date 2009-05-15 # -QT4 = qt-everywhere-opensource-src-4.7.4 - REP_DIR := $(realpath ..) +include $(REP_DIR)/lib/mk/qt_version.inc + # # Compound rule for building the tools in the right order # diff --git a/qt4/tool/qmake/Makefile b/qt4/tool/qmake/Makefile index c396ad614..bccb9ca34 100644 --- a/qt4/tool/qmake/Makefile +++ b/qt4/tool/qmake/Makefile @@ -7,8 +7,6 @@ # This file is based on the generated Makefile created by qt4's configure. # -QT4 = qt-everywhere-opensource-src-4.7.4 - CC_1 = gcc CC = $(CC_1) CXX_1 = g++ @@ -23,6 +21,8 @@ QMAKE_LFLAGS = $(QMAKE_LFLAGS_1) # Genode repository REP_DIR := ../.. +include $(REP_DIR)/lib/mk/qt_version.inc + # root of Qt4 source tree CONTRIB_DIR := $(REP_DIR)/contrib/$(QT4)