38 #ifndef H_SCENE_GRAPH_SKIN_APPLICATION_BASE_H
39 #define H_SCENE_GRAPH_SKIN_APPLICATION_BASE_H
90 void set_tooltip(
const std::string& x) {
94 size_t index = tooltip_.find(
"\\n");
95 index != std::string::npos;
96 index = tooltip_.find(
"\\n", index+2)
98 tooltip_.replace(index, 2,
" \n");
117 virtual void start();
154 const std::string& name,
155 const std::string& value,
156 const std::string& help=
""
221 virtual void end(
bool canceled);
228 std::string
find_file(
const std::string& filename)
const;
264 bool get_can_undo()
const;
287 void div(
const std::string& value);
295 void out(
const std::string& value);
303 void warn(
const std::string& value);
311 void err(
const std::string& value);
398 void div(
const std::string& value)
override;
403 void out(
const std::string& value)
override;
408 void warn(
const std::string& value)
override;
413 void err(
const std::string& value)
override;
418 void status(
const std::string& value)
override;
445 void end(
bool canceled)
override;
452 LoggerClient_var logger_client_;
454 std::string tooltip_;
460 bool undo_redo_called_;
463 static bool stopping_;
464 bool started_callback_called_;
A LoggerClient that redirects all messages to an ApplicationBase.
void out(const std::string &value) override
void div(const std::string &value) override
void status(const std::string &value) override
void warn(const std::string &value) override
void err(const std::string &value) override
A ProgressClient that redirects all messages to an ApplicationBase.
void begin() override
Starts listening progress.
void end(bool canceled) override
Stops listening progress.
void progress(index_t step, index_t percent) override
Tracks progress.
Base class for Application.
virtual void end(bool canceled)
ProgressClient overload, callback called by ProgressTask.
virtual void post_draw()
Called after each frame.
std::string state_buffer_filename(index_t i) const
Gets the file name to be used to store a state buffer.
void err(const std::string &value)
A signal that is triggered when the logger displays an error message.
virtual void save_state_to_file(const std::string &filename)
Saves Graphite state to a file.
virtual void save_state()
Saves state before applying command or tool, for undo()/redo().
void div(const std::string &value)
A signal that is triggered when a 'separation div' should be displayed in the logger.
virtual void progress_cancel()
Cancels current progress tastk.
virtual void begin()
ProgressClient overload, callback called by ProgressTask.
virtual void progress(index_t step, index_t percent)
ProgressClient overload, callback called by ProgressTask.
std::string find_file(const std::string &filename) const
Finds a file in the OGF_PATH.
Interpreter * interpreter()
Gets the main Interpreter.
virtual void save_preferences()
Saves the preferences to home directory / graphite.ini.
const std::string & get_tooltip() const
Gets the tooltip to be displayed near the cursor in the rendering area, or an empty string if there i...
virtual void draw()
Redraws the main window.
virtual void stop()
Stops the application.
void declare_preference_variable(const std::string &name, const std::string &value, const std::string &help="")
Declares a preference variable.
virtual void set_style(const std::string &value)
Sets the style to be used for widgets.
bool get_can_redo() const
Tests whether redo() can be called.
void notify_progress(index_t value)
A signal that is triggered when a ProgressTask is updated.
virtual void undo()
Restores last saved state if available.
void notify_progress_begin(const std::string &value)
A signal that is triggered when a ProgressTask starts.
ApplicationBase(Interpreter *interpreter=nullptr)
ApplicationBase constructor.
~ApplicationBase() override
ApplicationBase destructor.
static bool is_stopping()
Tests whether the application is stopping.
virtual void load_state_from_file(const std::string &filename)
Saves Graphite state to a file.
virtual void cancel_current_job()
Cancels the current job.
void out(const std::string &value)
A signal that is triggered when the logger displays a message.
virtual bool preferences_loaded()
Tests whether preferences were loaded.
void notify_progress_end()
A signal that is triggered when a ProgressTask finishes.
void status(const std::string &value)
A signal that is triggered when the message in the status bar should be updated.
virtual void redo()
Restores next saved state if available.
static void set_stopping_flag()
Indicates that the application is stopping, i.e. processes the last events from the event queue.
virtual void set_font_size(index_t value)
Sets the size of fonts in the application.
virtual void load_preferences(const std::string &filename)
Loads preference variables from a file.
void warn(const std::string &value)
A signal that is triggered when the logger displays a warning message.
virtual void update()
Indicates that the main window should be redrawn.
Abstract base class for the GOM interpreter.
Base class for all objects in the GOM system.
geo_index_t index_t
The type for storing and manipulating indices.
Global Graphite namespace.
The base class for all composite objects in the GOM system.
Functions and classes for displaying progress bars.
Definitions common to all include files in the scene_graph library.