Use TouchGFX
This commit is contained in:
		@ -0,0 +1,35 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#ifndef FRONTENDAPPLICATIONBASE_HPP
 | 
			
		||||
#define FRONTENDAPPLICATIONBASE_HPP
 | 
			
		||||
 | 
			
		||||
#include <mvp/MVPApplication.hpp>
 | 
			
		||||
#include <gui/model/Model.hpp>
 | 
			
		||||
 | 
			
		||||
class FrontendHeap;
 | 
			
		||||
 | 
			
		||||
class FrontendApplicationBase : public touchgfx::MVPApplication
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    FrontendApplicationBase(Model& m, FrontendHeap& heap);
 | 
			
		||||
    virtual ~FrontendApplicationBase() { }
 | 
			
		||||
 | 
			
		||||
    virtual void changeToStartScreen()
 | 
			
		||||
    {
 | 
			
		||||
        gotoscreenScreenNoTransition();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // screen
 | 
			
		||||
    void gotoscreenScreenNoTransition();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    touchgfx::Callback<FrontendApplicationBase> transitionCallback;
 | 
			
		||||
    FrontendHeap& frontendHeap;
 | 
			
		||||
    Model& model;
 | 
			
		||||
 | 
			
		||||
    // screen
 | 
			
		||||
    void gotoscreenScreenNoTransitionImpl();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // FRONTENDAPPLICATIONBASE_HPP
 | 
			
		||||
@ -0,0 +1,87 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#ifndef FRONTENDHEAPBASE_HPP
 | 
			
		||||
#define FRONTENDHEAPBASE_HPP
 | 
			
		||||
 | 
			
		||||
#include <common/Meta.hpp>
 | 
			
		||||
#include <common/Partition.hpp>
 | 
			
		||||
#include <mvp/MVPHeap.hpp>
 | 
			
		||||
 | 
			
		||||
#include <touchgfx/transitions/NoTransition.hpp>
 | 
			
		||||
#include <gui/common/FrontendApplication.hpp>
 | 
			
		||||
#include <gui/model/Model.hpp>
 | 
			
		||||
 | 
			
		||||
#include <gui/screen_screen/screenView.hpp>
 | 
			
		||||
#include <gui/screen_screen/screenPresenter.hpp>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * This class provides the memory that shall be used for memory allocations
 | 
			
		||||
 * in the frontend. A single instance of the FrontendHeap is allocated once (in heap
 | 
			
		||||
 * memory), and all other frontend objects such as views, presenters and data model are
 | 
			
		||||
 * allocated within the scope of this FrontendHeap. As such, the RAM usage of the entire
 | 
			
		||||
 * user interface is sizeof(FrontendHeap).
 | 
			
		||||
 *
 | 
			
		||||
 * @note The FrontendHeap reserves memory for the most memory-consuming presenter and
 | 
			
		||||
 * view only. The largest of these classes are determined at compile-time using template
 | 
			
		||||
 * magic. As such, it is important to add all presenters, views and transitions to the
 | 
			
		||||
 * type lists in this class.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
class FrontendHeapBase : public touchgfx::MVPHeap
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    /**
 | 
			
		||||
     * A list of all view types. Must end with meta::Nil.
 | 
			
		||||
     * @note All view types used in the application MUST be added to this list!
 | 
			
		||||
     */
 | 
			
		||||
    typedef touchgfx::meta::TypeList< screenView,
 | 
			
		||||
            touchgfx::meta::Nil
 | 
			
		||||
            > GeneratedViewTypes;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Determine (compile time) the View type of largest size.
 | 
			
		||||
     */
 | 
			
		||||
    typedef touchgfx::meta::select_type_maxsize< GeneratedViewTypes >::type MaxGeneratedViewType;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * A list of all presenter types. Must end with meta::Nil.
 | 
			
		||||
     * @note All presenter types used in the application MUST be added to this list!
 | 
			
		||||
     */
 | 
			
		||||
    typedef touchgfx::meta::TypeList< screenPresenter,
 | 
			
		||||
            touchgfx::meta::Nil
 | 
			
		||||
            > GeneratedPresenterTypes;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Determine (compile time) the Presenter type of largest size.
 | 
			
		||||
     */
 | 
			
		||||
    typedef touchgfx::meta::select_type_maxsize< GeneratedPresenterTypes >::type MaxGeneratedPresenterType;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * A list of all transition types. Must end with meta::Nil.
 | 
			
		||||
     * @note All transition types used in the application MUST be added to this list!
 | 
			
		||||
     */
 | 
			
		||||
    typedef touchgfx::meta::TypeList< touchgfx::NoTransition,
 | 
			
		||||
            touchgfx::meta::Nil
 | 
			
		||||
            > GeneratedTransitionTypes;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Determine (compile time) the Transition type of largest size.
 | 
			
		||||
     */
 | 
			
		||||
    typedef touchgfx::meta::select_type_maxsize< GeneratedTransitionTypes >::type MaxGeneratedTransitionType;
 | 
			
		||||
 | 
			
		||||
    virtual void gotoStartScreen(FrontendApplication& app)
 | 
			
		||||
    {
 | 
			
		||||
        app.gotoscreenScreenNoTransition();
 | 
			
		||||
    }
 | 
			
		||||
protected:
 | 
			
		||||
    FrontendHeapBase(touchgfx::AbstractPartition& presenters, touchgfx::AbstractPartition& views, touchgfx::AbstractPartition& transitions, FrontendApplication& app)
 | 
			
		||||
        : MVPHeap(presenters, views, transitions, app)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // FRONTENDHEAPBASE_HPP
 | 
			
		||||
@ -0,0 +1,11 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#ifndef SIMCONSTANTS_HPP
 | 
			
		||||
#define SIMCONSTANTS_HPP
 | 
			
		||||
 | 
			
		||||
static unsigned short SIM_WIDTH = 320;
 | 
			
		||||
static unsigned short SIM_HEIGHT = 480;
 | 
			
		||||
#define SIM_TITLE "MyApplication"
 | 
			
		||||
 | 
			
		||||
#endif // SIMCONSTANTS_HPP
 | 
			
		||||
@ -0,0 +1,45 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#ifndef SCREENVIEWBASE_HPP
 | 
			
		||||
#define SCREENVIEWBASE_HPP
 | 
			
		||||
 | 
			
		||||
#include <gui/common/FrontendApplication.hpp>
 | 
			
		||||
#include <mvp/View.hpp>
 | 
			
		||||
#include <gui/screen_screen/screenPresenter.hpp>
 | 
			
		||||
#include <touchgfx/widgets/Box.hpp>
 | 
			
		||||
#include <touchgfx/widgets/TextArea.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/Circle.hpp>
 | 
			
		||||
#include <touchgfx/widgets/canvas/PainterRGB565.hpp>
 | 
			
		||||
 | 
			
		||||
class screenViewBase : public touchgfx::View<screenPresenter>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    screenViewBase();
 | 
			
		||||
    virtual ~screenViewBase();
 | 
			
		||||
    virtual void setupScreen();
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    FrontendApplication& application() {
 | 
			
		||||
        return *static_cast<FrontendApplication*>(touchgfx::Application::getInstance());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Member Declarations
 | 
			
		||||
     */
 | 
			
		||||
    touchgfx::Box __background;
 | 
			
		||||
    touchgfx::TextArea textArea1;
 | 
			
		||||
    touchgfx::Circle circle1;
 | 
			
		||||
    touchgfx::PainterRGB565 circle1Painter;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Canvas Buffer Size
 | 
			
		||||
     */
 | 
			
		||||
    static const uint32_t CANVAS_BUFFER_SIZE = 7200;
 | 
			
		||||
    uint8_t canvasBuffer[CANVAS_BUFFER_SIZE];
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // SCREENVIEWBASE_HPP
 | 
			
		||||
@ -0,0 +1,43 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#include <new>
 | 
			
		||||
#include <gui_generated/common/FrontendApplicationBase.hpp>
 | 
			
		||||
#include <gui/common/FrontendHeap.hpp>
 | 
			
		||||
#include <touchgfx/transitions/NoTransition.hpp>
 | 
			
		||||
#include <texts/TextKeysAndLanguages.hpp>
 | 
			
		||||
#include <touchgfx/Texts.hpp>
 | 
			
		||||
#include <touchgfx/hal/HAL.hpp>
 | 
			
		||||
#include <platform/driver/lcd/LCD16bpp.hpp>
 | 
			
		||||
#include <gui/screen_screen/screenView.hpp>
 | 
			
		||||
#include <gui/screen_screen/screenPresenter.hpp>
 | 
			
		||||
 | 
			
		||||
using namespace touchgfx;
 | 
			
		||||
 | 
			
		||||
FrontendApplicationBase::FrontendApplicationBase(Model& m, FrontendHeap& heap)
 | 
			
		||||
    : touchgfx::MVPApplication(),
 | 
			
		||||
      transitionCallback(),
 | 
			
		||||
      frontendHeap(heap),
 | 
			
		||||
      model(m)
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::HAL::getInstance()->setDisplayOrientation(touchgfx::ORIENTATION_LANDSCAPE);
 | 
			
		||||
    touchgfx::Texts::setLanguage(GB);
 | 
			
		||||
    reinterpret_cast<touchgfx::LCD16bpp&>(touchgfx::HAL::lcd()).enableTextureMapperAll();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Screen Transition Declarations
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
// screen
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoscreenScreenNoTransition()
 | 
			
		||||
{
 | 
			
		||||
    transitionCallback = touchgfx::Callback<FrontendApplicationBase>(this, &FrontendApplication::gotoscreenScreenNoTransitionImpl);
 | 
			
		||||
    pendingScreenTransitionCallback = &transitionCallback;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void FrontendApplicationBase::gotoscreenScreenNoTransitionImpl()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::makeTransition<screenView, screenPresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,41 @@
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
/********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/
 | 
			
		||||
/*********************************************************************************/
 | 
			
		||||
#include <gui_generated/screen_screen/screenViewBase.hpp>
 | 
			
		||||
#include <touchgfx/canvas_widget_renderer/CanvasWidgetRenderer.hpp>
 | 
			
		||||
#include <touchgfx/Color.hpp>
 | 
			
		||||
#include <texts/TextKeysAndLanguages.hpp>
 | 
			
		||||
 | 
			
		||||
screenViewBase::screenViewBase()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE);
 | 
			
		||||
    
 | 
			
		||||
    __background.setPosition(0, 0, 480, 320);
 | 
			
		||||
    __background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0));
 | 
			
		||||
    add(__background);
 | 
			
		||||
 | 
			
		||||
    textArea1.setXY(190, 29);
 | 
			
		||||
    textArea1.setColor(touchgfx::Color::getColorFromRGB(255, 0, 0));
 | 
			
		||||
    textArea1.setLinespacing(0);
 | 
			
		||||
    textArea1.setTypedText(touchgfx::TypedText(T___SINGLEUSE_6GPV));
 | 
			
		||||
    add(textArea1);
 | 
			
		||||
 | 
			
		||||
    circle1.setPosition(97, 120, 80, 80);
 | 
			
		||||
    circle1.setCenter(40, 40);
 | 
			
		||||
    circle1.setRadius(40);
 | 
			
		||||
    circle1.setLineWidth(0);
 | 
			
		||||
    circle1.setArc(0, 360);
 | 
			
		||||
    circle1Painter.setColor(touchgfx::Color::getColorFromRGB(3, 255, 226));
 | 
			
		||||
    circle1.setPainter(circle1Painter);
 | 
			
		||||
    add(circle1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
screenViewBase::~screenViewBase()
 | 
			
		||||
{
 | 
			
		||||
    touchgfx::CanvasWidgetRenderer::resetBuffer();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void screenViewBase::setupScreen()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user