Exemple #1
0
void LauncherApp::ReadyToRun()
{
	// Since we will essentially run the GUI...
	set_thread_priority(Thread(), B_DISPLAY_PRIORITY);

    BWebPage::InitializeOnce();
    BWebPage::SetCacheModel(B_WEBKIT_CACHE_MODEL_WEB_BROWSER);

	BFile settingsFile;
	BRect windowFrameFromSettings = m_lastWindowFrame;
	if (openSettingsFile(settingsFile, B_READ_ONLY)) {
		BMessage settingsArchive;
		settingsArchive.Unflatten(&settingsFile);
		settingsArchive.FindRect("window frame", &windowFrameFromSettings);
	}
	m_lastWindowFrame = windowFrameFromSettings;

	m_initialized = true;

	if (m_launchRefsMessage) {
		RefsReceived(m_launchRefsMessage);
		delete m_launchRefsMessage;
		m_launchRefsMessage = 0;
	} else {
	    LauncherWindow* window = new LauncherWindow(m_lastWindowFrame);
	    window->Show();
	}
}
Exemple #2
0
void LauncherApp::newWindow(const BString& url)
{
	m_lastWindowFrame.OffsetBy(20, 20);
	if (!BScreen().Frame().Contains(m_lastWindowFrame))
		m_lastWindowFrame.OffsetTo(50, 50);

	LauncherWindow* window = new LauncherWindow(m_lastWindowFrame);
	window->Show();
	if (url.Length())
	    window->CurrentWebView()->LoadURL(url.String());
}
int main(int argc, char** argv)
{
  gtk_init(&argc, &argv);
  nux::logging::configure_logging(::getenv("UNITY_LOG_SEVERITY"));
  nux::NuxInitialize(0);

  LauncherWindow lc;
  lc.Show();

  return 0;
}