Beispiel #1
0
int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
			LPSTR lpCmdLine, int nCmdShow)

{
	int argc = 0;
	char argv = '0';
	//set up the application
	GtApplication::GtApplicationInit(argc,&argv);
	GtApplication* ptrApp = GtApplication::GetAppInstancePtr();
	//set up the event win handle and start the event loop
	if(ptrApp)
	{
		//set up the main window
		TestWindow objMain;
		objMain.Show();

		ptrApp->Set_winID(objMain.Get_winID());
		ptrApp->Set_ptrWindow(&objMain);
		ptrApp->Execute();
	}

	try
	{
		GtApplication::Quit();
		exit(0);
	}catch(...){};
	return 0;	
};
Beispiel #2
0
int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
        LPTSTR lpCmdLine, int nCmdShow)
#endif
{
  InitSineTable();

  LoadFiles();

#ifdef WIN32
  CommonInterface::hInst = hInstance;

  TestWindow::register_class(hInstance);
  MapWindow::register_class(hInstance);
#endif

#ifndef WIN32
  HINSTANCE hInstance = NULL;
#endif

  MapGfx.Initialise(hInstance, blackboard.SettingsMap());

  TestWindow window;
  GenerateBlackboard(window.map);
  window.set(0, 0, 640, 480);
  DrawThread::Draw(window.map);
  window.show();

  window.event_loop(0);

  return 0;
}
Beispiel #3
0
int main()
{
	new BC_Signals;
	TestWindow window;
	window.create_objects();
	window.run_window();
}
Beispiel #4
0
int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
#ifdef _WIN32_WCE
        LPWSTR lpCmdLine,
#else
        LPSTR lpCmdLine2,
#endif
        int nCmdShow)
#endif
{
  ScreenGlobalInit screen_init;

#ifdef WIN32
  PaintWindow::register_class(hInstance);
  TestWindow::register_class(hInstance);
#endif

  TestWindow window;
  window.set(0, 0, 240, 100);
  window.show();

  window.event_loop();

  return 0;
}
Beispiel #5
0
int main(int argc, char *argv[])
{
  QApplication a(argc, argv);
  TestWindow w;
  w.show();

  return a.exec();
}
Beispiel #6
0
static void
Main()
{
  TestWindow window;
  window.Create({250, 250});
  window.Show();

  window.RunEventLoop();
}
Beispiel #7
0
void TestApp::run()
{
  TestWindow *win = new TestWindow;
  win->show();

  COREMANAGER->setTopInputProcessor(*this);
  COREMANAGER->enableResizing();
  COREMANAGER->startMainLoop();
}
Beispiel #8
0
  void OnResize(PixelSize size) override {
    SingleWindow::OnResize(size);

    const PixelRect rc = GetClientRect();
    if (test_window.IsDefined())
      test_window.Move(rc);

    if (close_button.IsDefined())
      close_button.Move(GetButtonRect(rc));
  }
void SlideContainerAutoTest::testInit()
{
    // Even with content, a SlideContainer should be invisible until slideIn()
    // is called
    TestWindow window;
    window.show();

    QTest::qWait(500);
    QCOMPARE(window.mMainWidget->height(), window.height());
}
Beispiel #10
0
static void
Main()
{
  TestWindow window;
  window.Create(_T("ViewImage"), {640, 480});
  if (window.LoadFile(path.c_str()))
    window.RunEventLoop();
  else
    fprintf(stderr, "Failed to load file\n");
}
void SlideContainerAutoTest::testHiddenContentResize()
{
    // Resizing content should not trigger a slide if it is not visible.
    TestWindow window;
    window.show();
    QTest::qWaitForWindowShown(&window);

    window.mContent->show();
    window.mContent->setFixedSize(150, 80);
    QTest::qWait(500);
    QCOMPARE(window.mContainer->height(), 0);
}
void SlideContainerAutoTest::testSlideIn()
{
    TestWindow window;
    QSignalSpy inSpy(window.mContainer, SIGNAL(slidedIn()));
    QSignalSpy outSpy(window.mContainer, SIGNAL(slidedOut()));
    window.show();

    window.mContainer->slideIn();
    while (window.mContainer->slideHeight() != window.mContent->height()) {
        QTest::qWait(100);
    }
    QCOMPARE(window.mContainer->height(), window.mContent->height());
    QCOMPARE(inSpy.count(), 1);
    QCOMPARE(outSpy.count(), 0);
}
Beispiel #13
0
TestApplication::TestApplication()
	: BApplication("application/x-vnd.ARP.LayoutTest")
{
	ArpD(cdb << ADH << "LayoutTest application started, creating window." << endl);
	TestWindow*	tWindow = new TestWindow(this);
	if( tWindow ) {
		tWindow->Show();
#if 0
		PrefWindow*	pWindow
			= new PrefWindow(BMessenger(tWindow),tWindow->Globals());
		if( pWindow ) pWindow->Show();
		LayoutWindow* lWindow
			= new LayoutWindow();
		if( lWindow ) lWindow->Show();
#endif
	}
}
Beispiel #14
0
int
main(int argc, char** argv)
{
	BApplication app(kAppSignature);

	TestWindow* window = new TestWindow();

	window->AddTest(new Test("Simple clipping",
		new Test1Clipping(), new Test1Validate()));

	window->AddTest(new Test("Scaled clipping 1",
		new Test2Clipping(), new Test2Validate()));

	window->AddTest(new Test("Scaled clipping 2",
		new Test3Clipping(), new Test3Validate()));

	window->AddTest(new Test("Nested states",
		new Test4Clipping(), new Test4Validate()));

	window->SetToTest(3);
	window->Show();

	app.Run();
	return 0;
}
void SlideContainerAutoTest::testSlideInDeleteSlideOut()
{
    // If content is deleted while visible, slideOut() should still produce an
    // animation
    TestWindow window;
    window.show();

    window.mContainer->slideIn();
    while (window.mContainer->slideHeight() != window.mContent->height()) {
        QTest::qWait(100);
    }
    window.mContent->deleteLater();
    window.mContainer->slideOut();
    while (window.mContainer->slideHeight() != 0) {
        QTest::qWait(100);
    }
    QCOMPARE(window.mContainer->height(), 0);
}
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    TestWindow* window = new TestWindow;
    window->resize(1700, 1200);

    QHBoxLayout *layout = new QHBoxLayout;
    window->setLayout(layout);

    Open3DGraphicsAdventureEngine* engine = new Open3DGraphicsAdventureEngine(window);

    layout->addWidget(engine->getRenderWidget());

    window->show();


    return a.exec();
}
Beispiel #17
0
int main(int argc, char **argv)
{
    int result = ERROR_OK;

    KAboutData about("kross",
                     0,
                     ki18n("Kross"),
                     "0.1",
                     ki18n("KDE application to run Kross scripts."),
                     KAboutData::License_LGPL,
                     ki18n("(C) 2006 Sebastian Sauer"),
                     ki18n("Run Kross scripts."),
                     "http://kross.dipe.org",
                     "*****@*****.**");
    about.addAuthor(ki18n("Sebastian Sauer"), ki18n("Author"), "*****@*****.**");

    // Initialize command line args
    KCmdLineArgs::init(argc, argv, &about);
    // Tell which options are supported and parse them.
    KCmdLineOptions options;
    options.add("+file", ki18n("Scriptfile"));

    KCmdLineArgs::addCmdLineOptions(options);
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

    // If no options are defined.
    if(args->count() < 1) {
        std::cout << "Syntax: " << KCmdLineArgs::appName().toLocal8Bit().constData() << " scriptfile1 [scriptfile2] [scriptfile3] ..." << std::endl;
        return ERROR_HELP;
    }

    // Each argument is a scriptfile to open
    QStringList scripts;
    for(int i = 0; i < args->count(); i++)
        scripts.append( args->arg(i) );

    app = new KApplication(true);
    TestWindow *mainWin = new TestWindow(scripts);
    mainWin->show();
    args->clear();
    result = app->exec();
    delete app;
    return result;
}
int main()
{
	BApplication app( "application/x-vnd.dleRednex-DLEScrollViewTest" );
	
	TestWindow *win = new TestWindow;
	win->Lock();

	dle::VSplit *vs = new dle::VSplit;
	{
		dle::BMenuBar *menubar = new dle::BMenuBar( "wheee", B_ITEMS_IN_ROW );
		menubar->SetInner( 0 );
		vs->AddObject( menubar, 1.0f );
		
		printf( "%f\n", menubar->GetInnerLeft() );
		
		dle::AutoScrollView *asv = new dle::AutoScrollView;
		{
			dle::VSplit *vs = new dle::VSplit;
			for( int i=0; i<4; i++ )
			{
				dle::HSplit *hs = new dle::HSplit;
				for( int j=0; j<8; j++ )
				{
					dle::VSplit *vs = new dle::VSplit;
					for( int k=0; k<4; k++ )
					{
						dle::BButton *bb = new dle::BButton( "HitMe!", new BMessage('hit!') );
						vs->AddObject( bb, 1.0f );
					}
					hs->AddObject( vs, 1.0f );
				}
				vs->AddObject( hs, 1.0f );
			}
			asv->AddObject( vs );
		}
		vs->AddObject( asv );
	}
	win->AddObject( vs );
	win->Unlock();
	
	app.Run();	
	return 0;
}
Beispiel #19
0
  void Create(PixelSize size) {
    SingleWindow::Create(_T("Test"), size);

    WindowStyle style;
    style.Disable();

    const PixelRect rc = GetClientRect();
    close_button.Create(*this, _T("Close"), CLOSE, GetButtonRect(rc));
    test_window.Create(*this, rc, style);
  }
Beispiel #20
0
int main(int argc, char **argv)
{
    try
    {
        GuiApp app(argc, argv);
        app.initSubsystems(App::DisablePlugins);

        TestWindow win;
        win.show();

        return app.execLoop();
    }
    catch(Error const &err)
    {
        qWarning() << err.asText();
    }

    qDebug("Exiting main()...");
    return 0;        
}
Beispiel #21
0
/*
class QSlotStorage : public QObject {
public:
    QSlotStorage() { }
    void onClick() {
	printf("QSlotStorage::onClicked()\n");
	fflush(stdout);
    }
};
*/
int main() {
    BApplication *app = new BApplication("application/x.vnd-Lemon-Nirvana");
    TestWindow *test = new TestWindow( BRect(30,30,700,500), "test1" );
    QWidget *widget = test->RootWidget();
    QCheckBox *check = new QCheckBox( widget ); 
    check->resize(100,200);
    QSlotStorage *storage = new QSlotStorage();

    QObject::connect(check, SIGNAL(clicked()), new QSlot(storage, SLOT(onClick())));
    KWQSignal *signal = check->findSignal(SIGNAL(clicked()));
    //printf("%s\n",signal->_name);
    signal->call();

    check->setText("Label sd fsd fsd fsd fsd fsd fsd fsd fsd fsd fsd fsd fs dfs df sd fsd fs fd");
    check->move(100,100);

    test->Show();
    app->Run();
    return 0;
}
Beispiel #22
0
int main(int argc, char *argv[])
{
	new BC_Signals;
	TestWindow window;
	int angles[] = { 180, 0 };
	float values[] = { 1, 0 };

	window.add_tool(new BC_Pan(10, 
		120, 
		100, 
		1, 
		2, 
		angles, 
		-1, 
		-1,
		values));
	window.add_tool(new BC_TextBox(10, 10, 200, 5, _("Mary Egbert\nhad a little lamb.")));
	BC_Title *title;
	window.add_tool(title = new BC_Title(10, 210, _("Hello world")));
	title->update("xyz");
	window.show_window();

sleep(2);
	title->update("abc");

	window.run_window();

//	thread_fork();
}
Beispiel #23
0
int main( int argc, char** argv )
{

	
	QApplication app( argc, argv );
	TestWindow window;
	app.setMainWidget(&window);
	//app.setMainWidget( dz );
	window.resize( 640, 400 );
	window.show();
	return app.exec();
	/*
	SignalTraceReader str;
	str.open( "signaltrace.txt" );	
	str.skipLines( 4 );
	
	SignalInfoList sil;
	
	str.readSignalInfo( sil );

	sil.dump();
	*/
}
Beispiel #24
0
int main(int argc, char **argv)
{
    KAboutData about("propertytest2", 0, ki18n("KoProperty Test"), version, ki18n(description),
                     KAboutData::License_GPL, ki18n("(C) 2005 Cedric Pasteur"), KLocalizedString(), 0, "*****@*****.**");
    about.addAuthor(ki18n("Cedric Pasteur"), KLocalizedString(), "*****@*****.**");
    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("flat",
        ki18n("Flat display: do not display groups\n"
              "(useful for testing)"));
    options.add("font-size <size>",
        ki18n("Set font size to <size> (in points)\n"
              "(useful for testing whether editors keep the font settings)"));
    options.add("property <name>",
        ki18n("Display only specified property\n"
              "(useful when we want to focus on testing a single\n"
              "property editor)"));
    options.add("ro",
        ki18n("Set all properties as read-only:\n"
              "(useful for testing read-only mode)"));
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication app;

    TestWindow test;
    bool ok;
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    const int fontSize = args->getOption("font-size").toInt(&ok);
    if (fontSize > 0 && ok) {
        QFont f(test.font());
        f.setPointSize(fontSize);
        test.setFont(f);
    }
    test.show();

    return app.exec();
}
Beispiel #25
0
//[-------------------------------------------------------]
//[ Protected virtual PLGui::GuiApplication functions     ]
//[-------------------------------------------------------]
void Application::OnCreateMainWindow()
{
	// [sbusch]
//	String sDir = Url(sFilename).CutFilename();
//	System::GetInstance()->SetCurrentDir(sDir);
//	LoadableManager::GetInstance()->AddBaseDir(sDir);

	// Get GUI
	Gui *pGui = Gui::GetSystemGui();

	// List screens
	System::GetInstance()->GetConsole().Print("Screens:\n");
	for (uint32 i=0; i<pGui->GetScreens().GetNumOfElements(); i++) {
		Screen *pScreen = pGui->GetScreens().Get(i);
		String sName	= pScreen->GetName();
		Vector2i vSize	= pScreen->GetSize();
		Vector2i vPos	= pScreen->GetPos();
		bool bDefault	= pScreen->IsDefault();
		System::GetInstance()->GetConsole().Print(
			String("- ") + sName +
			" [" + vSize.x + 'x' + vSize.y +']' +
			" (" + vPos .x + ',' + vPos .y + ')' +
			(bDefault ? " (*)" : "") +
			'\n');
	}

	// Create window
	TestWindow *pWindow = new TestWindow();
//	pWindow->SetFullscreenEnabled(true);
	pWindow->SetPos(Vector2i(0, 0));
	pWindow->SetSize(Vector2i(640, 480));
	pWindow->Center(CenterScreen);
	pWindow->SetVisible(true);

	// Add modifiers
	pWindow->AddModifier("PLGui::ModClose", "ExitApplication=1");
//	pWindow->AddModifier("PLGui::ModBlend", "");

	// Set main window
	SetMainWindow(pWindow);
}
int main(int /* argc */, char ** /* argv */)
{
    SDL_Init(SDL_INIT_VIDEO);   // Initialize SDL2

    SDL_Window *window;        // Declare a pointer to an SDL_Window

    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION,3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION,3);
    SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 1);

    int winWidth = 1024;
    int winHeight = 768;

    // Create an application window with the following settings:
    window = SDL_CreateWindow(
      "An SDL2 window",         //    const char* title
      SDL_WINDOWPOS_UNDEFINED,  //    int x: initial x position
      SDL_WINDOWPOS_UNDEFINED,  //    int y: initial y position
      winWidth,                      //    int w: width, in pixels
      winHeight,                      //    int h: height, in pixels
      SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN          //    Uint32 flags: window options, see docs
    );

    // Check that the window was successfully made
    if(window==NULL){
      // In the event that the window could not be made...
      std::cout << "Could not create window: " << SDL_GetError() << '\n';
      SDL_Quit();
      return 1;
    }

    auto context = SDL_GL_CreateContext(window);

    SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED );

    TestWindow *screen = new TestWindow( window, winWidth, winHeight );

    bool quit = false;
    try
    {
        //nanogui::init();

        //Event handler
        SDL_Event e;
        //nanogui::ref<ExampleApplication> app = new ExampleApplication();
        while( !quit )
        {
            //Handle events on queue
            while( SDL_PollEvent( &e ) != 0 )
            {
                //User requests quit
                if( e.type == SDL_QUIT )
                {
                    quit = true;
                }
                screen->onEvent( e );
            }

            SDL_SetRenderDrawColor(renderer, 0xd3, 0xd3, 0xd3, 0xff );
            SDL_RenderClear( renderer );

            screen->drawAll();

            SDL_SetRenderDrawColor(renderer, 0xff, 0, 0, 0xff );
            SDL_Rect r{ 0, 0, 20, 30 };
            SDL_RenderFillRect( renderer, &r );

            //Update screen
            SDL_GL_SwapWindow(window);
        }

        //nanogui::shutdown();
    }
    catch (const std::runtime_error &e)
    {
        std::string error_msg = std::string("Caught a fatal error: ") + std::string(e.what());
        #if defined(_WIN32)
            MessageBoxA(nullptr, error_msg.c_str(), NULL, MB_ICONERROR | MB_OK);
        #else
            std::cerr << error_msg << endl;
        #endif
        return -1;
    }

    return 0;
}
Beispiel #27
0
TestApplication::TestApplication()
	: BApplication("application/x-vnd.ARP-layoutest")
{
	TestWindow		*aWindow;

	// Instantiate the test window, and make it visible.	
	aWindow = new TestWindow(this);
	aWindow->Show();
	
	fflush(stdout);
	fflush(stderr);
	
	{
		DB(DBALL,cdb << "Testing messages..." << endl);
		BMessage testMsg;
		status_t res = testMsg.AddInt32("A param...",65);
		DB(DBALL,cdb << "Added an int32; result=" << res << endl);
		res = testMsg.AddFloat("A param...",103.4);
		DB(DBALL,cdb << "Added a float; result=" << res << endl);
		DB(DBALL,cdb << "Final message = " << testMsg << endl);
		DB(DBALL,cdb.flush());
	}
	
	{
		BStopWatch watch("FuncCall StopWatch");
		watch.Reset();
	
		printf("Testing virtual function calls...\n");
		int64 i;
		watch.Resume();
		const int fcount = 10000000;
		for( i=0; i<fcount; i++ ) {
			aWindow->TestFunc("a string",23);
		}
		watch.Suspend();
	
		bigtime_t el = watch.ElapsedTime();
		printf("Operations per second: %f\n",
			(((float)fcount)*1000000.0)/(float)el);
	}

	{
		BStopWatch watch("BMessage StopWatch");
		watch.Reset();
	
		printf("Testing BMessage invocation...\n");
		int64 i;
		watch.Resume();
		const int fcount = 10000000;
		for( i=0; i<fcount; i++ ) {
			BMessage testMsg;
			aWindow->TestMsg(testMsg);
		}
		watch.Suspend();
	
		bigtime_t el = watch.ElapsedTime();
		printf("Operations per second: %f\n",
			(((float)fcount)*1000000.0)/(float)el);
	}

	{
		BStopWatch watch("BMessage init StopWatch");
		watch.Reset();
	
		printf("Testing BMessage initialization...\n");
		int64 i;
		watch.Resume();
		const int fcount = 10000;
		for( i=0; i<fcount; i++ ) {
			BMessage testMsg;
			testMsg.AddInt32("A param...",65);
			aWindow->TestMsg(testMsg);
		}
		watch.Suspend();
	
		bigtime_t el = watch.ElapsedTime();
		printf("Operations per second: %f\n",
			(((float)fcount)*1000000.0)/(float)el);
	}
}
Beispiel #28
0
int main(int argc, 
         char **argv)
{
   Application *app = new Application("Printer", "Dtprinter", &argc, argv);
   TestWindow *window = new TestWindow(app, "Printer");
   window->Initialize();

   window->AddAction("Exit", "PrinterSubSystem", ExitCB, NULL, "x", "Alt+F4");
   window->AddAction("Properties...", "Queue", NULL, NULL, "p",
		     "Ctrl+Backspace");
   window->AddSep("Queue");
   window->AddAction("Start", "Queue", NULL, NULL, "S");
   window->AddAction("Stop", "Queue", NULL, NULL, "t");
   window->AddSep("Queue");
   window->AddAction("Monitor", "Queue", NULL, NULL, "M");
   window->AddAction("Cancel", "PrintJob", NULL, NULL, "C");

   window->RegisterPopup(window->container);

   IconObj *lp0 = new IconObj("Queue", window->container, "lp0", "Fpprnt");
   window->RegisterPopup(lp0);
   IconObj *tmp = new IconObj("PrintJob", lp0, "job1", "DtPrtjb");
   window->RegisterPopup(tmp);
   tmp = new IconObj("PrintJob", lp0, "job2", "DtPrtjb");
   window->RegisterPopup(tmp);
   tmp = new IconObj("PrintJob", lp0, "job3", "DtPrtjb");
   window->RegisterPopup(tmp);
   IconObj *lp1 = new IconObj("Queue", window->container, "lp1", "Fpprnt");
   window->RegisterPopup(lp1);
   tmp = new IconObj("PrintJob", lp1, "job4", "DtPrtjb");
   window->RegisterPopup(tmp);
   tmp = new IconObj("PrintJob", lp1, "job5", "DtPrtjb");
   window->RegisterPopup(tmp);

   app->Visible(true);
   app->Run();

   return 0;
}