From: daniel wilms Date: Wed, 4 Nov 2009 13:47:05 +0000 (+0200) Subject: changed hardcoded path for testing X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=84165a159c430b85886b0509083b92f988c2f570;hp=548c0a152139533e27756576c81d00cc570ea61e;p=wpcreator changed hardcoded path for testing --- diff --git a/src/.test.desktop b/src/.test.desktop new file mode 100644 index 0000000..53d4c82 --- /dev/null +++ b/src/.test.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Background Image +Name=test +Hidden=true +X-File1=./test-1.png +X-File2=./test-2.png +X-File3=./test-3.png +X-File4=./test-4.png +X-Order=1 diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..5e57480 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,135 @@ +############################################################################# +# Makefile for building: wallpaperCreator +# Generated by qmake (2.01a) (Qt 4.5.0) on: Wed Nov 4 15:41:11 2009 +# Project: WallpaperCreator.pro +# Template: app +# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug_and_release CONFIG+=debug -o Makefile WallpaperCreator.pro +############################################################################# + +first: debug +install: debug-install +uninstall: debug-uninstall +MAKEFILE = Makefile +QMAKE = /usr/bin/qmake-qt4 +DEL_FILE = rm -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p +COPY = cp -f +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +INSTALL_FILE = install -m 644 -p +INSTALL_PROGRAM = install -m 755 -p +INSTALL_DIR = $(COPY_DIR) +DEL_FILE = rm -f +SYMLINK = ln -sf +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p +SUBTARGETS = \ + debug \ + release + +debug: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-make_default: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-make_first: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug first +debug-all: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug all +debug-clean: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug clean +debug-distclean: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug distclean +debug-install: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug install +debug-uninstall: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug uninstall +release: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release +release-make_default: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release +release-make_first: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release first +release-all: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release all +release-clean: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release clean +release-distclean: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release distclean +release-install: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release install +release-uninstall: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release uninstall + +Makefile: WallpaperCreator.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/debug.prf \ + /usr/share/qt4/mkspecs/features/debug_and_release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + /usr/lib/libQtGui.prl \ + /usr/lib/libQtCore.prl + $(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug_and_release CONFIG+=debug -o Makefile WallpaperCreator.pro +/usr/share/qt4/mkspecs/common/g++.conf: +/usr/share/qt4/mkspecs/common/unix.conf: +/usr/share/qt4/mkspecs/common/linux.conf: +/usr/share/qt4/mkspecs/qconfig.pri: +/usr/share/qt4/mkspecs/features/qt_functions.prf: +/usr/share/qt4/mkspecs/features/qt_config.prf: +/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/usr/share/qt4/mkspecs/features/default_pre.prf: +/usr/share/qt4/mkspecs/features/debug.prf: +/usr/share/qt4/mkspecs/features/debug_and_release.prf: +/usr/share/qt4/mkspecs/features/default_post.prf: +/usr/share/qt4/mkspecs/features/warn_on.prf: +/usr/share/qt4/mkspecs/features/qt.prf: +/usr/share/qt4/mkspecs/features/unix/thread.prf: +/usr/share/qt4/mkspecs/features/moc.prf: +/usr/share/qt4/mkspecs/features/resources.prf: +/usr/share/qt4/mkspecs/features/uic.prf: +/usr/share/qt4/mkspecs/features/yacc.prf: +/usr/share/qt4/mkspecs/features/lex.prf: +/usr/lib/libQtGui.prl: +/usr/lib/libQtCore.prl: +qmake: qmake_all FORCE + @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug_and_release CONFIG+=debug -o Makefile WallpaperCreator.pro + +qmake_all: FORCE + +make_default: debug-make_default release-make_default FORCE +make_first: debug-make_first release-make_first FORCE +all: debug-all release-all FORCE +clean: debug-clean release-clean FORCE +distclean: debug-distclean release-distclean FORCE + -$(DEL_FILE) Makefile + +debug-mocclean: $(MAKEFILE).Debug + $(MAKE) -f $(MAKEFILE).Debug mocclean +release-mocclean: $(MAKEFILE).Release + $(MAKE) -f $(MAKEFILE).Release mocclean +mocclean: debug-mocclean release-mocclean + +debug-mocables: $(MAKEFILE).Debug + $(MAKE) -f $(MAKEFILE).Debug mocables +release-mocables: $(MAKEFILE).Release + $(MAKE) -f $(MAKEFILE).Release mocables +mocables: debug-mocables release-mocables +FORCE: + +$(MAKEFILE).Debug: Makefile +$(MAKEFILE).Release: Makefile diff --git a/src/Makefile.Debug b/src/Makefile.Debug new file mode 100644 index 0000000..981cc7e --- /dev/null +++ b/src/Makefile.Debug @@ -0,0 +1,209 @@ +############################################################################# +# Makefile for building: wallpaperCreator +# Generated by qmake (2.01a) (Qt 4.5.0) on: Wed Nov 4 15:41:11 2009 +# Project: WallpaperCreator.pro +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_GUI_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/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -Idebug -I. +LINK = g++ +LFLAGS = +LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/bin/qmake-qt4 +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -sf +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = debug/ + +####### Files + +SOURCES = main.cpp \ + mainwindow.cpp \ + namedialog.cpp \ + progressdialog.cpp debug/moc_mainwindow.cpp \ + debug/moc_namedialog.cpp \ + debug/moc_progressdialog.cpp +OBJECTS = debug/main.o \ + debug/mainwindow.o \ + debug/namedialog.o \ + debug/progressdialog.o \ + debug/moc_mainwindow.o \ + debug/moc_namedialog.o \ + debug/moc_progressdialog.o +DIST = /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/debug.prf \ + /usr/share/qt4/mkspecs/features/debug_and_release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/build_pass.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + WallpaperCreator.pro +QMAKE_TARGET = wallpaperCreator +DESTDIR = +TARGET = wallpaperCreator + +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_mainwindow.h ui_namedialog.h ui_progressdialog.h $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +qmake: FORCE + @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug_and_release CONFIG+=debug -o Makefile.Debug WallpaperCreator.pro + +dist: + @$(CHK_DIR_EXISTS) debug/wallpaperCreator1.0.0 || $(MKDIR) debug/wallpaperCreator1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) debug/wallpaperCreator1.0.0/ && $(COPY_FILE) --parents mainwindow.h namedialog.h progressdialog.h debug/wallpaperCreator1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp namedialog.cpp progressdialog.cpp debug/wallpaperCreator1.0.0/ && $(COPY_FILE) --parents mainwindow.ui namedialog.ui progressdialog.ui debug/wallpaperCreator1.0.0/ && (cd `dirname debug/wallpaperCreator1.0.0` && $(TAR) wallpaperCreator1.0.0.tar wallpaperCreator1.0.0 && $(COMPRESS) wallpaperCreator1.0.0.tar) && $(MOVE) `dirname debug/wallpaperCreator1.0.0`/wallpaperCreator1.0.0.tar.gz . && $(DEL_FILE) -r debug/wallpaperCreator1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile.Debug + + +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_mainwindow.cpp debug/moc_namedialog.cpp debug/moc_progressdialog.cpp +compiler_moc_header_clean: + -$(DEL_FILE) debug/moc_mainwindow.cpp debug/moc_namedialog.cpp debug/moc_progressdialog.cpp +debug/moc_mainwindow.cpp: namedialog.h \ + mainwindow.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) mainwindow.h -o debug/moc_mainwindow.cpp + +debug/moc_namedialog.cpp: namedialog.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) namedialog.h -o debug/moc_namedialog.cpp + +debug/moc_progressdialog.cpp: progressdialog.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) progressdialog.h -o debug/moc_progressdialog.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_mainwindow.h ui_namedialog.h ui_progressdialog.h +compiler_uic_clean: + -$(DEL_FILE) ui_mainwindow.h ui_namedialog.h ui_progressdialog.h +ui_mainwindow.h: mainwindow.ui + /usr/bin/uic-qt4 mainwindow.ui -o ui_mainwindow.h + +ui_namedialog.h: namedialog.ui + /usr/bin/uic-qt4 namedialog.ui -o ui_namedialog.h + +ui_progressdialog.h: progressdialog.ui + /usr/bin/uic-qt4 progressdialog.ui -o ui_progressdialog.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 mainwindow.h \ + namedialog.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/main.o main.cpp + +debug/mainwindow.o: mainwindow.cpp mainwindow.h \ + namedialog.h \ + ui_mainwindow.h \ + progressdialog.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/mainwindow.o mainwindow.cpp + +debug/namedialog.o: namedialog.cpp namedialog.h \ + ui_namedialog.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/namedialog.o namedialog.cpp + +debug/progressdialog.o: progressdialog.cpp progressdialog.h \ + ui_progressdialog.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/progressdialog.o progressdialog.cpp + +debug/moc_mainwindow.o: debug/moc_mainwindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_mainwindow.o debug/moc_mainwindow.cpp + +debug/moc_namedialog.o: debug/moc_namedialog.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_namedialog.o debug/moc_namedialog.cpp + +debug/moc_progressdialog.o: debug/moc_progressdialog.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_progressdialog.o debug/moc_progressdialog.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/src/Makefile.Release b/src/Makefile.Release new file mode 100644 index 0000000..bf8ab08 --- /dev/null +++ b/src/Makefile.Release @@ -0,0 +1,209 @@ +############################################################################# +# Makefile for building: wallpaperCreator +# Generated by qmake (2.01a) (Qt 4.5.0) on: Wed Nov 4 15:41:11 2009 +# Project: WallpaperCreator.pro +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_NO_DEBUG -DQT_GUI_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/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -Irelease -I. +LINK = g++ +LFLAGS = -Wl,-O1 +LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/bin/qmake-qt4 +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -sf +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = release/ + +####### Files + +SOURCES = main.cpp \ + mainwindow.cpp \ + namedialog.cpp \ + progressdialog.cpp release/moc_mainwindow.cpp \ + release/moc_namedialog.cpp \ + release/moc_progressdialog.cpp +OBJECTS = release/main.o \ + release/mainwindow.o \ + release/namedialog.o \ + release/progressdialog.o \ + release/moc_mainwindow.o \ + release/moc_namedialog.o \ + release/moc_progressdialog.o +DIST = /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/release.prf \ + /usr/share/qt4/mkspecs/features/debug_and_release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/build_pass.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + WallpaperCreator.pro +QMAKE_TARGET = wallpaperCreator +DESTDIR = +TARGET = wallpaperCreator + +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_mainwindow.h ui_namedialog.h ui_progressdialog.h $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +qmake: FORCE + @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug_and_release CONFIG+=debug -o Makefile.Release WallpaperCreator.pro + +dist: + @$(CHK_DIR_EXISTS) release/wallpaperCreator1.0.0 || $(MKDIR) release/wallpaperCreator1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) release/wallpaperCreator1.0.0/ && $(COPY_FILE) --parents mainwindow.h namedialog.h progressdialog.h release/wallpaperCreator1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp namedialog.cpp progressdialog.cpp release/wallpaperCreator1.0.0/ && $(COPY_FILE) --parents mainwindow.ui namedialog.ui progressdialog.ui release/wallpaperCreator1.0.0/ && (cd `dirname release/wallpaperCreator1.0.0` && $(TAR) wallpaperCreator1.0.0.tar wallpaperCreator1.0.0 && $(COMPRESS) wallpaperCreator1.0.0.tar) && $(MOVE) `dirname release/wallpaperCreator1.0.0`/wallpaperCreator1.0.0.tar.gz . && $(DEL_FILE) -r release/wallpaperCreator1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile.Release + + +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_mainwindow.cpp release/moc_namedialog.cpp release/moc_progressdialog.cpp +compiler_moc_header_clean: + -$(DEL_FILE) release/moc_mainwindow.cpp release/moc_namedialog.cpp release/moc_progressdialog.cpp +release/moc_mainwindow.cpp: namedialog.h \ + mainwindow.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) mainwindow.h -o release/moc_mainwindow.cpp + +release/moc_namedialog.cpp: namedialog.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) namedialog.h -o release/moc_namedialog.cpp + +release/moc_progressdialog.cpp: progressdialog.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) progressdialog.h -o release/moc_progressdialog.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_mainwindow.h ui_namedialog.h ui_progressdialog.h +compiler_uic_clean: + -$(DEL_FILE) ui_mainwindow.h ui_namedialog.h ui_progressdialog.h +ui_mainwindow.h: mainwindow.ui + /usr/bin/uic-qt4 mainwindow.ui -o ui_mainwindow.h + +ui_namedialog.h: namedialog.ui + /usr/bin/uic-qt4 namedialog.ui -o ui_namedialog.h + +ui_progressdialog.h: progressdialog.ui + /usr/bin/uic-qt4 progressdialog.ui -o ui_progressdialog.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 mainwindow.h \ + namedialog.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/main.o main.cpp + +release/mainwindow.o: mainwindow.cpp mainwindow.h \ + namedialog.h \ + ui_mainwindow.h \ + progressdialog.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/mainwindow.o mainwindow.cpp + +release/namedialog.o: namedialog.cpp namedialog.h \ + ui_namedialog.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/namedialog.o namedialog.cpp + +release/progressdialog.o: progressdialog.cpp progressdialog.h \ + ui_progressdialog.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/progressdialog.o progressdialog.cpp + +release/moc_mainwindow.o: release/moc_mainwindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_mainwindow.o release/moc_mainwindow.cpp + +release/moc_namedialog.o: release/moc_namedialog.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_namedialog.o release/moc_namedialog.cpp + +release/moc_progressdialog.o: release/moc_progressdialog.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/moc_progressdialog.o release/moc_progressdialog.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/src/debug/main.o b/src/debug/main.o new file mode 100644 index 0000000..ec90aea Binary files /dev/null and b/src/debug/main.o differ diff --git a/src/debug/mainwindow.o b/src/debug/mainwindow.o new file mode 100644 index 0000000..270f065 Binary files /dev/null and b/src/debug/mainwindow.o differ diff --git a/src/debug/moc_mainwindow.cpp b/src/debug/moc_mainwindow.cpp new file mode 100644 index 0000000..e0eb536 --- /dev/null +++ b/src/debug/moc_mainwindow.cpp @@ -0,0 +1,103 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'mainwindow.h' +** +** Created: Wed Nov 4 15:41:16 2009 +** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "../mainwindow.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'mainwindow.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 61 +#error "This file was generated using the moc from 4.5.0. 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_MainWindow[] = { + + // content: + 2, // revision + 0, // classname + 0, 0, // classinfo + 7, 12, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + + // signals: signature, parameters, type, tag, flags + 12, 11, 11, 11, 0x05, + 42, 11, 11, 11, 0x05, + + // slots: signature, parameters, type, tag, flags + 65, 11, 11, 11, 0x0a, + 76, 11, 11, 11, 0x0a, + 94, 11, 11, 11, 0x0a, + 106, 11, 11, 11, 0x0a, + 124, 11, 11, 11, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_MainWindow[] = { + "MainWindow\0\0installationStatusUpdate(int)\0" + "installationFinished()\0openFile()\0" + "getImage(QString)\0cropImage()\0" + "installImageSet()\0installImageSetWithName(QString)\0" +}; + +const QMetaObject MainWindow::staticMetaObject = { + { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow, + qt_meta_data_MainWindow, 0 } +}; + +const QMetaObject *MainWindow::metaObject() const +{ + return &staticMetaObject; +} + +void *MainWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MainWindow)) + return static_cast(const_cast< MainWindow*>(this)); + return QMainWindow::qt_metacast(_clname); +} + +int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QMainWindow::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: installationStatusUpdate((*reinterpret_cast< int(*)>(_a[1]))); break; + case 1: installationFinished(); break; + case 2: openFile(); break; + case 3: getImage((*reinterpret_cast< QString(*)>(_a[1]))); break; + case 4: cropImage(); break; + case 5: installImageSet(); break; + case 6: installImageSetWithName((*reinterpret_cast< QString(*)>(_a[1]))); break; + default: ; + } + _id -= 7; + } + return _id; +} + +// SIGNAL 0 +void MainWindow::installationStatusUpdate(int _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} + +// SIGNAL 1 +void MainWindow::installationFinished() +{ + QMetaObject::activate(this, &staticMetaObject, 1, 0); +} +QT_END_MOC_NAMESPACE diff --git a/src/debug/moc_mainwindow.o b/src/debug/moc_mainwindow.o new file mode 100644 index 0000000..59e7b53 Binary files /dev/null and b/src/debug/moc_mainwindow.o differ diff --git a/src/debug/moc_namedialog.cpp b/src/debug/moc_namedialog.cpp new file mode 100644 index 0000000..04bfd51 --- /dev/null +++ b/src/debug/moc_namedialog.cpp @@ -0,0 +1,87 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'namedialog.h' +** +** Created: Wed Nov 4 15:41:17 2009 +** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "../namedialog.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'namedialog.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 61 +#error "This file was generated using the moc from 4.5.0. 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_NameDialog[] = { + + // content: + 2, // revision + 0, // classname + 0, 0, // classinfo + 3, 12, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + + // signals: signature, parameters, type, tag, flags + 12, 11, 11, 11, 0x05, + + // slots: signature, parameters, type, tag, flags + 33, 11, 11, 11, 0x0a, + 46, 11, 11, 11, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_NameDialog[] = { + "NameDialog\0\0nameEntered(QString)\0" + "acceptName()\0activateButton(QString)\0" +}; + +const QMetaObject NameDialog::staticMetaObject = { + { &QDialog::staticMetaObject, qt_meta_stringdata_NameDialog, + qt_meta_data_NameDialog, 0 } +}; + +const QMetaObject *NameDialog::metaObject() const +{ + return &staticMetaObject; +} + +void *NameDialog::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_NameDialog)) + return static_cast(const_cast< NameDialog*>(this)); + return QDialog::qt_metacast(_clname); +} + +int NameDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: nameEntered((*reinterpret_cast< QString(*)>(_a[1]))); break; + case 1: acceptName(); break; + case 2: activateButton((*reinterpret_cast< QString(*)>(_a[1]))); break; + default: ; + } + _id -= 3; + } + return _id; +} + +// SIGNAL 0 +void NameDialog::nameEntered(QString _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} +QT_END_MOC_NAMESPACE diff --git a/src/debug/moc_namedialog.o b/src/debug/moc_namedialog.o new file mode 100644 index 0000000..c2c3ed9 Binary files /dev/null and b/src/debug/moc_namedialog.o differ diff --git a/src/debug/moc_progressdialog.cpp b/src/debug/moc_progressdialog.cpp new file mode 100644 index 0000000..9670bb0 --- /dev/null +++ b/src/debug/moc_progressdialog.cpp @@ -0,0 +1,76 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'progressdialog.h' +** +** Created: Wed Nov 4 15:41:18 2009 +** by: The Qt Meta Object Compiler version 61 (Qt 4.5.0) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "../progressdialog.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'progressdialog.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 61 +#error "This file was generated using the moc from 4.5.0. 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_ProgressDialog[] = { + + // content: + 2, // revision + 0, // classname + 0, 0, // classinfo + 2, 12, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + + // slots: signature, parameters, type, tag, flags + 16, 15, 15, 15, 0x0a, + 46, 15, 15, 15, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_ProgressDialog[] = { + "ProgressDialog\0\0updateInstallationStatus(int)\0" + "installationFinished()\0" +}; + +const QMetaObject ProgressDialog::staticMetaObject = { + { &QDialog::staticMetaObject, qt_meta_stringdata_ProgressDialog, + qt_meta_data_ProgressDialog, 0 } +}; + +const QMetaObject *ProgressDialog::metaObject() const +{ + return &staticMetaObject; +} + +void *ProgressDialog::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_ProgressDialog)) + return static_cast(const_cast< ProgressDialog*>(this)); + return QDialog::qt_metacast(_clname); +} + +int ProgressDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: updateInstallationStatus((*reinterpret_cast< int(*)>(_a[1]))); break; + case 1: installationFinished(); break; + default: ; + } + _id -= 2; + } + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/src/debug/moc_progressdialog.o b/src/debug/moc_progressdialog.o new file mode 100644 index 0000000..565b73e Binary files /dev/null and b/src/debug/moc_progressdialog.o differ diff --git a/src/debug/namedialog.o b/src/debug/namedialog.o new file mode 100644 index 0000000..f813658 Binary files /dev/null and b/src/debug/namedialog.o differ diff --git a/src/debug/progressdialog.o b/src/debug/progressdialog.o new file mode 100644 index 0000000..7bbd107 Binary files /dev/null and b/src/debug/progressdialog.o differ diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 961df17..48dca91 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -91,7 +91,7 @@ void MainWindow::installImageSetWithName(QString name) { #ifdef Q_WS_HILDON QString base = "/home/user/MyDocs/.images/"; #else - QString base = "/home/dwilms/testapp/"; + QString base = "./"; #endif QString filename = base +name; out << filename; diff --git a/src/qtc-gdbmacros/LGPL_EXCEPTION.TXT b/src/qtc-gdbmacros/LGPL_EXCEPTION.TXT new file mode 100644 index 0000000..8d0f85e --- /dev/null +++ b/src/qtc-gdbmacros/LGPL_EXCEPTION.TXT @@ -0,0 +1,3 @@ +Nokia Qt LGPL Exception version 1.0 + +As a special exception to the GNU Lesser General Public License version 2.1, the object code form of a "work that uses the Library" may incorporate material from a header file that is part of the Library. You may distribute such object code under terms of your choice, provided that the incorporated material (i) does not exceed more than 5% of the total size of the Library; and (ii) is limited to numerical parameters, data structure layouts, accessors, macros, inline functions and templates. \ No newline at end of file diff --git a/src/qtc-gdbmacros/LICENSE.LGPL b/src/qtc-gdbmacros/LICENSE.LGPL new file mode 100644 index 0000000..602bfc9 --- /dev/null +++ b/src/qtc-gdbmacros/LICENSE.LGPL @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/src/qtc-gdbmacros/Makefile b/src/qtc-gdbmacros/Makefile new file mode 100644 index 0000000..c2cf05b --- /dev/null +++ b/src/qtc-gdbmacros/Makefile @@ -0,0 +1,139 @@ +############################################################################# +# Makefile for building: libgdbmacros.so.1.0.0 +# Generated by qmake (2.01a) (Qt 4.5.0) on: Wed Nov 4 15:43:09 2009 +# Project: gdbmacros.pro +# Template: lib +# Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug_and_release CONFIG+=debug -o Makefile gdbmacros.pro +############################################################################# + +first: debug +install: debug-install +uninstall: debug-uninstall +MAKEFILE = Makefile +QMAKE = /usr/bin/qmake-qt4 +DEL_FILE = rm -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p +COPY = cp -f +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +INSTALL_FILE = install -m 644 -p +INSTALL_PROGRAM = install -m 755 -p +INSTALL_DIR = $(COPY_DIR) +DEL_FILE = rm -f +SYMLINK = ln -sf +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p +SUBTARGETS = \ + debug \ + release + +debug: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-make_default: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-make_first: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug first +debug-all: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug all +debug-clean: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug clean +debug-distclean: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug distclean +debug-install: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug install +debug-uninstall: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug uninstall +release: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release +release-make_default: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release +release-make_first: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release first +release-all: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release all +release-clean: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release clean +release-distclean: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release distclean +release-install: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release install +release-uninstall: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release uninstall + +Makefile: gdbmacros.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/debug.prf \ + /usr/share/qt4/mkspecs/features/debug_and_release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/shared.prf \ + /usr/share/qt4/mkspecs/features/dll.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + /usr/lib/libQtGui.prl \ + /usr/lib/libQtCore.prl + $(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug_and_release CONFIG+=debug -o Makefile gdbmacros.pro +/usr/share/qt4/mkspecs/common/g++.conf: +/usr/share/qt4/mkspecs/common/unix.conf: +/usr/share/qt4/mkspecs/common/linux.conf: +/usr/share/qt4/mkspecs/qconfig.pri: +/usr/share/qt4/mkspecs/features/qt_functions.prf: +/usr/share/qt4/mkspecs/features/qt_config.prf: +/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/usr/share/qt4/mkspecs/features/default_pre.prf: +/usr/share/qt4/mkspecs/features/debug.prf: +/usr/share/qt4/mkspecs/features/debug_and_release.prf: +/usr/share/qt4/mkspecs/features/default_post.prf: +/usr/share/qt4/mkspecs/features/shared.prf: +/usr/share/qt4/mkspecs/features/dll.prf: +/usr/share/qt4/mkspecs/features/warn_on.prf: +/usr/share/qt4/mkspecs/features/qt.prf: +/usr/share/qt4/mkspecs/features/unix/thread.prf: +/usr/share/qt4/mkspecs/features/moc.prf: +/usr/share/qt4/mkspecs/features/resources.prf: +/usr/share/qt4/mkspecs/features/uic.prf: +/usr/share/qt4/mkspecs/features/yacc.prf: +/usr/share/qt4/mkspecs/features/lex.prf: +/usr/lib/libQtGui.prl: +/usr/lib/libQtCore.prl: +qmake: qmake_all FORCE + @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug_and_release CONFIG+=debug -o Makefile gdbmacros.pro + +qmake_all: FORCE + +make_default: debug-make_default release-make_default FORCE +make_first: debug-make_first release-make_first FORCE +all: debug-all release-all FORCE +clean: debug-clean release-clean FORCE +distclean: debug-distclean release-distclean FORCE + -$(DEL_FILE) Makefile + +debug-mocclean: $(MAKEFILE).Debug + $(MAKE) -f $(MAKEFILE).Debug mocclean +release-mocclean: $(MAKEFILE).Release + $(MAKE) -f $(MAKEFILE).Release mocclean +mocclean: debug-mocclean release-mocclean + +debug-mocables: $(MAKEFILE).Debug + $(MAKE) -f $(MAKEFILE).Debug mocables +release-mocables: $(MAKEFILE).Release + $(MAKE) -f $(MAKEFILE).Release mocables +mocables: debug-mocables release-mocables +FORCE: + +$(MAKEFILE).Debug: Makefile +$(MAKEFILE).Release: Makefile diff --git a/src/qtc-gdbmacros/Makefile.Debug b/src/qtc-gdbmacros/Makefile.Debug new file mode 100644 index 0000000..ad355b1 --- /dev/null +++ b/src/qtc-gdbmacros/Makefile.Debug @@ -0,0 +1,173 @@ +############################################################################# +# Makefile for building: libgdbmacros.so.1.0.0 +# Generated by qmake (2.01a) (Qt 4.5.0) on: Wed Nov 4 15:43:09 2009 +# Project: gdbmacros.pro +# Template: lib +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -g -Wall -W -D_REENTRANT -fPIC $(DEFINES) +CXXFLAGS = -pipe -g -Wall -W -D_REENTRANT -fPIC $(DEFINES) +INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -Idebug -I. +LINK = g++ +LFLAGS = -shared -Wl,-soname,libgdbmacros.so.1 +LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/bin/qmake-qt4 +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -sf +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = debug/ + +####### Files + +SOURCES = gdbmacros.cpp +OBJECTS = debug/gdbmacros.o +DIST = /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/debug.prf \ + /usr/share/qt4/mkspecs/features/debug_and_release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/build_pass.prf \ + /usr/share/qt4/mkspecs/features/shared.prf \ + /usr/share/qt4/mkspecs/features/dll.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + gdbmacros.pro +QMAKE_TARGET = gdbmacros +DESTDIR = +TARGET = libgdbmacros.so.1.0.0 +TARGETA = libgdbmacros.a +TARGETD = libgdbmacros.so.1.0.0 +TARGET0 = libgdbmacros.so +TARGET1 = libgdbmacros.so.1 +TARGET2 = libgdbmacros.so.1.0 + +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): $(OBJECTS) $(SUBLIBS) $(OBJCOMP) + -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP) + -ln -s $(TARGET) $(TARGET0) + -ln -s $(TARGET) $(TARGET1) + -ln -s $(TARGET) $(TARGET2) + + + +staticlib: $(TARGETA) + +$(TARGETA): $(OBJECTS) $(OBJCOMP) + -$(DEL_FILE) $(TARGETA) + $(AR) $(TARGETA) $(OBJECTS) + +qmake: FORCE + @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug_and_release CONFIG+=debug -o Makefile.Debug gdbmacros.pro + +dist: + @$(CHK_DIR_EXISTS) debug/gdbmacros1.0.0 || $(MKDIR) debug/gdbmacros1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) debug/gdbmacros1.0.0/ && $(COPY_FILE) --parents gdbmacros.cpp debug/gdbmacros1.0.0/ && (cd `dirname debug/gdbmacros1.0.0` && $(TAR) gdbmacros1.0.0.tar gdbmacros1.0.0 && $(COMPRESS) gdbmacros1.0.0.tar) && $(MOVE) `dirname debug/gdbmacros1.0.0`/gdbmacros1.0.0.tar.gz . && $(DEL_FILE) -r debug/gdbmacros1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) $(TARGET0) $(TARGET1) $(TARGET2) $(TARGETA) + -$(DEL_FILE) Makefile.Debug + + +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: +compiler_moc_header_clean: +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: +compiler_uic_clean: +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: + +####### Compile + +debug/gdbmacros.o: gdbmacros.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/gdbmacros.o gdbmacros.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/src/qtc-gdbmacros/Makefile.Release b/src/qtc-gdbmacros/Makefile.Release new file mode 100644 index 0000000..ee5d671 --- /dev/null +++ b/src/qtc-gdbmacros/Makefile.Release @@ -0,0 +1,173 @@ +############################################################################# +# Makefile for building: libgdbmacros.so.1.0.0 +# Generated by qmake (2.01a) (Qt 4.5.0) on: Wed Nov 4 15:43:09 2009 +# Project: gdbmacros.pro +# Template: lib +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES) +CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES) +INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -Irelease -I. +LINK = g++ +LFLAGS = -Wl,-O1 -shared -Wl,-soname,libgdbmacros.so.1 +LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/bin/qmake-qt4 +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -sf +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = release/ + +####### Files + +SOURCES = gdbmacros.cpp +OBJECTS = release/gdbmacros.o +DIST = /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/release.prf \ + /usr/share/qt4/mkspecs/features/debug_and_release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/build_pass.prf \ + /usr/share/qt4/mkspecs/features/shared.prf \ + /usr/share/qt4/mkspecs/features/dll.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + gdbmacros.pro +QMAKE_TARGET = gdbmacros +DESTDIR = +TARGET = libgdbmacros.so.1.0.0 +TARGETA = libgdbmacros.a +TARGETD = libgdbmacros.so.1.0.0 +TARGET0 = libgdbmacros.so +TARGET1 = libgdbmacros.so.1 +TARGET2 = libgdbmacros.so.1.0 + +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): $(OBJECTS) $(SUBLIBS) $(OBJCOMP) + -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP) + -ln -s $(TARGET) $(TARGET0) + -ln -s $(TARGET) $(TARGET1) + -ln -s $(TARGET) $(TARGET2) + + + +staticlib: $(TARGETA) + +$(TARGETA): $(OBJECTS) $(OBJCOMP) + -$(DEL_FILE) $(TARGETA) + $(AR) $(TARGETA) $(OBJECTS) + +qmake: FORCE + @$(QMAKE) -spec /usr/share/qt4/mkspecs/linux-g++ -unix CONFIG+=debug_and_release CONFIG+=debug -o Makefile.Release gdbmacros.pro + +dist: + @$(CHK_DIR_EXISTS) release/gdbmacros1.0.0 || $(MKDIR) release/gdbmacros1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) release/gdbmacros1.0.0/ && $(COPY_FILE) --parents gdbmacros.cpp release/gdbmacros1.0.0/ && (cd `dirname release/gdbmacros1.0.0` && $(TAR) gdbmacros1.0.0.tar gdbmacros1.0.0 && $(COMPRESS) gdbmacros1.0.0.tar) && $(MOVE) `dirname release/gdbmacros1.0.0`/gdbmacros1.0.0.tar.gz . && $(DEL_FILE) -r release/gdbmacros1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) $(TARGET0) $(TARGET1) $(TARGET2) $(TARGETA) + -$(DEL_FILE) Makefile.Release + + +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: +compiler_moc_header_clean: +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: +compiler_uic_clean: +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: + +####### Compile + +release/gdbmacros.o: gdbmacros.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o release/gdbmacros.o gdbmacros.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/src/qtc-gdbmacros/debug/gdbmacros.o b/src/qtc-gdbmacros/debug/gdbmacros.o new file mode 100644 index 0000000..7d61c58 Binary files /dev/null and b/src/qtc-gdbmacros/debug/gdbmacros.o differ diff --git a/src/qtc-gdbmacros/gdbmacros.cpp b/src/qtc-gdbmacros/gdbmacros.cpp new file mode 100644 index 0000000..9b3d9bd --- /dev/null +++ b/src/qtc-gdbmacros/gdbmacros.cpp @@ -0,0 +1,2567 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Qt Software Information (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** +**************************************************************************/ + +#include + +// this relies on contents copied from qobject_p.h +#define PRIVATE_OBJECT_ALLOWED 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int qtGhVersion = QT_VERSION; + +#ifdef QT_GUI_LIB +# include +# include +#endif + +#include +#include +#include +#include + +#include +#include +#include + +/*! + \class QDumper + \brief Helper class for producing "nice" output in Qt Creator's debugger. + + \internal + + The whole "custom dumper" implementation is currently far less modular + than it could be. But as the code is still in a flux, making it nicer + from a pure archtectural point of view seems still be a waste of resources. + + Some hints: + + New dumpers for non-templated classes should be mentioned in + \c{qDumpObjectData440()} in the \c{protocolVersion == 1} branch. + + Templated classes need extra support on the IDE level + (see plugins/debugger/gdbengine.cpp) and should not be mentiond in + \c{qDumpObjectData440()}. + + In any case, dumper processesing should end up in + \c{handleProtocolVersion2and3()} and needs an entry in the bis switch there. + + Next step is to create a suitable \c{static void qDumpFoo(QDumper &d)} + function. At the bare minimum it should contain something like: + + + \c{ + const Foo &foo = *reinterpret_cast(d.data); + + P(d, "value", ...); + P(d, "type", "Foo"); + P(d, "numchild", "0"); + } + + + 'P(d, name, value)' roughly expands to: + d << (name) << "=\"" << value << "\""; + + Useful (i.e. understood by the IDE) names include: + + \list + \o "name" shows up in the first column in the Locals&Watchers view. + \o "value" shows up in the second column. + \o "valueencoded" should be set to "1" if the value is base64 encoded. + Always base64-encode values that might use unprintable or otherwise + "confuse" the protocol (like spaces and quotes). [A-Za-z0-9] is "safe". + A value of "3" is used for base64-encoded UCS4, "2" denotes + base64-encoded UTF16. + \o "numchild" return the number of children in the view. Effectively, only + 0 and != 0 will be used, so don't try too hard to get the number right. + \endlist + + If the current item has children, it might be queried to produce information + about thes children. In this case the dumper should use something like + + \c{ + if (d.dumpChildren) { + d << ",children=["; + } + + */ + +#undef NS +#ifdef QT_NAMESPACE +# define STRINGIFY0(s) #s +# define STRINGIFY1(s) STRINGIFY0(s) +# define NS STRINGIFY1(QT_NAMESPACE) "::" +# define NSX "'" STRINGIFY1(QT_NAMESPACE) "::" +# define NSY "'" +#else +# define NS "" +# define NSX "" +# define NSY "" +#endif + + +#if PRIVATE_OBJECT_ALLOWED + +#if defined(QT_BEGIN_NAMESPACE) +QT_BEGIN_NAMESPACE +#endif + +class QVariant; +class QThreadData; +class QObjectConnectionListVector; + +class QObjectPrivate : public QObjectData +{ + Q_DECLARE_PUBLIC(QObject) + +public: + QObjectPrivate() {} + virtual ~QObjectPrivate() {} + + // preserve binary compatibility with code compiled without Qt 3 support + QList pendingChildInsertedEvents; // unused + + // id of the thread that owns the object + QThreadData *threadData; + + struct Sender + { + QObject *sender; + int signal; + int ref; + }; + + Sender *currentSender; // object currently activating the object + QObject *currentChildBeingDeleted; + + QList > eventFilters; + + struct ExtraData; + ExtraData *extraData; + mutable quint32 connectedSignals; + + QString objectName; + + struct Connection + { + QObject *receiver; + int method; + uint connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking + QBasicAtomicPointer argumentTypes; + }; + typedef QList ConnectionList; + + QObjectConnectionListVector *connectionLists; + QList senders; + int *deleteWatch; +}; + +#if defined(QT_BEGIN_NAMESPACE) +QT_END_NAMESPACE +#endif + +#endif // PRIVATE_OBJECT_ALLOWED + + +// this can be mangled typenames of nested templates, each char-by-char +// comma-separated integer list +static char qDumpInBuffer[10000]; +static char qDumpOutBuffer[100000]; +//static char qDumpSize[20]; + +namespace { + +static bool isPointerType(const QByteArray &type) +{ + return type.endsWith("*") || type.endsWith("* const"); +} + +static QByteArray stripPointerType(QByteArray type) +{ + if (type.endsWith("*")) + type.chop(1); + if (type.endsWith("* const")) + type.chop(7); + if (type.endsWith(' ')) + type.chop(1); + return type; +} + +// This is used to abort evaluation of custom data dumpers in a "coordinated" +// way. Abortion will happen anyway when we try to access a non-initialized +// non-trivial object, so there is no way to prevent this from occuring at all +// conceptionally. Gdb will catch SIGSEGV and return to the calling frame. +// This is just fine provided we only _read_ memory in the custom handlers +// below. + +volatile int qProvokeSegFaultHelper; + +static const void *addOffset(const void *p, int offset) +{ + return offset + reinterpret_cast(p); +} + +static const void *skipvtable(const void *p) +{ + return sizeof(void*) + reinterpret_cast(p); +} + +static const void *deref(const void *p) +{ + return *reinterpret_cast(p); +} + +static const void *dfunc(const void *p) +{ + return deref(skipvtable(p)); +} + +static bool isEqual(const char *s, const char *t) +{ + return qstrcmp(s, t) == 0; +} + +static bool startsWith(const char *s, const char *t) +{ + return qstrncmp(s, t, strlen(t)) == 0; +} + +// provoke segfault when address is not readable +#define qCheckAccess(d) do { qProvokeSegFaultHelper = *(char*)d; } while (0) +#define qCheckPointer(d) do { if (d) qProvokeSegFaultHelper = *(char*)d; } while (0) +// provoke segfault unconditionally +#define qCheck(b) do { if (!(b)) qProvokeSegFaultHelper = *(char*)0; } while (0) + +const char *stripNamespace(const char *type) +{ + static const size_t nslen = strlen(NS); + return startsWith(type, NS) ? type + nslen : type; +} + +static bool isSimpleType(const char *type) +{ + switch (type[0]) { + case 'c': + return isEqual(type, "char"); + case 'd': + return isEqual(type, "double"); + case 'f': + return isEqual(type, "float"); + case 'i': + return isEqual(type, "int"); + case 'l': + return isEqual(type, "long") || startsWith(type, "long "); + case 's': + return isEqual(type, "short") || isEqual(type, "signed") + || startsWith(type, "signed "); + case 'u': + return isEqual(type, "unsigned") || startsWith(type, "unsigned "); + } + return false; +} + +#if 0 +static bool isStringType(const char *type) +{ + return isEqual(type, NS"QString") + || isEqual(type, NS"QByteArray") + || isEqual(type, "std::string") + || isEqual(type, "std::wstring") + || isEqual(type, "wstring"); +} +#endif + +static bool isMovableType(const char *type) +{ + if (isPointerType(type)) + return true; + + if (isSimpleType(type)) + return true; + + type = stripNamespace(type); + + switch (type[1]) { + case 'B': + return isEqual(type, "QBrush") + || isEqual(type, "QBitArray") + || isEqual(type, "QByteArray") ; + case 'C': + return isEqual(type, "QCustomTypeInfo"); + case 'D': + return isEqual(type, "QDate") + || isEqual(type, "QDateTime"); + case 'F': + return isEqual(type, "QFileInfo") + || isEqual(type, "QFixed") + || isEqual(type, "QFixedPoint") + || isEqual(type, "QFixedSize"); + case 'H': + return isEqual(type, "QHashDummyValue"); + case 'I': + return isEqual(type, "QIcon") + || isEqual(type, "QImage"); + case 'L': + return isEqual(type, "QLine") + || isEqual(type, "QLineF") + || isEqual(type, "QLocal"); + case 'M': + return isEqual(type, "QMatrix") + || isEqual(type, "QModelIndex"); + case 'P': + return isEqual(type, "QPoint") + || isEqual(type, "QPointF") + || isEqual(type, "QPen") + || isEqual(type, "QPersistentModelIndex"); + case 'R': + return isEqual(type, "QResourceRoot") + || isEqual(type, "QRect") + || isEqual(type, "QRectF") + || isEqual(type, "QRegExp"); + case 'S': + return isEqual(type, "QSize") + || isEqual(type, "QSizeF") + || isEqual(type, "QString"); + case 'T': + return isEqual(type, "QTime") + || isEqual(type, "QTextBlock"); + case 'U': + return isEqual(type, "QUrl"); + case 'V': + return isEqual(type, "QVariant"); + case 'X': + return isEqual(type, "QXmlStreamAttribute") + || isEqual(type, "QXmlStreamNamespaceDeclaration") + || isEqual(type, "QXmlStreamNotationDeclaration") + || isEqual(type, "QXmlStreamEntityDeclaration"); + } + return false; +} + +struct QDumper +{ + explicit QDumper(); + ~QDumper(); + void checkFill(); + QDumper &operator<<(long c); + QDumper &operator<<(int i); + QDumper &operator<<(double d); + QDumper &operator<<(float d); + QDumper &operator<<(unsigned long c); + QDumper &operator<<(unsigned int i); + QDumper &operator<<(const void *p); + QDumper &operator<<(qulonglong c); + QDumper &operator<<(const char *str); + QDumper &operator<<(const QByteArray &ba); + QDumper &operator<<(const QString &str); + void put(char c); + void addCommaIfNeeded(); + void putBase64Encoded(const char *buf, int n); + void putEllipsis(); + void disarm(); + + void beginHash(); // start of data hash output + void endHash(); // start of data hash output + + // the dumper arguments + int protocolVersion; // dumper protocol version + int token; // some token to show on success + const char *outertype; // object type + const char *iname; // object name used for display + const char *exp; // object expression + const char *innertype; // 'inner type' for class templates + const void *data; // pointer to raw data + bool dumpChildren; // do we want to see children? + + // handling of nested templates + void setupTemplateParameters(); + enum { maxTemplateParameters = 10 }; + const char *templateParameters[maxTemplateParameters + 1]; + int templateParametersCount; + + // internal state + bool success; // are we finished? + bool full; + int pos; + + int extraInt[4]; +}; + + +QDumper::QDumper() +{ + success = false; + full = false; + qDumpOutBuffer[0] = 'f'; // marks output as 'wrong' + pos = 1; +} + +QDumper::~QDumper() +{ + qDumpOutBuffer[pos++] = '\0'; + if (success) + qDumpOutBuffer[0] = (full ? '+' : 't'); +} + +void QDumper::setupTemplateParameters() +{ + char *s = const_cast(innertype); + + templateParametersCount = 1; + templateParameters[0] = s; + for (int i = 1; i != maxTemplateParameters + 1; ++i) + templateParameters[i] = 0; + + while (*s) { + while (*s && *s != '@') + ++s; + if (*s) { + *s = '\0'; + ++s; + templateParameters[templateParametersCount++] = s; + } + } +} + +QDumper &QDumper::operator<<(unsigned long long c) +{ + checkFill(); + pos += sprintf(qDumpOutBuffer + pos, "%llu", c); + return *this; +} + +QDumper &QDumper::operator<<(unsigned long c) +{ + checkFill(); + pos += sprintf(qDumpOutBuffer + pos, "%lu", c); + return *this; +} + +QDumper &QDumper::operator<<(float d) +{ + checkFill(); + pos += sprintf(qDumpOutBuffer + pos, "%f", d); + return *this; +} + +QDumper &QDumper::operator<<(double d) +{ + checkFill(); + pos += sprintf(qDumpOutBuffer + pos, "%f", d); + return *this; +} + +QDumper &QDumper::operator<<(unsigned int i) +{ + checkFill(); + pos += sprintf(qDumpOutBuffer + pos, "%u", i); + return *this; +} + +QDumper &QDumper::operator<<(long c) +{ + checkFill(); + pos += sprintf(qDumpOutBuffer + pos, "%ld", c); + return *this; +} + +QDumper &QDumper::operator<<(int i) +{ + checkFill(); + pos += sprintf(qDumpOutBuffer + pos, "%d", i); + return *this; +} + +QDumper &QDumper::operator<<(const void *p) +{ + static char buf[100]; + if (p) { + sprintf(buf, "%p", p); + // we get a '0x' prefix only on some implementations. + // if it isn't there, write it out manually. + if (buf[1] != 'x') { + put('0'); + put('x'); + } + *this << buf; + } else { + *this << ""; + } + return *this; +} + +void QDumper::checkFill() +{ + if (pos >= int(sizeof(qDumpOutBuffer)) - 100) + full = true; +} + +void QDumper::put(char c) +{ + checkFill(); + if (!full) + qDumpOutBuffer[pos++] = c; +} + +void QDumper::addCommaIfNeeded() +{ + if (pos == 0) + return; + char c = qDumpOutBuffer[pos - 1]; + if (c == '}' || c == '"' || c == ']') + put(','); +} + +void QDumper::putBase64Encoded(const char *buf, int n) +{ + const char alphabet[] = "ABCDEFGH" "IJKLMNOP" "QRSTUVWX" "YZabcdef" + "ghijklmn" "opqrstuv" "wxyz0123" "456789+/"; + const char padchar = '='; + int padlen = 0; + + //int tmpsize = ((n * 4) / 3) + 3; + + int i = 0; + while (i < n) { + int chunk = 0; + chunk |= int(uchar(buf[i++])) << 16; + if (i == n) { + padlen = 2; + } else { + chunk |= int(uchar(buf[i++])) << 8; + if (i == n) + padlen = 1; + else + chunk |= int(uchar(buf[i++])); + } + + int j = (chunk & 0x00fc0000) >> 18; + int k = (chunk & 0x0003f000) >> 12; + int l = (chunk & 0x00000fc0) >> 6; + int m = (chunk & 0x0000003f); + put(alphabet[j]); + put(alphabet[k]); + put(padlen > 1 ? padchar : alphabet[l]); + put(padlen > 0 ? padchar : alphabet[m]); + } +} + +QDumper &QDumper::operator<<(const char *str) +{ + if (!str) + return *this << ""; + while (*str) + put(*(str++)); + return *this; +} + +QDumper &QDumper::operator<<(const QByteArray &ba) +{ + putBase64Encoded(ba.constData(), ba.size()); + return *this; +} + +QDumper &QDumper::operator<<(const QString &str) +{ + QByteArray ba = str.toUtf8(); + putBase64Encoded(ba.constData(), ba.size()); + return *this; +} + +void QDumper::disarm() +{ + success = true; +} + +void QDumper::beginHash() +{ + addCommaIfNeeded(); + put('{'); +} + +void QDumper::endHash() +{ + put('}'); +} + +void QDumper::putEllipsis() +{ + addCommaIfNeeded(); + *this << "{name=\"\",value=\"\",type=\"" << innertype << "\"}"; +} + +// +// Some helpers to keep the dumper code short +// + +// dump property=value pair +#undef P +#define P(dumper,name,value) \ + do { \ + dumper.addCommaIfNeeded(); \ + dumper << (name) << "=\"" << value << "\""; \ + } while (0) + +// simple string property +#undef S +#define S(dumper, name, value) \ + dumper.beginHash(); \ + P(dumper, "name", name); \ + P(dumper, "value", value); \ + P(dumper, "type", NS"QString"); \ + P(dumper, "numchild", "0"); \ + P(dumper, "valueencoded", "1"); \ + dumper.endHash(); + +// simple integer property +#undef I +#define I(dumper, name, value) \ + dumper.beginHash(); \ + P(dumper, "name", name); \ + P(dumper, "value", value); \ + P(dumper, "type", "int"); \ + P(dumper, "numchild", "0"); \ + dumper.endHash(); + +// simple boolean property +#undef BL +#define BL(dumper, name, value) \ + dumper.beginHash(); \ + P(dumper, "name", name); \ + P(dumper, "value", (value ? "true" : "false")); \ + P(dumper, "type", "bool"); \ + P(dumper, "numchild", "0"); \ + dumper.endHash(); + + +// a single QChar +#undef QC +#define QC(dumper, name, value) \ + dumper.beginHash(); \ + P(dumper, "name", name); \ + P(dumper, "value", QString(QLatin1String("'%1' (%2, 0x%3)")) \ + .arg(value).arg(value.unicode()).arg(value.unicode(), 0, 16)); \ + P(dumper, "valueencoded", "1"); \ + P(dumper, "type", NS"QChar"); \ + P(dumper, "numchild", "0"); \ + dumper.endHash(); + +#undef TT +#define TT(type, value) \ + "" << type << " : " << value << "" + +static void qDumpUnknown(QDumper &d) +{ + P(d, "iname", d.iname); + P(d, "addr", d.data); + P(d, "value", ""); + P(d, "type", d.outertype); + P(d, "numchild", "0"); + d.disarm(); +} + +static void qDumpInnerValueHelper(QDumper &d, const char *type, const void *addr, + const char *field = "value") +{ + type = stripNamespace(type); + switch (type[1]) { + case 'l': + if (isEqual(type, "float")) + P(d, field, *(float*)addr); + return; + case 'n': + if (isEqual(type, "int")) + P(d, field, *(int*)addr); + else if (isEqual(type, "unsigned")) + P(d, field, *(unsigned int*)addr); + else if (isEqual(type, "unsigned int")) + P(d, field, *(unsigned int*)addr); + else if (isEqual(type, "unsigned long")) + P(d, field, *(unsigned long*)addr); + else if (isEqual(type, "unsigned long long")) + P(d, field, *(qulonglong*)addr); + return; + case 'o': + if (isEqual(type, "bool")) + switch (*(bool*)addr) { + case 0: P(d, field, "false"); break; + case 1: P(d, field, "true"); break; + default: P(d, field, *(bool*)addr); break; + } + else if (isEqual(type, "double")) + P(d, field, *(double*)addr); + else if (isEqual(type, "long")) + P(d, field, *(long*)addr); + else if (isEqual(type, "long long")) + P(d, field, *(qulonglong*)addr); + return; + case 'B': + if (isEqual(type, "QByteArray")) { + d.addCommaIfNeeded(); + d << field << "encoded=\"1\","; + P(d, field, *(QByteArray*)addr); + } + return; + case 'L': + if (startsWith(type, "QList<")) { + const QListData *ldata = reinterpret_cast(addr); + P(d, "value", "<" << ldata->size() << " items>"); + P(d, "valuedisabled", "true"); + P(d, "numchild", ldata->size()); + } + return; + case 'O': + if (isEqual(type, "QObject *")) { + if (addr) { + const QObject *ob = reinterpret_cast(addr); + P(d, "addr", ob); + P(d, "value", ob->objectName()); + P(d, "valueencoded", "1"); + P(d, "type", NS"QObject"); + P(d, "displayedtype", ob->metaObject()->className()); + } else { + P(d, "value", "0x0"); + P(d, "type", NS"QObject *"); + } + } + return; + case 'S': + if (isEqual(type, "QString")) { + d.addCommaIfNeeded(); + d << field << "encoded=\"1\","; + P(d, field, *(QString*)addr); + } + return; + default: + return; + } +} + +static void qDumpInnerValue(QDumper &d, const char *type, const void *addr) +{ + P(d, "addr", addr); + P(d, "type", type); + + if (!type[0]) + return; + + qDumpInnerValueHelper(d, type, addr); +} + + +static void qDumpInnerValueOrPointer(QDumper &d, + const char *type, const char *strippedtype, const void *addr) +{ + if (strippedtype) { + if (deref(addr)) { + P(d, "addr", deref(addr)); + P(d, "type", strippedtype); + qDumpInnerValueHelper(d, strippedtype, deref(addr)); + } else { + P(d, "addr", addr); + P(d, "type", strippedtype); + P(d, "value", ""); + P(d, "numchild", "0"); + } + } else { + P(d, "addr", addr); + P(d, "type", type); + qDumpInnerValueHelper(d, type, addr); + } +} + +////////////////////////////////////////////////////////////////////////////// + +static void qDumpQByteArray(QDumper &d) +{ + const QByteArray &ba = *reinterpret_cast(d.data); + + if (!ba.isEmpty()) { + qCheckAccess(ba.constData()); + qCheckAccess(ba.constData() + ba.size()); + } + + if (ba.size() <= 100) + P(d, "value", ba); + else + P(d, "value", ba.left(100) << " "); + P(d, "valueencoded", "1"); + P(d, "type", NS"QByteArray"); + P(d, "numchild", ba.size()); + P(d, "childtype", "char"); + P(d, "childnumchild", "0"); + if (d.dumpChildren) { + d << ",children=["; + char buf[20]; + for (int i = 0; i != ba.size(); ++i) { + unsigned char c = ba.at(i); + unsigned char u = (isprint(c) && c != '\'' && c != '"') ? c : '?'; + sprintf(buf, "%02x (%u '%c')", c, c, u); + d.beginHash(); + P(d, "name", i); + P(d, "value", buf); + d.endHash(); + } + d << "]"; + } + d.disarm(); +} + +static void qDumpQDateTime(QDumper &d) +{ +#ifdef QT_NO_DATESTRING + qDumpUnknown(d); +#else + const QDateTime &date = *reinterpret_cast(d.data); + if (date.isNull()) { + P(d, "value", "(null)"); + } else { + P(d, "value", date.toString()); + P(d, "valueencoded", "1"); + } + P(d, "type", NS"QDateTime"); + P(d, "numchild", "3"); + if (d.dumpChildren) { + d << ",children=["; + BL(d, "isNull", date.isNull()); + I(d, "toTime_t", (long)date.toTime_t()); + S(d, "toString", date.toString()); + S(d, "toString_(ISO)", date.toString(Qt::ISODate)); + S(d, "toString_(SystemLocale)", date.toString(Qt::SystemLocaleDate)); + S(d, "toString_(Locale)", date.toString(Qt::LocaleDate)); + S(d, "toString", date.toString()); + + #if 0 + d.beginHash(); + P(d, "name", "toUTC"); + P(d, "exp", "(("NSX"QDateTime"NSY"*)" << d.data << ")" + "->toTimeSpec('"NS"Qt::UTC')"); + P(d, "type", NS"QDateTime"); + P(d, "numchild", "1"); + d.endHash(); + #endif + + #if 0 + d.beginHash(); + P(d, "name", "toLocalTime"); + P(d, "exp", "(("NSX"QDateTime"NSY"*)" << d.data << ")" + "->toTimeSpec('"NS"Qt::LocalTime')"); + P(d, "type", NS"QDateTime"); + P(d, "numchild", "1"); + d.endHash(); + #endif + + d << "]"; + } + d.disarm(); +#endif // ifdef QT_NO_DATESTRING +} + +static void qDumpQDir(QDumper &d) +{ + const QDir &dir = *reinterpret_cast(d.data); + P(d, "value", dir.path()); + P(d, "valueencoded", "1"); + P(d, "type", NS"QDir"); + P(d, "numchild", "3"); + if (d.dumpChildren) { + d << ",children=["; + S(d, "absolutePath", dir.absolutePath()); + S(d, "canonicalPath", dir.canonicalPath()); + d << "]"; + } + d.disarm(); +} + +static void qDumpQFile(QDumper &d) +{ + const QFile &file = *reinterpret_cast(d.data); + P(d, "value", file.fileName()); + P(d, "valueencoded", "1"); + P(d, "type", NS"QFile"); + P(d, "numchild", "2"); + if (d.dumpChildren) { + d << ",children=["; + S(d, "fileName", file.fileName()); + BL(d, "exists", file.exists()); + d << "]"; + } + d.disarm(); +} + +static void qDumpQFileInfo(QDumper &d) +{ + const QFileInfo &info = *reinterpret_cast(d.data); + P(d, "value", info.filePath()); + P(d, "valueencoded", "1"); + P(d, "type", NS"QFileInfo"); + P(d, "numchild", "3"); + if (d.dumpChildren) { + d << ",children=["; + S(d, "absolutePath", info.absolutePath()); + S(d, "absoluteFilePath", info.absoluteFilePath()); + S(d, "canonicalPath", info.canonicalPath()); + S(d, "canonicalFilePath", info.canonicalFilePath()); + S(d, "completeBaseName", info.completeBaseName()); + S(d, "completeSuffix", info.completeSuffix()); + S(d, "baseName", info.baseName()); +#ifdef Q_OS_MACX + BL(d, "isBundle", info.isBundle()); + S(d, "bundleName", info.bundleName()); +#endif + S(d, "completeSuffix", info.completeSuffix()); + S(d, "fileName", info.fileName()); + S(d, "filePath", info.filePath()); + S(d, "group", info.group()); + S(d, "owner", info.owner()); + S(d, "path", info.path()); + + I(d, "groupid", (long)info.groupId()); + I(d, "ownerid", (long)info.ownerId()); + //QFile::Permissions permissions () const + I(d, "permissions", info.permissions()); + + //QDir absoluteDir () const + //QDir dir () const + + BL(d, "caching", info.caching()); + BL(d, "exists", info.exists()); + BL(d, "isAbsolute", info.isAbsolute()); + BL(d, "isDir", info.isDir()); + BL(d, "isExecutable", info.isExecutable()); + BL(d, "isFile", info.isFile()); + BL(d, "isHidden", info.isHidden()); + BL(d, "isReadable", info.isReadable()); + BL(d, "isRelative", info.isRelative()); + BL(d, "isRoot", info.isRoot()); + BL(d, "isSymLink", info.isSymLink()); + BL(d, "isWritable", info.isWritable()); + + d.beginHash(); + P(d, "name", "created"); + P(d, "value", info.created().toString()); + P(d, "valueencoded", "1"); + P(d, "exp", "(("NSX"QFileInfo"NSY"*)" << d.data << ")->created()"); + P(d, "type", NS"QDateTime"); + P(d, "numchild", "1"); + d.endHash(); + + d.beginHash(); + P(d, "name", "lastModified"); + P(d, "value", info.lastModified().toString()); + P(d, "valueencoded", "1"); + P(d, "exp", "(("NSX"QFileInfo"NSY"*)" << d.data << ")->lastModified()"); + P(d, "type", NS"QDateTime"); + P(d, "numchild", "1"); + d.endHash(); + + d.beginHash(); + P(d, "name", "lastRead"); + P(d, "value", info.lastRead().toString()); + P(d, "valueencoded", "1"); + P(d, "exp", "(("NSX"QFileInfo"NSY"*)" << d.data << ")->lastRead()"); + P(d, "type", NS"QDateTime"); + P(d, "numchild", "1"); + d.endHash(); + + d << "]"; + } + d.disarm(); +} + +bool isOptimizedIntKey(const char *keyType) +{ + return isEqual(keyType, "int") +#if defined(Q_BYTE_ORDER) && Q_BYTE_ORDER == Q_LITTLE_ENDIAN + || isEqual(keyType, "short") + || isEqual(keyType, "ushort") +#endif + || isEqual(keyType, "uint"); +} + +int hashOffset(bool optimizedIntKey, bool forKey, unsigned keySize, unsigned valueSize) +{ + // int-key optimization, small value + struct NodeOS { void *next; uint k; uint v; } nodeOS; + // int-key optimiatzion, large value + struct NodeOL { void *next; uint k; void *v; } nodeOL; + // no optimization, small value + struct NodeNS { void *next; uint h; uint k; uint v; } nodeNS; + // no optimization, large value + struct NodeNL { void *next; uint h; uint k; void *v; } nodeNL; + // complex key + struct NodeL { void *next; uint h; void *k; void *v; } nodeL; + + if (forKey) { + // offsetof(...,...) not yet in Standard C++ + const ulong nodeOSk ( (char *)&nodeOS.k - (char *)&nodeOS ); + const ulong nodeOLk ( (char *)&nodeOL.k - (char *)&nodeOL ); + const ulong nodeNSk ( (char *)&nodeNS.k - (char *)&nodeNS ); + const ulong nodeNLk ( (char *)&nodeNL.k - (char *)&nodeNL ); + const ulong nodeLk ( (char *)&nodeL.k - (char *)&nodeL ); + if (optimizedIntKey) + return valueSize > sizeof(int) ? nodeOLk : nodeOSk; + if (keySize > sizeof(int)) + return nodeLk; + return valueSize > sizeof(int) ? nodeNLk : nodeNSk; + } else { + const ulong nodeOSv ( (char *)&nodeOS.v - (char *)&nodeOS ); + const ulong nodeOLv ( (char *)&nodeOL.v - (char *)&nodeOL ); + const ulong nodeNSv ( (char *)&nodeNS.v - (char *)&nodeNS ); + const ulong nodeNLv ( (char *)&nodeNL.v - (char *)&nodeNL ); + const ulong nodeLv ( (char *)&nodeL.v - (char *)&nodeL ); + if (optimizedIntKey) + return valueSize > sizeof(int) ? nodeOLv : nodeOSv; + if (keySize > sizeof(int)) + return nodeLv; + return valueSize > sizeof(int) ? nodeNLv : nodeNSv; + } +} + + +static void qDumpQHash(QDumper &d) +{ + QHashData *h = *reinterpret_cast(d.data); + const char *keyType = d.templateParameters[0]; + const char *valueType = d.templateParameters[1]; + + qCheckPointer(h->fakeNext); + qCheckPointer(h->buckets); + + unsigned keySize = d.extraInt[0]; + unsigned valueSize = d.extraInt[1]; + + int n = h->size; + + if (n < 0) + qCheck(false); + if (n > 0) { + qCheckPointer(h->fakeNext); + qCheckPointer(*h->buckets); + } + + P(d, "value", "<" << n << " items>"); + P(d, "numchild", n); + if (d.dumpChildren) { + if (n > 1000) + n = 1000; + bool isSimpleKey = isSimpleType(keyType); + bool isSimpleValue = isSimpleType(valueType); + bool opt = isOptimizedIntKey(keyType); + int keyOffset = hashOffset(opt, true, keySize, valueSize); + int valueOffset = hashOffset(opt, false, keySize, valueSize); + + P(d, "extra", "isSimpleKey: " << isSimpleKey + << " isSimpleValue: " << isSimpleValue + << " valueType: '" << isSimpleValue + << " keySize: " << keyOffset << " valueOffset: " << valueOffset + << " opt: " << opt); + + QHashData::Node *node = h->firstNode(); + QHashData::Node *end = reinterpret_cast(h); + int i = 0; + + d << ",children=["; + while (node != end) { + d.beginHash(); + P(d, "name", i); + qDumpInnerValueHelper(d, keyType, addOffset(node, keyOffset), "key"); + qDumpInnerValueHelper(d, valueType, addOffset(node, valueOffset)); + if (isSimpleKey && isSimpleValue) { + P(d, "type", valueType); + P(d, "addr", addOffset(node, valueOffset)); + } else { + P(d, "exp", "*('"NS"QHashNode<" << keyType << "," + << valueType << " >'*)" << node); + P(d, "type", "'"NS"QHashNode<" << keyType << "," + << valueType << " >'"); + } + d.endHash(); + ++i; + node = QHashData::nextNode(node); + } + d << "]"; + } + d.disarm(); +} + +static void qDumpQHashNode(QDumper &d) +{ + const QHashData *h = reinterpret_cast(d.data); + const char *keyType = d.templateParameters[0]; + const char *valueType = d.templateParameters[1]; + + unsigned keySize = d.extraInt[0]; + unsigned valueSize = d.extraInt[1]; + bool opt = isOptimizedIntKey(keyType); + int keyOffset = hashOffset(opt, true, keySize, valueSize); + int valueOffset = hashOffset(opt, false, keySize, valueSize); + if (isSimpleType(valueType)) + qDumpInnerValueHelper(d, valueType, addOffset(h, valueOffset)); + else + P(d, "value", ""); + + P(d, "numchild", 2); + if (d.dumpChildren) { + // there is a hash specialization in cast the key are integers or shorts + d << ",children=["; + d.beginHash(); + P(d, "name", "key"); + P(d, "type", keyType); + P(d, "addr", addOffset(h, keyOffset)); + d.endHash(); + d.beginHash(); + P(d, "name", "value"); + P(d, "type", valueType); + P(d, "addr", addOffset(h, valueOffset)); + d.endHash(); + d << "]"; + } + d.disarm(); +} + +static void qDumpQImage(QDumper &d) +{ +#ifdef QT_GUI_LIB + const QImage &im = *reinterpret_cast(d.data); + P(d, "value", "(" << im.width() << "x" << im.height() << ")"); + P(d, "type", NS"QImage"); + P(d, "numchild", "0"); + d.disarm(); +#else + Q_UNUSED(d); +#endif +} + +static void qDumpQList(QDumper &d) +{ + // This uses the knowledge that QList has only a single member + // of type union { QListData p; QListData::Data *d; }; + const QListData &ldata = *reinterpret_cast(d.data); + const QListData::Data *pdata = + *reinterpret_cast(d.data); + int nn = ldata.size(); + if (nn < 0) + qCheck(false); + if (nn > 0) { + qCheckAccess(ldata.d->array); + //qCheckAccess(ldata.d->array[0]); + //qCheckAccess(ldata.d->array[nn - 1]); +#if QT_VERSION >= 0x040400 + if (ldata.d->ref._q_value <= 0) + qCheck(false); +#endif + } + + int n = nn; + P(d, "value", "<" << n << " items>"); + P(d, "valuedisabled", "true"); + P(d, "numchild", n); + P(d, "childtype", d.innertype); + if (d.dumpChildren) { + unsigned innerSize = d.extraInt[0]; + bool innerTypeIsPointer = isPointerType(d.innertype); + QByteArray strippedInnerType = stripPointerType(d.innertype); + + // The exact condition here is: + // QTypeInfo::isLarge || QTypeInfo::isStatic + // but this data is available neither in the compiled binary nor + // in the frontend. + // So as first approximation only do the 'isLarge' check: + bool isInternal = innerSize <= int(sizeof(void*)) + && isMovableType(d.innertype); + + P(d, "internal", (int)isInternal); + P(d, "childtype", d.innertype); + if (n > 1000) + n = 1000; + d << ",children=["; + for (int i = 0; i != n; ++i) { + d.beginHash(); + P(d, "name", i); + if (innerTypeIsPointer) { + void *p = ldata.d->array + i + pdata->begin; + if (p) { + //P(d, "value","@" << p); + qDumpInnerValue(d, strippedInnerType.data(), deref(p)); + } else { + P(d, "value", ""); + P(d, "numchild", "0"); + } + } else { + void *p = ldata.d->array + i + pdata->begin; + if (isInternal) { + //qDumpInnerValue(d, d.innertype, p); + P(d, "addr", p); + qDumpInnerValueHelper(d, d.innertype, p); + } else { + //qDumpInnerValue(d, d.innertype, deref(p)); + P(d, "addr", deref(p)); + qDumpInnerValueHelper(d, d.innertype, deref(p)); + } + } + d.endHash(); + } + if (n < nn) + d.putEllipsis(); + d << "]"; + } + d.disarm(); +} + +static void qDumpQLinkedList(QDumper &d) +{ + // This uses the knowledge that QLinkedList has only a single member + // of type union { QLinkedListData *d; QLinkedListNode *e; }; + const QLinkedListData *ldata = + reinterpret_cast(deref(d.data)); + int nn = ldata->size; + if (nn < 0) + qCheck(false); + + int n = nn; + P(d, "value", "<" << n << " items>"); + P(d, "valuedisabled", "true"); + P(d, "numchild", n); + P(d, "childtype", d.innertype); + if (d.dumpChildren) { + //unsigned innerSize = d.extraInt[0]; + //bool innerTypeIsPointer = isPointerType(d.innertype); + QByteArray strippedInnerType = stripPointerType(d.innertype); + const char *stripped = + isPointerType(d.innertype) ? strippedInnerType.data() : 0; + + P(d, "childtype", d.innertype); + if (n > 1000) + n = 1000; + d << ",children=["; + const void *p = deref(ldata); + for (int i = 0; i != n; ++i) { + d.beginHash(); + P(d, "name", i); + const void *addr = addOffset(p, 2 * sizeof(void*)); + qDumpInnerValueOrPointer(d, d.innertype, stripped, addr); + p = deref(p); + d.endHash(); + } + if (n < nn) + d.putEllipsis(); + d << "]"; + } + d.disarm(); +} + +static void qDumpQLocale(QDumper &d) +{ + const QLocale &locale = *reinterpret_cast(d.data); + P(d, "value", locale.name()); + P(d, "valueencoded", "1"); + P(d, "type", NS"QLocale"); + P(d, "numchild", "8"); + if (d.dumpChildren) { + d << ",children=["; + + d.beginHash(); + P(d, "name", "country"); + P(d, "exp", "(("NSX"QLocale"NSY"*)" << d.data << ")->country()"); + d.endHash(); + + d.beginHash(); + P(d, "name", "language"); + P(d, "exp", "(("NSX"QLocale"NSY"*)" << d.data << ")->language()"); + d.endHash(); + + d.beginHash(); + P(d, "name", "measurementSystem"); + P(d, "exp", "(("NSX"QLocale"NSY"*)" << d.data << ")->measurementSystem()"); + d.endHash(); + + d.beginHash(); + P(d, "name", "numberOptions"); + P(d, "exp", "(("NSX"QLocale"NSY"*)" << d.data << ")->numberOptions()"); + d.endHash(); + + S(d, "timeFormat_(short)", locale.timeFormat(QLocale::ShortFormat)); + S(d, "timeFormat_(long)", locale.timeFormat(QLocale::LongFormat)); + + QC(d, "decimalPoint", locale.decimalPoint()); + QC(d, "exponential", locale.exponential()); + QC(d, "percent", locale.percent()); + QC(d, "zeroDigit", locale.zeroDigit()); + QC(d, "groupSeparator", locale.groupSeparator()); + QC(d, "negativeSign", locale.negativeSign()); + + d << "]"; + } + d.disarm(); +} + +static void qDumpQMapNode(QDumper &d) +{ + const QMapData *h = reinterpret_cast(d.data); + const char *keyType = d.templateParameters[0]; + const char *valueType = d.templateParameters[1]; + + qCheckAccess(h->backward); + qCheckAccess(h->forward[0]); + + P(d, "value", ""); + P(d, "numchild", 2); + if (d.dumpChildren) { + //unsigned keySize = d.extraInt[0]; + //unsigned valueSize = d.extraInt[1]; + unsigned mapnodesize = d.extraInt[2]; + unsigned valueOff = d.extraInt[3]; + + unsigned keyOffset = 2 * sizeof(void*) - mapnodesize; + unsigned valueOffset = 2 * sizeof(void*) - mapnodesize + valueOff; + + d << ",children=["; + d.beginHash(); + P(d, "name", "key"); + qDumpInnerValue(d, keyType, addOffset(h, keyOffset)); + + d.endHash(); + d.beginHash(); + P(d, "name", "value"); + qDumpInnerValue(d, valueType, addOffset(h, valueOffset)); + d.endHash(); + d << "]"; + } + + d.disarm(); +} + +static void qDumpQMap(QDumper &d) +{ + QMapData *h = *reinterpret_cast(d.data); + const char *keyType = d.templateParameters[0]; + const char *valueType = d.templateParameters[1]; + + int n = h->size; + + if (n < 0) + qCheck(false); + if (n > 0) { + qCheckAccess(h->backward); + qCheckAccess(h->forward[0]); + qCheckPointer(h->backward->backward); + qCheckPointer(h->forward[0]->backward); + } + + P(d, "value", "<" << n << " items>"); + P(d, "numchild", n); + if (d.dumpChildren) { + if (n > 1000) + n = 1000; + + //unsigned keySize = d.extraInt[0]; + //unsigned valueSize = d.extraInt[1]; + unsigned mapnodesize = d.extraInt[2]; + unsigned valueOff = d.extraInt[3]; + + bool isSimpleKey = isSimpleType(keyType); + bool isSimpleValue = isSimpleType(valueType); + // both negative: + int keyOffset = 2 * sizeof(void*) - int(mapnodesize); + int valueOffset = 2 * sizeof(void*) - int(mapnodesize) + valueOff; + + P(d, "extra", "simplekey: " << isSimpleKey << " isSimpleValue: " << isSimpleValue + << " keyOffset: " << keyOffset << " valueOffset: " << valueOffset + << " mapnodesize: " << mapnodesize); + d << ",children=["; + + QMapData::Node *node = reinterpret_cast(h->forward[0]); + QMapData::Node *end = reinterpret_cast(h); + int i = 0; + + while (node != end) { + d.beginHash(); + P(d, "name", i); + qDumpInnerValueHelper(d, keyType, addOffset(node, keyOffset), "key"); + qDumpInnerValueHelper(d, valueType, addOffset(node, valueOffset)); + if (isSimpleKey && isSimpleValue) { + P(d, "type", valueType); + P(d, "addr", addOffset(node, valueOffset)); + } else { +#if QT_VERSION >= 0x040500 + // actually, any type (even 'char') will do... + P(d, "type", NS"QMapNode<" + << keyType << "," << valueType << " >"); + P(d, "exp", "*('"NS"QMapNode<" + << keyType << "," << valueType << " >'*)" << node); + + //P(d, "exp", "*('"NS"QMapData'*)" << (void*)node); + //P(d, "exp", "*(char*)" << (void*)node); + // P(d, "addr", node); does not work as gdb fails to parse +#else + P(d, "type", NS"QMapData::Node<" + << keyType << "," << valueType << " >"); + P(d, "exp", "*('"NS"QMapData::Node<" + << keyType << "," << valueType << " >'*)" << node); +#endif + } + d.endHash(); + + ++i; + node = node->forward[0]; + } + d << "]"; + } + + d.disarm(); +} + +static void qDumpQMultiMap(QDumper &d) +{ + qDumpQMap(d); +} + +static void qDumpQModelIndex(QDumper &d) +{ + const QModelIndex *mi = reinterpret_cast(d.data); + + P(d, "type", NS"QModelIndex"); + if (mi->isValid()) { + P(d, "value", "(" << mi->row() << ", " << mi->column() << ")"); + P(d, "numchild", 5); + if (d.dumpChildren) { + d << ",children=["; + I(d, "row", mi->row()); + I(d, "column", mi->column()); + + d.beginHash(); + P(d, "name", "parent"); + const QModelIndex parent = mi->parent(); + if (parent.isValid()) + P(d, "value", "(" << mi->row() << ", " << mi->column() << ")"); + else + P(d, "value", ""); + P(d, "exp", "(("NSX"QModelIndex"NSY"*)" << d.data << ")->parent()"); + P(d, "type", NS"QModelIndex"); + P(d, "numchild", "1"); + d.endHash(); + + S(d, "internalId", QString::number(mi->internalId(), 10)); + + d.beginHash(); + P(d, "name", "model"); + P(d, "value", static_cast(mi->model())); + P(d, "type", NS"QAbstractItemModel*"); + P(d, "numchild", "1"); + d.endHash(); + + d << "]"; + } + } else { + P(d, "value", ""); + P(d, "numchild", 0); + } + + d.disarm(); +} + +static void qDumpQObject(QDumper &d) +{ + const QObject *ob = reinterpret_cast(d.data); + const QMetaObject *mo = ob->metaObject(); + unsigned childrenOffset = d.extraInt[0]; + P(d, "value", ob->objectName()); + P(d, "valueencoded", "1"); + P(d, "type", NS"QObject"); + P(d, "displayedtype", mo->className()); + P(d, "numchild", 4); + if (d.dumpChildren) { + const QObjectList &children = ob->children(); + int slotCount = 0; + int signalCount = 0; + for (int i = mo->methodCount(); --i >= 0; ) { + QMetaMethod::MethodType mt = mo->method(i).methodType(); + signalCount += (mt == QMetaMethod::Signal); + slotCount += (mt == QMetaMethod::Slot); + } + d << ",children=["; + d.beginHash(); + P(d, "name", "properties"); + // FIXME: Note that when simply using '(QObject*)' + // in the cast below, Gdb/MI _sometimes_ misparses + // expressions further down in the tree. + P(d, "exp", "*(class '"NS"QObject'*)" << d.data); + P(d, "type", NS"QObjectPropertyList"); + P(d, "value", "<" << mo->propertyCount() << " items>"); + P(d, "numchild", mo->propertyCount()); + d.endHash(); +#if 0 + d.beginHash(); + P(d, "name", "methods"); + P(d, "exp", "*(class '"NS"QObject'*)" << d.data); + P(d, "value", "<" << mo->methodCount() << " items>"); + P(d, "numchild", mo->methodCount()); + d.endHash(); +#endif +#if 0 + d.beginHash(); + P(d, "name", "senders"); + P(d, "exp", "(*(class '"NS"QObjectPrivate'*)" << dfunc(ob) << ")->senders"); + P(d, "type", NS"QList<"NS"QObjectPrivateSender>"); + d.endHash(); +#endif +#if PRIVATE_OBJECT_ALLOWED + d.beginHash(); + P(d, "name", "signals"); + P(d, "exp", "*(class '"NS"QObject'*)" << d.data); + P(d, "type", NS"QObjectSignalList"); + P(d, "value", "<" << signalCount << " items>"); + P(d, "numchild", signalCount); + d.endHash(); + d.beginHash(); + P(d, "name", "slots"); + P(d, "exp", "*(class '"NS"QObject'*)" << d.data); + P(d, "type", NS"QObjectSlotList"); + P(d, "value", "<" << slotCount << " items>"); + P(d, "numchild", slotCount); + d.endHash(); +#endif + d.beginHash(); + P(d, "name", "children"); + // works always, but causes additional traffic on the list + //P(d, "exp", "((class '"NS"QObject'*)" << d.data << ")->children()"); + // + //P(d, "addr", addOffset(dfunc(ob), childrenOffset)); + //P(d, "type", NS"QList"); + //P(d, "value", "<" << children.size() << " items>"); + qDumpInnerValue(d, NS"QList<"NS"QObject *>", + addOffset(dfunc(ob), childrenOffset)); + P(d, "numchild", children.size()); + d.endHash(); +#if 0 + // Unneeded (and not working): Connections are listes as childen + // of the signal or slot they are connected to. + // d.beginHash(); + // P(d, "name", "connections"); + // P(d, "exp", "*(*(class "NS"QObjectPrivate*)" << dfunc(ob) << ")->connectionLists"); + // P(d, "type", NS"QVector<"NS"QList<"NS"QObjectPrivate::Connection> >"); + // d.endHash(); +#endif +#if 0 + d.beginHash(); + P(d, "name", "objectprivate"); + P(d, "type", NS"QObjectPrivate"); + P(d, "addr", dfunc(ob)); + P(d, "value", ""); + P(d, "numchild", "1"); + d.endHash(); +#endif + d.beginHash(); + P(d, "name", "parent"); + qDumpInnerValueHelper(d, NS"QObject *", ob->parent()); + d.endHash(); +#if 1 + d.beginHash(); + P(d, "name", "className"); + P(d, "value",ob->metaObject()->className()); + P(d, "type", ""); + P(d, "numchild", "0"); + d.endHash(); +#endif + d << "]"; + } + d.disarm(); +} + +static void qDumpQObjectPropertyList(QDumper &d) +{ + const QObject *ob = (const QObject *)d.data; + const QMetaObject *mo = ob->metaObject(); + P(d, "addr", ""); + P(d, "type", NS"QObjectPropertyList"); + P(d, "numchild", mo->propertyCount()); + if (d.dumpChildren) { + d << ",children=["; + for (int i = mo->propertyCount(); --i >= 0; ) { + const QMetaProperty & prop = mo->property(i); + d.beginHash(); + P(d, "name", prop.name()); + P(d, "exp", "((" << mo->className() << "*)" << ob + << ")->" << prop.name() << "()"); + if (isEqual(prop.typeName(), "QString")) { + P(d, "value", prop.read(ob).toString()); + P(d, "valueencoded", "1"); + P(d, "type", NS"QString"); + P(d, "numchild", "0"); + } else if (isEqual(prop.typeName(), "bool")) { + P(d, "value", (prop.read(ob).toBool() ? "true" : "false")); + P(d, "numchild", "0"); + } else if (isEqual(prop.typeName(), "int")) { + P(d, "value", prop.read(ob).toInt()); + P(d, "numchild", "0"); + } + P(d, "type", prop.typeName()); + P(d, "numchild", "1"); + d.endHash(); + } + d << "]"; + } + d.disarm(); +} + +static void qDumpQObjectMethodList(QDumper &d) +{ + const QObject *ob = (const QObject *)d.data; + const QMetaObject *mo = ob->metaObject(); + P(d, "addr", ""); + P(d, "type", NS"QObjectMethodList"); + P(d, "numchild", mo->methodCount()); + P(d, "childtype", "QMetaMethod::Method"); + P(d, "childnumchild", "0"); + if (d.dumpChildren) { + d << ",children=["; + for (int i = 0; i != mo->methodCount(); ++i) { + const QMetaMethod & method = mo->method(i); + int mt = method.methodType(); + d.beginHash(); + P(d, "name", i << " " << mo->indexOfMethod(method.signature()) + << " " << method.signature()); + P(d, "value", (mt == QMetaMethod::Signal ? "" : "") << " (" << mt << ")"); + d.endHash(); + } + d << "]"; + } + d.disarm(); +} + +#if PRIVATE_OBJECT_ALLOWED +const char * qConnectionTypes[] ={ + "auto", + "direct", + "queued", + "autocompat", + "blockingqueued" +}; + +#if QT_VERSION >= 0x040400 +static const QObjectPrivate::ConnectionList &qConnectionList(const QObject *ob, int signalNumber) +{ + static const QObjectPrivate::ConnectionList emptyList; + const QObjectPrivate *p = reinterpret_cast(dfunc(ob)); + if (!p->connectionLists) + return emptyList; + typedef QVector ConnLists; + const ConnLists *lists = reinterpret_cast(p->connectionLists); + // there's an optimization making the lists only large enough to hold the + // last non-empty item + if (signalNumber >= lists->size()) + return emptyList; + return lists->at(signalNumber); +} +#endif + +static void qDumpQObjectSignal(QDumper &d) +{ + unsigned signalNumber = d.extraInt[0]; + + P(d, "addr", ""); + P(d, "numchild", "1"); + P(d, "type", NS"QObjectSignal"); + +#if QT_VERSION >= 0x040400 + if (d.dumpChildren) { + const QObject *ob = reinterpret_cast(d.data); + d << ",children=["; + const QObjectPrivate::ConnectionList &connList = qConnectionList(ob, signalNumber); + for (int i = 0; i != connList.size(); ++i) { + const QObjectPrivate::Connection &conn = connList.at(i); + d.beginHash(); + P(d, "name", i << " receiver"); + qDumpInnerValueHelper(d, NS"QObject *", conn.receiver); + d.endHash(); + d.beginHash(); + P(d, "name", i << " slot"); + P(d, "type", ""); + if (conn.receiver) + P(d, "value", conn.receiver->metaObject()->method(conn.method).signature()); + else + P(d, "value", ""); + P(d, "numchild", "0"); + d.endHash(); + d.beginHash(); + P(d, "name", i << " type"); + P(d, "type", ""); + P(d, "value", "<" << qConnectionTypes[conn.method] << " connection>"); + P(d, "numchild", "0"); + d.endHash(); + } + d << "]"; + P(d, "numchild", connList.size()); + } +#endif + d.disarm(); +} + +static void qDumpQObjectSignalList(QDumper &d) +{ + const QObject *ob = reinterpret_cast(d.data); + const QMetaObject *mo = ob->metaObject(); + int count = 0; + for (int i = mo->methodCount(); --i >= 0; ) + count += (mo->method(i).methodType() == QMetaMethod::Signal); + P(d, "addr", d.data); + P(d, "numchild", count); +#if QT_VERSION >= 0x040400 + if (d.dumpChildren) { + d << ",children=["; + for (int i = 0; i != mo->methodCount(); ++i) { + const QMetaMethod & method = mo->method(i); + if (method.methodType() == QMetaMethod::Signal) { + int k = mo->indexOfSignal(method.signature()); + const QObjectPrivate::ConnectionList &connList = qConnectionList(ob, k); + d.beginHash(); + P(d, "name", k); + P(d, "value", method.signature()); + P(d, "numchild", connList.size()); + //P(d, "numchild", "1"); + P(d, "exp", "*(class '"NS"QObject'*)" << d.data); + P(d, "type", NS"QObjectSignal"); + d.endHash(); + } + } + d << "]"; + } +#endif + d.disarm(); +} + +static void qDumpQObjectSlot(QDumper &d) +{ + int slotNumber = d.extraInt[0]; + + P(d, "addr", d.data); + P(d, "numchild", "1"); + P(d, "type", NS"QObjectSlot"); + +#if QT_VERSION >= 0x040400 + if (d.dumpChildren) { + d << ",children=["; + int numchild = 0; + const QObject *ob = reinterpret_cast(d.data); + const QObjectPrivate *p = reinterpret_cast(dfunc(ob)); + for (int s = 0; s != p->senders.size(); ++s) { + const QObjectPrivate::Sender &sender = p->senders.at(s); + const QObjectPrivate::ConnectionList &connList + = qConnectionList(sender.sender, sender.signal); + for (int i = 0; i != connList.size(); ++i) { + const QObjectPrivate::Connection &conn = connList.at(i); + if (conn.receiver == ob && conn.method == slotNumber) { + ++numchild; + const QMetaMethod & method = + sender.sender->metaObject()->method(sender.signal); + d.beginHash(); + P(d, "name", s << " sender"); + qDumpInnerValueHelper(d, NS"QObject *", sender.sender); + d.endHash(); + d.beginHash(); + P(d, "name", s << " signal"); + P(d, "type", ""); + P(d, "value", method.signature()); + P(d, "numchild", "0"); + d.endHash(); + d.beginHash(); + P(d, "name", s << " type"); + P(d, "type", ""); + P(d, "value", "<" << qConnectionTypes[conn.method] << " connection>"); + P(d, "numchild", "0"); + d.endHash(); + } + } + } + d << "]"; + P(d, "numchild", numchild); + } +#endif + d.disarm(); +} + +static void qDumpQObjectSlotList(QDumper &d) +{ + const QObject *ob = reinterpret_cast(d.data); +#if QT_VERSION >= 0x040400 + const QObjectPrivate *p = reinterpret_cast(dfunc(ob)); +#endif + const QMetaObject *mo = ob->metaObject(); + + int count = 0; + for (int i = mo->methodCount(); --i >= 0; ) + count += (mo->method(i).methodType() == QMetaMethod::Slot); + + P(d, "addr", d.data); + P(d, "numchild", count); +#if QT_VERSION >= 0x040400 + if (d.dumpChildren) { + d << ",children=["; + for (int i = 0; i != mo->methodCount(); ++i) { + const QMetaMethod & method = mo->method(i); + if (method.methodType() == QMetaMethod::Slot) { + d.beginHash(); + int k = mo->indexOfSlot(method.signature()); + P(d, "name", k); + P(d, "value", method.signature()); + + // count senders. expensive... + int numchild = 0; + for (int s = 0; s != p->senders.size(); ++s) { + const QObjectPrivate::Sender & sender = p->senders.at(s); + const QObjectPrivate::ConnectionList &connList + = qConnectionList(sender.sender, sender.signal); + for (int c = 0; c != connList.size(); ++c) { + const QObjectPrivate::Connection &conn = connList.at(c); + if (conn.receiver == ob && conn.method == k) + ++numchild; + } + } + P(d, "numchild", numchild); + P(d, "exp", "*(class '"NS"QObject'*)" << d.data); + P(d, "type", NS"QObjectSlot"); + d.endHash(); + } + } + d << "]"; + } +#endif + d.disarm(); +} +#endif // PRIVATE_OBJECT_ALLOWED + + +static void qDumpQPixmap(QDumper &d) +{ +#ifdef QT_GUI_LIB + const QPixmap &im = *reinterpret_cast(d.data); + P(d, "value", "(" << im.width() << "x" << im.height() << ")"); + P(d, "type", NS"QPixmap"); + P(d, "numchild", "0"); + d.disarm(); +#else + Q_UNUSED(d); +#endif +} + +static void qDumpQSet(QDumper &d) +{ + // This uses the knowledge that QHash has only a single member + // of union { QHashData *d; QHashNode *e; }; + QHashData *hd = *(QHashData**)d.data; + QHashData::Node *node = hd->firstNode(); + + int n = hd->size; + if (n < 0) + qCheck(false); + if (n > 0) { + qCheckAccess(node); + qCheckPointer(node->next); + } + + P(d, "value", "<" << n << " items>"); + P(d, "valuedisabled", "true"); + P(d, "numchild", 2 * n); + if (d.dumpChildren) { + if (n > 100) + n = 100; + d << ",children=["; + int i = 0; + for (int bucket = 0; bucket != hd->numBuckets && i <= 10000; ++bucket) { + for (node = hd->buckets[bucket]; node->next; node = node->next) { + d.beginHash(); + P(d, "name", i); + P(d, "type", d.innertype); + P(d, "exp", "(('"NS"QHashNode<" << d.innertype + << ","NS"QHashDummyValue>'*)" + << static_cast(node) << ")->key" + ); + d.endHash(); + ++i; + if (i > 10000) { + d.putEllipsis(); + break; + } + } + } + d << "]"; + } + d.disarm(); +} + +static void qDumpQString(QDumper &d) +{ + const QString &str = *reinterpret_cast(d.data); + + if (!str.isEmpty()) { + qCheckAccess(str.unicode()); + qCheckAccess(str.unicode() + str.size()); + } + + P(d, "value", str); + P(d, "valueencoded", "1"); + P(d, "type", NS"QString"); + //P(d, "editvalue", str); // handled generically below + P(d, "numchild", "0"); + + d.disarm(); +} + +static void qDumpQStringList(QDumper &d) +{ + const QStringList &list = *reinterpret_cast(d.data); + int n = list.size(); + if (n < 0) + qCheck(false); + if (n > 0) { + qCheckAccess(&list.front()); + qCheckAccess(&list.back()); + } + + P(d, "value", "<" << n << " items>"); + P(d, "valuedisabled", "true"); + P(d, "numchild", n); + P(d, "childtype", NS"QString"); + P(d, "childnumchild", "0"); + if (d.dumpChildren) { + if (n > 1000) + n = 1000; + d << ",children=["; + for (int i = 0; i != n; ++i) { + d.beginHash(); + P(d, "name", i); + P(d, "value", list[i]); + P(d, "valueencoded", "1"); + d.endHash(); + } + if (n < list.size()) + d.putEllipsis(); + d << "]"; + } + d.disarm(); +} + +static void qDumpQTextCodec(QDumper &d) +{ + const QTextCodec &codec = *reinterpret_cast(d.data); + P(d, "value", codec.name()); + P(d, "valueencoded", "1"); + P(d, "type", NS"QTextCodec"); + P(d, "numchild", "2"); + if (d.dumpChildren) { + d << ",children=["; + S(d, "name", codec.name()); + I(d, "mibEnum", codec.mibEnum()); + d << "]"; + } + d.disarm(); +} + +static void qDumpQVariantHelper(const void *data, QString *value, + QString *exp, int *numchild) +{ + const QVariant &v = *reinterpret_cast(data); + switch (v.type()) { + case QVariant::Invalid: + *value = QLatin1String(""); + *numchild = 0; + break; + case QVariant::String: + *value = QLatin1Char('"') + v.toString() + QLatin1Char('"'); + *numchild = 0; + break; + case QVariant::StringList: + *exp = QString(QLatin1String("((QVariant*)%1)->d.data.c")) + .arg((quintptr)data); + *numchild = v.toStringList().size(); + break; + case QVariant::Int: + *value = QString::number(v.toInt()); + *numchild= 0; + break; + case QVariant::Double: + *value = QString::number(v.toDouble()); + *numchild = 0; + break; + default: { + char buf[1000]; + const char *format = (v.typeName()[0] == 'Q') + ? "'"NS"%s "NS"qVariantValue<"NS"%s >'(*('"NS"QVariant'*)%p)" + : "'%s "NS"qVariantValue<%s >'(*('"NS"QVariant'*)%p)"; + qsnprintf(buf, sizeof(buf) - 1, format, v.typeName(), v.typeName(), data); + *exp = QLatin1String(buf); + *numchild = 1; + break; + } + } +} + +static void qDumpQVariant(QDumper &d) +{ + const QVariant &v = *reinterpret_cast(d.data); + QString value; + QString exp; + int numchild = 0; + qDumpQVariantHelper(d.data, &value, &exp, &numchild); + bool isInvalid = (v.typeName() == 0); + if (isInvalid) { + P(d, "value", "(invalid)"); + } else if (value.isEmpty()) { + P(d, "value", "(" << v.typeName() << ") " << qPrintable(value)); + } else { + QByteArray ba; + ba += '('; + ba += v.typeName(); + ba += ") "; + ba += qPrintable(value); + P(d, "value", ba); + P(d, "valueencoded", "1"); + } + P(d, "type", NS"QVariant"); + P(d, "numchild", (isInvalid ? "0" : "1")); + if (d.dumpChildren) { + d << ",children=["; + d.beginHash(); + P(d, "name", "value"); + if (!exp.isEmpty()) + P(d, "exp", qPrintable(exp)); + if (!value.isEmpty()) { + P(d, "value", value); + P(d, "valueencoded", "1"); + } + P(d, "type", v.typeName()); + P(d, "numchild", numchild); + d.endHash(); + d << "]"; + } + d.disarm(); +} + +static void qDumpQVector(QDumper &d) +{ + QVectorData *v = *reinterpret_cast(d.data); + + // Try to provoke segfaults early to prevent the frontend + // from asking for unavailable child details + int nn = v->size; + if (nn < 0) + qCheck(false); + if (nn > 0) { + //qCheckAccess(&vec.front()); + //qCheckAccess(&vec.back()); + } + + unsigned innersize = d.extraInt[0]; + unsigned typeddatasize = d.extraInt[1]; + + int n = nn; + P(d, "value", "<" << n << " items>"); + P(d, "valuedisabled", "true"); + P(d, "numchild", n); + if (d.dumpChildren) { + QByteArray strippedInnerType = stripPointerType(d.innertype); + const char *stripped = + isPointerType(d.innertype) ? strippedInnerType.data() : 0; + if (n > 1000) + n = 1000; + d << ",children=["; + for (int i = 0; i != n; ++i) { + d.beginHash(); + P(d, "name", i); + qDumpInnerValueOrPointer(d, d.innertype, stripped, + addOffset(v, i * innersize + typeddatasize)); + d.endHash(); + } + if (n < nn) + d.putEllipsis(); + d << "]"; + } + d.disarm(); +} + +static void qDumpStdList(QDumper &d) +{ + const std::list &list = *reinterpret_cast *>(d.data); + const void *p = d.data; + qCheckAccess(p); + p = deref(p); + qCheckAccess(p); + p = deref(p); + qCheckAccess(p); + p = deref(addOffset(d.data, sizeof(void*))); + qCheckAccess(p); + p = deref(addOffset(p, sizeof(void*))); + qCheckAccess(p); + p = deref(addOffset(p, sizeof(void*))); + qCheckAccess(p); + + int nn = 0; + std::list::const_iterator it = list.begin(); + for (; nn < 101 && it != list.end(); ++nn, ++it) + qCheckAccess(it.operator->()); + + if (nn > 100) + P(d, "value", ""); + else + P(d, "value", "<" << nn << " items>"); + P(d, "numchild", nn); + + P(d, "valuedisabled", "true"); + if (d.dumpChildren) { + QByteArray strippedInnerType = stripPointerType(d.innertype); + const char *stripped = + isPointerType(d.innertype) ? strippedInnerType.data() : 0; + d << ",children=["; + it = list.begin(); + for (int i = 0; i < 1000 && it != list.end(); ++i, ++it) { + d.beginHash(); + P(d, "name", i); + qDumpInnerValueOrPointer(d, d.innertype, stripped, it.operator->()); + d.endHash(); + } + if (it != list.end()) + d.putEllipsis(); + d << "]"; + } + d.disarm(); +} + +static void qDumpStdMap(QDumper &d) +{ + typedef std::map DummyType; + const DummyType &map = *reinterpret_cast(d.data); + const char *keyType = d.templateParameters[0]; + const char *valueType = d.templateParameters[1]; + const void *p = d.data; + qCheckAccess(p); + p = deref(p); + + int nn = map.size(); + qCheck(nn >= 0); + DummyType::const_iterator it = map.begin(); + for (int i = 0; i < nn && i < 10 && it != map.end(); ++i, ++it) + qCheckAccess(it.operator->()); + + QByteArray strippedInnerType = stripPointerType(d.innertype); + P(d, "numchild", nn); + P(d, "value", "<" << nn << " items>"); + P(d, "valuedisabled", "true"); + P(d, "valueoffset", d.extraInt[2]); + + // HACK: we need a properly const qualified version of the + // std::pair used. We extract it from the allocator parameter + // (#4, "std::allocator >") + // as it is there, and, equally importantly, in an order that + // gdb accepts when fed with it. + char *pairType = (char *)(d.templateParameters[3]) + 15; + pairType[strlen(pairType) - 2] = 0; + P(d, "pairtype", pairType); + + if (d.dumpChildren) { + bool isSimpleKey = isSimpleType(keyType); + bool isSimpleValue = isSimpleType(valueType); + int valueOffset = d.extraInt[2]; + + P(d, "extra", "isSimpleKey: " << isSimpleKey + << " isSimpleValue: " << isSimpleValue + << " valueType: '" << valueType + << " valueOffset: " << valueOffset); + + d << ",children=["; + it = map.begin(); + for (int i = 0; i < 1000 && it != map.end(); ++i, ++it) { + d.beginHash(); + const void *node = it.operator->(); + P(d, "name", i); + qDumpInnerValueHelper(d, keyType, node, "key"); + qDumpInnerValueHelper(d, valueType, addOffset(node, valueOffset)); + if (isSimpleKey && isSimpleValue) { + P(d, "type", valueType); + P(d, "addr", addOffset(node, valueOffset)); + P(d, "numchild", 0); + } else { + P(d, "addr", node); + P(d, "type", pairType); + P(d, "numchild", 2); + } + d.endHash(); + } + if (it != map.end()) + d.putEllipsis(); + d << "]"; + } + d.disarm(); +} + +static void qDumpStdString(QDumper &d) +{ + const std::string &str = *reinterpret_cast(d.data); + + if (!str.empty()) { + qCheckAccess(str.c_str()); + qCheckAccess(str.c_str() + str.size() - 1); + } + + d << ",value=\""; + d.putBase64Encoded(str.c_str(), str.size()); + d << "\""; + P(d, "valueencoded", "1"); + P(d, "type", "std::string"); + P(d, "numchild", "0"); + + d.disarm(); +} + +static void qDumpStdWString(QDumper &d) +{ + const std::wstring &str = *reinterpret_cast(d.data); + + if (!str.empty()) { + qCheckAccess(str.c_str()); + qCheckAccess(str.c_str() + str.size() - 1); + } + + d << "value='"; + d.putBase64Encoded((const char *)str.c_str(), str.size() * sizeof(wchar_t)); + d << "'"; + P(d, "valueencoded", (sizeof(wchar_t) == 2 ? "2" : "3")); + P(d, "type", "std::wstring"); + P(d, "numchild", "0"); + + d.disarm(); +} + +static void qDumpStdVector(QDumper &d) +{ + // Correct type would be something like: + // std::_Vector_base >>::_Vector_impl + struct VectorImpl { + char *start; + char *finish; + char *end_of_storage; + }; + const VectorImpl *v = static_cast(d.data); + + // Try to provoke segfaults early to prevent the frontend + // from asking for unavailable child details + int nn = (v->finish - v->start) / d.extraInt[0]; + if (nn < 0) + qCheck(false); + if (nn > 0) { + qCheckAccess(v->start); + qCheckAccess(v->finish); + qCheckAccess(v->end_of_storage); + } + + int n = nn; + P(d, "value", "<" << n << " items>"); + P(d, "valuedisabled", "true"); + P(d, "numchild", n); + if (d.dumpChildren) { + unsigned innersize = d.extraInt[0]; + QByteArray strippedInnerType = stripPointerType(d.innertype); + const char *stripped = + isPointerType(d.innertype) ? strippedInnerType.data() : 0; + if (n > 1000) + n = 1000; + d << ",children=["; + for (int i = 0; i != n; ++i) { + d.beginHash(); + P(d, "name", i); + qDumpInnerValueOrPointer(d, d.innertype, stripped, + addOffset(v->start, i * innersize)); + d.endHash(); + } + if (n < nn) + d.putEllipsis(); + d << "]"; + } + d.disarm(); +} + +static void qDumpStdVectorBool(QDumper &d) +{ + // FIXME + return qDumpStdVector(d); +} + +static void handleProtocolVersion2and3(QDumper & d) +{ + if (!d.outertype[0]) { + qDumpUnknown(d); + return; + } + + d.setupTemplateParameters(); + P(d, "iname", d.iname); + P(d, "addr", d.data); + +#ifdef QT_NO_QDATASTREAM + if (d.protocolVersion == 3) { + QVariant::Type type = QVariant::nameToType(d.outertype); + if (type != QVariant::Invalid) { + QVariant v(type, d.data); + QByteArray ba; + QDataStream ds(&ba, QIODevice::WriteOnly); + ds << v; + P(d, "editvalue", ba); + } + } +#endif + + const char *type = stripNamespace(d.outertype); + // type[0] is usally 'Q', so don't use it + switch (type[1]) { + case 'B': + if (isEqual(type, "QByteArray")) + qDumpQByteArray(d); + break; + case 'D': + if (isEqual(type, "QDateTime")) + qDumpQDateTime(d); + else if (isEqual(type, "QDir")) + qDumpQDir(d); + break; + case 'F': + if (isEqual(type, "QFile")) + qDumpQFile(d); + else if (isEqual(type, "QFileInfo")) + qDumpQFileInfo(d); + break; + case 'H': + if (isEqual(type, "QHash")) + qDumpQHash(d); + else if (isEqual(type, "QHashNode")) + qDumpQHashNode(d); + break; + case 'I': + if (isEqual(type, "QImage")) + qDumpQImage(d); + break; + case 'L': + if (isEqual(type, "QList")) + qDumpQList(d); + else if (isEqual(type, "QLinkedList")) + qDumpQLinkedList(d); + else if (isEqual(type, "QLocale")) + qDumpQLocale(d); + break; + case 'M': + if (isEqual(type, "QMap")) + qDumpQMap(d); + else if (isEqual(type, "QMapNode")) + qDumpQMapNode(d); + else if (isEqual(type, "QModelIndex")) + qDumpQModelIndex(d); + else if (isEqual(type, "QMultiMap")) + qDumpQMultiMap(d); + break; + case 'O': + if (isEqual(type, "QObject")) + qDumpQObject(d); + else if (isEqual(type, "QObjectPropertyList")) + qDumpQObjectPropertyList(d); + else if (isEqual(type, "QObjectMethodList")) + qDumpQObjectMethodList(d); + #if PRIVATE_OBJECT_ALLOWED + else if (isEqual(type, "QObjectSignal")) + qDumpQObjectSignal(d); + else if (isEqual(type, "QObjectSignalList")) + qDumpQObjectSignalList(d); + else if (isEqual(type, "QObjectSlot")) + qDumpQObjectSlot(d); + else if (isEqual(type, "QObjectSlotList")) + qDumpQObjectSlotList(d); + #endif + break; + case 'P': + if (isEqual(type, "QPixmap")) + qDumpQPixmap(d); + break; + case 'S': + if (isEqual(type, "QSet")) + qDumpQSet(d); + else if (isEqual(type, "QString")) + qDumpQString(d); + else if (isEqual(type, "QStringList")) + qDumpQStringList(d); + break; + case 'T': + if (isEqual(type, "QTextCodec")) + qDumpQTextCodec(d); + break; + case 'V': + if (isEqual(type, "QVariant")) + qDumpQVariant(d); + else if (isEqual(type, "QVector")) + qDumpQVector(d); + break; + case 's': + if (isEqual(type, "wstring")) + qDumpStdWString(d); + break; + case 't': + if (isEqual(type, "std::vector")) + qDumpStdVector(d); + else if (isEqual(type, "std::vector::bool")) + qDumpStdVectorBool(d); + else if (isEqual(type, "std::list")) + qDumpStdList(d); + else if (isEqual(type, "std::map")) + qDumpStdMap(d); + else if (isEqual(type, "std::string") || isEqual(type, "string")) + qDumpStdString(d); + else if (isEqual(type, "std::wstring")) + qDumpStdWString(d); + break; + } + + if (!d.success) + qDumpUnknown(d); +} + +} // anonymous namespace + + +extern "C" Q_DECL_EXPORT +void qDumpObjectData440( + int protocolVersion, + int token, + void *data, + bool dumpChildren, + int extraInt0, + int extraInt1, + int extraInt2, + int extraInt3) +{ + //sleep(20); + if (protocolVersion == 1) { + QDumper d; + d.protocolVersion = protocolVersion; + d.token = token; + + // This is a list of all available dumpers. Note that some templates + // currently require special hardcoded handling in the debugger plugin. + // They are mentioned here nevertheless. For types that not listed + // here, dumpers won't be used. + d << "dumpers=[" + "\""NS"QByteArray\"," + "\""NS"QDateTime\"," + "\""NS"QDir\"," + "\""NS"QFile\"," + "\""NS"QFileInfo\"," + "\""NS"QHash\"," + "\""NS"QHashNode\"," + "\""NS"QImage\"," + "\""NS"QLinkedList\"," + "\""NS"QList\"," + "\""NS"QLocale\"," + "\""NS"QMap\"," + "\""NS"QMapNode\"," + "\""NS"QModelIndex\"," + #if QT_VERSION >= 0x040500 + "\""NS"QMultiMap\"," + #endif + "\""NS"QObject\"," + "\""NS"QObjectMethodList\"," // hack to get nested properties display + "\""NS"QObjectPropertyList\"," + #if PRIVATE_OBJECT_ALLOWED + "\""NS"QObjectSignal\"," + "\""NS"QObjectSignalList\"," + "\""NS"QObjectSlot\"," + "\""NS"QObjectSlotList\"," + #endif // PRIVATE_OBJECT_ALLOWED + // << "\""NS"QRegion\"," + "\""NS"QSet\"," + "\""NS"QString\"," + "\""NS"QStringList\"," + "\""NS"QTextCodec\"," + "\""NS"QVariant\"," + "\""NS"QVector\"," + "\""NS"QWidget\"," + "\"string\"," + "\"wstring\"," + "\"std::basic_string\"," + "\"std::list\"," + "\"std::map\"," + "\"std::string\"," + "\"std::vector\"," + "\"std::wstring\"," + "]"; + d << ",qtversion=[" + "\"" << ((QT_VERSION >> 16) & 255) << "\"," + "\"" << ((QT_VERSION >> 8) & 255) << "\"," + "\"" << ((QT_VERSION) & 255) << "\"]"; + d << ",namespace=\""NS"\""; + d.disarm(); + } + + else if (protocolVersion == 2 || protocolVersion == 3) { + QDumper d; + + d.protocolVersion = protocolVersion; + d.token = token; + d.data = data; + d.dumpChildren = dumpChildren; + d.extraInt[0] = extraInt0; + d.extraInt[1] = extraInt1; + d.extraInt[2] = extraInt2; + d.extraInt[3] = extraInt3; + + const char *inbuffer = qDumpInBuffer; + d.outertype = inbuffer; while (*inbuffer) ++inbuffer; ++inbuffer; + d.iname = inbuffer; while (*inbuffer) ++inbuffer; ++inbuffer; + d.exp = inbuffer; while (*inbuffer) ++inbuffer; ++inbuffer; + d.innertype = inbuffer; while (*inbuffer) ++inbuffer; ++inbuffer; + d.iname = inbuffer; while (*inbuffer) ++inbuffer; ++inbuffer; + + handleProtocolVersion2and3(d); + } + + else { + qDebug() << "Unsupported protocol version" << protocolVersion; + } +} diff --git a/src/qtc-gdbmacros/gdbmacros.pro b/src/qtc-gdbmacros/gdbmacros.pro new file mode 100644 index 0000000..bd1c07b --- /dev/null +++ b/src/qtc-gdbmacros/gdbmacros.pro @@ -0,0 +1,3 @@ +TEMPLATE = lib +CONFIG += shared +SOURCES=gdbmacros.cpp diff --git a/src/qtc-gdbmacros/libgdbmacros.so b/src/qtc-gdbmacros/libgdbmacros.so new file mode 120000 index 0000000..d4a4031 --- /dev/null +++ b/src/qtc-gdbmacros/libgdbmacros.so @@ -0,0 +1 @@ +libgdbmacros.so.1.0.0 \ No newline at end of file diff --git a/src/qtc-gdbmacros/libgdbmacros.so.1 b/src/qtc-gdbmacros/libgdbmacros.so.1 new file mode 120000 index 0000000..d4a4031 --- /dev/null +++ b/src/qtc-gdbmacros/libgdbmacros.so.1 @@ -0,0 +1 @@ +libgdbmacros.so.1.0.0 \ No newline at end of file diff --git a/src/qtc-gdbmacros/libgdbmacros.so.1.0 b/src/qtc-gdbmacros/libgdbmacros.so.1.0 new file mode 120000 index 0000000..d4a4031 --- /dev/null +++ b/src/qtc-gdbmacros/libgdbmacros.so.1.0 @@ -0,0 +1 @@ +libgdbmacros.so.1.0.0 \ No newline at end of file diff --git a/src/qtc-gdbmacros/libgdbmacros.so.1.0.0 b/src/qtc-gdbmacros/libgdbmacros.so.1.0.0 new file mode 100755 index 0000000..a8d6ffc Binary files /dev/null and b/src/qtc-gdbmacros/libgdbmacros.so.1.0.0 differ diff --git a/src/test-1.png b/src/test-1.png new file mode 100644 index 0000000..ff14151 Binary files /dev/null and b/src/test-1.png differ diff --git a/src/test-2.png b/src/test-2.png new file mode 100644 index 0000000..08a4b29 Binary files /dev/null and b/src/test-2.png differ diff --git a/src/test-3.png b/src/test-3.png new file mode 100644 index 0000000..13dfcb4 Binary files /dev/null and b/src/test-3.png differ diff --git a/src/test-4.png b/src/test-4.png new file mode 100644 index 0000000..bf63a3b Binary files /dev/null and b/src/test-4.png differ diff --git a/src/ui_mainwindow.h b/src/ui_mainwindow.h new file mode 100644 index 0000000..c80f635 --- /dev/null +++ b/src/ui_mainwindow.h @@ -0,0 +1,138 @@ +/******************************************************************************** +** Form generated from reading ui file 'mainwindow.ui' +** +** Created: Wed Nov 4 15:41:11 2009 +** by: Qt User Interface Compiler version 4.5.0 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + +#ifndef UI_MAINWINDOW_H +#define UI_MAINWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_MainWindowClass +{ +public: + QWidget *centralWidget; + QWidget *originalImage; + QSplitter *splitter; + QPushButton *select; + QPushButton *crop; + QPushButton *install; + QPushButton *set; + QWidget *layoutWidget; + QHBoxLayout *horizontalLayout; + QWidget *image_1; + QWidget *image_2; + QWidget *image_3; + QWidget *image_4; + + void setupUi(QMainWindow *MainWindowClass) + { + if (MainWindowClass->objectName().isEmpty()) + MainWindowClass->setObjectName(QString::fromUtf8("MainWindowClass")); + MainWindowClass->setWindowModality(Qt::ApplicationModal); + MainWindowClass->resize(800, 400); + QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(MainWindowClass->sizePolicy().hasHeightForWidth()); + MainWindowClass->setSizePolicy(sizePolicy); + MainWindowClass->setMaximumSize(QSize(800, 480)); + centralWidget = new QWidget(MainWindowClass); + centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + originalImage = new QWidget(centralWidget); + originalImage->setObjectName(QString::fromUtf8("originalImage")); + originalImage->setGeometry(QRect(80, 50, 661, 110)); + sizePolicy.setHeightForWidth(originalImage->sizePolicy().hasHeightForWidth()); + originalImage->setSizePolicy(sizePolicy); + splitter = new QSplitter(centralWidget); + splitter->setObjectName(QString::fromUtf8("splitter")); + splitter->setGeometry(QRect(240, 310, 531, 71)); + splitter->setOrientation(Qt::Horizontal); + select = new QPushButton(splitter); + select->setObjectName(QString::fromUtf8("select")); + select->setEnabled(true); + splitter->addWidget(select); + crop = new QPushButton(splitter); + crop->setObjectName(QString::fromUtf8("crop")); + crop->setEnabled(false); + splitter->addWidget(crop); + install = new QPushButton(splitter); + install->setObjectName(QString::fromUtf8("install")); + install->setEnabled(false); + splitter->addWidget(install); + set = new QPushButton(splitter); + set->setObjectName(QString::fromUtf8("set")); + set->setEnabled(false); + splitter->addWidget(set); + layoutWidget = new QWidget(centralWidget); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(80, 180, 661, 101)); + horizontalLayout = new QHBoxLayout(layoutWidget); + horizontalLayout->setSpacing(6); + horizontalLayout->setMargin(11); + horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + horizontalLayout->setContentsMargins(0, 0, 0, 0); + image_1 = new QWidget(layoutWidget); + image_1->setObjectName(QString::fromUtf8("image_1")); + + horizontalLayout->addWidget(image_1); + + image_2 = new QWidget(layoutWidget); + image_2->setObjectName(QString::fromUtf8("image_2")); + + horizontalLayout->addWidget(image_2); + + image_3 = new QWidget(layoutWidget); + image_3->setObjectName(QString::fromUtf8("image_3")); + + horizontalLayout->addWidget(image_3); + + image_4 = new QWidget(layoutWidget); + image_4->setObjectName(QString::fromUtf8("image_4")); + + horizontalLayout->addWidget(image_4); + + MainWindowClass->setCentralWidget(centralWidget); + + retranslateUi(MainWindowClass); + QObject::connect(select, SIGNAL(clicked()), MainWindowClass, SLOT(openFile())); + QObject::connect(crop, SIGNAL(clicked()), MainWindowClass, SLOT(cropImage())); + QObject::connect(install, SIGNAL(clicked()), MainWindowClass, SLOT(installImageSet())); + + QMetaObject::connectSlotsByName(MainWindowClass); + } // setupUi + + void retranslateUi(QMainWindow *MainWindowClass) + { + MainWindowClass->setWindowTitle(QApplication::translate("MainWindowClass", "MainWindow", 0, QApplication::UnicodeUTF8)); + select->setText(QApplication::translate("MainWindowClass", "Select", 0, QApplication::UnicodeUTF8)); + crop->setText(QApplication::translate("MainWindowClass", "Crop Image", 0, QApplication::UnicodeUTF8)); + install->setText(QApplication::translate("MainWindowClass", "Install", 0, QApplication::UnicodeUTF8)); + set->setText(QApplication::translate("MainWindowClass", "Set", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(MainWindowClass); + } // retranslateUi + +}; + +namespace Ui { + class MainWindowClass: public Ui_MainWindowClass {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_MAINWINDOW_H diff --git a/src/ui_namedialog.h b/src/ui_namedialog.h new file mode 100644 index 0000000..8ef884a --- /dev/null +++ b/src/ui_namedialog.h @@ -0,0 +1,64 @@ +/******************************************************************************** +** Form generated from reading ui file 'namedialog.ui' +** +** Created: Wed Nov 4 15:41:11 2009 +** by: Qt User Interface Compiler version 4.5.0 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + +#ifndef UI_NAMEDIALOG_H +#define UI_NAMEDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_NameDialog +{ +public: + QLineEdit *nameInput; + QPushButton *acceptButton; + + void setupUi(QDialog *NameDialog) + { + if (NameDialog->objectName().isEmpty()) + NameDialog->setObjectName(QString::fromUtf8("NameDialog")); + NameDialog->resize(800, 150); + nameInput = new QLineEdit(NameDialog); + nameInput->setObjectName(QString::fromUtf8("nameInput")); + nameInput->setGeometry(QRect(130, 50, 391, 51)); + acceptButton = new QPushButton(NameDialog); + acceptButton->setObjectName(QString::fromUtf8("acceptButton")); + acceptButton->setEnabled(false); + acceptButton->setGeometry(QRect(630, 40, 111, 71)); + + retranslateUi(NameDialog); + QObject::connect(acceptButton, SIGNAL(clicked()), NameDialog, SLOT(acceptName())); + + QMetaObject::connectSlotsByName(NameDialog); + } // setupUi + + void retranslateUi(QDialog *NameDialog) + { + NameDialog->setWindowTitle(QApplication::translate("NameDialog", "Dialog", 0, QApplication::UnicodeUTF8)); + acceptButton->setText(QApplication::translate("NameDialog", "OK", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(NameDialog); + } // retranslateUi + +}; + +namespace Ui { + class NameDialog: public Ui_NameDialog {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_NAMEDIALOG_H diff --git a/src/ui_progressdialog.h b/src/ui_progressdialog.h new file mode 100644 index 0000000..1ea9975 --- /dev/null +++ b/src/ui_progressdialog.h @@ -0,0 +1,72 @@ +/******************************************************************************** +** Form generated from reading ui file 'progressdialog.ui' +** +** Created: Wed Nov 4 15:41:11 2009 +** by: Qt User Interface Compiler version 4.5.0 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + +#ifndef UI_PROGRESSDIALOG_H +#define UI_PROGRESSDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_ProgressDialog +{ +public: + QProgressBar *progressBar; + QLabel *doneLabel; + QPushButton *noticedButton; + + void setupUi(QDialog *ProgressDialog) + { + if (ProgressDialog->objectName().isEmpty()) + ProgressDialog->setObjectName(QString::fromUtf8("ProgressDialog")); + ProgressDialog->resize(800, 200); + progressBar = new QProgressBar(ProgressDialog); + progressBar->setObjectName(QString::fromUtf8("progressBar")); + progressBar->setGeometry(QRect(160, 50, 401, 81)); + progressBar->setValue(0); + doneLabel = new QLabel(ProgressDialog); + doneLabel->setObjectName(QString::fromUtf8("doneLabel")); + doneLabel->setEnabled(true); + doneLabel->setGeometry(QRect(120, 60, 481, 51)); + noticedButton = new QPushButton(ProgressDialog); + noticedButton->setObjectName(QString::fromUtf8("noticedButton")); + noticedButton->setEnabled(true); + noticedButton->setGeometry(QRect(600, 50, 131, 61)); + + retranslateUi(ProgressDialog); + QObject::connect(noticedButton, SIGNAL(clicked()), ProgressDialog, SLOT(accept())); + + QMetaObject::connectSlotsByName(ProgressDialog); + } // setupUi + + void retranslateUi(QDialog *ProgressDialog) + { + ProgressDialog->setWindowTitle(QApplication::translate("ProgressDialog", "Dialog", 0, QApplication::UnicodeUTF8)); + doneLabel->setText(QApplication::translate("ProgressDialog", "Done. Now available as ImageSet!", 0, QApplication::UnicodeUTF8)); + noticedButton->setText(QApplication::translate("ProgressDialog", "OK", 0, QApplication::UnicodeUTF8)); + Q_UNUSED(ProgressDialog); + } // retranslateUi + +}; + +namespace Ui { + class ProgressDialog: public Ui_ProgressDialog {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_PROGRESSDIALOG_H diff --git a/src/wallpaperCreator b/src/wallpaperCreator new file mode 100755 index 0000000..2899b56 Binary files /dev/null and b/src/wallpaperCreator differ