summaryrefslogtreecommitdiffstats
path: root/kpovmodeler/main.cpp
blob: 12cbe7197c7e4edf6b6d7699fdddc003e1201a2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
**************************************************************************
                                 description
                             --------------------
    copyright            : (C) 2000-2001 by Andreas Zehender
    email                : zehender@kde.org
**************************************************************************

**************************************************************************
*                                                                        *
*  This program is free software; you can redistribute it and/or modify  *
*  it under the terms of the GNU General Public License as published by  *
*  the Free Software Foundation; either version 2 of the License, or     *
*  (at your option) any later version.                                   *
*                                                                        *
**************************************************************************/


#include <klocale.h>
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <kapplication.h>

#include "pmshell.h"
#include "pmfactory.h"
#include "pmrendermanager.h"
#include "version.h"


static KCmdLineOptions options[] =
{
  { "+[file]", I18N_NOOP( "File to open" ), 0 },
  { "no-opengl", I18N_NOOP( "Disables OpenGL rendering" ), 0 },
  { "no-dri", I18N_NOOP( "Disables direct rendering" ), 0 },
  KCmdLineLastOption
};

int main( int argc, char* argv[] )
{
   PMShell* shell = 0;

   TDECmdLineArgs::init( argc, argv, PMFactory::aboutData( ) );
   TDECmdLineArgs::addCmdLineOptions( options );

   TDEApplication app;

   TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs( );

   if( !args->isSet( "-opengl" ) )
      PMRenderManager::disableOpenGL( );
   if( !args->isSet( "-dri" ) )
      PMGLView::enableDirectRendering( false );

   if( args->count( ) > 0 )
   {
      for( int i = 0 ; i < args->count( ) ; i++ )
      {
         shell = new PMShell( args->url( i ) );
         shell->show( );
      }
   }
   else
   {
      shell = new PMShell;
      shell->show( );
   }
   args->clear();   
   return app.exec( );
}