Beispiel #1
0
/// <summary>
/// Constructor
/// </summary>
TileGroup::TileGroup(LPCTSTR prefix)
  : Drawable(prefix)
  , mChangeNotifyUID(0)
  , mContextMenu2(nullptr)
  , mContextMenu3(nullptr)
  , mClipBoardCutFiles(false)
  , mInRectangleSelection(false)
  , mNextPositionID(0)
  , mRootFolder(nullptr)
{
  LoadSettings();

  WindowSettings windowSettings;
  windowSettings.Load(mSettings, &sWindowDefaults);
  mStateRender.Load(sInitData, mSettings);

  mSelectionRectagle.Init(mSettings);

  mWindow->Initialize(windowSettings, &mStateRender);
  //mWindow->AddDropRegion();
  mWindow->AddPostPainter(&mSelectionRectagle);
  // TODO::Add the selection rectangle as a brush owner
  mWindow->Show();

  mIconLoadedMessage = mWindow->RegisterUserMessage(this);
  mChangeNotifyMsg = mWindow->RegisterUserMessage(this);

  // Get the root ISHellFolder
  SHGetDesktopFolder(reinterpret_cast<IShellFolder**>(&mRootFolder));

  WCHAR path[MAX_PATH];
  mSettings->GetString(L"Folder", path, _countof(path), L"Desktop");
  SetFolder(path);
}
Beispiel #2
0
/// <summary>
/// Constructor
/// </summary>
Calendar::Calendar(LPCWSTR calendarName)
    : Drawable(calendarName)
{
  WindowSettings windowSettings;
  windowSettings.Load(mSettings);
  mStateRender.Load(mSettings);

  mWindow->Initialize(windowSettings, &mStateRender);
}
DICOMVolume::WindowedImagePointer DICOMVolume::windowed_image(const WindowSettings& windowSettings) const
{
	typedef itk::IntensityWindowingImageFilter<BaseImage,WindowedImage> Windower;

	Windower::Pointer windower = Windower::New();
	windower->SetInput(m_baseImage);
	windower->SetWindowLevel(windowSettings.width(), windowSettings.centre());
	windower->SetOutputMinimum(0);
	windower->SetOutputMaximum(255);
	windower->Update();

	return windower->GetOutput();
}
Beispiel #4
0
/// <summary>
/// Constructor.
/// </summary>
/// <param name="name">The settings prefix to use.</param>
CoverArt::CoverArt(LPCTSTR name) : Drawable(name)
{
    StateRender<States>::InitData initData;
    mStateRender.Load(initData, mSettings);

    WindowSettings defaults;
    WindowSettings windowSettings;
    defaults.width = 200;
    defaults.height = 200;
    defaults.registerWithCore = true;
    windowSettings.Load(mSettings, &defaults);
    mWindow->Initialize(windowSettings, &mStateRender);

    LoadSettings();
    //Update();

    mWindow->Show();
}
Beispiel #5
0
bool Window::createTransferWindow()
{
    LB_TS_THREAD( _pipeThread );
    LBASSERT( _systemWindow );

    if( _transferWindow )
        return true;

    // create another (shared) osWindow with no drawable
    WindowSettings settings = getSettings();
    settings.setIAttribute( WindowSettings::IATTR_HINT_DRAWABLE, OFF );
    const SystemWindow* sysWindow = _sharedContextWindow ?
                                    _sharedContextWindow->getSystemWindow() : 0;
    settings.setSharedContextWindow( sysWindow );
    const Pipe* pipe = getPipe();
    _transferWindow = pipe->getWindowSystem().createWindow( this, settings );

    if( _transferWindow )
    {
        if( !_transferWindow->configInit( ))
        {
            LBWARN << "Transfer window initialization failed" << std::endl;
            delete _transferWindow;
            _transferWindow = 0;
        }
        else
        {
            // #177: It looks like the driver realizes the context on the first
            // makeCurrent
            _transferWindow->makeCurrent();
            _transferWindow->doneCurrent();
        }
    }
    else
        LBERROR << "Window system " << pipe->getWindowSystem()
                << " not implemented or supported" << std::endl;

    makeCurrent();

    LBVERB << "Transfer window initialization finished" << std::endl;
    return _transferWindow != 0;
}
Beispiel #6
0
/// <summary>
/// Constructor
/// </summary>
Clock::Clock(LPCTSTR clockName) : Drawable(clockName) {
  mUse24HourDial = mSettings->GetBool(L"24HourDial", false);

  WindowSettings windowSettings;
  windowSettings.Load(mSettings, &sClockWindowDefaults);
  mStateRender.Load(mSettings);

  mWindow->Initialize(windowSettings, &mStateRender);

  mSecondHand.Initialize(mSettings, L"SecondHand", 60.0f);
  mMinuteHand.Initialize(mSettings, L"MinuteHand", 60.0f);
  mHourHand.Initialize(mSettings, L"HourHand", mUse24HourDial ? 24.0f : 12.0f);

  mWindow->AddPrePainter(&mHourHand);
  mWindow->AddPrePainter(&mMinuteHand);
  mWindow->AddPrePainter(&mSecondHand);

  UpdateHands();
  mUpdateTimer = mWindow->SetCallbackTimer(mSettings->GetInt(L"UpdateRate", 1000), this);

  mWindow->Show();
}
Beispiel #7
0
bool Window::configInitSystemWindow( const uint128_t& )
{
    const Pipe* pipe = getPipe();
    WindowSettings settings = getSettings();
    const SystemWindow* sysWindow = _sharedContextWindow ?
                                    _sharedContextWindow->getSystemWindow() : 0;
    settings.setSharedContextWindow( sysWindow );
    SystemWindow* systemWindow =
        pipe->getWindowSystem().createWindow( this, settings );

    LBASSERT( systemWindow );
    if( !systemWindow->configInit( ))
    {
        LBWARN << "System window initialization failed" << std::endl;
        systemWindow->configExit();
        delete systemWindow;
        return false;
    }

    setPixelViewport( systemWindow->getPixelViewport( ));
    setSystemWindow( systemWindow );
    return true;
}
Beispiel #8
0
static MoonWindow*
create_window (Deployment *deployment, const char *app_id)
{
	MoonAppRecord *app;
	OutOfBrowserSettings *oob;
	WindowSettings *settings;
	MoonWindow *moon_window;
	Surface *surface;

	/* fetch the app record */
	if (!(app = installer->GetAppRecord (app_id))) {
		g_warning ("Could not find application: %s", app_id);
		return NULL;
	}

	/* create the moonlight widget */
	moon_window = winsys->CreateWindow (MoonWindowType_Desktop, 0, 0);
	surface = new Surface (moon_window);
	deployment->SetSurface (surface);
	moon_window->SetSurface (surface);

	if (!load_app (deployment, installer->GetBaseInstallDir (), app))
		return NULL;
	
	surface->AddXamlHandler (Surface::ErrorEvent, error_handler, NULL);
	
	if ((oob = deployment->GetOutOfBrowserSettings ())) {
		load_window_icons (moon_window, deployment, oob->GetIcons ());
		settings = oob->GetWindowSettings ();
	} else
		settings = NULL;
	
	if (settings != NULL) {
		Uri *uri;
		const char *hostname = NULL;

		uri = Uri::Create (app->origin);
		if (uri != NULL)
			hostname = uri->GetHost ();

		if (!hostname || !*hostname)
			hostname = "localhost";

		char *window_title = g_strdup_printf ("%s - %s",
						      settings->GetTitle(),
						      hostname);

		delete uri;

		moon_window->SetTitle (window_title);

		g_free (window_title);

		moon_window->Resize (settings->GetWidth (), settings->GetHeight());
			
		if (settings->GetWindowStartupLocation () == WindowStartupLocationManual) {
			// FIXME: this should really use a MoonWindow::Move
			moon_window->SetLeft (settings->GetLeft ());
			moon_window->SetTop (settings->GetTop ());
		}

		moon_window->SetStyle (settings->GetWindowStyle ());

	} else if (oob != NULL) {
		moon_window->SetTitle (oob->GetShortName ());
	} else {
		moon_window->SetTitle ("Moonlight");
	}
	
	delete app;

	return moon_window;
}
void windowDownloadD::on_settingsButton_clicked()
{
    WindowSettings *centralWindow = new WindowSettings(this,3,this->parentWidget());
    centralWindow->show();
}
void windowLoadMiRNAF::on_settingsButton_clicked()
{
    WindowSettings *centralWindow = new WindowSettings(this,1,this->parentWidget());
    centralWindow->show();
}