Created
September 29, 2017 11:02
-
-
Save anonymous/7d43c6d5b2cf1fef618be9f75077ad0c to your computer and use it in GitHub Desktop.
Circular Dependency Issue
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
/* | |
============================================================================== | |
Application.h | |
Created: 21 Sep 2017 11:33:33pm | |
Author: Jefferson Bledsoe | |
============================================================================== | |
*/ | |
#pragma once | |
#include "../JuceLibraryCode/JuceHeader.h" | |
#include "Windows/WindowList.h" | |
#include "Utility/CommandIDs.h" | |
#include "Utility/MyoMapperLookAndFeel.h" | |
//============================================================================== | |
/* | |
*/ | |
class MyoMapperApplication : public JUCEApplication, | |
private AsyncUpdater | |
{ | |
public: | |
MyoMapperApplication(); | |
static MyoMapperApplication& getApp(); | |
static ApplicationCommandManager& getCommandManager(); | |
static ApplicationProperties& getAppProperties(); | |
static WindowList& getWindowList(); | |
//========================================================================== | |
const String getApplicationName() override { return ProjectInfo::projectName; } | |
const String getApplicationVersion() override { return ProjectInfo::versionString; } | |
bool moreThanOneInstanceAllowed() override { return true; } | |
//========================================================================== | |
void initialise (const String& commandLine) override; | |
void shutdown() override; | |
void systemRequestedQuit() override; | |
void handleAsyncUpdate() override; | |
//========================================================================== | |
MenuBarModel* getMenuModel(); | |
StringArray getMenuBarNames(); | |
void createMenu (PopupMenu&, const String& menuName); | |
void createFileMenu (PopupMenu&); | |
void createViewMenu (PopupMenu&); | |
void createWindowMenu (PopupMenu&); | |
void createHelpMenu (PopupMenu&); | |
void createAppleMenu (PopupMenu&); | |
void menuCommand (int menuItemID); | |
//========================================================================== | |
void getAllCommands (Array<CommandID>&) override; | |
void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result) override; | |
bool perform (const InvocationInfo& info) override; | |
//========================================================================== | |
void createNewMapper(); | |
void userFileOpenDialog(); | |
void openFile(); | |
void saveMapper(); | |
void saveMapperAs(); | |
void quitMapper(); | |
void windowZoomIncrease(); | |
void windowZoomDecrease(); | |
void enableFullscreen(); | |
void showSettingsWindow(); | |
void newDisplayWindow(); | |
void moveWindowsToFront(); | |
void hideAllWindows(); | |
void closeWindow(); | |
void closeAllWindows(); | |
void showAboutWindow(); | |
void showDocumentationWindow(); | |
void showPreferencesWindow(); | |
// ========================================================================== | |
MyoMapperLookAndFeel lookAndFeel; // For new UI | |
struct MainMenuBarModel; | |
ScopedPointer<MainMenuBarModel> menuModel; | |
// Document Manager Goes Here | |
ScopedPointer<ApplicationCommandManager> commandManager; | |
ScopedPointer<ApplicationProperties> appProperties; | |
// General floating window builder used to create these windows | |
ScopedPointer<WindowList> windowList; | |
ScopedPointer<Component> settingsWindow; | |
// ScopedPointer<Component> aboutWindow, documentationWindow; | |
private: | |
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MyoMapperApplication) | |
}; |
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
/* | |
============================================================================== | |
WindowsList.h | |
Created: 22 Sep 2017 3:51:10am | |
Author: Jefferson Bledsoe | |
============================================================================== | |
*/ | |
#pragma once | |
class WindowSetter; | |
#include "../JuceLibraryCode/JuceHeader.h" | |
#include "WindowSetter.h" | |
#include "FeedbackWindow.h" | |
#include "SettingsWindow.h" | |
//============================================================================== | |
/* | |
*/ | |
class WindowList | |
{ | |
public: | |
WindowList(); | |
void createInitialWindow(); | |
void createNewFeedbackWindow(); | |
void getOrCreateSettingsWindow(); | |
void forceCloseWindows(); | |
void askAllWindowsToClose(); | |
void closeWindow (WindowSetter*); | |
// void closeWindow (SettingsWindow*); | |
void closeWindow (FeedbackWindow*); | |
OwnedArray<WindowSetter> windows; | |
private: | |
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WindowList) | |
}; |
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
/* | |
============================================================================== | |
WindowSetter.h | |
Created: 22 Sep 2017 5:16:30pm | |
Author: Jefferson Bledsoe | |
============================================================================== | |
*/ | |
#pragma once | |
#include "../JuceLibraryCode/JuceHeader.h" | |
//#include "WindowList.h" | |
#include "../Application.h" | |
//============================================================================== | |
/* | |
*/ | |
class WindowSetter : public DialogWindow | |
{ | |
public: | |
WindowSetter (const String& title, | |
Component* content, | |
bool shouldBeResizeable, | |
int initWidth, int initHeight, | |
int minWidth, int minHeight, | |
int maxWidth, int maxHeight) | |
: DialogWindow (title, Colours::white, true, true), | |
owner (this) | |
{ | |
setUsingNativeTitleBar (true); | |
setResizable (true, true); | |
setResizeLimits (minWidth, minHeight, maxWidth, maxHeight); | |
setContentOwned (content, false); | |
setVisible (true); | |
} | |
~WindowSetter() | |
{ | |
} | |
void closeButtonPressed() override | |
{ | |
MyoMapperApplication::getWindowList().remove (/*Pointer To This Window*/); | |
owner = nullptr; | |
} | |
bool escapeKeyPressed() override | |
{ | |
return true; | |
} | |
private: | |
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WindowSetter) | |
ScopedPointer<Component> owner; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment