Changeset 60 for trunk/src

Show
Ignore:
Timestamp:
09/27/10 09:32:36 (20 months ago)
Author:
mirko
Message:

A quick fix for ubuntu 10.04 and ArchLinux?, I can't test it on previous releases.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/pdfcube.cc

    r43 r60  
    670670        forward(widget); 
    671671        current_face = next_face(); 
    672         //          quick_reset(widget); 
     672        quick_reset(widget); 
    673673        break; 
    674674      case CUBE_PREV: 
     
    678678        backward(widget); 
    679679        current_face = prev_face(); 
    680         //          quick_reset(widget); 
     680        quick_reset(widget); 
    681681        break; 
    682682      case SWITCH_FW: 
     
    686686        forward(widget); 
    687687        current_face = next_face(); 
     688        quick_reset(widget); 
    688689        break; 
    689690      case SWITCH_BW: 
     
    693694        backward(widget); 
    694695        current_face = prev_face(); 
     696        quick_reset(widget); 
    695697        break; 
    696698      case ZOOM0: 
     
    737739  // Prev face of the cube in [0..3] 
    738740  int prev_face() { 
    739     if (current_face - 1 < 0) 
    740       return 3; 
    741     else 
    742       return current_face - 1; 
     741    return (current_face+3) % 4; 
    743742  } 
    744743 
    745744  // Next face of the cube in [0..3] 
    746745  int next_face() { 
    747     if (current_face + 1 > 3) 
    748       return 0; 
    749     else 
    750       return current_face + 1; 
     746    return (current_face+1) % 4; 
    751747  } 
    752748 
     
    911907  void 
    912908  quick_reset(GtkWidget * widget) { 
     909    // update_textures(widget); 
    913910    animating = FALSE; 
    914911    frame = 0; 
     
    922919    angle = 0.0; 
    923920    current_face = 0; 
    924     active_animation = ANIM_NONE; 
     921    // active_animation = ANIM_NONE; 
    925922    previous_animation = ANIM_NONE; 
    926923    last_animation = ANIM_NONE; 
     
    19731970    cerr << "File name error." << endl; 
    19741971  } 
     1972  clog << "Opening: " << filename_uri << endl; 
     1973  GError *error = NULL; 
    19751974  PopplerDocument * 
    1976     document = poppler_document_new_from_file(filename_uri, NULL, NULL); 
     1975    document = poppler_document_new_from_file(filename_uri, NULL, &error); 
    19771976 
    19781977  if (document == NULL) { 
    1979     cerr << "Invaild PDF file." << endl; 
     1978    cerr << "Invaild PDF file." << error->message << endl; 
    19801979    exit(1); 
    19811980  }