Skip to content

Commit d38fb3c

Browse files
sudaradrowaudio
andauthored
Fix Linux issue with DocumentWindow (#91)
* Remove JuceHeader.h and qualify with juce:: * Fix issue with juce::String spacing * Add JUCE_GUI_BASICS_INCLUDE_XHEADERS=1 * Status -> State to avoid Xlib naming issue Co-authored-by: drowaudio <[email protected]>
1 parent ffe8382 commit d38fb3c

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ target_compile_definitions(pluginval PRIVATE
7979
JUCE_DISPLAY_SPLASH_SCREEN=0
8080
JUCE_MODAL_LOOPS_PERMITTED=1
8181
JUCE_REPORT_APP_USAGE=0
82+
JUCE_GUI_BASICS_INCLUDE_XHEADERS=1
8283
VERSION="${CURRENT_VERSION}")
8384

8485
target_link_libraries(pluginval PRIVATE
@@ -90,4 +91,4 @@ target_link_libraries(pluginval PRIVATE
9091
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
9192
target_link_libraries(pluginval PRIVATE
9293
-static-libstdc++)
93-
endif()
94+
endif()

Source/MainComponent.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@
2121
juce::PropertiesFile& getAppPreferences();
2222

2323
//==============================================================================
24-
struct ConnectionStatus : public juce::Component,
24+
struct ConnectionState : public juce::Component,
2525
private juce::ChangeListener,
2626
private Validator::Listener
2727
{
28-
ConnectionStatus (Validator& v)
28+
ConnectionState (Validator& v)
2929
: validator (v)
3030
{
3131
validator.addListener (this);
3232
validator.addChangeListener (this);
3333
}
3434

35-
~ConnectionStatus() override
35+
~ConnectionState() override
3636
{
3737
validator.removeListener (this);
3838
validator.removeChangeListener (this);
@@ -43,12 +43,12 @@ struct ConnectionStatus : public juce::Component,
4343
auto r = getLocalBounds().toFloat();
4444

4545
g.setColour ([this] {
46-
switch (status)
46+
switch (state)
4747
{
48-
case Status::disconnected: return juce::Colours::darkred;
49-
case Status::validating: return juce::Colours::orange;
50-
case Status::connected:
51-
case Status::complete: return juce::Colours::lightgreen;
48+
case State::disconnected: return juce::Colours::darkred;
49+
case State::validating: return juce::Colours::orange;
50+
case State::connected:
51+
case State::complete: return juce::Colours::lightgreen;
5252
}
5353

5454
return juce::Colours::darkred;
@@ -60,7 +60,7 @@ struct ConnectionStatus : public juce::Component,
6060
}
6161

6262
private:
63-
enum class Status
63+
enum class State
6464
{
6565
disconnected,
6666
connected,
@@ -69,22 +69,22 @@ struct ConnectionStatus : public juce::Component,
6969
};
7070

7171
Validator& validator;
72-
std::atomic<Status> status { Status::disconnected };
72+
std::atomic<State> state { State::disconnected };
7373

74-
void setStatus (Status newStatus)
74+
void setState (State newStatus)
7575
{
76-
status = newStatus;
76+
state = newStatus;
7777
juce::MessageManager::callAsync ([sp = SafePointer<Component> (this)] () mutable { if (sp != nullptr) sp->repaint(); });
7878
}
7979

8080
void changeListenerCallback (juce::ChangeBroadcaster*) override
8181
{
82-
setStatus (validator.isConnected() ? Status::connected : Status::disconnected);
82+
setState (validator.isConnected() ? State::connected : State::disconnected);
8383
}
8484

8585
void validationStarted (const juce::String&) override
8686
{
87-
setStatus (Status::validating);
87+
setState (State::validating);
8888
}
8989

9090
void logMessage (const juce::String&) override
@@ -97,7 +97,7 @@ struct ConnectionStatus : public juce::Component,
9797

9898
void allItemsComplete() override
9999
{
100-
setStatus (Status::complete);
100+
setState (State::complete);
101101
}
102102
};
103103

@@ -245,7 +245,7 @@ class MainComponent : public juce::Component,
245245
clearButton { "Clear Log" }, saveButton { "Save Log" }, optionsButton { "Options" };
246246
juce::Slider strictnessSlider;
247247
juce::Label strictnessLabel { {}, "Strictness Level" };
248-
ConnectionStatus connectionStatus { validator };
248+
ConnectionState connectionStatus { validator };
249249

250250
void savePluginList();
251251

0 commit comments

Comments
 (0)