//#include <qwindow.h>
*/
-#include <qpainter.h>
-#include <qprinter.h>
-#include <qpushbt.h>
-#include <qradiobt.h>
-#include <qbttngrp.h>
-#include <qapp.h>
+#include <QtGui/QPainter>
+#include <QtGui/QPrinter>
+#include <QtGui/QPushButton>
+#include <QtGui/QRadioButton>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QApplication>
+#include <QtGui/QMainWindow>
#include <math.h>
-#include <qpixmap.h>
-#include <qscrbar.h>
-#include <qcolor.h>
+#include <QtGui/QPixmap>
+#include <QtGui/QScrollBar>
+#include <QtGui/QColor>
#include <stdio.h>
-#include <qfont.h>
-#include <qfontmet.h>
-#include <qlist.h>
+#include <QtGui/QFont>
+#include <QtGui/QFontMetrics>
+#include <QtCore/QList>
#include <fcntl.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include "comm.h"
#include "socu.h"
#include <unistd.h>
-#include <qsocknot.h>
-#include <qobject.h>
+#include <QtCore/QSocketNotifier>
+#include <QtCore/QObject>
#include <errno.h>
-#include <qqueue.h>
-#include <qmsgbox.h>
-#include <qmenubar.h>
-#include <qpopmenu.h>
-#include <qkeycode.h>
+#include <QtCore/QQueue>
+#include <QtGui/QMessageBox>
+#include <QtGui/QMenuBar>
+// #include <qpopmenu.h>
+#include <QtCore/qnamespace.h>
#define MAXWIDTH 640
#define MAXHEIGHT 480
};
};
-class VGR : public QFrame {
+class VGR : public QMainWindow {
Q_OBJECT
public:
VGR(char*);
* Construct the DrawView with buttons.
*/
VGR::VGR(char *sockname)
- :QFrame()
+ :QMainWindow()
{
QPixmap mp;
struct sockaddr_un svr;
MakeColors();
setCaption("graphic resource");
- setBackgroundColor(white);
+// setBackgroundColor(white);
canvas = new QPixmap(640, 480);
canvas->fill(backgroundColor());
setMaximumSize(MAXWIDTH + 16, MAXHEIGHT + 16);
setUpdatesEnabled(FALSE);
-};
+}
VGR::~VGR()
{
*pom=ev->ascii();
if (*pom==0) {
switch(ev->key()) {
- case Key_F1:
+ case Qt::Key_F1:
*pom = -10;
break;
- case Key_F2:
+ case Qt::Key_F2:
*pom = -11;
break;
- case Key_F3:
+ case Qt::Key_F3:
*pom = -12;
break;
- case Key_F4:
+ case Qt::Key_F4:
*pom = -13;
break;
- case Key_F5:
+ case Qt::Key_F5:
*pom = -14;
break;
- case Key_F6:
+ case Qt::Key_F6:
*pom = -15;
break;
- case Key_F7:
+ case Qt::Key_F7:
*pom = -16;
break;
- case Key_F8:
+ case Qt::Key_F8:
*pom = -17;
break;
- case Key_F9:
+ case Qt::Key_F9:
*pom = -18;
break;
- case Key_F10:
+ case Qt::Key_F10:
*pom = -19;
break;
- case Key_Insert:
+ case Qt::Key_Insert:
*pom = -20;
break;
- case Key_Home:
+ case Qt::Key_Home:
*pom = -21;
break;
- case Key_End:
+ case Qt::Key_End:
*pom = -22;
break;
- case Key_PageUp:
+ case Qt::Key_PageUp:
*pom = -23;
break;
- case Key_PageDown:
+ case Qt::Key_PageDown:
*pom = -24;
break;
- case Key_Left:
+ case Qt::Key_Left:
*pom = -25;
break;
- case Key_Right:
+ case Qt::Key_Right:
*pom = -26;
break;
- case Key_Up:
+ case Qt::Key_Up:
*pom = -27;
break;
- case Key_Down:
+ case Qt::Key_Down:
*pom = -28;
break;
}/* switch */
p.begin(canvas);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(x, y + fm.height(), s, strlen(s));
p.end();
p.begin(this);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(x - ox, y - oy + fm.height(), s, strlen(s));
p.end();
p.begin(canvas);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(x , y + fm.height(), s, strlen(s));
p.end();
p.begin(this);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(x - ox, y - oy + fm.height(), s, strlen(s));
p.end();
p.begin(canvas);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(x, y + fm.height(), s, strlen(s));
p.end();
p.begin(this);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(x - ox, y - oy + fm.height(), s, strlen(s));
p.end();
p.begin(canvas);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(tx * fm.maxWidth(), (ty + 1) * fm.height(), s, strlen(s));
p.end();
p.begin(this);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(tx * fm.maxWidth() - ox, (ty + 1) * fm.height() - oy, s,
strlen(s));
p.begin(canvas);
p.setPen(*lcolors[gfcol]);
p.setBackgroundColor(*lcolors[gbcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(gx, gy + fm.height(), s, strlen(s));
p.end();
p.begin(this);
p.setPen(*lcolors[gfcol]);
p.setBackgroundColor(*lcolors[gbcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(gx - ox, gy - oy + fm.height(), s, strlen(s));
p.end();
p.begin(canvas);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(tx * fm.maxWidth(), (ty + 1) * fm.height(), s,
strlen(s));
p.begin(this);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(tx * fm.maxWidth() - ox, (ty + 1) * fm.height() - oy,
s, strlen(s));
p.begin(canvas);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(tx * fm.maxWidth(), (ty + 1) * fm.height(), s, strlen(s));
p.end();
p.begin(this);
p.setPen(*lcolors[fcol]);
p.setBackgroundColor(*lcolors[bcol]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(tx * fm.maxWidth() - ox, (ty + 1) * fm.height() - oy, s,
strlen(s));
p.begin(canvas);
p.setPen(*lcolors[f]);
p.setBackgroundColor(*lcolors[b]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setFont(*prv_font);
p.drawText(x, y + fm.height(), s, strlen(s));
p.end();
p.setPen(*lcolors[f]);
p.setFont(*prv_font);
p.setBackgroundColor(*lcolors[b]);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.drawText(x - ox, y - oy + fm.height(), s, strlen(s));
p.end();
{
QApplication app(argc, argv);
VGR gs(argv[1]);
- app.setMainWidget(&gs);
+// app.setMainWidget(&gs);
gs.show();
return app.exec();
}