aboutsummaryrefslogtreecommitdiffstats
path: root/astro/xglobe/files
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2011-01-20 20:26:11 +0800
committerpav <pav@FreeBSD.org>2011-01-20 20:26:11 +0800
commitd27cc7d070a4d0504a4fbb045c35654db5b76de7 (patch)
tree53b329812a1ea3b471f9dd4dfab83f28d82c37b0 /astro/xglobe/files
parentdceb36ed70e6f10c00d094f6b1bbf5ef43cff9a1 (diff)
downloadfreebsd-ports-gnome-d27cc7d070a4d0504a4fbb045c35654db5b76de7.tar.gz
freebsd-ports-gnome-d27cc7d070a4d0504a4fbb045c35654db5b76de7.tar.zst
freebsd-ports-gnome-d27cc7d070a4d0504a4fbb045c35654db5b76de7.zip
- Migrate to qt4
PR: ports/154148 Submitted by: G. Paul Ziemba <p-fbsd-bugs@ziemba.us> Feature safe: yes
Diffstat (limited to 'astro/xglobe/files')
-rw-r--r--astro/xglobe/files/patch-Makefile (renamed from astro/xglobe/files/patch-aa)20
-rw-r--r--astro/xglobe/files/patch-desktopwidget.cpp32
-rw-r--r--astro/xglobe/files/patch-desktopwidget.h11
-rw-r--r--astro/xglobe/files/patch-earthapp.cpp77
-rw-r--r--astro/xglobe/files/patch-earthapp.h11
-rw-r--r--astro/xglobe/files/patch-main.cpp19
-rw-r--r--astro/xglobe/files/patch-marker.xpm9
-rw-r--r--astro/xglobe/files/patch-markerlist.cpp25
-rw-r--r--astro/xglobe/files/patch-markerlist.h36
-rw-r--r--astro/xglobe/files/patch-random32
-rw-r--r--astro/xglobe/files/patch-renderer.cpp111
-rw-r--r--astro/xglobe/files/patch-sunpos.cpp11
12 files changed, 345 insertions, 49 deletions
diff --git a/astro/xglobe/files/patch-aa b/astro/xglobe/files/patch-Makefile
index 38d72353b486..b3bca761963c 100644
--- a/astro/xglobe/files/patch-aa
+++ b/astro/xglobe/files/patch-Makefile
@@ -1,6 +1,6 @@
---- Makefile.orig Mon Jul 19 14:56:27 1999
-+++ Makefile Sat Jan 25 14:51:03 2003
-@@ -4,29 +4,30 @@
+--- Makefile.orig 1999-07-19 05:56:27.000000000 -0700
++++ Makefile 2011-01-19 09:39:21.000000000 -0800
+@@ -4,43 +4,44 @@
####### Installation directory
@@ -15,11 +15,11 @@
-X11_INCLUDE_DIR = /usr/X11R6/include
-QT_INCLUDE_DIR = $(QTDIR)/include
+X11_INCLUDE_DIR = $(LOCALBASE)/include
-+QT_INCLUDE_DIR = $(QT_PREFIX)/include/
++QT_INCLUDE_DIR = $(QT_PREFIX)/include/qt4
-QT_LIB_DIR = $(QTDIR)/lib
-X11_LIB_DIR = /usr/X11R6/lib
-+QT_LIB_DIR = $(QT_PREFIX)/lib
++QT_LIB_DIR = $(QT_PREFIX)/lib/qt4
+X11_LIB_DIR = $(LOCALBASE)/lib
@@ -27,25 +27,27 @@
-CPP = g++
-LINK = g++
+-MOC = moc
+CXX ?= c++
+CPP = ${CXX}
+LINK = ${CXX}
- MOC = moc
++MOC = moc-qt4
INSTALL = install
####### compile and link options
-CFLAGS = $(INCLUDE_DIRS) -DXGLOBE_LIB_DIR=\"$(XGLOBE_LIB_DIR)\" $(WITH_QIMGIO) -O2 -Wall
-+CFLAGS += $(INCLUDE_DIRS) -DXGLOBE_LIB_DIR=\"$(XGLOBE_LIB_DIR)\" $(WITH_QIMGIO)
++CFLAGS += -DQT3_SUPPORT $(INCLUDE_DIRS) -DXGLOBE_LIB_DIR=\"$(XGLOBE_LIB_DIR)\" $(WITH_QIMGIO)
LFLAGS =
-@@ -34,13 +35,13 @@
+-INCLUDE_DIRS = -I$(QT_INCLUDE_DIR) -I$(X11_INCLUDE_DIR)
++INCLUDE_DIRS = -I$(QT_INCLUDE_DIR) -I$(QT_INCLUDE_DIR)/Qt -I$(QT_INCLUDE_DIR)/QtGui -I$(X11_INCLUDE_DIR)
LIB_DIRS = -L$(QT_LIB_DIR) -L$(X11_LIB_DIR)
-LIBS = -lX11 -lqt -lm
-+LIBS = -lX11 -lqt-mt -lm ${PTHREAD_LIBS}
++LIBS = -lX11 -lQt3Support -lQtGui -lm ${PTHREAD_LIBS}
# If you want to use the QImageIO lib (to support jpg and png maps) use the
# next two lines and comment the one above
#WITH_QIMGIO = -DWITH_QIMAGEIO
diff --git a/astro/xglobe/files/patch-desktopwidget.cpp b/astro/xglobe/files/patch-desktopwidget.cpp
index b08ea53549fa..9ef3e1498445 100644
--- a/astro/xglobe/files/patch-desktopwidget.cpp
+++ b/astro/xglobe/files/patch-desktopwidget.cpp
@@ -1,10 +1,36 @@
---- desktopwidget.cpp.orig Sun Jan 26 09:35:35 2003
-+++ desktopwidget.cpp Sun Jan 26 09:38:52 2003
-@@ -18,6 +18,7 @@
+--- desktopwidget.cpp.orig 1998-12-09 10:15:52.000000000 -0800
++++ desktopwidget.cpp 2011-01-18 22:40:26.000000000 -0800
+@@ -18,10 +18,14 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include "desktopwidget.h"
++//Added by qt3to4:
++#include <QPaintEvent>
++#include <QPixmap>
DesktopWidget::DesktopWidget(QWidget *parent, const char *name)
+- : QWidget( parent, name, WType_Desktop | WPaintDesktop)
++ : QWidget( parent, name, Qt::WType_Desktop | Qt::WPaintDesktop)
+ {
+ haveImage = FALSE;
+ currentImage = new QPixmap(width(), height());
+@@ -43,6 +47,7 @@
+ {
+ QPainter p(this);
+
++ printf("DesktopWidget::paintEvent\n");
+ if(!haveImage)
+ {
+ p.setFont(QFont("helvetica", 35));
+@@ -62,7 +67,8 @@
+
+ void DesktopWidget::updateDisplay(QImage *image)
+ {
+- ASSERT(image != NULL);
++ fprintf(stderr, "updateDisplay called\n");
++ Q_ASSERT(image != NULL);
+ currentImage->convertFromImage(*image);
+ haveImage = TRUE;
+ setBackgroundPixmap(*currentImage);
diff --git a/astro/xglobe/files/patch-desktopwidget.h b/astro/xglobe/files/patch-desktopwidget.h
new file mode 100644
index 000000000000..1824d35063a0
--- /dev/null
+++ b/astro/xglobe/files/patch-desktopwidget.h
@@ -0,0 +1,11 @@
+--- desktopwidget.h.orig 1998-12-09 10:16:54.000000000 -0800
++++ desktopwidget.h 2011-01-18 14:22:52.000000000 -0800
+@@ -23,6 +23,8 @@
+ #include <qwidget.h>
+ #include <qpixmap.h>
+ #include <qpainter.h>
++//Added by qt3to4:
++#include <QPaintEvent>
+
+ class DesktopWidget : public QWidget
+ {
diff --git a/astro/xglobe/files/patch-earthapp.cpp b/astro/xglobe/files/patch-earthapp.cpp
new file mode 100644
index 000000000000..76941cf6958e
--- /dev/null
+++ b/astro/xglobe/files/patch-earthapp.cpp
@@ -0,0 +1,77 @@
+--- earthapp.cpp.orig 1999-12-06 08:14:10.000000000 -0800
++++ earthapp.cpp 2011-01-19 09:28:15.000000000 -0800
+@@ -69,6 +69,12 @@
+ #include "config.h"
+ #include "earthapp.h"
+ #include "moonpos.h"
++//Added by qt3to4:
++#include <QPixmap>
++#include <QPalette>
++#include <QX11Info>
++
++#include <X11/Xlib.h>
+
+ /* ------------------------------------------------------------------------*/
+
+@@ -334,7 +340,7 @@
+ if(use_kde)
+ {
+ dwidget = new DesktopWidget();
+- ASSERT(dwidget != NULL);
++ Q_ASSERT(dwidget != NULL);
+ dwidget->update();
+ }
+ }
+@@ -343,9 +349,9 @@
+
+ EarthApplication::~EarthApplication(void)
+ {
+- ASSERT(r != NULL);
++ Q_ASSERT(r != NULL);
+ delete r;
+- ASSERT(timer != NULL);
++ Q_ASSERT(timer != NULL);
+ timer->stop();
+ delete timer;
+
+@@ -937,8 +943,8 @@
+
+ void EarthApplication::randomPosition()
+ {
+- view_lat = ((rand()%30001)/30000.)*180. - 90.;
+- view_long = ((rand()%30001)/30000.)*360. - 180.;
++ view_lat = ((random()%30001)/30000.)*180. - 90.;
++ view_long = ((random()%30001)/30000.)*360. - 180.;
+ }
+
+ /* ------------------------------------------------------------------------*/
+@@ -1233,7 +1239,7 @@
+ r->setRotation(rotation);
+
+ timer = new QTimer(this);
+- ASSERT(timer != NULL);
++ Q_ASSERT(timer != NULL);
+
+ connect(timer, SIGNAL(timeout()), this, SLOT(recalc()));
+ QTimer::singleShot(1, this, SLOT(recalc())); // this will start rendering
+@@ -1307,7 +1313,19 @@
+ {
+ QPixmap pm;
+ pm.convertFromImage(*(r->getImage()));
+- desktop()->setBackgroundPixmap(pm);
++
++
++ QPalette palette;
++ palette.setBrush(desktop()->backgroundRole(), QBrush(pm));
++ desktop()->setPalette(palette);
++
++ //
++ // With Qt4, this step seems to be necessary to make the
++ // changes appear immediately. Is there a way to do it via
++ // Qt4 methods?
++ //
++ XClearWindow(QX11Info::display(), QX11Info::appRootWindow());
++
+ if(once)
+ {
+ processEvents();
diff --git a/astro/xglobe/files/patch-earthapp.h b/astro/xglobe/files/patch-earthapp.h
new file mode 100644
index 000000000000..ad7ba6e0662a
--- /dev/null
+++ b/astro/xglobe/files/patch-earthapp.h
@@ -0,0 +1,11 @@
+--- earthapp.h.orig 1999-12-06 08:14:23.000000000 -0800
++++ earthapp.h 2011-01-18 14:22:52.000000000 -0800
+@@ -54,6 +54,8 @@
+ #define _EARTHAPP_H
+
+ #include <qapplication.h>
++#include <QApplication>
++#include <QDesktopWidget>
+ #include <qtimer.h>
+ #include <qsize.h>
+ #include <qstring.h>
diff --git a/astro/xglobe/files/patch-main.cpp b/astro/xglobe/files/patch-main.cpp
new file mode 100644
index 000000000000..505b961f3df7
--- /dev/null
+++ b/astro/xglobe/files/patch-main.cpp
@@ -0,0 +1,19 @@
+--- main.cpp.orig 1999-07-13 10:32:55.000000000 -0700
++++ main.cpp 2011-01-18 14:22:52.000000000 -0800
+@@ -24,6 +24,7 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <qstring.h>
+ #include "config.h"
+@@ -37,6 +38,8 @@
+ {
+ EarthApplication myApp(argc, argv);
+
++ srandomdev();
++
+ #ifdef WITH_QIMAGEIO
+ qInitImageIO();
+ #endif
diff --git a/astro/xglobe/files/patch-marker.xpm b/astro/xglobe/files/patch-marker.xpm
new file mode 100644
index 000000000000..4cfec031a041
--- /dev/null
+++ b/astro/xglobe/files/patch-marker.xpm
@@ -0,0 +1,9 @@
+--- marker.xpm.orig 1998-11-20 09:16:30.000000000 -0800
++++ marker.xpm 2011-01-19 09:32:52.000000000 -0800
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * marker_xpm[] = {
++static const char * marker_xpm[] = {
+ "7 7 3 1",
+ " c None",
+ ". c #000000",
diff --git a/astro/xglobe/files/patch-markerlist.cpp b/astro/xglobe/files/patch-markerlist.cpp
new file mode 100644
index 000000000000..16e6d3e45e02
--- /dev/null
+++ b/astro/xglobe/files/patch-markerlist.cpp
@@ -0,0 +1,25 @@
+--- markerlist.cpp.orig 1999-07-13 11:13:41.000000000 -0700
++++ markerlist.cpp 2011-01-18 14:22:52.000000000 -0800
+@@ -28,7 +28,7 @@
+
+ #include "markerlist.h"
+ #include <qfile.h>
+-#include <qtextstream.h>
++#include <q3textstream.h>
+
+ /* ------------------------------------------------------------------------ */
+
+@@ -94,11 +94,11 @@
+ int pos1;
+ int pos2;
+ QFile f(filename);
+- QTextStream t(&f);
++ Q3TextStream t(&f);
+ QString line;
+ QColor color;
+
+- if(!f.open(IO_ReadOnly))
++ if(!f.open(QIODevice::ReadOnly))
+ return FALSE;
+
+ while(!t.eof())
diff --git a/astro/xglobe/files/patch-markerlist.h b/astro/xglobe/files/patch-markerlist.h
new file mode 100644
index 000000000000..82cb67d79370
--- /dev/null
+++ b/astro/xglobe/files/patch-markerlist.h
@@ -0,0 +1,36 @@
+--- markerlist.h.orig 1999-07-13 11:14:07.000000000 -0700
++++ markerlist.h 2011-01-18 14:22:52.000000000 -0800
+@@ -56,21 +56,23 @@
+ class MarkerList
+ {
+ public:
+- MarkerList() { list.setAutoDelete(TRUE); }
+- ~MarkerList() { list.clear(); }
+- inline void append(const Location *l) { list.append(l); }
+- inline Location *first() { return list.first(); }
+- inline Location *last() { return list.last(); }
+- inline Location *next() { return list.next(); }
+- inline Location *prev() { return list.prev(); }
+- inline Location *current() { return list.current(); }
++ MarkerList() { }
++ ~MarkerList() { qDeleteAll(list); list.clear(); }
++ inline void append(Location *l) { list.append(l); }
++// inline Location *first() { return list.first(); }
++// inline Location *last() { return list.last(); }
++// inline Location *next() { return list.next(); }
++// inline Location *prev() { return list.prev(); }
++// inline Location *current() { return list.current(); }
++ inline Location *atindex(int i) {return list[i]; } // Q&D
+ inline uint count() { return list.count(); }
+- inline void clear() { list.clear(); }
++ inline void clear() { qDeleteAll(list); list.clear(); }
++ inline int size() { return list.size(); }
+
+ bool loadMarkerFile(const char *filename);
+
+ protected:
+- QList<Location> list;
++ QList<Location *> list;
+ };
+
+ #endif
diff --git a/astro/xglobe/files/patch-random b/astro/xglobe/files/patch-random
deleted file mode 100644
index 563286db5d4c..000000000000
--- a/astro/xglobe/files/patch-random
+++ /dev/null
@@ -1,32 +0,0 @@
---- earthapp.cpp.orig Sat Feb 24 10:13:10 2001
-+++ earthapp.cpp Sat Feb 24 10:13:29 2001
-@@ -937,8 +937,8 @@
-
- void EarthApplication::randomPosition()
- {
-- view_lat = ((rand()%30001)/30000.)*180. - 90.;
-- view_long = ((rand()%30001)/30000.)*360. - 180.;
-+ view_lat = ((random()%30001)/30000.)*180. - 90.;
-+ view_long = ((random()%30001)/30000.)*360. - 180.;
- }
-
- /* ------------------------------------------------------------------------*/
---- main.cpp.orig Tue Jul 13 10:32:55 1999
-+++ main.cpp Sat Feb 24 10:14:56 2001
-@@ -24,6 +24,7 @@
- */
-
- #include <stdio.h>
-+#include <stdlib.h>
- #include <string.h>
- #include <qstring.h>
- #include "config.h"
-@@ -36,6 +37,8 @@
- int main(int argc, char **argv)
- {
- EarthApplication myApp(argc, argv);
-+
-+ srandomdev();
-
- #ifdef WITH_QIMAGEIO
- qInitImageIO();
diff --git a/astro/xglobe/files/patch-renderer.cpp b/astro/xglobe/files/patch-renderer.cpp
index de20cc228a18..49e57136982f 100644
--- a/astro/xglobe/files/patch-renderer.cpp
+++ b/astro/xglobe/files/patch-renderer.cpp
@@ -1,6 +1,87 @@
---- renderer.cpp.orig Tue Dec 7 03:13:35 1999
-+++ renderer.cpp Wed Jan 4 23:17:40 2006
-@@ -1434,7 +1434,7 @@
+--- renderer.cpp.orig 1999-12-06 08:13:35.000000000 -0800
++++ renderer.cpp 2011-01-18 14:22:52.000000000 -0800
+@@ -123,7 +123,7 @@
+ this->ambientGreen = 0.15;
+ this->ambientBlue = 0.15;
+ this->markerpixmap = new QPixmap((const char **)marker_xpm);
+- ASSERT(markerpixmap != NULL);
++ Q_ASSERT(markerpixmap != NULL);
+ this->show_label = TRUE;
+ this->gridtype = NO_GRID;
+ this->d_gridline = 15.0*PI/180.;
+@@ -448,7 +448,7 @@
+
+ void Renderer::setMarkerList(MarkerList *l)
+ {
+- ASSERT(l != NULL);
++ Q_ASSERT(l != NULL);
+ markerlist = l;
+ }
+
+@@ -1136,7 +1136,7 @@
+ Location **visible_locations;
+
+ visible_locations = new Location*[markerlist->count()];
+- ASSERT(visible_locations != NULL);
++ Q_ASSERT(visible_locations != NULL);
+
+ // Matrix M of renderFrame, but transposed
+ m11 = cos(rot)*cos(view_long)-sin(view_lat)*sin(view_long)*sin(rot);
+@@ -1151,8 +1151,9 @@
+
+ visible_angle = radius/center_dist;
+
+- for(i=0, l = markerlist->first(); l != NULL; l = markerlist->next())
++ for(i=0, num=0; i < markerlist->size(); ++i)
+ {
++ l = markerlist->atindex(i);
+ lon = l->getLongitude()*PI/180.;
+ lat = l->getLatitude()*PI/180.;
+
+@@ -1185,12 +1186,9 @@
+ l->x = screen_x + shift_x;
+ l->y = screen_y + shift_y;
+
+- visible_locations[i] = l;
+- i++;
++ visible_locations[num++] = l;
+ }
+
+- num = i;
+-
+ // sort the markers according to depth
+ qsort(visible_locations, num, sizeof(Location *),
+ Renderer::compareLocations);
+@@ -1208,8 +1206,8 @@
+ {
+ double c1, c2;
+
+- c1 = (*((Location **)l1))->cos_angle;
+- c2 = (*((Location **)l2))->cos_angle;
++ c1 = ((Location *)l1)->cos_angle;
++ c2 = ((Location *)l2)->cos_angle;
+
+ if(c1 > c2)
+ return 1;
+@@ -1364,7 +1362,7 @@
+ QImage *clonedImage = NULL;
+
+ clonedImage = new QImage(*renderedImage);
+- ASSERT(clonedImage != NULL);
++ Q_ASSERT(clonedImage != NULL);
+ return clonedImage;
+ }
+
+@@ -1391,7 +1389,7 @@
+ #if QT_VERSION >= 200
+ p.setPen(Qt::black);
+ #else
+- p.setPen(black);
++ p.setPen(Qt::black);
+ #endif
+ wx = -br.x()+markerpixmap->width()+2;
+ wy = -br.y();
+@@ -1434,7 +1432,7 @@
for(wx=0 ; wx<visiblerect.width(); wx++)
{
@@ -9,7 +90,7 @@
{
case 0x00000000:
*dest++ = 0;
-@@ -1483,8 +1483,8 @@
+@@ -1483,8 +1481,8 @@
labelstring.sprintf("%s, %s %d. %d, %d:%02d %s\n"
"View pos %2.2f° %c %2.2f° %c\n"
"Sun pos %2.2f° %c %2.2f° %c",
@@ -20,7 +101,27 @@
dt.date().day(), dt.date().year(),
dt.time().hour(), dt.time().minute(),
tzname[tm->tm_isdst],
-@@ -1562,9 +1562,9 @@
+@@ -1499,7 +1497,7 @@
+ QRect br = fm.boundingRect(0, 0, 0, 0, Qt::AlignLeft|Qt::AlignTop,
+ labelstring);
+ #else
+- QRect br = fm.boundingRect(0, 0, 0, 0, AlignLeft|AlignTop, labelstring);
++ QRect br = fm.boundingRect(0, 0, 0, 0, Qt::AlignLeft|Qt::AlignTop, labelstring);
+ #endif
+ QPixmap pm(br.width()+10, br.height()+10);
+
+@@ -1512,8 +1510,8 @@
+ p.drawText(5, 5, br.width(), br.height(), Qt::AlignLeft|Qt::AlignTop,
+ labelstring);
+ #else
+- p.setPen(white);
+- p.drawText(5, 5, br.width(), br.height(), AlignLeft|AlignTop, labelstring);
++ p.setPen(Qt::white);
++ p.drawText(5, 5, br.width(), br.height(), Qt::AlignLeft|Qt::AlignTop, labelstring);
+ #endif
+ p.end();
+
+@@ -1562,9 +1560,9 @@
for(int i=0; i<numstars; i++)
{
diff --git a/astro/xglobe/files/patch-sunpos.cpp b/astro/xglobe/files/patch-sunpos.cpp
new file mode 100644
index 000000000000..f63f28e08013
--- /dev/null
+++ b/astro/xglobe/files/patch-sunpos.cpp
@@ -0,0 +1,11 @@
+--- sunpos.cpp.orig 1998-12-09 10:51:09.000000000 -0800
++++ sunpos.cpp 2011-01-18 14:22:52.000000000 -0800
+@@ -203,7 +203,7 @@
+ double JD;
+
+ /* lazy test to ensure gregorian calendar */
+- ASSERT(y >= 1583);
++ Q_ASSERT(y >= 1583);
+
+ if ((m == 1) || (m == 2))
+ {