Esempio n. 1
0
void GUI_ModulesLoaded_hook(void* kernelEntry, void* arg2, void* arg3, void* arg4)
{
	// Start the gui
	useGUI = true;
	// Override useGUI default
	getBoolForKey(kGUIKey, &useGUI, &bootInfo->bootConfig);
	if (useGUI && initGUI())
	{
		// initGUI() returned with an error, disabling GUI.
		useGUI = false;
	}
	else if(useGUI)
	{
		replace_function("_initGraphicsMode", &GUI_initGraphicsMode);
		replace_function("_getBootOptions", &GUI_getBootOptions);
		replace_function("_clearBootArgs", &GUI_clearBootArgs);
		replace_function("_showHelp", &GUI_showHelp);
		
		replace_function("_printf", &GUI_printf);
		replace_function("_verbose", &GUI_verbose);
		replace_function("_error", &GUI_error);
		replace_function("_stop", &GUI_stop);		
		
		setVideoMode( GRAPHICS_MODE, 0 );
		drawBackground();
	
	}
//	DBG("GUI loaded\n");
}
Esempio n. 2
0
/** Initializes openGL and simulation status */
void cbInitGL()
{
	simulation = new GPUSimulation();
	simulation->init();
	g_iceParticles = simulation->getIceParticles();

	//glEnableVertexAttribArray(1);
	srand ( time(NULL) );
	g_fps = 0;
	fps_begin = timeGetTime();

	if(TEST_OUTPUT) {
		if(g_useGPU)
			outputTest.open ("test-gpu.txt");
		else
			outputTest.open ("test-cpu.txt");
	}
	
    // Init app GUI
    initGUI();

    // Set OpenGL state variables
    glClearColor(0.15f, 0.15f, 0.15f, 0);
    glColor4f(1.0f, 0.0f, 0.0f, 1.0f);

    glEnable(GL_DEPTH_TEST);
	glDisable(GL_CULL_FACE);

    cbCompileShaderProgram(NULL);
}
Esempio n. 3
0
void App::calc(float timeElapsed)
{
    switch( m_State )
    {
    case state_normal :
        m_Grid.update(timeElapsed);
        for(unsigned int i=0; i<m_Digits.size(); i++)
            m_Digits[i].update(timeElapsed);
        m_pNoiseButton->update(timeElapsed);
        m_pRecognizeButton->update(timeElapsed);
        break;

    case state_loading :
        static int first = true;
        if (first == true)
        {
            first = false;
            return;
        }
        initGUI();
        initNN();
        m_State = state_normal;
        break;
    }
}
Esempio n. 4
0
void KuickShow::delayAction(DelayedRepeatEvent *event)
{
    if (m_delayedRepeatItem)
        return;

    m_delayedRepeatItem = event;

    KURL url = event->viewer->currentFile()->url();
//    QFileInfo fi( event->viewer->filename() );
//    start.setPath( fi.dirPath( true ) );
    initGUI( url.upURL() );

    // see eventFilter() for explanation and similar code
    if ( fileWidget->dirLister()->isFinished() &&
         fileWidget->dirLister()->rootItem() )
    {
        fileWidget->setCurrentItem( url.fileName() );
        QTimer::singleShot( 0, this, SLOT( doReplay()));
    }
    else
    {
        fileWidget->setInitialItem( url.fileName() );
        connect( fileWidget, SIGNAL( finished() ),
                 SLOT( doReplay() ));
    }
}
Esempio n. 5
0
/*!
 * \brief CreateFeature constructor. Initiates the gui.
 * \param parent
 */
CreateFeature::CreateFeature(QList<FeatureWrapper*> &features, QWidget *parent) :
    QDialog(parent),featureList(features),
    ui(new Ui::CreateFeature)
{
    ui->setupUi(this);
    initGUI();
}
Esempio n. 6
0
LoginWidget::LoginWidget(QWidget *parent) :
QWidget(parent)
{
  m_loginEdit = new QLineEdit(this);
  m_passwordEdit = new QLineEdit(this);
  m_passwordEdit->setEchoMode(QLineEdit::Password);
  m_rememberCheck = new QCheckBox("Remember me", this);
  m_signInButton = new QPushButton("Sign in", this);
  m_createAccountButton = new QPushButton("Create account", this);

  initGUI();

  m_loginQuery = new LoginQuery(DEFAULT_USER_NAME, DEFAULT_USER_PASSWORD, this);
  m_addEventsChannelQuery = new AddChannelQuery(this);

  connect(m_signInButton, SIGNAL(clicked()),
    this, SLOT(onSignInClicked()));
  connect(m_createAccountButton, SIGNAL(clicked()),
    this, SLOT(onCreateAccountClicked()));
  connect(m_loginQuery, SIGNAL(connected()),
    this, SLOT(onLoginConnected()));
  connect(m_loginQuery, SIGNAL(errorOccured(QString)),
    this, SLOT(onError(QString)));
  connect(m_loginQuery, SIGNAL(networkErrorOccured(QString)),
    this, SLOT(onError(QString)), Qt::QueuedConnection);
}
Esempio n. 7
0
KCMKOrgSummary::KCMKOrgSummary(QWidget *parent, const char *name)
    : KCModule(parent, name)
{
    initGUI();

    customDaysChanged(1);

    connect(mCalendarGroup, SIGNAL(clicked(int)), SLOT(modified()));
    connect(mCalendarGroup, SIGNAL(clicked(int)), SLOT(buttonClicked(int)));
    connect(mTodoGroup, SIGNAL(clicked(int)), SLOT(modified()));
    connect(mCustomDays, SIGNAL(valueChanged(int)), SLOT(modified()));
    connect(mCustomDays, SIGNAL(valueChanged(int)), SLOT(customDaysChanged(int)));

    KAcceleratorManager::manage(this);

    load();

    KAboutData *about = new KAboutData(I18N_NOOP("kcmkorgsummary"),
                                       I18N_NOOP("Schedule Configuration Dialog"),
                                       0, 0, KAboutData::License_GPL,
                                       I18N_NOOP("(c) 2003 - 2004 Tobias Koenig"));

    about->addAuthor("Tobias Koenig", 0, "[email protected]");
    setAboutData(about);
}
Esempio n. 8
0
View::View(RootSection *document, MainWindow* parent)
    : QWidget(parent)
    , m_doc(document)
    , m_canvas(0)
    , m_activeSection(0)
    , m_mainWindow(parent)
    , m_cutController(0)
    , m_copyController(0)
{
    setXMLFile("braindumpview.rc");

    m_doc->viewManager()->addView(this);

    m_editPaste = actionCollection()->addAction(KStandardAction::Paste, "edit_paste", this, SLOT(editPaste()));
    m_editCut = actionCollection()->addAction(KStandardAction::Cut, "edit_cut", 0, 0);
    m_editCopy = actionCollection()->addAction(KStandardAction::Copy, "edit_copy", 0, 0);
    initGUI();
    initActions();
    loadExtensions();

    if(m_doc->sections().count() > 0) {
        setActiveSection(m_doc->sections()[0]);
    } else {
        setActiveSection(0);
    }

    m_doc->viewManager()->viewHasFocus(this);
}
/*
 *  Constructs a ImageImporter as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
ImageImporter::ImageImporter( KPhotoBook* parent, const char* name, bool modal, WFlags fl )
    : KDialog( parent, name, modal, fl ), m_photobook(parent), m_bCurrentDeviceMounted(false)
{
    setCaption(i18n("Image Importer"));
    
    initGUI();
    initData();
}
Esempio n. 10
0
KKeyChooser::KKeyChooser(KGlobalAccel *actions, QWidget *parent, bool bCheckAgainstStdKeys, bool bAllowLetterShortcuts, bool /*bAllowWinKey*/)
    : QWidget(parent)
{
    ActionType type = (bCheckAgainstStdKeys) ? ApplicationGlobal : Global;

    initGUI(type, bAllowLetterShortcuts);
    insert(actions);
}
ZmdConfigWindow::ZmdConfigWindow(ZmdUpdaterCore *_core, QWidget *parent) :
    QWidget(parent,
            0,
            Qt::WDestructiveClose | Qt::WShowModal)
{
  core = _core;
  initGUI();
}
Esempio n. 12
0
void ScalarEntityDialog::showEvent(QShowEvent *event)
{
    //Put the dialog in the screen center
    const QRect screen = QApplication::desktop()->screenGeometry();
    this->move( screen.center() - this->rect().center() );
    initGUI();
    event->accept();
}
PluginManager::PluginManager(QWidget *parent) : QDialog(parent), ui(new Ui::PluginManager) {
	ui->setupUi(this);
	factory = PluginFactory::factory;

	initGUI();

	connect(ui->bClose, SIGNAL(clicked()), this, SLOT(reject()));
	connect(ui->cbAllowAll, SIGNAL(clicked(bool)), this, SLOT(setAllowPolicy(bool)));
}
Esempio n. 14
0
void MeteorTowerShopItem::init()
{
	initGUI("Meteor Tower","Data/ShopImages/meteorTurret.png");
	button->subsribeEvent(PRESS,new MemberSubsciber<MeteorTowerShopItem>(&MeteorTowerShopItem::onClick,this));
	
	tower = ArenaHeap::getPtr()->MeteorTowers.New();

	tower->init();
}
Esempio n. 15
0
int main (int argc, char* argv[])
{


	if (!loadMapFromFile ("maps/level1.map"))
	{
		printf ("Can't locate map!");
	}

	initGUI();
	initMap();
	initPlayer();

	SDL_Event e;
	int quit = 0;

	int start_time;
	int urd_time;
	int wait_time;
	int target_time = 1000/FPS;

	while (!quit)
	{
		start_time = SDL_GetTicks();

		while (SDL_PollEvent (&e))
		{
			if (e.type == SDL_QUIT)
			{
				quit = 1;
			}
			else
			{
				player->left = 0;
				player->right = 0;
			}
			processInput ();
		}

		clearScreen();
		updatePlayer (player);
		renderBackground();
		renderMap();
		renderPlayer (player);
		draw();

		urd_time = (SDL_GetTicks() - start_time);
		wait_time = target_time - urd_time;

		SDL_Delay (wait_time);
	}

	destroyGUI();
	deletePlayer (player);

	return 0;
}
Esempio n. 16
0
KAddressBookView::KAddressBookView(KAB::Core *core, QWidget *parent,
                                   const char *name)
    : QWidget(parent, name), mCore(core), mFieldList()
{
    initGUI();

    connect(mCore->searchManager(), SIGNAL(contactsUpdated()),
            SLOT(updateView()));
}
Esempio n. 17
0
KoPAView::KoPAView( KoPADocument *document, QWidget *parent )
: KoView( document, parent )
, d( new Private( document ) )
{
    initGUI();
    initActions();

    if ( d->doc->pageCount() > 0 )
        doUpdateActivePage( d->doc->pageByIndex( 0, false ) );
}
Esempio n. 18
0
File: main.c Progetto: adamjberg/VPN
int main (int argc, char *argv[])
{
    initGUI(argc, argv);

    srand(time(NULL));

    gtk_main ();

    return 0;
}
Esempio n. 19
0
void Main::init()
{
	BallObject::init();
	initEnvironment();

	initGUI();
	
	Ball::init();
	PlayersBall::init();
}
Esempio n. 20
0
	//-------------------------------------------------------------------------------------
	GUIManager::GUIManager(Ogre::Root *root, TankWarWorld *world, Ogre::RenderWindow *window, Ogre::SceneManager *sceneMgr, InputHandler* inputHandler, TankFactory* tankFactory, CollisionManager *mCollisionManager):
		mRoot(root), mWorld(world), mWindow(window), mSceneMgr(sceneMgr), mInputHandler(inputHandler), tankFactory(tankFactory), mCollisionManager(mCollisionManager)
	{
		setupVariables();
		initGUI();
		setupMenuGUI();

		miniMap();
		
	}
Esempio n. 21
0
ShortcutsModule::ShortcutsModule( QWidget *parent, const char *name )
: QWidget( parent )
, m_actionsGeneral(new KActionCollection(this))
, m_actionsSequence(new KActionCollection(this))
, m_listGeneral(new KActionCollection(this))
, m_listSequence(new KActionCollection(this))
, m_listApplication(new KActionCollection(this))
{
	setObjectName(name);
	initGUI();
}
Esempio n. 22
0
MainWindow::MainWindow()
    : KXmlGuiWindow()
    , m_settingsDialog(nullptr)
    , m_reviewWidget(nullptr)
    , m_transWidget(nullptr)
    , m_reloading(false)

{
    initGUI();
    QTimer::singleShot(10, this, SLOT(initObject()));
}
Esempio n. 23
0
ViewManager::ViewManager(KAB::Core *core, QWidget *parent, const char *name)
    : QWidget(parent, name), mCore(core), mActiveView(0),
      mFilterSelectionWidget(0)
{
    initGUI();
    initActions();

    mViewDict.setAutoDelete(true);

    createViewFactories();
}
Esempio n. 24
0
KoPAView::KoPAView(KoPart *part, KoPADocument *document, KoPAFlags withModeBox, QWidget *parent)
: KoView(part, document, parent)
, d( new Private(document))
{
    initGUI(withModeBox);
    initActions();

    if ( d->doc->pageCount() > 0 )
        doUpdateActivePage( d->doc->pageByIndex( 0, false ) );

    setAcceptDrops(true);
}
Esempio n. 25
0
KPrView::KPrView(KPrPart *part, KPrDocument *document, QWidget *parent)
  : KoPAView(part, document, KoPAView::ModeBox, parent)
  , m_part(part)
  , m_presentationMode( new KPrViewModePresentation( this, kopaCanvas() ))
  , m_normalMode( viewMode() )
  , m_notesMode( new KPrViewModeNotes( this, kopaCanvas() ))
  , m_slidesSorterMode(new KPrViewModeSlidesSorter(this, kopaCanvas()))
#ifndef CALLIGRA_DISABLE_DBUS
  , m_dbus(new KPrViewAdaptor( this ) )
#else
  , m_dbus(0)
#endif
{
    m_normalMode->setName(i18n("Normal"));
    initGUI();
    initActions();

    // Change strings because in KPresenter it's called slides and not pages
    actionCollection()->action("view_masterpages")->setText(i18n("Show Master Slides"));
    actionCollection()->action("import_document")->setText(i18n("Import Slideshow..."));
    actionCollection()->action("page_insertpage")->setText(i18n( "Insert Slide"));
    actionCollection()->action("page_insertpage")->setToolTip(i18n("Insert a new slide after the current one"));
    actionCollection()->action("page_insertpage")->setWhatsThis(i18n("Insert a new slide after the current one"));
    actionCollection()->action("page_copypage")->setText(i18n("Copy Slide"));
    actionCollection()->action("page_copypage")->setToolTip(i18n("Copy the current slide"));
    actionCollection()->action("page_copypage")->setWhatsThis(i18n("Copy the current slide"));
    actionCollection()->action("page_deletepage")->setText(i18n("Delete Slide"));
    actionCollection()->action("page_deletepage")->setToolTip(i18n("Delete the current slide"));
    actionCollection()->action("page_deletepage")->setWhatsThis(i18n("Delete the current slide"));
    actionCollection()->action("format_masterpage")->setText(i18n("Master Slide..."));
    actionCollection()->action("page_previous")->setText(i18n("Previous Slide"));
    actionCollection()->action("page_previous")->setToolTip(i18n("Go to previous slide"));
    actionCollection()->action("page_previous")->setWhatsThis(i18n("Go to previous slide"));
    actionCollection()->action("page_next")->setText(i18n("Next Slide"));
    actionCollection()->action("page_next")->setToolTip(i18n("Go to next slide"));
    actionCollection()->action("page_next")->setWhatsThis(i18n("Go to next slide"));
    actionCollection()->action("page_first")->setText(i18n("First Slide"));
    actionCollection()->action("page_first")->setToolTip(i18n("Go to first slide"));
    actionCollection()->action("page_first")->setWhatsThis(i18n("Go to first slide"));
    actionCollection()->action("page_last")->setText(i18n("Last Slide"));
    actionCollection()->action("page_last")->setToolTip(i18n("Go to last slide"));
    actionCollection()->action("page_last")->setWhatsThis(i18n("Go to last slide"));
    actionCollection()->action("configure")->setText(i18n("Configure Stage..."));

    masterShapeManager()->setPaintingStrategy( new KPrShapeManagerDisplayMasterStrategy( masterShapeManager(),
                                                   new KPrPageSelectStrategyActive( kopaCanvas() ) ) );

    connect(zoomController(), SIGNAL(zoomChanged(KoZoomMode::Mode,qreal)), this, SLOT(zoomChanged(KoZoomMode::Mode,qreal)));

    setAcceptDrops(true);
}
Esempio n. 26
0
I8KView::I8KView(KSim::PluginObject *parent, const char *name)
   : KSim::PluginView(parent, name),
     m_timer( 0L ), m_procFile( 0L ), m_procStream( 0L )
{
  initGUI();

  m_timer = new QTimer( this );

  m_reData = new QRegExp( "\\S+\\s+\\S+\\s+\\S+\\s+(\\d+)\\s+\\S+"
        "\\s+\\S+\\s+(\\d+)\\s+(\\d+)\\s+\\S+\\s+\\S+" );

  openStream();
  reparseConfig();
}
Esempio n. 27
0
CodeViewerDialog::CodeViewerDialog ( QWidget* parent, CodeDocument * doc,
                                     Settings::CodeViewerState state,
                                     const char* name, bool modal, Qt::WFlags fl )
        : KDialog ( parent, fl ), m_state(state)
{
    setObjectName(name);
    uDebug() << "setObjectName(" << name << ")";
    setModal(modal);
    setButtons(KDialog::Cancel);
    setupUi(mainWidget());
    setInitialSize(QSize(630, 730));
    initGUI(name);
    addCodeDocument(doc);
    connect(this, SIGNAL(cancelClicked()), mainWidget(), SLOT(close()));
}
Esempio n. 28
0
		virtual void KeyboardCB(unsigned char Key, int x, int y){
			switch(Key){
						case 'n':
							m_oManager = ObjectManager();
							m_UI = UI();
							m_gui.init();
							initGUI();
							break;
						case 'q':
							exit(0);
							break;
						case '1':
							m_UI.changeDrawT(tPOINT);
							break;
						case '2':
							m_UI.changeDrawT(tLINE);
							break;
						case '3':
							m_UI.changeDrawT(tTRI);
							break;
						case '4':
							m_UI.changeDrawT(tSQUAR);
							break;
						case 's':
							if(stereo){
								stereo = false;
							}else{
								stereo = true;
							}
							break;
						case 'r':
							m_UI.changeDrawT(tREMOVE);
							break;
					}
			initGUI();
		}
Esempio n. 29
0
AddresseeEditorWidget::AddresseeEditorWidget( QWidget *parent, const char *name )
  : AddresseeEditorBase( parent, name ),
    mBlockSignals( false ), mReadOnly( false )
{
  kdDebug(5720) << "AddresseeEditorWidget()" << endl;

  initGUI();
  mCategorySelectDialog = 0;
  mCategoryEditDialog = 0;

  // Load the empty addressee as defaults
  load();

  mDirty = false;
}
ResourceSelection::ResourceSelection( KAB::Core *core, QWidget *parent )
  : KAB::ExtensionWidget( core, parent ), mManager( 0 )
{
  initGUI();

  AddressBookWrapper *wrapper = static_cast<AddressBookWrapper*>( core->addressBook() );
  mManager = wrapper->getResourceManager();

  connect( mAddButton, SIGNAL( clicked() ), SLOT( add() ) );
  connect( mEditButton, SIGNAL( clicked() ), SLOT( edit() ) );
  connect( mRemoveButton, SIGNAL( clicked() ), SLOT( remove() ) );

  connect( mListView, SIGNAL( itemClicked( QTreeWidgetItem *, int ) ),
           SLOT( currentChanged( QTreeWidgetItem * ) ) );

  QTimer::singleShot( 0, this, SLOT( updateView() ) );
}