From: Shamus Hammons Date: Fri, 26 Dec 2014 15:46:24 +0000 (-0600) Subject: Converted from Qt4 to Qt5. X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=ttedit;a=commitdiff_plain;h=3ef71393f70213eb53db552605ae3c93f1303ee9 Converted from Qt4 to Qt5. --- diff --git a/Makefile b/Makefile deleted file mode 100644 index 81a051d..0000000 --- a/Makefile +++ /dev/null @@ -1,337 +0,0 @@ -############################################################################# -# Makefile for building: ttedit -# Generated by qmake (2.01a) (Qt 4.8.4) on: Mon Dec 31 13:07:16 2012 -# Project: ttedit.pro -# Template: app -# Command: /usr/bin/qmake -o Makefile ttedit.pro -############################################################################# - -####### Compiler, tools and options - -CC = gcc -CXX = g++ -DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -CFLAGS = -pipe -O2 -D_REENTRANT -Wall -W $(DEFINES) -CXXFLAGS = -pipe -O2 -D_REENTRANT -Wall -W $(DEFINES) -INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -Iobj -LINK = g++ -LFLAGS = -Wl,-O1 -LIBS = $(SUBLIBS) -L/usr/lib64/qt4 -lQtGui -L/usr/lib64 -L/usr/lib64/qt4 -L/usr/X11R6/lib -lQtCore -lgthread-2.0 -lrt -lglib-2.0 -lpthread -AR = ar cqs -RANLIB = -QMAKE = /usr/bin/qmake -TAR = tar -cf -COMPRESS = gzip -9f -COPY = cp -f -SED = sed -COPY_FILE = $(COPY) -COPY_DIR = $(COPY) -r -STRIP = strip -INSTALL_FILE = install -m 644 -p -INSTALL_DIR = $(COPY_DIR) -INSTALL_PROGRAM = install -m 755 -p -DEL_FILE = rm -f -SYMLINK = ln -f -s -DEL_DIR = rmdir -MOVE = mv -f -CHK_DIR_EXISTS= test -d -MKDIR = mkdir -p - -####### Output directory - -OBJECTS_DIR = obj/ - -####### Files - -SOURCES = src/ttedit.cpp \ - src/mainwindow.cpp \ - src/editwindow.cpp \ - src/glyphpoints.cpp \ - src/debug.cpp \ - src/toolwindow.cpp \ - src/charwindow.cpp \ - src/vector.cpp \ - src/graphicprimitives.cpp obj/moc_mainwindow.cpp \ - obj/moc_editwindow.cpp \ - obj/moc_toolwindow.cpp \ - obj/moc_charwindow.cpp \ - obj/qrc_ttedit.cpp -OBJECTS = obj/ttedit.o \ - obj/mainwindow.o \ - obj/editwindow.o \ - obj/glyphpoints.o \ - obj/debug.o \ - obj/toolwindow.o \ - obj/charwindow.o \ - obj/vector.o \ - obj/graphicprimitives.o \ - obj/moc_mainwindow.o \ - obj/moc_editwindow.o \ - obj/moc_toolwindow.o \ - obj/moc_charwindow.o \ - obj/qrc_ttedit.o -DIST = /usr/share/qt4/mkspecs/common/unix.conf \ - /usr/share/qt4/mkspecs/common/linux.conf \ - /usr/share/qt4/mkspecs/common/gcc-base.conf \ - /usr/share/qt4/mkspecs/common/gcc-base-unix.conf \ - /usr/share/qt4/mkspecs/common/g++-base.conf \ - /usr/share/qt4/mkspecs/common/g++-unix.conf \ - /usr/share/qt4/mkspecs/qconfig.pri \ - /usr/share/qt4/mkspecs/modules/qt_phonon.pri \ - /usr/share/qt4/mkspecs/modules/qt_webkit_version.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/default_post.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/unix/gdb_dwarf_index.prf \ - /usr/share/qt4/mkspecs/features/warn_on.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 \ - ttedit.pro -QMAKE_TARGET = ttedit -DESTDIR = -TARGET = ttedit - -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 $(TARGET) - -$(TARGET): $(OBJECTS) - $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) - -Makefile: ttedit.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \ - /usr/share/qt4/mkspecs/common/linux.conf \ - /usr/share/qt4/mkspecs/common/gcc-base.conf \ - /usr/share/qt4/mkspecs/common/gcc-base-unix.conf \ - /usr/share/qt4/mkspecs/common/g++-base.conf \ - /usr/share/qt4/mkspecs/common/g++-unix.conf \ - /usr/share/qt4/mkspecs/qconfig.pri \ - /usr/share/qt4/mkspecs/modules/qt_phonon.pri \ - /usr/share/qt4/mkspecs/modules/qt_webkit_version.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/default_post.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/unix/gdb_dwarf_index.prf \ - /usr/share/qt4/mkspecs/features/warn_on.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/lib64/qt4/libQtGui.prl \ - /usr/lib64/qt4/libQtCore.prl - $(QMAKE) -o Makefile ttedit.pro -/usr/share/qt4/mkspecs/common/unix.conf: -/usr/share/qt4/mkspecs/common/linux.conf: -/usr/share/qt4/mkspecs/common/gcc-base.conf: -/usr/share/qt4/mkspecs/common/gcc-base-unix.conf: -/usr/share/qt4/mkspecs/common/g++-base.conf: -/usr/share/qt4/mkspecs/common/g++-unix.conf: -/usr/share/qt4/mkspecs/qconfig.pri: -/usr/share/qt4/mkspecs/modules/qt_phonon.pri: -/usr/share/qt4/mkspecs/modules/qt_webkit_version.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/default_post.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/unix/gdb_dwarf_index.prf: -/usr/share/qt4/mkspecs/features/warn_on.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/lib64/qt4/libQtGui.prl: -/usr/lib64/qt4/libQtCore.prl: -qmake: FORCE - @$(QMAKE) -o Makefile ttedit.pro - -dist: - @$(CHK_DIR_EXISTS) obj/ttedit1.0.0 || $(MKDIR) obj/ttedit1.0.0 - $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/ttedit1.0.0/ && $(COPY_FILE) --parents src/ttedit.h src/mainwindow.h src/editwindow.h src/glyphpoints.h src/types.h src/debug.h src/toolwindow.h src/charwindow.h src/vector.h src/graphicprimitives.h src/list.h obj/ttedit1.0.0/ && $(COPY_FILE) --parents ttedit.qrc obj/ttedit1.0.0/ && $(COPY_FILE) --parents src/ttedit.cpp src/mainwindow.cpp src/editwindow.cpp src/glyphpoints.cpp src/debug.cpp src/toolwindow.cpp src/charwindow.cpp src/vector.cpp src/graphicprimitives.cpp obj/ttedit1.0.0/ && (cd `dirname obj/ttedit1.0.0` && $(TAR) ttedit1.0.0.tar ttedit1.0.0 && $(COMPRESS) ttedit1.0.0.tar) && $(MOVE) `dirname obj/ttedit1.0.0`/ttedit1.0.0.tar.gz . && $(DEL_FILE) -r obj/ttedit1.0.0 - - -clean:compiler_clean - -$(DEL_FILE) $(OBJECTS) - -$(DEL_FILE) *~ core *.core - - -####### Sub-libraries - -distclean: clean - -$(DEL_FILE) $(TARGET) - -$(DEL_FILE) Makefile - - -check: first - -mocclean: compiler_moc_header_clean compiler_moc_source_clean - -mocables: compiler_moc_header_make_all compiler_moc_source_make_all - -compiler_moc_header_make_all: obj/moc_mainwindow.cpp obj/moc_editwindow.cpp obj/moc_toolwindow.cpp obj/moc_charwindow.cpp -compiler_moc_header_clean: - -$(DEL_FILE) obj/moc_mainwindow.cpp obj/moc_editwindow.cpp obj/moc_toolwindow.cpp obj/moc_charwindow.cpp -obj/moc_mainwindow.cpp: src/mainwindow.h - /usr/bin/moc $(DEFINES) $(INCPATH) src/mainwindow.h -o obj/moc_mainwindow.cpp - -obj/moc_editwindow.cpp: src/types.h \ - src/toolwindow.h \ - src/glyphpoints.h \ - src/editwindow.h - /usr/bin/moc $(DEFINES) $(INCPATH) src/editwindow.h -o obj/moc_editwindow.cpp - -obj/moc_toolwindow.cpp: src/toolwindow.h - /usr/bin/moc $(DEFINES) $(INCPATH) src/toolwindow.h -o obj/moc_toolwindow.cpp - -obj/moc_charwindow.cpp: src/glyphpoints.h \ - src/types.h \ - src/charwindow.h - /usr/bin/moc $(DEFINES) $(INCPATH) src/charwindow.h -o obj/moc_charwindow.cpp - -compiler_rcc_make_all: obj/qrc_ttedit.cpp -compiler_rcc_clean: - -$(DEL_FILE) obj/qrc_ttedit.cpp -obj/qrc_ttedit.cpp: ttedit.qrc \ - res/cursor-zoom.png \ - res/cursor-add-point.png \ - res/cursor-del-poly.png \ - res/toolpal1.png \ - res/cursor-add-poly.png \ - res/cursor-rotate.png \ - res/act-back.png \ - res/ttedit.png \ - res/cursor-del-point.png \ - res/cursor-select-poly.png \ - res/act-charwin.png \ - res/act-forward.png \ - res/cursor-select.png \ - res/cursor-scroll.png - /usr/bin/rcc -name ttedit ttedit.qrc -o obj/qrc_ttedit.cpp - -compiler_image_collection_make_all: obj/qmake_image_collection.cpp -compiler_image_collection_clean: - -$(DEL_FILE) obj/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: compiler_moc_header_clean compiler_rcc_clean - -####### Compile - -obj/ttedit.o: src/ttedit.cpp src/ttedit.h \ - src/mainwindow.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/ttedit.o src/ttedit.cpp - -obj/mainwindow.o: src/mainwindow.cpp src/mainwindow.h \ - src/charwindow.h \ - src/glyphpoints.h \ - src/types.h \ - src/editwindow.h \ - src/toolwindow.h \ - src/ttedit.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/mainwindow.o src/mainwindow.cpp - -obj/editwindow.o: src/editwindow.cpp src/editwindow.h \ - src/types.h \ - src/toolwindow.h \ - src/glyphpoints.h \ - src/charwindow.h \ - src/debug.h \ - src/graphicprimitives.h \ - src/mainwindow.h \ - src/ttedit.h \ - src/vector.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/editwindow.o src/editwindow.cpp - -obj/glyphpoints.o: src/glyphpoints.cpp src/glyphpoints.h \ - src/types.h \ - src/debug.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/glyphpoints.o src/glyphpoints.cpp - -obj/debug.o: src/debug.cpp src/debug.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/debug.o src/debug.cpp - -obj/toolwindow.o: src/toolwindow.cpp src/toolwindow.h \ - src/types.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/toolwindow.o src/toolwindow.cpp - -obj/charwindow.o: src/charwindow.cpp src/charwindow.h \ - src/glyphpoints.h \ - src/types.h \ - src/debug.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/charwindow.o src/charwindow.cpp - -obj/vector.o: src/vector.cpp src/vector.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/vector.o src/vector.cpp - -obj/graphicprimitives.o: src/graphicprimitives.cpp src/graphicprimitives.h \ - src/types.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/graphicprimitives.o src/graphicprimitives.cpp - -obj/moc_mainwindow.o: obj/moc_mainwindow.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_mainwindow.o obj/moc_mainwindow.cpp - -obj/moc_editwindow.o: obj/moc_editwindow.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_editwindow.o obj/moc_editwindow.cpp - -obj/moc_toolwindow.o: obj/moc_toolwindow.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_toolwindow.o obj/moc_toolwindow.cpp - -obj/moc_charwindow.o: obj/moc_charwindow.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_charwindow.o obj/moc_charwindow.cpp - -obj/qrc_ttedit.o: obj/qrc_ttedit.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/qrc_ttedit.o obj/qrc_ttedit.cpp - -####### Install - -install: FORCE - -uninstall: FORCE - -FORCE: - diff --git a/src/charwindow.h b/src/charwindow.h index cabd343..a5bfb18 100755 --- a/src/charwindow.h +++ b/src/charwindow.h @@ -8,7 +8,7 @@ #ifndef __CHARWINDOW_H__ #define __CHARWINDOW_H__ -#include +#include #include "glyphpoints.h" class CharWindow: public QWidget diff --git a/src/editwindow.cpp b/src/editwindow.cpp index ef3d585..429943d 100755 --- a/src/editwindow.cpp +++ b/src/editwindow.cpp @@ -677,3 +677,14 @@ void EditWindow::mouseReleaseEvent(QMouseEvent * event) event->accept(); } + + +void EditWindow::keyPressEvent(QKeyEvent * event) +{ +} + + +void EditWindow::keyReleaseEvent(QKeyEvent * event) +{ +} + diff --git a/src/editwindow.h b/src/editwindow.h index 98691a4..8821da4 100755 --- a/src/editwindow.h +++ b/src/editwindow.h @@ -8,7 +8,7 @@ #ifndef __EDITWINDOW_H__ #define __EDITWINDOW_H__ -#include +#include #include "types.h" #include "toolwindow.h" // For ToolType enum #include "glyphpoints.h" @@ -27,6 +27,8 @@ class EditWindow: public QWidget void mousePressEvent(QMouseEvent * event); void mouseMoveEvent(QMouseEvent * event); void mouseReleaseEvent(QMouseEvent * event); + void keyPressEvent(QKeyEvent *); + void keyReleaseEvent(QKeyEvent *); private: void CreateCursors(void); diff --git a/src/glyphpoints.h b/src/glyphpoints.h index ce82ec9..03375fa 100755 --- a/src/glyphpoints.h +++ b/src/glyphpoints.h @@ -24,6 +24,14 @@ struct IPoint bool operator==(const IPoint & p) { return (p.x == x && p.y == y ? true: false); }; }; + +struct GuideLine +{ + int32 x, y; + double angle; +}; + + // Throws the following exceptions: #define GP_OUT_OF_RANGE 1 diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0767695..25b63d1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -200,7 +200,7 @@ void MainWindow::OpenFile(void) { QString filename = QFileDialog::getOpenFileName(this, tr("Open Glyph File"), "./", tr("Glyph files (*.glyph)")); - FILE * file = fopen(filename.toAscii().data(), "r"); + FILE * file = fopen(filename.toUtf8().data(), "r"); //need to pop an error box here... if (file == 0) @@ -219,7 +219,7 @@ void MainWindow::SaveFile(void) { QString filename = QFileDialog::getSaveFileName(this, tr("Save Glyph File"), "./", tr("Glyph files (*.glyph)")); - FILE * file = fopen(filename.toAscii().data(), "w"); + FILE * file = fopen(filename.toUtf8().data(), "w"); //need to pop an error box here... if (file == 0) diff --git a/src/mainwindow.h b/src/mainwindow.h index 166a87e..80df508 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -8,7 +8,7 @@ #ifndef __MAINWINDOW_H__ #define __MAINWINDOW_H__ -#include +#include // Forward declarations diff --git a/src/toolwindow.h b/src/toolwindow.h index bb10b15..1077d67 100755 --- a/src/toolwindow.h +++ b/src/toolwindow.h @@ -8,7 +8,7 @@ #ifndef __TOOLWINDOW_H__ #define __TOOLWINDOW_H__ -#include +#include // Enumerations diff --git a/src/ttedit.h b/src/ttedit.h index 3c63025..482b6ac 100755 --- a/src/ttedit.h +++ b/src/ttedit.h @@ -8,7 +8,7 @@ #ifndef __TTEDIT_H__ #define __TTEDIT_H__ -#include +#include // Forward declarations class CharWindow; diff --git a/ttedit.pro b/ttedit.pro index 78798a3..996c9a4 100644 --- a/ttedit.pro +++ b/ttedit.pro @@ -3,6 +3,7 @@ CONFIG += qt #debug doesn't do shit (Actually, it does seem to do *something*) #CONFIG += qt debug +QT += widgets HEADERS += src/ttedit.h HEADERS += src/mainwindow.h