Changeset 40 for trunk/src/pdfcube.cc

Show
Ignore:
Timestamp:
12/22/08 23:52:10 (3 years ago)
Author:
mirko
Message:

initial work on release 0.0.4

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/pdfcube.cc

    r39 r40  
    11// ex: set ts=2: -*- mode: C++; mode: flyspell-prog; mode: flymake; c-basic-offset: 2; indent-tabs-mode: nil -*-  
    22// 
    3 // PDF-Cube source file - pdfcube.cc 
     3// PDFCube source file - pdfcube.cc 
    44//  
    55// Copyright (C) 2006-2008  
     
    5757#define DEFAULT_WIDTH 640 
    5858#define DEFAULT_HEIGHT 480 
    59 #define DEFAULT_TITLE  "PDF-Cube" 
     59#define DEFAULT_TITLE  "PDFCube" 
    6060#define N_FRAMES 30 
    6161#define TIMEOUT_INTERVAL 38 
     
    18451845{ 
    18461846 
     1847  GtkWidget * 
     1848    window; 
     1849  GdkGLConfig * 
     1850    glconfig; 
     1851 
     1852  /* Initialize GTK. */ 
     1853  gtk_init(&argc, &argv); 
     1854 
     1855  /* Initialize GtkGLExt. */ 
     1856  gtk_gl_init(&argc, &argv); 
     1857 
    18471858  po::options_description opts("Available options"); 
    18481859 
     
    18731884 
    18741885  if(vm.count("help")) { 
    1875     cout << endl << "PDFCube 0.0.3" << endl; 
     1886    cout << endl << "pdfcube 0.0.4" << endl; 
    18761887    cout << "=============" << endl; 
    18771888    cout << "Copyright (C) 2006-2008 Mirko Maischberger <mirko.maischberger@gmail.com>" << endl; 
     
    18871898   
    18881899  if(vm.count("version")) { 
    1889     cout << "pdfcube 0.0.3" << endl; 
     1900    cout << "pdfcube 0.0.4" << endl; 
    18901901    return 0; 
    18911902  } 
     
    18941905    input_file = vm["input-file"].as<std::string>(); 
    18951906  } else { 
    1896     cerr << "You must specify an input PDF file on the command line." << endl; 
    1897     exit(1); 
     1907    GtkWidget* filesel; 
     1908    filesel = gtk_file_chooser_dialog_new("Choose a PDF presentation...", 
     1909                                          NULL, 
     1910                                          GTK_FILE_CHOOSER_ACTION_OPEN, 
     1911                                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, 
     1912                                          GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, 
     1913                                          NULL); 
     1914    if (gtk_dialog_run(GTK_DIALOG(filesel)) == GTK_RESPONSE_ACCEPT) 
     1915      { 
     1916        char *filename; 
     1917        filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel)); 
     1918        input_file = filename; 
     1919        g_free(filename); 
     1920      } 
     1921    gtk_widget_destroy(filesel); 
    18981922  } 
    18991923 
     
    19231947    std::copy(&tc[0], &tc[3], &top_color[0]); 
    19241948  } 
    1925  
    1926   GtkWidget * 
    1927     window; 
    1928   GdkGLConfig * 
    1929     glconfig; 
    1930  
    1931   /* Initialize GTK. */ 
    1932   gtk_init(&argc, &argv); 
    1933  
    1934   /* Initialize GtkGLExt. */ 
    1935   gtk_gl_init(&argc, &argv); 
    19361949 
    19371950  /* Configure OpenGL framebuffer. */