| | 34 | #if 0 |
| | 35 | /** |
| | 36 | * The index class will contain methods to show all the pages in an |
| | 37 | * index page, to hilight a different page and to restore the selected |
| | 38 | * page in full screen. |
| | 39 | * |
| | 40 | */ |
| | 41 | class index |
| | 42 | { |
| | 43 | // ... |
| | 44 | } |
| | 45 | /** |
| | 46 | * @brief Abstract animator class. |
| | 47 | * |
| | 48 | * Animations are for transitions between two pages. They start from |
| | 49 | * one page and go to another one. The prepare() method whoud be |
| | 50 | * called before starting and is indended to render the hi resolution |
| | 51 | * version of the needed pages and to setup the scene |
| | 52 | * graph. render(frame) is used to position the actors for the given |
| | 53 | * frame number and unprepare() will free the unneded hi-res versions. |
| | 54 | */ |
| | 55 | class animator |
| | 56 | { |
| | 57 | virtual ~animator() {} |
| | 58 | |
| | 59 | void |
| | 60 | prepare() = 0; |
| | 61 | |
| | 62 | void |
| | 63 | render(int frame) = 0; |
| | 64 | |
| | 65 | void |
| | 66 | unprepare() = 0; |
| | 67 | }; |
| | 68 | |
| | 69 | class replace_animator : public animator |
| | 70 | { |
| | 71 | replace_animator(pdfcube::document& doc, int page_no); |
| | 72 | // ... |
| | 73 | } |
| | 74 | |
| | 75 | class cube_animator : public animator |
| | 76 | { |
| | 77 | replace_animator(pdfcube::document& doc, int page_no); |
| | 78 | // ... |
| | 79 | } |
| | 80 | |
| | 81 | /** |
| | 82 | * An animator factory returns an animator for the give page number of |
| | 83 | * a document. |
| | 84 | * |
| | 85 | */ |
| | 86 | class animator_factory |
| | 87 | { |
| | 88 | animator* make_animator(pdfcube::document& doc, int page_no) |
| | 89 | { |
| | 90 | switch(doc.page(page_no).transition_type()) |
| | 91 | { |
| | 92 | case POPPLER_PAGE_TRANSITION_REPLACE: |
| | 93 | return new replace_animator(doc, page_no); |
| | 94 | case POPPLER_PAGE_TRANSITION_BOX: |
| | 95 | return new cube_animator(doc, page_no); |
| | 96 | } |
| | 97 | return NULL; |
| | 98 | } |
| | 99 | } |
| | 100 | #endif |
| | 101 | |
| | 102 | // a main to quick-test some clutter api |