[Revert] Omega App

This commit is contained in:
Quentin
2020-06-20 19:31:42 +02:00
parent 710e4cf56b
commit 1b76a48ae2
21 changed files with 2 additions and 518 deletions

View File

@@ -1,24 +0,0 @@
apps += Omega::App
app_headers += apps/omega/app.h
apps_src += $(addprefix apps/omega/,\
app.cpp \
omega_controller.cpp \
omega_view.cpp \
contributors_controller.cpp \
contributors_view.cpp \
)
app_images += apps/omega/omega_icon.png
i18n_files += $(addprefix apps/omega/,\
base.de.i18n\
base.en.i18n\
base.es.i18n\
base.fr.i18n\
base.pt.i18n\
base.hu.i18n\
base.universal.i18n\
)
$(eval $(call depends_on_image,apps/omega/app.cpp,apps/omega/omega_icon.png))

View File

@@ -1,43 +0,0 @@
#include "app.h"
#include "apps/apps_container.h"
#include "omega_icon.h"
#include "apps/i18n.h"
#include <assert.h>
namespace Omega {
I18n::Message App::Descriptor::name() {
return I18n::Message::OmegaApp;
}
I18n::Message App::Descriptor::upperName() {
return I18n::Message::OmegaAppCapital;
}
const Image * App::Descriptor::icon() {
return ImageStore::OmegaIcon;
}
App::Snapshot::Snapshot()
{
}
App * App::Snapshot::unpack(Container * container) {
return new App(this);
}
App::Descriptor * App::Snapshot::descriptor() {
static Descriptor descriptor;
return &descriptor;
}
void App::Snapshot::reset() {
}
App::App(Snapshot * snapshot) :
::App(snapshot, &m_omegaController),
m_omegaController(this)
{
}
}

View File

@@ -1,31 +0,0 @@
#ifndef OMEGA_APP_H
#define OMEGA_APP_H
#include <escher.h>
#include "omega_controller.h"
namespace Omega {
class App : public ::App {
public:
class Descriptor : public ::App::Descriptor {
public:
I18n::Message name() override;
I18n::Message upperName() override;
const Image * icon() override;
};
class Snapshot : public ::App::Snapshot {
public:
Snapshot();
App * unpack(Container * container) override;
void reset() override;
Descriptor * descriptor() override;
};
private:
App(Snapshot * snapshot);
OmegaController m_omegaController;
};
}
#endif

View File

@@ -1,4 +0,0 @@
OmegaApp = "Omega"
OmegaAppCapital = "OMEGA"
OmegaContributors = "Beiträger"
OmegaVersion = "Version"

View File

@@ -1,4 +0,0 @@
OmegaApp = "Omega"
OmegaAppCapital = "OMEGA"
OmegaContributors = "Contributors"
OmegaVersion = "Version"

View File

@@ -1,4 +0,0 @@
OmegaApp = "Omega"
OmegaAppCapital = "OMEGA"
OmegaContributors = "Contribuyentes"
OmegaVersion = "Versión"

View File

@@ -1,4 +0,0 @@
OmegaApp = "Omega"
OmegaAppCapital = "OMEGA"
OmegaContributors = "Contributeurs"
OmegaVersion = "Version"

View File

@@ -1,4 +0,0 @@
OmegaApp = "Omega"
OmegaAppCapital = "OMEGA"
OmegaContributors = "Közremüködök"
OmegaVersion = "Verzió"

View File

@@ -1,4 +0,0 @@
OmegaApp = "Omega"
OmegaAppCapital = "OMEGA"
OmegaContributors = "Contribuidores"
OmegaVersion = "Versão"

View File

@@ -1,2 +0,0 @@
OmegaURL = "getomega.web.app"
OmegaDiscord = "discord.gg/X2TWhh9"

View File

@@ -1,110 +0,0 @@
#include "contributors_controller.h"
#include <assert.h>
#include "apps/i18n.h"
// using namespace Shared;
namespace Omega {
// constexpr SettingsMessageTree s_contributorsChildren[17] = {
// SettingsMessageTree(I18n::Message::Developers),
// SettingsMessageTree(I18n::Message::QuentinGuidee),
// SettingsMessageTree(I18n::Message::SandraSimmons),
// SettingsMessageTree(I18n::Message::JoachimLeFournis),
// SettingsMessageTree(I18n::Message::JeanBaptisteBoric),
// SettingsMessageTree(I18n::Message::MaximeFriess),
// SettingsMessageTree(I18n::Message::David),
// SettingsMessageTree(I18n::Message::DamienNicolet),
// SettingsMessageTree(I18n::Message::EvannDreumont),
// SettingsMessageTree(I18n::Message::SzaboLevente),
// SettingsMessageTree(I18n::Message::VenceslasDuet),
// SettingsMessageTree(I18n::Message::CharlotteThomas),
// SettingsMessageTree(I18n::Message::BetaTesters),
// SettingsMessageTree(I18n::Message::CyprienMejat),
// SettingsMessageTree(I18n::Message::TimeoArnouts),
// SettingsMessageTree(I18n::Message::LouisC),
// SettingsMessageTree(I18n::Message::LelahelHideux)
// };
ContributorsController::ContributorsController(Responder * parentResponder) :
ViewController(parentResponder),
SelectableTableViewDataSource(),
m_contributorsView(&m_selectableTableView),
m_contributorCell(),
m_selectableTableView(this)
{
}
View * ContributorsController::view() {
return &m_contributorsView;
}
const char * ContributorsController::title() {
return "Contributors";
}
void ContributorsController::didBecomeFirstResponder() {
if (selectedRow() < 0) {
selectCellAtLocation(0, 0);
}
Container::activeApp()->setFirstResponder(&m_selectableTableView);
}
void ContributorsController::viewWillAppear() {
ViewController::viewWillAppear();
m_selectableTableView.reloadData();
}
bool ContributorsController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::Left) {
stackController()->pop();
return true;
}
return false;
}
int ContributorsController::numberOfRows() const {
return 1;
}
KDCoordinate ContributorsController::rowHeight(int j) {
return Metric::ParameterCellHeight;
}
KDCoordinate ContributorsController::cumulatedHeightFromIndex(int j) {
return rowHeight(0) * j;
}
int ContributorsController::indexFromCumulatedHeight(KDCoordinate offsetY) {
KDCoordinate height = rowHeight(0);
if (height == 0) {
return 0;
}
return (offsetY - 1) / height;
}
HighlightCell * ContributorsController::reusableCell(int index, int type) {
assert(index >= 0 && index <= k_numberOfCells);
return &m_contributorCell;
}
int ContributorsController::reusableCellCount(int type) {
return 1;
}
int ContributorsController::typeAtLocation(int i, int j) {
return 0;
}
void ContributorsController::willDisplayCellForIndex(HighlightCell * cell, int index) {
MessageTableCell * myCell = (MessageTableCell *)cell;
//I18n::Message titles[1] = {I18n::Message::OmegaContributors};
//myCell->setMessage(titles[index]);
myCell->setMessage(I18n::Message::QuentinGuidee);
}
StackViewController * ContributorsController::stackController() const {
return (StackViewController *)parentResponder();
}
}

View File

@@ -1,38 +0,0 @@
#ifndef APPS_OMEGA_CONTRIBUTORS_CONTROLLER_H
#define APPS_OMEGA_CONTRIBUTORS_CONTROLLER_H
#include <escher.h>
#include "contributors_view.h"
// #include <apps/shared/settings_message_tree.h>
namespace Omega {
class ContributorsController : public ViewController, public ListViewDataSource, public SelectableTableViewDataSource, public SelectableTableViewDelegate {
public:
ContributorsController(Responder * parentResponder);
const char * title() override;
View * view() override;
bool handleEvent(Ion::Events::Event event) override;
void didBecomeFirstResponder() override;
void viewWillAppear() override;
KDCoordinate cumulatedHeightFromIndex(int j) override;
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
virtual int numberOfRows() const override;
virtual KDCoordinate rowHeight(int j) override;
HighlightCell * reusableCell(int index, int type) override;
int reusableCellCount(int type) override;
int typeAtLocation(int i, int j) override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
private:
StackViewController * stackController() const;
virtual int initialSelectedRow() const { return 0; }
constexpr static int k_numberOfCells = 1;
ContributorsView m_contributorsView;
MessageTableCell m_contributorCell;
SelectableTableView m_selectableTableView;
};
}
#endif

View File

@@ -1,33 +0,0 @@
#include "contributors_view.h"
#include "apps/i18n.h"
namespace Omega {
ContributorsView::ContributorsView(SelectableTableView * selectableTableView) :
View(),
m_selectableTableView(selectableTableView)
{
}
void ContributorsView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(KDRect(0, 0, bounds().width(), bounds().height()), Palette::BackgroundApps);
}
void ContributorsView::reload() {
markRectAsDirty(bounds());
}
int ContributorsView::numberOfSubviews() const {
return 1;
}
View * ContributorsView::subviewAtIndex(int index) {
assert(index == 0 || index == 1);
return m_selectableTableView;
}
void ContributorsView::layoutSubviews(bool force) {
m_selectableTableView->setFrame(KDRect(0, 0, bounds().width(), bounds().height()), force);
}
}

View File

@@ -1,22 +0,0 @@
#ifndef APPS_OMEGA_CONTRIBUTORS_VIEW_H
#define APPS_OMEGA_CONTRIBUTORS_VIEW_H
#include <escher.h>
namespace Omega {
class ContributorsView : public View {
public:
ContributorsView(SelectableTableView * selectableTableView);
void drawRect(KDContext * ctx, KDRect rect) const override;
void reload();
int numberOfSubviews() const override;
View * subviewAtIndex(int index) override;
private:
void layoutSubviews(bool force = false) override;
SelectableTableView * m_selectableTableView;
};
}
#endif

View File

@@ -1,79 +0,0 @@
#include "omega_controller.h"
#include <assert.h>
#include "apps/i18n.h"
namespace Omega {
OmegaController::OmegaController(Responder * parentResponder) :
ViewController(parentResponder),
SelectableTableViewDataSource(),
m_omegaView(&m_selectableTableView),
m_selectableTableView(this),
m_contributorsCell(),
m_versionCell(),
m_contributorsController(this)
{
m_contributorsCell.setMessageFont(KDFont::LargeFont);
m_versionCell.setMessageFont(KDFont::LargeFont);
m_versionCell.setAccessoryFont(KDFont::SmallFont);
m_versionCell.setAccessoryText(Ion::omegaVersion());
}
View * OmegaController::view() {
return &m_omegaView;
}
void OmegaController::didBecomeFirstResponder() {
if (selectedRow() < 0) {
selectCellAtLocation(0, 0);
}
Container::activeApp()->setFirstResponder(&m_selectableTableView);
}
bool OmegaController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::OK || event == Ion::Events::EXE || event == Ion::Events::Right) {
//StackViewController * stack = (StackViewController *)parentResponder();
stackController()->push(&m_contributorsController, Palette::BannerFirstText, Palette::BannerFirstBackground, Palette::BannerFirstBorder);
return true;
}
return false;
}
int OmegaController::numberOfRows() const {
return 2;
}
KDCoordinate OmegaController::rowHeight(int j) {
return Metric::ParameterCellHeight;
}
HighlightCell * OmegaController::reusableCell(int index, int type) {
assert(index >= 0 && index <= 1);
switch (index)
{
case 1:
return &m_versionCell;
default:
return &m_contributorsCell;
}
}
int OmegaController::reusableCellCount(int type) {
return 2;
}
int OmegaController::typeAtLocation(int i, int j) {
return 0;
}
void OmegaController::willDisplayCellForIndex(HighlightCell * cell, int index) {
MessageTableCell * myCell = (MessageTableCell *)cell;
I18n::Message titles[2] = {I18n::Message::OmegaContributors, I18n::Message::OmegaVersion};
myCell->setMessage(titles[index]);
}
StackViewController * OmegaController::stackController() const {
return (StackViewController *)parentResponder();
}
}

View File

@@ -1,35 +0,0 @@
#ifndef APPS_OMEGA_CONTROLLER_H
#define APPS_OMEGA_CONTROLLER_H
#include <escher.h>
#include "omega_view.h"
#include "contributors_controller.h"
namespace Omega {
class OmegaController : public ViewController, public ListViewDataSource, public SelectableTableViewDataSource, public SelectableTableViewDelegate {
public:
OmegaController(Responder * parentResponder);
View * view() override;
bool handleEvent(Ion::Events::Event event) override;
void didBecomeFirstResponder() override;
virtual int numberOfRows() const override;
virtual KDCoordinate rowHeight(int j) override;
HighlightCell * reusableCell(int index, int type) override;
int reusableCellCount(int type) override;
int typeAtLocation(int i, int j) override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
private:
StackViewController * stackController() const;
constexpr static int k_numberOfCells = 2;
OmegaView m_omegaView;
SelectableTableView m_selectableTableView;
MessageTableCellWithChevron m_contributorsCell;
MessageTableCellWithBuffer m_versionCell;
ContributorsController m_contributorsController;
};
}
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -1,50 +0,0 @@
#include "omega_view.h"
#include "apps/i18n.h"
namespace Omega {
OmegaView::OmegaView(SelectableTableView * selectableTableView) :
View(),
m_omegaTextView(KDFont::LargeFont, I18n::Message::OmegaApp, 0.5, 0.1, Palette::Toolbar, Palette::BackgroundApps),
m_urlTextView(KDFont::SmallFont, I18n::Message::OmegaURL, 0.5, 0.2, Palette::SecondaryText, Palette::BackgroundApps),
m_discordTextView(KDFont::SmallFont, I18n::Message::OmegaDiscord, 0.5, 0.2, Palette::SecondaryText, Palette::BackgroundApps),
m_selectableTableView(selectableTableView)
{
}
void OmegaView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->fillRect(KDRect(0, 0, bounds().width(), bounds().height()), Palette::BackgroundApps);
}
void OmegaView::reload() {
markRectAsDirty(bounds());
}
int OmegaView::numberOfSubviews() const {
return 4;
}
View * OmegaView::subviewAtIndex(int index) {
assert(index >= 0 && index <= 3);
switch (index)
{
case 1:
return &m_urlTextView;
case 2:
return &m_discordTextView;
case 3:
return m_selectableTableView;
default:
return &m_omegaTextView;
}
}
void OmegaView::layoutSubviews(bool force) {
KDCoordinate textHeight = KDFont::SmallFont->glyphSize().height();
m_omegaTextView.setFrame(KDRect(0, 30, bounds().width(), textHeight + 12), force);
m_urlTextView.setFrame(KDRect(0, 60, bounds().width(), textHeight), force);
m_discordTextView.setFrame(KDRect(0, 76, bounds().width(), textHeight), force);
m_selectableTableView->setFrame(KDRect(0, 100, bounds().width(), bounds().height()), force);
}
}

View File

@@ -1,25 +0,0 @@
#ifndef APPS_OMEGA_VIEW_H
#define APPS_OMEGA_VIEW_H
#include <escher.h>
namespace Omega {
class OmegaView : public View {
public:
OmegaView(SelectableTableView * selectableTableView);
void drawRect(KDContext * ctx, KDRect rect) const override;
void reload();
int numberOfSubviews() const override;
View * subviewAtIndex(int index) override;
private:
void layoutSubviews(bool force = false) override;
MessageTextView m_omegaTextView;
MessageTextView m_urlTextView;
MessageTextView m_discordTextView;
SelectableTableView * m_selectableTableView;
};
}
#endif

View File

@@ -7,7 +7,7 @@ HOME_DISPLAY_EXTERNALS ?= 1
EPSILON_VERSION ?= 13.1.0
OMEGA_VERSION ?= 1.20.0
# USERNAME ?= N/A
EPSILON_APPS ?= calculation rpn graph code statistics probability solver atom sequence regression settings external omega
EPSILON_APPS ?= calculation rpn graph code statistics probability solver atom sequence regression settings external
EPSILON_I18N ?= en fr es de pt hu
# EPSILON_I18N ?= en fr es de pt hu
EPSILON_GETOPT ?= 0

2
themes

Submodule themes updated: 1cc7e38051...c0f54d2298