Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.3 (based on Qt6) #239

Merged
merged 26 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8a08d80
resolving issue #151 :)
tabhishek432 Jun 21, 2023
2aaa9fe
Making Catalogs, examples and tutorial work in web browser
tabhishek432 Jun 24, 2023
84b5dba
minor change in .pro file
tabhishek432 Jun 25, 2023
67a9c26
Resolving issue #225 of loading random examples
tabhishek432 Jul 29, 2023
338b65d
Implementing XaoS in Qt6 version
tabhishek432 Aug 27, 2023
faf7a87
Asyncify DIALOG_IFILE
kovzol Aug 30, 2023
5db7fa2
Asyncify DIALOG_OFILE
kovzol Aug 30, 2023
3f7ec07
Fix font change (thanks to Abhishek for some parts)
kovzol Sep 4, 2023
b61707b
Asyncify DIALOG_COORD, refactor
kovzol Sep 6, 2023
de0d5d6
Asyncify DIALOG_PALSLIDER
kovzol Sep 14, 2023
c36c715
Asyncify DIALOG_PALPICKER
kovzol Sep 16, 2023
1430953
Fix Mandelbrot mode and Perturbation in WASM
kovzol Sep 16, 2023
09b0365
Asyncify DIALOG_LIST, fix duplications (ignore them)
kovzol Sep 28, 2023
f55eda2
Fix dialog titles; improve dialog sizes in WASM
kovzol Sep 29, 2023
4eb3533
Asyncify DIALOG_CHOICE
kovzol Sep 29, 2023
b883abf
Remove rendering activities on WASM
kovzol Sep 29, 2023
a1962ca
Show Qt version, update copyright year
kovzol Sep 29, 2023
98f86bf
Try alternative ways to show progress information
kovzol Sep 29, 2023
16c182e
Remove File->Quit from the WASM build
kovzol Sep 29, 2023
39d5b05
Remove question about quitting in WASM
kovzol Sep 29, 2023
39c9bbd
Fix disabling Record in WASM
kovzol Sep 29, 2023
be188f4
Version bump to 4.3
kovzol Sep 29, 2023
de1e501
Merge pull request #1 from kovzol/qt6
kovzol Sep 29, 2023
6063fda
Attempt to update autobuild machinery for Qt6
kovzol Sep 29, 2023
6fdd48a
Fix qmake command
kovzol Sep 29, 2023
30bfc62
Attempt to fix Mac build
kovzol Sep 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: prerequisites
run: sudo apt update && sudo apt install build-essential qttools5-dev-tools qt5-default
run: sudo apt update && sudo apt install build-essential qttools5-dev-tools qt6-base-dev libgl1-mesa-dev
- name: qmake
run: qmake
run: qmake6
- name: make
run: make

Expand All @@ -23,7 +23,9 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: install-qt
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v3
with:
version: '6.2.4'
- name: qmake
run: qmake
- name: make
Expand Down
5 changes: 3 additions & 2 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- [Jens Kilian](mailto:[email protected]): BeOS driver, deutsch.cat
- [Thomas A. K. Kjaer](mailto:[email protected]): OS/2 ports (320x200 graphics and AA-lib)
- [Zbyněk Konečný](mailto:[email protected]): Czech translation
- [Zoltán Kovács](mailto:[email protected]): Internationalization, Hungarian translations, finalizing version 3.1, bug fixes, web design, current maintainer
- [Zoltán Kovács](mailto:[email protected]): Internationalization, Hungarian translations, finalizing version 3.1, bug fixes, web design, WebAssembly version, current maintainer
- [Zsigmond Kovács](mailto:[email protected]): Fractal examples
- [Bjarnheiður Kristinsdóttir](mailto:[email protected]): Icelandic translation
- [J.B. Langston III](mailto:[email protected]): Native Mac OS X port (from version 3.2.2); web redesign; co-maintainer
Expand All @@ -39,6 +39,7 @@
- [Ilinca Sitaru](mailto:[email protected]): Romanian translation
- Daniel Skarda: Fractal examples
- Andrew Stone ([Stone Design](www.stone.com)): Videator Support, Cocoa improvements, performance mode, bug fixes
- [Abhishek Tiwari](mailto:[email protected]): WebAssembly version, [contributions for GSoC 2023](https://github.com/tabhishek432/GSoC-2023-xaos)
- [Márton Török](mailto:[email protected]): Small fixes for pipes
- [Pavel Tzekov](mailto:[email protected]): Win32 support
- Charles Vidal: Tcl/Tk interface
Expand All @@ -54,7 +55,7 @@ XaoS uses the following libraries. These libraries may be included with some
binary distributions of XaoS.

### [Qt](https://www.qt.io/)
Copyright © 2020 The Qt Company
Copyright © 2023 The Qt Company

License GPLv2+: [GNU GPL version 2 or later](https://gnu.org/licenses/gpl.html)

Expand Down
20 changes: 20 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
RELEASE NOTES FOR XAOS VERSION 4.3
----------------------------------

New Features
============

o Migration to Qt 6.

o WebAssembly port, that is, a full-featured web version is available. Tested with Qt >= 6.5.2.

o Progress bar for time consuming operations (only on native platforms).

Bug Fixes
=========

o Example files are loaded properly even if XaoS is not installed (that is, the examples are not flattened).

o User formulas are not duplicated in the history.


RELEASE NOTES FOR XAOS VERSION 4.2.1
------------------------------------

Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ choose without the long calculation required by other fractal generators.
It has many other features too, like different fractal types, autopilot,
special coloring modes, random palette generation, color cycling, etc.

You can try the XaoS zooming algorithm online using
[XaoS.js](http://xaos-project.github.io/XaoSjs/).
XaoS (since version 4.3, September 2023) is available as a full-featured web application as well.
You can try it at its [current webpage](https://matek.hu/zoltan/xaos).
Also, you can try a simplified version of the XaoS zooming algorithm online using
[XaoS.js](https://xaos-project.github.io/XaoSjs/).

XaoS is based on [Qt](http://www.qt.io), and has been tested on Linux, Mac, and Windows. It
XaoS is based on [Qt](http://www.qt.io), and has been tested on Windows, Mac and Linux. It
should also work on any other platform supporting Qt Widgets, like the BSDs.

- Original authors: [Jan Hubička](http://www.ucw.cz/~hubicka/) and [Thomas Marsh](https://www.linkedin.com/in/thomasmarsh).
- Current maintainers: [J.B. Langston](https://www.linkedin.com/in/jblangston/) and [Zoltán Kovács](https://sites.google.com/site/kovzol/).
- Original authors: [Jan Hubička](https://www.ucw.cz/~hubicka/) and [Thomas Marsh](https://www.linkedin.com/in/thomasmarsh).
- Current maintainers: [J.B. Langston](https://www.linkedin.com/in/jblangston/) and [Zoltán Kovács](https://matek.hu/zoltan).
- See [CREDITS](CREDITS.md) for a complete list of contributors.

Project Resources
Expand Down Expand Up @@ -48,7 +50,7 @@ or implement a new feature yourself, pull requests are very welcome.
License
-------

Copyright © 1996-2020 XaoS Contributors
Copyright © 1996-2023 XaoS Contributors

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
15 changes: 13 additions & 2 deletions XaoS.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
# Project created by QtCreator 2009-10-29T19:21:55
# -------------------------------------------------

lessThan(QT_MAJOR_VERSION, 5): error("requires Qt >= 5")
lessThan(QT_MINOR_VERSION, 7): error("requires Qt >= 5.7")
lessThan(QT_MAJOR_VERSION, 6): error("requires Qt >= 6")
wasm {
lessThan(QT_MINOR_VERSION, 5): error("requires Qt >= 6.5.2")
}

TEMPLATE = app

Expand Down Expand Up @@ -49,15 +51,19 @@ isEmpty(QMAKE_LRELEASE) {
}
unix {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt5 }
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
} else {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
}
}

CONFIG += optimize_full
CONFIG += c++11

QMAKE_CXXFLAGS += -ffast-math
QMAKE_CFLAGS += -ffast-math

QMAKE_CXXFLAGS += -fpermissive
RESOURCES += XaoS.qrc

DESTDIR = $$PWD/bin
Expand All @@ -75,6 +81,11 @@ isEmpty(PREFIX) {
PREFIX = /usr/local
}
DEFINES += DATAPATH=\\\"$$PREFIX/share/XaoS\\\"
wasm{
QMAKE_LFLAGS += --preload-file $$PWD/examples@$$DATAPATH/examples
QMAKE_LFLAGS += --preload-file $$PWD/catalogs@$$DATAPATH/catalogs
QMAKE_LFLAGS += --preload-file $$PWD/tutorial@$$DATAPATH/tutorial
}
executable.files = bin/xaos
executable.path = $$PREFIX/bin
examples.path = $$PREFIX/share/XaoS/examples
Expand Down
2 changes: 1 addition & 1 deletion src/engine/fractal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void recalc_view(fractal_context *c)
number_t xs = c->s.rr, ys = c->s.ri * c->windowwidth / c->windowheight,
xc = c->s.cr, yc = c->s.ci, size;
precalculate_rotation(c);
rotate(*c, xc, yc);
my_rotate(*c, xc, yc);
/*assert(c->s.rr >= 0);
assert(c->s.ri >= 0); */

Expand Down
2 changes: 1 addition & 1 deletion src/include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define CONFIG_H

// XaoS release
#define XaoS_VERSION "4.2.1"
#define XaoS_VERSION "4.3"

// URLs
#define HELP_URL "https://github.com/xaos-project/XaoS/wiki"
Expand Down
2 changes: 1 addition & 1 deletion src/include/fractal.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ struct symmetryinfo2 {
#define BTRACEOK \
((cformula.flags & (2 << cfractalc.mandelbrot)) && \
!cfractalc.incoloringmode && cfractalc.coloringmode != 7)
#define rotate(f, x, y) \
#define my_rotate(f, x, y) \
{ \
number_t tmp; \
tmp = (x) * (f).cos - (y) * (f).sin; \
Expand Down
7 changes: 6 additions & 1 deletion src/ui-hlp/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <QTextStream>
#include <QMessageBox>
#include <QSettings>
#include <QRegularExpression>

#include "filter.h"
#include "config.h"
Expand Down Expand Up @@ -799,7 +800,7 @@ static void uih_loadgpl(struct uih_context *uih, xio_constpath d)
}

for(int i = 4; i < 35; i++) {
QStringList currcolors = colorvals[i].split(QRegExp("\\s+"));
QStringList currcolors = colorvals[i].split(QRegularExpression("\\s+"));
int r = currcolors[0].toInt();
int g = currcolors[1].toInt();
int b = currcolors[2].toInt();
Expand Down Expand Up @@ -1239,10 +1240,14 @@ void uih_registermenus_i18n(void)
MENUFLAG_INTERRUPT | MENUFLAG_NOPLAY, uih_playfile,
playdialog);
MENUSEPARATOR_I("file");

// Rendering activities in the WebAssembly version make little sense, and therefore not supported at the moment:
#ifndef __wasm
MENUDIALOG_I("file", NULL, TR("Menu", "Render"), "renderanim", UI,
uih_render, uih_renderdialog);
MENUDIALOG_I("file", NULL, TR("Menu", "Render Image"), "renderimg", UI,
uih_renderimg, uih_renderimgdialog);
#endif
MENUSEPARATOR_I("file");
MENUNOP_I("file", NULL, TR("Menu", "Load random example"), "loadexample",
MENUFLAG_INTERRUPT, uih_loadexample);
Expand Down
8 changes: 4 additions & 4 deletions src/ui-hlp/play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void uih_update_lines(uih_context *c)
case 2:
x = l->x1;
y = l->y1;
rotate(*(c->fcontext), x, y);
my_rotate(*(c->fcontext), x, y);
x = (x - c->fcontext->rs.nc) /
(c->fcontext->rs.mc - c->fcontext->rs.nc) *
c->zengine->image->width;
Expand All @@ -185,7 +185,7 @@ void uih_update_lines(uih_context *c)
c->zengine->action->convertup(c->zengine, &x1, &y1);
x = l->x2;
y = l->y2;
rotate(*(c->fcontext), x, y);
my_rotate(*(c->fcontext), x, y);
x = (x - c->fcontext->rs.nc) /
(c->fcontext->rs.mc - c->fcontext->rs.nc) *
c->zengine->image->width;
Expand Down Expand Up @@ -224,7 +224,7 @@ void uih_update_lines(uih_context *c)
default:
x = l->mx1;
y = l->my1;
rotate(*(c->fcontext), x, y);
my_rotate(*(c->fcontext), x, y);
x = (x - c->fcontext->rs.nc) /
(c->fcontext->rs.mc - c->fcontext->rs.nc) *
c->zengine->image->width;
Expand All @@ -236,7 +236,7 @@ void uih_update_lines(uih_context *c)
c->zengine->action->convertup(c->zengine, &mx1, &my1);
x = l->mx2;
y = l->my2;
rotate(*(c->fcontext), x, y);
my_rotate(*(c->fcontext), x, y);
x = (x - c->fcontext->rs.nc) /
(c->fcontext->rs.mc - c->fcontext->rs.nc) *
c->zengine->image->width;
Expand Down
10 changes: 5 additions & 5 deletions src/ui/customdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

QStringList fnames = {};

QString format(number_t number)
QString CustomDialog::format(number_t number)
{
char buf[256];
#ifdef USE_FLOAT128
Expand Down Expand Up @@ -51,13 +51,13 @@ CustomDialog::CustomDialog(struct uih_context *uih, const menuitem *item,

QLineEdit *real = new QLineEdit(format(dialog[i].deffloat), this);
QFontMetrics metric(real->font());
real->setMinimumWidth(metric.width(real->text()) * 1.1);
real->setMinimumWidth(metric.horizontalAdvance(real->text()) * 1.1);
real->setObjectName(label + "real");
// real->setValidator(new QDoubleValidator(real));

QLineEdit *imag = new QLineEdit(format(dialog[i].deffloat2), this);
imag->setObjectName(label + "imag");
imag->setMinimumWidth(metric.width(imag->text()) * 1.1);
imag->setMinimumWidth(metric.horizontalAdvance(imag->text()) * 1.1);
// imag->setValidator(new QDoubleValidator(imag));

QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight);
Expand All @@ -74,7 +74,7 @@ CustomDialog::CustomDialog(struct uih_context *uih, const menuitem *item,

QLineEdit *filename = new QLineEdit(dialog[i].defstr, this);
QFontMetrics metric(filename->font());
filename->setMinimumWidth(metric.width(filename->text()) * 1.1);
filename->setMinimumWidth(metric.horizontalAdvance(filename->text()) * 1.1);
filename->setObjectName(label);

QToolButton *chooser = new QToolButton(this);
Expand Down Expand Up @@ -250,7 +250,7 @@ CustomDialog::CustomDialog(struct uih_context *uih, const menuitem *item,
field->setText(dialog[i].defstr);
}
QFontMetrics metric(field->font());
field->setMinimumWidth(metric.width(field->text()) * 1.1);
field->setMinimumWidth(metric.horizontalAdvance(field->text()) * 1.1);
formLayout->addRow(label, field);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/ui/customdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class CustomDialog : public QDialog
const menudialog *dialog, QWidget *parent = 0);
void accept();
dialogparam *parameters();
static QString format(number_t number);
};

#endif // CUSTOMDIALOG_H
4 changes: 2 additions & 2 deletions src/ui/fractalwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FractalWidget::FractalWidget()
setAttribute(Qt::WA_OpaquePaintEvent, true);
}

QPoint FractalWidget::mousePosition() { return m_mousePosition; }
QPointF FractalWidget::mousePosition() { return m_mousePosition; }

void FractalWidget::setImage(struct image *image) { m_image = image; }

Expand Down Expand Up @@ -75,6 +75,6 @@ void FractalWidget::mouseMoveEvent(QMouseEvent *event)

void FractalWidget::wheelEvent(QWheelEvent *event)
{
m_mousePosition = event->pos();
m_mousePosition = event->position();
event->ignore();
}
4 changes: 2 additions & 2 deletions src/ui/fractalwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class FractalWidget : public QWidget
private:
struct image *m_image = NULL;
QSize m_sizeHint;
QPoint m_mousePosition = QPoint(0, 0);
QPointF m_mousePosition = QPointF(0.0, 0.0);

protected:
void mouseMoveEvent(QMouseEvent *event);
Expand All @@ -35,7 +35,7 @@ class FractalWidget : public QWidget
public:
FractalWidget();
QSize sizeHint() const;
QPoint mousePosition();
QPointF mousePosition();
void setImage(struct image *image);
};

Expand Down
6 changes: 3 additions & 3 deletions src/ui/image_qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int xtextwidth(struct image */*image*/, void *font, const char *text)
line[pos] = '\0';

QFontMetrics metrics(getFont(font));
return metrics.width(line) + 1;
return metrics.horizontalAdvance(line) + 1;
}

int xtextheight(struct image */*image*/, void *font)
Expand All @@ -75,7 +75,7 @@ int xtextheight(struct image */*image*/, void *font)
int xtextcharw(struct image */*image*/, void *font, const char c)
{
QFontMetrics metrics(getFont(font));
return metrics.width(c);
return metrics.horizontalAdvance(c);
}

// Saves image as png with xpf chunk data
Expand All @@ -98,7 +98,7 @@ const char* readpng(xio_constpath filename)
const QImage xaos_image = reader.read();
QString xpf_chunk = xaos_image.text("Metadata");
const char *xpf_data = NULL;
if(xpf_chunk != NULL or !xpf_chunk.isEmpty())
if(xpf_chunk != QString() or !xpf_chunk.isEmpty())
xpf_data = mystrdup(xpf_chunk.toStdString().c_str());
return xpf_data;
}
Expand Down
10 changes: 8 additions & 2 deletions src/ui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,12 @@ static void ui_about(struct uih_context *uih)
QSysInfo::kernelType() + " " +
// QSysInfo::kernelVersion() + " "
// QSysInfo::buildAbi() + " " +
QSysInfo::buildCpuArchitecture() +
QSysInfo::buildCpuArchitecture() + ", Qt " + QT_VERSION_STR +
")"
"<br>"
"Fast interactive real-time fractal zoomer/morpher<br><br>"
"Original Authors: Jan Hubička and Thomas Marsh<br>"
"Copyright © 1996-2020 XaoS Contributors<br>"
"Copyright © 1996-2023 XaoS Contributors<br>"
"<br>"
"This program is free software; you can redistribute it and/or modify "
"it under the terms of the GNU General Public License as published by "
Expand Down Expand Up @@ -363,12 +363,16 @@ void uih_setlanguage(uih_context *c, int l)
settings.setValue("MainWindow/language", lang2(l));
QMessageBox msgBox;
msgBox.setText(TR("Message", "XaoS must restart to change the language."));
#ifndef __wasm
msgBox.setInformativeText(TR("Message", "Do you want to quit now?"));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
#endif
int ret = msgBox.exec();
#ifndef __wasm
if (ret == QMessageBox::Yes) {
exit(0);
}
#endif
}

#ifndef Q_OS_MAC
Expand Down Expand Up @@ -477,8 +481,10 @@ static void ui_registermenus_i18n(void)
{
int no_menuitems_i18n =
ui_no_menuitems_i18n; /* This variable must be local. */
#ifndef __wasm
MENUINT_I("file", NULL, TR("Menu", "Quit"), "quit",
MENUFLAG_INTERRUPT | MENUFLAG_ATSTARTUP, ui_quit, UI);
#endif

MENUNOP_I("ui", NULL, TR("Menu", "Message Font..."), "font", UI, ui_font);
MENUNOP_I("uia", NULL, TR("Menu", "Message Font..."), "font", UI, ui_font);
Expand Down
Loading