#############################################################################
# Makefile for building: ttedit
-# Generated by qmake (2.01a) (Qt 4.8.3) on: Sat Nov 17 12:34:10 2012
+# Generated by qmake (2.01a) (Qt 4.8.3) on: Mon Nov 19 18:59:51 2012
# Project: ttedit.pro
# Template: app
# Command: /usr/bin/qmake -o Makefile ttedit.pro
compiler_rcc_clean:
-$(DEL_FILE) obj/qrc_ttedit.cpp
obj/qrc_ttedit.cpp: ttedit.qrc \
- res/cursor3.png \
+ res/cursor-zoom.png \
res/toolpal1.xpm \
- res/cursor5.png \
- res/cursor1.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/cursor6.png \
- res/cursor8.png \
- res/cursor7.png \
+ res/cursor-del-point.png \
+ res/cursor-select-poly.png \
res/act-charwin.png \
res/act-forward.png \
- res/cursor2.png \
- res/cursor9.png \
- res/cursor4.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
src/types.h \
src/editwindow.h \
src/toolwindow.h \
- src/ttedit.h \
- src/debug.h \
- res/cur1.xpm \
- res/cur2.xpm \
- res/cur3.xpm \
- res/cur4.xpm \
- res/cur5.xpm \
- res/cur6.xpm \
- res/cur7.xpm \
- res/cur8.xpm \
- res/ttedit.xpm \
- res/tool1.xpm \
- res/tool2.xpm \
- res/tool3.xpm
+ src/ttedit.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/mainwindow.o src/mainwindow.cpp
obj/editwindow.o: src/editwindow.cpp src/editwindow.h \
+++ /dev/null
-/* XPM */
-static const char *cur1_xpm[]={
-"32 32 3 1",
-". c None",
-"# c #000000",
-"a c #ffffff",
-".#..............................",
-"#a#.............................",
-"#aa#............................",
-"#aaa#...........................",
-"#aaaa#..........................",
-"#aaaaa#.........................",
-"#aaaaaa#........................",
-"#aaaaaaa#.......................",
-"#aaaaaaaa#......................",
-"#aaaaaaaaa#.....................",
-"#aaaaaaaaaa#....................",
-"#aaaaaa####.....................",
-"#aaaaaa#........................",
-"#aa##aaa#.......................",
-"#a#.#aaa#.......................",
-".#...#aaa#......................",
-".....#aaa#......................",
-"......#a#.......................",
-".......#........................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................"};
+++ /dev/null
-/* XPM */
-static const char *cur2_xpm[]={
-"32 32 3 1",
-". c None",
-"# c #000000",
-"a c #ffffff",
-".#..............................",
-"#a#.............................",
-"#aa#............................",
-"#aaa#...........................",
-"#aaaa#..........................",
-"#aaaaa#.........................",
-"#aaaaaa#........................",
-"#aaaaaaa#.......................",
-"#aaaaaaaa#......................",
-"#aaaaaaaaa#.....................",
-"#aaaaaaaaaa#....................",
-"#aaaaaa####.....................",
-"#aaaaaa#........................",
-"#aa##aaa#..#######..............",
-"#a#.#aaa#..#aaaaaa#.............",
-".#...#aaa#.#aaaaaaa#............",
-".....#aaa#.#aa###aa#............",
-"......#a#..#aa#.#aa#............",
-".......#...#aa###aa#............",
-"...........#aaaaaaa#............",
-"...........#aaaaaa#.............",
-"...........#aa####..............",
-"...........#aa#.................",
-"...........#aa#.................",
-"...........####.................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................"};
+++ /dev/null
-/* XPM */
-static const char *cur3_xpm[]={
-"32 32 3 1",
-". c None",
-"# c #000000",
-"a c #ffffff",
-"...........##...................",
-"..........#aa#..................",
-"..........#aa#..................",
-".........#aaaa#.................",
-".........#aaaa#.................",
-"........#aaaaaa#................",
-"......###a#aa#a###..............",
-"......#a###aa###a#..............",
-".....####.#aa#.####.............",
-"...##aa#..#aa#..#aa##...........",
-".##aaa####a##a####aaa##.........",
-"#aaaaaaaaa#aa#aaaaaaaaa#........",
-"#aaaaaaaaa#aa#aaaaaaaaa#........",
-".##aaa####a##a####aaa##.........",
-"...##aa#..#aa#..#aa##...........",
-".....####.#aa#.####.............",
-"......#a###aa###a#..............",
-"......###a#aa#a###..............",
-"........#aaaaaa#................",
-"........#aaaaa#.................",
-".........#aaaa#.................",
-"..........#aa#..................",
-"..........#aa#..................",
-"...........##...................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................"};
+++ /dev/null
-/* XPM */
-static const char *cur4_xpm[]={
-"32 32 3 1",
-". c None",
-"# c #000000",
-"a c #ffffff",
-"..####..........................",
-"..#aa#..........................",
-"###aa###........................",
-"#aaaaaa#........................",
-"#aaaaaa#........................",
-"###aa###........................",
-"..#aa#........###...............",
-"..####......##aaa##.............",
-"..#aa#.....#aa###aa#............",
-"..#aa#....#aa##..#aa#...........",
-".#aaaa#...#a##a#..#a#...........",
-".#aaaa#..#a##a#....#a#..........",
-"#aaaaaa#.#a#a#.....#a#..........",
-"#a#aa#a#.#a#a#.....#a#..........",
-".##aa##..#a##......#a#..........",
-"..#aa#...#a#.......#a#..........",
-"..#aa#....#a#.....#a#...........",
-"..#aa#....#aa#...#aa#...........",
-"..#aa#.....#aa###aaa#...........",
-".##aa##.....##aaa###a#..........",
-"#a#aa#a#......###...#a##........",
-"#aaaaaa#.............#aa#.......",
-".#aaaa#..............#aaa#......",
-".#aaaa#...............#aaa#.....",
-"..#aa#.................#aaa#....",
-"..#aa#..................#a#.....",
-"...##....................#......",
-"########........................",
-"#aaaaaa#........................",
-"#aaaaaa#........................",
-"########........................",
-"................................"};
+++ /dev/null
-/* XPM */
-static const char *cur5_xpm[]={
-"32 32 3 1",
-". c None",
-"# c #000000",
-"a c #ffffff",
-".#..............................",
-"#a#.............................",
-"#aa#............................",
-"#aaa#...........................",
-"#aaaa#..........................",
-"#aaaaa#.........................",
-"#aaaaaa#........................",
-"#aaaaaaa#.......................",
-"#aaaaaaaa#......................",
-"#aaaaaaaaa#...#.................",
-"#aaaaaaaaaa#.#a#................",
-"#aaaaaa####.##a##...............",
-"#aaaaaa#...#aaaaa#..............",
-"#aa##aaa#...##a##...............",
-"#a#.#aaa#....#a#................",
-".#...#aaa#...####...............",
-".....#aaa#..#aaaa#..............",
-"......#a#..#aaaaaa#.............",
-".......#...#aa##aa#.............",
-"...........#aa##aa#.............",
-"...........#aaaaaa#.............",
-"............#aaaa#..............",
-".............####...............",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................"};
+++ /dev/null
-/* XPM */
-static const char *cur6_xpm[]={
-"32 32 3 1",
-". c None",
-"# c #000000",
-"a c #ffffff",
-".#..............................",
-"#a#.............................",
-"#aa#............................",
-"#aaa#...........................",
-"#aaaa#..........................",
-"#aaaaa#......#..................",
-"#aaaaaa#....#a#.................",
-"#aaaaaaa#..##a##................",
-"#aaaaaaaa##aaaaa#...............",
-"#aaaaaaaaa###a##................",
-"#aaaaaaaaaa##a#.................",
-"#aaaaaa####..#.##...............",
-"#aaaaaa#......#aa#..............",
-"#aa##aaa#....#aaaa#.............",
-"#a#.#aaa#....#aaaa#.............",
-".#...#aaa#..#aa##aa#............",
-".....#aaa#..#aa##aa#............",
-"......#a#..#aa#..#aa#...........",
-".......#...#aa#..#aa#...........",
-"..........#aa######aa#..........",
-"..........#aaaaaaaaaa#..........",
-"...........#aaaaaaaa#...........",
-"............########............",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................"};
+++ /dev/null
-/* XPM */
-static const char *cur7_xpm[]={
-"32 32 3 1",
-". c None",
-"# c #000000",
-"a c #ffffff",
-".#..............................",
-"#a#.............................",
-"#aa#............................",
-"#aaa#...........................",
-"#aaaa#..........................",
-"#aaaaa#.........................",
-"#aaaaaa#........................",
-"#aaaaaaa#.......................",
-"#aaaaaaaa#......................",
-"#aaaaaaaaa#.....................",
-"#aaaaaaaaaa#....................",
-"#aaaaaa####.#####...............",
-"#aaaaaa#...#aaaaa#..............",
-"#aa##aaa#...#####...............",
-"#a#.#aaa#.......................",
-".#...#aaa#...####...............",
-".....#aaa#..#aaaa#..............",
-"......#a#..#aaaaaa#.............",
-".......#...#aa##aa#.............",
-"...........#aa##aa#.............",
-"...........#aaaaaa#.............",
-"............#aaaa#..............",
-".............####...............",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................"};
+++ /dev/null
-/* XPM */
-static const char *cur8_xpm[]={
-"32 32 3 1",
-". c None",
-"# c #000000",
-"a c #ffffff",
-".#..............................",
-"#a#.............................",
-"#aa#............................",
-"#aaa#...........................",
-"#aaaa#..........................",
-"#aaaaa#.........................",
-"#aaaaaa#........................",
-"#aaaaaaa#..#####................",
-"#aaaaaaaa##aaaaa#...............",
-"#aaaaaaaaa######................",
-"#aaaaaaaaaa#....................",
-"#aaaaaa####....##...............",
-"#aaaaaa#......#aa#..............",
-"#aa##aaa#....#aaaa#.............",
-"#a#.#aaa#....#aaaa#.............",
-".#...#aaa#..#aa##aa#............",
-".....#aaa#..#aa##aa#............",
-"......#a#..#aa#..#aa#...........",
-".......#...#aa#..#aa#...........",
-"..........#aa######aa#..........",
-"..........#aaaaaaaaaa#..........",
-"...........#aaaaaaaa#...........",
-"............########............",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................",
-"................................"};
+++ /dev/null
-/* XPM */
-static const char * tool1_xpm[] = {
-"16 15 3 1",
-" c None",
-". c #A0A0A0",
-"+ c #000000",
-" ",
-" ",
-" ",
-" ",
-" ++ ",
-" ++ ",
-" ++++ ",
-" ++++++++++++++ ",
-" ++++ ",
-" ++ ",
-" ++ ",
-" ",
-" ",
-" ",
-" "};
+++ /dev/null
-/* XPM */
-static const char * tool2_xpm[] = {
-"16 15 3 1",
-" c None",
-". c #C0C0C0",
-"+ c #000000",
-" ",
-" ",
-" ",
-" ",
-" ++ ",
-" ++ ",
-" ++++ ",
-" ++++++++++++++ ",
-" ++++ ",
-" ++ ",
-" ++ ",
-" ",
-" ",
-" ",
-" "};
+++ /dev/null
-/* XPM */
-static const char * tool3_xpm[] = {
-"16 15 3 1",
-" c None",
-". c #C0C0C0",
-"+ c #000000",
-"++++++++++++++++",
-"+ +",
-"+ ++++++++ +",
-"+ ++++++++++ +",
-"+ ++ ++ +",
-"+ ++ +",
-"+ +++++++++ +",
-"+ ++++++++++ +",
-"+ ++ ++ +",
-"+ ++ ++ +",
-"+ ++ +++ +",
-"+ ++++++++++ +",
-"+ ++++++ ++ +",
-"+ +",
-"++++++++++++++++"};
-
+++ /dev/null
-/* XPM */
-static const char * toolpal1_xpm[] = {
-"120 48 2 1",
-" c #000000",
-". c #FFFFFF",
-" ",
-" .................. .................. .................. .................. .................. ",
-" ",
-" . .................. . . .................. . . .................. . . .................. . . ....... ....... . ",
-" . .... ............. . . .................. . . ........ ........ . . .................. . . ...... ...... . ",
-" . .... ............ . . .................. . . ........ ........ . . ...... .......... . . .... . . .... . ",
-" . .... ........... . . .. ............... . . ....... ....... . . .... .. ........ . . ... .. .... .. ... . ",
-" . .... .......... . . .. .............. . . ....... ....... . . ... ...... ....... . . .. .. ...... .. .. . ",
-" . .... ......... . . .. ............. . . ...... . . ...... . . ... ...... ....... . . .. ............ .. . ",
-" . .... ........ . . .. ............ . . ..... .. .. ..... . . .. ........ ...... . . . ...... ...... . . ",
-" . .... ....... . . .. ... .. . . ... ... ... ... . . .. ........ ...... . . . ...... ...... . . ",
-" . .... ...... . . .. .. . . . . . . . ... ...... ....... . . . .... .... . . ",
-" . .... ..... . . .. . ... . . . . . . . ... ...... ....... . . . .... .... . . ",
-" . .... ........ . . .. ... ... . . . ... ... ... ... . . .... .. ...... . . . ...... ...... . . ",
-" . .... ........ . . .. ... . . . ..... .. .. ..... . . ...... .. ..... . . . ...... ...... . . ",
-" . .... .. ....... . . .. .. .. .. . . ...... . . ...... . . ........... .... . . .. ............ .. . ",
-" . .... ... ....... . . ...... .. ...... . . ....... ....... . . ............ ... . . .. ............ .. . ",
-" . ......... ...... . . .......... ...... . . ....... ....... . . ............. .. . . ... .......... ... . ",
-" . ......... ...... . . .......... ...... . . ........ ........ . . .............. .. . . .... ...... .... . ",
-" . .......... ....... . . .................. . . ........ ........ . . .................. . . ...... ...... . ",
-" . .................. . . .................. . . .................. . . .................. . . .................. . ",
-" ",
-" .................. .................. .................. .................. .................. ",
-" ",
-" ",
-" .................. .................. .................. .................. .................. ",
-" ",
-" . .................. . . .................. . . .................. . . .................. . . .................. . ",
-" . .................. . . .................. . . .................. . . .................. . . .................. . ",
-" . .................. . . ........ ........ . . .. .......... .. . . .. ........... .. . . .................. . ",
-" . .................. . . ....... ....... . . .. ........ .. . . ... . .. .. . . .................. . ",
-" . .................. . . ....... ....... . . ... ...... ... . . .... ... . . .................. . ",
-" . ....... ....... . . ...... .. ...... . . .... .... . . ..... ... .... . . .................. . ",
-" . ...... ...... . . ...... .. ...... . . ..... ..... . . ...... ... ..... . . .................. . ",
-" . ..... ..... . . ..... .... ..... . . ..... ..... . . ...... . ..... . . .................. . ",
-" . ..... .. ..... . . ..... .... ..... . . ..... ..... . . ...... ..... . . .................. . ",
-" . ..... .. ..... . . .... ...... .... . . ..... ..... . . ...... ..... . . .................. . ",
-" . ..... ..... . . .... ...... .... . . ..... ..... . . ...... ...... . . .................. . ",
-" . ...... ...... . . ... ........ ... . . ..... ..... . . ...... ... ..... . . .................. . ",
-" . ....... ....... . . ... ........ ... . . .... .... . . ..... .... .... . . .................. . ",
-" . .................. . . .. .......... .. . . ... ...... ... . . .... ..... ... . . .................. . ",
-" . .................. . . .. .. . . .. ........ .. . . ... . ...... .. . . .................. . ",
-" . .................. . . ... ... . . .. .......... .. . . .. ........... .. . . .................. . ",
-" . .................. . . .................. . . .................. . . .................. . . .................. . ",
-" . .................. . . .................. . . .................. . . .................. . . .................. . ",
-" ",
-" .................. .................. .................. .................. .................. ",
-" "};
void EditWindow::CreateCursors(void)
{
- int hotx[9] = { 1, 1, 11, 15, 1, 1, 1, 1, 1 };
- int hoty[9] = { 1, 1, 11, 13, 1, 1, 1, 1, 1 };
+ int hotx[10] = { 1, 1, 11, 15, 1, 1, 1, 1, 1, 1 };
+ int hoty[10] = { 1, 1, 11, 13, 1, 1, 1, 1, 1, 1 };
+ char cursorName[10][48] = { "select", "select-poly", "scroll", "zoom", "add-point",
+ "add-poly", "del-point", "del-poly", "rotate", "rotate" };
- for(int i=0; i<9; i++)
+ for(int i=0; i<10; i++)
{
QString s;
- s.sprintf(":/res/cursor%u.png", i+1);
+ s.sprintf(":/res/cursor-%s.png", cursorName[i]);
QPixmap pmTmp(s);
cur[i] = QCursor(pmTmp, hotx[i], hoty[i]);
}
double rotationAngle;
ToolWindow * toolPalette;
- QCursor cur[9];
+ QCursor cur[10];
};
#endif // __EDITWINDOW_H__
#if 0
-#include "ttedit.h"
-#include "charwindow.h"
-#include "toolwindow.h"
-#include "editwindow.h"
-#include "tte_res.h" // Resource IDs
-#ifdef DEBUG
-#include "debug.h"
-#endif
-
-// Pixmap resouces
-
-#include "res/cur1.xpm"
-#include "res/cur2.xpm"
-#include "res/cur3.xpm"
-#include "res/cur4.xpm"
-#include "res/cur5.xpm"
-#include "res/cur6.xpm"
-#include "res/cur7.xpm"
-#include "res/cur8.xpm"
-#include "res/ttedit.xpm" // *nix only, but small enough to not matter
-#include "res/tool1.xpm"
-#include "res/tool2.xpm"
-#include "res/tool3.xpm"
IMPLEMENT_APP(TTEditApp) // Run the main application loop
ToolWindow::ToolWindow(void): QWidget(NULL, Qt::Window | Qt::FramelessWindowHint),
prevTool(TOOLNone)
{
- img = QImage(":/res/toolpal1.xpm");
+// img = QImage(":/res/toolpal1.xpm");
+ img = QImage(":/res/toolpal1.png");
// Set up sizes
sizeTPBM.rx() = img.width(), sizeTPBM.ry() = img.height();
- sizeStamp.rx() = sizeTPBM.x() / 5, sizeStamp.ry() = sizeTPBM.y() / 2;
+ sizeStamp.rx() = sizeTPBM.x() / 4, sizeStamp.ry() = sizeTPBM.y() / 3;
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setVisible(false);
//need ul corner of bitmap, ul corner of dest, width/height
p.setCompositionMode(QPainter::RasterOp_NotSource);
// QPoint pt(sizeStamp.x() * (prevTool & 0x03), sizeStamp.y() * (prevTool >> 2));
- QPoint pt(sizeStamp.x() * (prevTool % 5), sizeStamp.y() * (prevTool / 5));
+ QPoint pt(sizeStamp.x() * (prevTool % 4), sizeStamp.y() * (prevTool / 4));
p.drawImage(pt.x(), pt.y(), img, pt.x(), pt.y(), sizeStamp.x(), sizeStamp.y());
}
}
ToolType newTool = TOOLNone;
// NOTE: This works because x and y are UNSIGNED
- if (x < 5 && y < 2)
- newTool = (ToolType)((y * 5) + x);
+ if (x < 4 && y < 3)
+ newTool = (ToolType)((y * 4) + x);
- // We don't have 10 yet, so fix this if the user selected the blank space
- if (newTool == 9)
+ // We don't have 11 yet, so fix this if the user selected the blank space
+ if (newTool > 9)
newTool = TOOLNone;
return newTool;
TOOLPolySelect, // Polygon selection tool
TOOLScroll, // Scroll window tool
TOOLZoom, // Zoom window tool
- TOOLRotate, // Rotate tool
TOOLAddPt, // Add point tool
TOOLAddPoly, // Polygon creation tool
TOOLDelPt, // Delete point tool
- TOOLDelPoly // Delete polygon tool
+ TOOLDelPoly, // Delete polygon tool
+ TOOLRotate, // Rotate tool
+ TOOLRotatePoly // ROtate polygon around centroid tool
};
class ToolWindow: public QWidget
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
- <file>res/cursor1.png</file>
- <file>res/cursor2.png</file>
- <file>res/cursor3.png</file>
- <file>res/cursor4.png</file>
- <file>res/cursor5.png</file>
- <file>res/cursor6.png</file>
- <file>res/cursor7.png</file>
- <file>res/cursor8.png</file>
- <file>res/cursor9.png</file>
+ <file>res/cursor-select.png</file>
+ <file>res/cursor-select-poly.png</file>
+ <file>res/cursor-scroll.png</file>
+ <file>res/cursor-zoom.png</file>
+ <file>res/cursor-add-point.png</file>
+ <file>res/cursor-add-poly.png</file>
+ <file>res/cursor-del-point.png</file>
+ <file>res/cursor-del-poly.png</file>
+ <file>res/cursor-rotate.png</file>
<file>res/act-back.png</file>
<file>res/act-forward.png</file>
<file>res/act-charwin.png</file>