Changeset 9
- Timestamp:
- 03/11/07 17:41:03 (5 years ago)
- Location:
- trunk/pdfcube/src
- Files:
-
- 3 added
- 3 modified
-
Makefile.am (modified) (1 diff)
-
cmdline.c (added)
-
cmdline.h (added)
-
llcube.cc (modified) (3 diffs)
-
pdfcube.cc (modified) (7 diffs)
-
pdfcube.ggo (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdfcube/src/Makefile.am
r7 r9 1 1 bin_PROGRAMS = pdfcube 2 2 3 pdfcube_SOURCES = pdfcube.cc 4 pdfcube_CXXFLAGS=-Wall -Weffc++ 3 pdfcube_SOURCES = pdfcube.cc cmdline.c cmdline.h 4 5 pdfcube_CXXFLAGS=-Wall -Weffc++ 5 6 6 7 INCLUDES = $(glib_CFLAGS) $(gtk_CFLAGS) $(gtkglext_CFLAGS) $(poppler_CFLAGS) $(poppler_glib_CFLAGS) -
trunk/pdfcube/src/llcube.cc
r3 r9 1 // -*- mode: C++ -*- 2 // 3 // PDF-Cube source file - llcube.cc (low level cube code) 4 // 5 // Copyright (C) 2006 Mirko Maischberger <mirko.maischberger@gmail.com> 6 // 7 // This program is free software; you can redistribute it and/or modify 8 // it under the terms of the GNU General Public License as published by 9 // the Free Software Foundation; either version 2 of the License, or 10 // (at your option) any later version. 11 // 12 // This program is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WAPRANTY; without even the implied warranty of 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 // GNU General Public License for more details. 16 // 17 // You should have received a copy of the GNU General Public License 18 // along with this program; if not, write to the Free Software 19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 1 21 namespace 100allora { 2 22 … … 51 71 point3d<GLfloat>& looking_at, 52 72 GLfloat perspective, 53 GLfloat angle y, GLfloat anglex, GLfloat anglez)73 GLfloat anglex, GLfloat angley, GLfloat anglez) 54 74 { } 55 75 … … 178 198 point3d camera_position; 179 199 point3d looking_at; 180 181 182 200 } 183 184 201 } -
trunk/pdfcube/src/pdfcube.cc
r3 r9 33 33 #include <gtk/gtkgl.h> 34 34 35 // OpenGL (-lglut)35 // OpenGL 36 36 #include <GL/gl.h> 37 37 #include <GL/glu.h> … … 39 39 // PDF to GdkPixbuf (pkg-config poppler-glib) 40 40 #include <poppler.h> 41 42 #include "cmdline.h" 41 43 42 44 using namespace std; … … 54 56 // Globals (will be moved inside classes some day) 55 57 56 static gboolean fullscreen = TRUE;58 static gboolean fullscreen = FALSE; 57 59 static gboolean animating = FALSE; 58 60 … … 733 735 double w, h; 734 736 poppler_page_get_size(page, &w, &h); 735 poppler_page_render_to_pixbuf(page, 0,0,iWidth,iHeight,1.0*iWidth/w,0,pm); 737 poppler_page_render_to_pixbuf(page, 0, 0, iWidth, iHeight, 738 ((double)iWidth)/w, 0, pm); 736 739 } 737 740 … … 1475 1478 GdkGLConfig *glconfig; 1476 1479 1480 gengetopt_args_info args_info; 1481 1482 if(cmdline_parser(argc, argv, &args_info) != 0) 1483 exit(1); 1484 1477 1485 /* Initialize GTK. */ 1478 1486 gtk_init (&argc, &argv); … … 1484 1492 glconfig = configure_gl(); 1485 1493 1486 if(arg c < 2)1487 { 1488 perror("usage: pdfcube file_uri [cube_page ...]");1494 if(args_info.inputs_num != 1) 1495 { 1496 cerr << "You must specify a PDF file name"; 1489 1497 exit(1); 1490 1498 } 1491 gchar *absoluteFileName = get_absolute_file_name (argv[1]); 1499 1500 gchar *absoluteFileName = get_absolute_file_name (args_info.inputs[0]); 1492 1501 gchar *filename_uri = g_filename_to_uri (absoluteFileName, NULL, NULL); 1493 1502 g_free (absoluteFileName); … … 1514 1523 } 1515 1524 1516 for(int ii = 2; ii < argc; ii++) 1517 { 1518 page_transition[atoi(argv[ii])] = true; 1519 } 1525 for(int ii = 0; ii < args_info.cube_given; ii++) 1526 { 1527 assert(args_info.cube_arg[ii] >= 2); 1528 assert(args_info.cube_arg[ii] <= pc->pages()+1); 1529 page_transition[args_info.cube_arg[ii]-2] = true; 1530 } 1531 1520 1532 1521 1533 /* Create and show the application window. */ 1522 1534 window = create_window(glconfig); 1535 1536 if(args_info.fullscreen_given) fullscreen = true; 1523 1537 1524 1538 if(fullscreen)

