Application-level control. More...
#include <Application.hpp>
Public Member Functions | |
virtual | ~Application (void) |
Destructor. More... | |
Application (int argc=0, char **argv=nullptr) | |
Constructor. More... | |
Application (const Application &rhs)=delete | |
Cannot copy Application. More... | |
Application & | operator= (const Application &rhs)=delete |
Cannot assign Application. More... | |
virtual | operator GApplication * (void) const |
Convert to GApplication* . More... | |
virtual | operator GtkApplication * (void) const |
Convert to GtkApplication* . More... | |
virtual VStr | argv (void) const |
Get a vector of all the command line parameters (argv ). More... | |
virtual Application & | initialize (void)=0 |
This callback is made on startup once it is safe to create windows and controls. More... | |
virtual int | run_message_loop (void) |
Run the message loop. This will only return once the last FrameWindow has been closed. More... | |
Static Public Member Functions | |
static GtkApplication * | gtk_app (void) |
Return the underlying GtkApplication* . More... | |
Static Protected Attributes | |
static int | saved_argc = 0 |
Value of argc normally passed into main() . More... | |
static char ** | saved_argv = nullptr |
Value of argv normally passed into main() . More... | |
static GtkApplication * | gtk_application = nullptr |
Pointer to single GTK+ application. More... | |
Application-level control.
|
virtual |
Destructor.
References gtk_application.
nocl::Application::Application | ( | int | argc = 0 , |
char ** | argv = nullptr |
||
) |
Constructor.
Only one of these objects may be constructed. You should have a class that inherits from Application, and then override methods such as initialize().
The argc
and argv
parameters are provided for convenience, to gain easy access to the command line arguments from anywhere in the application. But neither NOCL nor GTK+ require specific startup parameters, so if you don't need the arguments they can be left empty.
nocl::Exception | Throws if the application object has already been constructed. |
nocl::Exception | Throws if the GTK+ application cannot be created. |
References argv(), gtk_application, initialize(), NOCL_WHERE, saved_argc, and saved_argv.
|
delete |
Cannot copy Application.
|
delete |
Cannot assign Application.
|
virtual |
Convert to GApplication*
.
References gtk_application.
|
virtual |
Convert to GtkApplication*
.
References gtk_application.
|
virtual |
Get a vector of all the command line parameters (argv
).
This will return an empty vector unless argc
and argv
were provided in the constructor.
References saved_argc, and saved_argv.
Referenced by Application().
|
pure virtual |
This callback is made on startup once it is safe to create windows and controls.
One of your classes should inherit from nocl::Application
and override nocl::Application::initialize
(), possibly to initialize a FrameWindow and other GUI controls that it will need.
Example:
Referenced by Application().
|
virtual |
Run the message loop. This will only return once the last FrameWindow has been closed.
References nocl::Exception::details(), saved_argc, and saved_argv.
|
static |
Return the underlying GtkApplication*
.
nullptr
if an instance of Application
has not yet been created. References gtk_application.
|
staticprotected |
Value of argc
normally passed into main()
.
Referenced by Application(), argv(), and run_message_loop().
|
staticprotected |
Value of argv
normally passed into main()
.
Referenced by Application(), argv(), and run_message_loop().
|
staticprotected |
Pointer to single GTK+ application.
Referenced by Application(), gtk_app(), operator GApplication *(), operator GtkApplication *(), and ~Application().