forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from daschuer/qopenglwidget
resolve conflicts, Fix OpenGL status
- Loading branch information
Showing
72 changed files
with
1,027 additions
and
329 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
File renamed without changes
File renamed without changes
File renamed without changes
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,36 @@ | ||
#include "controllers/colorjsproxy.h" | ||
|
||
ColorJSProxy::ColorJSProxy(QScriptEngine* pScriptEngine) | ||
: m_pScriptEngine(pScriptEngine), | ||
m_predefinedColorsList(makePredefinedColorsList(pScriptEngine)){}; | ||
|
||
ColorJSProxy::~ColorJSProxy() {}; | ||
|
||
QScriptValue ColorJSProxy::predefinedColorFromId(int iId) { | ||
PredefinedColorPointer color(Color::predefinedColorSet.predefinedColorFromId(iId)); | ||
return jsColorFrom(color); | ||
}; | ||
|
||
Q_INVOKABLE QScriptValue ColorJSProxy::predefinedColorsList() { | ||
return m_predefinedColorsList; | ||
} | ||
|
||
QScriptValue ColorJSProxy::jsColorFrom(PredefinedColorPointer predefinedColor) { | ||
QScriptValue jsColor = m_pScriptEngine->newObject(); | ||
jsColor.setProperty("red", predefinedColor->m_defaultRgba.red()); | ||
jsColor.setProperty("green", predefinedColor->m_defaultRgba.green()); | ||
jsColor.setProperty("blue", predefinedColor->m_defaultRgba.blue()); | ||
jsColor.setProperty("alpha", predefinedColor->m_defaultRgba.alpha()); | ||
jsColor.setProperty("id", predefinedColor->m_iId); | ||
return jsColor; | ||
} | ||
|
||
QScriptValue ColorJSProxy::makePredefinedColorsList(QScriptEngine* pScriptEngine) { | ||
int numColors = Color::predefinedColorSet.allColors.length(); | ||
QScriptValue colorList = pScriptEngine->newArray(numColors); | ||
for (int i = 0; i < numColors; ++i) { | ||
PredefinedColorPointer color = Color::predefinedColorSet.allColors.at(i); | ||
colorList.setProperty(i, jsColorFrom(color)); | ||
} | ||
return colorList; | ||
} |
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,27 @@ | ||
#ifndef COLORJSPROXY_H | ||
#define COLORJSPROXY_H | ||
|
||
#include <QObject> | ||
#include <QScriptEngine> | ||
#include <QScriptValue> | ||
|
||
#include "util/color/color.h" | ||
|
||
class ColorJSProxy: public QObject { | ||
Q_OBJECT | ||
public: | ||
ColorJSProxy(QScriptEngine* pScriptEngine); | ||
|
||
virtual ~ColorJSProxy(); | ||
|
||
Q_INVOKABLE QScriptValue predefinedColorFromId(int iId); | ||
Q_INVOKABLE QScriptValue predefinedColorsList(); | ||
|
||
private: | ||
QScriptValue jsColorFrom(PredefinedColorPointer predefinedColor); | ||
QScriptValue makePredefinedColorsList(QScriptEngine* pScriptEngine); | ||
QScriptEngine* m_pScriptEngine; | ||
QScriptValue m_predefinedColorsList; | ||
}; | ||
|
||
#endif /* COLORJSPROXY_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
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.