linux::CApplication


All platform-dependent classes have been moved to Platform Package in release 10.0.0.

This class is available on Linux platform only

Corresponding class for Windows platform is here.

Corresponding class for Android platform is here.

Implementation of application for Linux platform.

You can find more information in comments below. Overrided methods can be found in corresponding base interface.

class CApplication :public virtual IApplication
    {
    public:
        struct FONT_FACE // Describe loaded font face 
        {
            void *Face;
            String Name;
            int RefCount;
            bool Default;
        };
    public:
        void(*OnDestroyLastWindow)(); // Event called right after destroying the last window in application windows list 
    
        int getWindowCount() override;
        IWindow *getWindow(const int index) override;
        IForm *getWindowForm(const int index) override;
        IForm *getMainForm() override;
        IKeyboard *getKeyboard() override;
        IMouse *getMouse() override;
        ITranslate *getTranslate() override;
        IStyles *getStyles() override;
        IScreen *getScreen() override;
        ISystem *getSystem() override;
        IPicture *getPicture() override;
        IDialogs *getDialogs() override;
        IFileSystem *getFileSystem() override;
        const String &getApplicationFileName() const override;
        const String &getApplicationDirectory() const override;
        INetwork *getNetwork() override;
        const String &getModuleFileName() const override;
        const String &getModuleDirectory() const override;
        IEditor *getEditor() override; // Return nullptr 
        bool isUseDialogBoxes() override;
        bool isGlobal() override; // Return true 
    
        bool setMainForm(IForm *value) override;
    
        int Run() override;
        void ProcessMessages() override;
        void RepaintAll() override;
        IApplicationService *QueryService() override;
        IThread *CreateThread(const bool paused, IThreadListener *listener) override;
    
        CApplication();
        virtual ~CApplication();
    
        CLOSE_ACTION getCloseAction(IWindow *window); // Return default close action for specified window. caFree by default. But if handle belongs to form and this form isn't same as main form, than close action is hide 
        FONT_FACE *LoadFontFace(const String &filename); // Load font or return existing one 
        FONT_FACE *LoadDefaultFontFace(const String &filename); // Load default font or return existing one 
        void FreeFontFace(FONT_FACE *face); // Free font if it is not used anymore. Each call of LoadFontFace/LoadDefaultFontFace should correspond the same count of calls of FreeFontFace 
    };

The usage is quite simple.

void main()
    {
        CMyForm *form; // Your form(s) 
        CApplication app; // Create application 
        app.CreateForm(&form); // Create form(s) 
        app.Run(); // Run application 
    }

or

int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
    {
        CMyForm *form; // Your form(s) 
        CApplication app; // Create application 
        app.CreateForm(&form); // Create form(s) 
        return app.Run(); // Run application 
    }
Namespace: nitisa::standard::linux
Include: Standard/Platform/Linux/Application.h