forked from fltk/fltk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
723dff4
commit e3a1eb5
Showing
23 changed files
with
175 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// Application Class for Fast Light User Interface Designer (FLUID). | ||
// | ||
// Copyright 1998-2024 by Bill Spitzak and others. | ||
// | ||
// This library is free software. Distribution and use rights are outlined in | ||
// the file "COPYING" which should have been included with this file. If this | ||
// file is missing or damaged, see the license at: | ||
// | ||
// https://www.fltk.org/COPYING.php | ||
// | ||
// Please see the following page on how to report bugs and issues: | ||
// | ||
// https://www.fltk.org/bugs.php | ||
// | ||
|
||
|
||
#include "application/application.h" | ||
|
||
#include "fluid.h" | ||
#include "widget_browser.h" | ||
|
||
extern bool confirm_project_clear(); | ||
|
||
/** | ||
Clear the current project and create a new, empty one. | ||
If the current project was modified, FLUID will give the user the opportunity | ||
to save the old project first. | ||
\param[in] user_must_confirm if set, a confimation dialog is presented to the | ||
user before resetting the project. Default is `true`. | ||
\return false if the operation was canceled | ||
*/ | ||
bool fluid::Application::new_project(bool user_must_confirm) { | ||
// verify user intention | ||
if ((user_must_confirm) && (confirm_project_clear() == false)) | ||
return false; | ||
|
||
// clear the current project | ||
project().reset(); | ||
set_filename(NULL); | ||
set_modflag(0, 0); | ||
widget_browser->rebuild(); | ||
project().update_settings_dialog(); | ||
|
||
// all is clear to continue | ||
return true; | ||
} | ||
|
||
/** | ||
* Return a reference to the current project. | ||
*/ | ||
fluid::Project &fluid::Application::project() | ||
{ | ||
return g_project; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// Application Class for Fast Light User Interface Designer (FLUID). | ||
// | ||
// Copyright 1998-2024 by Bill Spitzak and others. | ||
// | ||
// This library is free software. Distribution and use rights are outlined in | ||
// the file "COPYING" which should have been included with this file. If this | ||
// file is missing or damaged, see the license at: | ||
// | ||
// https://www.fltk.org/COPYING.php | ||
// | ||
// Please see the following page on how to report bugs and issues: | ||
// | ||
// https://www.fltk.org/bugs.php | ||
// | ||
|
||
#ifndef FLUID_APPLICATION_APPLICATION_H | ||
#define FLUID_APPLICATION_APPLICATION_H | ||
|
||
#include "fluid.h" | ||
|
||
#include <string> | ||
|
||
namespace fluid { | ||
|
||
class Application { | ||
public: | ||
/// Command line arguments. | ||
App_Args args; | ||
/// Application settings. | ||
App_Settings settings; | ||
/// Application history. | ||
App_History history; | ||
/// Set if the application is not in interactive mode. | ||
bool batch_mode { false }; | ||
/// current directory path at application launch | ||
Fl_String launch_path { }; | ||
|
||
/// Clear the current project and create a new, empty one. | ||
bool new_project(bool user_must_confirm = true); | ||
/// Get the current project. | ||
Project &project(); | ||
}; | ||
|
||
}; // namespace FLUID | ||
|
||
#endif // FLUID_APPLICATION_APPLICATION_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.