Skip to content

Commit

Permalink
Mac add missing Qt framework
Browse files Browse the repository at this point in the history
  • Loading branch information
MizPlusPlus committed May 7, 2018
1 parent 4d4cfc5 commit b3f6d20
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion OSCWidgets.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion OSCWidgets/EosPlatform.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion OSCWidgets/EosPlatform.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 4 additions & 1 deletion OSCWidgets/EosPlatform_Mac.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -41,7 +41,10 @@ EosPlatform_Mac::~EosPlatform_Mac()
bool EosPlatform_Mac::Initialize(std::string &error)
{
if(m_Platform == 0)
{
m_Platform = Bridge_CreatePlatform(error);
Bridge_InitQtPlugins();
}

return (m_Platform != 0);
}
Expand Down
2 changes: 1 addition & 1 deletion OSCWidgets/EosPlatform_Mac.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion OSCWidgets/EosPlatform_Mac_Bridge.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -29,6 +29,7 @@ void* Bridge_CreatePlatform(std::string &error);
void Bridge_DestroyPlatform(void *platform);
void* Bridge_BeginActivity(const std::string &reason, std::string &error);
void Bridge_EndActivity(void *activity);
void Bridge_InitQtPlugins();

////////////////////////////////////////////////////////////////////////////////

Expand Down
2 changes: 1 addition & 1 deletion OSCWidgets/EosPlatform_Mac_Native.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 18 additions & 1 deletion OSCWidgets/EosPlatform_Mac_Native.mm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015 Electronic Theatre Controls, Inc., http://www.etcconnect.com
// Copyright (c) 2018 Electronic Theatre Controls, Inc., http://www.etcconnect.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand All @@ -20,6 +20,9 @@

#import "EosPlatform_Mac_Native.h"
#import "EosPlatform_Mac_Bridge.h"
#import <QtWidgets/QApplication>
#import <QtCore/QDir>
#import <QtCore/QUrl>

////////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -112,3 +115,17 @@ + (void)EndActivity:(id)activity
@end

////////////////////////////////////////////////////////////////////////////////

void Bridge_InitQtPlugins()
{
// only load plugins from our bundle
CFURLRef url = (CFURLRef)CFAutorelease((CFURLRef)CFBundleCopyBundleURL(CFBundleGetMainBundle()));
if(url != nil)
{
QDir dir( QUrl::fromCFURL(url).path() );
if( dir.cd("Contents/Plugins") )
QApplication::setLibraryPaths(QStringList() << dir.canonicalPath());
}
}

////////////////////////////////////////////////////////////////////////////////
2 changes: 1 addition & 1 deletion OSCWidgets/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

////////////////////////////////////////////////////////////////////////////////

#define APP_VERSION "0.7"
#define APP_VERSION "0.8"

#define MIN_OPACITY 10

Expand Down
9 changes: 0 additions & 9 deletions OSCWidgets/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#include "Utils.h"
#include "EosPlatform.h"

// TODO: image format plugins!

////////////////////////////////////////////////////////////////////////////////

int main(int argc, char* argv[])
Expand All @@ -50,13 +48,6 @@ int main(int argc, char* argv[])
}

QApplication app(argc, argv);

#ifndef WIN32
QDir dir( app.applicationDirPath() );
dir.cdUp();
dir.cd("Plugins");
app.setLibraryPaths( QStringList(dir.canonicalPath()) );
#endif

app.setDesktopSettingsAware(false);
app.setQuitOnLastWindowClosed(false);
Expand Down

0 comments on commit b3f6d20

Please sign in to comment.