Beispiel #1
0
    Tooltip::Tooltip(const String& type, const String& name) :
            Window(type, name)
    {
        d_hoverTime     = 0.4f;
        d_displayTime   = 7.5f;
        d_fadeTime      = 0.33f;

        addTooltipProperties();

        setClippedByParent(false);
        setDestroyedByParent(false);
        setAlwaysOnTop(true);

        switchToInactiveState();
    }
Beispiel #2
0
ThorConfigDialog::ThorConfigDialog(ThorConfig *_config, Component *content) : DialogWindow (T("Options"), Colours::white, true, true)
{
	config = _config;
	if (content)
	{
		setContentComponent (content);
		setName (content->getName());
	}
	else
		setContentComponent (configComponent = new ThorConfigComponent(config));

	setTitleBarHeight (16);
	enterModalState (true);
	setVisible (true);
	setAlwaysOnTop(true);
}
    TempDialogWindow (const String& title,
                      Component* contentComponent_,
                      Component* componentToCentreAround,
                      const Colour& colour,
                      const bool escapeKeyTriggersCloseButton_,
                      const bool shouldBeResizable,
                      const bool useBottomRightCornerResizer)
        : DialogWindow (title, colour, escapeKeyTriggersCloseButton_, true)
    {
        if (! JUCEApplication::isStandaloneApp())
            setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level

        setContentNonOwned (contentComponent_, true);
        centreAroundComponent (componentToCentreAround, getWidth(), getHeight());
        setResizable (shouldBeResizable, useBottomRightCornerResizer);
    }
    DefaultDialogWindow (LaunchOptions& options)
        : DialogWindow (options.dialogTitle, options.dialogBackgroundColour,
                        options.escapeKeyTriggersCloseButton, true)
    {
        setUsingNativeTitleBar (options.useNativeTitleBar);

        if (! JUCEApplication::isStandaloneApp())
            setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level

        if (options.content.willDeleteObject())
            setContentOwned (options.content.release(), true);
        else
            setContentNonOwned (options.content.release(), true);

        centreAroundComponent (options.componentToCentreAround, getWidth(), getHeight());
        setResizable (options.resizable, options.useBottomRightCornerResizer);
    }
TooltipWindow::TooltipWindow (Component* const parentComp, const int delayMs)
    : Component ("tooltip"),
      lastComponentUnderMouse (nullptr),
      millisecondsBeforeTipAppears (delayMs),
      mouseClicks (0), mouseWheelMoves (0),
      lastCompChangeTime (0), lastHideTime (0),
      reentrant (false)
{
    if (Desktop::getInstance().getMainMouseSource().canHover())
        startTimer (123);

    setAlwaysOnTop (true);
    setOpaque (true);

    if (parentComp != nullptr)
        parentComp->addChildComponent (this);
}
TooltipWindow::TooltipWindow (Component* const parent_,
                              const int millisecondsBeforeTipAppears_)
    : Component ("tooltip"),
      millisecondsBeforeTipAppears (millisecondsBeforeTipAppears_),
      mouseClicks (0),
      lastHideTime (0),
      lastComponentUnderMouse (nullptr),
      changedCompsSinceShown (true)
{
    if (Desktop::getInstance().getMainMouseSource().canHover())
        startTimer (123);

    setAlwaysOnTop (true);
    setOpaque (true);

    if (parent_ != nullptr)
        parent_->addChildComponent (this);
}
Beispiel #7
0
//==============================================================================
TrackBox::TrackBox (String trackName_, Colour trackColour_, int trackIndex_, int trackGroupIndex_)
    : trackName(trackName_),
      trackColour(trackColour_),
      trackIndex(trackIndex_),
      trackGroupIndex(trackGroupIndex_)
{
    setName ("TrackBox");

    //[UserPreSize]
    //[/UserPreSize]

    setSize (75, 40);


    //[Constructor] You can add your own custom stuff here..
    // make sure these are always on top of TrackGroupContainers
    setAlwaysOnTop(true);
    //[/Constructor]
}
Beispiel #8
0
//==============================================================================
AlertWindow::AlertWindow (const String& title,
                          const String& message,
                          AlertIconType iconType,
                          Component* comp)
   : TopLevelWindow (title, true),
     alertIconType (iconType),
     associatedComponent (comp),
     escapeKeyCancels (true)
{
    setAlwaysOnTop (juce_areThereAnyAlwaysOnTopWindows());

    if (message.isEmpty())
        text = " "; // to force an update if the message is empty

    setMessage (message);

    AlertWindow::lookAndFeelChanged();
    constrainer.setMinimumOnscreenAmounts (0x10000, 0x10000, 0x10000, 0x10000);
}
void SplashScreen::makeVisible (int w, int h, bool useDropShadow, bool fullscreen)
{
    clickCountToDelete = Desktop::getInstance().getMouseButtonClickCounter();
    creationTime = Time::getCurrentTime();

    const Rectangle<int> screenSize = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
    const int width  = (fullscreen ? screenSize.getWidth()   : w);
    const int height = (fullscreen ? screenSize.getHeight()  : h);

    setAlwaysOnTop (true);
    setVisible (true);
    centreWithSize (width, height);
    addToDesktop (useDropShadow ? ComponentPeer::windowHasDropShadow : 0);

    if (fullscreen)
        getPeer()->setFullScreen (true);

    toFront (false);
}
Beispiel #10
0
CallOutBox::CallOutBox (Component& c, const Rectangle<int>& area, Component* const parent)
    : arrowSize (16.0f), content (c), dismissalMouseClicksAreAlwaysConsumed (false)
{
    addAndMakeVisible (content);

    if (parent != nullptr)
    {
        parent->addChildComponent (this);
        updatePosition (area, parent->getLocalBounds());
        setVisible (true);
    }
    else
    {
        setAlwaysOnTop (juce_areThereAnyAlwaysOnTopWindows());

        updatePosition (area, Desktop::getInstance().getDisplays()
                                .getDisplayContaining (area.getCentre()).userArea);

        addToDesktop (ComponentPeer::windowIsTemporary);
    }
}
CallOutBox::CallOutBox (Component& c, const Rectangle<int>& area, Component* const parent)
    : borderSpace (20), arrowSize (16.0f), content (c)
{
    addAndMakeVisible (&content);

    if (parent != nullptr)
    {
        parent->addChildComponent (this);
        updatePosition (area, parent->getLocalBounds());
        setVisible (true);
    }
    else
    {
        if (! JUCEApplication::isStandaloneApp())
            setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level

        updatePosition (area, Desktop::getInstance().getDisplays()
                                .getDisplayContaining (area.getCentre()).userArea);

        addToDesktop (ComponentPeer::windowIsTemporary);
    }
}
//--------------------------------------------------------------
void testApp::setup() {
//  ofSetLogLevel(OF_LOG_VERBOSE);
//  ofSetVerticalSync(true);
  ofSetFrameRate(10);
  ofSetWindowShape(400, 400);
  setAlwaysOnTop();
  
  ofDirectory dir;
  dir.listDir("nameko");
  for (int i = 0; i < dir.numFiles(); ++i) {
    ofFile file = dir[i];
    int x = strtol(file.getBaseName().c_str(), NULL, 16);
    ofImage *n = new ofImage();
    n->loadImage(file.getAbsolutePath());
    nameko.insert(make_pair(x, n));
  }
  
  verticalFrame.loadImage("vertical-frame.png");
  horizontalFrame.loadImage("horizontal-frame.png");
  
  mouseThread.startThread(true, false);
}
Beispiel #13
0
PluginWindow::PluginWindow (Component* const pluginEditor,
                            AudioProcessorGraph::Node* const o,
                            WindowFormatType t)
    : DocumentWindow (pluginEditor->getName(), Colours::black,
                      DocumentWindow::minimiseButton | DocumentWindow::closeButton),
    owner (o),
    type (t),
    editor(pluginEditor),
    basicLookAndFeel(new CabbageLookAndFeelBasic())
{
    setSize (400, 300);
    this->setTitleBarHeight(18);
    //setLookAndFeel(basicLookAndFeel);
    setContentOwned (pluginEditor, true);

    setTopLeftPosition (owner->properties.getWithDefault ("uiLastX", Random::getSystemRandom().nextInt (500)),
                        owner->properties.getWithDefault ("uiLastY", Random::getSystemRandom().nextInt (500)));
    setVisible (true);
    setAlwaysOnTop(true);
    activePluginWindows.add (this);
    startTimer(100);
}
Beispiel #14
0
UploadWindow::UploadWindow()
{
	setSize(96, 96);
	setOpaque(true);
	addToDesktop(0);
	setAlwaysOnTop(true);

	juce::Rectangle<int> rc = Desktop::getInstance().getDisplays().getMainDisplay().userArea;

	Settings* settings = Settings::getInstance();
	if (settings->x == -1 || settings->y == -1 || !Desktop::getInstance().getDisplays().getTotalBounds(true).contains(settings->x, settings->y))
		setTopLeftPosition(rc.getRight() - 96 - 7, rc.getBottom() - 96 - 7);
	else
		setTopLeftPosition(settings->x, settings->y);

	setVisible(true);
	
#if defined (JUCE_WIN32) || defined (JUCE_LINUX)
	trayIcon = new TrayIcon(this);
#endif
#ifdef JUCE_MAC
	MenuBarModel::setMacMainMenu(this);
#endif
}
BEGIN_JUCE_NAMESPACE

#include "juce_CallOutBox.h"
#include "juce_ComponentPeer.h"
#include "../lookandfeel/juce_LookAndFeel.h"
#include "../../../application/juce_Application.h"


//==============================================================================
CallOutBox::CallOutBox (Component& contentComponent,
                        Component& componentToPointTo,
                        Component* const parentComponent)
    : borderSpace (20), arrowSize (16.0f), content (contentComponent)
{
    addAndMakeVisible (&content);

    if (parentComponent != 0)
    {
        parentComponent->addChildComponent (this);

        updatePosition (parentComponent->getLocalArea (&componentToPointTo, componentToPointTo.getLocalBounds()),
                        parentComponent->getLocalBounds());

        setVisible (true);
    }
    else
    {
        if (! JUCEApplication::isStandaloneApp())
            setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level

        updatePosition (componentToPointTo.getScreenBounds(),
                        componentToPointTo.getParentMonitorArea());

        addToDesktop (ComponentPeer::windowIsTemporary);
    }
}
//==============================================================================
JUCESplashScreen::JUCESplashScreen (Component& parent)
{
    ignoreUnused (hasStartedFading);
    ignoreUnused (parent);

   #if JUCE_REPORT_APP_USAGE
    if (! appUsageReported)
    {
        const ScopedTryLock appUsageReportingLock (appUsageReporting);

        if (appUsageReportingLock.isLocked() && ! appUsageReported)
        {
            const auto deviceDescription = SystemStats::getDeviceDescription();
            const auto deviceString = SystemStats::getDeviceIdentifiers().joinIntoString (":");
            const auto deviceIdentifier = String::toHexString (deviceString.hashCode64());
            const auto osName = SystemStats::getOperatingSystemName();

            StringPairArray data;

            data.set ("v",   "1");
            data.set ("tid", "UA-19759318-3");
            data.set ("cid", deviceIdentifier);
            data.set ("t",   "event");
            data.set ("ec",  "info");
            data.set ("ea",  "appStarted");

            data.set ("cd1", SystemStats::getJUCEVersion());
            data.set ("cd2", osName);
            data.set ("cd3", deviceDescription);
            data.set ("cd4", deviceIdentifier);

            String appType, appName, appVersion, appManufacturer;

           #if defined(JucePlugin_Name)
            appType         = "Plugin";
            appName         = JucePlugin_Name;
            appVersion      = JucePlugin_VersionString;
            appManufacturer = JucePlugin_Manufacturer;
           #else
            if (JUCEApplicationBase::isStandaloneApp())
            {
                appType = "Application";

                if (auto* app = JUCEApplicationBase::getInstance())
                {
                    appName    = app->getApplicationName();
                    appVersion = app->getApplicationVersion();
                }
            }
            else
            {
                appType = "Library";
            }
           #endif

            data.set ("cd5", appType);
            data.set ("cd6", appName);
            data.set ("cd7", appVersion);
            data.set ("cd8", appManufacturer);

            data.set ("an", appName);
            data.set ("av", appVersion);

            auto agentCPUVendor = SystemStats::getCpuVendor();

            if (agentCPUVendor.isEmpty())
                agentCPUVendor = "CPU";

            auto agentOSName = osName.replaceCharacter ('.', '_')
                                     .replace ("iOS", "iPhone OS");
           #if JUCE_IOS
            agentOSName << " like Mac OS X";
           #endif

            String userAgent;
            userAgent << "Mozilla/5.0 ("
                      << deviceDescription << ";"
                      << agentCPUVendor << " " << agentOSName << ";"
                      << SystemStats::getDisplayLanguage() << ")";

            ReportingThreadContainer::getInstance()->sendReport ("https://www.google-analytics.com/collect", userAgent, data);

            appUsageReported = true;
        }
    }
   #else
    ignoreUnused (appUsageReported);
   #endif

   #if JUCE_DISPLAY_SPLASH_SCREEN
    if (splashDisplayTime == 0
         || Time::getMillisecondCounter() < splashDisplayTime + (uint32) millisecondsToDisplaySplash)
    {
        content = getSplashScreenLogo();

        setAlwaysOnTop (true);
        parent.addAndMakeVisible (this);
    }
    else
   #endif
    {
        startTimer (1);
    }
}
 DraggerOverlayComp()
 {
     setMouseCursor (MouseCursor::DraggingHandCursor);
     setAlwaysOnTop (true);
 }
Beispiel #18
0
// Initialize GLUT & OpenSG and start the cluster server
int main(int argc,char **argv)
{
#ifdef WIN32
	OSG::preloadSharedObject("OSGFileIO");
    OSG::preloadSharedObject("OSGImageFileIO");
	OSG::preloadSharedObject("OSGEffectGroups");
#endif
	ChangeList::setReadWriteDefault();
    osgInit(argc, argv);
	
	std::string name("ClusterServer");
    std::string connectionType("StreamSock");
    std::string address("127.0.0.1");
	bool fullscreen = true;
	bool always_on_top = false;
	bool stereo = false;
	WindowGeometry geometry = {0,0,500,500};

	if (!parseCmdLineArgs(argc, argv, name, connectionType, address, geometry, fullscreen, always_on_top, stereo))
		return 0;

	printConfiguration(name, address, connectionType, stereo, fullscreen, always_on_top);

    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE | (stereo ? GLUT_STEREO : 0));
	glutInitWindowPosition(geometry.x, geometry.y);
	glutInitWindowSize(geometry.w, geometry.h);
    int winid = glutCreateWindow(name.c_str());
    if(fullscreen) 
	{
        glutFullScreen();
    }
	if (always_on_top)
	{
		setAlwaysOnTop(name);
	}
    glutDisplayFunc(display);
    glutIdleFunc(display);
    glutReshapeFunc(reshape);
    glutSetCursor(GLUT_CURSOR_NONE);

    ract = RenderAction::create();

    window     = GLUTWindow::create();
	OSGCompat::setGlutId(window, winid);
    window->init();

	bool failed = false;
	do
	{
		try 
		{
			delete server;
			server = new ClusterServer(window, name, connectionType, address);
			server->start();
			failed = false;
		}
		catch (OSG_STDEXCEPTION_NAMESPACE::exception& e)
		{
			SLOG << "ERROR: " << e.what() << endLog;
			SLOG << "Attempting to restart ClusterServer..." << endLog;
			failed = true;
		}
	} while (failed);

    glutMainLoop();

    return 0;
}
Beispiel #19
0
void MainWindow::actionAlwaysOnTop(bool checked){
    setAlwaysOnTop(checked);

    updateAlwaysOnTop();
}
Beispiel #20
0
 TargetGroupHighlight()
 {
     setAlwaysOnTop (true);
     setInterceptsMouseClicks (false, false);
 }
Beispiel #21
0
void Clock::setAlwaysOnTopSlot()
{
    m_isAlwaysOnTop = alwaysOnTopAct->isChecked();
    setAlwaysOnTop();
}
 CaretComponent()
 {
     setAlwaysOnTop (true);
     setInterceptsMouseClicks (false, false);
 }
Beispiel #23
0
void Task::toggleAlwaysOnTop()
{
    setAlwaysOnTop( !isAlwaysOnTop() );
}
Beispiel #24
0
/// Create dialog window for selecting a new GUI skin.
///
/// @param editorWindow pointer to the plug-in GUI
///
/// @param currentSkinFile file pointing to the currently used skin
///
/// ### Exit values
///
/// | %Value | %Result                           |
/// | :----: | --------------------------------- |
/// | 0      | window has been closed "by force" |
/// | 1      | user has selected a skin          |
///
GenericWindowSkin::GenericWindowSkin(Component *editorWindow, const File &currentSkinFile)
    : DocumentWindow("Select skin", Colours::white, 0, true)
{
    // dialog window dimentsions
    int windowWidth = 150;
    int windowHeight = 0;

    // empty windows are boring, so let's prepare a space for some
    // window components
    setContentOwned(&contentComponent, false);

    // locate skin directory and fill list box model
    File fileSkinDirectory = currentSkinFile.getParentDirectory();
    listBoxModel.fill(fileSkinDirectory);

    // set model for list box
    listBox.setModel(&listBoxModel);

    // calculate and set list box dimensions
    int listBoxWidth = windowWidth - 20;
    int listBoxHeight = listBoxModel.getNumRows() * listBox.getRowHeight() + 2;
    listBox.setBounds(10, 10, listBoxWidth, listBoxHeight);

    // set look of list box
    listBox.setColour(ListBox::outlineColourId, Colours::grey);
    listBox.setOutlineThickness(1);

    // disable multiple selections
    listBox.setMultipleSelectionEnabled(false);

    // select current skin in list box
    currentSkinName = currentSkinFile.getFileNameWithoutExtension();
    int rowNumber = listBoxModel.getRow(currentSkinName);
    listBox.selectRow(rowNumber);

    // display list box
    contentComponent.addAndMakeVisible(listBox);

    // calculate dialog window height from height of list box
    windowHeight = listBoxHeight + 50;

    // create and position an "select" button
    buttonSelect.setButtonText("Select");
    buttonSelect.setBounds(10, windowHeight - 30, 60, 20);
    buttonSelect.setColour(TextButton::buttonColourId, Colours::red);
    buttonSelect.setColour(TextButton::buttonOnColourId, Colours::red);

    // add "skin" window as button listener and display the button
    buttonSelect.addListener(this);
    contentComponent.addAndMakeVisible(buttonSelect);

    // create and position an "default" button
    buttonDefault.setButtonText("Default");
    buttonDefault.setBounds(windowWidth - 70, windowHeight - 30, 60, 20);
    buttonDefault.setColour(TextButton::buttonColourId, Colours::yellow);
    buttonDefault.setColour(TextButton::buttonOnColourId, Colours::yellow);

    // add "skin" window as button listener and display the button
    buttonDefault.addListener(this);
    contentComponent.addAndMakeVisible(buttonDefault);

    // set window dimensions
    setSize(windowWidth, windowHeight + getTitleBarHeight());

    // keep dialog window on top
    setAlwaysOnTop(true);

    // center window on editor
    centreAroundComponent(editorWindow, getWidth(), getHeight());

    // this window does not have any transparent areas (increases
    // performance on redrawing)
    setOpaque(true);

    // finally, display window
    setVisible(true);
}
Beispiel #25
0
int Cconfigurator::loadConfig(QByteArray path, QByteArray filename)
{
	int size;
	QSettings conf(path + filename, QSettings::IniFormat);

	conf.beginGroup("General");
    setBaseFile( conf.value("mapFile", "database/mume.pmf").toByteArray() );
	setWindowRect( conf.value("windowRect").toRect() );
	setAlwaysOnTop( conf.value("alwaysOnTop", true ).toBool() );
	setStartupMode( conf.value("startupMode", 1).toInt() );
    setLogFileEnabled( conf.value("isLogFileEnabled", false).toBool() );
	conf.endGroup();

	conf.beginGroup("Networking");
	setLocalPort( conf.value("localPort", 4242).toInt() );
	setRemoteHost( conf.value("remoteHost", "193.134.218.111").toByteArray() );
	setRemotePort( conf.value("remotePort", 443).toInt() );
	conf.endGroup();

	conf.beginGroup("OpenGL");
	setTextureVisibility( conf.value("texturesVisibility", 500).toInt() );
	setDetailsVisibility( conf.value("detailsVisibility", 300).toInt() );
	setVisibleLayers( conf.value("visibleLayers", 5).toInt() );
	setShowNotesRenderer( conf.value("showNotes", true).toBool() );
	setShowRegionsInfo( conf.value("showRegions", false). toBool() );
	setDisplayRegionsRenderer( conf.value("displayRegions", false).toBool() );
	setMultisampling( conf.value("multisampling", true).toBool() );
	setSelectOAnyLayer( conf.value("selectOnAnyLayer", true).toBool() );
    setRendererAngles(conf.value("angleX", 0).toFloat(), conf.value("angleY", 0).toFloat(), conf.value("angleZ", 0).toFloat());
    setRendererPosition(conf.value("userX", 0).toFloat(), conf.value("userY", 0).toFloat(), conf.value("userZ", 0).toFloat());
    setNoteColor( conf.value("noteColor", "#F28003").toByteArray() );
    setDrawPrespam(  conf.value("drawPrespam", true).toBool() );

	conf.endGroup();

	conf.beginGroup("Engine");
	setExitsCheck( conf.value("checkExits", false).toBool() );
	setTerrainCheck( conf.value("checkTerrain", true).toBool() );
	setBriefMode( conf.value("briefmode", true ).toBool() );
	setAutomerge( conf.value("autoMerge", true ).toBool() );
	setAngrylinker( conf.value("angryLinker", true ).toBool() );
	setDuallinker( conf.value("dualLinker", false ).toBool() );
	setAutorefresh( conf.value("autoRefresh", true ).toBool() );
	setNameQuote( conf.value("roomNameQuote", 10 ).toInt() );
	setDescQuote( conf.value("descQuote", 10 ).toInt() );
	setRegionsAutoReplace( conf.value("regionsAutoReplace", false ).toBool() );
	setRegionsAutoSet( conf.value("regionsAutoSet", false ).toBool() );
	setMactionUsesPrespam( conf.value("mactionUsesPrespam", true).toBool() );
	setPrespamTTL( conf.value("prespamTTL", 5000).toInt() );

	conf.endGroup();

    conf.beginGroup("Patterns");
    setExitsPattern( conf.value("exitsPattern", "Exits: ").toByteArray() );
    spells_pattern = conf.value("spellsEffectPattern", "Affected by:").toByteArray();
    setScorePattern( conf.value("scorePattern", "[0-9]*/* hits, */* mana, and */* moves.").toByteArray()  );
    setShortScorePattern( conf.value("scorePatternShort", "[0-9]*/* hits and */* moves.").toByteArray() );
	conf.endGroup();


	conf.beginGroup("GroupManager");
	setGroupManagerHost( conf.value("remoteHost", "localhost").toByteArray() );
	setGroupManagerRemotePort( conf.value("remotePort", 4243 ).toInt() );
	setGroupManagerLocalPort( conf.value("localServerPort", 4243 ).toInt() );
	setGroupManagerCharName( conf.value("charName", "Charname" ).toByteArray() );
	setGroupManagerColor( QColor( conf.value("charColor", "#F28003").toString() ) );
	setGroupManagerShowSelf( conf.value("showSelf", false ).toBool() );
	setGroupManagerNotifyArmour( conf.value("notifyArm", true ).toBool() );
	setGroupManagerNotifySanc( conf.value("notifySanc", true ).toBool() );
	setGroupManagerNotifyBash( conf.value("notifyBash", true ).toBool() );
	setGroupManagerShowManager( conf.value("showGroupManager", true ).toBool() );
	setGroupManagerRect( conf.value("windowRect").toRect() );
	conf.endGroup();


	size = conf.beginReadArray("Spells");
	for (int i = 0; i < size; ++i) {
	  conf.setArrayIndex(i);
	  TSpell spell;

      spell.up = false;
      spell.silently_up = false;
	  spell.addon = conf.value("addon", 0).toBool();
	  spell.name = conf.value("name").toByteArray();
	  spell.up_mes = conf.value("upMessage").toByteArray();
	  spell.refresh_mes = conf.value("refreshMessage").toByteArray();
	  spell.down_mes = conf.value("downMessage").toByteArray();

      addSpell(spell);
	}
	conf.endArray();


	conf.beginGroup("Movement tracking");
	size = conf.beginReadArray("Cancel Patterns");
	for (int i = 0; i < size; ++i) {
	  conf.setArrayIndex(i);
	  moveCancelPatterns.append( conf.value("pattern").toByteArray() );
	}
	conf.endArray();
	size = conf.beginReadArray("Force Patterns");
	for (int i = 0; i < size; ++i) {
	  conf.setArrayIndex(i);
	  moveForcePatterns.append( conf.value("pattern").toByteArray() );
	}
	conf.endArray();
	conf.endGroup();

	size = conf.beginReadArray("Debug Settings");
	for (int i = 0; i < size; ++i) {
	  conf.setArrayIndex(i);

      QString s = conf.value("name").toString();

	  unsigned int z = 0;
      while (debug_data[z].name != NULL) {
          if (debug_data[z].name == s)
              break;
          z++;
      }
      if (debug_data[z].name == NULL) {
          print_debug(DEBUG_CONFIG, "Warning, %s is a wrong debug descriptor/name!", qPrintable(s));
          continue;
      }

      debug_data[i].state = conf.value("state", 0 ).toInt();
	}
	conf.endArray();

	configFile = filename;
	configPath = path;

	setConfigModified(false);
	return true;
}
Beispiel #26
0
void MMSWindowClass::setAttributesFromTAFF(MMSTaffFile *tafff, string *path, bool reset_paths) {
    MMSFBColor color;

    if ((reset_paths)&&(path)&&(*path!="")) {
    	// unset my paths
    	unsetBgImagePath();
    }

	startTAFFScan
	{
        switch (attrid) {
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_alignment:
            setAlignment(getAlignmentFromString(attrval_str));
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_dx:
            setDx(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_dy:
            setDy(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_w:
            setWidth(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_h:
            setHeight(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgcolor:
            setBgColor(MMSFBColor((unsigned int)attrval_int));
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgcolor_a:
			color.a = color.r = color.g = color.b = 0;
            if (isBgColor()) getBgColor(color);
            color.a = attrval_int;
            setBgColor(color);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgcolor_r:
			color.a = color.r = color.g = color.b = 0;
            if (isBgColor()) getBgColor(color);
            color.r = attrval_int;
            setBgColor(color);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgcolor_g:
			color.a = color.r = color.g = color.b = 0;
            if (isBgColor()) getBgColor(color);
            color.g = attrval_int;
            setBgColor(color);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgcolor_b:
			color.a = color.r = color.g = color.b = 0;
            if (isBgColor()) getBgColor(color);
            color.b = attrval_int;
            setBgColor(color);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgimage:
            if (*attrval_str)
                setBgImagePath("");
            else
                setBgImagePath((path)?*path:"");
            setBgImageName(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgimage_path:
            if (*attrval_str)
                setBgImagePath(attrval_str);
            else
                setBgImagePath((path)?*path:"");
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_bgimage_name:
            setBgImageName(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_opacity:
            setOpacity(attrval_int);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_fadein:
            setFadeIn((attrval_int) ? true : false);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_fadeout:
            setFadeOut((attrval_int) ? true : false);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_debug:
            setDebug((attrval_int) ? true : false);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_margin:
            setMargin(attrval_int);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_up_arrow:
            setUpArrow(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_down_arrow:
            setDownArrow(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_left_arrow:
            setLeftArrow(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_right_arrow:
            setRightArrow(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_navigate_up:
            setNavigateUp(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_navigate_down:
            setNavigateDown(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_navigate_left:
            setNavigateLeft(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_navigate_right:
            setNavigateRight(attrval_str);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_own_surface:
#ifdef __HAVE_DIRECTFB__
			if(attrval_int) {
				MMSConfigData config;
				if(config.getBackend() == MMSFB_BE_DFB) {
					cerr << "Warning: DirectFB backend does not support own_surface=true (ignored)" << endl;
					break;
				}
			}
#endif
            setOwnSurface((attrval_int) ? true : false);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_movein:
            setMoveIn(getDirectionFromString(attrval_str));
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_moveout:
            setMoveOut(getDirectionFromString(attrval_str));
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_modal:
            setModal((attrval_int) ? true : false);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_static_zorder:
            setStaticZOrder((attrval_int) ? true : false);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_always_on_top:
            setAlwaysOnTop((attrval_int) ? true : false);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_focusable:
            setFocusable((attrval_int) ? true : false);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_backbuffer:
            setBackBuffer((attrval_int) ? true : false);
            break;
		case MMSGUI_WINDOW_ATTR::MMSGUI_WINDOW_ATTR_IDS_initial_load:
            setInitialLoad((attrval_int) ? true : false);
            break;
		}
	}
	endTAFFScan

    if ((reset_paths)&&(path)&&(*path!="")) {
    	// set my paths
    	if (!isBgImagePath())
    		setBgImagePath(*path);
    }
}
WindowAbout::WindowAbout(int nWidth, int nHeight)
    : ResizableWindow(T("About K-Meter"), false)
    // create new window child of width "nWidth" and height "nHeight"
{
    // set dimensions to those passed to the function ...
    setBounds(0, 0, nWidth, nHeight);
    // ... and keep the new window on top
    setAlwaysOnTop(true);

    // prohibit movement of the new window
    pConstrainer = new ProhibitingBoundsConstrainer();
    setConstrainer(pConstrainer);

    // empty windows are boring, so let's prepare a space for some
    // window components
    contentComponent = new Component(T("Window Area"));
    setContentComponent(contentComponent);

    // create a word-wrapping read-only text editor component with
    // multiple lines for displaying information about the plug-in
    TextEditorAbout = new TextEditor(T("About Text"));
    TextEditorAbout->setMultiLine(true, true);
    TextEditorAbout->setReadOnly(true);

    // initialise colours of the text editor component
    TextEditorAbout->setColour(TextEditor::backgroundColourId, Colours::black.withAlpha(0.25f));
    TextEditorAbout->setColour(TextEditor::textColourId, Colours::white);
    TextEditorAbout->setColour(TextEditor::highlightColourId, Colours::white.withAlpha(0.25f));
    TextEditorAbout->setColour(TextEditor::highlightedTextColourId, Colours::white);

    // set up two fonts, one for headlines and one for regular text
    Font fontHeadline(15.0f, Font::bold);
    Font fontRegular(13.0f, Font::plain);

    // display plug-in name and version number
    TextEditorAbout->setFont(fontHeadline);
    TextEditorAbout->insertTextAtCaret(
        String("K-Meter ") + JucePlugin_VersionString + T("\n")
    );

    // display plug-in description
    TextEditorAbout->setFont(fontRegular);
    TextEditorAbout->insertTextAtCaret(
        String(JucePlugin_Desc) + T(".\n\n")
    );

    // display the contributors
    TextEditorAbout->setFont(fontHeadline);
    TextEditorAbout->insertTextAtCaret(
        T("Contributors\n")
    );

    TextEditorAbout->setFont(fontRegular);
    TextEditorAbout->insertTextAtCaret(
        L"Martin Zuther\n"
        L"Bob Katz\n"
        L"bram@smartelectronix\n\n"
    );

    // display copyright notice
    TextEditorAbout->setFont(fontHeadline);
    TextEditorAbout->insertTextAtCaret(
        T("Copyright\n")
    );

    TextEditorAbout->setFont(fontRegular);
    TextEditorAbout->insertTextAtCaret(
        T("(c) 2010-2011 Contributors\n\n")
    );

    // display used libraries
    TextEditorAbout->setFont(fontHeadline);
    TextEditorAbout->insertTextAtCaret(
        T("Libraries\n")
    );

    TextEditorAbout->setFont(fontRegular);
    TextEditorAbout->insertTextAtCaret(
#ifdef LINUX
        L"ALSA\n"
#endif
        L"FFTW\n"
#ifdef LINUX
        L"FreeType\n"
#endif
        L"JUCE\n"
#ifdef LINUX
        L"POSIX Threads\n"
        L"Xlib\n"
        L"Xext\n"
#endif
        L"\n"
    );

#if (JUCE_USE_VSTSDK_2_4 != 0)

    // display trademarks (but only when necessary)
    TextEditorAbout->setFont(fontHeadline);
    TextEditorAbout->insertTextAtCaret(
        T("Trademarks\n")
    );

    TextEditorAbout->setFont(fontRegular);
    TextEditorAbout->insertTextAtCaret(
        T("VST PlugIn Technology by Steinberg\n\n")
    );

#endif

#if (JUCE_ASIO != 0)

    // display trademarks (but only when necessary)
    TextEditorAbout->setFont(fontHeadline);
    TextEditorAbout->insertTextAtCaret(
        T("Trademarks\n")
    );

    TextEditorAbout->setFont(fontRegular);
    TextEditorAbout->insertTextAtCaret(
        T("ASIO Technology by Steinberg Media Technologies GmbH\n\n")
    );

#endif

    // display license summary
    TextEditorAbout->setFont(fontHeadline);
    TextEditorAbout->insertTextAtCaret(
        T("License\n")
    );

    TextEditorAbout->setFont(fontRegular);
    TextEditorAbout->insertTextAtCaret(
        L"This program is free software: you can redistribute it and/or modify "
        L"it under the terms of the GNU General Public License as published by "
        L"the Free Software Foundation, either version 3 of the License, or "
        L"(at your option) any later version.\n\n"

        L"This program is distributed in the hope that it will be useful, "
        L"but WITHOUT ANY WARRANTY; without even the implied warranty of "
        L"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
        L"GNU General Public License for more details.\n\n"

        L"You should have received a copy of the GNU General Public License "
        L"along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n"

        L"Thank you for using free software!\n\n"
    );

    // in case the text has become too long to fit into the text
    // editor component, scroll to the beginning
    TextEditorAbout->setCaretPosition(0);
    TextEditorAbout->scrollEditorToPositionCaret(0, 0);

    // finally, position and display the text editor component
    TextEditorAbout->setBounds(0, 0, nWidth, nHeight - 47);
    contentComponent->addAndMakeVisible(TextEditorAbout);

    // create and position an "about" button that appears as if it
    // were pressed down and which closes the window when clicked
    ButtonAbout = new TextButton(T("About"));
    ButtonAbout->setBounds(nWidth - 73, nHeight - 34, 60, 20);
    ButtonAbout->setColour(TextButton::buttonColourId, Colours::yellow);
    ButtonAbout->setColour(TextButton::buttonOnColourId, Colours::grey);

    // add "about" window as button listener and display the button
    ButtonAbout->addButtonListener(this);
    contentComponent->addAndMakeVisible(ButtonAbout);

    // prepare an image button by loading its images from memory
    ImageButtonGplNormal = ImageCache::getFromMemory(resources::button_gpl_normal_png, resources::button_gpl_normal_pngSize);
    ImageButtonGplOver = ImageCache::getFromMemory(resources::button_gpl_over_png, resources::button_gpl_over_pngSize);
    ImageButtonGplDown = ImageCache::getFromMemory(resources::button_gpl_down_png, resources::button_gpl_down_pngSize);

    // create and position the image button which opens the license
    // text in a web browser
    ButtonGpl = new ImageButton(T("GPL Link"));
    ButtonGpl->setBounds(4, nHeight - 41, 64, 32);
    ButtonGpl->setImages(true, false, true,
                         ImageButtonGplNormal, 1.0f, Colour(),
                         ImageButtonGplOver, 1.0f, Colour(),
                         ImageButtonGplDown, 1.0f, Colour()
                        );

    // add "about" window as button listener and display the button
    ButtonGpl->addButtonListener(this);
    contentComponent->addAndMakeVisible(ButtonGpl);
}