paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/test stress1.cpp,NONE,1.1.2.1 stress2.cpp,NON


From: Alexander Pipelka <address@hidden>
Subject: [paragui-cvs] CVS: paragui/test stress1.cpp,NONE,1.1.2.1 stress2.cpp,NONE,1.1.2.1 Makefile.am,1.2.6.2,1.2.6.3 layouttest.cpp,1.1.1.1,1.1.1.1.6.1
Date: Fri, 14 Jun 2002 09:48:56 -0400

Update of /cvsroot/paragui/paragui/test
In directory subversions:/tmp/cvs-serv1867

Modified Files:
      Tag: devel-1-0
        Makefile.am layouttest.cpp 
Added Files:
      Tag: devel-1-0
        stress1.cpp stress2.cpp 
Log Message:
added stress-test apps



--- NEW FILE ---
#include "paragui.h"

#include "pgapplication.h"
#include "pgbutton.h"
#include "pgwidgetlist.h"
#include "pglabel.h"
#include "pgwindow.h"
#include "pgmaskedit.h"
#include "pgscrollbar.h"
#include "pgprogressbar.h"
#include "pgradiobutton.h"
#include "pgthemewidget.h"
#include "pgcheckbutton.h"
#include "pgslider.h"
#include "pglistbox.h"
#include "pgcolumnitem.h"
#include "pgdropdown.h"
#include "pgeventobject.h"
#include "pgpopupmenu.h"
#include "pgspinnerbox.h"
#include "pglog.h"
#include "pgmenubar.h"

#define RESX 800
#define RESY 600

PARAGUI_CALLBACK(handle_exit) {
        PG_Application* app = (PG_Application*)clientdata;
        app->Quit();
        return true;
}

int main(int argc, char* argv[]) {
        char theme[20];

        strcpy(theme, "default");
        
        // initial flags for screensurface
        Uint32 flags = SDL_SWSURFACE;
        int bpp = 0;

        int resx = RESX, resy = RESY;
        
        // construct the application object
        PG_Application app;
        app.SetEmergencyQuit(true);
                
        for(int c=1; c<argc; c++) {

                if(argv[c][0] != '-') {
                        strcpy(theme, argv[c]);
                }

                if(strcmp(argv[c], "-f") == 0) {
                        flags |= SDL_FULLSCREEN;
                }

                if(strcmp(argv[c], "-bpp") == 0) {
                        bpp = atoi(argv[++c]);
                }
                
                if(strcmp(argv[c], "-x") == 0) {
                        resx = atoi(argv[++c]);
                }
                
                if(strcmp(argv[c], "-y") == 0) {
                        resy = atoi(argv[++c]);
                }
        }

        Uint32 start_ticks = SDL_GetTicks();
        
        if(!app.LoadTheme(theme)) {
            PG_LogERR("Unable to load theme \"%s\"", theme);
            return -1;
        }

        PG_LogMSG("Loaded theme in %i ms", SDL_GetTicks() - start_ticks);

        if(!app.InitScreen(resx, resy, bpp, flags)){
                printf("Resolution %dx%d not supported\n", resx, resy);
                exit(-1);
        }

        PG_LogMSG("screen initialized after %i ms", SDL_GetTicks() - 
start_ticks);

        app.SetCursor(app.GetTheme()->FindSurface("Pointer", "Pointer", 
"normal"));

        int xw = resx/32;
        int yw = resy/32;
        
        PG_ThemeWidget* b = NULL;
        
        for(int x=0; x<33; x++) {
                for(int y=0; y<33; y++) {
                        b = new PG_ThemeWidget(NULL, PG_Rect(x*xw, y*yw, xw, 
yw));
                        b->Show();
                }
        }
        
        PG_LogMSG("app ready after %i ms", SDL_GetTicks() - start_ticks);
        app.ShowCursor(PG_CURSOR_SOFTWARE);

        // Enter main loop 
        app.Run();

        return EXIT_SUCCESS;
}

--- NEW FILE ---
#include "paragui.h"

#include "pgapplication.h"
#include "pgbutton.h"
#include "pgwidgetlist.h"
#include "pglabel.h"
#include "pgwindow.h"
#include "pgmaskedit.h"
#include "pgscrollbar.h"
#include "pgprogressbar.h"
#include "pgradiobutton.h"
#include "pgthemewidget.h"
#include "pgcheckbutton.h"
#include "pgslider.h"
#include "pglistbox.h"
#include "pgcolumnitem.h"
#include "pgdropdown.h"
#include "pgeventobject.h"
#include "pgpopupmenu.h"
#include "pgspinnerbox.h"
#include "pglog.h"
#include "pgmenubar.h"

#define RESX 800
#define RESY 600

PARAGUI_CALLBACK(handle_exit) {
        PG_Application* app = (PG_Application*)clientdata;
        app->Quit();
        return true;
}

int main(int argc, char* argv[]) {
        char theme[20];

        strcpy(theme, "default");
        
        // initial flags for screensurface
        Uint32 flags = SDL_SWSURFACE;
        int bpp = 0;

        int resx = RESX, resy = RESY;
        
        // construct the application object
        PG_Application app;
        app.SetEmergencyQuit(true);
                
        for(int c=1; c<argc; c++) {

                if(argv[c][0] != '-') {
                        strcpy(theme, argv[c]);
                }

                if(strcmp(argv[c], "-f") == 0) {
                        flags |= SDL_FULLSCREEN;
                }

                if(strcmp(argv[c], "-bpp") == 0) {
                        bpp = atoi(argv[++c]);
                }
                
                if(strcmp(argv[c], "-x") == 0) {
                        resx = atoi(argv[++c]);
                }
                
                if(strcmp(argv[c], "-y") == 0) {
                        resy = atoi(argv[++c]);
                }
        }

        Uint32 start_ticks = SDL_GetTicks();
        
        if(!app.LoadTheme(theme)) {
            PG_LogERR("Unable to load theme \"%s\"", theme);
            return -1;
        }

        PG_LogMSG("Loaded theme in %i ms", SDL_GetTicks() - start_ticks);

        if(!app.InitScreen(resx, resy, bpp, flags)){
                printf("Resolution %dx%d not supported\n", resx, resy);
                exit(-1);
        }

        PG_LogMSG("screen initialized after %i ms", SDL_GetTicks() - 
start_ticks);

        app.SetCursor(app.GetTheme()->FindSurface("Pointer", "Pointer", 
"normal"));

        int xw = resx/32;
        int yw = resy/32;

        PG_Widget container(NULL, PG_Rect(0,0,resx,resy));      
        PG_ThemeWidget* b = NULL;
        
        for(int x=0; x<33; x++) {
                for(int y=0; y<33; y++) {
                        b = new PG_ThemeWidget(&container, PG_Rect(x*xw, y*yw, 
xw, yw));
                }
        }

        container.Show();
                
        PG_LogMSG("app ready after %i ms", SDL_GetTicks() - start_ticks);
        app.ShowCursor(PG_CURSOR_SOFTWARE);

        // Enter main loop 
        app.Run();

        return EXIT_SUCCESS;
}

Index: Makefile.am
===================================================================
RCS file: /cvsroot/paragui/paragui/test/Makefile.am,v
retrieving revision 1.2.6.2
retrieving revision 1.2.6.3
diff -C2 -r1.2.6.2 -r1.2.6.3
*** Makefile.am 31 May 2002 15:08:46 -0000      1.2.6.2
--- Makefile.am 14 Jun 2002 13:48:54 -0000      1.2.6.3
***************
*** 1,5 ****
  AUTOMAKE_OPTIONS = foreign
  
! bin_PROGRAMS = listbox animation dropdown paratest dblbuffer navtest 
windowtest layouttest windowresize
  
  listbox_SOURCES = listbox.cpp
--- 1,11 ----
  AUTOMAKE_OPTIONS = foreign
  
! bin_PROGRAMS = stress1 stress2 listbox animation dropdown paratest dblbuffer 
navtest windowtest layouttest windowresize
! 
! stress1_SOURCES = stress1.cpp
! stress1_LDADD = $(PARAGUI_LIBS)
! 
! stress2_SOURCES = stress2.cpp
! stress2_LDADD = $(PARAGUI_LIBS)
  
  listbox_SOURCES = listbox.cpp

Index: layouttest.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/layouttest.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.6.1
diff -C2 -r1.1.1.1 -r1.1.1.1.6.1
*** layouttest.cpp      15 Apr 2002 13:22:29 -0000      1.1.1.1
--- layouttest.cpp      14 Jun 2002 13:48:54 -0000      1.1.1.1.6.1
***************
*** 1,5 ****
  #include "paragui.h"
- #include <iostream>
  #include "pgapplication.h"
  
  int main() {
--- 1,5 ----
  #include "paragui.h"
  #include "pgapplication.h"
+ #include "pgwindow.h"
  
  int main() {
***************
*** 17,22 ****
        }
  
!       app.LoadLayout("pokus.xml");
  
        // Enter main loop 
        app.Run();
--- 17,26 ----
        }
  
!       PG_Window wnd(NULL, PG_Rect(0,0,400,300), "Test");
!       wnd.LoadLayout("pokus.xml");
  
+       SDL_Delay(2000);
+       wnd.Show();
+       
        // Enter main loop 
        app.Run();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]