pax_global_header00006660000000000000000000000064117761303610014517gustar00rootroot0000000000000052 comment=074a3c6b451c2defb0ee41a6a8bf4a38e3e0b0ab davvil-pdfpc-074a3c6/000077500000000000000000000000001177613036100144275ustar00rootroot00000000000000davvil-pdfpc-074a3c6/.gitignore000066400000000000000000000001001177613036100164060ustar00rootroot00000000000000.history .*.swp build/ src/paths.vala c-src/paths.c man/pdfpc.1 davvil-pdfpc-074a3c6/.gitmodules000066400000000000000000000001551177613036100166050ustar00rootroot00000000000000[submodule "cmake/Vala_CMake"] path = cmake/Vala_CMake url = git://github.com/jakobwesthoff/Vala_CMake.git davvil-pdfpc-074a3c6/CHANGELOG.txt000066400000000000000000000070151177613036100164620ustar00rootroot00000000000000=============== pdfpc Changelog =============== Version 3.1.1 ============= *Released: July 2012* - Bug fix for released C sources Version 3.1 =========== *Released: June 2012* - Revamped overview mode, with better keyboard navigation support and better visual appearance (thanks to rschroll) - Support for configuration files. Now all keybindings are configurable - Improved layout management (thanks to rschroll) - (Hopefully) Improved handling of fullscreen modes Version 3.0 =========== *Released: May 2012* - Renamed to pdfpc (forked from Pdf Presenter Console) - Support for new poppler version - Support for (textual) notes - Support for overlays - Overview mode - Jump to slides by inputting the slide number - Movement in 10-slide blocks allowed using shift - Two additional timer modes: countup and end time of presentation - Pause timer (useful for rehearsal talks) - Support for mouse wheel (thanks to mikerofone) and bluetooth headset controls (thanks to NerdyProjects) - Freezing and blacking out of presentation view - Presenter view starts on primary screen - Definition of "end slide" - Navigable history of jumps =============================== Pdf Presenter Console Changelog =============================== Version 2.0 =========== *Released: 16. Jan 2010* - Complete rewrite of rendering system to allow more sophisticated actions. - Changed license of the project from GPLv3 to GPLv2+ because of incompatibilities with Poppler. (Thanks to Jakub Wilk and Barak A. Pearlmutter for pointing out this out). - Implemented: Usage of left-/right mousebuttons for slide navigation. - Implemented: Handling of navigational links inside of PDF files. - Implemented: Abstraction to cache prerendered slides. - Implemented: Compressed cache for prerendered slides. - Implemented: Alternative way of executing the prerendering process to allow for smoother navigation while slides are generated. - Implemented: Means to switch displays in single monitor mode as well as dual monitor mode - Implemented: Disabled timer if a duration of 0 is provided - Fixed: Build problems on Fedora 13 due to changed linking procedure - Fixed: Slightly changed image data formats due to update of Gtk to Version 2.22 or higher. - Implemented: Removed usage of deprecated Gdk.GC in favor of Cairo. Version 1.1.1 ============= - Fixed: Compile error with newer vala versions due to wrong property visibility - Fixed: Typo in help text Version 1.1 =========== - Implemented: Controllable interface for cleaner controller code. - Fixed: Install target is now executable. - Fixed: Warnings shown in one-screen-presentation-mode, due to non existant process indicator. - Implemented: Presentation timer as its own GTK Widget - Implemented: Support for negative timer values (aka overtime) - Implemented: Different Timer colors for normal time, the last x minutes and overtime - Implemented: Made last-minutes time configurable - Fixed: Library paths were not used correctly for compilation - Implemented: Fullscreen window as own Gtk class - Fixed: Problem which caused the windows not be displayed on the correct displays using the Xfce4 Xfwm window mananger. - Implemented: Command line option to set the size of the current slide in the presenter screen - Implemented: A few more common key bindings - Implemented: Hide cursor after 5 seconds timeout Version 1.0 =========== - Initial release .. Local Variables: mode: rst fill-column: 79 End: vim: et syn=rst tw=79 davvil-pdfpc-074a3c6/CMakeLists.txt000066400000000000000000000010701177613036100171650ustar00rootroot00000000000000project("pdfpc" C) cmake_minimum_required(VERSION 2.6) SET(CMAKE_BUILD_TYPE "Release") set(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc" CACHE FILEPATH "sysconfdir") # Uncomment this section if you want to compile from vala sources #list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Vala_CMake/vala) #include(ValaPrecompile) #include(ValaVersion) # #find_package(Vala) # #ensure_vala_version("0.11.0" MINIMUM) # #add_subdirectory(src) # ...and comment the following line add_subdirectory(c-src) add_subdirectory(icons) add_subdirectory(man) add_subdirectory(rc) davvil-pdfpc-074a3c6/LICENSE.txt000066400000000000000000000432541177613036100162620ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. davvil-pdfpc-074a3c6/README.rst000066400000000000000000000103421177613036100161160ustar00rootroot00000000000000===== pdfpc ===== About ===== pdfpc is a GTK based presentation viewer application for GNU/Linux which uses Keynote like multi-monitor output to provide meta information to the speaker during the presentation. It is able to show a normal presentation window on one screen, while showing a more sophisticated overview on the other one providing information like a picture of the next slide, as well as the left over time till the end of the presentation. The input files processed by pdfpc are PDF documents, which can be created using nearly any of today's presentation software. More information, including screenshots and a demo presentation, can be found at http://davvil.github.com/pdfpc/ Requirements ============ In order to compile and run pdfpc the following requirements need to be met: - CMake Version >=2.6 - Gtk+ 2.x - libPoppler with glib bindings - librsvg Compile and install =================== Compiling from source tarballs ------------------------------ You can download the latest stable release of pdfpc in the download section of github (https://github.com/davvil/pdfpc/downloads). Uncompress the tarball (we use v3.0 as an example here):: tar xvf pdfpc-3.0.tgz Change to the extracted directory:: cd pdfpc-3.0 Compile and install:: cmake . make sudo make install If there are no errors in the process, you just installed pdfpc on your system. Congratulations! If there were errors, they are probably due to missing dependencies. Please check that you have all the necessary libraries (in some distributions you may have to install *-devel* packages). Note: You may alter the final installation prefix in the cmake call. By default the pdfpc files will be installed under */usr/local/*. If you want to change that, for example to be installed under */usr/*, with config files under */etc/* you may specify another installation prefix as follows:: cmake -DCMAKE_INSTALL_PREFIX="/usr" -DSYSCONFDIR=/etc . Compiling from github --------------------- If you want the bleeding-edge version of pdfpc, you should checkout the git repository. The *master* branch should be fairly stable and safe to use, unstable development happens in the *devel* branch. When installing from git you will need two additional dependencies: - git - Vala Compiler Version >=0.11.0 The pdfpc source can be retrieved from github:: git clone git://github.com/davvil/pdfpc.git After it has been transfered you need to switch to the ``pdfpc`` directory, which has just been created. From inside this directory use these commands to retrieve all needed submodules:: git submodule init git submodule update You are now set to compile and install pdfpc. Start by creating a build directory (this is optional but it keeps the directories clean, in case you want to do some changes):: mkdir build cd build After you are inside the build directory create the needed Makefiles using CMake:: cmake ../ If you have put your build directory elsewhere on your system adapt the path above accordingly. You need to provide CMake with the pdfpc directory as created by git. As pointed out before, you may alter the installation directories via the *-DCMAKE_INSTALL_PREFIX* and *-DSYSCONFDIR* command line arguments. If all requirements are met, CMake will tell you that it created all the necessary build files for you. If any of the requirements were not met you will be informed of it to provide the necessary files or install the appropriate packages. The next step is to compile and install pdfpc using GNU Make or any other make derivative you may have installed. Simply issue the following command to start building the application:: make make install You may need to prefix the last command with a *sudo* or obtain super-user rights in any other way applicable to your situation. Congratulations you just installed pdfpc on your system. How to go on ============ Download the demo presentation from the downloads section and load it into pdfpc to get a feeling of it:: pdfpc pdfpc-demo.pdf Acknowledgements ================ pdfpc is a fork of pdf-presenter console, available at http://westhoffswelt.de/projects/pdf_presenter_console.html .. Local Variables: mode: rst fill-column: 79 End: vim: et syn=rst tw=79 davvil-pdfpc-074a3c6/c-src/000077500000000000000000000000001177613036100154365ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/CMakeLists.txt000066400000000000000000000033051177613036100201770ustar00rootroot00000000000000find_package(PkgConfig) pkg_check_modules(GOBJECT REQUIRED gobject-2.0) pkg_check_modules(GIO REQUIRED gio-2.0) pkg_check_modules(GEE REQUIRED gee-1.0) pkg_check_modules(POPPLER REQUIRED poppler-glib) pkg_check_modules(GTK REQUIRED gtk+-2.0) pkg_check_modules(GTHREAD REQUIRED gthread-2.0) pkg_check_modules(RSVG REQUIRED librsvg-2.0) set(CFLAGS ${GOBJECT_CFLAGS} ${GOBJECT_CFLAGS_OTHER} ${GIO_CFLAGS} ${GIO_CFLAGS_OTHER} ${GEE_CFLAGS} ${GEE_CFLAGS_OTHER} ${POPPLER_CFLAGS} ${POPPLER_CFLAGS_OTHER} ${GTK_CFLAGS} ${GTK_CFLAGS_OTHER} ${GTHREAD_CFLAGS} ${GTHREAD_CFLAGS_OTHER} ${RSVG_CFLAGS} ${RSVG_CFLAGS_OTHER} ) add_definitions(${CFLAGS}) set(LIBS ${GOBJECT_LIBRARIES} ${GIO_LIBRARIES} ${GEE_LIBRARIES} ${POPPLER_LIBRARIES} ${GTK_LIBRARIES} ${GTHREAD_LIBRARIES} ${RSVG_LIBRARIES} ) link_libraries(${LIBS}) set(LIB_PATHS ${GOBJECT_LIBRARY_DIRS} ${GIO_LIBRARY_DIRS} ${POPPLER_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTHREAD_LIBRARY_DIRS} ${RSVG_LIBRARY_DIRS} ) link_directories(${LIB_PATHS}) # The files to be configured will be written automatically. In order for the # sed call to work properly, there mut be at least one line (may be empty) # between the markers. # BEGIN_CONFIGURE_FILES CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/pdfpc.in ${CMAKE_CURRENT_SOURCE_DIR}/pdfpc.c) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/classes/window/presenter.in ${CMAKE_CURRENT_SOURCE_DIR}/classes/window/presenter.c) # END_CONFIGURE_FILES file (GLOB_RECURSE C_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.c) add_executable(pdfpc ${C_SRC} ) # explicitly add libraries (needed e.g. for Fedora 13+) target_link_libraries(pdfpc -lm) install(TARGETS pdfpc RUNTIME DESTINATION bin ) davvil-pdfpc-074a3c6/c-src/classes/000077500000000000000000000000001177613036100170735ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/classes/cache_status.c000066400000000000000000000440571177613036100217170ustar00rootroot00000000000000/* cache_status.c generated by valac 0.16.0, the Vala compiler * generated from cache_status.vala, do not modify */ #include #include #include #include #include #include #define PDFPC_TYPE_CACHE_STATUS (pdfpc_cache_status_get_type ()) #define PDFPC_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatus)) #define PDFPC_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) #define PDFPC_IS_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_IS_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_CACHE_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) typedef struct _pdfpcCacheStatus pdfpcCacheStatus; typedef struct _pdfpcCacheStatusClass pdfpcCacheStatusClass; typedef struct _pdfpcCacheStatusPrivate pdfpcCacheStatusPrivate; #define PDFPC_VIEW_TYPE_PRERENDERING (pdfpc_view_prerendering_get_type ()) #define PDFPC_VIEW_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerendering)) #define PDFPC_VIEW_IS_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PRERENDERING)) #define PDFPC_VIEW_PRERENDERING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerenderingIface)) typedef struct _pdfpcViewPrerendering pdfpcViewPrerendering; typedef struct _pdfpcViewPrerenderingIface pdfpcViewPrerenderingIface; #define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ()) #define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase)) #define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) #define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) typedef struct _pdfpcViewBase pdfpcViewBase; typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass; #define PDFPC_RENDERER_TYPE_BASE (pdfpc_renderer_base_get_type ()) #define PDFPC_RENDERER_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBase)) #define PDFPC_RENDERER_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) #define PDFPC_RENDERER_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) typedef struct _pdfpcRendererBase pdfpcRendererBase; typedef struct _pdfpcRendererBaseClass pdfpcRendererBaseClass; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) typedef struct _pdfpcParamSpecCacheStatus pdfpcParamSpecCacheStatus; struct _pdfpcCacheStatus { GTypeInstance parent_instance; volatile int ref_count; pdfpcCacheStatusPrivate * priv; gint current_value; gint max_value; }; struct _pdfpcCacheStatusClass { GTypeClass parent_class; void (*finalize) (pdfpcCacheStatus *self); }; typedef void (*pdfpcCacheStatusUpdateFunction) (gdouble progress, void* user_data); typedef void (*pdfpcCacheStatusUpdateComplete) (void* user_data); struct _pdfpcCacheStatusPrivate { pdfpcCacheStatusUpdateFunction update_function; gpointer update_function_target; GDestroyNotify update_function_target_destroy_notify; pdfpcCacheStatusUpdateComplete update_complete; gpointer update_complete_target; GDestroyNotify update_complete_target_destroy_notify; }; struct _pdfpcViewPrerenderingIface { GTypeInterface parent_iface; }; struct _pdfpcParamSpecCacheStatus { GParamSpec parent_instance; }; static gpointer pdfpc_cache_status_parent_class = NULL; gpointer pdfpc_cache_status_ref (gpointer instance); void pdfpc_cache_status_unref (gpointer instance); GParamSpec* pdfpc_param_spec_cache_status (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_value_set_cache_status (GValue* value, gpointer v_object); void pdfpc_value_take_cache_status (GValue* value, gpointer v_object); gpointer pdfpc_value_get_cache_status (const GValue* value); GType pdfpc_cache_status_get_type (void) G_GNUC_CONST; #define PDFPC_CACHE_STATUS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusPrivate)) enum { PDFPC_CACHE_STATUS_DUMMY_PROPERTY }; void pdfpc_cache_status_register_update (pdfpcCacheStatus* self, pdfpcCacheStatusUpdateFunction update, void* update_target, pdfpcCacheStatusUpdateComplete complete, void* complete_target); void pdfpc_cache_status_update (pdfpcCacheStatus* self); GType pdfpc_view_prerendering_get_type (void) G_GNUC_CONST; void pdfpc_cache_status_monitor_view (pdfpcCacheStatus* self, pdfpcViewPrerendering* view); static void __lambda2_ (pdfpcCacheStatus* self, pdfpcViewPrerendering* v); GType pdfpc_view_base_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_base_get_type (void) G_GNUC_CONST; pdfpcRendererBase* pdfpc_view_base_get_renderer (pdfpcViewBase* self); GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; pdfpcMetadataBase* pdfpc_renderer_base_get_metadata (pdfpcRendererBase* self); guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self); static void ___lambda2__pdfpc_view_prerendering_prerendering_started (pdfpcViewPrerendering* _sender, gpointer self); static void __lambda3_ (pdfpcCacheStatus* self); static void ___lambda3__pdfpc_view_prerendering_slide_prerendered (pdfpcViewPrerendering* _sender, gpointer self); pdfpcCacheStatus* pdfpc_cache_status_new (void); pdfpcCacheStatus* pdfpc_cache_status_construct (GType object_type); static void pdfpc_cache_status_finalize (pdfpcCacheStatus* obj); /** * Register the functions for updating */ void pdfpc_cache_status_register_update (pdfpcCacheStatus* self, pdfpcCacheStatusUpdateFunction update, void* update_target, pdfpcCacheStatusUpdateComplete complete, void* complete_target) { pdfpcCacheStatusUpdateFunction _tmp0_; void* _tmp0__target; pdfpcCacheStatusUpdateComplete _tmp1_; void* _tmp1__target; g_return_if_fail (self != NULL); _tmp0_ = update; _tmp0__target = update_target; (self->priv->update_function_target_destroy_notify == NULL) ? NULL : (self->priv->update_function_target_destroy_notify (self->priv->update_function_target), NULL); self->priv->update_function = NULL; self->priv->update_function_target = NULL; self->priv->update_function_target_destroy_notify = NULL; self->priv->update_function = _tmp0_; self->priv->update_function_target = _tmp0__target; self->priv->update_function_target_destroy_notify = NULL; _tmp1_ = complete; _tmp1__target = complete_target; (self->priv->update_complete_target_destroy_notify == NULL) ? NULL : (self->priv->update_complete_target_destroy_notify (self->priv->update_complete_target), NULL); self->priv->update_complete = NULL; self->priv->update_complete_target = NULL; self->priv->update_complete_target_destroy_notify = NULL; self->priv->update_complete = _tmp1_; self->priv->update_complete_target = _tmp1__target; self->priv->update_complete_target_destroy_notify = NULL; } /** * Draw the current state to the widgets surface */ void pdfpc_cache_status_update (pdfpcCacheStatus* self) { gint _tmp0_; gint _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = self->current_value; _tmp1_ = self->max_value; if (_tmp0_ == _tmp1_) { pdfpcCacheStatusUpdateComplete _tmp2_; void* _tmp2__target; _tmp2_ = self->priv->update_complete; _tmp2__target = self->priv->update_complete_target; if (_tmp2_ != NULL) { pdfpcCacheStatusUpdateComplete _tmp3_; void* _tmp3__target; _tmp3_ = self->priv->update_complete; _tmp3__target = self->priv->update_complete_target; _tmp3_ (_tmp3__target); } } else { pdfpcCacheStatusUpdateFunction _tmp4_; void* _tmp4__target; _tmp4_ = self->priv->update_function; _tmp4__target = self->priv->update_function_target; if (_tmp4_ != NULL) { pdfpcCacheStatusUpdateFunction _tmp5_; void* _tmp5__target; gint _tmp6_; gint _tmp7_; _tmp5_ = self->priv->update_function; _tmp5__target = self->priv->update_function_target; _tmp6_ = self->current_value; _tmp7_ = self->max_value; _tmp5_ (((gdouble) _tmp6_) / _tmp7_, _tmp5__target); } } } /** * Monitor a new view for prerendering information */ static void __lambda2_ (pdfpcCacheStatus* self, pdfpcViewPrerendering* v) { gint _tmp0_; pdfpcViewPrerendering* _tmp1_; pdfpcRendererBase* _tmp2_ = NULL; pdfpcRendererBase* _tmp3_; pdfpcMetadataBase* _tmp4_ = NULL; pdfpcMetadataBase* _tmp5_; guint _tmp6_ = 0U; g_return_if_fail (v != NULL); _tmp0_ = self->max_value; _tmp1_ = v; _tmp2_ = pdfpc_view_base_get_renderer (PDFPC_VIEW_BASE (_tmp1_)); _tmp3_ = _tmp2_; _tmp4_ = pdfpc_renderer_base_get_metadata (_tmp3_); _tmp5_ = _tmp4_; _tmp6_ = pdfpc_metadata_base_get_slide_count (_tmp5_); self->max_value = _tmp0_ + ((gint) _tmp6_); _g_object_unref0 (_tmp5_); _g_object_unref0 (_tmp3_); } static void ___lambda2__pdfpc_view_prerendering_prerendering_started (pdfpcViewPrerendering* _sender, gpointer self) { __lambda2_ (self, _sender); } static void __lambda3_ (pdfpcCacheStatus* self) { gint _tmp0_; _tmp0_ = self->current_value; self->current_value = _tmp0_ + 1; pdfpc_cache_status_update (self); } static void ___lambda3__pdfpc_view_prerendering_slide_prerendered (pdfpcViewPrerendering* _sender, gpointer self) { __lambda3_ (self); } void pdfpc_cache_status_monitor_view (pdfpcCacheStatus* self, pdfpcViewPrerendering* view) { pdfpcViewPrerendering* _tmp0_; pdfpcViewPrerendering* _tmp1_; g_return_if_fail (self != NULL); g_return_if_fail (view != NULL); _tmp0_ = view; g_signal_connect (_tmp0_, "prerendering-started", (GCallback) ___lambda2__pdfpc_view_prerendering_prerendering_started, self); _tmp1_ = view; g_signal_connect (_tmp1_, "slide-prerendered", (GCallback) ___lambda3__pdfpc_view_prerendering_slide_prerendered, self); } pdfpcCacheStatus* pdfpc_cache_status_construct (GType object_type) { pdfpcCacheStatus* self = NULL; self = (pdfpcCacheStatus*) g_type_create_instance (object_type); return self; } pdfpcCacheStatus* pdfpc_cache_status_new (void) { return pdfpc_cache_status_construct (PDFPC_TYPE_CACHE_STATUS); } static void pdfpc_value_cache_status_init (GValue* value) { value->data[0].v_pointer = NULL; } static void pdfpc_value_cache_status_free_value (GValue* value) { if (value->data[0].v_pointer) { pdfpc_cache_status_unref (value->data[0].v_pointer); } } static void pdfpc_value_cache_status_copy_value (const GValue* src_value, GValue* dest_value) { if (src_value->data[0].v_pointer) { dest_value->data[0].v_pointer = pdfpc_cache_status_ref (src_value->data[0].v_pointer); } else { dest_value->data[0].v_pointer = NULL; } } static gpointer pdfpc_value_cache_status_peek_pointer (const GValue* value) { return value->data[0].v_pointer; } static gchar* pdfpc_value_cache_status_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { if (collect_values[0].v_pointer) { pdfpcCacheStatus* object; object = collect_values[0].v_pointer; if (object->parent_instance.g_class == NULL) { return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); } value->data[0].v_pointer = pdfpc_cache_status_ref (object); } else { value->data[0].v_pointer = NULL; } return NULL; } static gchar* pdfpc_value_cache_status_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { pdfpcCacheStatus** object_p; object_p = collect_values[0].v_pointer; if (!object_p) { return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); } if (!value->data[0].v_pointer) { *object_p = NULL; } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { *object_p = value->data[0].v_pointer; } else { *object_p = pdfpc_cache_status_ref (value->data[0].v_pointer); } return NULL; } GParamSpec* pdfpc_param_spec_cache_status (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { pdfpcParamSpecCacheStatus* spec; g_return_val_if_fail (g_type_is_a (object_type, PDFPC_TYPE_CACHE_STATUS), NULL); spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); G_PARAM_SPEC (spec)->value_type = object_type; return G_PARAM_SPEC (spec); } gpointer pdfpc_value_get_cache_status (const GValue* value) { g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_TYPE_CACHE_STATUS), NULL); return value->data[0].v_pointer; } void pdfpc_value_set_cache_status (GValue* value, gpointer v_object) { pdfpcCacheStatus* old; g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_TYPE_CACHE_STATUS)); old = value->data[0].v_pointer; if (v_object) { g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PDFPC_TYPE_CACHE_STATUS)); g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); value->data[0].v_pointer = v_object; pdfpc_cache_status_ref (value->data[0].v_pointer); } else { value->data[0].v_pointer = NULL; } if (old) { pdfpc_cache_status_unref (old); } } void pdfpc_value_take_cache_status (GValue* value, gpointer v_object) { pdfpcCacheStatus* old; g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_TYPE_CACHE_STATUS)); old = value->data[0].v_pointer; if (v_object) { g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PDFPC_TYPE_CACHE_STATUS)); g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); value->data[0].v_pointer = v_object; } else { value->data[0].v_pointer = NULL; } if (old) { pdfpc_cache_status_unref (old); } } static void pdfpc_cache_status_class_init (pdfpcCacheStatusClass * klass) { pdfpc_cache_status_parent_class = g_type_class_peek_parent (klass); PDFPC_CACHE_STATUS_CLASS (klass)->finalize = pdfpc_cache_status_finalize; g_type_class_add_private (klass, sizeof (pdfpcCacheStatusPrivate)); } static void pdfpc_cache_status_instance_init (pdfpcCacheStatus * self) { self->priv = PDFPC_CACHE_STATUS_GET_PRIVATE (self); self->current_value = 0; self->max_value = 0; self->priv->update_function = NULL; self->priv->update_complete = NULL; self->ref_count = 1; } static void pdfpc_cache_status_finalize (pdfpcCacheStatus* obj) { pdfpcCacheStatus * self; self = PDFPC_CACHE_STATUS (obj); (self->priv->update_function_target_destroy_notify == NULL) ? NULL : (self->priv->update_function_target_destroy_notify (self->priv->update_function_target), NULL); self->priv->update_function = NULL; self->priv->update_function_target = NULL; self->priv->update_function_target_destroy_notify = NULL; (self->priv->update_complete_target_destroy_notify == NULL) ? NULL : (self->priv->update_complete_target_destroy_notify (self->priv->update_complete_target), NULL); self->priv->update_complete = NULL; self->priv->update_complete_target = NULL; self->priv->update_complete_target_destroy_notify = NULL; } /** * Interface for showing the fill status of all registered pdf image caches */ GType pdfpc_cache_status_get_type (void) { static volatile gsize pdfpc_cache_status_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_cache_status_type_id__volatile)) { static const GTypeValueTable g_define_type_value_table = { pdfpc_value_cache_status_init, pdfpc_value_cache_status_free_value, pdfpc_value_cache_status_copy_value, pdfpc_value_cache_status_peek_pointer, "p", pdfpc_value_cache_status_collect_value, "p", pdfpc_value_cache_status_lcopy_value }; static const GTypeInfo g_define_type_info = { sizeof (pdfpcCacheStatusClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_cache_status_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcCacheStatus), 0, (GInstanceInitFunc) pdfpc_cache_status_instance_init, &g_define_type_value_table }; static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; GType pdfpc_cache_status_type_id; pdfpc_cache_status_type_id = g_type_register_fundamental (g_type_fundamental_next (), "pdfpcCacheStatus", &g_define_type_info, &g_define_type_fundamental_info, 0); g_once_init_leave (&pdfpc_cache_status_type_id__volatile, pdfpc_cache_status_type_id); } return pdfpc_cache_status_type_id__volatile; } gpointer pdfpc_cache_status_ref (gpointer instance) { pdfpcCacheStatus* self; self = instance; g_atomic_int_inc (&self->ref_count); return instance; } void pdfpc_cache_status_unref (gpointer instance) { pdfpcCacheStatus* self; self = instance; if (g_atomic_int_dec_and_test (&self->ref_count)) { PDFPC_CACHE_STATUS_GET_CLASS (self)->finalize (self); g_type_free_instance ((GTypeInstance *) self); } } davvil-pdfpc-074a3c6/c-src/classes/configFileReader.c000066400000000000000000001022011177613036100224230ustar00rootroot00000000000000/* configFileReader.c generated by valac 0.16.0, the Vala compiler * generated from configFileReader.vala, do not modify */ #include #include #include #include #include #include #include #include #define PDFPC_TYPE_CONFIG_FILE_READER (pdfpc_config_file_reader_get_type ()) #define PDFPC_CONFIG_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CONFIG_FILE_READER, pdfpcConfigFileReader)) #define PDFPC_CONFIG_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_CONFIG_FILE_READER, pdfpcConfigFileReaderClass)) #define PDFPC_IS_CONFIG_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CONFIG_FILE_READER)) #define PDFPC_IS_CONFIG_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_CONFIG_FILE_READER)) #define PDFPC_CONFIG_FILE_READER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_CONFIG_FILE_READER, pdfpcConfigFileReaderClass)) typedef struct _pdfpcConfigFileReader pdfpcConfigFileReader; typedef struct _pdfpcConfigFileReaderClass pdfpcConfigFileReaderClass; typedef struct _pdfpcConfigFileReaderPrivate pdfpcConfigFileReaderPrivate; #define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController)) #define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) #define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) typedef struct _pdfpcPresentationController pdfpcPresentationController; typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _g_free0(var) (var = (g_free (var), NULL)) #define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL))) #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) typedef struct _pdfpcParamSpecConfigFileReader pdfpcParamSpecConfigFileReader; struct _pdfpcConfigFileReader { GTypeInstance parent_instance; volatile int ref_count; pdfpcConfigFileReaderPrivate * priv; pdfpcPresentationController* presentation_controller; }; struct _pdfpcConfigFileReaderClass { GTypeClass parent_class; void (*finalize) (pdfpcConfigFileReader *self); }; typedef guint (*pdfpcConfigFileReaderbinding2uint) (const gchar* a, void* user_data); struct _pdfpcParamSpecConfigFileReader { GParamSpec parent_instance; }; static gpointer pdfpc_config_file_reader_parent_class = NULL; extern gboolean pdfpc_options_display_switch; gpointer pdfpc_config_file_reader_ref (gpointer instance); void pdfpc_config_file_reader_unref (gpointer instance); GParamSpec* pdfpc_param_spec_config_file_reader (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_value_set_config_file_reader (GValue* value, gpointer v_object); void pdfpc_value_take_config_file_reader (GValue* value, gpointer v_object); gpointer pdfpc_value_get_config_file_reader (const GValue* value); GType pdfpc_config_file_reader_get_type (void) G_GNUC_CONST; GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST; enum { PDFPC_CONFIG_FILE_READER_DUMMY_PROPERTY }; pdfpcConfigFileReader* pdfpc_config_file_reader_new (pdfpcPresentationController* controller); pdfpcConfigFileReader* pdfpc_config_file_reader_construct (GType object_type, pdfpcPresentationController* controller); void pdfpc_presentation_controller_set_accepted_key_mods (pdfpcPresentationController* self, guint value); static void pdfpc_config_file_reader_readBindDef (pdfpcConfigFileReader* self, const gchar* name, pdfpcConfigFileReaderbinding2uint conversor, void* conversor_target, guint* code, guint* modMask); static void pdfpc_config_file_reader_bindKey (pdfpcConfigFileReader* self, const gchar* wholeLine, gchar** fields, int fields_length1); static guint _gdk_keyval_from_name_pdfpc_config_file_readerbinding2uint (const gchar* a, gpointer self); void pdfpc_presentation_controller_bind (pdfpcPresentationController* self, guint keycode, guint modMask, const gchar* function); static void pdfpc_config_file_reader_unbindKey (pdfpcConfigFileReader* self, const gchar* wholeLine, gchar** fields, int fields_length1); void pdfpc_presentation_controller_unbind (pdfpcPresentationController* self, guint keycode, guint modMask); static void pdfpc_config_file_reader_bindMouse (pdfpcConfigFileReader* self, const gchar* wholeLine, gchar** fields, int fields_length1); static guint __lambda8_ (pdfpcConfigFileReader* self, const gchar* x); static guint ___lambda8__pdfpc_config_file_readerbinding2uint (const gchar* a, gpointer self); void pdfpc_presentation_controller_bindMouse (pdfpcPresentationController* self, guint button, guint modMask, const gchar* function); static void pdfpc_config_file_reader_unbindMouse (pdfpcConfigFileReader* self, const gchar* wholeLine, gchar** fields, int fields_length1); static guint __lambda9_ (pdfpcConfigFileReader* self, const gchar* x); static guint ___lambda9__pdfpc_config_file_readerbinding2uint (const gchar* a, gpointer self); void pdfpc_presentation_controller_unbindMouse (pdfpcPresentationController* self, guint keycode, guint modMask); void pdfpc_config_file_reader_readConfig (pdfpcConfigFileReader* self, const gchar* fname); void pdfpc_presentation_controller_unbindAll (pdfpcPresentationController* self); void pdfpc_presentation_controller_unbindAllMouse (pdfpcPresentationController* self); static void pdfpc_config_file_reader_finalize (pdfpcConfigFileReader* obj); static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); static gint _vala_array_length (gpointer array); static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } pdfpcConfigFileReader* pdfpc_config_file_reader_construct (GType object_type, pdfpcPresentationController* controller) { pdfpcConfigFileReader* self = NULL; pdfpcPresentationController* _tmp0_; pdfpcPresentationController* _tmp1_; guint supportedModifiers; pdfpcPresentationController* _tmp2_; g_return_val_if_fail (controller != NULL, NULL); self = (pdfpcConfigFileReader*) g_type_create_instance (object_type); _tmp0_ = controller; _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->presentation_controller); self->presentation_controller = _tmp1_; supportedModifiers = (guint) ((GDK_SHIFT_MASK | GDK_CONTROL_MASK) | GDK_META_MASK); _tmp2_ = self->presentation_controller; pdfpc_presentation_controller_set_accepted_key_mods (_tmp2_, supportedModifiers); return self; } pdfpcConfigFileReader* pdfpc_config_file_reader_new (pdfpcPresentationController* controller) { return pdfpc_config_file_reader_construct (PDFPC_TYPE_CONFIG_FILE_READER, controller); } static gchar string_get (const gchar* self, glong index) { gchar result = '\0'; glong _tmp0_; gchar _tmp1_; g_return_val_if_fail (self != NULL, '\0'); _tmp0_ = index; _tmp1_ = ((gchar*) self)[_tmp0_]; result = _tmp1_; return result; } static void pdfpc_config_file_reader_readBindDef (pdfpcConfigFileReader* self, const gchar* name, pdfpcConfigFileReaderbinding2uint conversor, void* conversor_target, guint* code, guint* modMask) { guint _vala_code = 0U; guint _vala_modMask = 0U; const gchar* _tmp0_; gchar** _tmp1_; gchar** _tmp2_ = NULL; gchar** fields; gint fields_length1; gint _fields_size_; gchar** _tmp3_; gint _tmp3__length1; g_return_if_fail (self != NULL); g_return_if_fail (name != NULL); _tmp0_ = name; _tmp2_ = _tmp1_ = g_strsplit (_tmp0_, "+", 0); fields = _tmp2_; fields_length1 = _vala_array_length (_tmp1_); _fields_size_ = fields_length1; _vala_modMask = (guint) 0x0; _vala_code = (guint) 0x0; _tmp3_ = fields; _tmp3__length1 = fields_length1; if (_tmp3__length1 == 1) { pdfpcConfigFileReaderbinding2uint _tmp4_; void* _tmp4__target; const gchar* _tmp5_; guint _tmp6_ = 0U; _tmp4_ = conversor; _tmp4__target = conversor_target; _tmp5_ = name; _tmp6_ = _tmp4_ (_tmp5_, _tmp4__target); _vala_code = _tmp6_; } else { gchar** _tmp7_; gint _tmp7__length1; _tmp7_ = fields; _tmp7__length1 = fields_length1; if (_tmp7__length1 == 2) { gchar** _tmp8_; gint _tmp8__length1; const gchar* _tmp9_; gchar* _tmp10_; gchar* modString; pdfpcConfigFileReaderbinding2uint _tmp28_; void* _tmp28__target; gchar** _tmp29_; gint _tmp29__length1; const gchar* _tmp30_; guint _tmp31_ = 0U; _tmp8_ = fields; _tmp8__length1 = fields_length1; _tmp9_ = _tmp8_[0]; _tmp10_ = g_strdup (_tmp9_); modString = _tmp10_; { gint m; m = 0; { gboolean _tmp11_; _tmp11_ = TRUE; while (TRUE) { gboolean _tmp12_; gint _tmp14_; const gchar* _tmp15_; gint _tmp16_; gint _tmp17_; const gchar* _tmp18_; gint _tmp19_; gchar _tmp20_ = '\0'; _tmp12_ = _tmp11_; if (!_tmp12_) { gint _tmp13_; _tmp13_ = m; m = _tmp13_ + 1; } _tmp11_ = FALSE; _tmp14_ = m; _tmp15_ = modString; _tmp16_ = strlen (_tmp15_); _tmp17_ = _tmp16_; if (!(_tmp14_ < _tmp17_)) { break; } _tmp18_ = modString; _tmp19_ = m; _tmp20_ = string_get (_tmp18_, (glong) _tmp19_); switch (_tmp20_) { case 'S': { guint _tmp21_; _tmp21_ = _vala_modMask; _vala_modMask = _tmp21_ | GDK_SHIFT_MASK; break; } case 'C': { guint _tmp22_; _tmp22_ = _vala_modMask; _vala_modMask = _tmp22_ | GDK_CONTROL_MASK; break; } case 'A': case 'M': { guint _tmp23_; _tmp23_ = _vala_modMask; _vala_modMask = _tmp23_ | GDK_META_MASK; break; } default: { FILE* _tmp24_; const gchar* _tmp25_; gint _tmp26_; gchar _tmp27_ = '\0'; _tmp24_ = stderr; _tmp25_ = modString; _tmp26_ = m; _tmp27_ = string_get (_tmp25_, (glong) _tmp26_); fprintf (_tmp24_, "Warning: Ignoring unknown modifier '%c'\n", (gint) _tmp27_); break; } } } } } _tmp28_ = conversor; _tmp28__target = conversor_target; _tmp29_ = fields; _tmp29__length1 = fields_length1; _tmp30_ = _tmp29_[1]; _tmp31_ = _tmp28_ (_tmp30_, _tmp28__target); _vala_code = _tmp31_; _g_free0 (modString); } } fields = (_vala_array_free (fields, fields_length1, (GDestroyNotify) g_free), NULL); if (code) { *code = _vala_code; } if (modMask) { *modMask = _vala_modMask; } } static guint _gdk_keyval_from_name_pdfpc_config_file_readerbinding2uint (const gchar* a, gpointer self) { guint result; result = gdk_keyval_from_name (a); return result; } static void pdfpc_config_file_reader_bindKey (pdfpcConfigFileReader* self, const gchar* wholeLine, gchar** fields, int fields_length1) { gchar** _tmp0_; gint _tmp0__length1; guint modMask; guint keycode; gchar** _tmp3_; gint _tmp3__length1; const gchar* _tmp4_; guint _tmp5_ = 0U; guint _tmp6_ = 0U; guint _tmp7_; g_return_if_fail (self != NULL); g_return_if_fail (wholeLine != NULL); _tmp0_ = fields; _tmp0__length1 = fields_length1; if (_tmp0__length1 != 3) { FILE* _tmp1_; const gchar* _tmp2_; _tmp1_ = stderr; _tmp2_ = wholeLine; fprintf (_tmp1_, "Bad key specification: %s\n", _tmp2_); return; } modMask = (guint) 0; keycode = (guint) 0; _tmp3_ = fields; _tmp3__length1 = fields_length1; _tmp4_ = _tmp3_[1]; pdfpc_config_file_reader_readBindDef (self, _tmp4_, _gdk_keyval_from_name_pdfpc_config_file_readerbinding2uint, NULL, &_tmp5_, &_tmp6_); keycode = _tmp5_; modMask = _tmp6_; _tmp7_ = keycode; if (_tmp7_ == ((guint) 0x0)) { FILE* _tmp8_; gchar** _tmp9_; gint _tmp9__length1; const gchar* _tmp10_; _tmp8_ = stderr; _tmp9_ = fields; _tmp9__length1 = fields_length1; _tmp10_ = _tmp9_[1]; fprintf (_tmp8_, "Warning: Unknown key: %s\n", _tmp10_); } else { pdfpcPresentationController* _tmp11_; guint _tmp12_; guint _tmp13_; gchar** _tmp14_; gint _tmp14__length1; const gchar* _tmp15_; _tmp11_ = self->presentation_controller; _tmp12_ = keycode; _tmp13_ = modMask; _tmp14_ = fields; _tmp14__length1 = fields_length1; _tmp15_ = _tmp14_[2]; pdfpc_presentation_controller_bind (_tmp11_, _tmp12_, _tmp13_, _tmp15_); } } static void pdfpc_config_file_reader_unbindKey (pdfpcConfigFileReader* self, const gchar* wholeLine, gchar** fields, int fields_length1) { gchar** _tmp0_; gint _tmp0__length1; guint modMask; guint keycode; gchar** _tmp3_; gint _tmp3__length1; const gchar* _tmp4_; guint _tmp5_ = 0U; guint _tmp6_ = 0U; guint _tmp7_; g_return_if_fail (self != NULL); g_return_if_fail (wholeLine != NULL); _tmp0_ = fields; _tmp0__length1 = fields_length1; if (_tmp0__length1 != 2) { FILE* _tmp1_; const gchar* _tmp2_; _tmp1_ = stderr; _tmp2_ = wholeLine; fprintf (_tmp1_, "Bad unbind specification: %s\n", _tmp2_); return; } modMask = (guint) 0; keycode = (guint) 0; _tmp3_ = fields; _tmp3__length1 = fields_length1; _tmp4_ = _tmp3_[1]; pdfpc_config_file_reader_readBindDef (self, _tmp4_, _gdk_keyval_from_name_pdfpc_config_file_readerbinding2uint, NULL, &_tmp5_, &_tmp6_); keycode = _tmp5_; modMask = _tmp6_; _tmp7_ = keycode; if (_tmp7_ == ((guint) 0x0)) { FILE* _tmp8_; gchar** _tmp9_; gint _tmp9__length1; const gchar* _tmp10_; _tmp8_ = stderr; _tmp9_ = fields; _tmp9__length1 = fields_length1; _tmp10_ = _tmp9_[1]; fprintf (_tmp8_, "Warning: Unknown key: %s\n", _tmp10_); } else { pdfpcPresentationController* _tmp11_; guint _tmp12_; guint _tmp13_; _tmp11_ = self->presentation_controller; _tmp12_ = keycode; _tmp13_ = modMask; pdfpc_presentation_controller_unbind (_tmp11_, _tmp12_, _tmp13_); } } static guint __lambda8_ (pdfpcConfigFileReader* self, const gchar* x) { guint result = 0U; const gchar* _tmp0_; gint _tmp1_ = 0; g_return_val_if_fail (x != NULL, 0U); _tmp0_ = x; _tmp1_ = atoi (_tmp0_); result = (guint) _tmp1_; return result; } static guint ___lambda8__pdfpc_config_file_readerbinding2uint (const gchar* a, gpointer self) { guint result; result = __lambda8_ (self, a); return result; } static void pdfpc_config_file_reader_bindMouse (pdfpcConfigFileReader* self, const gchar* wholeLine, gchar** fields, int fields_length1) { gchar** _tmp0_; gint _tmp0__length1; guint modMask; guint button; gchar** _tmp3_; gint _tmp3__length1; const gchar* _tmp4_; guint _tmp5_ = 0U; guint _tmp6_ = 0U; guint _tmp7_; g_return_if_fail (self != NULL); g_return_if_fail (wholeLine != NULL); _tmp0_ = fields; _tmp0__length1 = fields_length1; if (_tmp0__length1 != 3) { FILE* _tmp1_; const gchar* _tmp2_; _tmp1_ = stderr; _tmp2_ = wholeLine; fprintf (_tmp1_, "Bad mouse specification: %s\n", _tmp2_); return; } modMask = (guint) 0; button = (guint) 0; _tmp3_ = fields; _tmp3__length1 = fields_length1; _tmp4_ = _tmp3_[1]; pdfpc_config_file_reader_readBindDef (self, _tmp4_, ___lambda8__pdfpc_config_file_readerbinding2uint, self, &_tmp5_, &_tmp6_); button = _tmp5_; modMask = _tmp6_; _tmp7_ = button; if (_tmp7_ == ((guint) 0x0)) { FILE* _tmp8_; gchar** _tmp9_; gint _tmp9__length1; const gchar* _tmp10_; _tmp8_ = stderr; _tmp9_ = fields; _tmp9__length1 = fields_length1; _tmp10_ = _tmp9_[1]; fprintf (_tmp8_, "Warning: Unknown button: %s\n", _tmp10_); } else { pdfpcPresentationController* _tmp11_; guint _tmp12_; guint _tmp13_; gchar** _tmp14_; gint _tmp14__length1; const gchar* _tmp15_; _tmp11_ = self->presentation_controller; _tmp12_ = button; _tmp13_ = modMask; _tmp14_ = fields; _tmp14__length1 = fields_length1; _tmp15_ = _tmp14_[2]; pdfpc_presentation_controller_bindMouse (_tmp11_, _tmp12_, _tmp13_, _tmp15_); } } static guint __lambda9_ (pdfpcConfigFileReader* self, const gchar* x) { guint result = 0U; const gchar* _tmp0_; gint _tmp1_ = 0; g_return_val_if_fail (x != NULL, 0U); _tmp0_ = x; _tmp1_ = atoi (_tmp0_); result = (guint) _tmp1_; return result; } static guint ___lambda9__pdfpc_config_file_readerbinding2uint (const gchar* a, gpointer self) { guint result; result = __lambda9_ (self, a); return result; } static void pdfpc_config_file_reader_unbindMouse (pdfpcConfigFileReader* self, const gchar* wholeLine, gchar** fields, int fields_length1) { gchar** _tmp0_; gint _tmp0__length1; guint modMask; guint button; gchar** _tmp3_; gint _tmp3__length1; const gchar* _tmp4_; guint _tmp5_ = 0U; guint _tmp6_ = 0U; guint _tmp7_; g_return_if_fail (self != NULL); g_return_if_fail (wholeLine != NULL); _tmp0_ = fields; _tmp0__length1 = fields_length1; if (_tmp0__length1 != 2) { FILE* _tmp1_; const gchar* _tmp2_; _tmp1_ = stderr; _tmp2_ = wholeLine; fprintf (_tmp1_, "Bad unmouse specification: %s\n", _tmp2_); return; } modMask = (guint) 0; button = (guint) 0; _tmp3_ = fields; _tmp3__length1 = fields_length1; _tmp4_ = _tmp3_[1]; pdfpc_config_file_reader_readBindDef (self, _tmp4_, ___lambda9__pdfpc_config_file_readerbinding2uint, self, &_tmp5_, &_tmp6_); button = _tmp5_; modMask = _tmp6_; _tmp7_ = button; if (_tmp7_ == ((guint) 0x0)) { FILE* _tmp8_; gchar** _tmp9_; gint _tmp9__length1; const gchar* _tmp10_; _tmp8_ = stderr; _tmp9_ = fields; _tmp9__length1 = fields_length1; _tmp10_ = _tmp9_[1]; fprintf (_tmp8_, "Warning: Unknown button: %s\n", _tmp10_); } else { pdfpcPresentationController* _tmp11_; guint _tmp12_; guint _tmp13_; _tmp11_ = self->presentation_controller; _tmp12_ = button; _tmp13_ = modMask; pdfpc_presentation_controller_unbindMouse (_tmp11_, _tmp12_, _tmp13_); } } void pdfpc_config_file_reader_readConfig (pdfpcConfigFileReader* self, const gchar* fname) { const gchar* _tmp0_; GFile* _tmp1_ = NULL; GFile* file; GRegex* _tmp2_; GRegex* splitRegex; GRegex* _tmp3_; GRegex* commentRegex; guint8* raw_datau8 = NULL; gint raw_datau8_length1 = 0; gint _raw_datau8_size_ = 0; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (fname != NULL); _tmp0_ = fname; _tmp1_ = g_file_new_for_path (_tmp0_); file = _tmp1_; _tmp2_ = g_regex_new ("\\s\\s*", 0, 0, &_inner_error_); splitRegex = _tmp2_; if (_inner_error_ != NULL) { _g_object_unref0 (file); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } _tmp3_ = g_regex_new ("\\s*#.*$", 0, 0, &_inner_error_); commentRegex = _tmp3_; if (_inner_error_ != NULL) { _g_regex_unref0 (splitRegex); _g_object_unref0 (file); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } { GFile* _tmp4_; guint8* _tmp5_ = NULL; gsize _tmp6_; guint8* _tmp7_; gint _tmp7__length1; gchar** _tmp8_; gchar** _tmp9_ = NULL; gchar** lines; gint lines_length1; gint _lines_size_; _tmp4_ = file; g_file_load_contents (_tmp4_, NULL, &_tmp5_, &_tmp6_, NULL, &_inner_error_); raw_datau8 = (g_free (raw_datau8), NULL); raw_datau8 = _tmp5_; raw_datau8_length1 = _tmp6_; _raw_datau8_size_ = raw_datau8_length1; if (_inner_error_ != NULL) { goto __catch0_g_error; } _tmp7_ = raw_datau8; _tmp7__length1 = raw_datau8_length1; _tmp9_ = _tmp8_ = g_strsplit ((const gchar*) _tmp7_, "\n", 0); lines = _tmp9_; lines_length1 = _vala_array_length (_tmp8_); _lines_size_ = lines_length1; { gint i; i = 0; { gboolean _tmp10_; _tmp10_ = TRUE; while (TRUE) { gboolean _tmp11_; gint _tmp13_; gchar** _tmp14_; gint _tmp14__length1; GRegex* _tmp15_; gchar** _tmp16_; gint _tmp16__length1; gint _tmp17_; const gchar* _tmp18_; gchar* _tmp19_ = NULL; gchar* uncommentedLine; GRegex* _tmp20_; const gchar* _tmp21_; gchar** _tmp22_; gchar** _tmp23_ = NULL; gchar** fields; gint fields_length1; gint _fields_size_; gchar** _tmp24_; gint _tmp24__length1; gchar** _tmp25_; gint _tmp25__length1; const gchar* _tmp26_; const gchar* _tmp27_; GQuark _tmp29_ = 0U; static GQuark _tmp28_label0 = 0; static GQuark _tmp28_label1 = 0; static GQuark _tmp28_label2 = 0; static GQuark _tmp28_label3 = 0; static GQuark _tmp28_label4 = 0; static GQuark _tmp28_label5 = 0; static GQuark _tmp28_label6 = 0; _tmp11_ = _tmp10_; if (!_tmp11_) { gint _tmp12_; _tmp12_ = i; i = _tmp12_ + 1; } _tmp10_ = FALSE; _tmp13_ = i; _tmp14_ = lines; _tmp14__length1 = lines_length1; if (!(_tmp13_ < _tmp14__length1)) { break; } _tmp15_ = commentRegex; _tmp16_ = lines; _tmp16__length1 = lines_length1; _tmp17_ = i; _tmp18_ = _tmp16_[_tmp17_]; _tmp19_ = g_regex_replace (_tmp15_, _tmp18_, (gssize) (-1), 0, "", 0, &_inner_error_); uncommentedLine = _tmp19_; if (_inner_error_ != NULL) { lines = (_vala_array_free (lines, lines_length1, (GDestroyNotify) g_free), NULL); goto __catch0_g_error; } _tmp20_ = splitRegex; _tmp21_ = uncommentedLine; _tmp23_ = _tmp22_ = g_regex_split (_tmp20_, _tmp21_, 0); fields = _tmp23_; fields_length1 = _vala_array_length (_tmp22_); _fields_size_ = fields_length1; _tmp24_ = fields; _tmp24__length1 = fields_length1; if (_tmp24__length1 == 0) { fields = (_vala_array_free (fields, fields_length1, (GDestroyNotify) g_free), NULL); _g_free0 (uncommentedLine); continue; } _tmp25_ = fields; _tmp25__length1 = fields_length1; _tmp26_ = _tmp25_[0]; _tmp27_ = _tmp26_; _tmp29_ = (NULL == _tmp27_) ? 0 : g_quark_from_string (_tmp27_); if (_tmp29_ == ((0 != _tmp28_label0) ? _tmp28_label0 : (_tmp28_label0 = g_quark_from_static_string ("bind")))) { switch (0) { default: { const gchar* _tmp30_; gchar** _tmp31_; gint _tmp31__length1; _tmp30_ = uncommentedLine; _tmp31_ = fields; _tmp31__length1 = fields_length1; pdfpc_config_file_reader_bindKey (self, _tmp30_, _tmp31_, _tmp31__length1); break; } } } else if (_tmp29_ == ((0 != _tmp28_label1) ? _tmp28_label1 : (_tmp28_label1 = g_quark_from_static_string ("unbind")))) { switch (0) { default: { const gchar* _tmp32_; gchar** _tmp33_; gint _tmp33__length1; _tmp32_ = uncommentedLine; _tmp33_ = fields; _tmp33__length1 = fields_length1; pdfpc_config_file_reader_unbindKey (self, _tmp32_, _tmp33_, _tmp33__length1); break; } } } else if (_tmp29_ == ((0 != _tmp28_label2) ? _tmp28_label2 : (_tmp28_label2 = g_quark_from_static_string ("unbind_all")))) { switch (0) { default: { pdfpcPresentationController* _tmp34_; _tmp34_ = self->presentation_controller; pdfpc_presentation_controller_unbindAll (_tmp34_); break; } } } else if (_tmp29_ == ((0 != _tmp28_label3) ? _tmp28_label3 : (_tmp28_label3 = g_quark_from_static_string ("mouse")))) { switch (0) { default: { const gchar* _tmp35_; gchar** _tmp36_; gint _tmp36__length1; _tmp35_ = uncommentedLine; _tmp36_ = fields; _tmp36__length1 = fields_length1; pdfpc_config_file_reader_bindMouse (self, _tmp35_, _tmp36_, _tmp36__length1); break; } } } else if (_tmp29_ == ((0 != _tmp28_label4) ? _tmp28_label4 : (_tmp28_label4 = g_quark_from_static_string ("unmouse")))) { switch (0) { default: { const gchar* _tmp37_; gchar** _tmp38_; gint _tmp38__length1; _tmp37_ = uncommentedLine; _tmp38_ = fields; _tmp38__length1 = fields_length1; pdfpc_config_file_reader_unbindMouse (self, _tmp37_, _tmp38_, _tmp38__length1); break; } } } else if (_tmp29_ == ((0 != _tmp28_label5) ? _tmp28_label5 : (_tmp28_label5 = g_quark_from_static_string ("unmouse_all")))) { switch (0) { default: { pdfpcPresentationController* _tmp39_; _tmp39_ = self->presentation_controller; pdfpc_presentation_controller_unbindAllMouse (_tmp39_); break; } } } else if (_tmp29_ == ((0 != _tmp28_label6) ? _tmp28_label6 : (_tmp28_label6 = g_quark_from_static_string ("switch-screens")))) { switch (0) { default: { gboolean _tmp40_; _tmp40_ = pdfpc_options_display_switch; pdfpc_options_display_switch = !_tmp40_; break; } } } else { switch (0) { default: { FILE* _tmp41_; const gchar* _tmp42_; _tmp41_ = stderr; _tmp42_ = uncommentedLine; fprintf (_tmp41_, "Warning: Unknown command line \"%s\"\n", _tmp42_); break; } } } fields = (_vala_array_free (fields, fields_length1, (GDestroyNotify) g_free), NULL); _g_free0 (uncommentedLine); } } } lines = (_vala_array_free (lines, lines_length1, (GDestroyNotify) g_free), NULL); } goto __finally0; __catch0_g_error: { GError* e = NULL; e = _inner_error_; _inner_error_ = NULL; _g_error_free0 (e); } __finally0: if (_inner_error_ != NULL) { raw_datau8 = (g_free (raw_datau8), NULL); _g_regex_unref0 (commentRegex); _g_regex_unref0 (splitRegex); _g_object_unref0 (file); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } raw_datau8 = (g_free (raw_datau8), NULL); _g_regex_unref0 (commentRegex); _g_regex_unref0 (splitRegex); _g_object_unref0 (file); } static void pdfpc_value_config_file_reader_init (GValue* value) { value->data[0].v_pointer = NULL; } static void pdfpc_value_config_file_reader_free_value (GValue* value) { if (value->data[0].v_pointer) { pdfpc_config_file_reader_unref (value->data[0].v_pointer); } } static void pdfpc_value_config_file_reader_copy_value (const GValue* src_value, GValue* dest_value) { if (src_value->data[0].v_pointer) { dest_value->data[0].v_pointer = pdfpc_config_file_reader_ref (src_value->data[0].v_pointer); } else { dest_value->data[0].v_pointer = NULL; } } static gpointer pdfpc_value_config_file_reader_peek_pointer (const GValue* value) { return value->data[0].v_pointer; } static gchar* pdfpc_value_config_file_reader_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { if (collect_values[0].v_pointer) { pdfpcConfigFileReader* object; object = collect_values[0].v_pointer; if (object->parent_instance.g_class == NULL) { return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); } value->data[0].v_pointer = pdfpc_config_file_reader_ref (object); } else { value->data[0].v_pointer = NULL; } return NULL; } static gchar* pdfpc_value_config_file_reader_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { pdfpcConfigFileReader** object_p; object_p = collect_values[0].v_pointer; if (!object_p) { return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); } if (!value->data[0].v_pointer) { *object_p = NULL; } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { *object_p = value->data[0].v_pointer; } else { *object_p = pdfpc_config_file_reader_ref (value->data[0].v_pointer); } return NULL; } GParamSpec* pdfpc_param_spec_config_file_reader (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { pdfpcParamSpecConfigFileReader* spec; g_return_val_if_fail (g_type_is_a (object_type, PDFPC_TYPE_CONFIG_FILE_READER), NULL); spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); G_PARAM_SPEC (spec)->value_type = object_type; return G_PARAM_SPEC (spec); } gpointer pdfpc_value_get_config_file_reader (const GValue* value) { g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_TYPE_CONFIG_FILE_READER), NULL); return value->data[0].v_pointer; } void pdfpc_value_set_config_file_reader (GValue* value, gpointer v_object) { pdfpcConfigFileReader* old; g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_TYPE_CONFIG_FILE_READER)); old = value->data[0].v_pointer; if (v_object) { g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PDFPC_TYPE_CONFIG_FILE_READER)); g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); value->data[0].v_pointer = v_object; pdfpc_config_file_reader_ref (value->data[0].v_pointer); } else { value->data[0].v_pointer = NULL; } if (old) { pdfpc_config_file_reader_unref (old); } } void pdfpc_value_take_config_file_reader (GValue* value, gpointer v_object) { pdfpcConfigFileReader* old; g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_TYPE_CONFIG_FILE_READER)); old = value->data[0].v_pointer; if (v_object) { g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PDFPC_TYPE_CONFIG_FILE_READER)); g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); value->data[0].v_pointer = v_object; } else { value->data[0].v_pointer = NULL; } if (old) { pdfpc_config_file_reader_unref (old); } } static void pdfpc_config_file_reader_class_init (pdfpcConfigFileReaderClass * klass) { pdfpc_config_file_reader_parent_class = g_type_class_peek_parent (klass); PDFPC_CONFIG_FILE_READER_CLASS (klass)->finalize = pdfpc_config_file_reader_finalize; } static void pdfpc_config_file_reader_instance_init (pdfpcConfigFileReader * self) { self->ref_count = 1; } static void pdfpc_config_file_reader_finalize (pdfpcConfigFileReader* obj) { pdfpcConfigFileReader * self; self = PDFPC_CONFIG_FILE_READER (obj); _g_object_unref0 (self->presentation_controller); } GType pdfpc_config_file_reader_get_type (void) { static volatile gsize pdfpc_config_file_reader_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_config_file_reader_type_id__volatile)) { static const GTypeValueTable g_define_type_value_table = { pdfpc_value_config_file_reader_init, pdfpc_value_config_file_reader_free_value, pdfpc_value_config_file_reader_copy_value, pdfpc_value_config_file_reader_peek_pointer, "p", pdfpc_value_config_file_reader_collect_value, "p", pdfpc_value_config_file_reader_lcopy_value }; static const GTypeInfo g_define_type_info = { sizeof (pdfpcConfigFileReaderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_config_file_reader_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcConfigFileReader), 0, (GInstanceInitFunc) pdfpc_config_file_reader_instance_init, &g_define_type_value_table }; static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; GType pdfpc_config_file_reader_type_id; pdfpc_config_file_reader_type_id = g_type_register_fundamental (g_type_fundamental_next (), "pdfpcConfigFileReader", &g_define_type_info, &g_define_type_fundamental_info, 0); g_once_init_leave (&pdfpc_config_file_reader_type_id__volatile, pdfpc_config_file_reader_type_id); } return pdfpc_config_file_reader_type_id__volatile; } gpointer pdfpc_config_file_reader_ref (gpointer instance) { pdfpcConfigFileReader* self; self = instance; g_atomic_int_inc (&self->ref_count); return instance; } void pdfpc_config_file_reader_unref (gpointer instance) { pdfpcConfigFileReader* self; self = instance; if (g_atomic_int_dec_and_test (&self->ref_count)) { PDFPC_CONFIG_FILE_READER_GET_CLASS (self)->finalize (self); g_type_free_instance ((GTypeInstance *) self); } } static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { if ((array != NULL) && (destroy_func != NULL)) { int i; for (i = 0; i < array_length; i = i + 1) { if (((gpointer*) array)[i] != NULL) { destroy_func (((gpointer*) array)[i]); } } } } static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { _vala_array_destroy (array, array_length, destroy_func); g_free (array); } static gint _vala_array_length (gpointer array) { int length; length = 0; if (array) { while (((gpointer*) array)[length]) { length++; } } return length; } davvil-pdfpc-074a3c6/c-src/classes/metadata/000077500000000000000000000000001177613036100206535ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/classes/metadata/base.c000066400000000000000000000116711177613036100217370ustar00rootroot00000000000000/* base.c generated by valac 0.16.0, the Vala compiler * generated from base.vala, do not modify */ #include #include #include #include #include #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; typedef struct _pdfpcMetadataBasePrivate pdfpcMetadataBasePrivate; #define _g_free0(var) (var = (g_free (var), NULL)) #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) struct _pdfpcMetadataBase { GObject parent_instance; pdfpcMetadataBasePrivate * priv; gchar* fname; gchar* url; }; struct _pdfpcMetadataBaseClass { GObjectClass parent_class; guint (*get_slide_count) (pdfpcMetadataBase* self); }; static gpointer pdfpc_metadata_base_parent_class = NULL; GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; enum { PDFPC_METADATA_BASE_DUMMY_PROPERTY }; pdfpcMetadataBase* pdfpc_metadata_base_construct (GType object_type, const gchar* fname); gchar* pdfpc_metadata_base_get_url (pdfpcMetadataBase* self); guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self); static guint pdfpc_metadata_base_real_get_slide_count (pdfpcMetadataBase* self); static void pdfpc_metadata_base_finalize (GObject* obj); /** * Base constructor taking the url to specifiy the slideset as argument */ pdfpcMetadataBase* pdfpc_metadata_base_construct (GType object_type, const gchar* fname) { pdfpcMetadataBase * self = NULL; const gchar* _tmp0_; gchar* _tmp1_; const gchar* _tmp2_; GFile* _tmp3_ = NULL; GFile* _tmp4_; gchar* _tmp5_ = NULL; g_return_val_if_fail (fname != NULL, NULL); self = (pdfpcMetadataBase*) g_object_new (object_type, NULL); _tmp0_ = fname; _tmp1_ = g_strdup (_tmp0_); _g_free0 (self->fname); self->fname = _tmp1_; _tmp2_ = fname; _tmp3_ = g_file_new_for_commandline_arg (_tmp2_); _tmp4_ = _tmp3_; _tmp5_ = g_file_get_uri (_tmp4_); _g_free0 (self->url); self->url = _tmp5_; _g_object_unref0 (_tmp4_); return self; } /** * Return the registered url */ gchar* pdfpc_metadata_base_get_url (pdfpcMetadataBase* self) { gchar* result = NULL; const gchar* _tmp0_; gchar* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->url; _tmp1_ = g_strdup (_tmp0_); result = _tmp1_; return result; } /** * Return the number of slides defined by the given url */ static guint pdfpc_metadata_base_real_get_slide_count (pdfpcMetadataBase* self) { g_critical ("Type `%s' does not implement abstract method `pdfpc_metadata_base_get_slide_count'", g_type_name (G_TYPE_FROM_INSTANCE (self))); return 0U; } guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self) { g_return_val_if_fail (self != NULL, 0U); return PDFPC_METADATA_BASE_GET_CLASS (self)->get_slide_count (self); } static void pdfpc_metadata_base_class_init (pdfpcMetadataBaseClass * klass) { pdfpc_metadata_base_parent_class = g_type_class_peek_parent (klass); PDFPC_METADATA_BASE_CLASS (klass)->get_slide_count = pdfpc_metadata_base_real_get_slide_count; G_OBJECT_CLASS (klass)->finalize = pdfpc_metadata_base_finalize; } static void pdfpc_metadata_base_instance_init (pdfpcMetadataBase * self) { } static void pdfpc_metadata_base_finalize (GObject* obj) { pdfpcMetadataBase * self; self = PDFPC_METADATA_BASE (obj); _g_free0 (self->fname); _g_free0 (self->url); G_OBJECT_CLASS (pdfpc_metadata_base_parent_class)->finalize (obj); } /** * Metadata base class describing the basic metadata needed for every * slideset */ GType pdfpc_metadata_base_get_type (void) { static volatile gsize pdfpc_metadata_base_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_metadata_base_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcMetadataBaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_metadata_base_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcMetadataBase), 0, (GInstanceInitFunc) pdfpc_metadata_base_instance_init, NULL }; GType pdfpc_metadata_base_type_id; pdfpc_metadata_base_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcMetadataBase", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); g_once_init_leave (&pdfpc_metadata_base_type_id__volatile, pdfpc_metadata_base_type_id); } return pdfpc_metadata_base_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/metadata/pdf.c000066400000000000000000001525511177613036100216010ustar00rootroot00000000000000/* pdf.c generated by valac 0.16.0, the Vala compiler * generated from pdf.vala, do not modify */ #include #include #include #include #include #include #include #include #include #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; typedef struct _pdfpcMetadataBasePrivate pdfpcMetadataBasePrivate; #define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ()) #define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf)) #define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) #define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf; typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass; typedef struct _pdfpcMetadataPdfPrivate pdfpcMetadataPdfPrivate; #define PDFPC_TYPE_SLIDES_NOTES (pdfpc_slides_notes_get_type ()) #define PDFPC_SLIDES_NOTES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notes)) #define PDFPC_SLIDES_NOTES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notesClass)) #define PDFPC_IS_SLIDES_NOTES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_SLIDES_NOTES)) #define PDFPC_IS_SLIDES_NOTES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_SLIDES_NOTES)) #define PDFPC_SLIDES_NOTES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notesClass)) typedef struct _pdfpcslides_notes pdfpcslides_notes; typedef struct _pdfpcslides_notesClass pdfpcslides_notesClass; #define PDFPC_METADATA_PDF_TYPE_PARSE_STATE (pdfpc_metadata_pdf_parse_state_get_type ()) #define _g_free0(var) (var = (g_free (var), NULL)) #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) struct _pdfpcMetadataBase { GObject parent_instance; pdfpcMetadataBasePrivate * priv; gchar* fname; gchar* url; }; struct _pdfpcMetadataBaseClass { GObjectClass parent_class; guint (*get_slide_count) (pdfpcMetadataBase* self); }; struct _pdfpcMetadataPdf { pdfpcMetadataBase parent_instance; pdfpcMetadataPdfPrivate * priv; gchar* pdf_fname; gchar* pdf_url; gchar* pdfpc_url; PopplerDocument* document; gdouble page_width; gdouble page_height; guint page_count; pdfpcslides_notes* notes; gboolean skips_by_user; guint duration; }; struct _pdfpcMetadataPdfClass { pdfpcMetadataBaseClass parent_class; }; struct _pdfpcMetadataPdfPrivate { gint* user_view_indexes; gint user_view_indexes_length1; gint _user_view_indexes_size_; gint end_user_slide; }; typedef enum { PDFPC_METADATA_PDF_PARSE_STATE_FILE, PDFPC_METADATA_PDF_PARSE_STATE_SKIP, PDFPC_METADATA_PDF_PARSE_STATE_DURATION, PDFPC_METADATA_PDF_PARSE_STATE_END_USER_SLIDE, PDFPC_METADATA_PDF_PARSE_STATE_NOTES, PDFPC_METADATA_PDF_PARSE_STATE_NOTHING } pdfpcMetadataPdfParseState; static gpointer pdfpc_metadata_pdf_parent_class = NULL; extern GMutex* pdfpc_mutex_locks_poppler; GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST; GType pdfpc_slides_notes_get_type (void) G_GNUC_CONST; #define PDFPC_METADATA_PDF_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfPrivate)) enum { PDFPC_METADATA_PDF_DUMMY_PROPERTY }; static GType pdfpc_metadata_pdf_parse_state_get_type (void) G_GNUC_UNUSED; static void pdfpc_metadata_pdf_parse_pdfpc_file (pdfpcMetadataPdf* self, gchar** skip_line); void pdfpc_slides_notes_parse_lines (pdfpcslides_notes* self, gchar** lines, int lines_length1); static void pdfpc_metadata_pdf_parse_skip_line (pdfpcMetadataPdf* self, const gchar* line); static void _vala_array_add1 (gint** array, int* length, int* size, gint value); static void _vala_array_add2 (gint** array, int* length, int* size, gint value); static void pdfpc_metadata_pdf_fill_path_info (pdfpcMetadataPdf* self, const gchar* fname); void pdfpc_metadata_pdf_save_to_disk (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_duration (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_skips (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_end_user_slide (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_notes (pdfpcMetadataPdf* self); gboolean pdfpc_slides_notes_has_notes (pdfpcslides_notes* self); gchar* pdfpc_slides_notes_format_to_save (pdfpcslides_notes* self); pdfpcMetadataPdf* pdfpc_metadata_pdf_new (const gchar* fname); pdfpcMetadataPdf* pdfpc_metadata_pdf_construct (GType object_type, const gchar* fname); pdfpcMetadataBase* pdfpc_metadata_base_construct (GType object_type, const gchar* fname); pdfpcslides_notes* pdfpc_slides_notes_new (void); pdfpcslides_notes* pdfpc_slides_notes_construct (GType object_type); PopplerDocument* pdfpc_metadata_pdf_open_pdf_document (pdfpcMetadataPdf* self, const gchar* url); static void _vala_array_add3 (gint** array, int* length, int* size, gint value); static guint pdfpc_metadata_pdf_real_get_slide_count (pdfpcMetadataBase* base); gint pdfpc_metadata_pdf_get_user_slide_count (pdfpcMetadataPdf* self); gint pdfpc_metadata_pdf_get_end_user_slide (pdfpcMetadataPdf* self); void pdfpc_metadata_pdf_set_end_user_slide (pdfpcMetadataPdf* self, gint slide); gint pdfpc_metadata_pdf_toggle_skip (pdfpcMetadataPdf* self, gint slide_number, gint user_slide_number); gint pdfpc_metadata_pdf_user_slide_to_real_slide (pdfpcMetadataPdf* self, gint number); static gint* _vala_array_dup1 (gint* self, int length); static gint* _vala_array_dup2 (gint* self, int length); gint pdfpc_metadata_pdf_real_slide_to_user_slide (pdfpcMetadataPdf* self, gint number); gdouble pdfpc_metadata_pdf_get_page_width (pdfpcMetadataPdf* self); gdouble pdfpc_metadata_pdf_get_page_height (pdfpcMetadataPdf* self); PopplerDocument* pdfpc_metadata_pdf_get_document (pdfpcMetadataPdf* self); pdfpcslides_notes* pdfpc_metadata_pdf_get_notes (pdfpcMetadataPdf* self); guint pdfpc_metadata_pdf_get_duration (pdfpcMetadataPdf* self); void pdfpc_metadata_pdf_set_duration (pdfpcMetadataPdf* self, guint d); static void pdfpc_metadata_pdf_finalize (GObject* obj); static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); static gint _vala_array_length (gpointer array); /** * The parsing states for the pdfpc file */ static GType pdfpc_metadata_pdf_parse_state_get_type (void) { static volatile gsize pdfpc_metadata_pdf_parse_state_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_metadata_pdf_parse_state_type_id__volatile)) { static const GEnumValue values[] = {{PDFPC_METADATA_PDF_PARSE_STATE_FILE, "PDFPC_METADATA_PDF_PARSE_STATE_FILE", "file"}, {PDFPC_METADATA_PDF_PARSE_STATE_SKIP, "PDFPC_METADATA_PDF_PARSE_STATE_SKIP", "skip"}, {PDFPC_METADATA_PDF_PARSE_STATE_DURATION, "PDFPC_METADATA_PDF_PARSE_STATE_DURATION", "duration"}, {PDFPC_METADATA_PDF_PARSE_STATE_END_USER_SLIDE, "PDFPC_METADATA_PDF_PARSE_STATE_END_USER_SLIDE", "end-user-slide"}, {PDFPC_METADATA_PDF_PARSE_STATE_NOTES, "PDFPC_METADATA_PDF_PARSE_STATE_NOTES", "notes"}, {PDFPC_METADATA_PDF_PARSE_STATE_NOTHING, "PDFPC_METADATA_PDF_PARSE_STATE_NOTHING", "nothing"}, {0, NULL, NULL}}; GType pdfpc_metadata_pdf_parse_state_type_id; pdfpc_metadata_pdf_parse_state_type_id = g_enum_register_static ("pdfpcMetadataPdfParseState", values); g_once_init_leave (&pdfpc_metadata_pdf_parse_state_type_id__volatile, pdfpc_metadata_pdf_parse_state_type_id); } return pdfpc_metadata_pdf_parse_state_type_id__volatile; } /** * Parse the given pdfpc file */ static gchar* string_strip (const gchar* self) { gchar* result = NULL; gchar* _tmp0_ = NULL; gchar* _result_; const gchar* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_strdup (self); _result_ = _tmp0_; _tmp1_ = _result_; g_strstrip (_tmp1_); result = _result_; return result; } static void pdfpc_metadata_pdf_parse_pdfpc_file (pdfpcMetadataPdf* self, gchar** skip_line) { gchar* _vala_skip_line = NULL; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); _g_free0 (_vala_skip_line); _vala_skip_line = NULL; { const gchar* _tmp0_; GFile* _tmp1_ = NULL; GFile* file; guint8* raw_datau8 = NULL; gint raw_datau8_length1 = 0; gint _raw_datau8_size_ = 0; GFile* _tmp2_; guint8* _tmp3_ = NULL; gsize _tmp4_; guint8* _tmp5_; gint _tmp5__length1; gchar** _tmp6_; gchar** _tmp7_ = NULL; gchar** lines; gint lines_length1; gint _lines_size_; pdfpcMetadataPdfParseState state; _tmp0_ = self->pdfpc_url; _tmp1_ = g_file_new_for_uri (_tmp0_); file = _tmp1_; _tmp2_ = file; g_file_load_contents (_tmp2_, NULL, &_tmp3_, &_tmp4_, NULL, &_inner_error_); raw_datau8 = (g_free (raw_datau8), NULL); raw_datau8 = _tmp3_; raw_datau8_length1 = _tmp4_; _raw_datau8_size_ = raw_datau8_length1; if (_inner_error_ != NULL) { raw_datau8 = (g_free (raw_datau8), NULL); _g_object_unref0 (file); goto __catch1_g_error; } _tmp5_ = raw_datau8; _tmp5__length1 = raw_datau8_length1; _tmp7_ = _tmp6_ = g_strsplit ((const gchar*) _tmp5_, "\n", 0); lines = _tmp7_; lines_length1 = _vala_array_length (_tmp6_); _lines_size_ = lines_length1; state = PDFPC_METADATA_PDF_PARSE_STATE_NOTHING; { gint i; i = 0; { gboolean _tmp8_; _tmp8_ = TRUE; while (TRUE) { gboolean _tmp9_; gint _tmp11_; gchar** _tmp12_; gint _tmp12__length1; gchar** _tmp13_; gint _tmp13__length1; gint _tmp14_; const gchar* _tmp15_; gchar* _tmp16_ = NULL; gchar* l; const gchar* _tmp17_; const gchar* _tmp18_; _tmp9_ = _tmp8_; if (!_tmp9_) { gint _tmp10_; _tmp10_ = i; i = _tmp10_ + 1; } _tmp8_ = FALSE; _tmp11_ = i; _tmp12_ = lines; _tmp12__length1 = lines_length1; if (!(_tmp11_ < _tmp12__length1)) { break; } _tmp13_ = lines; _tmp13__length1 = lines_length1; _tmp14_ = i; _tmp15_ = _tmp13_[_tmp14_]; _tmp16_ = string_strip (_tmp15_); l = _tmp16_; _tmp17_ = l; if (g_strcmp0 (_tmp17_, "") == 0) { _g_free0 (l); continue; } _tmp18_ = l; if (g_strcmp0 (_tmp18_, "[file]") == 0) { state = PDFPC_METADATA_PDF_PARSE_STATE_FILE; } else { const gchar* _tmp19_; _tmp19_ = l; if (g_strcmp0 (_tmp19_, "[skip]") == 0) { state = PDFPC_METADATA_PDF_PARSE_STATE_SKIP; } else { const gchar* _tmp20_; _tmp20_ = l; if (g_strcmp0 (_tmp20_, "[duration]") == 0) { state = PDFPC_METADATA_PDF_PARSE_STATE_DURATION; } else { const gchar* _tmp21_; _tmp21_ = l; if (g_strcmp0 (_tmp21_, "[end_user_slide]") == 0) { state = PDFPC_METADATA_PDF_PARSE_STATE_END_USER_SLIDE; } else { const gchar* _tmp22_; _tmp22_ = l; if (g_strcmp0 (_tmp22_, "[notes]") == 0) { pdfpcslides_notes* _tmp23_; gchar** _tmp24_; gint _tmp24__length1; gint _tmp25_; gchar** _tmp26_; gint _tmp26__length1; _tmp23_ = self->notes; _tmp24_ = lines; _tmp24__length1 = lines_length1; _tmp25_ = i; _tmp26_ = lines; _tmp26__length1 = lines_length1; pdfpc_slides_notes_parse_lines (_tmp23_, _tmp24_ + (_tmp25_ + 1), _tmp26__length1 - (_tmp25_ + 1)); _g_free0 (l); break; } else { pdfpcMetadataPdfParseState _tmp27_; _tmp27_ = state; switch (_tmp27_) { case PDFPC_METADATA_PDF_PARSE_STATE_FILE: { const gchar* _tmp28_; gchar* _tmp29_; GFile* _tmp30_; GFile* _tmp31_ = NULL; GFile* _tmp32_; const gchar* _tmp33_; GFile* _tmp34_ = NULL; GFile* _tmp35_; GFile* pdffile; GFile* _tmp36_; gchar* _tmp37_ = NULL; _tmp28_ = l; _tmp29_ = g_strdup (_tmp28_); _g_free0 (self->pdf_fname); self->pdf_fname = _tmp29_; _tmp30_ = file; _tmp31_ = g_file_get_parent (_tmp30_); _tmp32_ = _tmp31_; _tmp33_ = self->pdf_fname; _tmp34_ = g_file_get_child (_tmp32_, _tmp33_); _tmp35_ = _tmp34_; _g_object_unref0 (_tmp32_); pdffile = _tmp35_; _tmp36_ = pdffile; _tmp37_ = g_file_get_uri (_tmp36_); _g_free0 (self->pdf_url); self->pdf_url = _tmp37_; state = PDFPC_METADATA_PDF_PARSE_STATE_NOTHING; _g_object_unref0 (pdffile); break; } case PDFPC_METADATA_PDF_PARSE_STATE_SKIP: { const gchar* _tmp38_; gchar* _tmp39_; _tmp38_ = l; _tmp39_ = g_strdup (_tmp38_); _g_free0 (_vala_skip_line); _vala_skip_line = _tmp39_; self->skips_by_user = TRUE; state = PDFPC_METADATA_PDF_PARSE_STATE_NOTHING; break; } case PDFPC_METADATA_PDF_PARSE_STATE_DURATION: { const gchar* _tmp40_; gint _tmp41_ = 0; _tmp40_ = l; _tmp41_ = atoi (_tmp40_); self->duration = (guint) _tmp41_; break; } case PDFPC_METADATA_PDF_PARSE_STATE_END_USER_SLIDE: { const gchar* _tmp42_; gint _tmp43_ = 0; _tmp42_ = l; _tmp43_ = atoi (_tmp42_); self->priv->end_user_slide = _tmp43_; break; } default: break; } } } } } } _g_free0 (l); } } } lines = (_vala_array_free (lines, lines_length1, (GDestroyNotify) g_free), NULL); raw_datau8 = (g_free (raw_datau8), NULL); _g_object_unref0 (file); } goto __finally1; __catch1_g_error: { GError* e = NULL; const gchar* _tmp44_; e = _inner_error_; _inner_error_ = NULL; _tmp44_ = e->message; g_error ("pdf.vala:145: %s", _tmp44_); _g_error_free0 (e); } __finally1: if (_inner_error_ != NULL) { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } if (skip_line) { *skip_line = _vala_skip_line; } else { _g_free0 (_vala_skip_line); } } /** * Parse the line for the skip slides */ static void _vala_array_add1 (gint** array, int* length, int* size, gint value) { if ((*length) == (*size)) { *size = (*size) ? (2 * (*size)) : 4; *array = g_renew (gint, *array, *size); } (*array)[(*length)++] = value; } static void _vala_array_add2 (gint** array, int* length, int* size, gint value) { if ((*length) == (*size)) { *size = (*size) ? (2 * (*size)) : 4; *array = g_renew (gint, *array, *size); } (*array)[(*length)++] = value; } static void pdfpc_metadata_pdf_parse_skip_line (pdfpcMetadataPdf* self, const gchar* line) { gint s; const gchar* _tmp0_; gchar** _tmp1_; gchar** _tmp2_ = NULL; gchar** fields; gint fields_length1; gint _fields_size_; g_return_if_fail (self != NULL); g_return_if_fail (line != NULL); s = 0; _tmp0_ = line; _tmp2_ = _tmp1_ = g_strsplit (_tmp0_, ",", 0); fields = _tmp2_; fields_length1 = _vala_array_length (_tmp1_); _fields_size_ = fields_length1; { gint f; f = 0; { gboolean _tmp3_; _tmp3_ = TRUE; while (TRUE) { gboolean _tmp4_; gint _tmp6_; gchar** _tmp7_; gint _tmp7__length1; gchar** _tmp8_; gint _tmp8__length1; gint _tmp9_; const gchar* _tmp10_; gchar** _tmp11_; gint _tmp11__length1; gint _tmp12_; const gchar* _tmp13_; gint _tmp14_ = 0; gint current_skip; gint _tmp20_; _tmp4_ = _tmp3_; if (!_tmp4_) { gint _tmp5_; _tmp5_ = f; f = _tmp5_ + 1; } _tmp3_ = FALSE; _tmp6_ = f; _tmp7_ = fields; _tmp7__length1 = fields_length1; if (!(_tmp6_ < (_tmp7__length1 - 1))) { break; } _tmp8_ = fields; _tmp8__length1 = fields_length1; _tmp9_ = f; _tmp10_ = _tmp8_[_tmp9_]; if (g_strcmp0 (_tmp10_, "") == 0) { continue; } _tmp11_ = fields; _tmp11__length1 = fields_length1; _tmp12_ = f; _tmp13_ = _tmp11_[_tmp12_]; _tmp14_ = atoi (_tmp13_); current_skip = _tmp14_ - 1; while (TRUE) { gint _tmp15_; gint _tmp16_; gint* _tmp17_; gint _tmp17__length1; gint _tmp18_; gint _tmp19_; _tmp15_ = s; _tmp16_ = current_skip; if (!(_tmp15_ < _tmp16_)) { break; } _tmp17_ = self->priv->user_view_indexes; _tmp17__length1 = self->priv->user_view_indexes_length1; _tmp18_ = s; _vala_array_add1 (&self->priv->user_view_indexes, &self->priv->user_view_indexes_length1, &self->priv->_user_view_indexes_size_, _tmp18_); _tmp19_ = s; s = _tmp19_ + 1; } _tmp20_ = s; s = _tmp20_ + 1; } } } while (TRUE) { gint _tmp21_; guint _tmp22_; gint* _tmp23_; gint _tmp23__length1; gint _tmp24_; gint _tmp25_; _tmp21_ = s; _tmp22_ = self->page_count; if (!(((guint) _tmp21_) < _tmp22_)) { break; } _tmp23_ = self->priv->user_view_indexes; _tmp23__length1 = self->priv->user_view_indexes_length1; _tmp24_ = s; _vala_array_add2 (&self->priv->user_view_indexes, &self->priv->user_view_indexes_length1, &self->priv->_user_view_indexes_size_, _tmp24_); _tmp25_ = s; s = _tmp25_ + 1; } fields = (_vala_array_free (fields, fields_length1, (GDestroyNotify) g_free), NULL); } /** * Fill the path information starting from the user provided filename */ static gchar* string_slice (const gchar* self, glong start, glong end) { gchar* result = NULL; gint _tmp0_; gint _tmp1_; glong string_length; glong _tmp2_; glong _tmp5_; gboolean _tmp8_ = FALSE; glong _tmp9_; gboolean _tmp12_; gboolean _tmp13_ = FALSE; glong _tmp14_; gboolean _tmp17_; glong _tmp18_; glong _tmp19_; glong _tmp20_; glong _tmp21_; glong _tmp22_; gchar* _tmp23_ = NULL; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = strlen (self); _tmp1_ = _tmp0_; string_length = (glong) _tmp1_; _tmp2_ = start; if (_tmp2_ < ((glong) 0)) { glong _tmp3_; glong _tmp4_; _tmp3_ = string_length; _tmp4_ = start; start = _tmp3_ + _tmp4_; } _tmp5_ = end; if (_tmp5_ < ((glong) 0)) { glong _tmp6_; glong _tmp7_; _tmp6_ = string_length; _tmp7_ = end; end = _tmp6_ + _tmp7_; } _tmp9_ = start; if (_tmp9_ >= ((glong) 0)) { glong _tmp10_; glong _tmp11_; _tmp10_ = start; _tmp11_ = string_length; _tmp8_ = _tmp10_ <= _tmp11_; } else { _tmp8_ = FALSE; } _tmp12_ = _tmp8_; g_return_val_if_fail (_tmp12_, NULL); _tmp14_ = end; if (_tmp14_ >= ((glong) 0)) { glong _tmp15_; glong _tmp16_; _tmp15_ = end; _tmp16_ = string_length; _tmp13_ = _tmp15_ <= _tmp16_; } else { _tmp13_ = FALSE; } _tmp17_ = _tmp13_; g_return_val_if_fail (_tmp17_, NULL); _tmp18_ = start; _tmp19_ = end; g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL); _tmp20_ = start; _tmp21_ = end; _tmp22_ = start; _tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_)); result = _tmp23_; return result; } static gint string_last_index_of (const gchar* self, const gchar* needle, gint start_index) { gint result = 0; gint _tmp0_; const gchar* _tmp1_; gchar* _tmp2_ = NULL; gchar* _result_; gchar* _tmp3_; g_return_val_if_fail (self != NULL, 0); g_return_val_if_fail (needle != NULL, 0); _tmp0_ = start_index; _tmp1_ = needle; _tmp2_ = g_strrstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_); _result_ = _tmp2_; _tmp3_ = _result_; if (_tmp3_ != NULL) { gchar* _tmp4_; _tmp4_ = _result_; result = (gint) (_tmp4_ - ((gchar*) self)); return result; } else { result = -1; return result; } } static void pdfpc_metadata_pdf_fill_path_info (pdfpcMetadataPdf* self, const gchar* fname) { const gchar* _tmp0_; gint _tmp1_; gint _tmp2_; gint l; const gchar* _tmp3_; GFile* _tmp4_ = NULL; GFile* file; gboolean _tmp5_ = FALSE; const gchar* _tmp6_; gint _tmp7_; gint _tmp8_; gboolean _tmp14_; g_return_if_fail (self != NULL); g_return_if_fail (fname != NULL); _tmp0_ = fname; _tmp1_ = strlen (_tmp0_); _tmp2_ = _tmp1_; l = _tmp2_; _tmp3_ = fname; _tmp4_ = g_file_new_for_commandline_arg (_tmp3_); file = _tmp4_; _tmp6_ = fname; _tmp7_ = strlen (_tmp6_); _tmp8_ = _tmp7_; if (_tmp8_ < 6) { _tmp5_ = TRUE; } else { const gchar* _tmp9_; gint _tmp10_; gint _tmp11_; gchar* _tmp12_ = NULL; gchar* _tmp13_; _tmp9_ = fname; _tmp10_ = l; _tmp11_ = l; _tmp12_ = string_slice (_tmp9_, (glong) (_tmp10_ - 6), (glong) _tmp11_); _tmp13_ = _tmp12_; _tmp5_ = g_strcmp0 (_tmp13_, ".pdfpc") != 0; _g_free0 (_tmp13_); } _tmp14_ = _tmp5_; if (_tmp14_) { GFile* _tmp15_; gchar* _tmp16_ = NULL; GFile* _tmp17_; gchar* _tmp18_ = NULL; GFile* _tmp19_; gchar* _tmp20_ = NULL; gchar* pdf_basefname; const gchar* _tmp21_; gint _tmp22_ = 0; gint extension_index; const gchar* _tmp23_; gint _tmp24_; gchar* _tmp25_ = NULL; gchar* _tmp26_; gchar* _tmp27_; gchar* _tmp28_; gchar* pdfpc_basefname; GFile* _tmp29_; GFile* _tmp30_ = NULL; GFile* _tmp31_; const gchar* _tmp32_; GFile* _tmp33_ = NULL; GFile* _tmp34_; GFile* pdfpc_file; GFile* _tmp35_; gchar* _tmp36_ = NULL; _tmp15_ = file; _tmp16_ = g_file_get_basename (_tmp15_); _g_free0 (self->pdf_fname); self->pdf_fname = _tmp16_; _tmp17_ = file; _tmp18_ = g_file_get_uri (_tmp17_); _g_free0 (self->pdf_url); self->pdf_url = _tmp18_; _tmp19_ = file; _tmp20_ = g_file_get_basename (_tmp19_); pdf_basefname = _tmp20_; _tmp21_ = pdf_basefname; _tmp22_ = string_last_index_of (_tmp21_, ".", 0); extension_index = _tmp22_; _tmp23_ = pdf_basefname; _tmp24_ = extension_index; _tmp25_ = string_slice (_tmp23_, (glong) 0, (glong) _tmp24_); _tmp26_ = _tmp25_; _tmp27_ = g_strconcat (_tmp26_, ".pdfpc", NULL); _tmp28_ = _tmp27_; _g_free0 (_tmp26_); pdfpc_basefname = _tmp28_; _tmp29_ = file; _tmp30_ = g_file_get_parent (_tmp29_); _tmp31_ = _tmp30_; _tmp32_ = pdfpc_basefname; _tmp33_ = g_file_get_child (_tmp31_, _tmp32_); _tmp34_ = _tmp33_; _g_object_unref0 (_tmp31_); pdfpc_file = _tmp34_; _tmp35_ = pdfpc_file; _tmp36_ = g_file_get_uri (_tmp35_); _g_free0 (self->pdfpc_url); self->pdfpc_url = _tmp36_; _g_object_unref0 (pdfpc_file); _g_free0 (pdfpc_basefname); _g_free0 (pdf_basefname); } else { GFile* _tmp37_; gchar* _tmp38_ = NULL; _tmp37_ = file; _tmp38_ = g_file_get_uri (_tmp37_); _g_free0 (self->pdfpc_url); self->pdfpc_url = _tmp38_; } _g_object_unref0 (file); } /** * Save the metadata to disk, if needed (i.e. if the user did something * with the notes or the skips) */ void pdfpc_metadata_pdf_save_to_disk (pdfpcMetadataPdf* self) { gchar* _tmp0_ = NULL; gchar* _tmp1_; gchar* _tmp2_ = NULL; gchar* _tmp3_; gchar* _tmp4_; gchar* _tmp5_; gchar* _tmp6_ = NULL; gchar* _tmp7_; gchar* _tmp8_; gchar* _tmp9_; gchar* _tmp10_ = NULL; gchar* _tmp11_; gchar* _tmp12_; gchar* _tmp13_; gchar* contents; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); _tmp0_ = pdfpc_metadata_pdf_format_duration (self); _tmp1_ = _tmp0_; _tmp2_ = pdfpc_metadata_pdf_format_skips (self); _tmp3_ = _tmp2_; _tmp4_ = g_strconcat (_tmp1_, _tmp3_, NULL); _tmp5_ = _tmp4_; _tmp6_ = pdfpc_metadata_pdf_format_end_user_slide (self); _tmp7_ = _tmp6_; _tmp8_ = g_strconcat (_tmp5_, _tmp7_, NULL); _tmp9_ = _tmp8_; _tmp10_ = pdfpc_metadata_pdf_format_notes (self); _tmp11_ = _tmp10_; _tmp12_ = g_strconcat (_tmp9_, _tmp11_, NULL); _tmp13_ = _tmp12_; _g_free0 (_tmp11_); _g_free0 (_tmp9_); _g_free0 (_tmp7_); _g_free0 (_tmp5_); _g_free0 (_tmp3_); _g_free0 (_tmp1_); contents = _tmp13_; { const gchar* _tmp14_; _tmp14_ = contents; if (g_strcmp0 (_tmp14_, "") != 0) { const gchar* _tmp15_; gchar* _tmp16_; gchar* _tmp17_; gchar* _tmp18_; gchar* _tmp19_; const gchar* _tmp20_; gchar* _tmp21_; const gchar* _tmp22_; GFile* _tmp23_ = NULL; GFile* pdfpc_file; GFile* _tmp24_; gchar* _tmp25_ = NULL; gchar* _tmp26_; const gchar* _tmp27_; const gchar* _tmp28_; gint _tmp29_; gint _tmp30_; _tmp15_ = self->pdf_fname; _tmp16_ = g_strconcat ("[file]\n", _tmp15_, NULL); _tmp17_ = _tmp16_; _tmp18_ = g_strconcat (_tmp17_, "\n", NULL); _tmp19_ = _tmp18_; _tmp20_ = contents; _tmp21_ = g_strconcat (_tmp19_, _tmp20_, NULL); _g_free0 (contents); contents = _tmp21_; _g_free0 (_tmp19_); _g_free0 (_tmp17_); _tmp22_ = self->pdfpc_url; _tmp23_ = g_file_new_for_uri (_tmp22_); pdfpc_file = _tmp23_; _tmp24_ = pdfpc_file; _tmp25_ = g_file_get_path (_tmp24_); _tmp26_ = _tmp25_; _tmp27_ = contents; _tmp28_ = contents; _tmp29_ = strlen (_tmp28_); _tmp30_ = _tmp29_; g_file_set_contents (_tmp26_, _tmp27_, (gssize) (_tmp30_ - 1), &_inner_error_); _g_free0 (_tmp26_); if (_inner_error_ != NULL) { _g_object_unref0 (pdfpc_file); goto __catch2_g_error; } _g_object_unref0 (pdfpc_file); } else { const gchar* _tmp31_; GFile* _tmp32_ = NULL; GFile* file; GFile* _tmp33_; gboolean _tmp34_ = FALSE; _tmp31_ = self->pdfpc_url; _tmp32_ = g_file_new_for_uri (_tmp31_); file = _tmp32_; _tmp33_ = file; _tmp34_ = g_file_query_exists (_tmp33_, NULL); if (_tmp34_) { GFile* _tmp35_; _tmp35_ = file; g_file_delete (_tmp35_, NULL, &_inner_error_); if (_inner_error_ != NULL) { _g_object_unref0 (file); goto __catch2_g_error; } } _g_object_unref0 (file); } } goto __finally2; __catch2_g_error: { GError* e = NULL; const gchar* _tmp36_; e = _inner_error_; _inner_error_ = NULL; _tmp36_ = e->message; g_error ("pdf.vala:212: %s", _tmp36_); _g_error_free0 (e); } __finally2: if (_inner_error_ != NULL) { _g_free0 (contents); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } _g_free0 (contents); } /** * Format the skip information for saving to disk */ gchar* pdfpc_metadata_pdf_format_skips (pdfpcMetadataPdf* self) { gchar* result = NULL; gchar* _tmp0_; gchar* contents; gboolean _tmp1_ = FALSE; gint* _tmp2_; gint _tmp2__length1; guint _tmp3_; gboolean _tmp5_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_strdup (""); contents = _tmp0_; _tmp2_ = self->priv->user_view_indexes; _tmp2__length1 = self->priv->user_view_indexes_length1; _tmp3_ = self->page_count; if (((guint) _tmp2__length1) < _tmp3_) { gboolean _tmp4_; _tmp4_ = self->skips_by_user; _tmp1_ = _tmp4_; } else { _tmp1_ = FALSE; } _tmp5_ = _tmp1_; if (_tmp5_) { const gchar* _tmp6_; gchar* _tmp7_; gint user_slide; const gchar* _tmp23_; gchar* _tmp24_; _tmp6_ = contents; _tmp7_ = g_strconcat (_tmp6_, "[skip]\n", NULL); _g_free0 (contents); contents = _tmp7_; user_slide = 0; { gint slide; slide = 0; { gboolean _tmp8_; _tmp8_ = TRUE; while (TRUE) { gboolean _tmp9_; gint _tmp11_; guint _tmp12_; gint _tmp13_; gint* _tmp14_; gint _tmp14__length1; gint _tmp15_; gint _tmp16_; _tmp9_ = _tmp8_; if (!_tmp9_) { gint _tmp10_; _tmp10_ = slide; slide = _tmp10_ + 1; } _tmp8_ = FALSE; _tmp11_ = slide; _tmp12_ = self->page_count; if (!(((guint) _tmp11_) < _tmp12_)) { break; } _tmp13_ = slide; _tmp14_ = self->priv->user_view_indexes; _tmp14__length1 = self->priv->user_view_indexes_length1; _tmp15_ = user_slide; _tmp16_ = _tmp14_[_tmp15_]; if (_tmp13_ != _tmp16_) { const gchar* _tmp17_; gint _tmp18_; gchar* _tmp19_ = NULL; gchar* _tmp20_; gchar* _tmp21_; _tmp17_ = contents; _tmp18_ = slide; _tmp19_ = g_strdup_printf ("%d,", _tmp18_ + 1); _tmp20_ = _tmp19_; _tmp21_ = g_strconcat (_tmp17_, _tmp20_, NULL); _g_free0 (contents); contents = _tmp21_; _g_free0 (_tmp20_); } else { gint _tmp22_; _tmp22_ = user_slide; user_slide = _tmp22_ + 1; } } } } _tmp23_ = contents; _tmp24_ = g_strconcat (_tmp23_, "\n", NULL); _g_free0 (contents); contents = _tmp24_; } result = contents; return result; } gchar* pdfpc_metadata_pdf_format_end_user_slide (pdfpcMetadataPdf* self) { gchar* result = NULL; gchar* _tmp0_; gchar* contents; gint _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_strdup (""); contents = _tmp0_; _tmp1_ = self->priv->end_user_slide; if (_tmp1_ >= 0) { const gchar* _tmp2_; gint _tmp3_; gchar* _tmp4_ = NULL; gchar* _tmp5_; gchar* _tmp6_; _tmp2_ = contents; _tmp3_ = self->priv->end_user_slide; _tmp4_ = g_strdup_printf ("[end_user_slide]\n%d\n", _tmp3_); _tmp5_ = _tmp4_; _tmp6_ = g_strconcat (_tmp2_, _tmp5_, NULL); _g_free0 (contents); contents = _tmp6_; _g_free0 (_tmp5_); } result = contents; return result; } /** * Format the notes for saving to disk */ gchar* pdfpc_metadata_pdf_format_notes (pdfpcMetadataPdf* self) { gchar* result = NULL; gchar* _tmp0_; gchar* contents; pdfpcslides_notes* _tmp1_; gboolean _tmp2_ = FALSE; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_strdup (""); contents = _tmp0_; _tmp1_ = self->notes; _tmp2_ = pdfpc_slides_notes_has_notes (_tmp1_); if (_tmp2_) { const gchar* _tmp3_; pdfpcslides_notes* _tmp4_; gchar* _tmp5_ = NULL; gchar* _tmp6_; gchar* _tmp7_; gchar* _tmp8_; gchar* _tmp9_; _tmp3_ = contents; _tmp4_ = self->notes; _tmp5_ = pdfpc_slides_notes_format_to_save (_tmp4_); _tmp6_ = _tmp5_; _tmp7_ = g_strconcat ("[notes]\n", _tmp6_, NULL); _tmp8_ = _tmp7_; _tmp9_ = g_strconcat (_tmp3_, _tmp8_, NULL); _g_free0 (contents); contents = _tmp9_; _g_free0 (_tmp8_); _g_free0 (_tmp6_); } result = contents; return result; } gchar* pdfpc_metadata_pdf_format_duration (pdfpcMetadataPdf* self) { gchar* result = NULL; gchar* _tmp0_; gchar* contents; guint _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_strdup (""); contents = _tmp0_; _tmp1_ = self->duration; if (_tmp1_ > ((guint) 0)) { const gchar* _tmp2_; guint _tmp3_; gchar* _tmp4_ = NULL; gchar* _tmp5_; gchar* _tmp6_; _tmp2_ = contents; _tmp3_ = self->duration; _tmp4_ = g_strdup_printf ("[duration]\n%u\n", _tmp3_); _tmp5_ = _tmp4_; _tmp6_ = g_strconcat (_tmp2_, _tmp5_, NULL); _g_free0 (contents); contents = _tmp6_; _g_free0 (_tmp5_); } result = contents; return result; } /** * Base constructor taking the file url to the pdf file */ static void _vala_array_add3 (gint** array, int* length, int* size, gint value) { if ((*length) == (*size)) { *size = (*size) ? (2 * (*size)) : 4; *array = g_renew (gint, *array, *size); } (*array)[(*length)++] = value; } pdfpcMetadataPdf* pdfpc_metadata_pdf_construct (GType object_type, const gchar* fname) { pdfpcMetadataPdf * self = NULL; const gchar* _tmp0_; const gchar* _tmp1_; pdfpcslides_notes* _tmp2_; gchar* skip_line; const gchar* _tmp3_; GFile* _tmp4_ = NULL; GFile* _tmp5_; gboolean _tmp6_ = FALSE; gboolean _tmp7_; const gchar* _tmp9_; PopplerDocument* _tmp10_ = NULL; GMutex* _tmp11_; PopplerDocument* _tmp12_; gint _tmp13_ = 0; PopplerDocument* _tmp14_; PopplerPage* _tmp15_ = NULL; PopplerPage* _tmp16_; gdouble _tmp17_ = 0.0; gdouble _tmp18_ = 0.0; gboolean _tmp19_; GMutex* _tmp40_; g_return_val_if_fail (fname != NULL, NULL); _tmp0_ = fname; self = (pdfpcMetadataPdf*) pdfpc_metadata_base_construct (object_type, _tmp0_); _tmp1_ = fname; pdfpc_metadata_pdf_fill_path_info (self, _tmp1_); _tmp2_ = pdfpc_slides_notes_new (); _g_object_unref0 (self->notes); self->notes = _tmp2_; self->skips_by_user = FALSE; skip_line = NULL; _tmp3_ = self->pdfpc_url; _tmp4_ = g_file_new_for_uri (_tmp3_); _tmp5_ = _tmp4_; _tmp6_ = g_file_query_exists (_tmp5_, NULL); _tmp7_ = _tmp6_; _g_object_unref0 (_tmp5_); if (_tmp7_) { gchar* _tmp8_ = NULL; pdfpc_metadata_pdf_parse_pdfpc_file (self, &_tmp8_); _g_free0 (skip_line); skip_line = _tmp8_; } _tmp9_ = self->pdf_url; _tmp10_ = pdfpc_metadata_pdf_open_pdf_document (self, _tmp9_); _g_object_unref0 (self->document); self->document = _tmp10_; _tmp11_ = pdfpc_mutex_locks_poppler; g_mutex_lock (_tmp11_); _tmp12_ = self->document; _tmp13_ = poppler_document_get_n_pages (_tmp12_); self->page_count = (guint) _tmp13_; _tmp14_ = self->document; _tmp15_ = poppler_document_get_page (_tmp14_, 0); _tmp16_ = _tmp15_; poppler_page_get_size (_tmp16_, &_tmp17_, &_tmp18_); self->page_width = _tmp17_; self->page_height = _tmp18_; _g_object_unref0 (_tmp16_); _tmp19_ = self->skips_by_user; if (!_tmp19_) { gchar* previous_label; gint user_pages; previous_label = NULL; user_pages = 0; { gint i; i = 0; { gboolean _tmp20_; _tmp20_ = TRUE; while (TRUE) { gboolean _tmp21_; gint _tmp23_; guint _tmp24_; PopplerDocument* _tmp25_; gint _tmp26_; PopplerPage* _tmp27_ = NULL; PopplerPage* _tmp28_; gchar* _tmp29_; gchar* _tmp30_; gchar* _tmp31_; gchar* this_label; const gchar* _tmp32_; const gchar* _tmp33_; _tmp21_ = _tmp20_; if (!_tmp21_) { gint _tmp22_; _tmp22_ = i; i = _tmp22_ + 1; } _tmp20_ = FALSE; _tmp23_ = i; _tmp24_ = self->page_count; if (!(((guint) _tmp23_) < _tmp24_)) { break; } _tmp25_ = self->document; _tmp26_ = i; _tmp27_ = poppler_document_get_page (_tmp25_, _tmp26_); _tmp28_ = _tmp27_; _tmp29_ = poppler_page_get_label (_tmp28_); _tmp30_ = _tmp29_; _tmp31_ = _tmp30_; _g_object_unref0 (_tmp28_); this_label = _tmp31_; _tmp32_ = this_label; _tmp33_ = previous_label; if (g_strcmp0 (_tmp32_, _tmp33_) != 0) { gint* _tmp34_; gint _tmp34__length1; gint _tmp35_; const gchar* _tmp36_; gchar* _tmp37_; gint _tmp38_; _tmp34_ = self->priv->user_view_indexes; _tmp34__length1 = self->priv->user_view_indexes_length1; _tmp35_ = i; _vala_array_add3 (&self->priv->user_view_indexes, &self->priv->user_view_indexes_length1, &self->priv->_user_view_indexes_size_, _tmp35_); _tmp36_ = this_label; _tmp37_ = g_strdup (_tmp36_); _g_free0 (previous_label); previous_label = _tmp37_; _tmp38_ = user_pages; user_pages = _tmp38_ + 1; } _g_free0 (this_label); } } } _g_free0 (previous_label); } else { const gchar* _tmp39_; _tmp39_ = skip_line; pdfpc_metadata_pdf_parse_skip_line (self, _tmp39_); } _tmp40_ = pdfpc_mutex_locks_poppler; g_mutex_unlock (_tmp40_); _g_free0 (skip_line); return self; } pdfpcMetadataPdf* pdfpc_metadata_pdf_new (const gchar* fname) { return pdfpc_metadata_pdf_construct (PDFPC_METADATA_TYPE_PDF, fname); } /** * Return the number of pages in the pdf document */ static guint pdfpc_metadata_pdf_real_get_slide_count (pdfpcMetadataBase* base) { pdfpcMetadataPdf * self; guint result = 0U; guint _tmp0_; self = (pdfpcMetadataPdf*) base; _tmp0_ = self->page_count; result = _tmp0_; return result; } /** * Return the number of user slides */ gint pdfpc_metadata_pdf_get_user_slide_count (pdfpcMetadataPdf* self) { gint result = 0; gint* _tmp0_; gint _tmp0__length1; g_return_val_if_fail (self != NULL, 0); _tmp0_ = self->priv->user_view_indexes; _tmp0__length1 = self->priv->user_view_indexes_length1; result = _tmp0__length1; return result; } /** * Return the last slide defined by the user. It may be different as * get_user_slide_count()! */ gint pdfpc_metadata_pdf_get_end_user_slide (pdfpcMetadataPdf* self) { gint result = 0; gint _tmp0_; g_return_val_if_fail (self != NULL, 0); _tmp0_ = self->priv->end_user_slide; if (_tmp0_ >= 0) { gint _tmp1_; _tmp1_ = self->priv->end_user_slide; result = _tmp1_; return result; } else { gint _tmp2_ = 0; _tmp2_ = pdfpc_metadata_pdf_get_user_slide_count (self); result = _tmp2_; return result; } } /** * Set the last slide defined by the user */ void pdfpc_metadata_pdf_set_end_user_slide (pdfpcMetadataPdf* self, gint slide) { gint _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = slide; self->priv->end_user_slide = _tmp0_; } /** * Toggle the skip flag for one slide * * We require to be provided also with the user_slide_number, as this * info should be available and so we do not need to perform a search. * * Returns the offset to move the current user_slide_number */ static gint* _vala_array_dup1 (gint* self, int length) { return g_memdup (self, length * sizeof (gint)); } static gint* _vala_array_dup2 (gint* self, int length) { return g_memdup (self, length * sizeof (gint)); } gint pdfpc_metadata_pdf_toggle_skip (pdfpcMetadataPdf* self, gint slide_number, gint user_slide_number) { gint result = 0; gint _tmp0_; gint _tmp1_; gint _tmp2_ = 0; gint converted_user_slide; gint offset = 0; gint* _tmp3_; gint _tmp3__length1; gint l; gint _tmp4_; gint _tmp5_; g_return_val_if_fail (self != NULL, 0); _tmp0_ = slide_number; if (_tmp0_ == 0) { result = 0; return result; } self->skips_by_user = TRUE; _tmp1_ = user_slide_number; _tmp2_ = pdfpc_metadata_pdf_user_slide_to_real_slide (self, _tmp1_); converted_user_slide = _tmp2_; _tmp3_ = self->priv->user_view_indexes; _tmp3__length1 = self->priv->user_view_indexes_length1; l = _tmp3__length1; _tmp4_ = converted_user_slide; _tmp5_ = slide_number; if (_tmp4_ == _tmp5_) { gint _tmp6_; gint* _tmp7_ = NULL; gint* new_indexes; gint new_indexes_length1; gint _new_indexes_size_; gint* _tmp31_; gint _tmp31__length1; gint* _tmp32_; gint _tmp32__length1; gboolean _tmp33_ = FALSE; gint _tmp34_; gboolean _tmp37_; _tmp6_ = l; _tmp7_ = g_new0 (gint, _tmp6_ - 1); new_indexes = _tmp7_; new_indexes_length1 = _tmp6_ - 1; _new_indexes_size_ = new_indexes_length1; { gint i; i = 0; { gboolean _tmp8_; _tmp8_ = TRUE; while (TRUE) { gboolean _tmp9_; gint _tmp11_; gint _tmp12_; gint* _tmp13_; gint _tmp13__length1; gint _tmp14_; gint* _tmp15_; gint _tmp15__length1; gint _tmp16_; gint _tmp17_; gint _tmp18_; _tmp9_ = _tmp8_; if (!_tmp9_) { gint _tmp10_; _tmp10_ = i; i = _tmp10_ + 1; } _tmp8_ = FALSE; _tmp11_ = i; _tmp12_ = user_slide_number; if (!(_tmp11_ < _tmp12_)) { break; } _tmp13_ = new_indexes; _tmp13__length1 = new_indexes_length1; _tmp14_ = i; _tmp15_ = self->priv->user_view_indexes; _tmp15__length1 = self->priv->user_view_indexes_length1; _tmp16_ = i; _tmp17_ = _tmp15_[_tmp16_]; _tmp13_[_tmp14_] = _tmp17_; _tmp18_ = _tmp13_[_tmp14_]; } } } { gint _tmp19_; gint i; _tmp19_ = user_slide_number; i = _tmp19_ + 1; { gboolean _tmp20_; _tmp20_ = TRUE; while (TRUE) { gboolean _tmp21_; gint _tmp23_; gint _tmp24_; gint* _tmp25_; gint _tmp25__length1; gint _tmp26_; gint* _tmp27_; gint _tmp27__length1; gint _tmp28_; gint _tmp29_; gint _tmp30_; _tmp21_ = _tmp20_; if (!_tmp21_) { gint _tmp22_; _tmp22_ = i; i = _tmp22_ + 1; } _tmp20_ = FALSE; _tmp23_ = i; _tmp24_ = l; if (!(_tmp23_ < _tmp24_)) { break; } _tmp25_ = new_indexes; _tmp25__length1 = new_indexes_length1; _tmp26_ = i; _tmp27_ = self->priv->user_view_indexes; _tmp27__length1 = self->priv->user_view_indexes_length1; _tmp28_ = i; _tmp29_ = _tmp27_[_tmp28_]; _tmp25_[_tmp26_ - 1] = _tmp29_; _tmp30_ = _tmp25_[_tmp26_ - 1]; } } } _tmp31_ = new_indexes; _tmp31__length1 = new_indexes_length1; _tmp32_ = (_tmp31_ != NULL) ? _vala_array_dup1 (_tmp31_, _tmp31__length1) : ((gpointer) _tmp31_); _tmp32__length1 = _tmp31__length1; self->priv->user_view_indexes = (g_free (self->priv->user_view_indexes), NULL); self->priv->user_view_indexes = _tmp32_; self->priv->user_view_indexes_length1 = _tmp32__length1; self->priv->_user_view_indexes_size_ = self->priv->user_view_indexes_length1; _tmp34_ = self->priv->end_user_slide; if (_tmp34_ >= 0) { gint _tmp35_; gint _tmp36_; _tmp35_ = user_slide_number; _tmp36_ = self->priv->end_user_slide; _tmp33_ = _tmp35_ < _tmp36_; } else { _tmp33_ = FALSE; } _tmp37_ = _tmp33_; if (_tmp37_) { gint _tmp38_; _tmp38_ = self->priv->end_user_slide; self->priv->end_user_slide = _tmp38_ - 1; } offset = -1; new_indexes = (g_free (new_indexes), NULL); } else { gint _tmp39_; gint* _tmp40_ = NULL; gint* new_indexes; gint new_indexes_length1; gint _new_indexes_size_; gint* _tmp52_; gint _tmp52__length1; gint _tmp53_; gint _tmp54_; gint _tmp55_; gint* _tmp68_; gint _tmp68__length1; gint* _tmp69_; gint _tmp69__length1; gboolean _tmp70_ = FALSE; gint _tmp71_; gboolean _tmp74_; _tmp39_ = l; _tmp40_ = g_new0 (gint, _tmp39_ + 1); new_indexes = _tmp40_; new_indexes_length1 = _tmp39_ + 1; _new_indexes_size_ = new_indexes_length1; { gint i; i = 0; { gboolean _tmp41_; _tmp41_ = TRUE; while (TRUE) { gboolean _tmp42_; gint _tmp44_; gint _tmp45_; gint* _tmp46_; gint _tmp46__length1; gint _tmp47_; gint* _tmp48_; gint _tmp48__length1; gint _tmp49_; gint _tmp50_; gint _tmp51_; _tmp42_ = _tmp41_; if (!_tmp42_) { gint _tmp43_; _tmp43_ = i; i = _tmp43_ + 1; } _tmp41_ = FALSE; _tmp44_ = i; _tmp45_ = user_slide_number; if (!(_tmp44_ <= _tmp45_)) { break; } _tmp46_ = new_indexes; _tmp46__length1 = new_indexes_length1; _tmp47_ = i; _tmp48_ = self->priv->user_view_indexes; _tmp48__length1 = self->priv->user_view_indexes_length1; _tmp49_ = i; _tmp50_ = _tmp48_[_tmp49_]; _tmp46_[_tmp47_] = _tmp50_; _tmp51_ = _tmp46_[_tmp47_]; } } } _tmp52_ = new_indexes; _tmp52__length1 = new_indexes_length1; _tmp53_ = user_slide_number; _tmp54_ = slide_number; _tmp52_[_tmp53_ + 1] = _tmp54_; _tmp55_ = _tmp52_[_tmp53_ + 1]; { gint _tmp56_; gint i; _tmp56_ = user_slide_number; i = _tmp56_ + 1; { gboolean _tmp57_; _tmp57_ = TRUE; while (TRUE) { gboolean _tmp58_; gint _tmp60_; gint _tmp61_; gint* _tmp62_; gint _tmp62__length1; gint _tmp63_; gint* _tmp64_; gint _tmp64__length1; gint _tmp65_; gint _tmp66_; gint _tmp67_; _tmp58_ = _tmp57_; if (!_tmp58_) { gint _tmp59_; _tmp59_ = i; i = _tmp59_ + 1; } _tmp57_ = FALSE; _tmp60_ = i; _tmp61_ = l; if (!(_tmp60_ < _tmp61_)) { break; } _tmp62_ = new_indexes; _tmp62__length1 = new_indexes_length1; _tmp63_ = i; _tmp64_ = self->priv->user_view_indexes; _tmp64__length1 = self->priv->user_view_indexes_length1; _tmp65_ = i; _tmp66_ = _tmp64_[_tmp65_]; _tmp62_[_tmp63_ + 1] = _tmp66_; _tmp67_ = _tmp62_[_tmp63_ + 1]; } } } _tmp68_ = new_indexes; _tmp68__length1 = new_indexes_length1; _tmp69_ = (_tmp68_ != NULL) ? _vala_array_dup2 (_tmp68_, _tmp68__length1) : ((gpointer) _tmp68_); _tmp69__length1 = _tmp68__length1; self->priv->user_view_indexes = (g_free (self->priv->user_view_indexes), NULL); self->priv->user_view_indexes = _tmp69_; self->priv->user_view_indexes_length1 = _tmp69__length1; self->priv->_user_view_indexes_size_ = self->priv->user_view_indexes_length1; _tmp71_ = self->priv->end_user_slide; if (_tmp71_ >= 0) { gint _tmp72_; gint _tmp73_; _tmp72_ = user_slide_number; _tmp73_ = self->priv->end_user_slide; _tmp70_ = _tmp72_ < _tmp73_; } else { _tmp70_ = FALSE; } _tmp74_ = _tmp70_; if (_tmp74_) { gint _tmp75_; _tmp75_ = self->priv->end_user_slide; self->priv->end_user_slide = _tmp75_ + 1; } offset = +1; new_indexes = (g_free (new_indexes), NULL); } result = offset; return result; } /** * Transform from user slide numbers to real slide numbers */ gint pdfpc_metadata_pdf_user_slide_to_real_slide (pdfpcMetadataPdf* self, gint number) { gint result = 0; gint _tmp0_; gint* _tmp1_; gint _tmp1__length1; g_return_val_if_fail (self != NULL, 0); _tmp0_ = number; _tmp1_ = self->priv->user_view_indexes; _tmp1__length1 = self->priv->user_view_indexes_length1; if (_tmp0_ < _tmp1__length1) { gint* _tmp2_; gint _tmp2__length1; gint _tmp3_; gint _tmp4_; _tmp2_ = self->priv->user_view_indexes; _tmp2__length1 = self->priv->user_view_indexes_length1; _tmp3_ = number; _tmp4_ = _tmp2_[_tmp3_]; result = _tmp4_; return result; } else { guint _tmp5_; _tmp5_ = self->page_count; result = (gint) _tmp5_; return result; } } gint pdfpc_metadata_pdf_real_slide_to_user_slide (pdfpcMetadataPdf* self, gint number) { gint result = 0; gint user_slide; g_return_val_if_fail (self != NULL, 0); user_slide = 0; { gint u; u = 0; { gboolean _tmp0_; _tmp0_ = TRUE; while (TRUE) { gboolean _tmp1_; gint _tmp3_; gint _tmp4_ = 0; gint _tmp5_; gint _tmp6_ = 0; gint real_slide; gint _tmp7_; gint _tmp8_; _tmp1_ = _tmp0_; if (!_tmp1_) { gint _tmp2_; _tmp2_ = u; u = _tmp2_ + 1; } _tmp0_ = FALSE; _tmp3_ = u; _tmp4_ = pdfpc_metadata_pdf_get_user_slide_count (self); if (!(_tmp3_ < _tmp4_)) { break; } _tmp5_ = u; _tmp6_ = pdfpc_metadata_pdf_user_slide_to_real_slide (self, _tmp5_); real_slide = _tmp6_; _tmp7_ = number; _tmp8_ = real_slide; if (_tmp7_ == _tmp8_) { gint _tmp9_; _tmp9_ = u; user_slide = _tmp9_; break; } else { gint _tmp10_; gint _tmp11_; _tmp10_ = number; _tmp11_ = real_slide; if (_tmp10_ < _tmp11_) { gint _tmp12_; _tmp12_ = u; user_slide = _tmp12_ - 1; break; } } } } } result = user_slide; return result; } /** * Return the width of the first page of the loaded pdf document. * * In presentations all pages will have the same size in most cases, * therefore this value is assumed to be useful. */ gdouble pdfpc_metadata_pdf_get_page_width (pdfpcMetadataPdf* self) { gdouble result = 0.0; gdouble _tmp0_; g_return_val_if_fail (self != NULL, 0.0); _tmp0_ = self->page_width; result = _tmp0_; return result; } /** * Return the height of the first page of the loaded pdf document. * * In presentations all pages will have the same size in most cases, * therefore this value is assumed to be useful. */ gdouble pdfpc_metadata_pdf_get_page_height (pdfpcMetadataPdf* self) { gdouble result = 0.0; gdouble _tmp0_; g_return_val_if_fail (self != NULL, 0.0); _tmp0_ = self->page_height; result = _tmp0_; return result; } /** * Return the Poppler.Document associated with this file */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } PopplerDocument* pdfpc_metadata_pdf_get_document (pdfpcMetadataPdf* self) { PopplerDocument* result = NULL; PopplerDocument* _tmp0_; PopplerDocument* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->document; _tmp1_ = _g_object_ref0 (_tmp0_); result = _tmp1_; return result; } /** * Return the notes for the presentation */ pdfpcslides_notes* pdfpc_metadata_pdf_get_notes (pdfpcMetadataPdf* self) { pdfpcslides_notes* result = NULL; pdfpcslides_notes* _tmp0_; pdfpcslides_notes* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->notes; _tmp1_ = _g_object_ref0 (_tmp0_); result = _tmp1_; return result; } /** * Get the duration of the presentation */ guint pdfpc_metadata_pdf_get_duration (pdfpcMetadataPdf* self) { guint result = 0U; guint _tmp0_; g_return_val_if_fail (self != NULL, 0U); _tmp0_ = self->duration; result = _tmp0_; return result; } /** * Get the duration of the presentation */ void pdfpc_metadata_pdf_set_duration (pdfpcMetadataPdf* self, guint d) { guint _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = d; self->duration = _tmp0_; } /** * Open a given pdf document url and return a Poppler.Document for it. */ PopplerDocument* pdfpc_metadata_pdf_open_pdf_document (pdfpcMetadataPdf* self, const gchar* url) { PopplerDocument* result = NULL; const gchar* _tmp0_; GFile* _tmp1_ = NULL; GFile* file; PopplerDocument* document; GMutex* _tmp2_; GMutex* _tmp9_; GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (url != NULL, NULL); _tmp0_ = url; _tmp1_ = g_file_new_for_uri (_tmp0_); file = _tmp1_; document = NULL; _tmp2_ = pdfpc_mutex_locks_poppler; g_mutex_lock (_tmp2_); { gchar* _tmp3_ = NULL; gchar* _tmp4_; PopplerDocument* _tmp5_; PopplerDocument* _tmp6_; PopplerDocument* _tmp7_; _tmp3_ = g_file_get_uri (file); _tmp4_ = _tmp3_; _tmp5_ = poppler_document_new_from_file (_tmp4_, NULL, &_inner_error_); _tmp6_ = _tmp5_; _g_free0 (_tmp4_); _tmp7_ = _tmp6_; if (_inner_error_ != NULL) { goto __catch3_g_error; } _g_object_unref0 (document); document = _tmp7_; } goto __finally3; __catch3_g_error: { GError* e = NULL; const gchar* _tmp8_; e = _inner_error_; _inner_error_ = NULL; _tmp8_ = e->message; g_error ("pdf.vala:462: Unable to open pdf file: %s", _tmp8_); _g_error_free0 (e); } __finally3: if (_inner_error_ != NULL) { _g_object_unref0 (document); _g_object_unref0 (file); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } _tmp9_ = pdfpc_mutex_locks_poppler; g_mutex_unlock (_tmp9_); result = document; _g_object_unref0 (file); return result; } static void pdfpc_metadata_pdf_class_init (pdfpcMetadataPdfClass * klass) { pdfpc_metadata_pdf_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (pdfpcMetadataPdfPrivate)); PDFPC_METADATA_BASE_CLASS (klass)->get_slide_count = pdfpc_metadata_pdf_real_get_slide_count; G_OBJECT_CLASS (klass)->finalize = pdfpc_metadata_pdf_finalize; } static void pdfpc_metadata_pdf_instance_init (pdfpcMetadataPdf * self) { self->priv = PDFPC_METADATA_PDF_GET_PRIVATE (self); self->pdf_fname = NULL; self->pdf_url = NULL; self->pdfpc_url = NULL; self->priv->end_user_slide = -1; } static void pdfpc_metadata_pdf_finalize (GObject* obj) { pdfpcMetadataPdf * self; self = PDFPC_METADATA_PDF (obj); _g_free0 (self->pdf_fname); _g_free0 (self->pdf_url); _g_free0 (self->pdfpc_url); _g_object_unref0 (self->document); _g_object_unref0 (self->notes); self->priv->user_view_indexes = (g_free (self->priv->user_view_indexes), NULL); G_OBJECT_CLASS (pdfpc_metadata_pdf_parent_class)->finalize (obj); } /** * Metadata for Pdf files */ GType pdfpc_metadata_pdf_get_type (void) { static volatile gsize pdfpc_metadata_pdf_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_metadata_pdf_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcMetadataPdfClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_metadata_pdf_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcMetadataPdf), 0, (GInstanceInitFunc) pdfpc_metadata_pdf_instance_init, NULL }; GType pdfpc_metadata_pdf_type_id; pdfpc_metadata_pdf_type_id = g_type_register_static (PDFPC_METADATA_TYPE_BASE, "pdfpcMetadataPdf", &g_define_type_info, 0); g_once_init_leave (&pdfpc_metadata_pdf_type_id__volatile, pdfpc_metadata_pdf_type_id); } return pdfpc_metadata_pdf_type_id__volatile; } static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { if ((array != NULL) && (destroy_func != NULL)) { int i; for (i = 0; i < array_length; i = i + 1) { if (((gpointer*) array)[i] != NULL) { destroy_func (((gpointer*) array)[i]); } } } } static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { _vala_array_destroy (array, array_length, destroy_func); g_free (array); } static gint _vala_array_length (gpointer array) { int length; length = 0; if (array) { while (((gpointer*) array)[length]) { length++; } } return length; } davvil-pdfpc-074a3c6/c-src/classes/metadata/slides_notes.c000066400000000000000000000416421177613036100235210ustar00rootroot00000000000000/* slides_notes.c generated by valac 0.16.0, the Vala compiler * generated from slides_notes.vala, do not modify */ #include #include #include #include #define PDFPC_TYPE_SLIDES_NOTES (pdfpc_slides_notes_get_type ()) #define PDFPC_SLIDES_NOTES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notes)) #define PDFPC_SLIDES_NOTES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notesClass)) #define PDFPC_IS_SLIDES_NOTES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_SLIDES_NOTES)) #define PDFPC_IS_SLIDES_NOTES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_SLIDES_NOTES)) #define PDFPC_SLIDES_NOTES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notesClass)) typedef struct _pdfpcslides_notes pdfpcslides_notes; typedef struct _pdfpcslides_notesClass pdfpcslides_notesClass; typedef struct _pdfpcslides_notesPrivate pdfpcslides_notesPrivate; #define _g_free0(var) (var = (g_free (var), NULL)) struct _pdfpcslides_notes { GObject parent_instance; pdfpcslides_notesPrivate * priv; gchar** notes; gint notes_length1; }; struct _pdfpcslides_notesClass { GObjectClass parent_class; }; static gpointer pdfpc_slides_notes_parent_class = NULL; GType pdfpc_slides_notes_get_type (void) G_GNUC_CONST; enum { PDFPC_SLIDES_NOTES_DUMMY_PROPERTY }; void pdfpc_slides_notes_set_note (pdfpcslides_notes* self, const gchar* note, gint slide_number); gchar* pdfpc_slides_notes_get_note_for_slide (pdfpcslides_notes* self, gint number); gboolean pdfpc_slides_notes_has_notes (pdfpcslides_notes* self); gchar* pdfpc_slides_notes_format_to_save (pdfpcslides_notes* self); void pdfpc_slides_notes_parse_lines (pdfpcslides_notes* self, gchar** lines, int lines_length1); pdfpcslides_notes* pdfpc_slides_notes_new (void); pdfpcslides_notes* pdfpc_slides_notes_construct (GType object_type); static void pdfpc_slides_notes_finalize (GObject* obj); static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); /** * Set a note for a given slide */ void pdfpc_slides_notes_set_note (pdfpcslides_notes* self, const gchar* note, gint slide_number) { gint _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (note != NULL); _tmp0_ = slide_number; if (_tmp0_ != (-1)) { gchar** _tmp1_; gint _tmp1__length1; gint _tmp2_; gchar** _tmp5_; gint _tmp5__length1; gint _tmp6_; const gchar* _tmp7_; gchar* _tmp8_; gchar* _tmp9_; _tmp1_ = self->notes; _tmp1__length1 = self->notes_length1; _tmp2_ = slide_number; if (_tmp1__length1 <= _tmp2_) { gint _tmp3_; gint _tmp4_ = 0; _tmp3_ = slide_number; _tmp4_ = _tmp3_ + 1; self->notes = g_renew (gchar*, self->notes, _tmp3_ + 1); (_tmp4_ > self->notes_length1) ? memset (self->notes + self->notes_length1, 0, sizeof (gchar*) * (_tmp4_ - self->notes_length1)) : NULL; self->notes_length1 = _tmp4_; } _tmp5_ = self->notes; _tmp5__length1 = self->notes_length1; _tmp6_ = slide_number; _tmp7_ = note; _tmp8_ = g_strdup (_tmp7_); _g_free0 (_tmp5_[_tmp6_]); _tmp5_[_tmp6_] = _tmp8_; _tmp9_ = _tmp5_[_tmp6_]; } } /** * Return the text of a note */ gchar* pdfpc_slides_notes_get_note_for_slide (pdfpcslides_notes* self, gint number) { gchar* result = NULL; gboolean _tmp0_ = FALSE; gint _tmp1_; gchar** _tmp2_; gint _tmp2__length1; gboolean _tmp6_; g_return_val_if_fail (self != NULL, NULL); _tmp1_ = number; _tmp2_ = self->notes; _tmp2__length1 = self->notes_length1; if (_tmp1_ >= _tmp2__length1) { _tmp0_ = TRUE; } else { gchar** _tmp3_; gint _tmp3__length1; gint _tmp4_; const gchar* _tmp5_; _tmp3_ = self->notes; _tmp3__length1 = self->notes_length1; _tmp4_ = number; _tmp5_ = _tmp3_[_tmp4_]; _tmp0_ = _tmp5_ == NULL; } _tmp6_ = _tmp0_; if (_tmp6_) { gchar* _tmp7_; _tmp7_ = g_strdup (""); result = _tmp7_; return result; } else { gchar** _tmp8_; gint _tmp8__length1; gint _tmp9_; const gchar* _tmp10_; gchar* _tmp11_; _tmp8_ = self->notes; _tmp8__length1 = self->notes_length1; _tmp9_ = number; _tmp10_ = _tmp8_[_tmp9_]; _tmp11_ = g_strdup (_tmp10_); result = _tmp11_; return result; } } /** * Does the user want notes? */ gboolean pdfpc_slides_notes_has_notes (pdfpcslides_notes* self) { gboolean result = FALSE; gchar** _tmp0_; gint _tmp0__length1; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = self->notes; _tmp0__length1 = self->notes_length1; result = _tmp0_ != NULL; return result; } /** * Returns the string that should be written to the pdfpc file */ static gchar string_get (const gchar* self, glong index) { gchar result = '\0'; glong _tmp0_; gchar _tmp1_; g_return_val_if_fail (self != NULL, '\0'); _tmp0_ = index; _tmp1_ = ((gchar*) self)[_tmp0_]; result = _tmp1_; return result; } gchar* pdfpc_slides_notes_format_to_save (pdfpcslides_notes* self) { gchar* result = NULL; gchar* _tmp0_; gchar* text; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_strdup (""); text = _tmp0_; { gint i; i = 0; { gboolean _tmp1_; _tmp1_ = TRUE; while (TRUE) { gboolean _tmp2_; gint _tmp4_; gchar** _tmp5_; gint _tmp5__length1; gchar** _tmp6_; gint _tmp6__length1; gint _tmp7_; const gchar* _tmp8_; _tmp2_ = _tmp1_; if (!_tmp2_) { gint _tmp3_; _tmp3_ = i; i = _tmp3_ + 1; } _tmp1_ = FALSE; _tmp4_ = i; _tmp5_ = self->notes; _tmp5__length1 = self->notes_length1; if (!(_tmp4_ < _tmp5__length1)) { break; } _tmp6_ = self->notes; _tmp6__length1 = self->notes_length1; _tmp7_ = i; _tmp8_ = _tmp6_[_tmp7_]; if (_tmp8_ != NULL) { const gchar* _tmp9_; gint _tmp10_; gchar* _tmp11_ = NULL; gchar* _tmp12_; gchar* _tmp13_ = NULL; gchar* _tmp14_; gchar** _tmp15_; gint _tmp15__length1; gint _tmp16_; const gchar* _tmp17_; gchar* _tmp18_; gchar* _tmp19_; gchar* _tmp20_; const gchar* _tmp21_; const gchar* _tmp22_; gint _tmp23_; gint _tmp24_; gchar _tmp25_ = '\0'; _tmp9_ = text; _tmp10_ = i; _tmp11_ = g_strdup_printf ("%i", _tmp10_ + 1); _tmp12_ = _tmp11_; _tmp13_ = g_strconcat ("### ", _tmp12_, "\n", NULL); _tmp14_ = _tmp13_; _tmp15_ = self->notes; _tmp15__length1 = self->notes_length1; _tmp16_ = i; _tmp17_ = _tmp15_[_tmp16_]; _tmp18_ = g_strconcat (_tmp14_, _tmp17_, NULL); _tmp19_ = _tmp18_; _tmp20_ = g_strconcat (_tmp9_, _tmp19_, NULL); _g_free0 (text); text = _tmp20_; _g_free0 (_tmp19_); _g_free0 (_tmp14_); _g_free0 (_tmp12_); _tmp21_ = text; _tmp22_ = text; _tmp23_ = strlen (_tmp22_); _tmp24_ = _tmp23_; _tmp25_ = string_get (_tmp21_, (glong) (_tmp24_ - 1)); if (_tmp25_ != '\n') { const gchar* _tmp26_; gchar* _tmp27_; _tmp26_ = text; _tmp27_ = g_strconcat (_tmp26_, "\n", NULL); _g_free0 (text); text = _tmp27_; } } } } } result = text; return result; } /** * Parse the notes line of the pdfpc file */ static gchar* string_strip (const gchar* self) { gchar* result = NULL; gchar* _tmp0_ = NULL; gchar* _result_; const gchar* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_strdup (self); _result_ = _tmp0_; _tmp1_ = _result_; g_strstrip (_tmp1_); result = _result_; return result; } static gchar* string_slice (const gchar* self, glong start, glong end) { gchar* result = NULL; gint _tmp0_; gint _tmp1_; glong string_length; glong _tmp2_; glong _tmp5_; gboolean _tmp8_ = FALSE; glong _tmp9_; gboolean _tmp12_; gboolean _tmp13_ = FALSE; glong _tmp14_; gboolean _tmp17_; glong _tmp18_; glong _tmp19_; glong _tmp20_; glong _tmp21_; glong _tmp22_; gchar* _tmp23_ = NULL; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = strlen (self); _tmp1_ = _tmp0_; string_length = (glong) _tmp1_; _tmp2_ = start; if (_tmp2_ < ((glong) 0)) { glong _tmp3_; glong _tmp4_; _tmp3_ = string_length; _tmp4_ = start; start = _tmp3_ + _tmp4_; } _tmp5_ = end; if (_tmp5_ < ((glong) 0)) { glong _tmp6_; glong _tmp7_; _tmp6_ = string_length; _tmp7_ = end; end = _tmp6_ + _tmp7_; } _tmp9_ = start; if (_tmp9_ >= ((glong) 0)) { glong _tmp10_; glong _tmp11_; _tmp10_ = start; _tmp11_ = string_length; _tmp8_ = _tmp10_ <= _tmp11_; } else { _tmp8_ = FALSE; } _tmp12_ = _tmp8_; g_return_val_if_fail (_tmp12_, NULL); _tmp14_ = end; if (_tmp14_ >= ((glong) 0)) { glong _tmp15_; glong _tmp16_; _tmp15_ = end; _tmp16_ = string_length; _tmp13_ = _tmp15_ <= _tmp16_; } else { _tmp13_ = FALSE; } _tmp17_ = _tmp13_; g_return_val_if_fail (_tmp17_, NULL); _tmp18_ = start; _tmp19_ = end; g_return_val_if_fail (_tmp18_ <= _tmp19_, NULL); _tmp20_ = start; _tmp21_ = end; _tmp22_ = start; _tmp23_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) (_tmp21_ - _tmp22_)); result = _tmp23_; return result; } static glong string_strnlen (gchar* str, glong maxlen) { glong result = 0L; gchar* _tmp0_; glong _tmp1_; gchar* _tmp2_ = NULL; gchar* end; gchar* _tmp3_; _tmp0_ = str; _tmp1_ = maxlen; _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_); end = _tmp2_; _tmp3_ = end; if (_tmp3_ == NULL) { glong _tmp4_; _tmp4_ = maxlen; result = _tmp4_; return result; } else { gchar* _tmp5_; gchar* _tmp6_; _tmp5_ = end; _tmp6_ = str; result = (glong) (_tmp5_ - _tmp6_); return result; } } static gchar* string_substring (const gchar* self, glong offset, glong len) { gchar* result = NULL; glong string_length = 0L; gboolean _tmp0_ = FALSE; glong _tmp1_; gboolean _tmp3_; glong _tmp9_; glong _tmp15_; glong _tmp18_; glong _tmp19_; glong _tmp20_; glong _tmp21_; glong _tmp22_; gchar* _tmp23_ = NULL; g_return_val_if_fail (self != NULL, NULL); _tmp1_ = offset; if (_tmp1_ >= ((glong) 0)) { glong _tmp2_; _tmp2_ = len; _tmp0_ = _tmp2_ >= ((glong) 0); } else { _tmp0_ = FALSE; } _tmp3_ = _tmp0_; if (_tmp3_) { glong _tmp4_; glong _tmp5_; glong _tmp6_ = 0L; _tmp4_ = offset; _tmp5_ = len; _tmp6_ = string_strnlen ((gchar*) self, _tmp4_ + _tmp5_); string_length = _tmp6_; } else { gint _tmp7_; gint _tmp8_; _tmp7_ = strlen (self); _tmp8_ = _tmp7_; string_length = (glong) _tmp8_; } _tmp9_ = offset; if (_tmp9_ < ((glong) 0)) { glong _tmp10_; glong _tmp11_; glong _tmp12_; _tmp10_ = string_length; _tmp11_ = offset; offset = _tmp10_ + _tmp11_; _tmp12_ = offset; g_return_val_if_fail (_tmp12_ >= ((glong) 0), NULL); } else { glong _tmp13_; glong _tmp14_; _tmp13_ = offset; _tmp14_ = string_length; g_return_val_if_fail (_tmp13_ <= _tmp14_, NULL); } _tmp15_ = len; if (_tmp15_ < ((glong) 0)) { glong _tmp16_; glong _tmp17_; _tmp16_ = string_length; _tmp17_ = offset; len = _tmp16_ - _tmp17_; } _tmp18_ = offset; _tmp19_ = len; _tmp20_ = string_length; g_return_val_if_fail ((_tmp18_ + _tmp19_) <= _tmp20_, NULL); _tmp21_ = offset; _tmp22_ = len; _tmp23_ = g_strndup (((gchar*) self) + _tmp21_, (gsize) _tmp22_); result = _tmp23_; return result; } void pdfpc_slides_notes_parse_lines (pdfpcslides_notes* self, gchar** lines, int lines_length1) { gint current_slide; gchar* _tmp0_; gchar* current_note; gchar** _tmp1_; gint _tmp1__length1; gint last_line; const gchar* _tmp42_; gint _tmp43_; g_return_if_fail (self != NULL); current_slide = -1; _tmp0_ = g_strdup (""); current_note = _tmp0_; _tmp1_ = lines; _tmp1__length1 = lines_length1; last_line = _tmp1__length1; while (TRUE) { gchar** _tmp2_; gint _tmp2__length1; gint _tmp3_; const gchar* _tmp4_; gchar* _tmp5_ = NULL; gchar* _tmp6_; gboolean _tmp7_; gint _tmp8_; _tmp2_ = lines; _tmp2__length1 = lines_length1; _tmp3_ = last_line; _tmp4_ = _tmp2_[_tmp3_ - 1]; _tmp5_ = string_strip (_tmp4_); _tmp6_ = _tmp5_; _tmp7_ = !(g_strcmp0 (_tmp6_, "") == 0); _g_free0 (_tmp6_); if (_tmp7_) { break; } _tmp8_ = last_line; last_line = _tmp8_ - 1; } { gint i; i = 0; { gboolean _tmp9_; _tmp9_ = TRUE; while (TRUE) { gboolean _tmp10_; gint _tmp12_; gchar** _tmp13_; gint _tmp13__length1; gboolean _tmp14_ = FALSE; gchar** _tmp15_; gint _tmp15__length1; gint _tmp16_; const gchar* _tmp17_; gint _tmp18_; gint _tmp19_; gboolean _tmp25_; _tmp10_ = _tmp9_; if (!_tmp10_) { gint _tmp11_; _tmp11_ = i; i = _tmp11_ + 1; } _tmp9_ = FALSE; _tmp12_ = i; _tmp13_ = lines; _tmp13__length1 = lines_length1; if (!(_tmp12_ < _tmp13__length1)) { break; } _tmp15_ = lines; _tmp15__length1 = lines_length1; _tmp16_ = i; _tmp17_ = _tmp15_[_tmp16_]; _tmp18_ = strlen (_tmp17_); _tmp19_ = _tmp18_; if (_tmp19_ > 3) { gchar** _tmp20_; gint _tmp20__length1; gint _tmp21_; const gchar* _tmp22_; gchar* _tmp23_ = NULL; gchar* _tmp24_; _tmp20_ = lines; _tmp20__length1 = lines_length1; _tmp21_ = i; _tmp22_ = _tmp20_[_tmp21_]; _tmp23_ = string_slice (_tmp22_, (glong) 0, (glong) 3); _tmp24_ = _tmp23_; _tmp14_ = g_strcmp0 (_tmp24_, "###") == 0; _g_free0 (_tmp24_); } else { _tmp14_ = FALSE; } _tmp25_ = _tmp14_; if (_tmp25_) { const gchar* _tmp26_; gint _tmp27_; gchar** _tmp28_; gint _tmp28__length1; gint _tmp29_; const gchar* _tmp30_; gchar* _tmp31_ = NULL; gchar* _tmp32_; gint _tmp33_ = 0; gchar* _tmp34_; _tmp26_ = current_note; _tmp27_ = current_slide; pdfpc_slides_notes_set_note (self, _tmp26_, _tmp27_); _tmp28_ = lines; _tmp28__length1 = lines_length1; _tmp29_ = i; _tmp30_ = _tmp28_[_tmp29_]; _tmp31_ = string_substring (_tmp30_, (glong) 3, (glong) (-1)); _tmp32_ = _tmp31_; _tmp33_ = atoi (_tmp32_); current_slide = _tmp33_ - 1; _g_free0 (_tmp32_); _tmp34_ = g_strdup (""); _g_free0 (current_note); current_note = _tmp34_; } else { const gchar* _tmp35_; gchar** _tmp36_; gint _tmp36__length1; gint _tmp37_; const gchar* _tmp38_; gchar* _tmp39_; gchar* _tmp40_; gchar* _tmp41_; _tmp35_ = current_note; _tmp36_ = lines; _tmp36__length1 = lines_length1; _tmp37_ = i; _tmp38_ = _tmp36_[_tmp37_]; _tmp39_ = g_strconcat (_tmp38_, "\n", NULL); _tmp40_ = _tmp39_; _tmp41_ = g_strconcat (_tmp35_, _tmp40_, NULL); _g_free0 (current_note); current_note = _tmp41_; _g_free0 (_tmp40_); } } } } _tmp42_ = current_note; _tmp43_ = current_slide; pdfpc_slides_notes_set_note (self, _tmp42_, _tmp43_); _g_free0 (current_note); } pdfpcslides_notes* pdfpc_slides_notes_construct (GType object_type) { pdfpcslides_notes * self = NULL; self = (pdfpcslides_notes*) g_object_new (object_type, NULL); return self; } pdfpcslides_notes* pdfpc_slides_notes_new (void) { return pdfpc_slides_notes_construct (PDFPC_TYPE_SLIDES_NOTES); } static void pdfpc_slides_notes_class_init (pdfpcslides_notesClass * klass) { pdfpc_slides_notes_parent_class = g_type_class_peek_parent (klass); G_OBJECT_CLASS (klass)->finalize = pdfpc_slides_notes_finalize; } static void pdfpc_slides_notes_instance_init (pdfpcslides_notes * self) { self->notes = NULL; } static void pdfpc_slides_notes_finalize (GObject* obj) { pdfpcslides_notes * self; self = PDFPC_SLIDES_NOTES (obj); self->notes = (_vala_array_free (self->notes, self->notes_length1, (GDestroyNotify) g_free), NULL); G_OBJECT_CLASS (pdfpc_slides_notes_parent_class)->finalize (obj); } /** * Class for providing storage for the notes associate with a presentation */ GType pdfpc_slides_notes_get_type (void) { static volatile gsize pdfpc_slides_notes_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_slides_notes_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcslides_notesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_slides_notes_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcslides_notes), 0, (GInstanceInitFunc) pdfpc_slides_notes_instance_init, NULL }; GType pdfpc_slides_notes_type_id; pdfpc_slides_notes_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcslides_notes", &g_define_type_info, 0); g_once_init_leave (&pdfpc_slides_notes_type_id__volatile, pdfpc_slides_notes_type_id); } return pdfpc_slides_notes_type_id__volatile; } static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { if ((array != NULL) && (destroy_func != NULL)) { int i; for (i = 0; i < array_length; i = i + 1) { if (((gpointer*) array)[i] != NULL) { destroy_func (((gpointer*) array)[i]); } } } } static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { _vala_array_destroy (array, array_length, destroy_func); g_free (array); } davvil-pdfpc-074a3c6/c-src/classes/mutex_locks.c000066400000000000000000000066761177613036100216130ustar00rootroot00000000000000/* mutex_locks.c generated by valac 0.16.0, the Vala compiler * generated from mutex_locks.vala, do not modify */ #include #include #define PDFPC_TYPE_MUTEX_LOCKS (pdfpc_mutex_locks_get_type ()) #define PDFPC_MUTEX_LOCKS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_MUTEX_LOCKS, pdfpcMutexLocks)) #define PDFPC_MUTEX_LOCKS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_MUTEX_LOCKS, pdfpcMutexLocksClass)) #define PDFPC_IS_MUTEX_LOCKS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_MUTEX_LOCKS)) #define PDFPC_IS_MUTEX_LOCKS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_MUTEX_LOCKS)) #define PDFPC_MUTEX_LOCKS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_MUTEX_LOCKS, pdfpcMutexLocksClass)) typedef struct _pdfpcMutexLocks pdfpcMutexLocks; typedef struct _pdfpcMutexLocksClass pdfpcMutexLocksClass; typedef struct _pdfpcMutexLocksPrivate pdfpcMutexLocksPrivate; #define _g_mutex_free0(var) ((var == NULL) ? NULL : (var = (g_mutex_free (var), NULL))) struct _pdfpcMutexLocks { GObject parent_instance; pdfpcMutexLocksPrivate * priv; }; struct _pdfpcMutexLocksClass { GObjectClass parent_class; }; static gpointer pdfpc_mutex_locks_parent_class = NULL; extern GMutex* pdfpc_mutex_locks_poppler; GMutex* pdfpc_mutex_locks_poppler = NULL; GType pdfpc_mutex_locks_get_type (void) G_GNUC_CONST; enum { PDFPC_MUTEX_LOCKS_DUMMY_PROPERTY }; void pdfpc_mutex_locks_init (void); pdfpcMutexLocks* pdfpc_mutex_locks_new (void); pdfpcMutexLocks* pdfpc_mutex_locks_construct (GType object_type); static void pdfpc_mutex_locks_finalize (GObject* obj); /** * Initialize all used mutex objects for the first time */ void pdfpc_mutex_locks_init (void) { GMutex* _tmp0_; _tmp0_ = g_mutex_new (); _g_mutex_free0 (pdfpc_mutex_locks_poppler); pdfpc_mutex_locks_poppler = _tmp0_; } pdfpcMutexLocks* pdfpc_mutex_locks_construct (GType object_type) { pdfpcMutexLocks * self = NULL; self = (pdfpcMutexLocks*) g_object_new (object_type, NULL); return self; } pdfpcMutexLocks* pdfpc_mutex_locks_new (void) { return pdfpc_mutex_locks_construct (PDFPC_TYPE_MUTEX_LOCKS); } static void pdfpc_mutex_locks_class_init (pdfpcMutexLocksClass * klass) { pdfpc_mutex_locks_parent_class = g_type_class_peek_parent (klass); G_OBJECT_CLASS (klass)->finalize = pdfpc_mutex_locks_finalize; } static void pdfpc_mutex_locks_instance_init (pdfpcMutexLocks * self) { } static void pdfpc_mutex_locks_finalize (GObject* obj) { pdfpcMutexLocks * self; self = PDFPC_MUTEX_LOCKS (obj); G_OBJECT_CLASS (pdfpc_mutex_locks_parent_class)->finalize (obj); } /** * Static property container holding all mutex locks, which are needed * throughout the application. */ GType pdfpc_mutex_locks_get_type (void) { static volatile gsize pdfpc_mutex_locks_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_mutex_locks_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcMutexLocksClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_mutex_locks_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcMutexLocks), 0, (GInstanceInitFunc) pdfpc_mutex_locks_instance_init, NULL }; GType pdfpc_mutex_locks_type_id; pdfpc_mutex_locks_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcMutexLocks", &g_define_type_info, 0); g_once_init_leave (&pdfpc_mutex_locks_type_id__volatile, pdfpc_mutex_locks_type_id); } return pdfpc_mutex_locks_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/options.c000066400000000000000000000076731177613036100207470ustar00rootroot00000000000000/* options.c generated by valac 0.16.0, the Vala compiler * generated from options.vala, do not modify */ #include #include #include #include #define PDFPC_TYPE_OPTIONS (pdfpc_options_get_type ()) #define PDFPC_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_OPTIONS, pdfpcOptions)) #define PDFPC_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_OPTIONS, pdfpcOptionsClass)) #define PDFPC_IS_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_OPTIONS)) #define PDFPC_IS_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_OPTIONS)) #define PDFPC_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_OPTIONS, pdfpcOptionsClass)) typedef struct _pdfpcOptions pdfpcOptions; typedef struct _pdfpcOptionsClass pdfpcOptionsClass; typedef struct _pdfpcOptionsPrivate pdfpcOptionsPrivate; struct _pdfpcOptions { GObject parent_instance; pdfpcOptionsPrivate * priv; }; struct _pdfpcOptionsClass { GObjectClass parent_class; }; static gpointer pdfpc_options_parent_class = NULL; extern gboolean pdfpc_options_display_switch; gboolean pdfpc_options_display_switch = FALSE; extern gboolean pdfpc_options_single_screen; gboolean pdfpc_options_single_screen = FALSE; extern gboolean pdfpc_options_windowed; gboolean pdfpc_options_windowed = FALSE; extern gboolean pdfpc_options_disable_caching; gboolean pdfpc_options_disable_caching = FALSE; extern gboolean pdfpc_options_disable_cache_compression; gboolean pdfpc_options_disable_cache_compression = FALSE; extern guint pdfpc_options_duration; guint pdfpc_options_duration = 987654321U; extern guint pdfpc_options_last_minutes; guint pdfpc_options_last_minutes = (guint) 5; extern guint pdfpc_options_current_size; guint pdfpc_options_current_size = (guint) 60; extern gint pdfpc_options_min_overview_width; gint pdfpc_options_min_overview_width = 150; extern gchar* pdfpc_options_start_time; gchar* pdfpc_options_start_time = NULL; extern gchar* pdfpc_options_end_time; gchar* pdfpc_options_end_time = NULL; extern gboolean pdfpc_options_black_on_end; gboolean pdfpc_options_black_on_end = FALSE; extern gboolean pdfpc_options_list_actions; gboolean pdfpc_options_list_actions = FALSE; GType pdfpc_options_get_type (void) G_GNUC_CONST; enum { PDFPC_OPTIONS_DUMMY_PROPERTY }; pdfpcOptions* pdfpc_options_new (void); pdfpcOptions* pdfpc_options_construct (GType object_type); static void pdfpc_options_finalize (GObject* obj); pdfpcOptions* pdfpc_options_construct (GType object_type) { pdfpcOptions * self = NULL; self = (pdfpcOptions*) g_object_new (object_type, NULL); return self; } pdfpcOptions* pdfpc_options_new (void) { return pdfpc_options_construct (PDFPC_TYPE_OPTIONS); } static void pdfpc_options_class_init (pdfpcOptionsClass * klass) { pdfpc_options_parent_class = g_type_class_peek_parent (klass); G_OBJECT_CLASS (klass)->finalize = pdfpc_options_finalize; } static void pdfpc_options_instance_init (pdfpcOptions * self) { } static void pdfpc_options_finalize (GObject* obj) { pdfpcOptions * self; self = PDFPC_OPTIONS (obj); G_OBJECT_CLASS (pdfpc_options_parent_class)->finalize (obj); } /** * Static property container holding the application wide option * information and their default values. */ GType pdfpc_options_get_type (void) { static volatile gsize pdfpc_options_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_options_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcOptionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_options_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcOptions), 0, (GInstanceInitFunc) pdfpc_options_instance_init, NULL }; GType pdfpc_options_type_id; pdfpc_options_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcOptions", &g_define_type_info, 0); g_once_init_leave (&pdfpc_options_type_id__volatile, pdfpc_options_type_id); } return pdfpc_options_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/presentation_controller.c000066400000000000000000003414011177613036100242200ustar00rootroot00000000000000/* presentation_controller.c generated by valac 0.16.0, the Vala compiler * generated from presentation_controller.vala, do not modify */ #include #include #include #include #include #include #include #include #include #include #define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController)) #define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) #define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) typedef struct _pdfpcPresentationController pdfpcPresentationController; typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass; typedef struct _pdfpcPresentationControllerPrivate pdfpcPresentationControllerPrivate; #define PDFPC_TYPE_CONTROLLABLE (pdfpc_controllable_get_type ()) #define PDFPC_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllable)) #define PDFPC_IS_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CONTROLLABLE)) #define PDFPC_CONTROLLABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllableIface)) typedef struct _pdfpcControllable pdfpcControllable; typedef struct _pdfpcControllableIface pdfpcControllableIface; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ()) #define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf)) #define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) #define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf; typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass; #define PDFPC_WINDOW_TYPE_OVERVIEW (pdfpc_window_overview_get_type ()) #define PDFPC_WINDOW_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverview)) #define PDFPC_WINDOW_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass)) #define PDFPC_WINDOW_IS_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_OVERVIEW)) #define PDFPC_WINDOW_IS_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_OVERVIEW)) #define PDFPC_WINDOW_OVERVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass)) typedef struct _pdfpcWindowOverview pdfpcWindowOverview; typedef struct _pdfpcWindowOverviewClass pdfpcWindowOverviewClass; #define PDFPC_TYPE_TIMER_LABEL (pdfpc_timer_label_get_type ()) #define PDFPC_TIMER_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabel)) #define PDFPC_TIMER_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabelClass)) #define PDFPC_IS_TIMER_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_TIMER_LABEL)) #define PDFPC_IS_TIMER_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_TIMER_LABEL)) #define PDFPC_TIMER_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabelClass)) typedef struct _pdfpcTimerLabel pdfpcTimerLabel; typedef struct _pdfpcTimerLabelClass pdfpcTimerLabelClass; #define PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION (pdfpc_presentation_controller_key_action_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, pdfpcPresentationControllerKeyAction)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, pdfpcPresentationControllerKeyActionClass)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, pdfpcPresentationControllerKeyActionClass)) typedef struct _pdfpcPresentationControllerKeyAction pdfpcPresentationControllerKeyAction; typedef struct _pdfpcPresentationControllerKeyActionClass pdfpcPresentationControllerKeyActionClass; #define PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF (pdfpc_presentation_controller_key_def_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER_KEY_DEF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, pdfpcPresentationControllerKeyDef)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_DEF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, pdfpcPresentationControllerKeyDefClass)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_DEF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_DEF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_DEF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, pdfpcPresentationControllerKeyDefClass)) typedef struct _pdfpcPresentationControllerKeyDef pdfpcPresentationControllerKeyDef; typedef struct _pdfpcPresentationControllerKeyDefClass pdfpcPresentationControllerKeyDefClass; #define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL))) #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _pdfpc_presentation_controller_key_action_unref0(var) ((var == NULL) ? NULL : (var = (pdfpc_presentation_controller_key_action_unref (var), NULL))) #define _pdfpc_presentation_controller_key_def_unref0(var) ((var == NULL) ? NULL : (var = (pdfpc_presentation_controller_key_def_unref (var), NULL))) typedef struct _pdfpcPresentationControllerKeyActionPrivate pdfpcPresentationControllerKeyActionPrivate; #define _g_free0(var) (var = (g_free (var), NULL)) typedef struct _pdfpcPresentationControllerParamSpecKeyAction pdfpcPresentationControllerParamSpecKeyAction; typedef struct _pdfpcPresentationControllerKeyDefPrivate pdfpcPresentationControllerKeyDefPrivate; typedef struct _pdfpcPresentationControllerParamSpecKeyDef pdfpcPresentationControllerParamSpecKeyDef; struct _pdfpcControllableIface { GTypeInterface parent_iface; pdfpcPresentationController* (*get_controller) (pdfpcControllable* self); void (*update) (pdfpcControllable* self); void (*edit_note) (pdfpcControllable* self); void (*ask_goto_page) (pdfpcControllable* self); void (*show_overview) (pdfpcControllable* self); void (*hide_overview) (pdfpcControllable* self); }; struct _pdfpcPresentationController { GObject parent_instance; pdfpcPresentationControllerPrivate * priv; gint current_slide_number; gint current_user_slide_number; gboolean faded_to_black; gboolean frozen; gboolean black_on_end; gint n_slides; GList* controllables; gboolean ignore_keyboard_events; gboolean ignore_mouse_events; pdfpcMetadataPdf* metadata; pdfpcWindowOverview* overview; gboolean overview_shown; guint last_key_event; pdfpcTimerLabel* timer; GeeHashMap* actionNames; GeeHashMap* keyBindings; GeeHashMap* mouseBindings; }; struct _pdfpcPresentationControllerClass { GObjectClass parent_class; }; struct _pdfpcPresentationControllerPrivate { guint _accepted_key_mods; gint* history; gint history_length1; gint _history_size_; }; typedef void (*pdfpcPresentationControllerKeyActionKeyActionDelegate) (void* user_data); struct _pdfpcPresentationControllerKeyAction { GTypeInstance parent_instance; volatile int ref_count; pdfpcPresentationControllerKeyActionPrivate * priv; pdfpcPresentationControllerKeyActionKeyActionDelegate d; gpointer d_target; GDestroyNotify d_target_destroy_notify; }; struct _pdfpcPresentationControllerKeyActionClass { GTypeClass parent_class; void (*finalize) (pdfpcPresentationControllerKeyAction *self); }; struct _pdfpcPresentationControllerParamSpecKeyAction { GParamSpec parent_instance; }; struct _pdfpcPresentationControllerKeyDef { GTypeInstance parent_instance; volatile int ref_count; pdfpcPresentationControllerKeyDefPrivate * priv; }; struct _pdfpcPresentationControllerKeyDefClass { GTypeClass parent_class; void (*finalize) (pdfpcPresentationControllerKeyDef *self); }; struct _pdfpcPresentationControllerKeyDefPrivate { guint _keycode; guint _modMask; }; struct _pdfpcPresentationControllerParamSpecKeyDef { GParamSpec parent_instance; }; static gpointer pdfpc_presentation_controller_parent_class = NULL; extern gchar* pdfpc_options_start_time; extern gchar* pdfpc_options_end_time; extern guint pdfpc_options_duration; extern guint pdfpc_options_last_minutes; static gpointer pdfpc_presentation_controller_key_action_parent_class = NULL; static gpointer pdfpc_presentation_controller_key_def_parent_class = NULL; GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST; GType pdfpc_controllable_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST; GType pdfpc_window_overview_get_type (void) G_GNUC_CONST; GType pdfpc_timer_label_get_type (void) G_GNUC_CONST; gpointer pdfpc_presentation_controller_key_action_ref (gpointer instance); void pdfpc_presentation_controller_key_action_unref (gpointer instance); GParamSpec* pdfpc_presentation_controller_param_spec_key_action (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_presentation_controller_value_set_key_action (GValue* value, gpointer v_object); void pdfpc_presentation_controller_value_take_key_action (GValue* value, gpointer v_object); gpointer pdfpc_presentation_controller_value_get_key_action (const GValue* value); GType pdfpc_presentation_controller_key_action_get_type (void) G_GNUC_CONST; gpointer pdfpc_presentation_controller_key_def_ref (gpointer instance); void pdfpc_presentation_controller_key_def_unref (gpointer instance); GParamSpec* pdfpc_presentation_controller_param_spec_key_def (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_presentation_controller_value_set_key_def (GValue* value, gpointer v_object); void pdfpc_presentation_controller_value_take_key_def (GValue* value, gpointer v_object); gpointer pdfpc_presentation_controller_value_get_key_def (const GValue* value); GType pdfpc_presentation_controller_key_def_get_type (void) G_GNUC_CONST; #define PDFPC_PRESENTATION_CONTROLLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerPrivate)) enum { PDFPC_PRESENTATION_CONTROLLER_DUMMY_PROPERTY, PDFPC_PRESENTATION_CONTROLLER_ACCEPTED_KEY_MODS }; static void _g_object_unref0_ (gpointer var); static void _g_list_free__g_object_unref0_ (GList* self); pdfpcPresentationController* pdfpc_presentation_controller_new (pdfpcMetadataPdf* metadata, gboolean allow_black_on_end); pdfpcPresentationController* pdfpc_presentation_controller_construct (GType object_type, pdfpcMetadataPdf* metadata, gboolean allow_black_on_end); static time_t pdfpc_presentation_controller_parseTime (pdfpcPresentationController* self, const gchar* t); void pdfpc_metadata_pdf_set_duration (pdfpcMetadataPdf* self, guint d); pdfpcTimerLabel* pdfpc_getTimerLabel (gint duration, time_t end_time, guint last_minutes, time_t start_time); guint pdfpc_metadata_pdf_get_duration (pdfpcMetadataPdf* self); void pdfpc_timer_label_reset (pdfpcTimerLabel* self); guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self); guint pdfpc_presentation_controller_key_def_hash (void* _a); static guint _pdfpc_presentation_controller_key_def_hash_ghash_func (gconstpointer key); gboolean pdfpc_presentation_controller_key_def_equal (void* _a, void* _b); static gboolean _pdfpc_presentation_controller_key_def_equal_gequal_func (gconstpointer a, gconstpointer b); void pdfpc_presentation_controller_fillActionNames (pdfpcPresentationController* self); void pdfpc_presentation_controller_set_overview (pdfpcPresentationController* self, pdfpcWindowOverview* o); void pdfpc_presentation_controller_next_page (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_next_page_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); pdfpcPresentationControllerKeyAction* pdfpc_presentation_controller_key_action_new (pdfpcPresentationControllerKeyActionKeyActionDelegate d, void* d_target); pdfpcPresentationControllerKeyAction* pdfpc_presentation_controller_key_action_construct (GType object_type, pdfpcPresentationControllerKeyActionKeyActionDelegate d, void* d_target); void pdfpc_presentation_controller_jump10 (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_jump10_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_next_user_page (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_next_user_page_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_previous_page (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_previous_page_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_back10 (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_back10_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_previous_user_page (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_previous_user_page_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_controllables_ask_goto_page (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_controllables_ask_goto_page_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_goto_first (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_goto_first_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_goto_last (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_goto_last_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_toggle_overview (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_toggle_overview_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_history_back (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_history_back_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_start (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_start_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_toggle_pause (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_toggle_pause_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_reset_timer (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_reset_timer_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_controllables_reset (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_controllables_reset_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_fade_to_black (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_fade_to_black_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_toggle_freeze (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_toggle_freeze_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); static void __lambda7_ (pdfpcPresentationController* self); static void ___lambda7__pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_toggle_skip (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_toggle_skip_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_controllables_edit_note (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_controllables_edit_note_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_set_end_user_slide (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_set_end_user_slide_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_exit_state (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_exit_state_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); void pdfpc_presentation_controller_quit (pdfpcPresentationController* self); static void _pdfpc_presentation_controller_quit_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self); gchar** pdfpc_presentation_controller_getActionDescriptions (int* result_length1); void pdfpc_presentation_controller_bind (pdfpcPresentationController* self, guint keycode, guint modMask, const gchar* function); pdfpcPresentationControllerKeyDef* pdfpc_presentation_controller_key_def_new (guint k, guint m); pdfpcPresentationControllerKeyDef* pdfpc_presentation_controller_key_def_construct (GType object_type, guint k, guint m); void pdfpc_presentation_controller_unbind (pdfpcPresentationController* self, guint keycode, guint modMask); void pdfpc_presentation_controller_unbindAll (pdfpcPresentationController* self); void pdfpc_presentation_controller_bindMouse (pdfpcPresentationController* self, guint button, guint modMask, const gchar* function); void pdfpc_presentation_controller_unbindMouse (pdfpcPresentationController* self, guint keycode, guint modMask); void pdfpc_presentation_controller_unbindAllMouse (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_key_press (pdfpcPresentationController* self, GdkEventKey* key); guint pdfpc_presentation_controller_get_accepted_key_mods (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_button_press (pdfpcPresentationController* self, GdkEventButton* button); void pdfpc_presentation_controller_scroll (pdfpcPresentationController* self, GdkEventScroll* scroll); gint pdfpc_presentation_controller_get_current_slide_number (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_current_user_slide_number (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_skip_previous (pdfpcPresentationController* self); gint pdfpc_metadata_pdf_user_slide_to_real_slide (pdfpcMetadataPdf* self, gint number); gboolean pdfpc_presentation_controller_skip_next (pdfpcPresentationController* self); gint pdfpc_metadata_pdf_get_user_slide_count (pdfpcMetadataPdf* self); gint pdfpc_presentation_controller_get_n_slide (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_user_n_slides (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_end_user_slide (pdfpcPresentationController* self); gint pdfpc_metadata_pdf_get_end_user_slide (pdfpcMetadataPdf* self); void pdfpc_metadata_pdf_set_end_user_slide (pdfpcMetadataPdf* self, gint slide); void pdfpc_presentation_controller_controllables_update (pdfpcPresentationController* self); void pdfpc_presentation_controller_set_end_user_slide_overview (pdfpcPresentationController* self); gint pdfpc_window_overview_get_current_slide (pdfpcWindowOverview* self); static void pdfpc_presentation_controller_slide2history (pdfpcPresentationController* self); static void _vala_array_add4 (gint** array, int* length, int* size, gint value); void pdfpc_presentation_controller_page_change_request (pdfpcPresentationController* self, gint page_number); gint pdfpc_metadata_pdf_real_slide_to_user_slide (pdfpcMetadataPdf* self, gint number); void pdfpc_timer_label_start (pdfpcTimerLabel* self); void pdfpc_presentation_controller_set_ignore_input_events (pdfpcPresentationController* self, gboolean v); void pdfpc_presentation_controller_set_ignore_mouse_events (pdfpcPresentationController* self, gboolean v); pdfpcTimerLabel* pdfpc_presentation_controller_getTimer (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_register_controllable (pdfpcPresentationController* self, pdfpcControllable* controllable); gboolean pdfpc_presentation_controller_is_faded_to_black (pdfpcPresentationController* self); void pdfpc_presentation_controller_goto_user_page (pdfpcPresentationController* self, gint page_number); void pdfpc_presentation_controller_controllables_hide_overview (pdfpcPresentationController* self); void pdfpc_controllable_update (pdfpcControllable* self); void pdfpc_presentation_controller_controllables_show_overview (pdfpcPresentationController* self); void pdfpc_controllable_show_overview (pdfpcControllable* self); void pdfpc_controllable_hide_overview (pdfpcControllable* self); void pdfpc_controllable_edit_note (pdfpcControllable* self); void pdfpc_controllable_ask_goto_page (pdfpcControllable* self); gboolean pdfpc_presentation_controller_is_frozen (pdfpcPresentationController* self); gint pdfpc_metadata_pdf_toggle_skip (pdfpcMetadataPdf* self, gint slide_number, gint user_slide_number); void pdfpc_window_overview_remove_current (pdfpcWindowOverview* self, gint newn); void pdfpc_window_overview_set_n_slides (pdfpcWindowOverview* self, gint n); gboolean pdfpc_timer_label_pause (pdfpcTimerLabel* self); gboolean pdfpc_timer_label_is_paused (pdfpcTimerLabel* self); void pdfpc_metadata_pdf_save_to_disk (pdfpcMetadataPdf* self); void pdfpc_presentation_controller_set_accepted_key_mods (pdfpcPresentationController* self, guint value); enum { PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION_DUMMY_PROPERTY }; static void pdfpc_presentation_controller_key_action_finalize (pdfpcPresentationControllerKeyAction* obj); #define PDFPC_PRESENTATION_CONTROLLER_KEY_DEF_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, pdfpcPresentationControllerKeyDefPrivate)) enum { PDFPC_PRESENTATION_CONTROLLER_KEY_DEF_DUMMY_PROPERTY }; void pdfpc_presentation_controller_key_def_set_keycode (pdfpcPresentationControllerKeyDef* self, guint value); void pdfpc_presentation_controller_key_def_set_modMask (pdfpcPresentationControllerKeyDef* self, guint value); guint pdfpc_presentation_controller_key_def_get_keycode (pdfpcPresentationControllerKeyDef* self); guint pdfpc_presentation_controller_key_def_get_modMask (pdfpcPresentationControllerKeyDef* self); static void pdfpc_presentation_controller_key_def_finalize (pdfpcPresentationControllerKeyDef* obj); static void pdfpc_presentation_controller_finalize (GObject* obj); static void _vala_pdfpc_presentation_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_pdfpc_presentation_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); static void _g_object_unref0_ (gpointer var) { (var == NULL) ? NULL : (var = (g_object_unref (var), NULL)); } static void _g_list_free__g_object_unref0_ (GList* self) { g_list_foreach (self, (GFunc) _g_object_unref0_, NULL); g_list_free (self); } /** * Instantiate a new controller */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } static guint _pdfpc_presentation_controller_key_def_hash_ghash_func (gconstpointer key) { guint result; result = pdfpc_presentation_controller_key_def_hash (key); return result; } static gboolean _pdfpc_presentation_controller_key_def_equal_gequal_func (gconstpointer a, gconstpointer b) { gboolean result; result = pdfpc_presentation_controller_key_def_equal (a, b); return result; } pdfpcPresentationController* pdfpc_presentation_controller_construct (GType object_type, pdfpcMetadataPdf* metadata, gboolean allow_black_on_end) { pdfpcPresentationController * self = NULL; pdfpcMetadataPdf* _tmp0_; pdfpcMetadataPdf* _tmp1_; gboolean _tmp2_; time_t start_time; const gchar* _tmp3_; time_t end_time; const gchar* _tmp6_; pdfpcMetadataPdf* _tmp10_; guint _tmp11_ = 0U; time_t _tmp12_; guint _tmp13_; time_t _tmp14_; pdfpcTimerLabel* _tmp15_ = NULL; pdfpcTimerLabel* _tmp16_; pdfpcMetadataPdf* _tmp17_; guint _tmp18_ = 0U; GeeHashMap* _tmp19_; GeeHashMap* _tmp20_; g_return_val_if_fail (metadata != NULL, NULL); self = (pdfpcPresentationController*) g_object_new (object_type, NULL); _tmp0_ = metadata; _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->metadata); self->metadata = _tmp1_; _tmp2_ = allow_black_on_end; self->black_on_end = _tmp2_; __g_list_free__g_object_unref0_0 (self->controllables); self->controllables = NULL; start_time = (time_t) 0; _tmp3_ = pdfpc_options_start_time; if (_tmp3_ != NULL) { const gchar* _tmp4_; time_t _tmp5_ = 0; _tmp4_ = pdfpc_options_start_time; _tmp5_ = pdfpc_presentation_controller_parseTime (self, _tmp4_); start_time = _tmp5_; } end_time = (time_t) 0; _tmp6_ = pdfpc_options_end_time; if (_tmp6_ != NULL) { const gchar* _tmp7_; time_t _tmp8_ = 0; pdfpcMetadataPdf* _tmp9_; _tmp7_ = pdfpc_options_end_time; _tmp8_ = pdfpc_presentation_controller_parseTime (self, _tmp7_); end_time = _tmp8_; pdfpc_options_duration = (guint) 0; _tmp9_ = self->metadata; pdfpc_metadata_pdf_set_duration (_tmp9_, (guint) 0); } _tmp10_ = self->metadata; _tmp11_ = pdfpc_metadata_pdf_get_duration (_tmp10_); _tmp12_ = end_time; _tmp13_ = pdfpc_options_last_minutes; _tmp14_ = start_time; _tmp15_ = pdfpc_getTimerLabel (((gint) _tmp11_) * 60, _tmp12_, _tmp13_, _tmp14_); _g_object_unref0 (self->timer); self->timer = _tmp15_; _tmp16_ = self->timer; pdfpc_timer_label_reset (_tmp16_); _tmp17_ = metadata; _tmp18_ = pdfpc_metadata_base_get_slide_count ((pdfpcMetadataBase*) _tmp17_); self->n_slides = (gint) _tmp18_; self->current_slide_number = 0; self->current_user_slide_number = 0; _tmp19_ = gee_hash_map_new (PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, (GBoxedCopyFunc) pdfpc_presentation_controller_key_def_ref, pdfpc_presentation_controller_key_def_unref, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, (GBoxedCopyFunc) pdfpc_presentation_controller_key_action_ref, pdfpc_presentation_controller_key_action_unref, _pdfpc_presentation_controller_key_def_hash_ghash_func, _pdfpc_presentation_controller_key_def_equal_gequal_func, NULL); _g_object_unref0 (self->keyBindings); self->keyBindings = _tmp19_; _tmp20_ = gee_hash_map_new (PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, (GBoxedCopyFunc) pdfpc_presentation_controller_key_def_ref, pdfpc_presentation_controller_key_def_unref, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, (GBoxedCopyFunc) pdfpc_presentation_controller_key_action_ref, pdfpc_presentation_controller_key_action_unref, _pdfpc_presentation_controller_key_def_hash_ghash_func, _pdfpc_presentation_controller_key_def_equal_gequal_func, NULL); _g_object_unref0 (self->mouseBindings); self->mouseBindings = _tmp20_; pdfpc_presentation_controller_fillActionNames (self); return self; } pdfpcPresentationController* pdfpc_presentation_controller_new (pdfpcMetadataPdf* metadata, gboolean allow_black_on_end) { return pdfpc_presentation_controller_construct (PDFPC_TYPE_PRESENTATION_CONTROLLER, metadata, allow_black_on_end); } void pdfpc_presentation_controller_set_overview (pdfpcPresentationController* self, pdfpcWindowOverview* o) { pdfpcWindowOverview* _tmp0_; pdfpcWindowOverview* _tmp1_; g_return_if_fail (self != NULL); g_return_if_fail (o != NULL); _tmp0_ = o; _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->overview); self->overview = _tmp1_; } static void _pdfpc_presentation_controller_next_page_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_next_page (self); } static void _pdfpc_presentation_controller_jump10_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_jump10 (self); } static void _pdfpc_presentation_controller_next_user_page_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_next_user_page (self); } static void _pdfpc_presentation_controller_previous_page_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_previous_page (self); } static void _pdfpc_presentation_controller_back10_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_back10 (self); } static void _pdfpc_presentation_controller_previous_user_page_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_previous_user_page (self); } static void _pdfpc_presentation_controller_controllables_ask_goto_page_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_controllables_ask_goto_page (self); } static void _pdfpc_presentation_controller_goto_first_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_goto_first (self); } static void _pdfpc_presentation_controller_goto_last_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_goto_last (self); } static void _pdfpc_presentation_controller_toggle_overview_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_toggle_overview (self); } static void _pdfpc_presentation_controller_history_back_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_history_back (self); } static void _pdfpc_presentation_controller_start_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_start (self); } static void _pdfpc_presentation_controller_toggle_pause_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_toggle_pause (self); } static void _pdfpc_presentation_controller_reset_timer_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_reset_timer (self); } static void _pdfpc_presentation_controller_controllables_reset_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_controllables_reset (self); } static void _pdfpc_presentation_controller_fade_to_black_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_fade_to_black (self); } static void _pdfpc_presentation_controller_toggle_freeze_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_toggle_freeze (self); } static void __lambda7_ (pdfpcPresentationController* self) { gboolean _tmp0_; _tmp0_ = self->frozen; if (!_tmp0_) { pdfpc_presentation_controller_toggle_freeze (self); } } static void ___lambda7__pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { __lambda7_ (self); } static void _pdfpc_presentation_controller_toggle_skip_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_toggle_skip (self); } static void _pdfpc_presentation_controller_controllables_edit_note_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_controllables_edit_note (self); } static void _pdfpc_presentation_controller_set_end_user_slide_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_set_end_user_slide (self); } static void _pdfpc_presentation_controller_exit_state_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_exit_state (self); } static void _pdfpc_presentation_controller_quit_pdfpc_presentation_controller_key_action_key_action_delegate (gpointer self) { pdfpc_presentation_controller_quit (self); } void pdfpc_presentation_controller_fillActionNames (pdfpcPresentationController* self) { GeeHashMap* _tmp0_; GeeHashMap* _tmp1_; pdfpcPresentationControllerKeyAction* _tmp2_; pdfpcPresentationControllerKeyAction* _tmp3_; GeeHashMap* _tmp4_; pdfpcPresentationControllerKeyAction* _tmp5_; pdfpcPresentationControllerKeyAction* _tmp6_; GeeHashMap* _tmp7_; pdfpcPresentationControllerKeyAction* _tmp8_; pdfpcPresentationControllerKeyAction* _tmp9_; GeeHashMap* _tmp10_; pdfpcPresentationControllerKeyAction* _tmp11_; pdfpcPresentationControllerKeyAction* _tmp12_; GeeHashMap* _tmp13_; pdfpcPresentationControllerKeyAction* _tmp14_; pdfpcPresentationControllerKeyAction* _tmp15_; GeeHashMap* _tmp16_; pdfpcPresentationControllerKeyAction* _tmp17_; pdfpcPresentationControllerKeyAction* _tmp18_; GeeHashMap* _tmp19_; pdfpcPresentationControllerKeyAction* _tmp20_; pdfpcPresentationControllerKeyAction* _tmp21_; GeeHashMap* _tmp22_; pdfpcPresentationControllerKeyAction* _tmp23_; pdfpcPresentationControllerKeyAction* _tmp24_; GeeHashMap* _tmp25_; pdfpcPresentationControllerKeyAction* _tmp26_; pdfpcPresentationControllerKeyAction* _tmp27_; GeeHashMap* _tmp28_; pdfpcPresentationControllerKeyAction* _tmp29_; pdfpcPresentationControllerKeyAction* _tmp30_; GeeHashMap* _tmp31_; pdfpcPresentationControllerKeyAction* _tmp32_; pdfpcPresentationControllerKeyAction* _tmp33_; GeeHashMap* _tmp34_; pdfpcPresentationControllerKeyAction* _tmp35_; pdfpcPresentationControllerKeyAction* _tmp36_; GeeHashMap* _tmp37_; pdfpcPresentationControllerKeyAction* _tmp38_; pdfpcPresentationControllerKeyAction* _tmp39_; GeeHashMap* _tmp40_; pdfpcPresentationControllerKeyAction* _tmp41_; pdfpcPresentationControllerKeyAction* _tmp42_; GeeHashMap* _tmp43_; pdfpcPresentationControllerKeyAction* _tmp44_; pdfpcPresentationControllerKeyAction* _tmp45_; GeeHashMap* _tmp46_; pdfpcPresentationControllerKeyAction* _tmp47_; pdfpcPresentationControllerKeyAction* _tmp48_; GeeHashMap* _tmp49_; pdfpcPresentationControllerKeyAction* _tmp50_; pdfpcPresentationControllerKeyAction* _tmp51_; GeeHashMap* _tmp52_; pdfpcPresentationControllerKeyAction* _tmp53_; pdfpcPresentationControllerKeyAction* _tmp54_; GeeHashMap* _tmp55_; pdfpcPresentationControllerKeyAction* _tmp56_; pdfpcPresentationControllerKeyAction* _tmp57_; GeeHashMap* _tmp58_; pdfpcPresentationControllerKeyAction* _tmp59_; pdfpcPresentationControllerKeyAction* _tmp60_; GeeHashMap* _tmp61_; pdfpcPresentationControllerKeyAction* _tmp62_; pdfpcPresentationControllerKeyAction* _tmp63_; GeeHashMap* _tmp64_; pdfpcPresentationControllerKeyAction* _tmp65_; pdfpcPresentationControllerKeyAction* _tmp66_; GeeHashMap* _tmp67_; pdfpcPresentationControllerKeyAction* _tmp68_; pdfpcPresentationControllerKeyAction* _tmp69_; g_return_if_fail (self != NULL); _tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, (GBoxedCopyFunc) pdfpc_presentation_controller_key_action_ref, pdfpc_presentation_controller_key_action_unref, NULL, NULL, NULL); _g_object_unref0 (self->actionNames); self->actionNames = _tmp0_; _tmp1_ = self->actionNames; _tmp2_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_next_page_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp3_ = _tmp2_; gee_abstract_map_set ((GeeAbstractMap*) _tmp1_, "next", _tmp3_); _pdfpc_presentation_controller_key_action_unref0 (_tmp3_); _tmp4_ = self->actionNames; _tmp5_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_jump10_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp6_ = _tmp5_; gee_abstract_map_set ((GeeAbstractMap*) _tmp4_, "next10", _tmp6_); _pdfpc_presentation_controller_key_action_unref0 (_tmp6_); _tmp7_ = self->actionNames; _tmp8_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_next_user_page_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp9_ = _tmp8_; gee_abstract_map_set ((GeeAbstractMap*) _tmp7_, "nextOverlay", _tmp9_); _pdfpc_presentation_controller_key_action_unref0 (_tmp9_); _tmp10_ = self->actionNames; _tmp11_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_previous_page_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp12_ = _tmp11_; gee_abstract_map_set ((GeeAbstractMap*) _tmp10_, "prev", _tmp12_); _pdfpc_presentation_controller_key_action_unref0 (_tmp12_); _tmp13_ = self->actionNames; _tmp14_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_back10_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp15_ = _tmp14_; gee_abstract_map_set ((GeeAbstractMap*) _tmp13_, "prev10", _tmp15_); _pdfpc_presentation_controller_key_action_unref0 (_tmp15_); _tmp16_ = self->actionNames; _tmp17_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_previous_user_page_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp18_ = _tmp17_; gee_abstract_map_set ((GeeAbstractMap*) _tmp16_, "prevOverlay", _tmp18_); _pdfpc_presentation_controller_key_action_unref0 (_tmp18_); _tmp19_ = self->actionNames; _tmp20_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_controllables_ask_goto_page_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp21_ = _tmp20_; gee_abstract_map_set ((GeeAbstractMap*) _tmp19_, "goto", _tmp21_); _pdfpc_presentation_controller_key_action_unref0 (_tmp21_); _tmp22_ = self->actionNames; _tmp23_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_goto_first_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp24_ = _tmp23_; gee_abstract_map_set ((GeeAbstractMap*) _tmp22_, "gotoFirst", _tmp24_); _pdfpc_presentation_controller_key_action_unref0 (_tmp24_); _tmp25_ = self->actionNames; _tmp26_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_goto_last_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp27_ = _tmp26_; gee_abstract_map_set ((GeeAbstractMap*) _tmp25_, "gotoLast", _tmp27_); _pdfpc_presentation_controller_key_action_unref0 (_tmp27_); _tmp28_ = self->actionNames; _tmp29_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_toggle_overview_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp30_ = _tmp29_; gee_abstract_map_set ((GeeAbstractMap*) _tmp28_, "overview", _tmp30_); _pdfpc_presentation_controller_key_action_unref0 (_tmp30_); _tmp31_ = self->actionNames; _tmp32_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_history_back_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp33_ = _tmp32_; gee_abstract_map_set ((GeeAbstractMap*) _tmp31_, "histBack", _tmp33_); _pdfpc_presentation_controller_key_action_unref0 (_tmp33_); _tmp34_ = self->actionNames; _tmp35_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_start_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp36_ = _tmp35_; gee_abstract_map_set ((GeeAbstractMap*) _tmp34_, "start", _tmp36_); _pdfpc_presentation_controller_key_action_unref0 (_tmp36_); _tmp37_ = self->actionNames; _tmp38_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_toggle_pause_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp39_ = _tmp38_; gee_abstract_map_set ((GeeAbstractMap*) _tmp37_, "pause", _tmp39_); _pdfpc_presentation_controller_key_action_unref0 (_tmp39_); _tmp40_ = self->actionNames; _tmp41_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_reset_timer_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp42_ = _tmp41_; gee_abstract_map_set ((GeeAbstractMap*) _tmp40_, "resetTimer", _tmp42_); _pdfpc_presentation_controller_key_action_unref0 (_tmp42_); _tmp43_ = self->actionNames; _tmp44_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_controllables_reset_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp45_ = _tmp44_; gee_abstract_map_set ((GeeAbstractMap*) _tmp43_, "reset", _tmp45_); _pdfpc_presentation_controller_key_action_unref0 (_tmp45_); _tmp46_ = self->actionNames; _tmp47_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_fade_to_black_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp48_ = _tmp47_; gee_abstract_map_set ((GeeAbstractMap*) _tmp46_, "blank", _tmp48_); _pdfpc_presentation_controller_key_action_unref0 (_tmp48_); _tmp49_ = self->actionNames; _tmp50_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_toggle_freeze_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp51_ = _tmp50_; gee_abstract_map_set ((GeeAbstractMap*) _tmp49_, "freeze", _tmp51_); _pdfpc_presentation_controller_key_action_unref0 (_tmp51_); _tmp52_ = self->actionNames; _tmp53_ = pdfpc_presentation_controller_key_action_new (___lambda7__pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp54_ = _tmp53_; gee_abstract_map_set ((GeeAbstractMap*) _tmp52_, "freezeOn", _tmp54_); _pdfpc_presentation_controller_key_action_unref0 (_tmp54_); _tmp55_ = self->actionNames; _tmp56_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_toggle_skip_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp57_ = _tmp56_; gee_abstract_map_set ((GeeAbstractMap*) _tmp55_, "overlay", _tmp57_); _pdfpc_presentation_controller_key_action_unref0 (_tmp57_); _tmp58_ = self->actionNames; _tmp59_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_controllables_edit_note_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp60_ = _tmp59_; gee_abstract_map_set ((GeeAbstractMap*) _tmp58_, "note", _tmp60_); _pdfpc_presentation_controller_key_action_unref0 (_tmp60_); _tmp61_ = self->actionNames; _tmp62_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_set_end_user_slide_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp63_ = _tmp62_; gee_abstract_map_set ((GeeAbstractMap*) _tmp61_, "endSlide", _tmp63_); _pdfpc_presentation_controller_key_action_unref0 (_tmp63_); _tmp64_ = self->actionNames; _tmp65_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_exit_state_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp66_ = _tmp65_; gee_abstract_map_set ((GeeAbstractMap*) _tmp64_, "exitState", _tmp66_); _pdfpc_presentation_controller_key_action_unref0 (_tmp66_); _tmp67_ = self->actionNames; _tmp68_ = pdfpc_presentation_controller_key_action_new (_pdfpc_presentation_controller_quit_pdfpc_presentation_controller_key_action_key_action_delegate, self); _tmp69_ = _tmp68_; gee_abstract_map_set ((GeeAbstractMap*) _tmp67_, "quit", _tmp69_); _pdfpc_presentation_controller_key_action_unref0 (_tmp69_); } /** * Gets an array wit all function names * * It would be more legant yo use the keys property of actionNames, but * we would need an instance for doing this... */ gchar** pdfpc_presentation_controller_getActionDescriptions (int* result_length1) { gchar** result = NULL; gchar* _tmp0_; gchar* _tmp1_; gchar* _tmp2_; gchar* _tmp3_; gchar* _tmp4_; gchar* _tmp5_; gchar* _tmp6_; gchar* _tmp7_; gchar* _tmp8_; gchar* _tmp9_; gchar* _tmp10_; gchar* _tmp11_; gchar* _tmp12_; gchar* _tmp13_; gchar* _tmp14_; gchar* _tmp15_; gchar* _tmp16_; gchar* _tmp17_; gchar* _tmp18_; gchar* _tmp19_; gchar* _tmp20_; gchar* _tmp21_; gchar* _tmp22_; gchar* _tmp23_; gchar* _tmp24_; gchar* _tmp25_; gchar* _tmp26_; gchar* _tmp27_; gchar* _tmp28_; gchar* _tmp29_; gchar* _tmp30_; gchar* _tmp31_; gchar* _tmp32_; gchar* _tmp33_; gchar* _tmp34_; gchar* _tmp35_; gchar* _tmp36_; gchar* _tmp37_; gchar* _tmp38_; gchar* _tmp39_; gchar* _tmp40_; gchar* _tmp41_; gchar* _tmp42_; gchar* _tmp43_; gchar* _tmp44_; gchar* _tmp45_; gchar** _tmp46_ = NULL; gchar** _tmp47_; gint _tmp47__length1; _tmp0_ = g_strdup ("next"); _tmp1_ = g_strdup ("Go to next slide"); _tmp2_ = g_strdup ("next10"); _tmp3_ = g_strdup ("Jump 10 slides forward"); _tmp4_ = g_strdup ("nextOverlay"); _tmp5_ = g_strdup ("Jump forward outside of current overlay"); _tmp6_ = g_strdup ("prev"); _tmp7_ = g_strdup ("Go to previous slide"); _tmp8_ = g_strdup ("prev10"); _tmp9_ = g_strdup ("Jump 10 slides back"); _tmp10_ = g_strdup ("prevOverlay"); _tmp11_ = g_strdup ("Jump back outside of current overlay"); _tmp12_ = g_strdup ("goto"); _tmp13_ = g_strdup ("Ask for a page to jump to"); _tmp14_ = g_strdup ("gotoFirst"); _tmp15_ = g_strdup ("Jump to first slide"); _tmp16_ = g_strdup ("gotoLast"); _tmp17_ = g_strdup ("Jump to last slide"); _tmp18_ = g_strdup ("overview"); _tmp19_ = g_strdup ("Show the overview mode"); _tmp20_ = g_strdup ("histBack"); _tmp21_ = g_strdup ("Go back in history"); _tmp22_ = g_strdup ("start"); _tmp23_ = g_strdup ("Start the timer"); _tmp24_ = g_strdup ("pause"); _tmp25_ = g_strdup ("Pause the timer"); _tmp26_ = g_strdup ("resetTimer"); _tmp27_ = g_strdup ("Reset the timer"); _tmp28_ = g_strdup ("reset"); _tmp29_ = g_strdup ("Reset the presentation"); _tmp30_ = g_strdup ("blank"); _tmp31_ = g_strdup ("Blank presentation screen"); _tmp32_ = g_strdup ("freeze"); _tmp33_ = g_strdup ("Toggle freeze presentation screen"); _tmp34_ = g_strdup ("freezeOn"); _tmp35_ = g_strdup ("Freeze presentation screen if unfrozen"); _tmp36_ = g_strdup ("overlay"); _tmp37_ = g_strdup ("Mark current slide as overlay slide"); _tmp38_ = g_strdup ("note"); _tmp39_ = g_strdup ("Edit note for current slide"); _tmp40_ = g_strdup ("endSlide"); _tmp41_ = g_strdup ("Set current slide as end slide"); _tmp42_ = g_strdup ("exitState"); _tmp43_ = g_strdup ("Exit \"special\" state (pause, freeze, blank)"); _tmp44_ = g_strdup ("quit"); _tmp45_ = g_strdup ("Exit pdfpc"); _tmp46_ = g_new0 (gchar*, 46 + 1); _tmp46_[0] = _tmp0_; _tmp46_[1] = _tmp1_; _tmp46_[2] = _tmp2_; _tmp46_[3] = _tmp3_; _tmp46_[4] = _tmp4_; _tmp46_[5] = _tmp5_; _tmp46_[6] = _tmp6_; _tmp46_[7] = _tmp7_; _tmp46_[8] = _tmp8_; _tmp46_[9] = _tmp9_; _tmp46_[10] = _tmp10_; _tmp46_[11] = _tmp11_; _tmp46_[12] = _tmp12_; _tmp46_[13] = _tmp13_; _tmp46_[14] = _tmp14_; _tmp46_[15] = _tmp15_; _tmp46_[16] = _tmp16_; _tmp46_[17] = _tmp17_; _tmp46_[18] = _tmp18_; _tmp46_[19] = _tmp19_; _tmp46_[20] = _tmp20_; _tmp46_[21] = _tmp21_; _tmp46_[22] = _tmp22_; _tmp46_[23] = _tmp23_; _tmp46_[24] = _tmp24_; _tmp46_[25] = _tmp25_; _tmp46_[26] = _tmp26_; _tmp46_[27] = _tmp27_; _tmp46_[28] = _tmp28_; _tmp46_[29] = _tmp29_; _tmp46_[30] = _tmp30_; _tmp46_[31] = _tmp31_; _tmp46_[32] = _tmp32_; _tmp46_[33] = _tmp33_; _tmp46_[34] = _tmp34_; _tmp46_[35] = _tmp35_; _tmp46_[36] = _tmp36_; _tmp46_[37] = _tmp37_; _tmp46_[38] = _tmp38_; _tmp46_[39] = _tmp39_; _tmp46_[40] = _tmp40_; _tmp46_[41] = _tmp41_; _tmp46_[42] = _tmp42_; _tmp46_[43] = _tmp43_; _tmp46_[44] = _tmp44_; _tmp46_[45] = _tmp45_; _tmp47_ = _tmp46_; _tmp47__length1 = 46; if (result_length1) { *result_length1 = _tmp47__length1; } result = _tmp47_; return result; } /** * Bind the (user-defined) keys */ void pdfpc_presentation_controller_bind (pdfpcPresentationController* self, guint keycode, guint modMask, const gchar* function) { GeeHashMap* _tmp0_; const gchar* _tmp1_; gboolean _tmp2_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (function != NULL); _tmp0_ = self->actionNames; _tmp1_ = function; _tmp2_ = gee_map_contains ((GeeMap*) _tmp0_, _tmp1_); if (_tmp2_) { GeeHashMap* _tmp3_; guint _tmp4_; guint _tmp5_; pdfpcPresentationControllerKeyDef* _tmp6_; pdfpcPresentationControllerKeyDef* _tmp7_; GeeHashMap* _tmp8_; const gchar* _tmp9_; gpointer _tmp10_ = NULL; pdfpcPresentationControllerKeyAction* _tmp11_; _tmp3_ = self->keyBindings; _tmp4_ = keycode; _tmp5_ = modMask; _tmp6_ = pdfpc_presentation_controller_key_def_new (_tmp4_, _tmp5_); _tmp7_ = _tmp6_; _tmp8_ = self->actionNames; _tmp9_ = function; _tmp10_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp8_, _tmp9_); _tmp11_ = (pdfpcPresentationControllerKeyAction*) _tmp10_; gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, _tmp7_, _tmp11_); _pdfpc_presentation_controller_key_action_unref0 (_tmp11_); _pdfpc_presentation_controller_key_def_unref0 (_tmp7_); } else { FILE* _tmp12_; const gchar* _tmp13_; _tmp12_ = stderr; _tmp13_ = function; fprintf (_tmp12_, "Warning: Unknown function %s\n", _tmp13_); } } /** * Unbind a key */ void pdfpc_presentation_controller_unbind (pdfpcPresentationController* self, guint keycode, guint modMask) { GeeHashMap* _tmp0_; guint _tmp1_; guint _tmp2_; pdfpcPresentationControllerKeyDef* _tmp3_; pdfpcPresentationControllerKeyDef* _tmp4_; g_return_if_fail (self != NULL); _tmp0_ = self->keyBindings; _tmp1_ = keycode; _tmp2_ = modMask; _tmp3_ = pdfpc_presentation_controller_key_def_new (_tmp1_, _tmp2_); _tmp4_ = _tmp3_; gee_abstract_map_unset ((GeeAbstractMap*) _tmp0_, _tmp4_, NULL); _pdfpc_presentation_controller_key_def_unref0 (_tmp4_); } /** * Unbind all keybindings */ void pdfpc_presentation_controller_unbindAll (pdfpcPresentationController* self) { GeeHashMap* _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->keyBindings; gee_abstract_map_clear ((GeeAbstractMap*) _tmp0_); } /** * Bind the (user-defined) keys */ void pdfpc_presentation_controller_bindMouse (pdfpcPresentationController* self, guint button, guint modMask, const gchar* function) { GeeHashMap* _tmp0_; const gchar* _tmp1_; gboolean _tmp2_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (function != NULL); _tmp0_ = self->actionNames; _tmp1_ = function; _tmp2_ = gee_map_contains ((GeeMap*) _tmp0_, _tmp1_); if (_tmp2_) { GeeHashMap* _tmp3_; guint _tmp4_; guint _tmp5_; pdfpcPresentationControllerKeyDef* _tmp6_; pdfpcPresentationControllerKeyDef* _tmp7_; GeeHashMap* _tmp8_; const gchar* _tmp9_; gpointer _tmp10_ = NULL; pdfpcPresentationControllerKeyAction* _tmp11_; _tmp3_ = self->mouseBindings; _tmp4_ = button; _tmp5_ = modMask; _tmp6_ = pdfpc_presentation_controller_key_def_new (_tmp4_, _tmp5_); _tmp7_ = _tmp6_; _tmp8_ = self->actionNames; _tmp9_ = function; _tmp10_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp8_, _tmp9_); _tmp11_ = (pdfpcPresentationControllerKeyAction*) _tmp10_; gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, _tmp7_, _tmp11_); _pdfpc_presentation_controller_key_action_unref0 (_tmp11_); _pdfpc_presentation_controller_key_def_unref0 (_tmp7_); } else { FILE* _tmp12_; const gchar* _tmp13_; _tmp12_ = stderr; _tmp13_ = function; fprintf (_tmp12_, "Warning: Unknown function %s\n", _tmp13_); } } /** * Unbind a mouse button */ void pdfpc_presentation_controller_unbindMouse (pdfpcPresentationController* self, guint keycode, guint modMask) { GeeHashMap* _tmp0_; guint _tmp1_; guint _tmp2_; pdfpcPresentationControllerKeyDef* _tmp3_; pdfpcPresentationControllerKeyDef* _tmp4_; g_return_if_fail (self != NULL); _tmp0_ = self->mouseBindings; _tmp1_ = keycode; _tmp2_ = modMask; _tmp3_ = pdfpc_presentation_controller_key_def_new (_tmp1_, _tmp2_); _tmp4_ = _tmp3_; gee_abstract_map_unset ((GeeAbstractMap*) _tmp0_, _tmp4_, NULL); _pdfpc_presentation_controller_key_def_unref0 (_tmp4_); } /** * Unbind all keybindings */ void pdfpc_presentation_controller_unbindAllMouse (pdfpcPresentationController* self) { GeeHashMap* _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->mouseBindings; gee_abstract_map_clear ((GeeAbstractMap*) _tmp0_); } /** * Handle keypresses to each of the controllables * * This seperate handling is needed because keypresses from any of the * window have implications on the behaviour of both of them. Therefore * this controller is needed to take care of the needed actions. */ gboolean pdfpc_presentation_controller_key_press (pdfpcPresentationController* self, GdkEventKey* key) { gboolean result = FALSE; gboolean _tmp0_ = FALSE; GdkEventKey _tmp1_; guint32 _tmp2_; guint _tmp3_; gboolean _tmp5_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); _tmp1_ = *key; _tmp2_ = _tmp1_.time; _tmp3_ = self->last_key_event; if (_tmp2_ != ((guint32) _tmp3_)) { gboolean _tmp4_; _tmp4_ = self->ignore_keyboard_events; _tmp0_ = !_tmp4_; } else { _tmp0_ = FALSE; } _tmp5_ = _tmp0_; if (_tmp5_) { GdkEventKey _tmp6_; guint32 _tmp7_; GeeHashMap* _tmp8_; GdkEventKey _tmp9_; guint _tmp10_; GdkEventKey _tmp11_; GdkModifierType _tmp12_; guint _tmp13_; pdfpcPresentationControllerKeyDef* _tmp14_; pdfpcPresentationControllerKeyDef* _tmp15_; gpointer _tmp16_ = NULL; pdfpcPresentationControllerKeyAction* _tmp17_; pdfpcPresentationControllerKeyAction* action; pdfpcPresentationControllerKeyAction* _tmp18_; _tmp6_ = *key; _tmp7_ = _tmp6_.time; self->last_key_event = (guint) _tmp7_; _tmp8_ = self->keyBindings; _tmp9_ = *key; _tmp10_ = _tmp9_.keyval; _tmp11_ = *key; _tmp12_ = _tmp11_.state; _tmp13_ = self->priv->_accepted_key_mods; _tmp14_ = pdfpc_presentation_controller_key_def_new (_tmp10_, (guint) (_tmp12_ & _tmp13_)); _tmp15_ = _tmp14_; _tmp16_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp8_, _tmp15_); _tmp17_ = (pdfpcPresentationControllerKeyAction*) _tmp16_; _pdfpc_presentation_controller_key_def_unref0 (_tmp15_); action = _tmp17_; _tmp18_ = action; if (_tmp18_ != NULL) { pdfpcPresentationControllerKeyAction* _tmp19_; pdfpcPresentationControllerKeyActionKeyActionDelegate _tmp20_; void* _tmp20__target; _tmp19_ = action; _tmp20_ = _tmp19_->d; _tmp20__target = _tmp19_->d_target; _tmp20_ (_tmp20__target); } result = TRUE; _pdfpc_presentation_controller_key_action_unref0 (action); return result; } else { result = FALSE; return result; } } /** * Handle mouse clicks to each of the controllables */ gboolean pdfpc_presentation_controller_button_press (pdfpcPresentationController* self, GdkEventButton* button) { gboolean result = FALSE; gboolean _tmp0_ = FALSE; gboolean _tmp1_; gboolean _tmp4_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (button != NULL, FALSE); _tmp1_ = self->ignore_mouse_events; if (!_tmp1_) { GdkEventButton _tmp2_; GdkEventType _tmp3_; _tmp2_ = *button; _tmp3_ = _tmp2_.type; _tmp0_ = _tmp3_ == GDK_BUTTON_PRESS; } else { _tmp0_ = FALSE; } _tmp4_ = _tmp0_; if (_tmp4_) { GeeHashMap* _tmp5_; GdkEventButton _tmp6_; guint _tmp7_; GdkEventButton _tmp8_; GdkModifierType _tmp9_; guint _tmp10_; pdfpcPresentationControllerKeyDef* _tmp11_; pdfpcPresentationControllerKeyDef* _tmp12_; gpointer _tmp13_ = NULL; pdfpcPresentationControllerKeyAction* _tmp14_; pdfpcPresentationControllerKeyAction* action; pdfpcPresentationControllerKeyAction* _tmp15_; _tmp5_ = self->mouseBindings; _tmp6_ = *button; _tmp7_ = _tmp6_.button; _tmp8_ = *button; _tmp9_ = _tmp8_.state; _tmp10_ = self->priv->_accepted_key_mods; _tmp11_ = pdfpc_presentation_controller_key_def_new (_tmp7_, (guint) (_tmp9_ & _tmp10_)); _tmp12_ = _tmp11_; _tmp13_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp5_, _tmp12_); _tmp14_ = (pdfpcPresentationControllerKeyAction*) _tmp13_; _pdfpc_presentation_controller_key_def_unref0 (_tmp12_); action = _tmp14_; _tmp15_ = action; if (_tmp15_ != NULL) { pdfpcPresentationControllerKeyAction* _tmp16_; pdfpcPresentationControllerKeyActionKeyActionDelegate _tmp17_; void* _tmp17__target; _tmp16_ = action; _tmp17_ = _tmp16_->d; _tmp17__target = _tmp16_->d_target; _tmp17_ (_tmp17__target); } result = TRUE; _pdfpc_presentation_controller_key_action_unref0 (action); return result; } else { result = FALSE; return result; } } /** * Notify each of the controllables of mouse scrolling */ void pdfpc_presentation_controller_scroll (pdfpcPresentationController* self, GdkEventScroll* scroll) { gboolean _tmp0_; g_return_if_fail (self != NULL); g_return_if_fail (scroll != NULL); _tmp0_ = self->ignore_mouse_events; if (!_tmp0_) { GdkEventScroll _tmp1_; GdkScrollDirection _tmp2_; _tmp1_ = *scroll; _tmp2_ = _tmp1_.direction; switch (_tmp2_) { case GDK_SCROLL_UP: case GDK_SCROLL_LEFT: { GdkEventScroll _tmp3_; GdkModifierType _tmp4_; _tmp3_ = *scroll; _tmp4_ = _tmp3_.state; if ((_tmp4_ & GDK_SHIFT_MASK) != 0) { pdfpc_presentation_controller_back10 (self); } else { pdfpc_presentation_controller_previous_page (self); } break; } case GDK_SCROLL_DOWN: case GDK_SCROLL_RIGHT: { GdkEventScroll _tmp5_; GdkModifierType _tmp6_; _tmp5_ = *scroll; _tmp6_ = _tmp5_.state; if ((_tmp6_ & GDK_SHIFT_MASK) != 0) { pdfpc_presentation_controller_jump10 (self); } else { pdfpc_presentation_controller_next_page (self); } break; } default: break; } } } /** * Get the current (real) slide number */ gint pdfpc_presentation_controller_get_current_slide_number (pdfpcPresentationController* self) { gint result = 0; gint _tmp0_; g_return_val_if_fail (self != NULL, 0); _tmp0_ = self->current_slide_number; result = _tmp0_; return result; } /** * Get the current (user) slide number */ gint pdfpc_presentation_controller_get_current_user_slide_number (pdfpcPresentationController* self) { gint result = 0; gint _tmp0_; g_return_val_if_fail (self != NULL, 0); _tmp0_ = self->current_user_slide_number; result = _tmp0_; return result; } /** * Was the previous slide a skip one? */ gboolean pdfpc_presentation_controller_skip_previous (pdfpcPresentationController* self) { gboolean result = FALSE; gint _tmp0_; pdfpcMetadataPdf* _tmp1_; gint _tmp2_; gint _tmp3_ = 0; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = self->current_slide_number; _tmp1_ = self->metadata; _tmp2_ = self->current_user_slide_number; _tmp3_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp1_, _tmp2_); result = _tmp0_ > _tmp3_; return result; } /** * Is the next slide a skip one? */ gboolean pdfpc_presentation_controller_skip_next (pdfpcPresentationController* self) { gboolean result = FALSE; gboolean _tmp0_ = FALSE; gboolean _tmp1_ = FALSE; gint _tmp2_; pdfpcMetadataPdf* _tmp3_; gint _tmp4_ = 0; gboolean _tmp7_; gboolean _tmp12_; g_return_val_if_fail (self != NULL, FALSE); _tmp2_ = self->current_user_slide_number; _tmp3_ = self->metadata; _tmp4_ = pdfpc_metadata_pdf_get_user_slide_count (_tmp3_); if (_tmp2_ >= (_tmp4_ - 1)) { gint _tmp5_; gint _tmp6_; _tmp5_ = self->current_slide_number; _tmp6_ = self->n_slides; _tmp1_ = _tmp5_ < _tmp6_; } else { _tmp1_ = FALSE; } _tmp7_ = _tmp1_; if (_tmp7_) { _tmp0_ = TRUE; } else { gint _tmp8_; pdfpcMetadataPdf* _tmp9_; gint _tmp10_; gint _tmp11_ = 0; _tmp8_ = self->current_slide_number; _tmp9_ = self->metadata; _tmp10_ = self->current_user_slide_number; _tmp11_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp9_, _tmp10_ + 1); _tmp0_ = (_tmp8_ + 1) < _tmp11_; } _tmp12_ = _tmp0_; result = _tmp12_; return result; } /** * Get the real total number of slides */ gint pdfpc_presentation_controller_get_n_slide (pdfpcPresentationController* self) { gint result = 0; gint _tmp0_; g_return_val_if_fail (self != NULL, 0); _tmp0_ = self->n_slides; result = _tmp0_; return result; } /** * Get the user total number of slides */ gint pdfpc_presentation_controller_get_user_n_slides (pdfpcPresentationController* self) { gint result = 0; pdfpcMetadataPdf* _tmp0_; gint _tmp1_ = 0; g_return_val_if_fail (self != NULL, 0); _tmp0_ = self->metadata; _tmp1_ = pdfpc_metadata_pdf_get_user_slide_count (_tmp0_); result = _tmp1_; return result; } /** * Get the last slide as defined by the user */ gint pdfpc_presentation_controller_get_end_user_slide (pdfpcPresentationController* self) { gint result = 0; pdfpcMetadataPdf* _tmp0_; gint _tmp1_ = 0; g_return_val_if_fail (self != NULL, 0); _tmp0_ = self->metadata; _tmp1_ = pdfpc_metadata_pdf_get_end_user_slide (_tmp0_); result = _tmp1_; return result; } /** * Set the last slide as defined by the user */ void pdfpc_presentation_controller_set_end_user_slide (pdfpcPresentationController* self) { pdfpcMetadataPdf* _tmp0_; gint _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = self->metadata; _tmp1_ = self->current_user_slide_number; pdfpc_metadata_pdf_set_end_user_slide (_tmp0_, _tmp1_ + 1); pdfpc_presentation_controller_controllables_update (self); } /** * Set the last slide as defined by the user */ void pdfpc_presentation_controller_set_end_user_slide_overview (pdfpcPresentationController* self) { pdfpcWindowOverview* _tmp0_; gint _tmp1_; gint _tmp2_; gint user_selected; pdfpcMetadataPdf* _tmp3_; g_return_if_fail (self != NULL); _tmp0_ = self->overview; _tmp1_ = pdfpc_window_overview_get_current_slide (_tmp0_); _tmp2_ = _tmp1_; user_selected = _tmp2_; _tmp3_ = self->metadata; pdfpc_metadata_pdf_set_end_user_slide (_tmp3_, user_selected + 1); } /** * Register the current slide in the history */ static void _vala_array_add4 (gint** array, int* length, int* size, gint value) { if ((*length) == (*size)) { *size = (*size) ? (2 * (*size)) : 4; *array = g_renew (gint, *array, *size); } (*array)[(*length)++] = value; } static void pdfpc_presentation_controller_slide2history (pdfpcPresentationController* self) { gint* _tmp0_; gint _tmp0__length1; gint _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = self->priv->history; _tmp0__length1 = self->priv->history_length1; _tmp1_ = self->current_slide_number; _vala_array_add4 (&self->priv->history, &self->priv->history_length1, &self->priv->_history_size_, _tmp1_); } /** * A request to change the page has been issued */ void pdfpc_presentation_controller_page_change_request (pdfpcPresentationController* self, gint page_number) { gint _tmp0_; gint _tmp1_; gint _tmp2_; pdfpcMetadataPdf* _tmp3_; gint _tmp4_; gint _tmp5_ = 0; pdfpcTimerLabel* _tmp6_; g_return_if_fail (self != NULL); _tmp0_ = page_number; _tmp1_ = self->current_slide_number; if (_tmp0_ != _tmp1_) { pdfpc_presentation_controller_slide2history (self); } _tmp2_ = page_number; self->current_slide_number = _tmp2_; _tmp3_ = self->metadata; _tmp4_ = self->current_slide_number; _tmp5_ = pdfpc_metadata_pdf_real_slide_to_user_slide (_tmp3_, _tmp4_); self->current_user_slide_number = _tmp5_; _tmp6_ = self->timer; pdfpc_timer_label_start (_tmp6_); pdfpc_presentation_controller_controllables_update (self); } /** * Set the state of ignote_input_events */ void pdfpc_presentation_controller_set_ignore_input_events (pdfpcPresentationController* self, gboolean v) { gboolean _tmp0_; gboolean _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = v; self->ignore_keyboard_events = _tmp0_; _tmp1_ = v; self->ignore_mouse_events = _tmp1_; } void pdfpc_presentation_controller_set_ignore_mouse_events (pdfpcPresentationController* self, gboolean v) { gboolean _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = v; self->ignore_mouse_events = _tmp0_; } /** * Get the timer */ pdfpcTimerLabel* pdfpc_presentation_controller_getTimer (pdfpcPresentationController* self) { pdfpcTimerLabel* result = NULL; pdfpcTimerLabel* _tmp0_; pdfpcTimerLabel* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->timer; _tmp1_ = _g_object_ref0 (_tmp0_); result = _tmp1_; return result; } /** * Register a new Controllable instance on this controller. * * On success true is returned, in case the controllable has already been * registered false is returned. */ gboolean pdfpc_presentation_controller_register_controllable (pdfpcPresentationController* self, pdfpcControllable* controllable) { gboolean result = FALSE; GList* _tmp0_; pdfpcControllable* _tmp1_; GList* _tmp2_ = NULL; pdfpcControllable* _tmp3_; pdfpcControllable* _tmp4_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (controllable != NULL, FALSE); _tmp0_ = self->controllables; _tmp1_ = controllable; _tmp2_ = g_list_find (_tmp0_, _tmp1_); if (_tmp2_ != NULL) { result = FALSE; return result; } _tmp3_ = controllable; _tmp4_ = _g_object_ref0 (_tmp3_); self->controllables = g_list_append (self->controllables, _tmp4_); result = TRUE; return result; } /** * Go to the next slide */ void pdfpc_presentation_controller_next_page (pdfpcPresentationController* self) { gboolean _tmp0_; pdfpcTimerLabel* _tmp1_; gint _tmp2_; gint _tmp3_; g_return_if_fail (self != NULL); _tmp0_ = self->overview_shown; if (_tmp0_) { return; } _tmp1_ = self->timer; pdfpc_timer_label_start (_tmp1_); _tmp2_ = self->current_slide_number; _tmp3_ = self->n_slides; if (_tmp2_ < (_tmp3_ - 1)) { gint _tmp4_; gint _tmp5_; pdfpcMetadataPdf* _tmp6_; gint _tmp7_; gint _tmp8_ = 0; gboolean _tmp10_; _tmp4_ = self->current_slide_number; self->current_slide_number = _tmp4_ + 1; _tmp5_ = self->current_slide_number; _tmp6_ = self->metadata; _tmp7_ = self->current_user_slide_number; _tmp8_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp6_, _tmp7_ + 1); if (_tmp5_ == _tmp8_) { gint _tmp9_; _tmp9_ = self->current_user_slide_number; self->current_user_slide_number = _tmp9_ + 1; } _tmp10_ = self->frozen; if (!_tmp10_) { self->faded_to_black = FALSE; } pdfpc_presentation_controller_controllables_update (self); } else { gboolean _tmp11_ = FALSE; gboolean _tmp12_; gboolean _tmp14_; _tmp12_ = self->black_on_end; if (_tmp12_) { gboolean _tmp13_ = FALSE; _tmp13_ = pdfpc_presentation_controller_is_faded_to_black (self); _tmp11_ = !_tmp13_; } else { _tmp11_ = FALSE; } _tmp14_ = _tmp11_; if (_tmp14_) { pdfpc_presentation_controller_fade_to_black (self); } } } /** * Go to the next user slide */ void pdfpc_presentation_controller_next_user_page (pdfpcPresentationController* self) { pdfpcTimerLabel* _tmp0_; gboolean needs_update = FALSE; gint _tmp1_; pdfpcMetadataPdf* _tmp2_; gint _tmp3_ = 0; gboolean _tmp17_; g_return_if_fail (self != NULL); _tmp0_ = self->timer; pdfpc_timer_label_start (_tmp0_); _tmp1_ = self->current_user_slide_number; _tmp2_ = self->metadata; _tmp3_ = pdfpc_metadata_pdf_get_user_slide_count (_tmp2_); if (_tmp1_ < (_tmp3_ - 1)) { gint _tmp4_; pdfpcMetadataPdf* _tmp5_; gint _tmp6_; gint _tmp7_ = 0; _tmp4_ = self->current_user_slide_number; self->current_user_slide_number = _tmp4_ + 1; _tmp5_ = self->metadata; _tmp6_ = self->current_user_slide_number; _tmp7_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp5_, _tmp6_); self->current_slide_number = _tmp7_; needs_update = TRUE; } else { gint _tmp8_; gint _tmp9_; _tmp8_ = self->current_slide_number; _tmp9_ = self->n_slides; if (_tmp8_ == (_tmp9_ - 1)) { gboolean _tmp10_ = FALSE; gboolean _tmp11_; gboolean _tmp13_; needs_update = FALSE; _tmp11_ = self->black_on_end; if (_tmp11_) { gboolean _tmp12_ = FALSE; _tmp12_ = pdfpc_presentation_controller_is_faded_to_black (self); _tmp10_ = !_tmp12_; } else { _tmp10_ = FALSE; } _tmp13_ = _tmp10_; if (_tmp13_) { pdfpc_presentation_controller_fade_to_black (self); } } else { pdfpcMetadataPdf* _tmp14_; gint _tmp15_ = 0; gint _tmp16_; _tmp14_ = self->metadata; _tmp15_ = pdfpc_metadata_pdf_get_user_slide_count (_tmp14_); self->current_user_slide_number = _tmp15_ - 1; _tmp16_ = self->n_slides; self->current_slide_number = _tmp16_ - 1; needs_update = FALSE; } } _tmp17_ = needs_update; if (_tmp17_) { gboolean _tmp18_; _tmp18_ = self->frozen; if (!_tmp18_) { self->faded_to_black = FALSE; } pdfpc_presentation_controller_controllables_update (self); } } /** * Go to the previous slide */ void pdfpc_presentation_controller_previous_page (pdfpcPresentationController* self) { pdfpcTimerLabel* _tmp0_; gint _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = self->timer; pdfpc_timer_label_start (_tmp0_); _tmp1_ = self->current_slide_number; if (_tmp1_ > 0) { gint _tmp2_; pdfpcMetadataPdf* _tmp3_; gint _tmp4_; gint _tmp5_ = 0; gboolean _tmp11_; _tmp2_ = self->current_slide_number; _tmp3_ = self->metadata; _tmp4_ = self->current_user_slide_number; _tmp5_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp3_, _tmp4_); if (_tmp2_ != _tmp5_) { gint _tmp6_; _tmp6_ = self->current_slide_number; self->current_slide_number = _tmp6_ - 1; } else { gint _tmp7_; pdfpcMetadataPdf* _tmp8_; gint _tmp9_; gint _tmp10_ = 0; _tmp7_ = self->current_user_slide_number; self->current_user_slide_number = _tmp7_ - 1; _tmp8_ = self->metadata; _tmp9_ = self->current_user_slide_number; _tmp10_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp8_, _tmp9_); self->current_slide_number = _tmp10_; } _tmp11_ = self->frozen; if (!_tmp11_) { self->faded_to_black = FALSE; } pdfpc_presentation_controller_controllables_update (self); } } /** * Go to the previous user slide */ void pdfpc_presentation_controller_previous_user_page (pdfpcPresentationController* self) { pdfpcTimerLabel* _tmp0_; gint _tmp1_; gboolean _tmp6_; g_return_if_fail (self != NULL); _tmp0_ = self->timer; pdfpc_timer_label_start (_tmp0_); _tmp1_ = self->current_user_slide_number; if (_tmp1_ > 0) { gint _tmp2_; pdfpcMetadataPdf* _tmp3_; gint _tmp4_; gint _tmp5_ = 0; _tmp2_ = self->current_user_slide_number; self->current_user_slide_number = _tmp2_ - 1; _tmp3_ = self->metadata; _tmp4_ = self->current_user_slide_number; _tmp5_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp3_, _tmp4_); self->current_slide_number = _tmp5_; } else { self->current_user_slide_number = 0; self->current_slide_number = 0; } _tmp6_ = self->frozen; if (!_tmp6_) { self->faded_to_black = FALSE; } pdfpc_presentation_controller_controllables_update (self); } /** * Go to the first slide */ void pdfpc_presentation_controller_goto_first (pdfpcPresentationController* self) { pdfpcTimerLabel* _tmp0_; gint _tmp1_; gboolean _tmp2_; g_return_if_fail (self != NULL); _tmp0_ = self->timer; pdfpc_timer_label_start (_tmp0_); _tmp1_ = self->current_slide_number; if (_tmp1_ != 0) { pdfpc_presentation_controller_slide2history (self); } self->current_slide_number = 0; self->current_user_slide_number = 0; _tmp2_ = self->frozen; if (!_tmp2_) { self->faded_to_black = FALSE; } pdfpc_presentation_controller_controllables_update (self); } /** * Go to the last slide */ void pdfpc_presentation_controller_goto_last (pdfpcPresentationController* self) { pdfpcTimerLabel* _tmp0_; gint _tmp1_; pdfpcMetadataPdf* _tmp2_; gint _tmp3_ = 0; pdfpcMetadataPdf* _tmp4_; gint _tmp5_ = 0; pdfpcMetadataPdf* _tmp6_; gint _tmp7_; gint _tmp8_ = 0; gboolean _tmp9_; g_return_if_fail (self != NULL); _tmp0_ = self->timer; pdfpc_timer_label_start (_tmp0_); _tmp1_ = self->current_user_slide_number; _tmp2_ = self->metadata; _tmp3_ = pdfpc_metadata_pdf_get_end_user_slide (_tmp2_); if (_tmp1_ != (_tmp3_ - 1)) { pdfpc_presentation_controller_slide2history (self); } _tmp4_ = self->metadata; _tmp5_ = pdfpc_metadata_pdf_get_end_user_slide (_tmp4_); self->current_user_slide_number = _tmp5_ - 1; _tmp6_ = self->metadata; _tmp7_ = self->current_user_slide_number; _tmp8_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp6_, _tmp7_); self->current_slide_number = _tmp8_; _tmp9_ = self->frozen; if (!_tmp9_) { self->faded_to_black = FALSE; } pdfpc_presentation_controller_controllables_update (self); } /** * Jump 10 (user) slides forward */ void pdfpc_presentation_controller_jump10 (pdfpcPresentationController* self) { gboolean _tmp0_; pdfpcTimerLabel* _tmp1_; gint _tmp2_; pdfpcMetadataPdf* _tmp3_; gint _tmp4_ = 0; gint max_user_slide; gint _tmp5_; gint _tmp6_; pdfpcMetadataPdf* _tmp8_; gint _tmp9_; gint _tmp10_ = 0; gboolean _tmp11_; g_return_if_fail (self != NULL); _tmp0_ = self->overview_shown; if (_tmp0_) { return; } _tmp1_ = self->timer; pdfpc_timer_label_start (_tmp1_); _tmp2_ = self->current_user_slide_number; self->current_user_slide_number = _tmp2_ + 10; _tmp3_ = self->metadata; _tmp4_ = pdfpc_metadata_pdf_get_user_slide_count (_tmp3_); max_user_slide = _tmp4_; _tmp5_ = self->current_user_slide_number; _tmp6_ = max_user_slide; if (_tmp5_ >= _tmp6_) { gint _tmp7_; _tmp7_ = max_user_slide; self->current_user_slide_number = _tmp7_ - 1; } _tmp8_ = self->metadata; _tmp9_ = self->current_user_slide_number; _tmp10_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp8_, _tmp9_); self->current_slide_number = _tmp10_; _tmp11_ = self->frozen; if (!_tmp11_) { self->faded_to_black = FALSE; } pdfpc_presentation_controller_controllables_update (self); } /** * Jump 10 (user) slides backward */ void pdfpc_presentation_controller_back10 (pdfpcPresentationController* self) { gboolean _tmp0_; pdfpcTimerLabel* _tmp1_; gint _tmp2_; gint _tmp3_; pdfpcMetadataPdf* _tmp4_; gint _tmp5_; gint _tmp6_ = 0; gboolean _tmp7_; g_return_if_fail (self != NULL); _tmp0_ = self->overview_shown; if (_tmp0_) { return; } _tmp1_ = self->timer; pdfpc_timer_label_start (_tmp1_); _tmp2_ = self->current_user_slide_number; self->current_user_slide_number = _tmp2_ - 10; _tmp3_ = self->current_user_slide_number; if (_tmp3_ < 0) { self->current_user_slide_number = 0; } _tmp4_ = self->metadata; _tmp5_ = self->current_user_slide_number; _tmp6_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp4_, _tmp5_); self->current_slide_number = _tmp6_; _tmp7_ = self->frozen; if (!_tmp7_) { self->faded_to_black = FALSE; } pdfpc_presentation_controller_controllables_update (self); } /** * Goto a slide in user page numbers */ void pdfpc_presentation_controller_goto_user_page (pdfpcPresentationController* self, gint page_number) { pdfpcTimerLabel* _tmp0_; gint _tmp1_; gint _tmp2_; gint _tmp3_; gint destination; pdfpcMetadataPdf* _tmp4_; gint _tmp5_ = 0; gint n_user_slides; gint _tmp6_; gint _tmp10_; pdfpcMetadataPdf* _tmp11_; gint _tmp12_; gint _tmp13_ = 0; gboolean _tmp14_; g_return_if_fail (self != NULL); _tmp0_ = self->timer; pdfpc_timer_label_start (_tmp0_); _tmp1_ = self->current_user_slide_number; _tmp2_ = page_number; if (_tmp1_ != (_tmp2_ - 1)) { pdfpc_presentation_controller_slide2history (self); } pdfpc_presentation_controller_controllables_hide_overview (self); _tmp3_ = page_number; destination = _tmp3_ - 1; _tmp4_ = self->metadata; _tmp5_ = pdfpc_metadata_pdf_get_user_slide_count (_tmp4_); n_user_slides = _tmp5_; _tmp6_ = page_number; if (_tmp6_ < 1) { destination = 0; } else { gint _tmp7_; gint _tmp8_; _tmp7_ = page_number; _tmp8_ = n_user_slides; if (_tmp7_ >= _tmp8_) { gint _tmp9_; _tmp9_ = n_user_slides; destination = _tmp9_ - 1; } } _tmp10_ = destination; self->current_user_slide_number = _tmp10_; _tmp11_ = self->metadata; _tmp12_ = self->current_user_slide_number; _tmp13_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp11_, _tmp12_); self->current_slide_number = _tmp13_; _tmp14_ = self->frozen; if (!_tmp14_) { self->faded_to_black = FALSE; } pdfpc_presentation_controller_set_ignore_input_events (self, FALSE); pdfpc_presentation_controller_controllables_update (self); } /** * Go back in history */ void pdfpc_presentation_controller_history_back (pdfpcPresentationController* self) { gboolean _tmp0_; gint* _tmp1_; gint _tmp1__length1; gint history_length; gint _tmp2_; g_return_if_fail (self != NULL); _tmp0_ = self->overview_shown; if (_tmp0_) { return; } _tmp1_ = self->priv->history; _tmp1__length1 = self->priv->history_length1; history_length = _tmp1__length1; _tmp2_ = history_length; if (_tmp2_ == 0) { pdfpc_presentation_controller_goto_first (self); } else { gint* _tmp3_; gint _tmp3__length1; gint _tmp4_; gint _tmp5_; pdfpcMetadataPdf* _tmp6_; gint _tmp7_; gint _tmp8_ = 0; gint _tmp9_; gint _tmp10_ = 0; gboolean _tmp11_; _tmp3_ = self->priv->history; _tmp3__length1 = self->priv->history_length1; _tmp4_ = history_length; _tmp5_ = _tmp3_[_tmp4_ - 1]; self->current_slide_number = _tmp5_; _tmp6_ = self->metadata; _tmp7_ = self->current_slide_number; _tmp8_ = pdfpc_metadata_pdf_real_slide_to_user_slide (_tmp6_, _tmp7_); self->current_user_slide_number = _tmp8_; _tmp9_ = history_length; _tmp10_ = _tmp9_ - 1; self->priv->history = g_renew (gint, self->priv->history, _tmp9_ - 1); (_tmp10_ > self->priv->history_length1) ? memset (self->priv->history + self->priv->history_length1, 0, sizeof (gint) * (_tmp10_ - self->priv->history_length1)) : NULL; self->priv->history_length1 = _tmp10_; self->priv->_history_size_ = _tmp10_; _tmp11_ = self->frozen; if (!_tmp11_) { self->faded_to_black = FALSE; } pdfpc_presentation_controller_controllables_update (self); } } /** * Notify the controllables that they have to update the view */ void pdfpc_presentation_controller_controllables_update (pdfpcPresentationController* self) { GList* _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->controllables; { GList* c_collection = NULL; GList* c_it = NULL; c_collection = _tmp0_; for (c_it = c_collection; c_it != NULL; c_it = c_it->next) { pdfpcControllable* _tmp1_; pdfpcControllable* c = NULL; _tmp1_ = _g_object_ref0 ((pdfpcControllable*) c_it->data); c = _tmp1_; { pdfpcControllable* _tmp2_; _tmp2_ = c; pdfpc_controllable_update (_tmp2_); _g_object_unref0 (c); } } } } /** * Reset all registered controllables to their initial state */ void pdfpc_presentation_controller_controllables_reset (pdfpcPresentationController* self) { g_return_if_fail (self != NULL); self->current_slide_number = 0; self->current_user_slide_number = 0; pdfpc_presentation_controller_controllables_update (self); pdfpc_presentation_controller_reset_timer (self); } void pdfpc_presentation_controller_toggle_overview (pdfpcPresentationController* self) { gboolean _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->overview_shown; if (_tmp0_) { pdfpc_presentation_controller_controllables_hide_overview (self); } else { pdfpc_presentation_controller_controllables_show_overview (self); } } void pdfpc_presentation_controller_controllables_show_overview (pdfpcPresentationController* self) { pdfpcWindowOverview* _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->overview; if (_tmp0_ != NULL) { GList* _tmp1_; pdfpc_presentation_controller_set_ignore_mouse_events (self, TRUE); _tmp1_ = self->controllables; { GList* c_collection = NULL; GList* c_it = NULL; c_collection = _tmp1_; for (c_it = c_collection; c_it != NULL; c_it = c_it->next) { pdfpcControllable* _tmp2_; pdfpcControllable* c = NULL; _tmp2_ = _g_object_ref0 ((pdfpcControllable*) c_it->data); c = _tmp2_; { pdfpcControllable* _tmp3_; _tmp3_ = c; pdfpc_controllable_show_overview (_tmp3_); _g_object_unref0 (c); } } } self->overview_shown = TRUE; } } void pdfpc_presentation_controller_controllables_hide_overview (pdfpcPresentationController* self) { gint _tmp0_; gint _tmp1_ = 0; GList* _tmp2_; g_return_if_fail (self != NULL); pdfpc_presentation_controller_set_ignore_mouse_events (self, FALSE); _tmp0_ = self->current_user_slide_number; _tmp1_ = pdfpc_presentation_controller_get_user_n_slides (self); if (_tmp0_ >= _tmp1_) { pdfpc_presentation_controller_goto_last (self); } self->overview_shown = FALSE; _tmp2_ = self->controllables; { GList* c_collection = NULL; GList* c_it = NULL; c_collection = _tmp2_; for (c_it = c_collection; c_it != NULL; c_it = c_it->next) { pdfpcControllable* _tmp3_; pdfpcControllable* c = NULL; _tmp3_ = _g_object_ref0 ((pdfpcControllable*) c_it->data); c = _tmp3_; { pdfpcControllable* _tmp4_; _tmp4_ = c; pdfpc_controllable_hide_overview (_tmp4_); _g_object_unref0 (c); } } } pdfpc_presentation_controller_controllables_update (self); } /** * Fill the presentation display with black */ void pdfpc_presentation_controller_fade_to_black (pdfpcPresentationController* self) { gboolean _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->faded_to_black; self->faded_to_black = !_tmp0_; pdfpc_presentation_controller_controllables_update (self); } /** * Is the presentation blanked? */ gboolean pdfpc_presentation_controller_is_faded_to_black (pdfpcPresentationController* self) { gboolean result = FALSE; gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = self->faded_to_black; result = _tmp0_; return result; } /** * Edit note for current slide. */ void pdfpc_presentation_controller_controllables_edit_note (pdfpcPresentationController* self) { gboolean _tmp0_; GList* _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = self->overview_shown; if (_tmp0_) { return; } _tmp1_ = self->controllables; { GList* c_collection = NULL; GList* c_it = NULL; c_collection = _tmp1_; for (c_it = c_collection; c_it != NULL; c_it = c_it->next) { pdfpcControllable* _tmp2_; pdfpcControllable* c = NULL; _tmp2_ = _g_object_ref0 ((pdfpcControllable*) c_it->data); c = _tmp2_; { pdfpcControllable* _tmp3_; _tmp3_ = c; pdfpc_controllable_edit_note (_tmp3_); _g_object_unref0 (c); } } } } /** * Ask for the page to jump to */ void pdfpc_presentation_controller_controllables_ask_goto_page (pdfpcPresentationController* self) { gboolean _tmp0_; GList* _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = self->overview_shown; if (_tmp0_) { return; } _tmp1_ = self->controllables; { GList* c_collection = NULL; GList* c_it = NULL; c_collection = _tmp1_; for (c_it = c_collection; c_it != NULL; c_it = c_it->next) { pdfpcControllable* _tmp2_; pdfpcControllable* c = NULL; _tmp2_ = _g_object_ref0 ((pdfpcControllable*) c_it->data); c = _tmp2_; { pdfpcControllable* _tmp3_; _tmp3_ = c; pdfpc_controllable_ask_goto_page (_tmp3_); _g_object_unref0 (c); } } } } /** * Freeze the display */ void pdfpc_presentation_controller_toggle_freeze (pdfpcPresentationController* self) { gboolean _tmp0_; gboolean _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = self->frozen; self->frozen = !_tmp0_; _tmp1_ = self->frozen; if (!_tmp1_) { self->faded_to_black = FALSE; } pdfpc_presentation_controller_controllables_update (self); } /** * Is the presentation frozen? */ gboolean pdfpc_presentation_controller_is_frozen (pdfpcPresentationController* self) { gboolean result = FALSE; gboolean _tmp0_; g_return_val_if_fail (self != NULL, FALSE); _tmp0_ = self->frozen; result = _tmp0_; return result; } /** * Toggle skip for current slide */ void pdfpc_presentation_controller_toggle_skip (pdfpcPresentationController* self) { gboolean _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->overview_shown; if (_tmp0_) { pdfpcWindowOverview* _tmp1_; gint _tmp2_; gint _tmp3_; gint user_selected; pdfpcMetadataPdf* _tmp4_; gint _tmp5_; gint _tmp6_ = 0; gint slide_number; pdfpcMetadataPdf* _tmp7_; gint _tmp8_; gint _tmp9_; gint _tmp10_ = 0; _tmp1_ = self->overview; _tmp2_ = pdfpc_window_overview_get_current_slide (_tmp1_); _tmp3_ = _tmp2_; user_selected = _tmp3_; _tmp4_ = self->metadata; _tmp5_ = user_selected; _tmp6_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp4_, _tmp5_); slide_number = _tmp6_; _tmp7_ = self->metadata; _tmp8_ = slide_number; _tmp9_ = user_selected; _tmp10_ = pdfpc_metadata_pdf_toggle_skip (_tmp7_, _tmp8_, _tmp9_); if (_tmp10_ != 0) { pdfpcWindowOverview* _tmp11_; gint _tmp12_ = 0; _tmp11_ = self->overview; _tmp12_ = pdfpc_presentation_controller_get_user_n_slides (self); pdfpc_window_overview_remove_current (_tmp11_, _tmp12_); } } else { gint _tmp13_; pdfpcMetadataPdf* _tmp14_; gint _tmp15_; gint _tmp16_; gint _tmp17_ = 0; pdfpcWindowOverview* _tmp18_; gint _tmp19_ = 0; _tmp13_ = self->current_user_slide_number; _tmp14_ = self->metadata; _tmp15_ = self->current_slide_number; _tmp16_ = self->current_user_slide_number; _tmp17_ = pdfpc_metadata_pdf_toggle_skip (_tmp14_, _tmp15_, _tmp16_); self->current_user_slide_number = _tmp13_ + _tmp17_; _tmp18_ = self->overview; _tmp19_ = pdfpc_presentation_controller_get_user_n_slides (self); pdfpc_window_overview_set_n_slides (_tmp18_, _tmp19_); pdfpc_presentation_controller_controllables_update (self); } } /** * Start the presentation (-> timer) */ void pdfpc_presentation_controller_start (pdfpcPresentationController* self) { pdfpcTimerLabel* _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->timer; pdfpc_timer_label_start (_tmp0_); pdfpc_presentation_controller_controllables_update (self); } /** * Pause the timer */ void pdfpc_presentation_controller_toggle_pause (pdfpcPresentationController* self) { pdfpcTimerLabel* _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->timer; pdfpc_timer_label_pause (_tmp0_); pdfpc_presentation_controller_controllables_update (self); } /** * Reset the timer */ void pdfpc_presentation_controller_reset_timer (pdfpcPresentationController* self) { pdfpcTimerLabel* _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->timer; pdfpc_timer_label_reset (_tmp0_); } void pdfpc_presentation_controller_exit_state (pdfpcPresentationController* self) { gboolean _tmp0_; gboolean _tmp1_; pdfpcTimerLabel* _tmp2_; gboolean _tmp3_ = FALSE; g_return_if_fail (self != NULL); _tmp0_ = self->faded_to_black; if (_tmp0_) { pdfpc_presentation_controller_fade_to_black (self); } _tmp1_ = self->frozen; if (_tmp1_) { pdfpc_presentation_controller_toggle_freeze (self); } _tmp2_ = self->timer; _tmp3_ = pdfpc_timer_label_is_paused (_tmp2_); if (_tmp3_) { pdfpc_presentation_controller_toggle_pause (self); } } void pdfpc_presentation_controller_quit (pdfpcPresentationController* self) { pdfpcMetadataPdf* _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->metadata; pdfpc_metadata_pdf_save_to_disk (_tmp0_); gtk_main_quit (); } /** * Parse the given time string to a Time object */ static void g_time_local (time_t time, struct tm* result) { struct tm _result_ = {0}; struct tm _tmp0_ = {0}; localtime_r (&time, &_tmp0_); _result_ = _tmp0_; *result = _result_; return; } static time_t pdfpc_presentation_controller_parseTime (pdfpcPresentationController* self, const gchar* t) { time_t result = 0; time_t _tmp0_; struct tm _tmp1_ = {0}; struct tm tm; const gchar* _tmp2_; gchar* _tmp3_; gchar* _tmp4_; time_t _tmp5_ = 0; g_return_val_if_fail (self != NULL, 0); g_return_val_if_fail (t != NULL, 0); _tmp0_ = time (NULL); g_time_local (_tmp0_, &_tmp1_); tm = _tmp1_; _tmp2_ = t; _tmp3_ = g_strconcat (_tmp2_, ":00", NULL); _tmp4_ = _tmp3_; strptime (_tmp4_, "%H:%M:%S", &tm); _g_free0 (_tmp4_); _tmp5_ = mktime (&tm); result = _tmp5_; return result; } guint pdfpc_presentation_controller_get_accepted_key_mods (pdfpcPresentationController* self) { guint result; guint _tmp0_; g_return_val_if_fail (self != NULL, 0U); _tmp0_ = self->priv->_accepted_key_mods; result = _tmp0_; return result; } void pdfpc_presentation_controller_set_accepted_key_mods (pdfpcPresentationController* self, guint value) { guint _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = value; self->priv->_accepted_key_mods = _tmp0_; g_object_notify ((GObject *) self, "accepted-key-mods"); } pdfpcPresentationControllerKeyAction* pdfpc_presentation_controller_key_action_construct (GType object_type, pdfpcPresentationControllerKeyActionKeyActionDelegate d, void* d_target) { pdfpcPresentationControllerKeyAction* self = NULL; pdfpcPresentationControllerKeyActionKeyActionDelegate _tmp0_; void* _tmp0__target; self = (pdfpcPresentationControllerKeyAction*) g_type_create_instance (object_type); _tmp0_ = d; _tmp0__target = d_target; (self->d_target_destroy_notify == NULL) ? NULL : (self->d_target_destroy_notify (self->d_target), NULL); self->d = NULL; self->d_target = NULL; self->d_target_destroy_notify = NULL; self->d = _tmp0_; self->d_target = _tmp0__target; self->d_target_destroy_notify = NULL; return self; } pdfpcPresentationControllerKeyAction* pdfpc_presentation_controller_key_action_new (pdfpcPresentationControllerKeyActionKeyActionDelegate d, void* d_target) { return pdfpc_presentation_controller_key_action_construct (PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, d, d_target); } static void pdfpc_presentation_controller_value_key_action_init (GValue* value) { value->data[0].v_pointer = NULL; } static void pdfpc_presentation_controller_value_key_action_free_value (GValue* value) { if (value->data[0].v_pointer) { pdfpc_presentation_controller_key_action_unref (value->data[0].v_pointer); } } static void pdfpc_presentation_controller_value_key_action_copy_value (const GValue* src_value, GValue* dest_value) { if (src_value->data[0].v_pointer) { dest_value->data[0].v_pointer = pdfpc_presentation_controller_key_action_ref (src_value->data[0].v_pointer); } else { dest_value->data[0].v_pointer = NULL; } } static gpointer pdfpc_presentation_controller_value_key_action_peek_pointer (const GValue* value) { return value->data[0].v_pointer; } static gchar* pdfpc_presentation_controller_value_key_action_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { if (collect_values[0].v_pointer) { pdfpcPresentationControllerKeyAction* object; object = collect_values[0].v_pointer; if (object->parent_instance.g_class == NULL) { return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); } value->data[0].v_pointer = pdfpc_presentation_controller_key_action_ref (object); } else { value->data[0].v_pointer = NULL; } return NULL; } static gchar* pdfpc_presentation_controller_value_key_action_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { pdfpcPresentationControllerKeyAction** object_p; object_p = collect_values[0].v_pointer; if (!object_p) { return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); } if (!value->data[0].v_pointer) { *object_p = NULL; } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { *object_p = value->data[0].v_pointer; } else { *object_p = pdfpc_presentation_controller_key_action_ref (value->data[0].v_pointer); } return NULL; } GParamSpec* pdfpc_presentation_controller_param_spec_key_action (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { pdfpcPresentationControllerParamSpecKeyAction* spec; g_return_val_if_fail (g_type_is_a (object_type, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION), NULL); spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); G_PARAM_SPEC (spec)->value_type = object_type; return G_PARAM_SPEC (spec); } gpointer pdfpc_presentation_controller_value_get_key_action (const GValue* value) { g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION), NULL); return value->data[0].v_pointer; } void pdfpc_presentation_controller_value_set_key_action (GValue* value, gpointer v_object) { pdfpcPresentationControllerKeyAction* old; g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION)); old = value->data[0].v_pointer; if (v_object) { g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION)); g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); value->data[0].v_pointer = v_object; pdfpc_presentation_controller_key_action_ref (value->data[0].v_pointer); } else { value->data[0].v_pointer = NULL; } if (old) { pdfpc_presentation_controller_key_action_unref (old); } } void pdfpc_presentation_controller_value_take_key_action (GValue* value, gpointer v_object) { pdfpcPresentationControllerKeyAction* old; g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION)); old = value->data[0].v_pointer; if (v_object) { g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION)); g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); value->data[0].v_pointer = v_object; } else { value->data[0].v_pointer = NULL; } if (old) { pdfpc_presentation_controller_key_action_unref (old); } } static void pdfpc_presentation_controller_key_action_class_init (pdfpcPresentationControllerKeyActionClass * klass) { pdfpc_presentation_controller_key_action_parent_class = g_type_class_peek_parent (klass); PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION_CLASS (klass)->finalize = pdfpc_presentation_controller_key_action_finalize; } static void pdfpc_presentation_controller_key_action_instance_init (pdfpcPresentationControllerKeyAction * self) { self->ref_count = 1; } static void pdfpc_presentation_controller_key_action_finalize (pdfpcPresentationControllerKeyAction* obj) { pdfpcPresentationControllerKeyAction * self; self = PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION (obj); (self->d_target_destroy_notify == NULL) ? NULL : (self->d_target_destroy_notify (self->d_target), NULL); self->d = NULL; self->d_target = NULL; self->d_target_destroy_notify = NULL; } /** * The key bindings as a map from keycodes to actions * * Vala doesn't allow for delegates as the values in a HashMap (yet?). See * http://stackoverflow.com/questions/6145635/gee-hashmap-containing-methods-as-values * for this solution. */ GType pdfpc_presentation_controller_key_action_get_type (void) { static volatile gsize pdfpc_presentation_controller_key_action_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_presentation_controller_key_action_type_id__volatile)) { static const GTypeValueTable g_define_type_value_table = { pdfpc_presentation_controller_value_key_action_init, pdfpc_presentation_controller_value_key_action_free_value, pdfpc_presentation_controller_value_key_action_copy_value, pdfpc_presentation_controller_value_key_action_peek_pointer, "p", pdfpc_presentation_controller_value_key_action_collect_value, "p", pdfpc_presentation_controller_value_key_action_lcopy_value }; static const GTypeInfo g_define_type_info = { sizeof (pdfpcPresentationControllerKeyActionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_presentation_controller_key_action_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcPresentationControllerKeyAction), 0, (GInstanceInitFunc) pdfpc_presentation_controller_key_action_instance_init, &g_define_type_value_table }; static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; GType pdfpc_presentation_controller_key_action_type_id; pdfpc_presentation_controller_key_action_type_id = g_type_register_fundamental (g_type_fundamental_next (), "pdfpcPresentationControllerKeyAction", &g_define_type_info, &g_define_type_fundamental_info, 0); g_once_init_leave (&pdfpc_presentation_controller_key_action_type_id__volatile, pdfpc_presentation_controller_key_action_type_id); } return pdfpc_presentation_controller_key_action_type_id__volatile; } gpointer pdfpc_presentation_controller_key_action_ref (gpointer instance) { pdfpcPresentationControllerKeyAction* self; self = instance; g_atomic_int_inc (&self->ref_count); return instance; } void pdfpc_presentation_controller_key_action_unref (gpointer instance) { pdfpcPresentationControllerKeyAction* self; self = instance; if (g_atomic_int_dec_and_test (&self->ref_count)) { PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION_GET_CLASS (self)->finalize (self); g_type_free_instance ((GTypeInstance *) self); } } pdfpcPresentationControllerKeyDef* pdfpc_presentation_controller_key_def_construct (GType object_type, guint k, guint m) { pdfpcPresentationControllerKeyDef* self = NULL; guint _tmp0_; guint _tmp1_; self = (pdfpcPresentationControllerKeyDef*) g_type_create_instance (object_type); _tmp0_ = k; pdfpc_presentation_controller_key_def_set_keycode (self, _tmp0_); _tmp1_ = m; pdfpc_presentation_controller_key_def_set_modMask (self, _tmp1_); return self; } pdfpcPresentationControllerKeyDef* pdfpc_presentation_controller_key_def_new (guint k, guint m) { return pdfpc_presentation_controller_key_def_construct (PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, k, m); } static gpointer _pdfpc_presentation_controller_key_def_ref0 (gpointer self) { return self ? pdfpc_presentation_controller_key_def_ref (self) : NULL; } guint pdfpc_presentation_controller_key_def_hash (void* _a) { guint result = 0U; void* _tmp0_; pdfpcPresentationControllerKeyDef* _tmp1_; pdfpcPresentationControllerKeyDef* a; GType _tmp2_ = 0UL; GHashFunc _tmp3_ = NULL; GHashFunc uintHashFunc; guint _tmp4_; guint _tmp5_; guint _tmp6_ = 0U; _tmp0_ = _a; _tmp1_ = _pdfpc_presentation_controller_key_def_ref0 (PDFPC_PRESENTATION_CONTROLLER_KEY_DEF (_tmp0_)); a = _tmp1_; _tmp2_ = g_type_from_name ("uint"); _tmp3_ = gee_functions_get_hash_func_for (_tmp2_); uintHashFunc = _tmp3_; _tmp4_ = a->priv->_keycode; _tmp5_ = a->priv->_modMask; _tmp6_ = uintHashFunc (_tmp4_ | _tmp5_); result = _tmp6_; _pdfpc_presentation_controller_key_def_unref0 (a); return result; } gboolean pdfpc_presentation_controller_key_def_equal (void* _a, void* _b) { gboolean result = FALSE; void* _tmp0_; pdfpcPresentationControllerKeyDef* _tmp1_; pdfpcPresentationControllerKeyDef* a; void* _tmp2_; pdfpcPresentationControllerKeyDef* _tmp3_; pdfpcPresentationControllerKeyDef* b; gboolean _tmp4_ = FALSE; pdfpcPresentationControllerKeyDef* _tmp5_; guint _tmp6_; pdfpcPresentationControllerKeyDef* _tmp7_; guint _tmp8_; gboolean _tmp13_; _tmp0_ = _a; _tmp1_ = _pdfpc_presentation_controller_key_def_ref0 (PDFPC_PRESENTATION_CONTROLLER_KEY_DEF (_tmp0_)); a = _tmp1_; _tmp2_ = _b; _tmp3_ = _pdfpc_presentation_controller_key_def_ref0 (PDFPC_PRESENTATION_CONTROLLER_KEY_DEF (_tmp2_)); b = _tmp3_; _tmp5_ = a; _tmp6_ = _tmp5_->priv->_keycode; _tmp7_ = b; _tmp8_ = _tmp7_->priv->_keycode; if (_tmp6_ == _tmp8_) { pdfpcPresentationControllerKeyDef* _tmp9_; guint _tmp10_; pdfpcPresentationControllerKeyDef* _tmp11_; guint _tmp12_; _tmp9_ = a; _tmp10_ = _tmp9_->priv->_modMask; _tmp11_ = b; _tmp12_ = _tmp11_->priv->_modMask; _tmp4_ = _tmp10_ == _tmp12_; } else { _tmp4_ = FALSE; } _tmp13_ = _tmp4_; result = _tmp13_; _pdfpc_presentation_controller_key_def_unref0 (b); _pdfpc_presentation_controller_key_def_unref0 (a); return result; } guint pdfpc_presentation_controller_key_def_get_keycode (pdfpcPresentationControllerKeyDef* self) { guint result; guint _tmp0_; g_return_val_if_fail (self != NULL, 0U); _tmp0_ = self->priv->_keycode; result = _tmp0_; return result; } void pdfpc_presentation_controller_key_def_set_keycode (pdfpcPresentationControllerKeyDef* self, guint value) { guint _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = value; self->priv->_keycode = _tmp0_; } guint pdfpc_presentation_controller_key_def_get_modMask (pdfpcPresentationControllerKeyDef* self) { guint result; guint _tmp0_; g_return_val_if_fail (self != NULL, 0U); _tmp0_ = self->priv->_modMask; result = _tmp0_; return result; } void pdfpc_presentation_controller_key_def_set_modMask (pdfpcPresentationControllerKeyDef* self, guint value) { guint _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = value; self->priv->_modMask = _tmp0_; } static void pdfpc_presentation_controller_value_key_def_init (GValue* value) { value->data[0].v_pointer = NULL; } static void pdfpc_presentation_controller_value_key_def_free_value (GValue* value) { if (value->data[0].v_pointer) { pdfpc_presentation_controller_key_def_unref (value->data[0].v_pointer); } } static void pdfpc_presentation_controller_value_key_def_copy_value (const GValue* src_value, GValue* dest_value) { if (src_value->data[0].v_pointer) { dest_value->data[0].v_pointer = pdfpc_presentation_controller_key_def_ref (src_value->data[0].v_pointer); } else { dest_value->data[0].v_pointer = NULL; } } static gpointer pdfpc_presentation_controller_value_key_def_peek_pointer (const GValue* value) { return value->data[0].v_pointer; } static gchar* pdfpc_presentation_controller_value_key_def_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { if (collect_values[0].v_pointer) { pdfpcPresentationControllerKeyDef* object; object = collect_values[0].v_pointer; if (object->parent_instance.g_class == NULL) { return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); } value->data[0].v_pointer = pdfpc_presentation_controller_key_def_ref (object); } else { value->data[0].v_pointer = NULL; } return NULL; } static gchar* pdfpc_presentation_controller_value_key_def_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { pdfpcPresentationControllerKeyDef** object_p; object_p = collect_values[0].v_pointer; if (!object_p) { return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); } if (!value->data[0].v_pointer) { *object_p = NULL; } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { *object_p = value->data[0].v_pointer; } else { *object_p = pdfpc_presentation_controller_key_def_ref (value->data[0].v_pointer); } return NULL; } GParamSpec* pdfpc_presentation_controller_param_spec_key_def (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { pdfpcPresentationControllerParamSpecKeyDef* spec; g_return_val_if_fail (g_type_is_a (object_type, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF), NULL); spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); G_PARAM_SPEC (spec)->value_type = object_type; return G_PARAM_SPEC (spec); } gpointer pdfpc_presentation_controller_value_get_key_def (const GValue* value) { g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF), NULL); return value->data[0].v_pointer; } void pdfpc_presentation_controller_value_set_key_def (GValue* value, gpointer v_object) { pdfpcPresentationControllerKeyDef* old; g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF)); old = value->data[0].v_pointer; if (v_object) { g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF)); g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); value->data[0].v_pointer = v_object; pdfpc_presentation_controller_key_def_ref (value->data[0].v_pointer); } else { value->data[0].v_pointer = NULL; } if (old) { pdfpc_presentation_controller_key_def_unref (old); } } void pdfpc_presentation_controller_value_take_key_def (GValue* value, gpointer v_object) { pdfpcPresentationControllerKeyDef* old; g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF)); old = value->data[0].v_pointer; if (v_object) { g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF)); g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); value->data[0].v_pointer = v_object; } else { value->data[0].v_pointer = NULL; } if (old) { pdfpc_presentation_controller_key_def_unref (old); } } static void pdfpc_presentation_controller_key_def_class_init (pdfpcPresentationControllerKeyDefClass * klass) { pdfpc_presentation_controller_key_def_parent_class = g_type_class_peek_parent (klass); PDFPC_PRESENTATION_CONTROLLER_KEY_DEF_CLASS (klass)->finalize = pdfpc_presentation_controller_key_def_finalize; g_type_class_add_private (klass, sizeof (pdfpcPresentationControllerKeyDefPrivate)); } static void pdfpc_presentation_controller_key_def_instance_init (pdfpcPresentationControllerKeyDef * self) { self->priv = PDFPC_PRESENTATION_CONTROLLER_KEY_DEF_GET_PRIVATE (self); self->ref_count = 1; } static void pdfpc_presentation_controller_key_def_finalize (pdfpcPresentationControllerKeyDef* obj) { pdfpcPresentationControllerKeyDef * self; self = PDFPC_PRESENTATION_CONTROLLER_KEY_DEF (obj); } GType pdfpc_presentation_controller_key_def_get_type (void) { static volatile gsize pdfpc_presentation_controller_key_def_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_presentation_controller_key_def_type_id__volatile)) { static const GTypeValueTable g_define_type_value_table = { pdfpc_presentation_controller_value_key_def_init, pdfpc_presentation_controller_value_key_def_free_value, pdfpc_presentation_controller_value_key_def_copy_value, pdfpc_presentation_controller_value_key_def_peek_pointer, "p", pdfpc_presentation_controller_value_key_def_collect_value, "p", pdfpc_presentation_controller_value_key_def_lcopy_value }; static const GTypeInfo g_define_type_info = { sizeof (pdfpcPresentationControllerKeyDefClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_presentation_controller_key_def_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcPresentationControllerKeyDef), 0, (GInstanceInitFunc) pdfpc_presentation_controller_key_def_instance_init, &g_define_type_value_table }; static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; GType pdfpc_presentation_controller_key_def_type_id; pdfpc_presentation_controller_key_def_type_id = g_type_register_fundamental (g_type_fundamental_next (), "pdfpcPresentationControllerKeyDef", &g_define_type_info, &g_define_type_fundamental_info, 0); g_once_init_leave (&pdfpc_presentation_controller_key_def_type_id__volatile, pdfpc_presentation_controller_key_def_type_id); } return pdfpc_presentation_controller_key_def_type_id__volatile; } gpointer pdfpc_presentation_controller_key_def_ref (gpointer instance) { pdfpcPresentationControllerKeyDef* self; self = instance; g_atomic_int_inc (&self->ref_count); return instance; } void pdfpc_presentation_controller_key_def_unref (gpointer instance) { pdfpcPresentationControllerKeyDef* self; self = instance; if (g_atomic_int_dec_and_test (&self->ref_count)) { PDFPC_PRESENTATION_CONTROLLER_KEY_DEF_GET_CLASS (self)->finalize (self); g_type_free_instance ((GTypeInstance *) self); } } static void pdfpc_presentation_controller_class_init (pdfpcPresentationControllerClass * klass) { pdfpc_presentation_controller_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (pdfpcPresentationControllerPrivate)); G_OBJECT_CLASS (klass)->get_property = _vala_pdfpc_presentation_controller_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_pdfpc_presentation_controller_set_property; G_OBJECT_CLASS (klass)->finalize = pdfpc_presentation_controller_finalize; /** * Key modifiers that we support */ g_object_class_install_property (G_OBJECT_CLASS (klass), PDFPC_PRESENTATION_CONTROLLER_ACCEPTED_KEY_MODS, g_param_spec_uint ("accepted-key-mods", "accepted-key-mods", "accepted-key-mods", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); } static void pdfpc_presentation_controller_instance_init (pdfpcPresentationController * self) { self->priv = PDFPC_PRESENTATION_CONTROLLER_GET_PRIVATE (self); self->faded_to_black = FALSE; self->frozen = FALSE; self->ignore_keyboard_events = FALSE; self->ignore_mouse_events = FALSE; self->overview_shown = FALSE; self->last_key_event = (guint) 0; } static void pdfpc_presentation_controller_finalize (GObject* obj) { pdfpcPresentationController * self; self = PDFPC_PRESENTATION_CONTROLLER (obj); __g_list_free__g_object_unref0_0 (self->controllables); _g_object_unref0 (self->metadata); _g_object_unref0 (self->overview); self->priv->history = (g_free (self->priv->history), NULL); _g_object_unref0 (self->timer); _g_object_unref0 (self->actionNames); _g_object_unref0 (self->keyBindings); _g_object_unref0 (self->mouseBindings); G_OBJECT_CLASS (pdfpc_presentation_controller_parent_class)->finalize (obj); } /** * Controller handling all the triggered events/signals */ GType pdfpc_presentation_controller_get_type (void) { static volatile gsize pdfpc_presentation_controller_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_presentation_controller_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcPresentationControllerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_presentation_controller_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcPresentationController), 0, (GInstanceInitFunc) pdfpc_presentation_controller_instance_init, NULL }; GType pdfpc_presentation_controller_type_id; pdfpc_presentation_controller_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcPresentationController", &g_define_type_info, 0); g_once_init_leave (&pdfpc_presentation_controller_type_id__volatile, pdfpc_presentation_controller_type_id); } return pdfpc_presentation_controller_type_id__volatile; } static void _vala_pdfpc_presentation_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { pdfpcPresentationController * self; self = PDFPC_PRESENTATION_CONTROLLER (object); switch (property_id) { case PDFPC_PRESENTATION_CONTROLLER_ACCEPTED_KEY_MODS: g_value_set_uint (value, pdfpc_presentation_controller_get_accepted_key_mods (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void _vala_pdfpc_presentation_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { pdfpcPresentationController * self; self = PDFPC_PRESENTATION_CONTROLLER (object); switch (property_id) { case PDFPC_PRESENTATION_CONTROLLER_ACCEPTED_KEY_MODS: pdfpc_presentation_controller_set_accepted_key_mods (self, g_value_get_uint (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } davvil-pdfpc-074a3c6/c-src/classes/renderer/000077500000000000000000000000001177613036100207015ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/classes/renderer/base.c000066400000000000000000000201261177613036100217600ustar00rootroot00000000000000/* base.c generated by valac 0.16.0, the Vala compiler * generated from base.vala, do not modify */ #include #include #include #define PDFPC_RENDERER_TYPE_BASE (pdfpc_renderer_base_get_type ()) #define PDFPC_RENDERER_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBase)) #define PDFPC_RENDERER_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) #define PDFPC_RENDERER_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) typedef struct _pdfpcRendererBase pdfpcRendererBase; typedef struct _pdfpcRendererBaseClass pdfpcRendererBaseClass; typedef struct _pdfpcRendererBasePrivate pdfpcRendererBasePrivate; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) typedef enum { PDFPC_RENDERER_RENDER_ERROR_SLIDE_DOES_NOT_EXIST } pdfpcRendererRenderError; #define PDFPC_RENDERER_RENDER_ERROR pdfpc_renderer_render_error_quark () struct _pdfpcRendererBase { GObject parent_instance; pdfpcRendererBasePrivate * priv; pdfpcMetadataBase* metadata; gint width; gint height; }; struct _pdfpcRendererBaseClass { GObjectClass parent_class; GdkPixmap* (*render_to_pixmap) (pdfpcRendererBase* self, gint slide_number, GError** error); GdkPixmap* (*fade_to_black) (pdfpcRendererBase* self); }; /** * Error domain used for every render error, which might occur */ static gpointer pdfpc_renderer_base_parent_class = NULL; GType pdfpc_renderer_base_get_type (void) G_GNUC_CONST; GQuark pdfpc_renderer_render_error_quark (void); GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; enum { PDFPC_RENDERER_BASE_DUMMY_PROPERTY }; pdfpcRendererBase* pdfpc_renderer_base_construct (GType object_type, pdfpcMetadataBase* metadata, gint width, gint height); pdfpcMetadataBase* pdfpc_renderer_base_get_metadata (pdfpcRendererBase* self); gint pdfpc_renderer_base_get_width (pdfpcRendererBase* self); gint pdfpc_renderer_base_get_height (pdfpcRendererBase* self); GdkPixmap* pdfpc_renderer_base_render_to_pixmap (pdfpcRendererBase* self, gint slide_number, GError** error); static GdkPixmap* pdfpc_renderer_base_real_render_to_pixmap (pdfpcRendererBase* self, gint slide_number, GError** error); GdkPixmap* pdfpc_renderer_base_fade_to_black (pdfpcRendererBase* self); static GdkPixmap* pdfpc_renderer_base_real_fade_to_black (pdfpcRendererBase* self); static void pdfpc_renderer_base_finalize (GObject* obj); /** * Base constructor taking a metadata object as well as the desired * render width and height as parameters. */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } pdfpcRendererBase* pdfpc_renderer_base_construct (GType object_type, pdfpcMetadataBase* metadata, gint width, gint height) { pdfpcRendererBase * self = NULL; pdfpcMetadataBase* _tmp0_; pdfpcMetadataBase* _tmp1_; gint _tmp2_; gint _tmp3_; g_return_val_if_fail (metadata != NULL, NULL); self = (pdfpcRendererBase*) g_object_new (object_type, NULL); _tmp0_ = metadata; _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->metadata); self->metadata = _tmp1_; _tmp2_ = width; self->width = _tmp2_; _tmp3_ = height; self->height = _tmp3_; return self; } /** * Return the registered metadata object */ pdfpcMetadataBase* pdfpc_renderer_base_get_metadata (pdfpcRendererBase* self) { pdfpcMetadataBase* result = NULL; pdfpcMetadataBase* _tmp0_; pdfpcMetadataBase* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->metadata; _tmp1_ = _g_object_ref0 (_tmp0_); result = _tmp1_; return result; } /** * Return the desired render width */ gint pdfpc_renderer_base_get_width (pdfpcRendererBase* self) { gint result = 0; gint _tmp0_; g_return_val_if_fail (self != NULL, 0); _tmp0_ = self->width; result = _tmp0_; return result; } /** * Return the desired render height */ gint pdfpc_renderer_base_get_height (pdfpcRendererBase* self) { gint result = 0; gint _tmp0_; g_return_val_if_fail (self != NULL, 0); _tmp0_ = self->height; result = _tmp0_; return result; } /** * Render the given slide_number to a Gdk.Pixmap and return it. * * If the requested slide is not available an * RenderError.SLIDE_DOES_NOT_EXIST error should be thrown. */ static GdkPixmap* pdfpc_renderer_base_real_render_to_pixmap (pdfpcRendererBase* self, gint slide_number, GError** error) { g_critical ("Type `%s' does not implement abstract method `pdfpc_renderer_base_render_to_pixmap'", g_type_name (G_TYPE_FROM_INSTANCE (self))); return NULL; } GdkPixmap* pdfpc_renderer_base_render_to_pixmap (pdfpcRendererBase* self, gint slide_number, GError** error) { g_return_val_if_fail (self != NULL, NULL); return PDFPC_RENDERER_BASE_GET_CLASS (self)->render_to_pixmap (self, slide_number, error); } /** * Fill the display with black. Useful for last "slide" or for fading * to black at certain points in the presentation. */ static GdkPixmap* pdfpc_renderer_base_real_fade_to_black (pdfpcRendererBase* self) { g_critical ("Type `%s' does not implement abstract method `pdfpc_renderer_base_fade_to_black'", g_type_name (G_TYPE_FROM_INSTANCE (self))); return NULL; } GdkPixmap* pdfpc_renderer_base_fade_to_black (pdfpcRendererBase* self) { g_return_val_if_fail (self != NULL, NULL); return PDFPC_RENDERER_BASE_GET_CLASS (self)->fade_to_black (self); } static void pdfpc_renderer_base_class_init (pdfpcRendererBaseClass * klass) { pdfpc_renderer_base_parent_class = g_type_class_peek_parent (klass); PDFPC_RENDERER_BASE_CLASS (klass)->render_to_pixmap = pdfpc_renderer_base_real_render_to_pixmap; PDFPC_RENDERER_BASE_CLASS (klass)->fade_to_black = pdfpc_renderer_base_real_fade_to_black; G_OBJECT_CLASS (klass)->finalize = pdfpc_renderer_base_finalize; } static void pdfpc_renderer_base_instance_init (pdfpcRendererBase * self) { } static void pdfpc_renderer_base_finalize (GObject* obj) { pdfpcRendererBase * self; self = PDFPC_RENDERER_BASE (obj); _g_object_unref0 (self->metadata); G_OBJECT_CLASS (pdfpc_renderer_base_parent_class)->finalize (obj); } /** * Renderer base class needed to be extended by every slide renderer. */ GType pdfpc_renderer_base_get_type (void) { static volatile gsize pdfpc_renderer_base_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_renderer_base_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcRendererBaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_renderer_base_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcRendererBase), 0, (GInstanceInitFunc) pdfpc_renderer_base_instance_init, NULL }; GType pdfpc_renderer_base_type_id; pdfpc_renderer_base_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcRendererBase", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); g_once_init_leave (&pdfpc_renderer_base_type_id__volatile, pdfpc_renderer_base_type_id); } return pdfpc_renderer_base_type_id__volatile; } GQuark pdfpc_renderer_render_error_quark (void) { return g_quark_from_static_string ("pdfpc_renderer_render_error-quark"); } davvil-pdfpc-074a3c6/c-src/classes/renderer/cache/000077500000000000000000000000001177613036100217445ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/classes/renderer/cache/base.c000066400000000000000000000162571177613036100230350ustar00rootroot00000000000000/* base.c generated by valac 0.16.0, the Vala compiler * generated from base.vala, do not modify */ #include #include #include #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; typedef struct _pdfpcRendererCacheBasePrivate pdfpcRendererCacheBasePrivate; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) struct _pdfpcRendererCacheBase { GObject parent_instance; pdfpcRendererCacheBasePrivate * priv; pdfpcMetadataBase* metadata; }; struct _pdfpcRendererCacheBaseClass { GObjectClass parent_class; void (*store) (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap); GdkPixmap* (*retrieve) (pdfpcRendererCacheBase* self, guint index); }; static gpointer pdfpc_renderer_cache_base_parent_class = NULL; GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; enum { PDFPC_RENDERER_CACHE_BASE_DUMMY_PROPERTY }; pdfpcRendererCacheBase* pdfpc_renderer_cache_base_construct (GType object_type, pdfpcMetadataBase* metadata); gboolean pdfpc_renderer_cache_base_allows_prerendering (pdfpcRendererCacheBase* self); void pdfpc_renderer_cache_base_store (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap); static void pdfpc_renderer_cache_base_real_store (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap); GdkPixmap* pdfpc_renderer_cache_base_retrieve (pdfpcRendererCacheBase* self, guint index); static GdkPixmap* pdfpc_renderer_cache_base_real_retrieve (pdfpcRendererCacheBase* self, guint index); static void pdfpc_renderer_cache_base_finalize (GObject* obj); /** * Initialize the cache store */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } pdfpcRendererCacheBase* pdfpc_renderer_cache_base_construct (GType object_type, pdfpcMetadataBase* metadata) { pdfpcRendererCacheBase * self = NULL; pdfpcMetadataBase* _tmp0_; pdfpcMetadataBase* _tmp1_; g_return_val_if_fail (metadata != NULL, NULL); self = (pdfpcRendererCacheBase*) g_object_new (object_type, NULL); _tmp0_ = metadata; _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->metadata); self->metadata = _tmp1_; return self; } /** * Asks the cache engine if prerendering is allowed in conjunction with it. * * The default behaviour is to allow prerendering, there might however * be engine implementation where prerendering does not make any sense. * Therefore it can be disabled by overriding this method and returning * false. */ gboolean pdfpc_renderer_cache_base_allows_prerendering (pdfpcRendererCacheBase* self) { gboolean result = FALSE; g_return_val_if_fail (self != NULL, FALSE); result = TRUE; return result; } /** * Store a pixmap in the cache using the given index as identifier */ static void pdfpc_renderer_cache_base_real_store (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap) { g_critical ("Type `%s' does not implement abstract method `pdfpc_renderer_cache_base_store'", g_type_name (G_TYPE_FROM_INSTANCE (self))); return; } void pdfpc_renderer_cache_base_store (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap) { g_return_if_fail (self != NULL); PDFPC_RENDERER_CACHE_BASE_GET_CLASS (self)->store (self, index, pixmap); } /** * Retrieve a stored pixmap from the cache. * * If no item with the given index is available null is returned */ static GdkPixmap* pdfpc_renderer_cache_base_real_retrieve (pdfpcRendererCacheBase* self, guint index) { g_critical ("Type `%s' does not implement abstract method `pdfpc_renderer_cache_base_retrieve'", g_type_name (G_TYPE_FROM_INSTANCE (self))); return NULL; } GdkPixmap* pdfpc_renderer_cache_base_retrieve (pdfpcRendererCacheBase* self, guint index) { g_return_val_if_fail (self != NULL, NULL); return PDFPC_RENDERER_CACHE_BASE_GET_CLASS (self)->retrieve (self, index); } static void pdfpc_renderer_cache_base_class_init (pdfpcRendererCacheBaseClass * klass) { pdfpc_renderer_cache_base_parent_class = g_type_class_peek_parent (klass); PDFPC_RENDERER_CACHE_BASE_CLASS (klass)->store = pdfpc_renderer_cache_base_real_store; PDFPC_RENDERER_CACHE_BASE_CLASS (klass)->retrieve = pdfpc_renderer_cache_base_real_retrieve; G_OBJECT_CLASS (klass)->finalize = pdfpc_renderer_cache_base_finalize; } static void pdfpc_renderer_cache_base_instance_init (pdfpcRendererCacheBase * self) { } static void pdfpc_renderer_cache_base_finalize (GObject* obj) { pdfpcRendererCacheBase * self; self = PDFPC_RENDERER_CACHE_BASE (obj); _g_object_unref0 (self->metadata); G_OBJECT_CLASS (pdfpc_renderer_cache_base_parent_class)->finalize (obj); } /** * Base Cache store interface which needs to be implemented by every * working cache. */ GType pdfpc_renderer_cache_base_get_type (void) { static volatile gsize pdfpc_renderer_cache_base_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_renderer_cache_base_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcRendererCacheBaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_renderer_cache_base_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcRendererCacheBase), 0, (GInstanceInitFunc) pdfpc_renderer_cache_base_instance_init, NULL }; GType pdfpc_renderer_cache_base_type_id; pdfpc_renderer_cache_base_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcRendererCacheBase", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); g_once_init_leave (&pdfpc_renderer_cache_base_type_id__volatile, pdfpc_renderer_cache_base_type_id); } return pdfpc_renderer_cache_base_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/renderer/cache/option_factory.c000066400000000000000000000216441177613036100251560ustar00rootroot00000000000000/* option_factory.c generated by valac 0.16.0, the Vala compiler * generated from option_factory.vala, do not modify */ #include #include #define PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY (pdfpc_renderer_cache_option_factory_get_type ()) #define PDFPC_RENDERER_CACHE_OPTION_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactory)) #define PDFPC_RENDERER_CACHE_OPTION_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactoryClass)) #define PDFPC_RENDERER_CACHE_IS_OPTION_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY)) #define PDFPC_RENDERER_CACHE_IS_OPTION_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY)) #define PDFPC_RENDERER_CACHE_OPTION_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactoryClass)) typedef struct _pdfpcRendererCacheOptionFactory pdfpcRendererCacheOptionFactory; typedef struct _pdfpcRendererCacheOptionFactoryClass pdfpcRendererCacheOptionFactoryClass; typedef struct _pdfpcRendererCacheOptionFactoryPrivate pdfpcRendererCacheOptionFactoryPrivate; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; #define PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE (pdfpc_renderer_cache_png_engine_get_type ()) #define PDFPC_RENDERER_CACHE_PNG_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngine)) #define PDFPC_RENDERER_CACHE_PNG_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngineClass)) #define PDFPC_RENDERER_CACHE_PNG_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_PNG_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_PNG_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngineClass)) typedef struct _pdfpcRendererCachePNGEngine pdfpcRendererCachePNGEngine; typedef struct _pdfpcRendererCachePNGEngineClass pdfpcRendererCachePNGEngineClass; #define PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE (pdfpc_renderer_cache_simple_engine_get_type ()) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngine)) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngineClass)) #define PDFPC_RENDERER_CACHE_SIMPLE_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_SIMPLE_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngineClass)) typedef struct _pdfpcRendererCacheSimpleEngine pdfpcRendererCacheSimpleEngine; typedef struct _pdfpcRendererCacheSimpleEngineClass pdfpcRendererCacheSimpleEngineClass; struct _pdfpcRendererCacheOptionFactory { GObject parent_instance; pdfpcRendererCacheOptionFactoryPrivate * priv; }; struct _pdfpcRendererCacheOptionFactoryClass { GObjectClass parent_class; }; static gpointer pdfpc_renderer_cache_option_factory_parent_class = NULL; extern gboolean pdfpc_options_disable_cache_compression; GType pdfpc_renderer_cache_option_factory_get_type (void) G_GNUC_CONST; enum { PDFPC_RENDERER_CACHE_OPTION_FACTORY_DUMMY_PROPERTY }; static pdfpcRendererCacheOptionFactory* pdfpc_renderer_cache_option_factory_new (void); static pdfpcRendererCacheOptionFactory* pdfpc_renderer_cache_option_factory_construct (GType object_type); GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; pdfpcRendererCacheBase* pdfpc_renderer_cache_option_factory_create (pdfpcMetadataBase* metadata); pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_new (pdfpcMetadataBase* metadata); pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_construct (GType object_type, pdfpcMetadataBase* metadata); GType pdfpc_renderer_cache_png_engine_get_type (void) G_GNUC_CONST; pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_new (pdfpcMetadataBase* metadata); pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_construct (GType object_type, pdfpcMetadataBase* metadata); GType pdfpc_renderer_cache_simple_engine_get_type (void) G_GNUC_CONST; /** * Do not allow instantiation of the factory */ static pdfpcRendererCacheOptionFactory* pdfpc_renderer_cache_option_factory_construct (GType object_type) { pdfpcRendererCacheOptionFactory * self = NULL; self = (pdfpcRendererCacheOptionFactory*) g_object_new (object_type, NULL); return self; } static pdfpcRendererCacheOptionFactory* pdfpc_renderer_cache_option_factory_new (void) { return pdfpc_renderer_cache_option_factory_construct (PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY); } /** * Create and return a new Cache engine based on the set of commandline * options. */ pdfpcRendererCacheBase* pdfpc_renderer_cache_option_factory_create (pdfpcMetadataBase* metadata) { pdfpcRendererCacheBase* result = NULL; gboolean _tmp0_; g_return_val_if_fail (metadata != NULL, NULL); _tmp0_ = pdfpc_options_disable_cache_compression; if (!_tmp0_) { pdfpcMetadataBase* _tmp1_; pdfpcRendererCachePNGEngine* _tmp2_; _tmp1_ = metadata; _tmp2_ = pdfpc_renderer_cache_png_engine_new (_tmp1_); result = (pdfpcRendererCacheBase*) _tmp2_; return result; } else { pdfpcMetadataBase* _tmp3_; pdfpcRendererCacheSimpleEngine* _tmp4_; _tmp3_ = metadata; _tmp4_ = pdfpc_renderer_cache_simple_engine_new (_tmp3_); result = (pdfpcRendererCacheBase*) _tmp4_; return result; } } static void pdfpc_renderer_cache_option_factory_class_init (pdfpcRendererCacheOptionFactoryClass * klass) { pdfpc_renderer_cache_option_factory_parent_class = g_type_class_peek_parent (klass); } static void pdfpc_renderer_cache_option_factory_instance_init (pdfpcRendererCacheOptionFactory * self) { } /** * Creates cache engines based on the global commandline options */ GType pdfpc_renderer_cache_option_factory_get_type (void) { static volatile gsize pdfpc_renderer_cache_option_factory_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_renderer_cache_option_factory_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcRendererCacheOptionFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_renderer_cache_option_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcRendererCacheOptionFactory), 0, (GInstanceInitFunc) pdfpc_renderer_cache_option_factory_instance_init, NULL }; GType pdfpc_renderer_cache_option_factory_type_id; pdfpc_renderer_cache_option_factory_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcRendererCacheOptionFactory", &g_define_type_info, 0); g_once_init_leave (&pdfpc_renderer_cache_option_factory_type_id__volatile, pdfpc_renderer_cache_option_factory_type_id); } return pdfpc_renderer_cache_option_factory_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/renderer/cache/png/000077500000000000000000000000001177613036100225305ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/classes/renderer/cache/png/engine.c000066400000000000000000000405751177613036100241540ustar00rootroot00000000000000/* engine.c generated by valac 0.16.0, the Vala compiler * generated from engine.vala, do not modify */ #include #include #include #include #include #include #include #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; typedef struct _pdfpcRendererCacheBasePrivate pdfpcRendererCacheBasePrivate; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE (pdfpc_renderer_cache_png_engine_get_type ()) #define PDFPC_RENDERER_CACHE_PNG_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngine)) #define PDFPC_RENDERER_CACHE_PNG_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngineClass)) #define PDFPC_RENDERER_CACHE_PNG_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_PNG_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_PNG_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngineClass)) typedef struct _pdfpcRendererCachePNGEngine pdfpcRendererCachePNGEngine; typedef struct _pdfpcRendererCachePNGEngineClass pdfpcRendererCachePNGEngineClass; typedef struct _pdfpcRendererCachePNGEnginePrivate pdfpcRendererCachePNGEnginePrivate; #define PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM (pdfpc_renderer_cache_png_item_get_type ()) #define PDFPC_RENDERER_CACHE_PNG_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItem)) #define PDFPC_RENDERER_CACHE_PNG_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItemClass)) #define PDFPC_RENDERER_CACHE_PNG_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM)) #define PDFPC_RENDERER_CACHE_PNG_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM)) #define PDFPC_RENDERER_CACHE_PNG_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItemClass)) typedef struct _pdfpcRendererCachePNGItem pdfpcRendererCachePNGItem; typedef struct _pdfpcRendererCachePNGItemClass pdfpcRendererCachePNGItemClass; #define _g_mutex_free0(var) ((var == NULL) ? NULL : (var = (g_mutex_free (var), NULL))) #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL))) struct _pdfpcRendererCacheBase { GObject parent_instance; pdfpcRendererCacheBasePrivate * priv; pdfpcMetadataBase* metadata; }; struct _pdfpcRendererCacheBaseClass { GObjectClass parent_class; void (*store) (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap); GdkPixmap* (*retrieve) (pdfpcRendererCacheBase* self, guint index); }; struct _pdfpcRendererCachePNGEngine { pdfpcRendererCacheBase parent_instance; pdfpcRendererCachePNGEnginePrivate * priv; pdfpcRendererCachePNGItem** storage; gint storage_length1; GMutex* mutex; }; struct _pdfpcRendererCachePNGEngineClass { pdfpcRendererCacheBaseClass parent_class; }; static gpointer pdfpc_renderer_cache_png_engine_parent_class = NULL; GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_cache_png_engine_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_cache_png_item_get_type (void) G_GNUC_CONST; enum { PDFPC_RENDERER_CACHE_PNG_ENGINE_DUMMY_PROPERTY }; pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_new (pdfpcMetadataBase* metadata); pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_construct (GType object_type, pdfpcMetadataBase* metadata); pdfpcRendererCacheBase* pdfpc_renderer_cache_base_construct (GType object_type, pdfpcMetadataBase* metadata); guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self); static void pdfpc_renderer_cache_png_engine_real_store (pdfpcRendererCacheBase* base, guint index, GdkPixmap* pixmap); pdfpcRendererCachePNGItem* pdfpc_renderer_cache_png_item_new (guint8* data, int data_length1); pdfpcRendererCachePNGItem* pdfpc_renderer_cache_png_item_construct (GType object_type, guint8* data, int data_length1); static GdkPixmap* pdfpc_renderer_cache_png_engine_real_retrieve (pdfpcRendererCacheBase* base, guint index); guint8* pdfpc_renderer_cache_png_item_get_png_data (pdfpcRendererCachePNGItem* self, int* result_length1); static void pdfpc_renderer_cache_png_engine_finalize (GObject* obj); static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); /** * Initialize the cache store */ pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_construct (GType object_type, pdfpcMetadataBase* metadata) { pdfpcRendererCachePNGEngine * self = NULL; pdfpcMetadataBase* _tmp0_; GMutex* _tmp1_; pdfpcMetadataBase* _tmp2_; guint _tmp3_ = 0U; pdfpcRendererCachePNGItem** _tmp4_ = NULL; GMutex* _tmp5_; g_return_val_if_fail (metadata != NULL, NULL); _tmp0_ = metadata; self = (pdfpcRendererCachePNGEngine*) pdfpc_renderer_cache_base_construct (object_type, _tmp0_); _tmp1_ = self->mutex; g_mutex_lock (_tmp1_); _tmp2_ = ((pdfpcRendererCacheBase*) self)->metadata; _tmp3_ = pdfpc_metadata_base_get_slide_count (_tmp2_); _tmp4_ = g_new0 (pdfpcRendererCachePNGItem*, _tmp3_ + 1); self->storage = (_vala_array_free (self->storage, self->storage_length1, (GDestroyNotify) g_object_unref), NULL); self->storage = _tmp4_; self->storage_length1 = _tmp3_; _tmp5_ = self->mutex; g_mutex_unlock (_tmp5_); return self; } pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_new (pdfpcMetadataBase* metadata) { return pdfpc_renderer_cache_png_engine_construct (PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, metadata); } /** * Store a pixmap in the cache using the given index as identifier */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } static void pdfpc_renderer_cache_png_engine_real_store (pdfpcRendererCacheBase* base, guint index, GdkPixmap* pixmap) { pdfpcRendererCachePNGEngine * self; gint pixmap_width = 0; gint pixmap_height = 0; GdkPixmap* _tmp0_; gint _tmp1_ = 0; gint _tmp2_ = 0; GdkPixbuf* _tmp3_; GdkPixbuf* pixbuf; GdkPixmap* _tmp4_; guint8* buffer = NULL; gint buffer_length1 = 0; gint _buffer_size_ = 0; pdfpcRendererCachePNGItem* _tmp9_; pdfpcRendererCachePNGItem* item; GMutex* _tmp10_; pdfpcRendererCachePNGItem** _tmp11_; gint _tmp11__length1; guint _tmp12_; pdfpcRendererCachePNGItem* _tmp13_; pdfpcRendererCachePNGItem* _tmp14_; GMutex* _tmp15_; GError * _inner_error_ = NULL; self = (pdfpcRendererCachePNGEngine*) base; g_return_if_fail (pixmap != NULL); _tmp0_ = pixmap; gdk_drawable_get_size ((GdkDrawable*) _tmp0_, &_tmp1_, &_tmp2_); pixmap_width = _tmp1_; pixmap_height = _tmp2_; _tmp3_ = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, pixmap_width, pixmap_height); pixbuf = _tmp3_; _tmp4_ = pixmap; gdk_pixbuf_get_from_drawable (pixbuf, (GdkDrawable*) _tmp4_, NULL, 0, 0, 0, 0, pixmap_width, pixmap_height); { guint8* _tmp5_ = NULL; gsize _tmp6_; gdk_pixbuf_save_to_buffer (pixbuf, (gchar**) (&_tmp5_), &_tmp6_, "png", &_inner_error_, "compression", "1", NULL, NULL); buffer = (g_free (buffer), NULL); buffer = _tmp5_; buffer_length1 = _tmp6_; _buffer_size_ = buffer_length1; if (_inner_error_ != NULL) { goto __catch4_g_error; } } goto __finally4; __catch4_g_error: { GError* e = NULL; guint _tmp7_; const gchar* _tmp8_; e = _inner_error_; _inner_error_ = NULL; _tmp7_ = index; _tmp8_ = e->message; g_error ("engine.vala:92: Could not generate PNG cache image for slide %u: %s", _tmp7_, _tmp8_); _g_error_free0 (e); } __finally4: if (_inner_error_ != NULL) { buffer = (g_free (buffer), NULL); _g_object_unref0 (pixbuf); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } _tmp9_ = pdfpc_renderer_cache_png_item_new (buffer, buffer_length1); item = _tmp9_; _tmp10_ = self->mutex; g_mutex_lock (_tmp10_); _tmp11_ = self->storage; _tmp11__length1 = self->storage_length1; _tmp12_ = index; _tmp13_ = _g_object_ref0 (item); _g_object_unref0 (_tmp11_[_tmp12_]); _tmp11_[_tmp12_] = _tmp13_; _tmp14_ = _tmp11_[_tmp12_]; _tmp15_ = self->mutex; g_mutex_unlock (_tmp15_); _g_object_unref0 (item); buffer = (g_free (buffer), NULL); _g_object_unref0 (pixbuf); } /** * Retrieve a stored pixmap from the cache. * * If no item with the given index is available null is returned */ static GdkPixmap* pdfpc_renderer_cache_png_engine_real_retrieve (pdfpcRendererCacheBase* base, guint index) { pdfpcRendererCachePNGEngine * self; GdkPixmap* result = NULL; pdfpcRendererCachePNGItem** _tmp0_; gint _tmp0__length1; guint _tmp1_; pdfpcRendererCachePNGItem* _tmp2_; pdfpcRendererCachePNGItem* _tmp3_; pdfpcRendererCachePNGItem* item; pdfpcRendererCachePNGItem* _tmp4_; GdkPixbufLoader* _tmp5_; GdkPixbufLoader* loader; GdkPixbufLoader* _tmp14_; GdkPixbuf* _tmp15_ = NULL; GdkPixbuf* _tmp16_; GdkPixbuf* pixbuf; GdkPixbuf* _tmp17_; gint _tmp18_ = 0; GdkPixbuf* _tmp19_; gint _tmp20_ = 0; GdkPixmap* _tmp21_; GdkPixmap* pixmap; GdkPixmap* _tmp22_; cairo_t* _tmp23_ = NULL; cairo_t* cr; cairo_t* _tmp24_; GdkPixbuf* _tmp25_; cairo_t* _tmp26_; GdkPixbuf* _tmp27_; gint _tmp28_ = 0; GdkPixbuf* _tmp29_; gint _tmp30_ = 0; cairo_t* _tmp31_; GError * _inner_error_ = NULL; self = (pdfpcRendererCachePNGEngine*) base; _tmp0_ = self->storage; _tmp0__length1 = self->storage_length1; _tmp1_ = index; _tmp2_ = _tmp0_[_tmp1_]; _tmp3_ = _g_object_ref0 (_tmp2_); item = _tmp3_; _tmp4_ = item; if (_tmp4_ == NULL) { result = NULL; _g_object_unref0 (item); return result; } _tmp5_ = gdk_pixbuf_loader_new (); loader = _tmp5_; { GdkPixbufLoader* _tmp6_; pdfpcRendererCachePNGItem* _tmp7_; gint _tmp8_ = 0; guint8* _tmp9_ = NULL; guint8* _tmp10_; gint _tmp10__length1; GdkPixbufLoader* _tmp11_; _tmp6_ = loader; _tmp7_ = item; _tmp9_ = pdfpc_renderer_cache_png_item_get_png_data (_tmp7_, &_tmp8_); _tmp10_ = _tmp9_; _tmp10__length1 = _tmp8_; gdk_pixbuf_loader_write (_tmp6_, _tmp10_, (gsize) _tmp8_, &_inner_error_); _tmp10_ = (g_free (_tmp10_), NULL); if (_inner_error_ != NULL) { goto __catch5_g_error; } _tmp11_ = loader; gdk_pixbuf_loader_close (_tmp11_, &_inner_error_); if (_inner_error_ != NULL) { goto __catch5_g_error; } } goto __finally5; __catch5_g_error: { GError* e = NULL; guint _tmp12_; const gchar* _tmp13_; e = _inner_error_; _inner_error_ = NULL; _tmp12_ = index; _tmp13_ = e->message; g_error ("engine.vala:119: Could not load cached PNG image for slide %u: %s", _tmp12_, _tmp13_); _g_error_free0 (e); } __finally5: if (_inner_error_ != NULL) { _g_object_unref0 (loader); _g_object_unref0 (item); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } _tmp14_ = loader; _tmp15_ = gdk_pixbuf_loader_get_pixbuf (_tmp14_); _tmp16_ = _g_object_ref0 (_tmp15_); pixbuf = _tmp16_; _tmp17_ = pixbuf; _tmp18_ = gdk_pixbuf_get_width (_tmp17_); _tmp19_ = pixbuf; _tmp20_ = gdk_pixbuf_get_height (_tmp19_); _tmp21_ = gdk_pixmap_new (NULL, _tmp18_, _tmp20_, 24); pixmap = _tmp21_; _tmp22_ = pixmap; _tmp23_ = gdk_cairo_create ((GdkDrawable*) _tmp22_); cr = _tmp23_; _tmp24_ = cr; _tmp25_ = pixbuf; gdk_cairo_set_source_pixbuf (_tmp24_, _tmp25_, (gdouble) 0, (gdouble) 0); _tmp26_ = cr; _tmp27_ = pixbuf; _tmp28_ = gdk_pixbuf_get_width (_tmp27_); _tmp29_ = pixbuf; _tmp30_ = gdk_pixbuf_get_height (_tmp29_); cairo_rectangle (_tmp26_, (gdouble) 0, (gdouble) 0, (gdouble) _tmp28_, (gdouble) _tmp30_); _tmp31_ = cr; cairo_fill (_tmp31_); result = pixmap; _cairo_destroy0 (cr); _g_object_unref0 (pixbuf); _g_object_unref0 (loader); _g_object_unref0 (item); return result; } static void pdfpc_renderer_cache_png_engine_class_init (pdfpcRendererCachePNGEngineClass * klass) { pdfpc_renderer_cache_png_engine_parent_class = g_type_class_peek_parent (klass); PDFPC_RENDERER_CACHE_BASE_CLASS (klass)->store = pdfpc_renderer_cache_png_engine_real_store; PDFPC_RENDERER_CACHE_BASE_CLASS (klass)->retrieve = pdfpc_renderer_cache_png_engine_real_retrieve; G_OBJECT_CLASS (klass)->finalize = pdfpc_renderer_cache_png_engine_finalize; } static void pdfpc_renderer_cache_png_engine_instance_init (pdfpcRendererCachePNGEngine * self) { GMutex* _tmp0_; self->storage = NULL; _tmp0_ = g_mutex_new (); self->mutex = _tmp0_; } static void pdfpc_renderer_cache_png_engine_finalize (GObject* obj) { pdfpcRendererCachePNGEngine * self; self = PDFPC_RENDERER_CACHE_PNG_ENGINE (obj); self->storage = (_vala_array_free (self->storage, self->storage_length1, (GDestroyNotify) g_object_unref), NULL); _g_mutex_free0 (self->mutex); G_OBJECT_CLASS (pdfpc_renderer_cache_png_engine_parent_class)->finalize (obj); } /** * Cache store which holds all given items in memory as compressed png * images */ GType pdfpc_renderer_cache_png_engine_get_type (void) { static volatile gsize pdfpc_renderer_cache_png_engine_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_renderer_cache_png_engine_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcRendererCachePNGEngineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_renderer_cache_png_engine_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcRendererCachePNGEngine), 0, (GInstanceInitFunc) pdfpc_renderer_cache_png_engine_instance_init, NULL }; GType pdfpc_renderer_cache_png_engine_type_id; pdfpc_renderer_cache_png_engine_type_id = g_type_register_static (PDFPC_RENDERER_CACHE_TYPE_BASE, "pdfpcRendererCachePNGEngine", &g_define_type_info, 0); g_once_init_leave (&pdfpc_renderer_cache_png_engine_type_id__volatile, pdfpc_renderer_cache_png_engine_type_id); } return pdfpc_renderer_cache_png_engine_type_id__volatile; } static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { if ((array != NULL) && (destroy_func != NULL)) { int i; for (i = 0; i < array_length; i = i + 1) { if (((gpointer*) array)[i] != NULL) { destroy_func (((gpointer*) array)[i]); } } } } static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { _vala_array_destroy (array, array_length, destroy_func); g_free (array); } davvil-pdfpc-074a3c6/c-src/classes/renderer/cache/png/item.c000066400000000000000000000134471177613036100236430ustar00rootroot00000000000000/* item.c generated by valac 0.16.0, the Vala compiler * generated from item.vala, do not modify */ #include #include #define PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM (pdfpc_renderer_cache_png_item_get_type ()) #define PDFPC_RENDERER_CACHE_PNG_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItem)) #define PDFPC_RENDERER_CACHE_PNG_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItemClass)) #define PDFPC_RENDERER_CACHE_PNG_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM)) #define PDFPC_RENDERER_CACHE_PNG_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM)) #define PDFPC_RENDERER_CACHE_PNG_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItemClass)) typedef struct _pdfpcRendererCachePNGItem pdfpcRendererCachePNGItem; typedef struct _pdfpcRendererCachePNGItemClass pdfpcRendererCachePNGItemClass; typedef struct _pdfpcRendererCachePNGItemPrivate pdfpcRendererCachePNGItemPrivate; struct _pdfpcRendererCachePNGItem { GObject parent_instance; pdfpcRendererCachePNGItemPrivate * priv; guint8* data; gint data_length1; }; struct _pdfpcRendererCachePNGItemClass { GObjectClass parent_class; }; static gpointer pdfpc_renderer_cache_png_item_parent_class = NULL; GType pdfpc_renderer_cache_png_item_get_type (void) G_GNUC_CONST; enum { PDFPC_RENDERER_CACHE_PNG_ITEM_DUMMY_PROPERTY }; pdfpcRendererCachePNGItem* pdfpc_renderer_cache_png_item_new (guint8* data, int data_length1); pdfpcRendererCachePNGItem* pdfpc_renderer_cache_png_item_construct (GType object_type, guint8* data, int data_length1); static guint8* _vala_array_dup3 (guint8* self, int length); guint8* pdfpc_renderer_cache_png_item_get_png_data (pdfpcRendererCachePNGItem* self, int* result_length1); static guint8* _vala_array_dup4 (guint8* self, int length); gint pdfpc_renderer_cache_png_item_get_length (pdfpcRendererCachePNGItem* self); static void pdfpc_renderer_cache_png_item_finalize (GObject* obj); /** * Create the item from a uchar array */ static guint8* _vala_array_dup3 (guint8* self, int length) { return g_memdup (self, length * sizeof (guint8)); } pdfpcRendererCachePNGItem* pdfpc_renderer_cache_png_item_construct (GType object_type, guint8* data, int data_length1) { pdfpcRendererCachePNGItem * self = NULL; guint8* _tmp0_; gint _tmp0__length1; guint8* _tmp1_; gint _tmp1__length1; self = (pdfpcRendererCachePNGItem*) g_object_new (object_type, NULL); _tmp0_ = data; _tmp0__length1 = data_length1; _tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup3 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_); _tmp1__length1 = _tmp0__length1; self->data = (g_free (self->data), NULL); self->data = _tmp1_; self->data_length1 = _tmp1__length1; return self; } pdfpcRendererCachePNGItem* pdfpc_renderer_cache_png_item_new (guint8* data, int data_length1) { return pdfpc_renderer_cache_png_item_construct (PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, data, data_length1); } /** * Return the stored data */ static guint8* _vala_array_dup4 (guint8* self, int length) { return g_memdup (self, length * sizeof (guint8)); } guint8* pdfpc_renderer_cache_png_item_get_png_data (pdfpcRendererCachePNGItem* self, int* result_length1) { guint8* result = NULL; guint8* _tmp0_; gint _tmp0__length1; guint8* _tmp1_; gint _tmp1__length1; guint8* _tmp2_; gint _tmp2__length1; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->data; _tmp0__length1 = self->data_length1; _tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup4 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_); _tmp1__length1 = _tmp0__length1; _tmp2_ = _tmp1_; _tmp2__length1 = _tmp1__length1; if (result_length1) { *result_length1 = _tmp2__length1; } result = _tmp2_; return result; } /** * Shortcut to retrieve the length of the stored dataset */ gint pdfpc_renderer_cache_png_item_get_length (pdfpcRendererCachePNGItem* self) { gint result = 0; guint8* _tmp0_; gint _tmp0__length1; g_return_val_if_fail (self != NULL, 0); _tmp0_ = self->data; _tmp0__length1 = self->data_length1; result = _tmp0__length1; return result; } static void pdfpc_renderer_cache_png_item_class_init (pdfpcRendererCachePNGItemClass * klass) { pdfpc_renderer_cache_png_item_parent_class = g_type_class_peek_parent (klass); G_OBJECT_CLASS (klass)->finalize = pdfpc_renderer_cache_png_item_finalize; } static void pdfpc_renderer_cache_png_item_instance_init (pdfpcRendererCachePNGItem * self) { } static void pdfpc_renderer_cache_png_item_finalize (GObject* obj) { pdfpcRendererCachePNGItem * self; self = PDFPC_RENDERER_CACHE_PNG_ITEM (obj); self->data = (g_free (self->data), NULL); G_OBJECT_CLASS (pdfpc_renderer_cache_png_item_parent_class)->finalize (obj); } /** * PNG picture data stored by the PNG cache engine. */ GType pdfpc_renderer_cache_png_item_get_type (void) { static volatile gsize pdfpc_renderer_cache_png_item_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_renderer_cache_png_item_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcRendererCachePNGItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_renderer_cache_png_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcRendererCachePNGItem), 0, (GInstanceInitFunc) pdfpc_renderer_cache_png_item_instance_init, NULL }; GType pdfpc_renderer_cache_png_item_type_id; pdfpc_renderer_cache_png_item_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcRendererCachePNGItem", &g_define_type_info, 0); g_once_init_leave (&pdfpc_renderer_cache_png_item_type_id__volatile, pdfpc_renderer_cache_png_item_type_id); } return pdfpc_renderer_cache_png_item_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/renderer/cache/simple/000077500000000000000000000000001177613036100232355ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/classes/renderer/cache/simple/engine.c000066400000000000000000000242711177613036100246540ustar00rootroot00000000000000/* engine.c generated by valac 0.16.0, the Vala compiler * generated from engine.vala, do not modify */ #include #include #include #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; typedef struct _pdfpcRendererCacheBasePrivate pdfpcRendererCacheBasePrivate; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE (pdfpc_renderer_cache_simple_engine_get_type ()) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngine)) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngineClass)) #define PDFPC_RENDERER_CACHE_SIMPLE_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_SIMPLE_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngineClass)) typedef struct _pdfpcRendererCacheSimpleEngine pdfpcRendererCacheSimpleEngine; typedef struct _pdfpcRendererCacheSimpleEngineClass pdfpcRendererCacheSimpleEngineClass; typedef struct _pdfpcRendererCacheSimpleEnginePrivate pdfpcRendererCacheSimpleEnginePrivate; #define _g_mutex_free0(var) ((var == NULL) ? NULL : (var = (g_mutex_free (var), NULL))) #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) struct _pdfpcRendererCacheBase { GObject parent_instance; pdfpcRendererCacheBasePrivate * priv; pdfpcMetadataBase* metadata; }; struct _pdfpcRendererCacheBaseClass { GObjectClass parent_class; void (*store) (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap); GdkPixmap* (*retrieve) (pdfpcRendererCacheBase* self, guint index); }; struct _pdfpcRendererCacheSimpleEngine { pdfpcRendererCacheBase parent_instance; pdfpcRendererCacheSimpleEnginePrivate * priv; GdkPixmap** storage; gint storage_length1; GMutex* mutex; }; struct _pdfpcRendererCacheSimpleEngineClass { pdfpcRendererCacheBaseClass parent_class; }; static gpointer pdfpc_renderer_cache_simple_engine_parent_class = NULL; GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_cache_simple_engine_get_type (void) G_GNUC_CONST; enum { PDFPC_RENDERER_CACHE_SIMPLE_ENGINE_DUMMY_PROPERTY }; pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_new (pdfpcMetadataBase* metadata); pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_construct (GType object_type, pdfpcMetadataBase* metadata); pdfpcRendererCacheBase* pdfpc_renderer_cache_base_construct (GType object_type, pdfpcMetadataBase* metadata); guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self); static void pdfpc_renderer_cache_simple_engine_real_store (pdfpcRendererCacheBase* base, guint index, GdkPixmap* pixmap); static GdkPixmap* pdfpc_renderer_cache_simple_engine_real_retrieve (pdfpcRendererCacheBase* base, guint index); static void pdfpc_renderer_cache_simple_engine_finalize (GObject* obj); static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); /** * Initialize the cache store */ pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_construct (GType object_type, pdfpcMetadataBase* metadata) { pdfpcRendererCacheSimpleEngine * self = NULL; pdfpcMetadataBase* _tmp0_; GMutex* _tmp1_; pdfpcMetadataBase* _tmp2_; guint _tmp3_ = 0U; GdkPixmap** _tmp4_ = NULL; GMutex* _tmp5_; g_return_val_if_fail (metadata != NULL, NULL); _tmp0_ = metadata; self = (pdfpcRendererCacheSimpleEngine*) pdfpc_renderer_cache_base_construct (object_type, _tmp0_); _tmp1_ = self->mutex; g_mutex_lock (_tmp1_); _tmp2_ = ((pdfpcRendererCacheBase*) self)->metadata; _tmp3_ = pdfpc_metadata_base_get_slide_count (_tmp2_); _tmp4_ = g_new0 (GdkPixmap*, _tmp3_ + 1); self->storage = (_vala_array_free (self->storage, self->storage_length1, (GDestroyNotify) g_object_unref), NULL); self->storage = _tmp4_; self->storage_length1 = _tmp3_; _tmp5_ = self->mutex; g_mutex_unlock (_tmp5_); return self; } pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_new (pdfpcMetadataBase* metadata) { return pdfpc_renderer_cache_simple_engine_construct (PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, metadata); } /** * Store a pixmap in the cache using the given index as identifier */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } static void pdfpc_renderer_cache_simple_engine_real_store (pdfpcRendererCacheBase* base, guint index, GdkPixmap* pixmap) { pdfpcRendererCacheSimpleEngine * self; GMutex* _tmp0_; GdkPixmap** _tmp1_; gint _tmp1__length1; guint _tmp2_; GdkPixmap* _tmp3_; GdkPixmap* _tmp4_; GdkPixmap* _tmp5_; GMutex* _tmp6_; self = (pdfpcRendererCacheSimpleEngine*) base; g_return_if_fail (pixmap != NULL); _tmp0_ = self->mutex; g_mutex_lock (_tmp0_); _tmp1_ = self->storage; _tmp1__length1 = self->storage_length1; _tmp2_ = index; _tmp3_ = pixmap; _tmp4_ = _g_object_ref0 (_tmp3_); _g_object_unref0 (_tmp1_[_tmp2_]); _tmp1_[_tmp2_] = _tmp4_; _tmp5_ = _tmp1_[_tmp2_]; _tmp6_ = self->mutex; g_mutex_unlock (_tmp6_); } /** * Retrieve a stored pixmap from the cache. * * If no item with the given index is available null is returned */ static GdkPixmap* pdfpc_renderer_cache_simple_engine_real_retrieve (pdfpcRendererCacheBase* base, guint index) { pdfpcRendererCacheSimpleEngine * self; GdkPixmap* result = NULL; GdkPixmap** _tmp0_; gint _tmp0__length1; guint _tmp1_; GdkPixmap* _tmp2_; GdkPixmap* _tmp3_; self = (pdfpcRendererCacheSimpleEngine*) base; _tmp0_ = self->storage; _tmp0__length1 = self->storage_length1; _tmp1_ = index; _tmp2_ = _tmp0_[_tmp1_]; _tmp3_ = _g_object_ref0 (_tmp2_); result = _tmp3_; return result; } static void pdfpc_renderer_cache_simple_engine_class_init (pdfpcRendererCacheSimpleEngineClass * klass) { pdfpc_renderer_cache_simple_engine_parent_class = g_type_class_peek_parent (klass); PDFPC_RENDERER_CACHE_BASE_CLASS (klass)->store = pdfpc_renderer_cache_simple_engine_real_store; PDFPC_RENDERER_CACHE_BASE_CLASS (klass)->retrieve = pdfpc_renderer_cache_simple_engine_real_retrieve; G_OBJECT_CLASS (klass)->finalize = pdfpc_renderer_cache_simple_engine_finalize; } static void pdfpc_renderer_cache_simple_engine_instance_init (pdfpcRendererCacheSimpleEngine * self) { GMutex* _tmp0_; self->storage = NULL; _tmp0_ = g_mutex_new (); self->mutex = _tmp0_; } static void pdfpc_renderer_cache_simple_engine_finalize (GObject* obj) { pdfpcRendererCacheSimpleEngine * self; self = PDFPC_RENDERER_CACHE_SIMPLE_ENGINE (obj); self->storage = (_vala_array_free (self->storage, self->storage_length1, (GDestroyNotify) g_object_unref), NULL); _g_mutex_free0 (self->mutex); G_OBJECT_CLASS (pdfpc_renderer_cache_simple_engine_parent_class)->finalize (obj); } /** * Cache store which simply holds all given items in memory. */ GType pdfpc_renderer_cache_simple_engine_get_type (void) { static volatile gsize pdfpc_renderer_cache_simple_engine_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_renderer_cache_simple_engine_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcRendererCacheSimpleEngineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_renderer_cache_simple_engine_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcRendererCacheSimpleEngine), 0, (GInstanceInitFunc) pdfpc_renderer_cache_simple_engine_instance_init, NULL }; GType pdfpc_renderer_cache_simple_engine_type_id; pdfpc_renderer_cache_simple_engine_type_id = g_type_register_static (PDFPC_RENDERER_CACHE_TYPE_BASE, "pdfpcRendererCacheSimpleEngine", &g_define_type_info, 0); g_once_init_leave (&pdfpc_renderer_cache_simple_engine_type_id__volatile, pdfpc_renderer_cache_simple_engine_type_id); } return pdfpc_renderer_cache_simple_engine_type_id__volatile; } static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { if ((array != NULL) && (destroy_func != NULL)) { int i; for (i = 0; i < array_length; i = i + 1) { if (((gpointer*) array)[i] != NULL) { destroy_func (((gpointer*) array)[i]); } } } } static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { _vala_array_destroy (array, array_length, destroy_func); g_free (array); } davvil-pdfpc-074a3c6/c-src/classes/renderer/pdf.c000066400000000000000000000434601177613036100216250ustar00rootroot00000000000000/* pdf.c generated by valac 0.16.0, the Vala compiler * generated from pdf.vala, do not modify */ #include #include #include #include #include #include #include #define PDFPC_RENDERER_TYPE_BASE (pdfpc_renderer_base_get_type ()) #define PDFPC_RENDERER_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBase)) #define PDFPC_RENDERER_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) #define PDFPC_RENDERER_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) typedef struct _pdfpcRendererBase pdfpcRendererBase; typedef struct _pdfpcRendererBaseClass pdfpcRendererBaseClass; typedef struct _pdfpcRendererBasePrivate pdfpcRendererBasePrivate; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define PDFPC_RENDERER_TYPE_CACHING (pdfpc_renderer_caching_get_type ()) #define PDFPC_RENDERER_CACHING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCaching)) #define PDFPC_RENDERER_IS_CACHING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_CACHING)) #define PDFPC_RENDERER_CACHING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCachingIface)) typedef struct _pdfpcRendererCaching pdfpcRendererCaching; typedef struct _pdfpcRendererCachingIface pdfpcRendererCachingIface; #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; #define PDFPC_RENDERER_TYPE_PDF (pdfpc_renderer_pdf_get_type ()) #define PDFPC_RENDERER_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdf)) #define PDFPC_RENDERER_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass)) #define PDFPC_RENDERER_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_PDF)) #define PDFPC_RENDERER_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_PDF)) #define PDFPC_RENDERER_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass)) typedef struct _pdfpcRendererPdf pdfpcRendererPdf; typedef struct _pdfpcRendererPdfClass pdfpcRendererPdfClass; typedef struct _pdfpcRendererPdfPrivate pdfpcRendererPdfPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ()) #define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf)) #define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) #define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf; typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass; #define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL))) typedef enum { PDFPC_RENDERER_RENDER_ERROR_SLIDE_DOES_NOT_EXIST } pdfpcRendererRenderError; #define PDFPC_RENDERER_RENDER_ERROR pdfpc_renderer_render_error_quark () struct _pdfpcRendererBase { GObject parent_instance; pdfpcRendererBasePrivate * priv; pdfpcMetadataBase* metadata; gint width; gint height; }; struct _pdfpcRendererBaseClass { GObjectClass parent_class; GdkPixmap* (*render_to_pixmap) (pdfpcRendererBase* self, gint slide_number, GError** error); GdkPixmap* (*fade_to_black) (pdfpcRendererBase* self); }; struct _pdfpcRendererCachingIface { GTypeInterface parent_iface; void (*set_cache) (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* (*get_cache) (pdfpcRendererCaching* self); }; struct _pdfpcRendererPdf { pdfpcRendererBase parent_instance; pdfpcRendererPdfPrivate * priv; gdouble scaling_factor; pdfpcRendererCacheBase* cache; }; struct _pdfpcRendererPdfClass { pdfpcRendererBaseClass parent_class; }; static gpointer pdfpc_renderer_pdf_parent_class = NULL; extern GMutex* pdfpc_mutex_locks_poppler; static pdfpcRendererCachingIface* pdfpc_renderer_pdf_pdfpc_renderer_caching_parent_iface = NULL; GType pdfpc_renderer_base_get_type (void) G_GNUC_CONST; GQuark pdfpc_renderer_render_error_quark (void); GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_caching_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_pdf_get_type (void) G_GNUC_CONST; enum { PDFPC_RENDERER_PDF_DUMMY_PROPERTY }; GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST; pdfpcRendererPdf* pdfpc_renderer_pdf_new (pdfpcMetadataPdf* metadata, gint width, gint height); pdfpcRendererPdf* pdfpc_renderer_pdf_construct (GType object_type, pdfpcMetadataPdf* metadata, gint width, gint height); pdfpcRendererBase* pdfpc_renderer_base_construct (GType object_type, pdfpcMetadataBase* metadata, gint width, gint height); gdouble pdfpc_metadata_pdf_get_page_width (pdfpcMetadataPdf* self); gdouble pdfpc_metadata_pdf_get_page_height (pdfpcMetadataPdf* self); static void pdfpc_renderer_pdf_real_set_cache (pdfpcRendererCaching* base, pdfpcRendererCacheBase* cache); static pdfpcRendererCacheBase* pdfpc_renderer_pdf_real_get_cache (pdfpcRendererCaching* base); static GdkPixmap* pdfpc_renderer_pdf_real_render_to_pixmap (pdfpcRendererBase* base, gint slide_number, GError** error); guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self); GdkPixmap* pdfpc_renderer_cache_base_retrieve (pdfpcRendererCacheBase* self, guint index); PopplerDocument* pdfpc_metadata_pdf_get_document (pdfpcMetadataPdf* self); void pdfpc_renderer_cache_base_store (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap); static GdkPixmap* pdfpc_renderer_pdf_real_fade_to_black (pdfpcRendererBase* base); static void pdfpc_renderer_pdf_finalize (GObject* obj); /** * Base constructor taking a pdf metadata object as well as the desired * render width and height as parameters. * * The pdf will always be rendered to fill up all available space. If * the proportions of the rendersize do not fit the proportions of the * pdf document the renderspace is filled up completely cutting of a * part of the pdf document. */ pdfpcRendererPdf* pdfpc_renderer_pdf_construct (GType object_type, pdfpcMetadataPdf* metadata, gint width, gint height) { pdfpcRendererPdf * self = NULL; pdfpcMetadataPdf* _tmp0_; gint _tmp1_; gint _tmp2_; gint _tmp3_; pdfpcMetadataPdf* _tmp4_; gdouble _tmp5_ = 0.0; gint _tmp6_; pdfpcMetadataPdf* _tmp7_; gdouble _tmp8_ = 0.0; gdouble _tmp9_ = 0.0; g_return_val_if_fail (metadata != NULL, NULL); _tmp0_ = metadata; _tmp1_ = width; _tmp2_ = height; self = (pdfpcRendererPdf*) pdfpc_renderer_base_construct (object_type, (pdfpcMetadataBase*) _tmp0_, _tmp1_, _tmp2_); _tmp3_ = width; _tmp4_ = metadata; _tmp5_ = pdfpc_metadata_pdf_get_page_width (_tmp4_); _tmp6_ = height; _tmp7_ = metadata; _tmp8_ = pdfpc_metadata_pdf_get_page_height (_tmp7_); _tmp9_ = fmax (_tmp3_ / _tmp5_, _tmp6_ / _tmp8_); self->scaling_factor = _tmp9_; return self; } pdfpcRendererPdf* pdfpc_renderer_pdf_new (pdfpcMetadataPdf* metadata, gint width, gint height) { return pdfpc_renderer_pdf_construct (PDFPC_RENDERER_TYPE_PDF, metadata, width, height); } /** * Set cache store to use */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } static void pdfpc_renderer_pdf_real_set_cache (pdfpcRendererCaching* base, pdfpcRendererCacheBase* cache) { pdfpcRendererPdf * self; pdfpcRendererCacheBase* _tmp0_; pdfpcRendererCacheBase* _tmp1_; self = (pdfpcRendererPdf*) base; g_return_if_fail (cache != NULL); _tmp0_ = cache; _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->cache); self->cache = _tmp1_; } /** * Retrieve the currently used cache engine */ static pdfpcRendererCacheBase* pdfpc_renderer_pdf_real_get_cache (pdfpcRendererCaching* base) { pdfpcRendererPdf * self; pdfpcRendererCacheBase* result = NULL; pdfpcRendererCacheBase* _tmp0_; pdfpcRendererCacheBase* _tmp1_; self = (pdfpcRendererPdf*) base; _tmp0_ = self->cache; _tmp1_ = _g_object_ref0 (_tmp0_); result = _tmp1_; return result; } /** * Render the given slide_number to a Gdk.Pixmap and return it. * * If the requested slide is not available an * RenderError.SLIDE_DOES_NOT_EXIST error is thrown. */ static GdkPixmap* pdfpc_renderer_pdf_real_render_to_pixmap (pdfpcRendererBase* base, gint slide_number, GError** error) { pdfpcRendererPdf * self; GdkPixmap* result = NULL; pdfpcMetadataBase* _tmp0_; pdfpcMetadataPdf* _tmp1_; pdfpcMetadataPdf* metadata; gboolean _tmp2_ = FALSE; gint _tmp3_; gboolean _tmp7_; pdfpcRendererCacheBase* _tmp10_; GMutex* _tmp15_; pdfpcMetadataPdf* _tmp16_; PopplerDocument* _tmp17_ = NULL; PopplerDocument* _tmp18_; gint _tmp19_; PopplerPage* _tmp20_ = NULL; PopplerPage* _tmp21_; PopplerPage* page; GMutex* _tmp22_; gint _tmp23_; gint _tmp24_; GdkPixmap* _tmp25_; GdkPixmap* pixmap; GdkPixmap* _tmp26_; cairo_t* _tmp27_ = NULL; cairo_t* cr; cairo_t* _tmp28_; cairo_t* _tmp29_; gint _tmp30_; gint _tmp31_; cairo_t* _tmp32_; cairo_t* _tmp33_; gdouble _tmp34_; gdouble _tmp35_; GMutex* _tmp36_; PopplerPage* _tmp37_; cairo_t* _tmp38_; GMutex* _tmp39_; pdfpcRendererCacheBase* _tmp40_; GError * _inner_error_ = NULL; self = (pdfpcRendererPdf*) base; _tmp0_ = ((pdfpcRendererBase*) self)->metadata; _tmp1_ = _g_object_ref0 (PDFPC_METADATA_IS_PDF (_tmp0_) ? ((pdfpcMetadataPdf*) _tmp0_) : NULL); metadata = _tmp1_; _tmp3_ = slide_number; if (_tmp3_ < 0) { _tmp2_ = TRUE; } else { gint _tmp4_; pdfpcMetadataPdf* _tmp5_; guint _tmp6_ = 0U; _tmp4_ = slide_number; _tmp5_ = metadata; _tmp6_ = pdfpc_metadata_base_get_slide_count ((pdfpcMetadataBase*) _tmp5_); _tmp2_ = ((guint) _tmp4_) >= _tmp6_; } _tmp7_ = _tmp2_; if (_tmp7_) { gint _tmp8_; GError* _tmp9_; _tmp8_ = slide_number; _tmp9_ = g_error_new (PDFPC_RENDERER_RENDER_ERROR, PDFPC_RENDERER_RENDER_ERROR_SLIDE_DOES_NOT_EXIST, "The requested slide '%i' does not exist.", _tmp8_); _inner_error_ = _tmp9_; if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { g_propagate_error (error, _inner_error_); _g_object_unref0 (metadata); return NULL; } else { _g_object_unref0 (metadata); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } } _tmp10_ = self->cache; if (_tmp10_ != NULL) { GdkPixmap* cache_content = NULL; pdfpcRendererCacheBase* _tmp11_; gint _tmp12_; GdkPixmap* _tmp13_ = NULL; GdkPixmap* _tmp14_; _tmp11_ = self->cache; _tmp12_ = slide_number; _tmp13_ = pdfpc_renderer_cache_base_retrieve (_tmp11_, (guint) _tmp12_); _g_object_unref0 (cache_content); cache_content = _tmp13_; _tmp14_ = cache_content; if (_tmp14_ != NULL) { result = cache_content; _g_object_unref0 (metadata); return result; } _g_object_unref0 (cache_content); } _tmp15_ = pdfpc_mutex_locks_poppler; g_mutex_lock (_tmp15_); _tmp16_ = metadata; _tmp17_ = pdfpc_metadata_pdf_get_document (_tmp16_); _tmp18_ = _tmp17_; _tmp19_ = slide_number; _tmp20_ = poppler_document_get_page (_tmp18_, _tmp19_); _tmp21_ = _tmp20_; _g_object_unref0 (_tmp18_); page = _tmp21_; _tmp22_ = pdfpc_mutex_locks_poppler; g_mutex_unlock (_tmp22_); _tmp23_ = ((pdfpcRendererBase*) self)->width; _tmp24_ = ((pdfpcRendererBase*) self)->height; _tmp25_ = gdk_pixmap_new (NULL, _tmp23_, _tmp24_, 24); pixmap = _tmp25_; _tmp26_ = pixmap; _tmp27_ = gdk_cairo_create ((GdkDrawable*) _tmp26_); cr = _tmp27_; _tmp28_ = cr; cairo_set_source_rgb (_tmp28_, (gdouble) 255, (gdouble) 255, (gdouble) 255); _tmp29_ = cr; _tmp30_ = ((pdfpcRendererBase*) self)->width; _tmp31_ = ((pdfpcRendererBase*) self)->height; cairo_rectangle (_tmp29_, (gdouble) 0, (gdouble) 0, (gdouble) _tmp30_, (gdouble) _tmp31_); _tmp32_ = cr; cairo_fill (_tmp32_); _tmp33_ = cr; _tmp34_ = self->scaling_factor; _tmp35_ = self->scaling_factor; cairo_scale (_tmp33_, _tmp34_, _tmp35_); _tmp36_ = pdfpc_mutex_locks_poppler; g_mutex_lock (_tmp36_); _tmp37_ = page; _tmp38_ = cr; poppler_page_render (_tmp37_, (cairo_t*) _tmp38_); _tmp39_ = pdfpc_mutex_locks_poppler; g_mutex_unlock (_tmp39_); _tmp40_ = self->cache; if (_tmp40_ != NULL) { pdfpcRendererCacheBase* _tmp41_; gint _tmp42_; GdkPixmap* _tmp43_; _tmp41_ = self->cache; _tmp42_ = slide_number; _tmp43_ = pixmap; pdfpc_renderer_cache_base_store (_tmp41_, (guint) _tmp42_, _tmp43_); } result = pixmap; _cairo_destroy0 (cr); _g_object_unref0 (page); _g_object_unref0 (metadata); return result; } static GdkPixmap* pdfpc_renderer_pdf_real_fade_to_black (pdfpcRendererBase* base) { pdfpcRendererPdf * self; GdkPixmap* result = NULL; gint _tmp0_; gint _tmp1_; GdkPixmap* _tmp2_; GdkPixmap* pixmap; cairo_t* _tmp3_ = NULL; cairo_t* cr; gint _tmp4_; gint _tmp5_; gdouble _tmp6_; gdouble _tmp7_; self = (pdfpcRendererPdf*) base; _tmp0_ = ((pdfpcRendererBase*) self)->width; _tmp1_ = ((pdfpcRendererBase*) self)->height; _tmp2_ = gdk_pixmap_new (NULL, _tmp0_, _tmp1_, 24); pixmap = _tmp2_; _tmp3_ = gdk_cairo_create ((GdkDrawable*) pixmap); cr = _tmp3_; cairo_set_source_rgb (cr, (gdouble) 0, (gdouble) 0, (gdouble) 0); _tmp4_ = ((pdfpcRendererBase*) self)->width; _tmp5_ = ((pdfpcRendererBase*) self)->height; cairo_rectangle (cr, (gdouble) 0, (gdouble) 0, (gdouble) _tmp4_, (gdouble) _tmp5_); cairo_fill (cr); _tmp6_ = self->scaling_factor; _tmp7_ = self->scaling_factor; cairo_scale (cr, _tmp6_, _tmp7_); result = pixmap; _cairo_destroy0 (cr); return result; } static void pdfpc_renderer_pdf_class_init (pdfpcRendererPdfClass * klass) { pdfpc_renderer_pdf_parent_class = g_type_class_peek_parent (klass); PDFPC_RENDERER_BASE_CLASS (klass)->render_to_pixmap = pdfpc_renderer_pdf_real_render_to_pixmap; PDFPC_RENDERER_BASE_CLASS (klass)->fade_to_black = pdfpc_renderer_pdf_real_fade_to_black; G_OBJECT_CLASS (klass)->finalize = pdfpc_renderer_pdf_finalize; } static void pdfpc_renderer_pdf_pdfpc_renderer_caching_interface_init (pdfpcRendererCachingIface * iface) { pdfpc_renderer_pdf_pdfpc_renderer_caching_parent_iface = g_type_interface_peek_parent (iface); iface->set_cache = (void (*)(pdfpcRendererCaching*, pdfpcRendererCacheBase*)) pdfpc_renderer_pdf_real_set_cache; iface->get_cache = (pdfpcRendererCacheBase* (*)(pdfpcRendererCaching*)) pdfpc_renderer_pdf_real_get_cache; } static void pdfpc_renderer_pdf_instance_init (pdfpcRendererPdf * self) { self->cache = NULL; } static void pdfpc_renderer_pdf_finalize (GObject* obj) { pdfpcRendererPdf * self; self = PDFPC_RENDERER_PDF (obj); _g_object_unref0 (self->cache); G_OBJECT_CLASS (pdfpc_renderer_pdf_parent_class)->finalize (obj); } /** * Pdf slide renderer */ GType pdfpc_renderer_pdf_get_type (void) { static volatile gsize pdfpc_renderer_pdf_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_renderer_pdf_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcRendererPdfClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_renderer_pdf_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcRendererPdf), 0, (GInstanceInitFunc) pdfpc_renderer_pdf_instance_init, NULL }; static const GInterfaceInfo pdfpc_renderer_caching_info = { (GInterfaceInitFunc) pdfpc_renderer_pdf_pdfpc_renderer_caching_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType pdfpc_renderer_pdf_type_id; pdfpc_renderer_pdf_type_id = g_type_register_static (PDFPC_RENDERER_TYPE_BASE, "pdfpcRendererPdf", &g_define_type_info, 0); g_type_add_interface_static (pdfpc_renderer_pdf_type_id, PDFPC_RENDERER_TYPE_CACHING, &pdfpc_renderer_caching_info); g_once_init_leave (&pdfpc_renderer_pdf_type_id__volatile, pdfpc_renderer_pdf_type_id); } return pdfpc_renderer_pdf_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/scaler.c000066400000000000000000000140321177613036100205100ustar00rootroot00000000000000/* scaler.c generated by valac 0.16.0, the Vala compiler * generated from scaler.vala, do not modify */ #include #include #include #include #include #include #define PDFPC_TYPE_SCALER (pdfpc_scaler_get_type ()) #define PDFPC_SCALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_SCALER, pdfpcScaler)) #define PDFPC_SCALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_SCALER, pdfpcScalerClass)) #define PDFPC_IS_SCALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_SCALER)) #define PDFPC_IS_SCALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_SCALER)) #define PDFPC_SCALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_SCALER, pdfpcScalerClass)) typedef struct _pdfpcScaler pdfpcScaler; typedef struct _pdfpcScalerClass pdfpcScalerClass; typedef struct _pdfpcScalerPrivate pdfpcScalerPrivate; struct _pdfpcScaler { GObject parent_instance; pdfpcScalerPrivate * priv; gdouble initial_width; gdouble initial_height; }; struct _pdfpcScalerClass { GObjectClass parent_class; }; static gpointer pdfpc_scaler_parent_class = NULL; GType pdfpc_scaler_get_type (void) G_GNUC_CONST; enum { PDFPC_SCALER_DUMMY_PROPERTY }; pdfpcScaler* pdfpc_scaler_new (gdouble width, gdouble height); pdfpcScaler* pdfpc_scaler_construct (GType object_type, gdouble width, gdouble height); void pdfpc_scaler_scale_to (pdfpcScaler* self, gint width, gint height, gboolean centered, gboolean allow_cutoff, GdkRectangle* result); static void pdfpc_scaler_finalize (GObject* obj); /** * Create a new Scaler taking initial width and height as input */ pdfpcScaler* pdfpc_scaler_construct (GType object_type, gdouble width, gdouble height) { pdfpcScaler * self = NULL; gdouble _tmp0_; gdouble _tmp1_; self = (pdfpcScaler*) g_object_new (object_type, NULL); _tmp0_ = width; self->initial_width = _tmp0_; _tmp1_ = height; self->initial_height = _tmp1_; return self; } pdfpcScaler* pdfpc_scaler_new (gdouble width, gdouble height) { return pdfpc_scaler_construct (PDFPC_TYPE_SCALER, width, height); } /** * Scale the initial dimensions to a specific measurement. * * The result is a Gdk.Rectangle, as by default the aspect_ration is * maintained and the result is centered in the given space. * * By default the given scaling will not cut off any information of the * source size. The allow_cutoff parameter allows to maximize usage of * the given space by allowing to cut off certain parts of the initial * input. */ void pdfpc_scaler_scale_to (pdfpcScaler* self, gint width, gint height, gboolean centered, gboolean allow_cutoff, GdkRectangle* result) { GdkRectangle target = {0}; gdouble factor; gint _tmp0_; gdouble _tmp17_; gdouble _tmp18_; gdouble _tmp19_ = 0.0; gdouble _tmp20_; gdouble _tmp21_; gdouble _tmp22_ = 0.0; gboolean _tmp23_; g_return_if_fail (self != NULL); memset (&target, 0, sizeof (GdkRectangle)); factor = (gdouble) 1.0f; _tmp0_ = width; if (_tmp0_ == 0) { gint _tmp1_; gdouble _tmp2_; _tmp1_ = height; _tmp2_ = self->initial_height; factor = _tmp1_ / _tmp2_; } else { gint _tmp3_; _tmp3_ = height; if (_tmp3_ == 0) { gint _tmp4_; gdouble _tmp5_; _tmp4_ = width; _tmp5_ = self->initial_width; factor = _tmp4_ / _tmp5_; } else { gboolean _tmp6_; _tmp6_ = allow_cutoff; if (_tmp6_ == TRUE) { gint _tmp7_; gdouble _tmp8_; gint _tmp9_; gdouble _tmp10_; gdouble _tmp11_ = 0.0; _tmp7_ = width; _tmp8_ = self->initial_width; _tmp9_ = height; _tmp10_ = self->initial_height; _tmp11_ = fmax (_tmp7_ / _tmp8_, _tmp9_ / _tmp10_); factor = _tmp11_; } else { gint _tmp12_; gdouble _tmp13_; gint _tmp14_; gdouble _tmp15_; gdouble _tmp16_ = 0.0; _tmp12_ = width; _tmp13_ = self->initial_width; _tmp14_ = height; _tmp15_ = self->initial_height; _tmp16_ = fmin (_tmp12_ / _tmp13_, _tmp14_ / _tmp15_); factor = _tmp16_; } } } _tmp17_ = self->initial_width; _tmp18_ = factor; _tmp19_ = floor (_tmp17_ * _tmp18_); target.width = (gint) _tmp19_; _tmp20_ = self->initial_height; _tmp21_ = factor; _tmp22_ = floor (_tmp20_ * _tmp21_); target.height = (gint) _tmp22_; _tmp23_ = centered; if (_tmp23_ == TRUE) { gint _tmp24_; GdkRectangle _tmp25_; gint _tmp26_; gdouble _tmp27_ = 0.0; gint _tmp28_; GdkRectangle _tmp29_; gint _tmp30_; gdouble _tmp31_ = 0.0; _tmp24_ = width; _tmp25_ = target; _tmp26_ = _tmp25_.width; _tmp27_ = floor ((gdouble) ((_tmp24_ - _tmp26_) / 2.0f)); target.x = (gint) _tmp27_; _tmp28_ = height; _tmp29_ = target; _tmp30_ = _tmp29_.height; _tmp31_ = floor ((gdouble) ((_tmp28_ - _tmp30_) / 2.0f)); target.y = (gint) _tmp31_; } *result = target; return; } static void pdfpc_scaler_class_init (pdfpcScalerClass * klass) { pdfpc_scaler_parent_class = g_type_class_peek_parent (klass); G_OBJECT_CLASS (klass)->finalize = pdfpc_scaler_finalize; } static void pdfpc_scaler_instance_init (pdfpcScaler * self) { } static void pdfpc_scaler_finalize (GObject* obj) { pdfpcScaler * self; self = PDFPC_SCALER (obj); G_OBJECT_CLASS (pdfpc_scaler_parent_class)->finalize (obj); } /** * Scaling calculator which is able to calculate different scaling * scenarios while maintaining the correct aspect ratio. */ GType pdfpc_scaler_get_type (void) { static volatile gsize pdfpc_scaler_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_scaler_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcScalerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_scaler_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcScaler), 0, (GInstanceInitFunc) pdfpc_scaler_instance_init, NULL }; GType pdfpc_scaler_type_id; pdfpc_scaler_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcScaler", &g_define_type_info, 0); g_once_init_leave (&pdfpc_scaler_type_id__volatile, pdfpc_scaler_type_id); } return pdfpc_scaler_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/timer_label.c000066400000000000000000000721731177613036100215300ustar00rootroot00000000000000/* timer_label.c generated by valac 0.16.0, the Vala compiler * generated from timer_label.vala, do not modify */ #include #include #include #include #include #include #include #define PDFPC_TYPE_TIMER_LABEL (pdfpc_timer_label_get_type ()) #define PDFPC_TIMER_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabel)) #define PDFPC_TIMER_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabelClass)) #define PDFPC_IS_TIMER_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_TIMER_LABEL)) #define PDFPC_IS_TIMER_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_TIMER_LABEL)) #define PDFPC_TIMER_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabelClass)) typedef struct _pdfpcTimerLabel pdfpcTimerLabel; typedef struct _pdfpcTimerLabelClass pdfpcTimerLabelClass; #define PDFPC_TYPE_COUNTDOWN_TIMER (pdfpc_countdown_timer_get_type ()) #define PDFPC_COUNTDOWN_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_COUNTDOWN_TIMER, pdfpcCountdownTimer)) #define PDFPC_COUNTDOWN_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_COUNTDOWN_TIMER, pdfpcCountdownTimerClass)) #define PDFPC_IS_COUNTDOWN_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_COUNTDOWN_TIMER)) #define PDFPC_IS_COUNTDOWN_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_COUNTDOWN_TIMER)) #define PDFPC_COUNTDOWN_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_COUNTDOWN_TIMER, pdfpcCountdownTimerClass)) typedef struct _pdfpcCountdownTimer pdfpcCountdownTimer; typedef struct _pdfpcCountdownTimerClass pdfpcCountdownTimerClass; #define PDFPC_TYPE_END_TIME_TIMER (pdfpc_end_time_timer_get_type ()) #define PDFPC_END_TIME_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_END_TIME_TIMER, pdfpcEndTimeTimer)) #define PDFPC_END_TIME_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_END_TIME_TIMER, pdfpcEndTimeTimerClass)) #define PDFPC_IS_END_TIME_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_END_TIME_TIMER)) #define PDFPC_IS_END_TIME_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_END_TIME_TIMER)) #define PDFPC_END_TIME_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_END_TIME_TIMER, pdfpcEndTimeTimerClass)) typedef struct _pdfpcEndTimeTimer pdfpcEndTimeTimer; typedef struct _pdfpcEndTimeTimerClass pdfpcEndTimeTimerClass; #define PDFPC_TYPE_COUNTUP_TIMER (pdfpc_countup_timer_get_type ()) #define PDFPC_COUNTUP_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_COUNTUP_TIMER, pdfpcCountupTimer)) #define PDFPC_COUNTUP_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_COUNTUP_TIMER, pdfpcCountupTimerClass)) #define PDFPC_IS_COUNTUP_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_COUNTUP_TIMER)) #define PDFPC_IS_COUNTUP_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_COUNTUP_TIMER)) #define PDFPC_COUNTUP_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_COUNTUP_TIMER, pdfpcCountupTimerClass)) typedef struct _pdfpcCountupTimer pdfpcCountupTimer; typedef struct _pdfpcCountupTimerClass pdfpcCountupTimerClass; typedef struct _pdfpcTimerLabelPrivate pdfpcTimerLabelPrivate; #define _g_free0(var) (var = (g_free (var), NULL)) typedef struct _pdfpcCountdownTimerPrivate pdfpcCountdownTimerPrivate; typedef struct _pdfpcEndTimeTimerPrivate pdfpcEndTimeTimerPrivate; typedef struct _pdfpcCountupTimerPrivate pdfpcCountupTimerPrivate; struct _pdfpcTimerLabel { GtkLabel parent_instance; pdfpcTimerLabelPrivate * priv; gint time; time_t start_time; guint timeout; GdkColor normal_color; GdkColor pretalk_color; }; struct _pdfpcTimerLabelClass { GtkLabelClass parent_class; void (*start) (pdfpcTimerLabel* self); void (*stop) (pdfpcTimerLabel* self); void (*reset) (pdfpcTimerLabel* self); gboolean (*on_timeout) (pdfpcTimerLabel* self); void (*format_time) (pdfpcTimerLabel* self); }; struct _pdfpcCountdownTimer { pdfpcTimerLabel parent_instance; pdfpcCountdownTimerPrivate * priv; gint duration; guint last_minutes; GdkColor last_minutes_color; GdkColor negative_color; }; struct _pdfpcCountdownTimerClass { pdfpcTimerLabelClass parent_class; }; struct _pdfpcEndTimeTimer { pdfpcCountdownTimer parent_instance; pdfpcEndTimeTimerPrivate * priv; time_t end_time; struct tm end_time_object; }; struct _pdfpcEndTimeTimerClass { pdfpcCountdownTimerClass parent_class; }; struct _pdfpcCountupTimer { pdfpcTimerLabel parent_instance; pdfpcCountupTimerPrivate * priv; }; struct _pdfpcCountupTimerClass { pdfpcTimerLabelClass parent_class; }; static gpointer pdfpc_timer_label_parent_class = NULL; static gpointer pdfpc_countdown_timer_parent_class = NULL; static gpointer pdfpc_end_time_timer_parent_class = NULL; static gpointer pdfpc_countup_timer_parent_class = NULL; GType pdfpc_timer_label_get_type (void) G_GNUC_CONST; pdfpcTimerLabel* pdfpc_getTimerLabel (gint duration, time_t end_time, guint last_minutes, time_t start_time); pdfpcEndTimeTimer* pdfpc_end_time_timer_new (time_t end_time, guint last_minutes, time_t start_time); pdfpcEndTimeTimer* pdfpc_end_time_timer_construct (GType object_type, time_t end_time, guint last_minutes, time_t start_time); GType pdfpc_countdown_timer_get_type (void) G_GNUC_CONST; GType pdfpc_end_time_timer_get_type (void) G_GNUC_CONST; pdfpcCountdownTimer* pdfpc_countdown_timer_new (gint duration, guint last_minutes, time_t start_time); pdfpcCountdownTimer* pdfpc_countdown_timer_construct (GType object_type, gint duration, guint last_minutes, time_t start_time); pdfpcCountupTimer* pdfpc_countup_timer_new (time_t start_time); pdfpcCountupTimer* pdfpc_countup_timer_construct (GType object_type, time_t start_time); GType pdfpc_countup_timer_get_type (void) G_GNUC_CONST; enum { PDFPC_TIMER_LABEL_DUMMY_PROPERTY }; pdfpcTimerLabel* pdfpc_timer_label_construct (GType object_type, time_t start_time); void pdfpc_timer_label_start (pdfpcTimerLabel* self); static void pdfpc_timer_label_real_start (pdfpcTimerLabel* self); gboolean pdfpc_timer_label_on_timeout (pdfpcTimerLabel* self); static gboolean _pdfpc_timer_label_on_timeout_gsource_func (gpointer self); void pdfpc_timer_label_stop (pdfpcTimerLabel* self); static void pdfpc_timer_label_real_stop (pdfpcTimerLabel* self); gboolean pdfpc_timer_label_pause (pdfpcTimerLabel* self); gboolean pdfpc_timer_label_is_paused (pdfpcTimerLabel* self); void pdfpc_timer_label_reset (pdfpcTimerLabel* self); static void pdfpc_timer_label_real_reset (pdfpcTimerLabel* self); gint pdfpc_timer_label_calculate_countdown (pdfpcTimerLabel* self); void pdfpc_timer_label_format_time (pdfpcTimerLabel* self); static gboolean pdfpc_timer_label_real_on_timeout (pdfpcTimerLabel* self); static void pdfpc_timer_label_real_format_time (pdfpcTimerLabel* self); void pdfpc_timer_label_show_time (pdfpcTimerLabel* self, guint timeInSecs, const gchar* prefix); static void pdfpc_timer_label_finalize (GObject* obj); enum { PDFPC_COUNTDOWN_TIMER_DUMMY_PROPERTY }; static void pdfpc_countdown_timer_real_format_time (pdfpcTimerLabel* base); static void pdfpc_countdown_timer_finalize (GObject* obj); enum { PDFPC_END_TIME_TIMER_DUMMY_PROPERTY }; static void pdfpc_end_time_timer_real_start (pdfpcTimerLabel* base); static void pdfpc_end_time_timer_real_stop (pdfpcTimerLabel* base); static void pdfpc_end_time_timer_real_reset (pdfpcTimerLabel* base); static gboolean pdfpc_end_time_timer_real_on_timeout (pdfpcTimerLabel* base); static void pdfpc_end_time_timer_finalize (GObject* obj); enum { PDFPC_COUNTUP_TIMER_DUMMY_PROPERTY }; static void pdfpc_countup_timer_real_format_time (pdfpcTimerLabel* base); /** * Factory function for creating TimerLabels, depending if a duration was * given. */ pdfpcTimerLabel* pdfpc_getTimerLabel (gint duration, time_t end_time, guint last_minutes, time_t start_time) { pdfpcTimerLabel* result = NULL; time_t _tmp0_; _tmp0_ = end_time; if (_tmp0_ > ((time_t) 0)) { time_t _tmp1_; guint _tmp2_; time_t _tmp3_; pdfpcEndTimeTimer* _tmp4_; pdfpcTimerLabel* _tmp5_; _tmp1_ = end_time; _tmp2_ = last_minutes; _tmp3_ = start_time; _tmp4_ = pdfpc_end_time_timer_new (_tmp1_, _tmp2_, _tmp3_); _tmp5_ = (pdfpcTimerLabel*) g_object_ref_sink (_tmp4_); result = _tmp5_; return result; } else { gint _tmp6_; _tmp6_ = duration; if (_tmp6_ > 0) { gint _tmp7_; guint _tmp8_; time_t _tmp9_; pdfpcCountdownTimer* _tmp10_; pdfpcTimerLabel* _tmp11_; _tmp7_ = duration; _tmp8_ = last_minutes; _tmp9_ = start_time; _tmp10_ = pdfpc_countdown_timer_new (_tmp7_, _tmp8_, _tmp9_); _tmp11_ = (pdfpcTimerLabel*) g_object_ref_sink (_tmp10_); result = _tmp11_; return result; } else { time_t _tmp12_; pdfpcCountupTimer* _tmp13_; pdfpcTimerLabel* _tmp14_; _tmp12_ = start_time; _tmp13_ = pdfpc_countup_timer_new (_tmp12_); _tmp14_ = (pdfpcTimerLabel*) g_object_ref_sink (_tmp13_); result = _tmp14_; return result; } } } /** * Default constructor taking the initial time as argument, as well as * the time to countdown until the talk actually starts. * * The second argument is optional. If no countdown_time is specified * the countdown will be disabled. The timer is paused in such a case * at the given intial_time. */ pdfpcTimerLabel* pdfpc_timer_label_construct (GType object_type, time_t start_time) { pdfpcTimerLabel * self = NULL; time_t _tmp0_; GdkColor _tmp1_ = {0}; GdkColor _tmp2_ = {0}; self = (pdfpcTimerLabel*) g_object_new (object_type, NULL); _tmp0_ = start_time; self->start_time = _tmp0_; gdk_color_parse ("white", &_tmp1_); self->normal_color = _tmp1_; gdk_color_parse ("green", &_tmp2_); self->pretalk_color = _tmp2_; return self; } /** * Start the timer */ static gboolean _pdfpc_timer_label_on_timeout_gsource_func (gpointer self) { gboolean result; result = pdfpc_timer_label_on_timeout (self); return result; } static void pdfpc_timer_label_real_start (pdfpcTimerLabel* self) { gboolean _tmp0_ = FALSE; guint _tmp1_; gboolean _tmp3_; _tmp1_ = self->timeout; if (_tmp1_ != ((guint) 0)) { gint _tmp2_; _tmp2_ = self->time; _tmp0_ = _tmp2_ < 0; } else { _tmp0_ = FALSE; } _tmp3_ = _tmp0_; if (_tmp3_) { self->time = 0; } else { guint _tmp4_; _tmp4_ = self->timeout; if (_tmp4_ == ((guint) 0)) { guint _tmp5_ = 0U; _tmp5_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 1000, _pdfpc_timer_label_on_timeout_gsource_func, g_object_ref (self), g_object_unref); self->timeout = _tmp5_; } } } void pdfpc_timer_label_start (pdfpcTimerLabel* self) { g_return_if_fail (self != NULL); PDFPC_TIMER_LABEL_GET_CLASS (self)->start (self); } /** * Stop the timer */ static void pdfpc_timer_label_real_stop (pdfpcTimerLabel* self) { guint _tmp0_; _tmp0_ = self->timeout; if (_tmp0_ != ((guint) 0)) { guint _tmp1_; _tmp1_ = self->timeout; g_source_remove (_tmp1_); self->timeout = (guint) 0; } } void pdfpc_timer_label_stop (pdfpcTimerLabel* self) { g_return_if_fail (self != NULL); PDFPC_TIMER_LABEL_GET_CLASS (self)->stop (self); } /** * Pauses the timer if it's running. Returns if the timer is paused. */ gboolean pdfpc_timer_label_pause (pdfpcTimerLabel* self) { gboolean result = FALSE; gboolean paused; gint _tmp0_; g_return_val_if_fail (self != NULL, FALSE); paused = FALSE; _tmp0_ = self->time; if (_tmp0_ > 0) { guint _tmp1_; _tmp1_ = self->timeout; if (_tmp1_ != ((guint) 0)) { pdfpc_timer_label_stop (self); paused = TRUE; } else { pdfpc_timer_label_start (self); } } result = paused; return result; } /** * Returns if the timer is paused */ gboolean pdfpc_timer_label_is_paused (pdfpcTimerLabel* self) { gboolean result = FALSE; gboolean _tmp0_ = FALSE; gint _tmp1_; gboolean _tmp3_; g_return_val_if_fail (self != NULL, FALSE); _tmp1_ = self->time; if (_tmp1_ > 0) { guint _tmp2_; _tmp2_ = self->timeout; _tmp0_ = _tmp2_ == ((guint) 0); } else { _tmp0_ = FALSE; } _tmp3_ = _tmp0_; result = _tmp3_; return result; } /** * Reset the timer to its initial value * * Furthermore the stop state will be restored * If the countdown is running the countdown value is recalculated. The * timer is not stopped in such situation. * * In presentation mode the time will be reset to the initial * presentation time. */ static void pdfpc_timer_label_real_reset (pdfpcTimerLabel* self) { gint _tmp0_ = 0; gint _tmp1_; pdfpc_timer_label_stop (self); _tmp0_ = pdfpc_timer_label_calculate_countdown (self); self->time = _tmp0_; _tmp1_ = self->time; if (_tmp1_ < 0) { pdfpc_timer_label_start (self); } else { self->time = 0; } pdfpc_timer_label_format_time (self); } void pdfpc_timer_label_reset (pdfpcTimerLabel* self) { g_return_if_fail (self != NULL); PDFPC_TIMER_LABEL_GET_CLASS (self)->reset (self); } /** * Calculate and return the countdown time in (negative) seconds until * the talk begins. */ static void g_time_local (time_t time, struct tm* result) { struct tm _result_ = {0}; struct tm _tmp0_ = {0}; localtime_r (&time, &_tmp0_); _result_ = _tmp0_; *result = _result_; return; } gint pdfpc_timer_label_calculate_countdown (pdfpcTimerLabel* self) { gint result = 0; time_t _tmp0_; struct tm _tmp1_ = {0}; time_t _tmp2_ = 0; time_t now; time_t _tmp3_; g_return_val_if_fail (self != NULL, 0); _tmp0_ = time (NULL); g_time_local (_tmp0_, &_tmp1_); _tmp2_ = mktime (&_tmp1_); now = _tmp2_; _tmp3_ = self->start_time; result = (gint) (now - _tmp3_); return result; } /** * Update the timer on every timeout step (every second) */ static gboolean pdfpc_timer_label_real_on_timeout (pdfpcTimerLabel* self) { gboolean result = FALSE; gint _tmp0_; _tmp0_ = self->time; self->time = _tmp0_ + 1; pdfpc_timer_label_format_time (self); result = TRUE; return result; } gboolean pdfpc_timer_label_on_timeout (pdfpcTimerLabel* self) { g_return_val_if_fail (self != NULL, FALSE); return PDFPC_TIMER_LABEL_GET_CLASS (self)->on_timeout (self); } /** * Shows the corresponding time */ static void pdfpc_timer_label_real_format_time (pdfpcTimerLabel* self) { g_critical ("Type `%s' does not implement abstract method `pdfpc_timer_label_format_time'", g_type_name (G_TYPE_FROM_INSTANCE (self))); return; } void pdfpc_timer_label_format_time (pdfpcTimerLabel* self) { g_return_if_fail (self != NULL); PDFPC_TIMER_LABEL_GET_CLASS (self)->format_time (self); } /** * Shows a time (in seconds) in hh:mm:ss format, with an additional prefix */ void pdfpc_timer_label_show_time (pdfpcTimerLabel* self, guint timeInSecs, const gchar* prefix) { guint hours = 0U; guint minutes = 0U; guint seconds = 0U; guint _tmp0_; guint _tmp1_; guint _tmp2_; const gchar* _tmp3_; gchar* _tmp4_ = NULL; gchar* _tmp5_; g_return_if_fail (self != NULL); g_return_if_fail (prefix != NULL); _tmp0_ = timeInSecs; hours = (_tmp0_ / 60) / 60; _tmp1_ = timeInSecs; minutes = (_tmp1_ / 60) % 60; _tmp2_ = timeInSecs; seconds = (_tmp2_ % 60) % 60; _tmp3_ = prefix; _tmp4_ = g_strdup_printf ("%s%.2u:%.2u:%.2u", _tmp3_, hours, minutes, seconds); _tmp5_ = _tmp4_; gtk_label_set_text ((GtkLabel*) self, _tmp5_); _g_free0 (_tmp5_); } static void pdfpc_timer_label_class_init (pdfpcTimerLabelClass * klass) { pdfpc_timer_label_parent_class = g_type_class_peek_parent (klass); PDFPC_TIMER_LABEL_CLASS (klass)->start = pdfpc_timer_label_real_start; PDFPC_TIMER_LABEL_CLASS (klass)->stop = pdfpc_timer_label_real_stop; PDFPC_TIMER_LABEL_CLASS (klass)->reset = pdfpc_timer_label_real_reset; PDFPC_TIMER_LABEL_CLASS (klass)->on_timeout = pdfpc_timer_label_real_on_timeout; PDFPC_TIMER_LABEL_CLASS (klass)->format_time = pdfpc_timer_label_real_format_time; G_OBJECT_CLASS (klass)->finalize = pdfpc_timer_label_finalize; } static void pdfpc_timer_label_instance_init (pdfpcTimerLabel * self) { self->time = 0; self->start_time = (time_t) 0; self->timeout = (guint) 0; } static void pdfpc_timer_label_finalize (GObject* obj) { pdfpcTimerLabel * self; self = PDFPC_TIMER_LABEL (obj); G_OBJECT_CLASS (pdfpc_timer_label_parent_class)->finalize (obj); } /** * Specialized label, which is capable of easily displaying a timer */ GType pdfpc_timer_label_get_type (void) { static volatile gsize pdfpc_timer_label_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_timer_label_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcTimerLabelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_timer_label_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcTimerLabel), 0, (GInstanceInitFunc) pdfpc_timer_label_instance_init, NULL }; GType pdfpc_timer_label_type_id; pdfpc_timer_label_type_id = g_type_register_static (GTK_TYPE_LABEL, "pdfpcTimerLabel", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); g_once_init_leave (&pdfpc_timer_label_type_id__volatile, pdfpc_timer_label_type_id); } return pdfpc_timer_label_type_id__volatile; } pdfpcCountdownTimer* pdfpc_countdown_timer_construct (GType object_type, gint duration, guint last_minutes, time_t start_time) { pdfpcCountdownTimer * self = NULL; time_t _tmp0_; gint _tmp1_; guint _tmp2_; GdkColor _tmp3_ = {0}; GdkColor _tmp4_ = {0}; _tmp0_ = start_time; self = (pdfpcCountdownTimer*) pdfpc_timer_label_construct (object_type, _tmp0_); _tmp1_ = duration; self->duration = _tmp1_; _tmp2_ = last_minutes; self->last_minutes = _tmp2_; gdk_color_parse ("orange", &_tmp3_); self->last_minutes_color = _tmp3_; gdk_color_parse ("red", &_tmp4_); self->negative_color = _tmp4_; return self; } pdfpcCountdownTimer* pdfpc_countdown_timer_new (gint duration, guint last_minutes, time_t start_time) { return pdfpc_countdown_timer_construct (PDFPC_TYPE_COUNTDOWN_TIMER, duration, last_minutes, start_time); } /** * Format the given time in a readable hh:mm:ss way and update the * label text */ static void pdfpc_countdown_timer_real_format_time (pdfpcTimerLabel* base) { pdfpcCountdownTimer * self; guint timeInSecs = 0U; gchar* _tmp0_; gchar* prefix; gint _tmp1_; guint _tmp17_; const gchar* _tmp18_; self = (pdfpcCountdownTimer*) base; _tmp0_ = g_strdup (""); prefix = _tmp0_; _tmp1_ = ((pdfpcTimerLabel*) self)->time; if (_tmp1_ < 0) { gchar* _tmp2_; gint _tmp3_; GdkColor _tmp4_; _tmp2_ = g_strdup ("-"); _g_free0 (prefix); prefix = _tmp2_; _tmp3_ = ((pdfpcTimerLabel*) self)->time; timeInSecs = (guint) (-_tmp3_); _tmp4_ = ((pdfpcTimerLabel*) self)->pretalk_color; gtk_widget_modify_fg ((GtkWidget*) self, GTK_STATE_NORMAL, &_tmp4_); } else { gint _tmp5_; gint _tmp6_; _tmp5_ = ((pdfpcTimerLabel*) self)->time; _tmp6_ = self->duration; if (_tmp5_ < _tmp6_) { gint _tmp7_; gint _tmp8_; guint _tmp9_; guint _tmp10_; _tmp7_ = self->duration; _tmp8_ = ((pdfpcTimerLabel*) self)->time; timeInSecs = (guint) (_tmp7_ - _tmp8_); _tmp9_ = timeInSecs; _tmp10_ = self->last_minutes; if (_tmp9_ < (_tmp10_ * 60)) { GdkColor _tmp11_; _tmp11_ = self->last_minutes_color; gtk_widget_modify_fg ((GtkWidget*) self, GTK_STATE_NORMAL, &_tmp11_); } else { GdkColor _tmp12_; _tmp12_ = ((pdfpcTimerLabel*) self)->normal_color; gtk_widget_modify_fg ((GtkWidget*) self, GTK_STATE_NORMAL, &_tmp12_); } } else { GdkColor _tmp13_; gint _tmp14_; gint _tmp15_; gchar* _tmp16_; _tmp13_ = self->negative_color; gtk_widget_modify_fg ((GtkWidget*) self, GTK_STATE_NORMAL, &_tmp13_); _tmp14_ = ((pdfpcTimerLabel*) self)->time; _tmp15_ = self->duration; timeInSecs = (guint) (_tmp14_ - _tmp15_); _tmp16_ = g_strdup ("-"); _g_free0 (prefix); prefix = _tmp16_; } } _tmp17_ = timeInSecs; _tmp18_ = prefix; pdfpc_timer_label_show_time ((pdfpcTimerLabel*) self, _tmp17_, _tmp18_); _g_free0 (prefix); } static void pdfpc_countdown_timer_class_init (pdfpcCountdownTimerClass * klass) { pdfpc_countdown_timer_parent_class = g_type_class_peek_parent (klass); PDFPC_TIMER_LABEL_CLASS (klass)->format_time = pdfpc_countdown_timer_real_format_time; G_OBJECT_CLASS (klass)->finalize = pdfpc_countdown_timer_finalize; } static void pdfpc_countdown_timer_instance_init (pdfpcCountdownTimer * self) { self->last_minutes = (guint) 5; } static void pdfpc_countdown_timer_finalize (GObject* obj) { pdfpcCountdownTimer * self; self = PDFPC_COUNTDOWN_TIMER (obj); G_OBJECT_CLASS (pdfpc_countdown_timer_parent_class)->finalize (obj); } GType pdfpc_countdown_timer_get_type (void) { static volatile gsize pdfpc_countdown_timer_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_countdown_timer_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcCountdownTimerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_countdown_timer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcCountdownTimer), 0, (GInstanceInitFunc) pdfpc_countdown_timer_instance_init, NULL }; GType pdfpc_countdown_timer_type_id; pdfpc_countdown_timer_type_id = g_type_register_static (PDFPC_TYPE_TIMER_LABEL, "pdfpcCountdownTimer", &g_define_type_info, 0); g_once_init_leave (&pdfpc_countdown_timer_type_id__volatile, pdfpc_countdown_timer_type_id); } return pdfpc_countdown_timer_type_id__volatile; } pdfpcEndTimeTimer* pdfpc_end_time_timer_construct (GType object_type, time_t end_time, guint last_minutes, time_t start_time) { pdfpcEndTimeTimer * self = NULL; guint _tmp0_; time_t _tmp1_; time_t _tmp2_; time_t _tmp3_; struct tm _tmp4_ = {0}; _tmp0_ = last_minutes; _tmp1_ = start_time; self = (pdfpcEndTimeTimer*) pdfpc_countdown_timer_construct (object_type, 1000, _tmp0_, _tmp1_); _tmp2_ = end_time; self->end_time = _tmp2_; _tmp3_ = end_time; g_time_local (_tmp3_, &_tmp4_); self->end_time_object = _tmp4_; return self; } pdfpcEndTimeTimer* pdfpc_end_time_timer_new (time_t end_time, guint last_minutes, time_t start_time) { return pdfpc_end_time_timer_construct (PDFPC_TYPE_END_TIME_TIMER, end_time, last_minutes, start_time); } static void pdfpc_end_time_timer_real_start (pdfpcTimerLabel* base) { pdfpcEndTimeTimer * self; time_t _tmp0_; struct tm _tmp1_ = {0}; time_t _tmp2_ = 0; time_t now; time_t _tmp3_; self = (pdfpcEndTimeTimer*) base; _tmp0_ = time (NULL); g_time_local (_tmp0_, &_tmp1_); _tmp2_ = mktime (&_tmp1_); now = _tmp2_; _tmp3_ = self->end_time; ((pdfpcCountdownTimer*) self)->duration = (gint) (_tmp3_ - now); PDFPC_TIMER_LABEL_CLASS (pdfpc_end_time_timer_parent_class)->start ((pdfpcTimerLabel*) PDFPC_COUNTDOWN_TIMER (self)); } static gchar* g_time_format (struct tm *self, const gchar* format) { gchar* result = NULL; gchar* _tmp0_ = NULL; gchar* buffer; gint buffer_length1; gint _buffer_size_; gchar* _tmp1_; gint _tmp1__length1; const gchar* _tmp2_; gchar* _tmp3_; gint _tmp3__length1; gchar* _tmp4_; g_return_val_if_fail (format != NULL, NULL); _tmp0_ = g_new0 (gchar, 64); buffer = _tmp0_; buffer_length1 = 64; _buffer_size_ = buffer_length1; _tmp1_ = buffer; _tmp1__length1 = buffer_length1; _tmp2_ = format; strftime (_tmp1_, _tmp1__length1, _tmp2_, &(*self)); _tmp3_ = buffer; _tmp3__length1 = buffer_length1; _tmp4_ = g_strdup ((const gchar*) _tmp3_); result = _tmp4_; buffer = (g_free (buffer), NULL); return result; } static void pdfpc_end_time_timer_real_stop (pdfpcTimerLabel* base) { pdfpcEndTimeTimer * self; gchar* _tmp0_ = NULL; gchar* _tmp1_; self = (pdfpcEndTimeTimer*) base; PDFPC_TIMER_LABEL_CLASS (pdfpc_end_time_timer_parent_class)->stop ((pdfpcTimerLabel*) PDFPC_COUNTDOWN_TIMER (self)); _tmp0_ = g_time_format (&self->end_time_object, "Until %H:%M"); _tmp1_ = _tmp0_; gtk_label_set_text ((GtkLabel*) self, _tmp1_); _g_free0 (_tmp1_); } static void pdfpc_end_time_timer_real_reset (pdfpcTimerLabel* base) { pdfpcEndTimeTimer * self; guint _tmp0_; self = (pdfpcEndTimeTimer*) base; PDFPC_TIMER_LABEL_CLASS (pdfpc_end_time_timer_parent_class)->reset ((pdfpcTimerLabel*) PDFPC_COUNTDOWN_TIMER (self)); _tmp0_ = ((pdfpcTimerLabel*) self)->timeout; if (_tmp0_ == ((guint) 0)) { gchar* _tmp1_ = NULL; gchar* _tmp2_; _tmp1_ = g_time_format (&self->end_time_object, "Until %H:%M"); _tmp2_ = _tmp1_; gtk_label_set_text ((GtkLabel*) self, _tmp2_); _g_free0 (_tmp2_); } } static gboolean pdfpc_end_time_timer_real_on_timeout (pdfpcTimerLabel* base) { pdfpcEndTimeTimer * self; gboolean result = FALSE; gint _tmp0_; gboolean _tmp6_ = FALSE; self = (pdfpcEndTimeTimer*) base; _tmp0_ = ((pdfpcTimerLabel*) self)->time; if (_tmp0_ == (-1)) { time_t _tmp1_; struct tm _tmp2_ = {0}; time_t _tmp3_ = 0; time_t now; time_t _tmp4_; time_t _tmp5_; _tmp1_ = time (NULL); g_time_local (_tmp1_, &_tmp2_); _tmp3_ = mktime (&_tmp2_); now = _tmp3_; _tmp4_ = self->end_time; _tmp5_ = now; ((pdfpcCountdownTimer*) self)->duration = (gint) (_tmp4_ - _tmp5_); } _tmp6_ = PDFPC_TIMER_LABEL_CLASS (pdfpc_end_time_timer_parent_class)->on_timeout ((pdfpcTimerLabel*) PDFPC_COUNTDOWN_TIMER (self)); result = _tmp6_; return result; } static void pdfpc_end_time_timer_class_init (pdfpcEndTimeTimerClass * klass) { pdfpc_end_time_timer_parent_class = g_type_class_peek_parent (klass); PDFPC_TIMER_LABEL_CLASS (klass)->start = pdfpc_end_time_timer_real_start; PDFPC_TIMER_LABEL_CLASS (klass)->stop = pdfpc_end_time_timer_real_stop; PDFPC_TIMER_LABEL_CLASS (klass)->reset = pdfpc_end_time_timer_real_reset; PDFPC_TIMER_LABEL_CLASS (klass)->on_timeout = pdfpc_end_time_timer_real_on_timeout; G_OBJECT_CLASS (klass)->finalize = pdfpc_end_time_timer_finalize; } static void pdfpc_end_time_timer_instance_init (pdfpcEndTimeTimer * self) { } static void pdfpc_end_time_timer_finalize (GObject* obj) { pdfpcEndTimeTimer * self; self = PDFPC_END_TIME_TIMER (obj); G_OBJECT_CLASS (pdfpc_end_time_timer_parent_class)->finalize (obj); } GType pdfpc_end_time_timer_get_type (void) { static volatile gsize pdfpc_end_time_timer_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_end_time_timer_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcEndTimeTimerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_end_time_timer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcEndTimeTimer), 0, (GInstanceInitFunc) pdfpc_end_time_timer_instance_init, NULL }; GType pdfpc_end_time_timer_type_id; pdfpc_end_time_timer_type_id = g_type_register_static (PDFPC_TYPE_COUNTDOWN_TIMER, "pdfpcEndTimeTimer", &g_define_type_info, 0); g_once_init_leave (&pdfpc_end_time_timer_type_id__volatile, pdfpc_end_time_timer_type_id); } return pdfpc_end_time_timer_type_id__volatile; } pdfpcCountupTimer* pdfpc_countup_timer_construct (GType object_type, time_t start_time) { pdfpcCountupTimer * self = NULL; time_t _tmp0_; _tmp0_ = start_time; self = (pdfpcCountupTimer*) pdfpc_timer_label_construct (object_type, _tmp0_); return self; } pdfpcCountupTimer* pdfpc_countup_timer_new (time_t start_time) { return pdfpc_countup_timer_construct (PDFPC_TYPE_COUNTUP_TIMER, start_time); } /** * Format the given time in a readable hh:mm:ss way and update the * label text */ static void pdfpc_countup_timer_real_format_time (pdfpcTimerLabel* base) { pdfpcCountupTimer * self; guint timeInSecs = 0U; gchar* _tmp0_; gchar* prefix; gint _tmp1_; guint _tmp7_; const gchar* _tmp8_; self = (pdfpcCountupTimer*) base; _tmp0_ = g_strdup (""); prefix = _tmp0_; _tmp1_ = ((pdfpcTimerLabel*) self)->time; if (_tmp1_ < 0) { gchar* _tmp2_; gint _tmp3_; GdkColor _tmp4_; _tmp2_ = g_strdup ("-"); _g_free0 (prefix); prefix = _tmp2_; _tmp3_ = ((pdfpcTimerLabel*) self)->time; timeInSecs = (guint) (-_tmp3_); _tmp4_ = ((pdfpcTimerLabel*) self)->pretalk_color; gtk_widget_modify_fg ((GtkWidget*) self, GTK_STATE_NORMAL, &_tmp4_); } else { gint _tmp5_; GdkColor _tmp6_; _tmp5_ = ((pdfpcTimerLabel*) self)->time; timeInSecs = (guint) _tmp5_; _tmp6_ = ((pdfpcTimerLabel*) self)->normal_color; gtk_widget_modify_fg ((GtkWidget*) self, GTK_STATE_NORMAL, &_tmp6_); } _tmp7_ = timeInSecs; _tmp8_ = prefix; pdfpc_timer_label_show_time ((pdfpcTimerLabel*) self, _tmp7_, _tmp8_); _g_free0 (prefix); } static void pdfpc_countup_timer_class_init (pdfpcCountupTimerClass * klass) { pdfpc_countup_timer_parent_class = g_type_class_peek_parent (klass); PDFPC_TIMER_LABEL_CLASS (klass)->format_time = pdfpc_countup_timer_real_format_time; } static void pdfpc_countup_timer_instance_init (pdfpcCountupTimer * self) { } GType pdfpc_countup_timer_get_type (void) { static volatile gsize pdfpc_countup_timer_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_countup_timer_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcCountupTimerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_countup_timer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcCountupTimer), 0, (GInstanceInitFunc) pdfpc_countup_timer_instance_init, NULL }; GType pdfpc_countup_timer_type_id; pdfpc_countup_timer_type_id = g_type_register_static (PDFPC_TYPE_TIMER_LABEL, "pdfpcCountupTimer", &g_define_type_info, 0); g_once_init_leave (&pdfpc_countup_timer_type_id__volatile, pdfpc_countup_timer_type_id); } return pdfpc_countup_timer_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/view/000077500000000000000000000000001177613036100200455ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/classes/view/base.c000066400000000000000000000237071177613036100211340ustar00rootroot00000000000000/* base.c generated by valac 0.16.0, the Vala compiler * generated from base.vala, do not modify */ #include #include #include #define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ()) #define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase)) #define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) #define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) typedef struct _pdfpcViewBase pdfpcViewBase; typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass; typedef struct _pdfpcViewBasePrivate pdfpcViewBasePrivate; #define PDFPC_RENDERER_TYPE_BASE (pdfpc_renderer_base_get_type ()) #define PDFPC_RENDERER_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBase)) #define PDFPC_RENDERER_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) #define PDFPC_RENDERER_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) typedef struct _pdfpcRendererBase pdfpcRendererBase; typedef struct _pdfpcRendererBaseClass pdfpcRendererBaseClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) typedef enum { PDFPC_RENDERER_RENDER_ERROR_SLIDE_DOES_NOT_EXIST } pdfpcRendererRenderError; #define PDFPC_RENDERER_RENDER_ERROR pdfpc_renderer_render_error_quark () struct _pdfpcViewBase { GtkDrawingArea parent_instance; pdfpcViewBasePrivate * priv; pdfpcRendererBase* renderer; }; struct _pdfpcViewBaseClass { GtkDrawingAreaClass parent_class; void (*display) (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); void (*fade_to_black) (pdfpcViewBase* self); void (*redraw) (pdfpcViewBase* self, GError** error); gint (*get_current_slide_number) (pdfpcViewBase* self); }; static gpointer pdfpc_view_base_parent_class = NULL; GType pdfpc_view_base_get_type (void) G_GNUC_CONST; GQuark pdfpc_renderer_render_error_quark (void); GType pdfpc_renderer_base_get_type (void) G_GNUC_CONST; enum { PDFPC_VIEW_BASE_DUMMY_PROPERTY }; pdfpcViewBase* pdfpc_view_base_construct (GType object_type, pdfpcRendererBase* renderer); gint pdfpc_renderer_base_get_width (pdfpcRendererBase* self); gint pdfpc_renderer_base_get_height (pdfpcRendererBase* self); pdfpcRendererBase* pdfpc_view_base_get_renderer (pdfpcViewBase* self); void pdfpc_view_base_display (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); static void pdfpc_view_base_real_display (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); void pdfpc_view_base_fade_to_black (pdfpcViewBase* self); static void pdfpc_view_base_real_fade_to_black (pdfpcViewBase* self); void pdfpc_view_base_redraw (pdfpcViewBase* self, GError** error); static void pdfpc_view_base_real_redraw (pdfpcViewBase* self, GError** error); gint pdfpc_view_base_get_current_slide_number (pdfpcViewBase* self); static gint pdfpc_view_base_real_get_current_slide_number (pdfpcViewBase* self); static void g_cclosure_user_marshal_VOID__INT_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); static void pdfpc_view_base_finalize (GObject* obj); /** * Base constructor taking the renderer to use as an argument */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } pdfpcViewBase* pdfpc_view_base_construct (GType object_type, pdfpcRendererBase* renderer) { pdfpcViewBase * self = NULL; pdfpcRendererBase* _tmp0_; pdfpcRendererBase* _tmp1_; pdfpcRendererBase* _tmp2_; gint _tmp3_ = 0; pdfpcRendererBase* _tmp4_; gint _tmp5_ = 0; g_return_val_if_fail (renderer != NULL, NULL); self = (pdfpcViewBase*) g_object_new (object_type, NULL); _tmp0_ = renderer; _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->renderer); self->renderer = _tmp1_; _tmp2_ = renderer; _tmp3_ = pdfpc_renderer_base_get_width (_tmp2_); _tmp4_ = renderer; _tmp5_ = pdfpc_renderer_base_get_height (_tmp4_); gtk_widget_set_size_request ((GtkWidget*) self, _tmp3_, _tmp5_); return self; } /** * Return the used renderer object */ pdfpcRendererBase* pdfpc_view_base_get_renderer (pdfpcViewBase* self) { pdfpcRendererBase* result = NULL; pdfpcRendererBase* _tmp0_; pdfpcRendererBase* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->renderer; _tmp1_ = _g_object_ref0 (_tmp0_); result = _tmp1_; return result; } /** * Display a specific slide * * If the slide number does not exist a RenderError.SLIDE_DOES_NOT_EXIST is thrown */ static void pdfpc_view_base_real_display (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error) { g_critical ("Type `%s' does not implement abstract method `pdfpc_view_base_display'", g_type_name (G_TYPE_FROM_INSTANCE (self))); return; } void pdfpc_view_base_display (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error) { g_return_if_fail (self != NULL); PDFPC_VIEW_BASE_GET_CLASS (self)->display (self, slide_number, force_redraw, error); } /** * Make the screen black. Useful for presentations together with a whiteboard */ static void pdfpc_view_base_real_fade_to_black (pdfpcViewBase* self) { g_critical ("Type `%s' does not implement abstract method `pdfpc_view_base_fade_to_black'", g_type_name (G_TYPE_FROM_INSTANCE (self))); return; } void pdfpc_view_base_fade_to_black (pdfpcViewBase* self) { g_return_if_fail (self != NULL); PDFPC_VIEW_BASE_GET_CLASS (self)->fade_to_black (self); } /** * Redraw the current slide. Useful for example when exiting from fade_to_black */ static void pdfpc_view_base_real_redraw (pdfpcViewBase* self, GError** error) { g_critical ("Type `%s' does not implement abstract method `pdfpc_view_base_redraw'", g_type_name (G_TYPE_FROM_INSTANCE (self))); return; } void pdfpc_view_base_redraw (pdfpcViewBase* self, GError** error) { g_return_if_fail (self != NULL); PDFPC_VIEW_BASE_GET_CLASS (self)->redraw (self, error); } /** * Return the currently shown slide number */ static gint pdfpc_view_base_real_get_current_slide_number (pdfpcViewBase* self) { g_critical ("Type `%s' does not implement abstract method `pdfpc_view_base_get_current_slide_number'", g_type_name (G_TYPE_FROM_INSTANCE (self))); return 0; } gint pdfpc_view_base_get_current_slide_number (pdfpcViewBase* self) { g_return_val_if_fail (self != NULL, 0); return PDFPC_VIEW_BASE_GET_CLASS (self)->get_current_slide_number (self); } static void g_cclosure_user_marshal_VOID__INT_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1, gint arg_1, gint arg_2, gpointer data2); register GMarshalFunc_VOID__INT_INT callback; register GCClosure * cc; register gpointer data1; register gpointer data2; cc = (GCClosure *) closure; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = param_values->data[0].v_pointer; } else { data1 = param_values->data[0].v_pointer; data2 = closure->data; } callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback); callback (data1, g_value_get_int (param_values + 1), g_value_get_int (param_values + 2), data2); } static void pdfpc_view_base_class_init (pdfpcViewBaseClass * klass) { pdfpc_view_base_parent_class = g_type_class_peek_parent (klass); PDFPC_VIEW_BASE_CLASS (klass)->display = pdfpc_view_base_real_display; PDFPC_VIEW_BASE_CLASS (klass)->fade_to_black = pdfpc_view_base_real_fade_to_black; PDFPC_VIEW_BASE_CLASS (klass)->redraw = pdfpc_view_base_real_redraw; PDFPC_VIEW_BASE_CLASS (klass)->get_current_slide_number = pdfpc_view_base_real_get_current_slide_number; G_OBJECT_CLASS (klass)->finalize = pdfpc_view_base_finalize; /** * Signal fired every time a slide is about to be left */ g_signal_new ("leaving_slide", PDFPC_VIEW_TYPE_BASE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); /** * Signal fired every time a slide is entered */ g_signal_new ("entering_slide", PDFPC_VIEW_TYPE_BASE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); } static void pdfpc_view_base_instance_init (pdfpcViewBase * self) { } static void pdfpc_view_base_finalize (GObject* obj) { pdfpcViewBase * self; self = PDFPC_VIEW_BASE (obj); _g_object_unref0 (self->renderer); G_OBJECT_CLASS (pdfpc_view_base_parent_class)->finalize (obj); } /** * Base class for every slide view */ GType pdfpc_view_base_get_type (void) { static volatile gsize pdfpc_view_base_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_view_base_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcViewBaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_view_base_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcViewBase), 0, (GInstanceInitFunc) pdfpc_view_base_instance_init, NULL }; GType pdfpc_view_base_type_id; pdfpc_view_base_type_id = g_type_register_static (GTK_TYPE_DRAWING_AREA, "pdfpcViewBase", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); g_once_init_leave (&pdfpc_view_base_type_id__volatile, pdfpc_view_base_type_id); } return pdfpc_view_base_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/view/behaviour/000077500000000000000000000000001177613036100220315ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/classes/view/behaviour/base.c000066400000000000000000000217011177613036100231100ustar00rootroot00000000000000/* base.c generated by valac 0.16.0, the Vala compiler * generated from base.vala, do not modify */ #include #include #include #define PDFPC_VIEW_BEHAVIOUR_TYPE_BASE (pdfpc_view_behaviour_base_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBase)) #define PDFPC_VIEW_BEHAVIOUR_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) typedef struct _pdfpcViewBehaviourBase pdfpcViewBehaviourBase; typedef struct _pdfpcViewBehaviourBaseClass pdfpcViewBehaviourBaseClass; typedef struct _pdfpcViewBehaviourBasePrivate pdfpcViewBehaviourBasePrivate; #define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ()) #define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase)) #define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) #define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) typedef struct _pdfpcViewBase pdfpcViewBase; typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) typedef enum { PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_BEHAVIOUR_ALREADY_ASSOCIATED, PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_VIEW_NOT_SUPPORTED } pdfpcViewBehaviourAssociationError; #define PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR pdfpc_view_behaviour_association_error_quark () struct _pdfpcViewBehaviourBase { GObject parent_instance; pdfpcViewBehaviourBasePrivate * priv; pdfpcViewBase* target; }; struct _pdfpcViewBehaviourBaseClass { GObjectClass parent_class; void (*associate) (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); }; /** * Error domain used for association errors */ static gpointer pdfpc_view_behaviour_base_parent_class = NULL; GType pdfpc_view_behaviour_base_get_type (void) G_GNUC_CONST; GType pdfpc_view_base_get_type (void) G_GNUC_CONST; GQuark pdfpc_view_behaviour_association_error_quark (void); enum { PDFPC_VIEW_BEHAVIOUR_BASE_DUMMY_PROPERTY }; pdfpcViewBehaviourBase* pdfpc_view_behaviour_base_construct (GType object_type); pdfpcViewBase* pdfpc_view_behaviour_base_get_target (pdfpcViewBehaviourBase* self); void pdfpc_view_behaviour_base_enforce_exclusive_association (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); gboolean pdfpc_view_behaviour_base_is_supported (pdfpcViewBehaviourBase* self, pdfpcViewBase* target); void pdfpc_view_behaviour_base_associate (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); static void pdfpc_view_behaviour_base_real_associate (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); static void pdfpc_view_behaviour_base_finalize (GObject* obj); /** * Base constructor not taking any arguments */ pdfpcViewBehaviourBase* pdfpc_view_behaviour_base_construct (GType object_type) { pdfpcViewBehaviourBase * self = NULL; self = (pdfpcViewBehaviourBase*) g_object_new (object_type, NULL); return self; } /** * Return the associated View object * * If no View has been associated yet null is returned */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } pdfpcViewBase* pdfpc_view_behaviour_base_get_target (pdfpcViewBehaviourBase* self) { pdfpcViewBase* result = NULL; pdfpcViewBase* _tmp0_; pdfpcViewBase* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = self->target; _tmp1_ = _g_object_ref0 (_tmp0_); result = _tmp1_; return result; } /** * Enfore the fact that a Behaviour may only be associated to one View */ void pdfpc_view_behaviour_base_enforce_exclusive_association (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error) { pdfpcViewBase* _tmp0_; pdfpcViewBase* _tmp1_; pdfpcViewBase* _tmp2_; pdfpcViewBase* _tmp4_; gboolean _tmp5_ = FALSE; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (target != NULL); _tmp0_ = self->target; _tmp1_ = target; if (_tmp0_ == _tmp1_) { return; } _tmp2_ = self->target; if (_tmp2_ != NULL) { GError* _tmp3_; _tmp3_ = g_error_new_literal (PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR, PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_BEHAVIOUR_ALREADY_ASSOCIATED, "A behaviour has been associated with two different Views."); _inner_error_ = _tmp3_; if (_inner_error_->domain == PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR) { g_propagate_error (error, _inner_error_); return; } else { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } _tmp4_ = target; _tmp5_ = pdfpc_view_behaviour_base_is_supported (self, _tmp4_); if (!_tmp5_) { GError* _tmp6_; _tmp6_ = g_error_new_literal (PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR, PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_VIEW_NOT_SUPPORTED, "The View which should be associated is incompatible to the given Behav" \ "iour"); _inner_error_ = _tmp6_; if (_inner_error_->domain == PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR) { g_propagate_error (error, _inner_error_); return; } else { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } } /** * Associate the implementing Behaviour with the given View */ static void pdfpc_view_behaviour_base_real_associate (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error) { g_critical ("Type `%s' does not implement abstract method `pdfpc_view_behaviour_base_associate'", g_type_name (G_TYPE_FROM_INSTANCE (self))); return; } void pdfpc_view_behaviour_base_associate (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error) { g_return_if_fail (self != NULL); PDFPC_VIEW_BEHAVIOUR_BASE_GET_CLASS (self)->associate (self, target, error); } /** * Check wheter the given target is supported by this Behaviour * * By default every View is supported. */ gboolean pdfpc_view_behaviour_base_is_supported (pdfpcViewBehaviourBase* self, pdfpcViewBase* target) { gboolean result = FALSE; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (target != NULL, FALSE); result = TRUE; return result; } static void pdfpc_view_behaviour_base_class_init (pdfpcViewBehaviourBaseClass * klass) { pdfpc_view_behaviour_base_parent_class = g_type_class_peek_parent (klass); PDFPC_VIEW_BEHAVIOUR_BASE_CLASS (klass)->associate = pdfpc_view_behaviour_base_real_associate; G_OBJECT_CLASS (klass)->finalize = pdfpc_view_behaviour_base_finalize; } static void pdfpc_view_behaviour_base_instance_init (pdfpcViewBehaviourBase * self) { self->target = NULL; } static void pdfpc_view_behaviour_base_finalize (GObject* obj) { pdfpcViewBehaviourBase * self; self = PDFPC_VIEW_BEHAVIOUR_BASE (obj); _g_object_unref0 (self->target); G_OBJECT_CLASS (pdfpc_view_behaviour_base_parent_class)->finalize (obj); } /** * Abstract base every View Behaviour implementation has to extend. * * A Behaviour is a certain characteristic which is added to an existing * View on demand. */ GType pdfpc_view_behaviour_base_get_type (void) { static volatile gsize pdfpc_view_behaviour_base_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_view_behaviour_base_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcViewBehaviourBaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_view_behaviour_base_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcViewBehaviourBase), 0, (GInstanceInitFunc) pdfpc_view_behaviour_base_instance_init, NULL }; GType pdfpc_view_behaviour_base_type_id; pdfpc_view_behaviour_base_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcViewBehaviourBase", &g_define_type_info, G_TYPE_FLAG_ABSTRACT); g_once_init_leave (&pdfpc_view_behaviour_base_type_id__volatile, pdfpc_view_behaviour_base_type_id); } return pdfpc_view_behaviour_base_type_id__volatile; } GQuark pdfpc_view_behaviour_association_error_quark (void) { return g_quark_from_static_string ("pdfpc_view_behaviour_association_error-quark"); } davvil-pdfpc-074a3c6/c-src/classes/view/behaviour/pdf_link/000077500000000000000000000000001177613036100236175ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/classes/view/behaviour/pdf_link/implementation.c000066400000000000000000000537511177613036100270230ustar00rootroot00000000000000/* implementation.c generated by valac 0.16.0, the Vala compiler * generated from implementation.vala, do not modify */ #include #include #include #include #include #include #include #define PDFPC_VIEW_BEHAVIOUR_TYPE_BASE (pdfpc_view_behaviour_base_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBase)) #define PDFPC_VIEW_BEHAVIOUR_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) typedef struct _pdfpcViewBehaviourBase pdfpcViewBehaviourBase; typedef struct _pdfpcViewBehaviourBaseClass pdfpcViewBehaviourBaseClass; typedef struct _pdfpcViewBehaviourBasePrivate pdfpcViewBehaviourBasePrivate; #define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ()) #define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase)) #define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) #define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) typedef struct _pdfpcViewBase pdfpcViewBase; typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass; #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION (pdfpc_view_behaviour_pdf_link_implementation_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementation)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementationClass)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_IMPLEMENTATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_IMPLEMENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementationClass)) typedef struct _pdfpcViewBehaviourPdfLinkImplementation pdfpcViewBehaviourPdfLinkImplementation; typedef struct _pdfpcViewBehaviourPdfLinkImplementationClass pdfpcViewBehaviourPdfLinkImplementationClass; typedef struct _pdfpcViewBehaviourPdfLinkImplementationPrivate pdfpcViewBehaviourPdfLinkImplementationPrivate; #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER (pdfpc_view_behaviour_pdf_link_signal_provider_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProvider)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProviderClass)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_SIGNAL_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_SIGNAL_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProviderClass)) typedef struct _pdfpcViewBehaviourPdfLinkSignalProvider pdfpcViewBehaviourPdfLinkSignalProvider; typedef struct _pdfpcViewBehaviourPdfLinkSignalProviderClass pdfpcViewBehaviourPdfLinkSignalProviderClass; #define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController)) #define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) #define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) typedef struct _pdfpcPresentationController pdfpcPresentationController; typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define PDFPC_VIEW_TYPE_DEFAULT (pdfpc_view_default_get_type ()) #define PDFPC_VIEW_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefault)) #define PDFPC_VIEW_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) #define PDFPC_VIEW_IS_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_IS_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) typedef struct _pdfpcViewDefault pdfpcViewDefault; typedef struct _pdfpcViewDefaultClass pdfpcViewDefaultClass; #define PDFPC_VIEW_TYPE_PDF (pdfpc_view_pdf_get_type ()) #define PDFPC_VIEW_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdf)) #define PDFPC_VIEW_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) #define PDFPC_VIEW_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) typedef struct _pdfpcViewPdf pdfpcViewPdf; typedef struct _pdfpcViewPdfClass pdfpcViewPdfClass; #define _gdk_cursor_unref0(var) ((var == NULL) ? NULL : (var = (gdk_cursor_unref (var), NULL))) typedef enum { PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_BEHAVIOUR_ALREADY_ASSOCIATED, PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_VIEW_NOT_SUPPORTED } pdfpcViewBehaviourAssociationError; #define PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR pdfpc_view_behaviour_association_error_quark () struct _pdfpcViewBehaviourBase { GObject parent_instance; pdfpcViewBehaviourBasePrivate * priv; pdfpcViewBase* target; }; struct _pdfpcViewBehaviourBaseClass { GObjectClass parent_class; void (*associate) (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); }; struct _pdfpcViewBehaviourPdfLinkImplementation { pdfpcViewBehaviourBase parent_instance; pdfpcViewBehaviourPdfLinkImplementationPrivate * priv; pdfpcViewBehaviourPdfLinkSignalProvider* signal_provider; pdfpcPresentationController* presentation_controller; }; struct _pdfpcViewBehaviourPdfLinkImplementationClass { pdfpcViewBehaviourBaseClass parent_class; }; static gpointer pdfpc_view_behaviour_pdf_link_implementation_parent_class = NULL; GType pdfpc_view_behaviour_base_get_type (void) G_GNUC_CONST; GType pdfpc_view_base_get_type (void) G_GNUC_CONST; GQuark pdfpc_view_behaviour_association_error_quark (void); GType pdfpc_view_behaviour_pdf_link_implementation_get_type (void) G_GNUC_CONST; GType pdfpc_view_behaviour_pdf_link_signal_provider_get_type (void) G_GNUC_CONST; GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST; enum { PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_DUMMY_PROPERTY }; pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_new (pdfpcPresentationController* presentation_controller); pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_construct (GType object_type, pdfpcPresentationController* presentation_controller); pdfpcViewBehaviourBase* pdfpc_view_behaviour_base_construct (GType object_type); pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_new (void); pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_construct (GType object_type); static void pdfpc_view_behaviour_pdf_link_implementation_real_associate (pdfpcViewBehaviourBase* base, pdfpcViewBase* target, GError** error); void pdfpc_view_behaviour_base_enforce_exclusive_association (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); GType pdfpc_view_default_get_type (void) G_GNUC_CONST; GType pdfpc_view_pdf_get_type (void) G_GNUC_CONST; void pdfpc_view_behaviour_pdf_link_signal_provider_attach (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewPdf* view); void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping); static void _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_enter (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, PopplerLinkMapping* mapping, gpointer self); void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping); static void _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_leave (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, PopplerLinkMapping* mapping, gpointer self); void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, guint target_page_number); static void _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_internal_link (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, guint source_page_number, guint target_page_number, gpointer self); void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, const gchar* command, const gchar* arguments); static void _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_external_command (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, guint source_page_number, const gchar* command, const gchar* arguments, gpointer self); gboolean pdfpc_view_behaviour_pdf_link_implementation_is_supported (pdfpcViewBehaviourPdfLinkImplementation* self, pdfpcViewBase* target); void pdfpc_presentation_controller_page_change_request (pdfpcPresentationController* self, gint page_number); static void pdfpc_view_behaviour_pdf_link_implementation_finalize (GObject* obj); /** * Base constructor not taking any arguments */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_construct (GType object_type, pdfpcPresentationController* presentation_controller) { pdfpcViewBehaviourPdfLinkImplementation * self = NULL; pdfpcViewBehaviourPdfLinkSignalProvider* _tmp0_; pdfpcPresentationController* _tmp1_; pdfpcPresentationController* _tmp2_; g_return_val_if_fail (presentation_controller != NULL, NULL); self = (pdfpcViewBehaviourPdfLinkImplementation*) pdfpc_view_behaviour_base_construct (object_type); _tmp0_ = pdfpc_view_behaviour_pdf_link_signal_provider_new (); _g_object_unref0 (self->signal_provider); self->signal_provider = _tmp0_; _tmp1_ = presentation_controller; _tmp2_ = _g_object_ref0 (_tmp1_); _g_object_unref0 (self->presentation_controller); self->presentation_controller = _tmp2_; return self; } pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_new (pdfpcPresentationController* presentation_controller) { return pdfpc_view_behaviour_pdf_link_implementation_construct (PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, presentation_controller); } /** * Associate the implementing Behaviour with the given View * * This method will register a lot of new signals on the target to * handle all the different states. */ static void _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_enter (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, PopplerLinkMapping* mapping, gpointer self) { pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter (self, link_rect, mapping); } static void _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_leave (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, PopplerLinkMapping* mapping, gpointer self) { pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave (self, link_rect, mapping); } static void _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_internal_link (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, guint source_page_number, guint target_page_number, gpointer self) { pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link (self, link_rect, source_page_number, target_page_number); } static void _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_external_command (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, guint source_page_number, const gchar* command, const gchar* arguments, gpointer self) { pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command (self, link_rect, source_page_number, command, arguments); } static void pdfpc_view_behaviour_pdf_link_implementation_real_associate (pdfpcViewBehaviourBase* base, pdfpcViewBase* target, GError** error) { pdfpcViewBehaviourPdfLinkImplementation * self; pdfpcViewBase* _tmp0_; pdfpcViewBase* _tmp1_; pdfpcViewBase* _tmp2_; pdfpcViewBehaviourPdfLinkSignalProvider* _tmp3_; pdfpcViewBase* _tmp4_; pdfpcViewBehaviourPdfLinkSignalProvider* _tmp5_; pdfpcViewBehaviourPdfLinkSignalProvider* _tmp6_; pdfpcViewBehaviourPdfLinkSignalProvider* _tmp7_; pdfpcViewBehaviourPdfLinkSignalProvider* _tmp8_; GError * _inner_error_ = NULL; self = (pdfpcViewBehaviourPdfLinkImplementation*) base; g_return_if_fail (target != NULL); _tmp0_ = target; pdfpc_view_behaviour_base_enforce_exclusive_association ((pdfpcViewBehaviourBase*) self, _tmp0_, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR) { g_propagate_error (error, _inner_error_); return; } else { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } _tmp1_ = target; _tmp2_ = _g_object_ref0 (_tmp1_); _g_object_unref0 (((pdfpcViewBehaviourBase*) self)->target); ((pdfpcViewBehaviourBase*) self)->target = _tmp2_; _tmp3_ = self->signal_provider; _tmp4_ = target; pdfpc_view_behaviour_pdf_link_signal_provider_attach (_tmp3_, PDFPC_VIEW_IS_PDF (_tmp4_) ? ((pdfpcViewPdf*) _tmp4_) : NULL); _tmp5_ = self->signal_provider; g_signal_connect_object (_tmp5_, "link-mouse-enter", (GCallback) _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_enter, self, 0); _tmp6_ = self->signal_provider; g_signal_connect_object (_tmp6_, "link-mouse-leave", (GCallback) _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_leave, self, 0); _tmp7_ = self->signal_provider; g_signal_connect_object (_tmp7_, "clicked-internal-link", (GCallback) _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_internal_link, self, 0); _tmp8_ = self->signal_provider; g_signal_connect_object (_tmp8_, "clicked-external-command", (GCallback) _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_external_command, self, 0); } /** * Check wheter the given target is supported by this Behaviour * * Only View.Pdf and its descendants are allowed to be used in * conjunction with this Behaviour */ gboolean pdfpc_view_behaviour_pdf_link_implementation_is_supported (pdfpcViewBehaviourPdfLinkImplementation* self, pdfpcViewBase* target) { gboolean result = FALSE; pdfpcViewBase* _tmp0_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (target != NULL, FALSE); _tmp0_ = target; result = PDFPC_VIEW_IS_PDF (_tmp0_); return result; } /** * The mouse pointer has entered a pdf link */ void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping) { pdfpcViewBase* _tmp0_; GdkWindow* _tmp1_; GdkDisplay* _tmp2_ = NULL; GdkCursor* _tmp3_; GdkCursor* _tmp4_; g_return_if_fail (self != NULL); g_return_if_fail (link_rect != NULL); g_return_if_fail (mapping != NULL); _tmp0_ = ((pdfpcViewBehaviourBase*) self)->target; _tmp1_ = ((GtkWidget*) _tmp0_)->window; _tmp2_ = gdk_display_get_default (); _tmp3_ = gdk_cursor_new_from_name (_tmp2_, "hand2"); _tmp4_ = _tmp3_; gdk_window_set_cursor (_tmp1_, _tmp4_); _gdk_cursor_unref0 (_tmp4_); } /** * The mouse pointer has left a pdf link */ void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping) { pdfpcViewBase* _tmp0_; GdkWindow* _tmp1_; g_return_if_fail (self != NULL); g_return_if_fail (link_rect != NULL); g_return_if_fail (mapping != NULL); _tmp0_ = ((pdfpcViewBehaviourBase*) self)->target; _tmp1_ = ((GtkWidget*) _tmp0_)->window; gdk_window_set_cursor (_tmp1_, NULL); } /** * An internal link has been clicked */ void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, guint target_page_number) { pdfpcPresentationController* _tmp0_; guint _tmp1_; g_return_if_fail (self != NULL); g_return_if_fail (link_rect != NULL); _tmp0_ = self->presentation_controller; _tmp1_ = target_page_number; pdfpc_presentation_controller_page_change_request (_tmp0_, (gint) _tmp1_); } /** * An external command link has been clicked */ void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, const gchar* command, const gchar* arguments) { g_return_if_fail (self != NULL); g_return_if_fail (link_rect != NULL); g_return_if_fail (command != NULL); g_return_if_fail (arguments != NULL); } static void pdfpc_view_behaviour_pdf_link_implementation_class_init (pdfpcViewBehaviourPdfLinkImplementationClass * klass) { pdfpc_view_behaviour_pdf_link_implementation_parent_class = g_type_class_peek_parent (klass); PDFPC_VIEW_BEHAVIOUR_BASE_CLASS (klass)->associate = pdfpc_view_behaviour_pdf_link_implementation_real_associate; G_OBJECT_CLASS (klass)->finalize = pdfpc_view_behaviour_pdf_link_implementation_finalize; } static void pdfpc_view_behaviour_pdf_link_implementation_instance_init (pdfpcViewBehaviourPdfLinkImplementation * self) { self->signal_provider = NULL; } static void pdfpc_view_behaviour_pdf_link_implementation_finalize (GObject* obj) { pdfpcViewBehaviourPdfLinkImplementation * self; self = PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION (obj); _g_object_unref0 (self->signal_provider); _g_object_unref0 (self->presentation_controller); G_OBJECT_CLASS (pdfpc_view_behaviour_pdf_link_implementation_parent_class)->finalize (obj); } /** * Behaviour which handles links inside of Pdf based Views */ GType pdfpc_view_behaviour_pdf_link_implementation_get_type (void) { static volatile gsize pdfpc_view_behaviour_pdf_link_implementation_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_view_behaviour_pdf_link_implementation_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcViewBehaviourPdfLinkImplementationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_view_behaviour_pdf_link_implementation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcViewBehaviourPdfLinkImplementation), 0, (GInstanceInitFunc) pdfpc_view_behaviour_pdf_link_implementation_instance_init, NULL }; GType pdfpc_view_behaviour_pdf_link_implementation_type_id; pdfpc_view_behaviour_pdf_link_implementation_type_id = g_type_register_static (PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, "pdfpcViewBehaviourPdfLinkImplementation", &g_define_type_info, 0); g_once_init_leave (&pdfpc_view_behaviour_pdf_link_implementation_type_id__volatile, pdfpc_view_behaviour_pdf_link_implementation_type_id); } return pdfpc_view_behaviour_pdf_link_implementation_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/view/behaviour/pdf_link/signal_provider.c000066400000000000000000001237311177613036100271610ustar00rootroot00000000000000/* signal_provider.c generated by valac 0.16.0, the Vala compiler * generated from signal_provider.vala, do not modify */ #include #include #include #include #include #include #include #include #include #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER (pdfpc_view_behaviour_pdf_link_signal_provider_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProvider)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProviderClass)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_SIGNAL_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_SIGNAL_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProviderClass)) typedef struct _pdfpcViewBehaviourPdfLinkSignalProvider pdfpcViewBehaviourPdfLinkSignalProvider; typedef struct _pdfpcViewBehaviourPdfLinkSignalProviderClass pdfpcViewBehaviourPdfLinkSignalProviderClass; typedef struct _pdfpcViewBehaviourPdfLinkSignalProviderPrivate pdfpcViewBehaviourPdfLinkSignalProviderPrivate; #define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ()) #define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase)) #define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) #define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) typedef struct _pdfpcViewBase pdfpcViewBase; typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass; #define PDFPC_VIEW_TYPE_DEFAULT (pdfpc_view_default_get_type ()) #define PDFPC_VIEW_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefault)) #define PDFPC_VIEW_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) #define PDFPC_VIEW_IS_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_IS_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) typedef struct _pdfpcViewDefault pdfpcViewDefault; typedef struct _pdfpcViewDefaultClass pdfpcViewDefaultClass; #define PDFPC_VIEW_TYPE_PDF (pdfpc_view_pdf_get_type ()) #define PDFPC_VIEW_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdf)) #define PDFPC_VIEW_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) #define PDFPC_VIEW_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) typedef struct _pdfpcViewPdf pdfpcViewPdf; typedef struct _pdfpcViewPdfClass pdfpcViewPdfClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define __vala_PopplerLinkMapping_free0(var) ((var == NULL) ? NULL : (var = (_vala_PopplerLinkMapping_free (var), NULL))) #define __g_list_free___vala_PopplerLinkMapping_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free___vala_PopplerLinkMapping_free0_ (var), NULL))) #define PDFPC_RENDERER_TYPE_BASE (pdfpc_renderer_base_get_type ()) #define PDFPC_RENDERER_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBase)) #define PDFPC_RENDERER_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) #define PDFPC_RENDERER_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) typedef struct _pdfpcRendererBase pdfpcRendererBase; typedef struct _pdfpcRendererBaseClass pdfpcRendererBaseClass; #define PDFPC_RENDERER_TYPE_PDF (pdfpc_renderer_pdf_get_type ()) #define PDFPC_RENDERER_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdf)) #define PDFPC_RENDERER_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass)) #define PDFPC_RENDERER_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_PDF)) #define PDFPC_RENDERER_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_PDF)) #define PDFPC_RENDERER_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass)) typedef struct _pdfpcRendererPdf pdfpcRendererPdf; typedef struct _pdfpcRendererPdfClass pdfpcRendererPdfClass; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ()) #define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf)) #define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) #define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf; typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass; #define __vala_PopplerDest_free0(var) ((var == NULL) ? NULL : (var = (_vala_PopplerDest_free (var), NULL))) struct _pdfpcViewBehaviourPdfLinkSignalProvider { GObject parent_instance; pdfpcViewBehaviourPdfLinkSignalProviderPrivate * priv; pdfpcViewPdf* target; PopplerLinkMapping* active_mapping; GList* page_link_mappings; GdkRectangle* precalculated_mapping_rectangles; gint precalculated_mapping_rectangles_length1; }; struct _pdfpcViewBehaviourPdfLinkSignalProviderClass { GObjectClass parent_class; }; static gpointer pdfpc_view_behaviour_pdf_link_signal_provider_parent_class = NULL; extern GMutex* pdfpc_mutex_locks_poppler; GType pdfpc_view_behaviour_pdf_link_signal_provider_get_type (void) G_GNUC_CONST; GType pdfpc_view_base_get_type (void) G_GNUC_CONST; GType pdfpc_view_default_get_type (void) G_GNUC_CONST; GType pdfpc_view_pdf_get_type (void) G_GNUC_CONST; enum { PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER_DUMMY_PROPERTY }; static void _vala_PopplerLinkMapping_free (PopplerLinkMapping* self); static void __vala_PopplerLinkMapping_free0_ (gpointer var); static void _g_list_free___vala_PopplerLinkMapping_free0_ (GList* self); void pdfpc_view_behaviour_pdf_link_signal_provider_attach (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewPdf* view); gboolean pdfpc_view_behaviour_pdf_link_signal_provider_on_button_press (pdfpcViewBehaviourPdfLinkSignalProvider* self, GtkWidget* source, GdkEventButton* e); static gboolean _pdfpc_view_behaviour_pdf_link_signal_provider_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self); gboolean pdfpc_view_behaviour_pdf_link_signal_provider_on_mouse_move (pdfpcViewBehaviourPdfLinkSignalProvider* self, GtkWidget* source, GdkEventMotion* event); static gboolean _pdfpc_view_behaviour_pdf_link_signal_provider_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self); void pdfpc_view_behaviour_pdf_link_signal_provider_on_entering_slide (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewBase* source, gint page_number); static void _pdfpc_view_behaviour_pdf_link_signal_provider_on_entering_slide_pdfpc_view_base_entering_slide (pdfpcViewBase* _sender, gint slide_number, gpointer self); void pdfpc_view_behaviour_pdf_link_signal_provider_on_leaving_slide (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewBase* source, gint from, gint to); static void _pdfpc_view_behaviour_pdf_link_signal_provider_on_leaving_slide_pdfpc_view_base_leaving_slide (pdfpcViewBase* _sender, gint from, gint to, gpointer self); PopplerLinkMapping* pdfpc_view_behaviour_pdf_link_signal_provider_get_link_mapping_by_coordinates (pdfpcViewBehaviourPdfLinkSignalProvider* self, gdouble x, gdouble y); void pdfpc_view_behaviour_pdf_link_signal_provider_handle_link_mapping (pdfpcViewBehaviourPdfLinkSignalProvider* self, PopplerLinkMapping* mapping); GType pdfpc_renderer_base_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_pdf_get_type (void) G_GNUC_CONST; pdfpcRendererPdf* pdfpc_view_pdf_get_renderer (pdfpcViewPdf* self); GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; pdfpcMetadataBase* pdfpc_renderer_base_get_metadata (pdfpcRendererBase* self); GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST; PopplerDocument* pdfpc_metadata_pdf_get_document (pdfpcMetadataPdf* self); static void _vala_PopplerDest_free (PopplerDest* self); void pdfpc_view_behaviour_pdf_link_signal_provider_convert_poppler_rectangle_to_gdk_rectangle (pdfpcViewBehaviourPdfLinkSignalProvider* self, PopplerRectangle* poppler_rectangle, GdkRectangle* result); gint pdfpc_view_base_get_current_slide_number (pdfpcViewBase* self); gdouble pdfpc_metadata_pdf_get_page_width (pdfpcMetadataPdf* self); gdouble pdfpc_metadata_pdf_get_page_height (pdfpcMetadataPdf* self); pdfpcRendererBase* pdfpc_view_base_get_renderer (pdfpcViewBase* self); guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self); static PopplerLinkMapping* _vala_PopplerLinkMapping_copy (PopplerLinkMapping* self); pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_new (void); pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_construct (GType object_type); static void g_cclosure_user_marshal_VOID__BOXED_UINT_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); static void g_cclosure_user_marshal_VOID__BOXED_UINT_STRING_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); static void g_cclosure_user_marshal_VOID__BOXED_BOXED (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); static void pdfpc_view_behaviour_pdf_link_signal_provider_finalize (GObject* obj); static void _vala_PopplerLinkMapping_free (PopplerLinkMapping* self) { g_boxed_free (poppler_link_mapping_get_type (), self); } static void __vala_PopplerLinkMapping_free0_ (gpointer var) { (var == NULL) ? NULL : (var = (_vala_PopplerLinkMapping_free (var), NULL)); } static void _g_list_free___vala_PopplerLinkMapping_free0_ (GList* self) { g_list_foreach (self, (GFunc) __vala_PopplerLinkMapping_free0_, NULL); g_list_free (self); } /** * Attach a View.Pdf to this signal provider */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } static gboolean _pdfpc_view_behaviour_pdf_link_signal_provider_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) { gboolean result; result = pdfpc_view_behaviour_pdf_link_signal_provider_on_button_press (self, _sender, event); return result; } static gboolean _pdfpc_view_behaviour_pdf_link_signal_provider_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self) { gboolean result; result = pdfpc_view_behaviour_pdf_link_signal_provider_on_mouse_move (self, _sender, event); return result; } static void _pdfpc_view_behaviour_pdf_link_signal_provider_on_entering_slide_pdfpc_view_base_entering_slide (pdfpcViewBase* _sender, gint slide_number, gpointer self) { pdfpc_view_behaviour_pdf_link_signal_provider_on_entering_slide (self, _sender, slide_number); } static void _pdfpc_view_behaviour_pdf_link_signal_provider_on_leaving_slide_pdfpc_view_base_leaving_slide (pdfpcViewBase* _sender, gint from, gint to, gpointer self) { pdfpc_view_behaviour_pdf_link_signal_provider_on_leaving_slide (self, _sender, from, to); } void pdfpc_view_behaviour_pdf_link_signal_provider_attach (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewPdf* view) { pdfpcViewPdf* _tmp0_; pdfpcViewPdf* _tmp1_; pdfpcViewPdf* _tmp2_; pdfpcViewPdf* _tmp3_; pdfpcViewPdf* _tmp4_; pdfpcViewPdf* _tmp5_; pdfpcViewPdf* _tmp6_; pdfpcViewPdf* _tmp7_; g_return_if_fail (self != NULL); g_return_if_fail (view != NULL); _tmp0_ = view; _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->target); self->target = _tmp1_; _tmp2_ = view; gtk_widget_add_events ((GtkWidget*) _tmp2_, (gint) GDK_BUTTON_PRESS_MASK); _tmp3_ = view; gtk_widget_add_events ((GtkWidget*) _tmp3_, (gint) GDK_POINTER_MOTION_MASK); _tmp4_ = view; g_signal_connect_object ((GtkWidget*) _tmp4_, "button-press-event", (GCallback) _pdfpc_view_behaviour_pdf_link_signal_provider_on_button_press_gtk_widget_button_press_event, self, 0); _tmp5_ = view; g_signal_connect_object ((GtkWidget*) _tmp5_, "motion-notify-event", (GCallback) _pdfpc_view_behaviour_pdf_link_signal_provider_on_mouse_move_gtk_widget_motion_notify_event, self, 0); _tmp6_ = view; g_signal_connect_object ((pdfpcViewBase*) _tmp6_, "entering-slide", (GCallback) _pdfpc_view_behaviour_pdf_link_signal_provider_on_entering_slide_pdfpc_view_base_entering_slide, self, 0); _tmp7_ = view; g_signal_connect_object ((pdfpcViewBase*) _tmp7_, "leaving-slide", (GCallback) _pdfpc_view_behaviour_pdf_link_signal_provider_on_leaving_slide_pdfpc_view_base_leaving_slide, self, 0); } /** * Return the Poppler.LinkMapping associated with link for the given * coordinates. * * If there is no link for the given coordinates null is returned * instead. */ PopplerLinkMapping* pdfpc_view_behaviour_pdf_link_signal_provider_get_link_mapping_by_coordinates (pdfpcViewBehaviourPdfLinkSignalProvider* self, gdouble x, gdouble y) { PopplerLinkMapping* result = NULL; g_return_val_if_fail (self != NULL, NULL); { gint i; i = 0; { gboolean _tmp0_; _tmp0_ = TRUE; while (TRUE) { gboolean _tmp1_; gint _tmp3_; GdkRectangle* _tmp4_; gint _tmp4__length1; GdkRectangle* _tmp5_; gint _tmp5__length1; gint _tmp6_; GdkRectangle _tmp7_; GdkRectangle r; gboolean _tmp8_ = FALSE; gboolean _tmp9_ = FALSE; gboolean _tmp10_ = FALSE; gdouble _tmp11_; GdkRectangle _tmp12_; gint _tmp13_; gboolean _tmp19_; gboolean _tmp23_; gboolean _tmp29_; _tmp1_ = _tmp0_; if (!_tmp1_) { gint _tmp2_; _tmp2_ = i; i = _tmp2_ + 1; } _tmp0_ = FALSE; _tmp3_ = i; _tmp4_ = self->precalculated_mapping_rectangles; _tmp4__length1 = self->precalculated_mapping_rectangles_length1; if (!(_tmp3_ < _tmp4__length1)) { break; } _tmp5_ = self->precalculated_mapping_rectangles; _tmp5__length1 = self->precalculated_mapping_rectangles_length1; _tmp6_ = i; _tmp7_ = _tmp5_[_tmp6_]; r = _tmp7_; _tmp11_ = x; _tmp12_ = r; _tmp13_ = _tmp12_.x; if (_tmp11_ >= ((gdouble) _tmp13_)) { gdouble _tmp14_; GdkRectangle _tmp15_; gint _tmp16_; GdkRectangle _tmp17_; gint _tmp18_; _tmp14_ = x; _tmp15_ = r; _tmp16_ = _tmp15_.x; _tmp17_ = r; _tmp18_ = _tmp17_.width; _tmp10_ = _tmp14_ <= ((gdouble) (_tmp16_ + _tmp18_)); } else { _tmp10_ = FALSE; } _tmp19_ = _tmp10_; if (_tmp19_) { gdouble _tmp20_; GdkRectangle _tmp21_; gint _tmp22_; _tmp20_ = y; _tmp21_ = r; _tmp22_ = _tmp21_.y; _tmp9_ = _tmp20_ >= ((gdouble) _tmp22_); } else { _tmp9_ = FALSE; } _tmp23_ = _tmp9_; if (_tmp23_) { gdouble _tmp24_; GdkRectangle _tmp25_; gint _tmp26_; GdkRectangle _tmp27_; gint _tmp28_; _tmp24_ = y; _tmp25_ = r; _tmp26_ = _tmp25_.y; _tmp27_ = r; _tmp28_ = _tmp27_.height; _tmp8_ = _tmp24_ <= ((gdouble) (_tmp26_ + _tmp28_)); } else { _tmp8_ = FALSE; } _tmp29_ = _tmp8_; if (_tmp29_) { GList* _tmp30_; gint _tmp31_; gconstpointer _tmp32_ = NULL; _tmp30_ = self->page_link_mappings; _tmp31_ = i; _tmp32_ = g_list_nth_data (_tmp30_, (guint) _tmp31_); result = (PopplerLinkMapping*) _tmp32_; return result; } } } } result = NULL; return result; } /** * Handle the given mapping as it has been clicked on. * * This method evaluates the mapping and emits all signals which are * needed in the given case. */ static void _vala_PopplerDest_free (PopplerDest* self) { g_boxed_free (poppler_dest_get_type (), self); } void pdfpc_view_behaviour_pdf_link_signal_provider_handle_link_mapping (pdfpcViewBehaviourPdfLinkSignalProvider* self, PopplerLinkMapping* mapping) { PopplerLinkMapping* _tmp0_; PopplerAction* _tmp1_; PopplerActionType _tmp2_; g_return_if_fail (self != NULL); g_return_if_fail (mapping != NULL); _tmp0_ = mapping; _tmp1_ = _tmp0_->action; _tmp2_ = _tmp1_->type; switch (_tmp2_) { case POPPLER_ACTION_GOTO_DEST: { PopplerLinkMapping* _tmp3_; PopplerAction* _tmp4_; PopplerActionGotoDest* action; PopplerActionGotoDest* _tmp5_; PopplerDest* _tmp6_; PopplerDestType _tmp7_; _tmp3_ = mapping; _tmp4_ = _tmp3_->action; action = (PopplerActionGotoDest*) _tmp4_; _tmp5_ = action; _tmp6_ = (*_tmp5_).dest; _tmp7_ = _tmp6_->type; switch (_tmp7_) { case POPPLER_DEST_NAMED: { GMutex* _tmp8_; pdfpcViewPdf* _tmp9_; pdfpcRendererPdf* _tmp10_ = NULL; pdfpcRendererPdf* _tmp11_; pdfpcMetadataBase* _tmp12_ = NULL; pdfpcMetadataPdf* _tmp13_; pdfpcMetadataPdf* metadata; pdfpcMetadataPdf* _tmp14_; PopplerDocument* _tmp15_ = NULL; PopplerDocument* document; PopplerDest* destination = NULL; PopplerDocument* _tmp16_; PopplerActionGotoDest* _tmp17_; PopplerDest* _tmp18_; const gchar* _tmp19_; PopplerDest* _tmp20_ = NULL; GMutex* _tmp21_; PopplerLinkMapping* _tmp22_; PopplerRectangle _tmp23_; GdkRectangle _tmp24_ = {0}; pdfpcViewPdf* _tmp25_; gint _tmp26_ = 0; PopplerDest* _tmp27_; gint _tmp28_; _tmp8_ = pdfpc_mutex_locks_poppler; g_mutex_lock (_tmp8_); _tmp9_ = self->target; _tmp10_ = pdfpc_view_pdf_get_renderer (_tmp9_); _tmp11_ = _tmp10_; _tmp12_ = pdfpc_renderer_base_get_metadata ((pdfpcRendererBase*) _tmp11_); _tmp13_ = PDFPC_METADATA_IS_PDF (_tmp12_) ? ((pdfpcMetadataPdf*) _tmp12_) : NULL; _g_object_unref0 (_tmp11_); metadata = _tmp13_; _tmp14_ = metadata; _tmp15_ = pdfpc_metadata_pdf_get_document (_tmp14_); document = _tmp15_; _tmp16_ = document; _tmp17_ = action; _tmp18_ = (*_tmp17_).dest; _tmp19_ = _tmp18_->named_dest; _tmp20_ = poppler_document_find_dest (_tmp16_, _tmp19_); __vala_PopplerDest_free0 (destination); destination = _tmp20_; _tmp21_ = pdfpc_mutex_locks_poppler; g_mutex_unlock (_tmp21_); _tmp22_ = mapping; _tmp23_ = _tmp22_->area; pdfpc_view_behaviour_pdf_link_signal_provider_convert_poppler_rectangle_to_gdk_rectangle (self, &_tmp23_, &_tmp24_); _tmp25_ = self->target; _tmp26_ = pdfpc_view_base_get_current_slide_number ((pdfpcViewBase*) _tmp25_); _tmp27_ = destination; _tmp28_ = _tmp27_->page_num; g_signal_emit_by_name (self, "clicked-internal-link", &_tmp24_, (guint) _tmp26_, (guint) (_tmp28_ - 1)); __vala_PopplerDest_free0 (destination); _g_object_unref0 (document); _g_object_unref0 (metadata); break; } default: break; } break; } case POPPLER_ACTION_LAUNCH: { PopplerLinkMapping* _tmp29_; PopplerAction* _tmp30_; PopplerActionLaunch* action; PopplerLinkMapping* _tmp31_; PopplerRectangle _tmp32_; GdkRectangle _tmp33_ = {0}; pdfpcViewPdf* _tmp34_; gint _tmp35_ = 0; PopplerActionLaunch* _tmp36_; const gchar* _tmp37_; PopplerActionLaunch* _tmp38_; const gchar* _tmp39_; _tmp29_ = mapping; _tmp30_ = _tmp29_->action; action = (PopplerActionLaunch*) _tmp30_; _tmp31_ = mapping; _tmp32_ = _tmp31_->area; pdfpc_view_behaviour_pdf_link_signal_provider_convert_poppler_rectangle_to_gdk_rectangle (self, &_tmp32_, &_tmp33_); _tmp34_ = self->target; _tmp35_ = pdfpc_view_base_get_current_slide_number ((pdfpcViewBase*) _tmp34_); _tmp36_ = action; _tmp37_ = (*_tmp36_).file_name; _tmp38_ = action; _tmp39_ = (*_tmp38_).params; g_signal_emit_by_name (self, "clicked-external-command", &_tmp33_, (guint) _tmp35_, _tmp37_, _tmp39_); break; } default: break; } } /** * Convert an arbitrary Poppler.Rectangle struct into a Gdk.Rectangle * struct taking into account the measurement differences between pdf * space and screen space. */ void pdfpc_view_behaviour_pdf_link_signal_provider_convert_poppler_rectangle_to_gdk_rectangle (pdfpcViewBehaviourPdfLinkSignalProvider* self, PopplerRectangle* poppler_rectangle, GdkRectangle* result) { GdkRectangle gdk_rectangle = {0}; GtkRequisition requisition = {0}; pdfpcViewPdf* _tmp0_; GtkRequisition _tmp1_ = {0}; pdfpcViewPdf* _tmp2_; pdfpcRendererPdf* _tmp3_ = NULL; pdfpcRendererPdf* _tmp4_; pdfpcMetadataBase* _tmp5_ = NULL; pdfpcMetadataPdf* _tmp6_; pdfpcMetadataPdf* metadata; PopplerRectangle _tmp7_; gdouble _tmp8_; gdouble _tmp9_ = 0.0; GtkRequisition _tmp10_; gint _tmp11_; gdouble _tmp12_ = 0.0; PopplerRectangle _tmp13_; gdouble _tmp14_; PopplerRectangle _tmp15_; gdouble _tmp16_; gdouble _tmp17_ = 0.0; GtkRequisition _tmp18_; gint _tmp19_; gdouble _tmp20_ = 0.0; gdouble _tmp21_ = 0.0; PopplerRectangle _tmp22_; gdouble _tmp23_; gdouble _tmp24_ = 0.0; GtkRequisition _tmp25_; gint _tmp26_; gdouble _tmp27_ = 0.0; PopplerRectangle _tmp28_; gdouble _tmp29_; PopplerRectangle _tmp30_; gdouble _tmp31_; gdouble _tmp32_ = 0.0; GtkRequisition _tmp33_; gint _tmp34_; gdouble _tmp35_ = 0.0; g_return_if_fail (self != NULL); g_return_if_fail (poppler_rectangle != NULL); memset (&gdk_rectangle, 0, sizeof (GdkRectangle)); _tmp0_ = self->target; gtk_widget_size_request ((GtkWidget*) _tmp0_, &_tmp1_); requisition = _tmp1_; _tmp2_ = self->target; _tmp3_ = pdfpc_view_pdf_get_renderer (_tmp2_); _tmp4_ = _tmp3_; _tmp5_ = pdfpc_renderer_base_get_metadata ((pdfpcRendererBase*) _tmp4_); _tmp6_ = PDFPC_METADATA_IS_PDF (_tmp5_) ? ((pdfpcMetadataPdf*) _tmp5_) : NULL; _g_object_unref0 (_tmp4_); metadata = _tmp6_; _tmp7_ = *poppler_rectangle; _tmp8_ = _tmp7_.x1; _tmp9_ = pdfpc_metadata_pdf_get_page_width (metadata); _tmp10_ = requisition; _tmp11_ = _tmp10_.width; _tmp12_ = ceil ((_tmp8_ / _tmp9_) * _tmp11_); gdk_rectangle.x = (gint) _tmp12_; _tmp13_ = *poppler_rectangle; _tmp14_ = _tmp13_.x2; _tmp15_ = *poppler_rectangle; _tmp16_ = _tmp15_.x1; _tmp17_ = pdfpc_metadata_pdf_get_page_height (metadata); _tmp18_ = requisition; _tmp19_ = _tmp18_.width; _tmp20_ = floor (((_tmp14_ - _tmp16_) / _tmp17_) * _tmp19_); gdk_rectangle.width = (gint) _tmp20_; _tmp21_ = pdfpc_metadata_pdf_get_page_height (metadata); _tmp22_ = *poppler_rectangle; _tmp23_ = _tmp22_.y2; _tmp24_ = pdfpc_metadata_pdf_get_page_height (metadata); _tmp25_ = requisition; _tmp26_ = _tmp25_.height; _tmp27_ = ceil (((_tmp21_ - _tmp23_) / _tmp24_) * _tmp26_); gdk_rectangle.y = (gint) _tmp27_; _tmp28_ = *poppler_rectangle; _tmp29_ = _tmp28_.y2; _tmp30_ = *poppler_rectangle; _tmp31_ = _tmp30_.y1; _tmp32_ = pdfpc_metadata_pdf_get_page_height (metadata); _tmp33_ = requisition; _tmp34_ = _tmp33_.height; _tmp35_ = floor (((_tmp29_ - _tmp31_) / _tmp32_) * _tmp34_); gdk_rectangle.height = (gint) _tmp35_; *result = gdk_rectangle; _g_object_unref0 (metadata); return; } /** * Called whenever a mouse button is pressed inside the View.Pdf * * Maybe a link has been clicked. Therefore we need to handle this. */ gboolean pdfpc_view_behaviour_pdf_link_signal_provider_on_button_press (pdfpcViewBehaviourPdfLinkSignalProvider* self, GtkWidget* source, GdkEventButton* e) { gboolean result = FALSE; GdkEventButton _tmp0_; guint _tmp1_; GdkEventButton _tmp2_; gdouble _tmp3_; GdkEventButton _tmp4_; gdouble _tmp5_; PopplerLinkMapping* _tmp6_ = NULL; PopplerLinkMapping* mapping; PopplerLinkMapping* _tmp7_; PopplerLinkMapping* _tmp8_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (source != NULL, FALSE); g_return_val_if_fail (e != NULL, FALSE); _tmp0_ = *e; _tmp1_ = _tmp0_.button; if (_tmp1_ != ((guint) 1)) { result = FALSE; return result; } _tmp2_ = *e; _tmp3_ = _tmp2_.x; _tmp4_ = *e; _tmp5_ = _tmp4_.y; _tmp6_ = pdfpc_view_behaviour_pdf_link_signal_provider_get_link_mapping_by_coordinates (self, _tmp3_, _tmp5_); mapping = _tmp6_; _tmp7_ = mapping; if (_tmp7_ == NULL) { result = FALSE; return result; } _tmp8_ = mapping; pdfpc_view_behaviour_pdf_link_signal_provider_handle_link_mapping (self, _tmp8_); result = TRUE; return result; } /** * Called whenever the mouse is moved on the surface of the View.Pdf * * The signal emitted by this method may for example be used to change * the mouse cursor if the pointer enters or leaves a link */ gboolean pdfpc_view_behaviour_pdf_link_signal_provider_on_mouse_move (pdfpcViewBehaviourPdfLinkSignalProvider* self, GtkWidget* source, GdkEventMotion* event) { gboolean result = FALSE; GdkEventMotion _tmp0_; gdouble _tmp1_; GdkEventMotion _tmp2_; gdouble _tmp3_; PopplerLinkMapping* _tmp4_ = NULL; PopplerLinkMapping* link_mapping; PopplerLinkMapping* _tmp5_; gboolean _tmp11_ = FALSE; PopplerLinkMapping* _tmp12_; gboolean _tmp15_; gboolean _tmp16_ = FALSE; PopplerLinkMapping* _tmp17_; gboolean _tmp19_; PopplerLinkMapping* _tmp26_; PopplerRectangle _tmp27_; GdkRectangle _tmp28_ = {0}; PopplerLinkMapping* _tmp29_; PopplerLinkMapping* _tmp30_; PopplerLinkMapping* _tmp31_ = NULL; PopplerLinkMapping* _tmp32_; PopplerRectangle _tmp33_; GdkRectangle _tmp34_ = {0}; PopplerLinkMapping* _tmp35_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (source != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE); _tmp0_ = *event; _tmp1_ = _tmp0_.x; _tmp2_ = *event; _tmp3_ = _tmp2_.y; _tmp4_ = pdfpc_view_behaviour_pdf_link_signal_provider_get_link_mapping_by_coordinates (self, _tmp1_, _tmp3_); link_mapping = _tmp4_; _tmp5_ = link_mapping; if (_tmp5_ == NULL) { PopplerLinkMapping* _tmp6_; _tmp6_ = self->active_mapping; if (_tmp6_ != NULL) { PopplerLinkMapping* _tmp7_; PopplerRectangle _tmp8_; GdkRectangle _tmp9_ = {0}; PopplerLinkMapping* _tmp10_; _tmp7_ = self->active_mapping; _tmp8_ = _tmp7_->area; pdfpc_view_behaviour_pdf_link_signal_provider_convert_poppler_rectangle_to_gdk_rectangle (self, &_tmp8_, &_tmp9_); _tmp10_ = self->active_mapping; g_signal_emit_by_name (self, "link-mouse-leave", &_tmp9_, _tmp10_); __vala_PopplerLinkMapping_free0 (self->active_mapping); self->active_mapping = NULL; } result = FALSE; return result; } _tmp12_ = link_mapping; if (_tmp12_ != NULL) { PopplerLinkMapping* _tmp13_; PopplerLinkMapping* _tmp14_; _tmp13_ = link_mapping; _tmp14_ = self->active_mapping; _tmp11_ = _tmp13_ == _tmp14_; } else { _tmp11_ = FALSE; } _tmp15_ = _tmp11_; if (_tmp15_) { result = FALSE; return result; } _tmp17_ = link_mapping; if (_tmp17_ != NULL) { PopplerLinkMapping* _tmp18_; _tmp18_ = self->active_mapping; _tmp16_ = _tmp18_ == NULL; } else { _tmp16_ = FALSE; } _tmp19_ = _tmp16_; if (_tmp19_) { PopplerLinkMapping* _tmp20_; PopplerLinkMapping* _tmp21_ = NULL; PopplerLinkMapping* _tmp22_; PopplerRectangle _tmp23_; GdkRectangle _tmp24_ = {0}; PopplerLinkMapping* _tmp25_; _tmp20_ = link_mapping; _tmp21_ = poppler_link_mapping_copy (_tmp20_); __vala_PopplerLinkMapping_free0 (self->active_mapping); self->active_mapping = _tmp21_; _tmp22_ = self->active_mapping; _tmp23_ = _tmp22_->area; pdfpc_view_behaviour_pdf_link_signal_provider_convert_poppler_rectangle_to_gdk_rectangle (self, &_tmp23_, &_tmp24_); _tmp25_ = self->active_mapping; g_signal_emit_by_name (self, "link-mouse-enter", &_tmp24_, _tmp25_); result = FALSE; return result; } _tmp26_ = self->active_mapping; _tmp27_ = _tmp26_->area; pdfpc_view_behaviour_pdf_link_signal_provider_convert_poppler_rectangle_to_gdk_rectangle (self, &_tmp27_, &_tmp28_); _tmp29_ = self->active_mapping; g_signal_emit_by_name (self, "link-mouse-leave", &_tmp28_, _tmp29_); _tmp30_ = link_mapping; _tmp31_ = poppler_link_mapping_copy (_tmp30_); __vala_PopplerLinkMapping_free0 (self->active_mapping); self->active_mapping = _tmp31_; _tmp32_ = self->active_mapping; _tmp33_ = _tmp32_->area; pdfpc_view_behaviour_pdf_link_signal_provider_convert_poppler_rectangle_to_gdk_rectangle (self, &_tmp33_, &_tmp34_); _tmp35_ = self->active_mapping; g_signal_emit_by_name (self, "link-mouse-enter", &_tmp34_, _tmp35_); result = FALSE; return result; } /** * Handle newly entered pdf pages to create a link mapping table for * further requests and checks. */ static PopplerLinkMapping* _vala_PopplerLinkMapping_copy (PopplerLinkMapping* self) { return g_boxed_copy (poppler_link_mapping_get_type (), self); } static gpointer __vala_PopplerLinkMapping_copy0 (gpointer self) { return self ? _vala_PopplerLinkMapping_copy (self) : NULL; } void pdfpc_view_behaviour_pdf_link_signal_provider_on_entering_slide (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewBase* source, gint page_number) { gboolean in_range; GMutex* _tmp0_; pdfpcViewBase* _tmp1_; pdfpcRendererBase* _tmp2_ = NULL; pdfpcRendererBase* _tmp3_; pdfpcMetadataBase* _tmp4_ = NULL; pdfpcMetadataPdf* _tmp5_; pdfpcMetadataPdf* metadata; gint _tmp6_; pdfpcMetadataPdf* _tmp7_; guint _tmp8_ = 0U; GMutex* _tmp17_; gboolean _tmp18_; GList* _tmp19_; guint _tmp20_ = 0U; g_return_if_fail (self != NULL); g_return_if_fail (source != NULL); in_range = TRUE; _tmp0_ = pdfpc_mutex_locks_poppler; g_mutex_lock (_tmp0_); _tmp1_ = source; _tmp2_ = pdfpc_view_base_get_renderer (_tmp1_); _tmp3_ = _tmp2_; _tmp4_ = pdfpc_renderer_base_get_metadata (_tmp3_); _tmp5_ = PDFPC_METADATA_IS_PDF (_tmp4_) ? ((pdfpcMetadataPdf*) _tmp4_) : NULL; _g_object_unref0 (_tmp3_); metadata = _tmp5_; _tmp6_ = page_number; _tmp7_ = metadata; _tmp8_ = pdfpc_metadata_base_get_slide_count ((pdfpcMetadataBase*) _tmp7_); if (((guint) _tmp6_) < _tmp8_) { pdfpcMetadataPdf* _tmp9_; PopplerDocument* _tmp10_ = NULL; PopplerDocument* _tmp11_; gint _tmp12_; PopplerPage* _tmp13_ = NULL; PopplerPage* _tmp14_; PopplerPage* page; PopplerPage* _tmp15_; GList* _tmp16_ = NULL; _tmp9_ = metadata; _tmp10_ = pdfpc_metadata_pdf_get_document (_tmp9_); _tmp11_ = _tmp10_; _tmp12_ = page_number; _tmp13_ = poppler_document_get_page (_tmp11_, _tmp12_); _tmp14_ = _tmp13_; _g_object_unref0 (_tmp11_); page = _tmp14_; _tmp15_ = page; _tmp16_ = poppler_page_get_link_mapping (_tmp15_); __g_list_free___vala_PopplerLinkMapping_free0_0 (self->page_link_mappings); self->page_link_mappings = _tmp16_; _g_object_unref0 (page); } else { __g_list_free___vala_PopplerLinkMapping_free0_0 (self->page_link_mappings); self->page_link_mappings = NULL; in_range = FALSE; } _tmp17_ = pdfpc_mutex_locks_poppler; g_mutex_unlock (_tmp17_); _tmp18_ = in_range; if (!_tmp18_) { _g_object_unref0 (metadata); return; } _tmp19_ = self->page_link_mappings; _tmp20_ = g_list_length (_tmp19_); if (_tmp20_ > ((guint) 0)) { GList* _tmp21_; guint _tmp22_ = 0U; GdkRectangle* _tmp23_ = NULL; gint i; GList* _tmp24_; _tmp21_ = self->page_link_mappings; _tmp22_ = g_list_length (_tmp21_); _tmp23_ = g_new0 (GdkRectangle, _tmp22_); self->precalculated_mapping_rectangles = (g_free (self->precalculated_mapping_rectangles), NULL); self->precalculated_mapping_rectangles = _tmp23_; self->precalculated_mapping_rectangles_length1 = _tmp22_; i = 0; _tmp24_ = self->page_link_mappings; { GList* mapping_collection = NULL; GList* mapping_it = NULL; mapping_collection = _tmp24_; for (mapping_it = mapping_collection; mapping_it != NULL; mapping_it = mapping_it->next) { PopplerLinkMapping* _tmp25_; PopplerLinkMapping* mapping = NULL; _tmp25_ = __vala_PopplerLinkMapping_copy0 ((PopplerLinkMapping*) mapping_it->data); mapping = _tmp25_; { GdkRectangle* _tmp26_; gint _tmp26__length1; gint _tmp27_; PopplerLinkMapping* _tmp28_; PopplerRectangle _tmp29_; GdkRectangle _tmp30_ = {0}; GdkRectangle _tmp31_; _tmp26_ = self->precalculated_mapping_rectangles; _tmp26__length1 = self->precalculated_mapping_rectangles_length1; _tmp27_ = i; i = _tmp27_ + 1; _tmp28_ = mapping; _tmp29_ = _tmp28_->area; pdfpc_view_behaviour_pdf_link_signal_provider_convert_poppler_rectangle_to_gdk_rectangle (self, &_tmp29_, &_tmp30_); _tmp26_[_tmp27_] = _tmp30_; _tmp31_ = _tmp26_[_tmp27_]; __vala_PopplerLinkMapping_free0 (mapping); } } } } _g_object_unref0 (metadata); } /** * Free the allocated link mapping tables, which were created on page * entering */ void pdfpc_view_behaviour_pdf_link_signal_provider_on_leaving_slide (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewBase* source, gint from, gint to) { g_return_if_fail (self != NULL); g_return_if_fail (source != NULL); self->precalculated_mapping_rectangles = (g_free (self->precalculated_mapping_rectangles), NULL); self->precalculated_mapping_rectangles = NULL; self->precalculated_mapping_rectangles_length1 = 0; } pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_construct (GType object_type) { pdfpcViewBehaviourPdfLinkSignalProvider * self = NULL; self = (pdfpcViewBehaviourPdfLinkSignalProvider*) g_object_new (object_type, NULL); return self; } pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_new (void) { return pdfpc_view_behaviour_pdf_link_signal_provider_construct (PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER); } static void g_cclosure_user_marshal_VOID__BOXED_UINT_UINT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__BOXED_UINT_UINT) (gpointer data1, gpointer arg_1, guint arg_2, guint arg_3, gpointer data2); register GMarshalFunc_VOID__BOXED_UINT_UINT callback; register GCClosure * cc; register gpointer data1; register gpointer data2; cc = (GCClosure *) closure; g_return_if_fail (n_param_values == 4); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = param_values->data[0].v_pointer; } else { data1 = param_values->data[0].v_pointer; data2 = closure->data; } callback = (GMarshalFunc_VOID__BOXED_UINT_UINT) (marshal_data ? marshal_data : cc->callback); callback (data1, g_value_get_boxed (param_values + 1), g_value_get_uint (param_values + 2), g_value_get_uint (param_values + 3), data2); } static void g_cclosure_user_marshal_VOID__BOXED_UINT_STRING_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__BOXED_UINT_STRING_STRING) (gpointer data1, gpointer arg_1, guint arg_2, const char* arg_3, const char* arg_4, gpointer data2); register GMarshalFunc_VOID__BOXED_UINT_STRING_STRING callback; register GCClosure * cc; register gpointer data1; register gpointer data2; cc = (GCClosure *) closure; g_return_if_fail (n_param_values == 5); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = param_values->data[0].v_pointer; } else { data1 = param_values->data[0].v_pointer; data2 = closure->data; } callback = (GMarshalFunc_VOID__BOXED_UINT_STRING_STRING) (marshal_data ? marshal_data : cc->callback); callback (data1, g_value_get_boxed (param_values + 1), g_value_get_uint (param_values + 2), g_value_get_string (param_values + 3), g_value_get_string (param_values + 4), data2); } static void g_cclosure_user_marshal_VOID__BOXED_BOXED (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__BOXED_BOXED) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__BOXED_BOXED callback; register GCClosure * cc; register gpointer data1; register gpointer data2; cc = (GCClosure *) closure; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = param_values->data[0].v_pointer; } else { data1 = param_values->data[0].v_pointer; data2 = closure->data; } callback = (GMarshalFunc_VOID__BOXED_BOXED) (marshal_data ? marshal_data : cc->callback); callback (data1, g_value_get_boxed (param_values + 1), g_value_get_boxed (param_values + 2), data2); } static void pdfpc_view_behaviour_pdf_link_signal_provider_class_init (pdfpcViewBehaviourPdfLinkSignalProviderClass * klass) { pdfpc_view_behaviour_pdf_link_signal_provider_parent_class = g_type_class_peek_parent (klass); G_OBJECT_CLASS (klass)->finalize = pdfpc_view_behaviour_pdf_link_signal_provider_finalize; /** * Emitted whenever a link on a pdf page is clicked, which should * trigger a document internal switch to another page. */ g_signal_new ("clicked_internal_link", PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__BOXED_UINT_UINT, G_TYPE_NONE, 3, GDK_TYPE_RECTANGLE, G_TYPE_UINT, G_TYPE_UINT); /** * Emitted whenever a link on a pdf page is clicked, which should * execute an external command. * * Be careful while handling these, as requested code to be execute may * be malicious. */ g_signal_new ("clicked_external_command", PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__BOXED_UINT_STRING_STRING, G_TYPE_NONE, 4, GDK_TYPE_RECTANGLE, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); /** * Emitted whenever the mouse entered a pdf link */ g_signal_new ("link_mouse_enter", PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__BOXED_BOXED, G_TYPE_NONE, 2, GDK_TYPE_RECTANGLE, poppler_link_mapping_get_type ()); /** * Emitted whenever the mouse left a pdf link */ g_signal_new ("link_mouse_leave", PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__BOXED_BOXED, G_TYPE_NONE, 2, GDK_TYPE_RECTANGLE, poppler_link_mapping_get_type ()); } static void pdfpc_view_behaviour_pdf_link_signal_provider_instance_init (pdfpcViewBehaviourPdfLinkSignalProvider * self) { self->target = NULL; self->active_mapping = NULL; self->page_link_mappings = NULL; self->precalculated_mapping_rectangles = NULL; } static void pdfpc_view_behaviour_pdf_link_signal_provider_finalize (GObject* obj) { pdfpcViewBehaviourPdfLinkSignalProvider * self; self = PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER (obj); _g_object_unref0 (self->target); __vala_PopplerLinkMapping_free0 (self->active_mapping); __g_list_free___vala_PopplerLinkMapping_free0_0 (self->page_link_mappings); self->precalculated_mapping_rectangles = (g_free (self->precalculated_mapping_rectangles), NULL); G_OBJECT_CLASS (pdfpc_view_behaviour_pdf_link_signal_provider_parent_class)->finalize (obj); } /** * Access provider to all signals related to PDF links. */ GType pdfpc_view_behaviour_pdf_link_signal_provider_get_type (void) { static volatile gsize pdfpc_view_behaviour_pdf_link_signal_provider_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_view_behaviour_pdf_link_signal_provider_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcViewBehaviourPdfLinkSignalProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_view_behaviour_pdf_link_signal_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcViewBehaviourPdfLinkSignalProvider), 0, (GInstanceInitFunc) pdfpc_view_behaviour_pdf_link_signal_provider_instance_init, NULL }; GType pdfpc_view_behaviour_pdf_link_signal_provider_type_id; pdfpc_view_behaviour_pdf_link_signal_provider_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcViewBehaviourPdfLinkSignalProvider", &g_define_type_info, 0); g_once_init_leave (&pdfpc_view_behaviour_pdf_link_signal_provider_type_id__volatile, pdfpc_view_behaviour_pdf_link_signal_provider_type_id); } return pdfpc_view_behaviour_pdf_link_signal_provider_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/view/default.c000066400000000000000000000760771177613036100216560ustar00rootroot00000000000000/* default.c generated by valac 0.16.0, the Vala compiler * generated from default.vala, do not modify */ #include #include #include #include #include #include #include #define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ()) #define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase)) #define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) #define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) typedef struct _pdfpcViewBase pdfpcViewBase; typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass; typedef struct _pdfpcViewBasePrivate pdfpcViewBasePrivate; #define PDFPC_RENDERER_TYPE_BASE (pdfpc_renderer_base_get_type ()) #define PDFPC_RENDERER_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBase)) #define PDFPC_RENDERER_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) #define PDFPC_RENDERER_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) typedef struct _pdfpcRendererBase pdfpcRendererBase; typedef struct _pdfpcRendererBaseClass pdfpcRendererBaseClass; #define PDFPC_VIEW_TYPE_PRERENDERING (pdfpc_view_prerendering_get_type ()) #define PDFPC_VIEW_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerendering)) #define PDFPC_VIEW_IS_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PRERENDERING)) #define PDFPC_VIEW_PRERENDERING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerenderingIface)) typedef struct _pdfpcViewPrerendering pdfpcViewPrerendering; typedef struct _pdfpcViewPrerenderingIface pdfpcViewPrerenderingIface; #define PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE (pdfpc_view_behaviour_decoratable_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_DECORATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE, pdfpcViewBehaviourDecoratable)) #define PDFPC_VIEW_BEHAVIOUR_IS_DECORATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE)) #define PDFPC_VIEW_BEHAVIOUR_DECORATABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE, pdfpcViewBehaviourDecoratableIface)) typedef struct _pdfpcViewBehaviourDecoratable pdfpcViewBehaviourDecoratable; typedef struct _pdfpcViewBehaviourDecoratableIface pdfpcViewBehaviourDecoratableIface; #define PDFPC_VIEW_BEHAVIOUR_TYPE_BASE (pdfpc_view_behaviour_base_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBase)) #define PDFPC_VIEW_BEHAVIOUR_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) typedef struct _pdfpcViewBehaviourBase pdfpcViewBehaviourBase; typedef struct _pdfpcViewBehaviourBaseClass pdfpcViewBehaviourBaseClass; #define PDFPC_VIEW_TYPE_DEFAULT (pdfpc_view_default_get_type ()) #define PDFPC_VIEW_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefault)) #define PDFPC_VIEW_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) #define PDFPC_VIEW_IS_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_IS_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) typedef struct _pdfpcViewDefault pdfpcViewDefault; typedef struct _pdfpcViewDefaultClass pdfpcViewDefaultClass; typedef struct _pdfpcViewDefaultPrivate pdfpcViewDefaultPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL))) #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) #define PDFPC_RENDERER_TYPE_CACHING (pdfpc_renderer_caching_get_type ()) #define PDFPC_RENDERER_CACHING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCaching)) #define PDFPC_RENDERER_IS_CACHING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_CACHING)) #define PDFPC_RENDERER_CACHING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCachingIface)) typedef struct _pdfpcRendererCaching pdfpcRendererCaching; typedef struct _pdfpcRendererCachingIface pdfpcRendererCachingIface; #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; typedef struct _Block1Data Block1Data; #define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL))) typedef enum { PDFPC_RENDERER_RENDER_ERROR_SLIDE_DOES_NOT_EXIST } pdfpcRendererRenderError; #define PDFPC_RENDERER_RENDER_ERROR pdfpc_renderer_render_error_quark () struct _pdfpcViewBase { GtkDrawingArea parent_instance; pdfpcViewBasePrivate * priv; pdfpcRendererBase* renderer; }; struct _pdfpcViewBaseClass { GtkDrawingAreaClass parent_class; void (*display) (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); void (*fade_to_black) (pdfpcViewBase* self); void (*redraw) (pdfpcViewBase* self, GError** error); gint (*get_current_slide_number) (pdfpcViewBase* self); }; struct _pdfpcViewPrerenderingIface { GTypeInterface parent_iface; }; struct _pdfpcViewBehaviourDecoratableIface { GTypeInterface parent_iface; void (*associate_behaviour) (pdfpcViewBehaviourDecoratable* self, pdfpcViewBehaviourBase* behaviour); }; struct _pdfpcViewDefault { pdfpcViewBase parent_instance; pdfpcViewDefaultPrivate * priv; gint current_slide_number; GdkPixmap* current_slide; gint n_slides; gint slide_limit; GList* behaviours; }; struct _pdfpcViewDefaultClass { pdfpcViewBaseClass parent_class; }; struct _pdfpcRendererCachingIface { GTypeInterface parent_iface; void (*set_cache) (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* (*get_cache) (pdfpcRendererCaching* self); }; struct _Block1Data { int _ref_count_; pdfpcViewDefault * self; gint* i; guint page_count; }; typedef enum { PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_BEHAVIOUR_ALREADY_ASSOCIATED, PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_VIEW_NOT_SUPPORTED } pdfpcViewBehaviourAssociationError; #define PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR pdfpc_view_behaviour_association_error_quark () static gpointer pdfpc_view_default_parent_class = NULL; static pdfpcViewPrerenderingIface* pdfpc_view_default_pdfpc_view_prerendering_parent_iface = NULL; static pdfpcViewBehaviourDecoratableIface* pdfpc_view_default_pdfpc_view_behaviour_decoratable_parent_iface = NULL; GType pdfpc_view_base_get_type (void) G_GNUC_CONST; GQuark pdfpc_renderer_render_error_quark (void); GType pdfpc_renderer_base_get_type (void) G_GNUC_CONST; GType pdfpc_view_prerendering_get_type (void) G_GNUC_CONST; GType pdfpc_view_behaviour_base_get_type (void) G_GNUC_CONST; GType pdfpc_view_behaviour_decoratable_get_type (void) G_GNUC_CONST; GType pdfpc_view_default_get_type (void) G_GNUC_CONST; enum { PDFPC_VIEW_DEFAULT_DUMMY_PROPERTY }; static void _g_object_unref0_ (gpointer var); static void _g_list_free__g_object_unref0_ (GList* self); pdfpcViewDefault* pdfpc_view_default_new (pdfpcRendererBase* renderer); pdfpcViewDefault* pdfpc_view_default_construct (GType object_type, pdfpcRendererBase* renderer); pdfpcViewBase* pdfpc_view_base_construct (GType object_type, pdfpcRendererBase* renderer); GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; pdfpcMetadataBase* pdfpc_renderer_base_get_metadata (pdfpcRendererBase* self); guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self); static void __lambda5_ (pdfpcViewDefault* self); void pdfpc_view_base_display (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_caching_get_type (void) G_GNUC_CONST; pdfpcRendererCacheBase* pdfpc_renderer_caching_get_cache (pdfpcRendererCaching* self); gboolean pdfpc_renderer_cache_base_allows_prerendering (pdfpcRendererCacheBase* self); void pdfpc_view_default_register_prerendering (pdfpcViewDefault* self); static void ___lambda5__gtk_widget_realize (GtkWidget* _sender, gpointer self); static Block1Data* block1_data_ref (Block1Data* _data1_); static void block1_data_unref (void * _userdata_); pdfpcRendererBase* pdfpc_view_base_get_renderer (pdfpcViewBase* self); static gboolean __lambda6_ (Block1Data* _data1_); GdkPixmap* pdfpc_renderer_base_render_to_pixmap (pdfpcRendererBase* self, gint slide_number, GError** error); static gboolean ___lambda6__gsource_func (gpointer self); static void pdfpc_view_default_real_associate_behaviour (pdfpcViewBehaviourDecoratable* base, pdfpcViewBehaviourBase* behaviour); GQuark pdfpc_view_behaviour_association_error_quark (void); void pdfpc_view_behaviour_base_associate (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); static void pdfpc_view_default_real_display (pdfpcViewBase* base, gint slide_number, gboolean force_redraw, GError** error); GdkPixmap* pdfpc_renderer_base_fade_to_black (pdfpcRendererBase* self); gint pdfpc_renderer_base_get_width (pdfpcRendererBase* self); gint pdfpc_renderer_base_get_height (pdfpcRendererBase* self); static void pdfpc_view_default_real_fade_to_black (pdfpcViewBase* base); static void pdfpc_view_default_real_redraw (pdfpcViewBase* base, GError** error); static gint pdfpc_view_default_real_get_current_slide_number (pdfpcViewBase* base); static gboolean pdfpc_view_default_real_expose_event (GtkWidget* base, GdkEventExpose* event); static void pdfpc_view_default_finalize (GObject* obj); static void _g_object_unref0_ (gpointer var) { (var == NULL) ? NULL : (var = (g_object_unref (var), NULL)); } static void _g_list_free__g_object_unref0_ (GList* self) { g_list_foreach (self, (GFunc) _g_object_unref0_, NULL); g_list_free (self); } /** * Base constructor taking the renderer to use as an argument */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } static void __lambda5_ (pdfpcViewDefault* self) { pdfpcRendererBase* _tmp3_; pdfpcRendererCaching* _tmp4_; pdfpcRendererCaching* caching_renderer; gboolean _tmp5_ = FALSE; gboolean _tmp6_ = FALSE; pdfpcRendererCaching* _tmp7_; gboolean _tmp11_; gboolean _tmp16_; GError * _inner_error_ = NULL; { gint _tmp0_; _tmp0_ = self->current_slide_number; pdfpc_view_base_display ((pdfpcViewBase*) self, _tmp0_, FALSE, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { goto __catch6_pdfpc_renderer_render_error; } g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } goto __finally6; __catch6_pdfpc_renderer_render_error: { GError* e = NULL; gint _tmp1_; const gchar* _tmp2_; e = _inner_error_; _inner_error_ = NULL; _tmp1_ = self->current_slide_number; _tmp2_ = e->message; g_error ("default.vala:79: Could not render initial page %d: %s", _tmp1_, _tmp2_); _g_error_free0 (e); } __finally6: if (_inner_error_ != NULL) { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } _tmp3_ = ((pdfpcViewBase*) self)->renderer; _tmp4_ = _g_object_ref0 (PDFPC_RENDERER_IS_CACHING (_tmp3_) ? ((pdfpcRendererCaching*) _tmp3_) : NULL); caching_renderer = _tmp4_; _tmp7_ = caching_renderer; if (_tmp7_ != NULL) { pdfpcRendererCaching* _tmp8_; pdfpcRendererCacheBase* _tmp9_ = NULL; pdfpcRendererCacheBase* _tmp10_; _tmp8_ = caching_renderer; _tmp9_ = pdfpc_renderer_caching_get_cache (_tmp8_); _tmp10_ = _tmp9_; _tmp6_ = _tmp10_ != NULL; _g_object_unref0 (_tmp10_); } else { _tmp6_ = FALSE; } _tmp11_ = _tmp6_; if (_tmp11_) { pdfpcRendererCaching* _tmp12_; pdfpcRendererCacheBase* _tmp13_ = NULL; pdfpcRendererCacheBase* _tmp14_; gboolean _tmp15_ = FALSE; _tmp12_ = caching_renderer; _tmp13_ = pdfpc_renderer_caching_get_cache (_tmp12_); _tmp14_ = _tmp13_; _tmp15_ = pdfpc_renderer_cache_base_allows_prerendering (_tmp14_); _tmp5_ = _tmp15_; _g_object_unref0 (_tmp14_); } else { _tmp5_ = FALSE; } _tmp16_ = _tmp5_; if (_tmp16_) { pdfpc_view_default_register_prerendering (self); } _g_object_unref0 (caching_renderer); } static void ___lambda5__gtk_widget_realize (GtkWidget* _sender, gpointer self) { __lambda5_ (self); } pdfpcViewDefault* pdfpc_view_default_construct (GType object_type, pdfpcRendererBase* renderer) { pdfpcViewDefault * self = NULL; pdfpcRendererBase* _tmp0_; pdfpcRendererBase* _tmp1_; pdfpcMetadataBase* _tmp2_ = NULL; pdfpcMetadataBase* _tmp3_; guint _tmp4_ = 0U; gint _tmp5_; g_return_val_if_fail (renderer != NULL, NULL); _tmp0_ = renderer; self = (pdfpcViewDefault*) pdfpc_view_base_construct (object_type, _tmp0_); gtk_widget_set_double_buffered ((GtkWidget*) self, FALSE); self->current_slide_number = 0; _tmp1_ = renderer; _tmp2_ = pdfpc_renderer_base_get_metadata (_tmp1_); _tmp3_ = _tmp2_; _tmp4_ = pdfpc_metadata_base_get_slide_count (_tmp3_); self->n_slides = (gint) _tmp4_; _g_object_unref0 (_tmp3_); _tmp5_ = self->n_slides; self->slide_limit = _tmp5_ + 1; gtk_widget_add_events ((GtkWidget*) self, (gint) GDK_STRUCTURE_MASK); g_signal_connect_object ((GtkWidget*) self, "realize", (GCallback) ___lambda5__gtk_widget_realize, self, 0); return self; } pdfpcViewDefault* pdfpc_view_default_new (pdfpcRendererBase* renderer) { return pdfpc_view_default_construct (PDFPC_VIEW_TYPE_DEFAULT, renderer); } /** * Start a thread to prerender all slides this view might display at * some time. * * This method may only be called from within the Gtk event loop, as * thread handling is borked otherwise. */ static Block1Data* block1_data_ref (Block1Data* _data1_) { g_atomic_int_inc (&_data1_->_ref_count_); return _data1_; } static void block1_data_unref (void * _userdata_) { Block1Data* _data1_; _data1_ = (Block1Data*) _userdata_; if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) { pdfpcViewDefault * self; self = _data1_->self; _g_object_unref0 (self); g_slice_free (Block1Data, _data1_); } } static gboolean __lambda6_ (Block1Data* _data1_) { pdfpcViewDefault * self; gboolean result = FALSE; gint _tmp7_; GError * _inner_error_ = NULL; self = _data1_->self; if (_data1_->i == NULL) { void* _tmp0_ = NULL; gint _tmp1_; _tmp0_ = g_malloc ((gsize) sizeof (gint)); _data1_->i = _tmp0_; *_data1_->i = 0; _tmp1_ = *_data1_->i; } { pdfpcRendererBase* _tmp2_ = NULL; pdfpcRendererBase* _tmp3_; GdkPixmap* _tmp4_ = NULL; GdkPixmap* _tmp5_; _tmp2_ = pdfpc_view_base_get_renderer ((pdfpcViewBase*) self); _tmp3_ = _tmp2_; _tmp4_ = pdfpc_renderer_base_render_to_pixmap (_tmp3_, *_data1_->i, &_inner_error_); _tmp5_ = _tmp4_; _g_object_unref0 (_tmp5_); _g_object_unref0 (_tmp3_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { goto __catch7_pdfpc_renderer_render_error; } g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return FALSE; } } goto __finally7; __catch7_pdfpc_renderer_render_error: { GError* e = NULL; const gchar* _tmp6_; e = _inner_error_; _inner_error_ = NULL; _tmp6_ = e->message; g_error ("default.vala:127: Could not render page '%i' while pre-rendering: %s", *_data1_->i, _tmp6_); _g_error_free0 (e); } __finally7: if (_inner_error_ != NULL) { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return FALSE; } g_signal_emit_by_name ((pdfpcViewPrerendering*) self, "slide-prerendered"); *_data1_->i = (*_data1_->i) + 1; _tmp7_ = *_data1_->i; if (((guint) (*_data1_->i)) >= _data1_->page_count) { g_signal_emit_by_name ((pdfpcViewPrerendering*) self, "prerendering-completed"); g_free (_data1_->i); result = FALSE; return result; } else { result = TRUE; return result; } } static gboolean ___lambda6__gsource_func (gpointer self) { gboolean result; result = __lambda6_ (self); return result; } void pdfpc_view_default_register_prerendering (pdfpcViewDefault* self) { Block1Data* _data1_; pdfpcRendererBase* _tmp0_ = NULL; pdfpcRendererBase* _tmp1_; pdfpcMetadataBase* _tmp2_ = NULL; pdfpcMetadataBase* _tmp3_; guint _tmp4_ = 0U; guint _tmp5_; g_return_if_fail (self != NULL); _data1_ = g_slice_new0 (Block1Data); _data1_->_ref_count_ = 1; _data1_->self = g_object_ref (self); _data1_->i = NULL; _tmp0_ = pdfpc_view_base_get_renderer ((pdfpcViewBase*) self); _tmp1_ = _tmp0_; _tmp2_ = pdfpc_renderer_base_get_metadata (_tmp1_); _tmp3_ = _tmp2_; _tmp4_ = pdfpc_metadata_base_get_slide_count (_tmp3_); _tmp5_ = _tmp4_; _g_object_unref0 (_tmp3_); _g_object_unref0 (_tmp1_); _data1_->page_count = _tmp5_; g_signal_emit_by_name ((pdfpcViewPrerendering*) self, "prerendering-started"); g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda6__gsource_func, block1_data_ref (_data1_), block1_data_unref); block1_data_unref (_data1_); _data1_ = NULL; } /** * Associate a new Behaviour with this View * * The implementation supports an arbitrary amount of different * behaviours. */ static void pdfpc_view_default_real_associate_behaviour (pdfpcViewBehaviourDecoratable* base, pdfpcViewBehaviourBase* behaviour) { pdfpcViewDefault * self; pdfpcViewBehaviourBase* _tmp0_; pdfpcViewBehaviourBase* _tmp1_; GError * _inner_error_ = NULL; self = (pdfpcViewDefault*) base; g_return_if_fail (behaviour != NULL); _tmp0_ = behaviour; _tmp1_ = _g_object_ref0 (_tmp0_); self->behaviours = g_list_append (self->behaviours, _tmp1_); { pdfpcViewBehaviourBase* _tmp2_; _tmp2_ = behaviour; pdfpc_view_behaviour_base_associate (_tmp2_, (pdfpcViewBase*) self, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR) { goto __catch8_pdfpc_view_behaviour_association_error; } g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } goto __finally8; __catch8_pdfpc_view_behaviour_association_error: { GError* e = NULL; const gchar* _tmp3_; e = _inner_error_; _inner_error_ = NULL; _tmp3_ = e->message; g_error ("default.vala:159: Behaviour association failure: %s", _tmp3_); _g_error_free0 (e); } __finally8: if (_inner_error_ != NULL) { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } /** * Display a specific slide number * * If the slide number does not exist a * RenderError.SLIDE_DOES_NOT_EXIST is thrown */ static void pdfpc_view_default_real_display (pdfpcViewBase* base, gint slide_number, gboolean force_redraw, GError** error) { pdfpcViewDefault * self; gint _tmp0_; gint _tmp1_; gint _tmp2_; gboolean _tmp4_ = FALSE; gboolean _tmp5_ = FALSE; gboolean _tmp6_; gboolean _tmp9_; gboolean _tmp11_; gint _tmp12_; gint _tmp13_; gint _tmp14_; gint _tmp15_; gint _tmp22_; pdfpcRendererBase* _tmp23_; gint _tmp24_ = 0; pdfpcRendererBase* _tmp25_; gint _tmp26_ = 0; gint _tmp27_; GError * _inner_error_ = NULL; self = (pdfpcViewDefault*) base; _tmp0_ = slide_number; if (_tmp0_ < 0) { slide_number = 0; } _tmp1_ = slide_number; _tmp2_ = self->slide_limit; if (_tmp1_ >= _tmp2_) { gint _tmp3_; _tmp3_ = self->slide_limit; slide_number = _tmp3_ - 1; } _tmp6_ = force_redraw; if (!_tmp6_) { gint _tmp7_; gint _tmp8_; _tmp7_ = slide_number; _tmp8_ = self->current_slide_number; _tmp5_ = _tmp7_ == _tmp8_; } else { _tmp5_ = FALSE; } _tmp9_ = _tmp5_; if (_tmp9_) { GdkPixmap* _tmp10_; _tmp10_ = self->current_slide; _tmp4_ = _tmp10_ != NULL; } else { _tmp4_ = FALSE; } _tmp11_ = _tmp4_; if (_tmp11_) { return; } _tmp12_ = self->current_slide_number; _tmp13_ = slide_number; g_signal_emit_by_name ((pdfpcViewBase*) self, "leaving-slide", _tmp12_, _tmp13_); _tmp14_ = slide_number; _tmp15_ = self->n_slides; if (_tmp14_ < _tmp15_) { pdfpcRendererBase* _tmp16_; gint _tmp17_; GdkPixmap* _tmp18_ = NULL; GdkPixmap* _tmp19_; _tmp16_ = ((pdfpcViewBase*) self)->renderer; _tmp17_ = slide_number; _tmp18_ = pdfpc_renderer_base_render_to_pixmap (_tmp16_, _tmp17_, &_inner_error_); _tmp19_ = _tmp18_; if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { g_propagate_error (error, _inner_error_); return; } else { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } _g_object_unref0 (self->current_slide); self->current_slide = _tmp19_; } else { pdfpcRendererBase* _tmp20_; GdkPixmap* _tmp21_ = NULL; _tmp20_ = ((pdfpcViewBase*) self)->renderer; _tmp21_ = pdfpc_renderer_base_fade_to_black (_tmp20_); _g_object_unref0 (self->current_slide); self->current_slide = _tmp21_; } _tmp22_ = slide_number; self->current_slide_number = _tmp22_; _tmp23_ = ((pdfpcViewBase*) self)->renderer; _tmp24_ = pdfpc_renderer_base_get_width (_tmp23_); _tmp25_ = ((pdfpcViewBase*) self)->renderer; _tmp26_ = pdfpc_renderer_base_get_height (_tmp25_); gtk_widget_queue_draw_area ((GtkWidget*) self, 0, 0, _tmp24_, _tmp26_); _tmp27_ = self->current_slide_number; g_signal_emit_by_name ((pdfpcViewBase*) self, "entering-slide", _tmp27_); } /** * Fill everything with black */ static void pdfpc_view_default_real_fade_to_black (pdfpcViewBase* base) { pdfpcViewDefault * self; pdfpcRendererBase* _tmp0_; GdkPixmap* _tmp1_ = NULL; pdfpcRendererBase* _tmp2_; gint _tmp3_ = 0; pdfpcRendererBase* _tmp4_; gint _tmp5_ = 0; self = (pdfpcViewDefault*) base; _tmp0_ = ((pdfpcViewBase*) self)->renderer; _tmp1_ = pdfpc_renderer_base_fade_to_black (_tmp0_); _g_object_unref0 (self->current_slide); self->current_slide = _tmp1_; _tmp2_ = ((pdfpcViewBase*) self)->renderer; _tmp3_ = pdfpc_renderer_base_get_width (_tmp2_); _tmp4_ = ((pdfpcViewBase*) self)->renderer; _tmp5_ = pdfpc_renderer_base_get_height (_tmp4_); gtk_widget_queue_draw_area ((GtkWidget*) self, 0, 0, _tmp3_, _tmp5_); } /** * Redraw the current slide. Useful for example when exiting from fade_to_black */ static void pdfpc_view_default_real_redraw (pdfpcViewBase* base, GError** error) { pdfpcViewDefault * self; gint _tmp0_; GError * _inner_error_ = NULL; self = (pdfpcViewDefault*) base; _tmp0_ = self->current_slide_number; pdfpc_view_base_display ((pdfpcViewBase*) self, _tmp0_, TRUE, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { g_propagate_error (error, _inner_error_); return; } else { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } } /** * Return the currently shown slide number */ static gint pdfpc_view_default_real_get_current_slide_number (pdfpcViewBase* base) { pdfpcViewDefault * self; gint result = 0; gint _tmp0_; self = (pdfpcViewDefault*) base; _tmp0_ = self->current_slide_number; result = _tmp0_; return result; } /** * This method is called by Gdk every time the widget needs to be redrawn. * * The implementation does a simple blit from the internal pixmap to * the window surface. */ static gboolean pdfpc_view_default_real_expose_event (GtkWidget* base, GdkEventExpose* event) { pdfpcViewDefault * self; gboolean result = FALSE; GdkWindow* _tmp0_; cairo_t* _tmp1_ = NULL; cairo_t* cr; GdkPixmap* _tmp2_; GdkEventExpose _tmp3_; GdkRectangle _tmp4_; gint _tmp5_; GdkEventExpose _tmp6_; GdkRectangle _tmp7_; gint _tmp8_; GdkEventExpose _tmp9_; GdkRectangle _tmp10_; gint _tmp11_; GdkEventExpose _tmp12_; GdkRectangle _tmp13_; gint _tmp14_; GdkEventExpose _tmp15_; GdkRectangle _tmp16_; gint _tmp17_; GdkEventExpose _tmp18_; GdkRectangle _tmp19_; gint _tmp20_; self = (pdfpcViewDefault*) base; g_return_val_if_fail (event != NULL, FALSE); _tmp0_ = ((GtkWidget*) self)->window; _tmp1_ = gdk_cairo_create ((GdkDrawable*) _tmp0_); cr = _tmp1_; _tmp2_ = self->current_slide; _tmp3_ = *event; _tmp4_ = _tmp3_.area; _tmp5_ = _tmp4_.x; _tmp6_ = *event; _tmp7_ = _tmp6_.area; _tmp8_ = _tmp7_.y; gdk_cairo_set_source_pixmap (cr, _tmp2_, (gdouble) _tmp5_, (gdouble) _tmp8_); _tmp9_ = *event; _tmp10_ = _tmp9_.area; _tmp11_ = _tmp10_.x; _tmp12_ = *event; _tmp13_ = _tmp12_.area; _tmp14_ = _tmp13_.y; _tmp15_ = *event; _tmp16_ = _tmp15_.area; _tmp17_ = _tmp16_.width; _tmp18_ = *event; _tmp19_ = _tmp18_.area; _tmp20_ = _tmp19_.height; cairo_rectangle (cr, (gdouble) _tmp11_, (gdouble) _tmp14_, (gdouble) _tmp17_, (gdouble) _tmp20_); cairo_fill (cr); result = TRUE; _cairo_destroy0 (cr); return result; } static void pdfpc_view_default_class_init (pdfpcViewDefaultClass * klass) { pdfpc_view_default_parent_class = g_type_class_peek_parent (klass); PDFPC_VIEW_BASE_CLASS (klass)->display = pdfpc_view_default_real_display; PDFPC_VIEW_BASE_CLASS (klass)->fade_to_black = pdfpc_view_default_real_fade_to_black; PDFPC_VIEW_BASE_CLASS (klass)->redraw = pdfpc_view_default_real_redraw; PDFPC_VIEW_BASE_CLASS (klass)->get_current_slide_number = pdfpc_view_default_real_get_current_slide_number; GTK_WIDGET_CLASS (klass)->expose_event = pdfpc_view_default_real_expose_event; G_OBJECT_CLASS (klass)->finalize = pdfpc_view_default_finalize; } static void pdfpc_view_default_pdfpc_view_prerendering_interface_init (pdfpcViewPrerenderingIface * iface) { pdfpc_view_default_pdfpc_view_prerendering_parent_iface = g_type_interface_peek_parent (iface); } static void pdfpc_view_default_pdfpc_view_behaviour_decoratable_interface_init (pdfpcViewBehaviourDecoratableIface * iface) { pdfpc_view_default_pdfpc_view_behaviour_decoratable_parent_iface = g_type_interface_peek_parent (iface); iface->associate_behaviour = (void (*)(pdfpcViewBehaviourDecoratable*, pdfpcViewBehaviourBase*)) pdfpc_view_default_real_associate_behaviour; } static void pdfpc_view_default_instance_init (pdfpcViewDefault * self) { self->behaviours = NULL; } static void pdfpc_view_default_finalize (GObject* obj) { pdfpcViewDefault * self; self = PDFPC_VIEW_DEFAULT (obj); _g_object_unref0 (self->current_slide); __g_list_free__g_object_unref0_0 (self->behaviours); G_OBJECT_CLASS (pdfpc_view_default_parent_class)->finalize (obj); } /** * Basic view class which is usable with any renderer. */ GType pdfpc_view_default_get_type (void) { static volatile gsize pdfpc_view_default_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_view_default_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcViewDefaultClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_view_default_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcViewDefault), 0, (GInstanceInitFunc) pdfpc_view_default_instance_init, NULL }; static const GInterfaceInfo pdfpc_view_prerendering_info = { (GInterfaceInitFunc) pdfpc_view_default_pdfpc_view_prerendering_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; static const GInterfaceInfo pdfpc_view_behaviour_decoratable_info = { (GInterfaceInitFunc) pdfpc_view_default_pdfpc_view_behaviour_decoratable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType pdfpc_view_default_type_id; pdfpc_view_default_type_id = g_type_register_static (PDFPC_VIEW_TYPE_BASE, "pdfpcViewDefault", &g_define_type_info, 0); g_type_add_interface_static (pdfpc_view_default_type_id, PDFPC_VIEW_TYPE_PRERENDERING, &pdfpc_view_prerendering_info); g_type_add_interface_static (pdfpc_view_default_type_id, PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE, &pdfpc_view_behaviour_decoratable_info); g_once_init_leave (&pdfpc_view_default_type_id__volatile, pdfpc_view_default_type_id); } return pdfpc_view_default_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/view/pdf.c000066400000000000000000000464401177613036100207720ustar00rootroot00000000000000/* pdf.c generated by valac 0.16.0, the Vala compiler * generated from pdf.vala, do not modify */ #include #include #include #include #include #include #define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ()) #define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase)) #define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) #define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) typedef struct _pdfpcViewBase pdfpcViewBase; typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass; typedef struct _pdfpcViewBasePrivate pdfpcViewBasePrivate; #define PDFPC_RENDERER_TYPE_BASE (pdfpc_renderer_base_get_type ()) #define PDFPC_RENDERER_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBase)) #define PDFPC_RENDERER_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) #define PDFPC_RENDERER_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) typedef struct _pdfpcRendererBase pdfpcRendererBase; typedef struct _pdfpcRendererBaseClass pdfpcRendererBaseClass; #define PDFPC_VIEW_TYPE_PRERENDERING (pdfpc_view_prerendering_get_type ()) #define PDFPC_VIEW_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerendering)) #define PDFPC_VIEW_IS_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PRERENDERING)) #define PDFPC_VIEW_PRERENDERING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerenderingIface)) typedef struct _pdfpcViewPrerendering pdfpcViewPrerendering; typedef struct _pdfpcViewPrerenderingIface pdfpcViewPrerenderingIface; #define PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE (pdfpc_view_behaviour_decoratable_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_DECORATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE, pdfpcViewBehaviourDecoratable)) #define PDFPC_VIEW_BEHAVIOUR_IS_DECORATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE)) #define PDFPC_VIEW_BEHAVIOUR_DECORATABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE, pdfpcViewBehaviourDecoratableIface)) typedef struct _pdfpcViewBehaviourDecoratable pdfpcViewBehaviourDecoratable; typedef struct _pdfpcViewBehaviourDecoratableIface pdfpcViewBehaviourDecoratableIface; #define PDFPC_VIEW_BEHAVIOUR_TYPE_BASE (pdfpc_view_behaviour_base_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBase)) #define PDFPC_VIEW_BEHAVIOUR_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) typedef struct _pdfpcViewBehaviourBase pdfpcViewBehaviourBase; typedef struct _pdfpcViewBehaviourBaseClass pdfpcViewBehaviourBaseClass; #define PDFPC_VIEW_TYPE_DEFAULT (pdfpc_view_default_get_type ()) #define PDFPC_VIEW_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefault)) #define PDFPC_VIEW_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) #define PDFPC_VIEW_IS_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_IS_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) typedef struct _pdfpcViewDefault pdfpcViewDefault; typedef struct _pdfpcViewDefaultClass pdfpcViewDefaultClass; typedef struct _pdfpcViewDefaultPrivate pdfpcViewDefaultPrivate; #define PDFPC_VIEW_TYPE_PDF (pdfpc_view_pdf_get_type ()) #define PDFPC_VIEW_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdf)) #define PDFPC_VIEW_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) #define PDFPC_VIEW_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) typedef struct _pdfpcViewPdf pdfpcViewPdf; typedef struct _pdfpcViewPdfClass pdfpcViewPdfClass; typedef struct _pdfpcViewPdfPrivate pdfpcViewPdfPrivate; #define PDFPC_RENDERER_TYPE_PDF (pdfpc_renderer_pdf_get_type ()) #define PDFPC_RENDERER_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdf)) #define PDFPC_RENDERER_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass)) #define PDFPC_RENDERER_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_PDF)) #define PDFPC_RENDERER_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_PDF)) #define PDFPC_RENDERER_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass)) typedef struct _pdfpcRendererPdf pdfpcRendererPdf; typedef struct _pdfpcRendererPdfClass pdfpcRendererPdfClass; #define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController)) #define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) #define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) typedef struct _pdfpcPresentationController pdfpcPresentationController; typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass; #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION (pdfpc_view_behaviour_pdf_link_implementation_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementation)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementationClass)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_IMPLEMENTATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_IMPLEMENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementationClass)) typedef struct _pdfpcViewBehaviourPdfLinkImplementation pdfpcViewBehaviourPdfLinkImplementation; typedef struct _pdfpcViewBehaviourPdfLinkImplementationClass pdfpcViewBehaviourPdfLinkImplementationClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ()) #define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf)) #define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) #define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf; typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass; #define PDFPC_TYPE_SCALER (pdfpc_scaler_get_type ()) #define PDFPC_SCALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_SCALER, pdfpcScaler)) #define PDFPC_SCALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_SCALER, pdfpcScalerClass)) #define PDFPC_IS_SCALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_SCALER)) #define PDFPC_IS_SCALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_SCALER)) #define PDFPC_SCALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_SCALER, pdfpcScalerClass)) typedef struct _pdfpcScaler pdfpcScaler; typedef struct _pdfpcScalerClass pdfpcScalerClass; typedef enum { PDFPC_RENDERER_RENDER_ERROR_SLIDE_DOES_NOT_EXIST } pdfpcRendererRenderError; #define PDFPC_RENDERER_RENDER_ERROR pdfpc_renderer_render_error_quark () struct _pdfpcViewBase { GtkDrawingArea parent_instance; pdfpcViewBasePrivate * priv; pdfpcRendererBase* renderer; }; struct _pdfpcViewBaseClass { GtkDrawingAreaClass parent_class; void (*display) (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); void (*fade_to_black) (pdfpcViewBase* self); void (*redraw) (pdfpcViewBase* self, GError** error); gint (*get_current_slide_number) (pdfpcViewBase* self); }; struct _pdfpcViewPrerenderingIface { GTypeInterface parent_iface; }; struct _pdfpcViewBehaviourDecoratableIface { GTypeInterface parent_iface; void (*associate_behaviour) (pdfpcViewBehaviourDecoratable* self, pdfpcViewBehaviourBase* behaviour); }; struct _pdfpcViewDefault { pdfpcViewBase parent_instance; pdfpcViewDefaultPrivate * priv; gint current_slide_number; GdkPixmap* current_slide; gint n_slides; gint slide_limit; GList* behaviours; }; struct _pdfpcViewDefaultClass { pdfpcViewBaseClass parent_class; }; struct _pdfpcViewPdf { pdfpcViewDefault parent_instance; pdfpcViewPdfPrivate * priv; }; struct _pdfpcViewPdfClass { pdfpcViewDefaultClass parent_class; }; static gpointer pdfpc_view_pdf_parent_class = NULL; GType pdfpc_view_base_get_type (void) G_GNUC_CONST; GQuark pdfpc_renderer_render_error_quark (void); GType pdfpc_renderer_base_get_type (void) G_GNUC_CONST; GType pdfpc_view_prerendering_get_type (void) G_GNUC_CONST; GType pdfpc_view_behaviour_base_get_type (void) G_GNUC_CONST; GType pdfpc_view_behaviour_decoratable_get_type (void) G_GNUC_CONST; GType pdfpc_view_default_get_type (void) G_GNUC_CONST; GType pdfpc_view_pdf_get_type (void) G_GNUC_CONST; enum { PDFPC_VIEW_PDF_DUMMY_PROPERTY }; GType pdfpc_renderer_pdf_get_type (void) G_GNUC_CONST; GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST; pdfpcViewPdf* pdfpc_view_pdf_new (pdfpcRendererPdf* renderer, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller); pdfpcViewPdf* pdfpc_view_pdf_construct (GType object_type, pdfpcRendererPdf* renderer, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller); pdfpcViewDefault* pdfpc_view_default_new (pdfpcRendererBase* renderer); pdfpcViewDefault* pdfpc_view_default_construct (GType object_type, pdfpcRendererBase* renderer); void pdfpc_view_behaviour_decoratable_associate_behaviour (pdfpcViewBehaviourDecoratable* self, pdfpcViewBehaviourBase* behaviour); pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_new (pdfpcPresentationController* presentation_controller); pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_construct (GType object_type, pdfpcPresentationController* presentation_controller); GType pdfpc_view_behaviour_pdf_link_implementation_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST; pdfpcViewPdf* pdfpc_view_pdf_from_metadata (pdfpcMetadataPdf* metadata, gint width, gint height, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller, GdkRectangle* scale_rect); gdouble pdfpc_metadata_pdf_get_page_width (pdfpcMetadataPdf* self); gdouble pdfpc_metadata_pdf_get_page_height (pdfpcMetadataPdf* self); pdfpcScaler* pdfpc_scaler_new (gdouble width, gdouble height); pdfpcScaler* pdfpc_scaler_construct (GType object_type, gdouble width, gdouble height); GType pdfpc_scaler_get_type (void) G_GNUC_CONST; void pdfpc_scaler_scale_to (pdfpcScaler* self, gint width, gint height, gboolean centered, gboolean allow_cutoff, GdkRectangle* result); pdfpcRendererPdf* pdfpc_renderer_pdf_new (pdfpcMetadataPdf* metadata, gint width, gint height); pdfpcRendererPdf* pdfpc_renderer_pdf_construct (GType object_type, pdfpcMetadataPdf* metadata, gint width, gint height); pdfpcRendererPdf* pdfpc_view_pdf_get_renderer (pdfpcViewPdf* self); /** * Default constructor restricted to Pdf renderers as input parameter */ pdfpcViewPdf* pdfpc_view_pdf_construct (GType object_type, pdfpcRendererPdf* renderer, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller) { pdfpcViewPdf * self = NULL; pdfpcRendererPdf* _tmp0_; pdfpcPresentationController* _tmp1_; pdfpcViewBehaviourPdfLinkImplementation* _tmp2_; pdfpcViewBehaviourPdfLinkImplementation* _tmp3_; g_return_val_if_fail (renderer != NULL, NULL); g_return_val_if_fail (presentation_controller != NULL, NULL); _tmp0_ = renderer; self = (pdfpcViewPdf*) pdfpc_view_default_construct (object_type, (pdfpcRendererBase*) _tmp0_); _tmp1_ = presentation_controller; _tmp2_ = pdfpc_view_behaviour_pdf_link_implementation_new (_tmp1_); _tmp3_ = _tmp2_; pdfpc_view_behaviour_decoratable_associate_behaviour ((pdfpcViewBehaviourDecoratable*) self, (pdfpcViewBehaviourBase*) _tmp3_); _g_object_unref0 (_tmp3_); return self; } pdfpcViewPdf* pdfpc_view_pdf_new (pdfpcRendererPdf* renderer, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller) { return pdfpc_view_pdf_construct (PDFPC_VIEW_TYPE_PDF, renderer, allow_black_on_end, presentation_controller); } /** * Create a new Pdf view directly from a file * * This is a convenience constructor which automatically create a full * metadata and rendering chain to be used with the pdf view. The given * width and height is used in conjunction with a scaler to maintain * aspect ration. The scale rectangle is provided in the scale_rect * argument. */ pdfpcViewPdf* pdfpc_view_pdf_from_metadata (pdfpcMetadataPdf* metadata, gint width, gint height, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller, GdkRectangle* scale_rect) { GdkRectangle _vala_scale_rect = {0}; pdfpcViewPdf* result = NULL; pdfpcMetadataPdf* _tmp0_; gdouble _tmp1_ = 0.0; pdfpcMetadataPdf* _tmp2_; gdouble _tmp3_ = 0.0; pdfpcScaler* _tmp4_; pdfpcScaler* scaler; gint _tmp5_; gint _tmp6_; GdkRectangle _tmp7_ = {0}; pdfpcMetadataPdf* _tmp8_; GdkRectangle _tmp9_; gint _tmp10_; GdkRectangle _tmp11_; gint _tmp12_; pdfpcRendererPdf* _tmp13_; pdfpcRendererPdf* renderer; gboolean _tmp14_; pdfpcPresentationController* _tmp15_; pdfpcViewPdf* _tmp16_; pdfpcViewPdf* _tmp17_; g_return_val_if_fail (metadata != NULL, NULL); g_return_val_if_fail (presentation_controller != NULL, NULL); _tmp0_ = metadata; _tmp1_ = pdfpc_metadata_pdf_get_page_width (_tmp0_); _tmp2_ = metadata; _tmp3_ = pdfpc_metadata_pdf_get_page_height (_tmp2_); _tmp4_ = pdfpc_scaler_new (_tmp1_, _tmp3_); scaler = _tmp4_; _tmp5_ = width; _tmp6_ = height; pdfpc_scaler_scale_to (scaler, _tmp5_, _tmp6_, TRUE, FALSE, &_tmp7_); _vala_scale_rect = _tmp7_; _tmp8_ = metadata; _tmp9_ = _vala_scale_rect; _tmp10_ = _tmp9_.width; _tmp11_ = _vala_scale_rect; _tmp12_ = _tmp11_.height; _tmp13_ = pdfpc_renderer_pdf_new (_tmp8_, _tmp10_, _tmp12_); renderer = _tmp13_; _tmp14_ = allow_black_on_end; _tmp15_ = presentation_controller; _tmp16_ = pdfpc_view_pdf_new (renderer, _tmp14_, _tmp15_); _tmp17_ = g_object_ref_sink (_tmp16_); result = _tmp17_; _g_object_unref0 (renderer); _g_object_unref0 (scaler); if (scale_rect) { *scale_rect = _vala_scale_rect; } return result; } /** * Return the currently used Pdf renderer */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } pdfpcRendererPdf* pdfpc_view_pdf_get_renderer (pdfpcViewPdf* self) { pdfpcRendererPdf* result = NULL; pdfpcRendererBase* _tmp0_; pdfpcRendererPdf* _tmp1_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = ((pdfpcViewBase*) self)->renderer; _tmp1_ = _g_object_ref0 (PDFPC_RENDERER_IS_PDF (_tmp0_) ? ((pdfpcRendererPdf*) _tmp0_) : NULL); result = _tmp1_; return result; } static void pdfpc_view_pdf_class_init (pdfpcViewPdfClass * klass) { pdfpc_view_pdf_parent_class = g_type_class_peek_parent (klass); } static void pdfpc_view_pdf_instance_init (pdfpcViewPdf * self) { } /** * View spezialized to work with Pdf renderers. * * This class is mainly needed to be decorated with pdf-link-interactions * signals. * * By default it does not implement any further functionality. */ GType pdfpc_view_pdf_get_type (void) { static volatile gsize pdfpc_view_pdf_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_view_pdf_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcViewPdfClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_view_pdf_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcViewPdf), 0, (GInstanceInitFunc) pdfpc_view_pdf_instance_init, NULL }; GType pdfpc_view_pdf_type_id; pdfpc_view_pdf_type_id = g_type_register_static (PDFPC_VIEW_TYPE_DEFAULT, "pdfpcViewPdf", &g_define_type_info, 0); g_once_init_leave (&pdfpc_view_pdf_type_id__volatile, pdfpc_view_pdf_type_id); } return pdfpc_view_pdf_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/window/000077500000000000000000000000001177613036100204025ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/classes/window/fullscreen.c000066400000000000000000000315611177613036100227160ustar00rootroot00000000000000/* fullscreen.c generated by valac 0.16.0, the Vala compiler * generated from fullscreen.vala, do not modify */ #include #include #include #include #define PDFPC_WINDOW_TYPE_FULLSCREEN (pdfpc_window_fullscreen_get_type ()) #define PDFPC_WINDOW_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreen)) #define PDFPC_WINDOW_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) #define PDFPC_WINDOW_IS_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_IS_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_FULLSCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) typedef struct _pdfpcWindowFullscreen pdfpcWindowFullscreen; typedef struct _pdfpcWindowFullscreenClass pdfpcWindowFullscreenClass; typedef struct _pdfpcWindowFullscreenPrivate pdfpcWindowFullscreenPrivate; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _gdk_cursor_unref0(var) ((var == NULL) ? NULL : (var = (gdk_cursor_unref (var), NULL))) struct _pdfpcWindowFullscreen { GtkWindow parent_instance; pdfpcWindowFullscreenPrivate * priv; GdkRectangle screen_geometry; guint hide_cursor_timeout; gboolean faded_to_black; gboolean frozen; }; struct _pdfpcWindowFullscreenClass { GtkWindowClass parent_class; }; static gpointer pdfpc_window_fullscreen_parent_class = NULL; extern gboolean pdfpc_options_windowed; GType pdfpc_window_fullscreen_get_type (void) G_GNUC_CONST; enum { PDFPC_WINDOW_FULLSCREEN_DUMMY_PROPERTY }; pdfpcWindowFullscreen* pdfpc_window_fullscreen_new (gint screen_num); pdfpcWindowFullscreen* pdfpc_window_fullscreen_construct (GType object_type, gint screen_num); void pdfpc_window_fullscreen_on_size_allocate (pdfpcWindowFullscreen* self, GtkWidget* source, GdkRectangle* r); static void _pdfpc_window_fullscreen_on_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self); gboolean pdfpc_window_fullscreen_on_configure (pdfpcWindowFullscreen* self, GdkEventConfigure* e); static gboolean _pdfpc_window_fullscreen_on_configure_gtk_widget_configure_event (GtkWidget* _sender, GdkEventConfigure* event, gpointer self); gboolean pdfpc_window_fullscreen_on_mouse_move (pdfpcWindowFullscreen* self, GtkWidget* source, GdkEventMotion* event); static gboolean _pdfpc_window_fullscreen_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self); void pdfpc_window_fullscreen_restart_hide_cursor_timer (pdfpcWindowFullscreen* self); gboolean pdfpc_window_fullscreen_on_hide_cursor_timeout (pdfpcWindowFullscreen* self); static gboolean _pdfpc_window_fullscreen_on_hide_cursor_timeout_gsource_func (gpointer self); static void pdfpc_window_fullscreen_finalize (GObject* obj); static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } static void _pdfpc_window_fullscreen_on_size_allocate_gtk_widget_size_allocate (GtkWidget* _sender, GdkRectangle* allocation, gpointer self) { pdfpc_window_fullscreen_on_size_allocate (self, _sender, allocation); } static gboolean _pdfpc_window_fullscreen_on_configure_gtk_widget_configure_event (GtkWidget* _sender, GdkEventConfigure* event, gpointer self) { gboolean result; result = pdfpc_window_fullscreen_on_configure (self, event); return result; } static gboolean _pdfpc_window_fullscreen_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self) { gboolean result; result = pdfpc_window_fullscreen_on_mouse_move (self, _sender, event); return result; } pdfpcWindowFullscreen* pdfpc_window_fullscreen_construct (GType object_type, gint screen_num) { pdfpcWindowFullscreen * self = NULL; GdkScreen* screen = NULL; gint _tmp0_; gboolean _tmp20_; self = (pdfpcWindowFullscreen*) g_object_new (object_type, NULL); _tmp0_ = screen_num; if (_tmp0_ >= 0) { GdkScreen* _tmp1_ = NULL; GdkScreen* _tmp2_; GdkScreen* _tmp3_; gint _tmp4_; GdkRectangle _tmp5_ = {0}; _tmp1_ = gdk_screen_get_default (); _tmp2_ = _g_object_ref0 (_tmp1_); _g_object_unref0 (screen); screen = _tmp2_; _tmp3_ = screen; _tmp4_ = screen_num; gdk_screen_get_monitor_geometry (_tmp3_, _tmp4_, &_tmp5_); self->screen_geometry = _tmp5_; } else { GdkDisplay* _tmp6_ = NULL; GdkDisplay* _tmp7_; GdkDisplay* display; gint pointerx = 0; gint pointery = 0; GdkDisplay* _tmp8_; GdkScreen* _tmp9_ = NULL; gint _tmp10_ = 0; gint _tmp11_ = 0; GdkScreen* _tmp12_; GdkScreen* _tmp13_; gint _tmp14_; gint _tmp15_; gint _tmp16_ = 0; gint current_screen; GdkScreen* _tmp17_; gint _tmp18_; GdkRectangle _tmp19_ = {0}; _tmp6_ = gdk_display_get_default (); _tmp7_ = _g_object_ref0 (_tmp6_); display = _tmp7_; _tmp8_ = display; gdk_display_get_pointer (_tmp8_, &_tmp9_, &_tmp10_, &_tmp11_, NULL); _g_object_unref0 (screen); _tmp12_ = _g_object_ref0 (_tmp9_); screen = _tmp12_; pointerx = _tmp10_; pointery = _tmp11_; _tmp13_ = screen; _tmp14_ = pointerx; _tmp15_ = pointery; _tmp16_ = gdk_screen_get_monitor_at_point (_tmp13_, _tmp14_, _tmp15_); current_screen = _tmp16_; _tmp17_ = screen; _tmp18_ = current_screen; gdk_screen_get_monitor_geometry (_tmp17_, _tmp18_, &_tmp19_); self->screen_geometry = _tmp19_; _g_object_unref0 (display); } _tmp20_ = pdfpc_options_windowed; if (!_tmp20_) { GdkRectangle _tmp21_; gint _tmp22_; GdkRectangle _tmp23_; gint _tmp24_; _tmp21_ = self->screen_geometry; _tmp22_ = _tmp21_.x; _tmp23_ = self->screen_geometry; _tmp24_ = _tmp23_.y; gtk_window_move ((GtkWindow*) self, _tmp22_, _tmp24_); g_signal_connect_object ((GtkWidget*) self, "size-allocate", (GCallback) _pdfpc_window_fullscreen_on_size_allocate_gtk_widget_size_allocate, self, 0); g_signal_connect_object ((GtkWidget*) self, "configure-event", (GCallback) _pdfpc_window_fullscreen_on_configure_gtk_widget_configure_event, self, 0); } else { gint _tmp25_; gint _tmp26_; _tmp25_ = self->screen_geometry.width; self->screen_geometry.width = _tmp25_ / 2; _tmp26_ = self->screen_geometry.height; self->screen_geometry.height = _tmp26_ / 2; gtk_window_set_resizable ((GtkWindow*) self, FALSE); } gtk_widget_add_events ((GtkWidget*) self, (gint) GDK_POINTER_MOTION_MASK); g_signal_connect_object ((GtkWidget*) self, "motion-notify-event", (GCallback) _pdfpc_window_fullscreen_on_mouse_move_gtk_widget_motion_notify_event, self, 0); pdfpc_window_fullscreen_restart_hide_cursor_timer (self); _g_object_unref0 (screen); return self; } pdfpcWindowFullscreen* pdfpc_window_fullscreen_new (gint screen_num) { return pdfpc_window_fullscreen_construct (PDFPC_WINDOW_TYPE_FULLSCREEN, screen_num); } gboolean pdfpc_window_fullscreen_on_configure (pdfpcWindowFullscreen* self, GdkEventConfigure* e) { gboolean result = FALSE; guint _tmp0_ = 0U; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (e != NULL, FALSE); gtk_window_fullscreen ((GtkWindow*) self); g_signal_parse_name ("configure-event", GTK_TYPE_WIDGET, &_tmp0_, NULL, FALSE); g_signal_handlers_disconnect_matched ((GtkWidget*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _pdfpc_window_fullscreen_on_configure_gtk_widget_configure_event, self); result = FALSE; return result; } /** * Called if window size is allocated * * This method is needed, because certain window manager (eg. Xfwm4) ignore * movement commands before the window has been displayed for the first * time. */ void pdfpc_window_fullscreen_on_size_allocate (pdfpcWindowFullscreen* self, GtkWidget* source, GdkRectangle* r) { gboolean _tmp0_ = FALSE; g_return_if_fail (self != NULL); g_return_if_fail (source != NULL); g_return_if_fail (r != NULL); _tmp0_ = GTK_WIDGET_MAPPED ((GtkWidget*) self); if (_tmp0_) { guint _tmp1_ = 0U; gint x = 0; gint y = 0; gint _tmp2_ = 0; gint _tmp3_ = 0; gboolean _tmp4_ = FALSE; gint _tmp5_; GdkRectangle _tmp6_; gint _tmp7_; gboolean _tmp11_; GdkRectangle _tmp12_; gint _tmp13_; GdkRectangle _tmp14_; gint _tmp15_; g_signal_parse_name ("size-allocate", GTK_TYPE_WIDGET, &_tmp1_, NULL, FALSE); g_signal_handlers_disconnect_matched ((GtkWidget*) self, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _pdfpc_window_fullscreen_on_size_allocate_gtk_widget_size_allocate, self); gtk_window_get_position ((GtkWindow*) self, &_tmp2_, &_tmp3_); x = _tmp2_; y = _tmp3_; _tmp5_ = x; _tmp6_ = self->screen_geometry; _tmp7_ = _tmp6_.x; if (_tmp5_ == _tmp7_) { gint _tmp8_; GdkRectangle _tmp9_; gint _tmp10_; _tmp8_ = y; _tmp9_ = self->screen_geometry; _tmp10_ = _tmp9_.y; _tmp4_ = _tmp8_ == _tmp10_; } else { _tmp4_ = FALSE; } _tmp11_ = _tmp4_; if (_tmp11_) { return; } _tmp12_ = self->screen_geometry; _tmp13_ = _tmp12_.x; _tmp14_ = self->screen_geometry; _tmp15_ = _tmp14_.y; gtk_window_move ((GtkWindow*) self, _tmp13_, _tmp15_); gtk_window_fullscreen ((GtkWindow*) self); } } /** * Called every time the mouse cursor is moved */ gboolean pdfpc_window_fullscreen_on_mouse_move (pdfpcWindowFullscreen* self, GtkWidget* source, GdkEventMotion* event) { gboolean result = FALSE; GdkWindow* _tmp0_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (source != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE); _tmp0_ = ((GtkWidget*) self)->window; gdk_window_set_cursor (_tmp0_, NULL); pdfpc_window_fullscreen_restart_hide_cursor_timer (self); result = FALSE; return result; } /** * Restart the 5 seconds timeout before hiding the mouse cursor */ static gboolean _pdfpc_window_fullscreen_on_hide_cursor_timeout_gsource_func (gpointer self) { gboolean result; result = pdfpc_window_fullscreen_on_hide_cursor_timeout (self); return result; } void pdfpc_window_fullscreen_restart_hide_cursor_timer (pdfpcWindowFullscreen* self) { guint _tmp0_; guint _tmp2_ = 0U; g_return_if_fail (self != NULL); _tmp0_ = self->hide_cursor_timeout; if (_tmp0_ != ((guint) 0)) { guint _tmp1_; _tmp1_ = self->hide_cursor_timeout; g_source_remove (_tmp1_); } _tmp2_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, _pdfpc_window_fullscreen_on_hide_cursor_timeout_gsource_func, g_object_ref (self), g_object_unref); self->hide_cursor_timeout = _tmp2_; } /** * Timeout method called if the mouse pointer has not been moved for 5 * seconds */ gboolean pdfpc_window_fullscreen_on_hide_cursor_timeout (pdfpcWindowFullscreen* self) { gboolean result = FALSE; GdkWindow* _tmp0_; g_return_val_if_fail (self != NULL, FALSE); self->hide_cursor_timeout = (guint) 0; _tmp0_ = ((GtkWidget*) self)->window; if (_tmp0_ != NULL) { GdkWindow* _tmp1_; GdkCursor* _tmp2_; GdkCursor* _tmp3_; _tmp1_ = ((GtkWidget*) self)->window; _tmp2_ = gdk_cursor_new (GDK_BLANK_CURSOR); _tmp3_ = _tmp2_; gdk_window_set_cursor (_tmp1_, _tmp3_); _gdk_cursor_unref0 (_tmp3_); result = FALSE; return result; } else { result = TRUE; return result; } } static void pdfpc_window_fullscreen_class_init (pdfpcWindowFullscreenClass * klass) { pdfpc_window_fullscreen_parent_class = g_type_class_peek_parent (klass); G_OBJECT_CLASS (klass)->finalize = pdfpc_window_fullscreen_finalize; } static void pdfpc_window_fullscreen_instance_init (pdfpcWindowFullscreen * self) { self->hide_cursor_timeout = (guint) 0; self->faded_to_black = FALSE; self->frozen = FALSE; } static void pdfpc_window_fullscreen_finalize (GObject* obj) { pdfpcWindowFullscreen * self; self = PDFPC_WINDOW_FULLSCREEN (obj); G_OBJECT_CLASS (pdfpc_window_fullscreen_parent_class)->finalize (obj); } /** * Window extension implementing all the needed functionality, to be * displayed fullscreen. * * Methods to specify the monitor to be displayed on in a multi-head setup * are provided as well. */ GType pdfpc_window_fullscreen_get_type (void) { static volatile gsize pdfpc_window_fullscreen_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_window_fullscreen_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcWindowFullscreenClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_window_fullscreen_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcWindowFullscreen), 0, (GInstanceInitFunc) pdfpc_window_fullscreen_instance_init, NULL }; GType pdfpc_window_fullscreen_type_id; pdfpc_window_fullscreen_type_id = g_type_register_static (GTK_TYPE_WINDOW, "pdfpcWindowFullscreen", &g_define_type_info, 0); g_once_init_leave (&pdfpc_window_fullscreen_type_id__volatile, pdfpc_window_fullscreen_type_id); } return pdfpc_window_fullscreen_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/window/overview.c000066400000000000000000001406741177613036100224300ustar00rootroot00000000000000/* overview.c generated by valac 0.16.0, the Vala compiler * generated from overview.vala, do not modify */ #include #include #include #include #include #include #include #include #include #define PDFPC_WINDOW_TYPE_OVERVIEW (pdfpc_window_overview_get_type ()) #define PDFPC_WINDOW_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverview)) #define PDFPC_WINDOW_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass)) #define PDFPC_WINDOW_IS_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_OVERVIEW)) #define PDFPC_WINDOW_IS_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_OVERVIEW)) #define PDFPC_WINDOW_OVERVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass)) typedef struct _pdfpcWindowOverview pdfpcWindowOverview; typedef struct _pdfpcWindowOverviewClass pdfpcWindowOverviewClass; typedef struct _pdfpcWindowOverviewPrivate pdfpcWindowOverviewPrivate; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ()) #define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf)) #define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) #define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf; typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass; #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; #define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController)) #define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) #define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) typedef struct _pdfpcPresentationController pdfpcPresentationController; typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass; #define PDFPC_WINDOW_TYPE_FULLSCREEN (pdfpc_window_fullscreen_get_type ()) #define PDFPC_WINDOW_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreen)) #define PDFPC_WINDOW_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) #define PDFPC_WINDOW_IS_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_IS_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_FULLSCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) typedef struct _pdfpcWindowFullscreen pdfpcWindowFullscreen; typedef struct _pdfpcWindowFullscreenClass pdfpcWindowFullscreenClass; #define PDFPC_WINDOW_TYPE_PRESENTER (pdfpc_window_presenter_get_type ()) #define PDFPC_WINDOW_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenter)) #define PDFPC_WINDOW_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass)) #define PDFPC_WINDOW_IS_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_PRESENTER)) #define PDFPC_WINDOW_IS_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_PRESENTER)) #define PDFPC_WINDOW_PRESENTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass)) typedef struct _pdfpcWindowPresenter pdfpcWindowPresenter; typedef struct _pdfpcWindowPresenterClass pdfpcWindowPresenterClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL))) #define __g_list_free__gtk_tree_path_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__gtk_tree_path_free0_ (var), NULL))) #define PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT (pdfpc_window_cell_renderer_highlight_get_type ()) #define PDFPC_WINDOW_CELL_RENDERER_HIGHLIGHT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT, pdfpcWindowCellRendererHighlight)) #define PDFPC_WINDOW_CELL_RENDERER_HIGHLIGHT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT, pdfpcWindowCellRendererHighlightClass)) #define PDFPC_WINDOW_IS_CELL_RENDERER_HIGHLIGHT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT)) #define PDFPC_WINDOW_IS_CELL_RENDERER_HIGHLIGHT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT)) #define PDFPC_WINDOW_CELL_RENDERER_HIGHLIGHT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT, pdfpcWindowCellRendererHighlightClass)) typedef struct _pdfpcWindowCellRendererHighlight pdfpcWindowCellRendererHighlight; typedef struct _pdfpcWindowCellRendererHighlightClass pdfpcWindowCellRendererHighlightClass; #define _g_free0(var) (var = (g_free (var), NULL)) typedef struct _pdfpcWindowCellRendererHighlightPrivate pdfpcWindowCellRendererHighlightPrivate; #define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL))) struct _pdfpcWindowOverview { GtkScrolledWindow parent_instance; pdfpcWindowOverviewPrivate * priv; GtkListStore* slides; GtkIconView* slides_view; pdfpcMetadataPdf* metadata; gint n_slides; gint last_structure_n_slides; gint target_width; gint target_height; gint next_undone_preview; guint idle_id; pdfpcRendererCacheBase* cache; pdfpcPresentationController* presentation_controller; pdfpcWindowPresenter* presenter; gdouble aspect_ratio; gint max_width; gint max_height; }; struct _pdfpcWindowOverviewClass { GtkScrolledWindowClass parent_class; }; struct _pdfpcWindowOverviewPrivate { gint _current_slide; }; struct _pdfpcWindowCellRendererHighlight { GtkCellRendererPixbuf parent_instance; pdfpcWindowCellRendererHighlightPrivate * priv; }; struct _pdfpcWindowCellRendererHighlightClass { GtkCellRendererPixbufClass parent_class; }; static gpointer pdfpc_window_overview_parent_class = NULL; extern gint pdfpc_options_min_overview_width; static gpointer pdfpc_window_cell_renderer_highlight_parent_class = NULL; GType pdfpc_window_overview_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST; GType pdfpc_window_fullscreen_get_type (void) G_GNUC_CONST; GType pdfpc_window_presenter_get_type (void) G_GNUC_CONST; #define PDFPC_WINDOW_OVERVIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewPrivate)) enum { PDFPC_WINDOW_OVERVIEW_DUMMY_PROPERTY, PDFPC_WINDOW_OVERVIEW_CURRENT_SLIDE }; void pdfpc_window_overview_on_selection_changed (pdfpcWindowOverview* self, GtkWidget* source); void pdfpc_window_presenter_custom_slide_count (pdfpcWindowPresenter* self, gint current); static void _gtk_tree_path_free0_ (gpointer var); static void _g_list_free__gtk_tree_path_free0_ (GList* self); void pdfpc_window_overview_set_current_slide (pdfpcWindowOverview* self, gint value); pdfpcWindowOverview* pdfpc_window_overview_new (pdfpcMetadataPdf* metadata, pdfpcPresentationController* presentation_controller, pdfpcWindowPresenter* presenter); pdfpcWindowOverview* pdfpc_window_overview_construct (GType object_type, pdfpcMetadataPdf* metadata, pdfpcPresentationController* presentation_controller, pdfpcWindowPresenter* presenter); pdfpcWindowCellRendererHighlight* pdfpc_window_cell_renderer_highlight_new (void); pdfpcWindowCellRendererHighlight* pdfpc_window_cell_renderer_highlight_construct (GType object_type); GType pdfpc_window_cell_renderer_highlight_get_type (void) G_GNUC_CONST; gboolean pdfpc_window_fullscreen_on_mouse_move (pdfpcWindowFullscreen* self, GtkWidget* source, GdkEventMotion* event); static gboolean _pdfpc_window_fullscreen_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self); gboolean pdfpc_window_overview_on_mouse_move (pdfpcWindowOverview* self, GtkWidget* source, GdkEventMotion* event); static gboolean _pdfpc_window_overview_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self); gboolean pdfpc_window_overview_on_mouse_release (pdfpcWindowOverview* self, GdkEventButton* event); static gboolean _pdfpc_window_overview_on_mouse_release_gtk_widget_button_release_event (GtkWidget* _sender, GdkEventButton* event, gpointer self); gboolean pdfpc_window_overview_on_key_press (pdfpcWindowOverview* self, GtkWidget* source, GdkEventKey* key); static gboolean _pdfpc_window_overview_on_key_press_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self); static void _pdfpc_window_overview_on_selection_changed_gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self); void pdfpc_window_overview_on_parent_set (pdfpcWindowOverview* self, GtkWidget* old_parent); static void _pdfpc_window_overview_on_parent_set_gtk_widget_parent_set (GtkWidget* _sender, GtkWidget* previous_parent, gpointer self); gdouble pdfpc_metadata_pdf_get_page_width (pdfpcMetadataPdf* self); gdouble pdfpc_metadata_pdf_get_page_height (pdfpcMetadataPdf* self); void pdfpc_window_overview_set_available_space (pdfpcWindowOverview* self, gint width, gint height); void pdfpc_window_overview_fill_structure (pdfpcWindowOverview* self); void pdfpc_window_overview_on_show (pdfpcWindowOverview* self); static void _pdfpc_window_overview_on_show_gtk_widget_show (GtkWidget* _sender, gpointer self); void pdfpc_window_overview_on_hide (pdfpcWindowOverview* self); static void _pdfpc_window_overview_on_hide_gtk_widget_hide (GtkWidget* _sender, gpointer self); void pdfpc_window_overview_fill_previews (pdfpcWindowOverview* self); gboolean _pdfpc_window_overview_fill_previews (pdfpcWindowOverview* self); static gboolean __pdfpc_window_overview_fill_previews_gsource_func (gpointer self); GdkPixmap* pdfpc_renderer_cache_base_retrieve (pdfpcRendererCacheBase* self, guint index); gint pdfpc_metadata_pdf_user_slide_to_real_slide (pdfpcMetadataPdf* self, gint number); void pdfpc_window_overview_set_cache (pdfpcWindowOverview* self, pdfpcRendererCacheBase* cache); void pdfpc_window_overview_set_n_slides (pdfpcWindowOverview* self, gint n); gint pdfpc_window_overview_get_current_slide (pdfpcWindowOverview* self); void pdfpc_window_overview_remove_current (pdfpcWindowOverview* self, gint newn); void pdfpc_presentation_controller_goto_user_page (pdfpcPresentationController* self, gint page_number); static void pdfpc_window_overview_finalize (GObject* obj); static void _vala_pdfpc_window_overview_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec); static void _vala_pdfpc_window_overview_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec); enum { PDFPC_WINDOW_CELL_RENDERER_HIGHLIGHT_DUMMY_PROPERTY }; static void pdfpc_window_cell_renderer_highlight_real_render (GtkCellRenderer* base, GdkWindow* window, GtkWidget* widget, GdkRectangle* background_area, GdkRectangle* cell_area, GdkRectangle* expose_area, GtkCellRendererState flags); static gpointer _gtk_tree_path_copy0 (gpointer self) { return self ? gtk_tree_path_copy (self) : NULL; } static void _gtk_tree_path_free0_ (gpointer var) { (var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)); } static void _g_list_free__gtk_tree_path_free0_ (GList* self) { g_list_foreach (self, (GFunc) _gtk_tree_path_free0_, NULL); g_list_free (self); } void pdfpc_window_overview_on_selection_changed (pdfpcWindowOverview* self, GtkWidget* source) { GtkIconView* _tmp0_; GList* _tmp1_ = NULL; GList* ltp; GList* _tmp2_; gint _tmp13_; g_return_if_fail (self != NULL); g_return_if_fail (source != NULL); _tmp0_ = self->slides_view; _tmp1_ = gtk_icon_view_get_selected_items (_tmp0_); ltp = _tmp1_; _tmp2_ = ltp; if (_tmp2_ != NULL) { GList* _tmp3_; gconstpointer _tmp4_; GtkTreePath* _tmp5_; GtkTreePath* tp; GtkTreePath* _tmp6_; gint* _tmp7_ = NULL; _tmp3_ = ltp; _tmp4_ = _tmp3_->data; _tmp5_ = _gtk_tree_path_copy0 ((GtkTreePath*) _tmp4_); tp = _tmp5_; _tmp6_ = tp; _tmp7_ = gtk_tree_path_get_indices (_tmp6_); if (_tmp7_ != NULL) { GtkTreePath* _tmp8_; gint* _tmp9_ = NULL; gint _tmp10_; pdfpcWindowPresenter* _tmp11_; gint _tmp12_; _tmp8_ = tp; _tmp9_ = gtk_tree_path_get_indices (_tmp8_); _tmp10_ = _tmp9_[0]; self->priv->_current_slide = _tmp10_; _tmp11_ = self->presenter; _tmp12_ = self->priv->_current_slide; pdfpc_window_presenter_custom_slide_count (_tmp11_, _tmp12_ + 1); _gtk_tree_path_free0 (tp); __g_list_free__gtk_tree_path_free0_0 (ltp); return; } _gtk_tree_path_free0 (tp); } _tmp13_ = self->priv->_current_slide; pdfpc_window_overview_set_current_slide (self, _tmp13_); __g_list_free__gtk_tree_path_free0_0 (ltp); } /** * Constructor */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } static gboolean _pdfpc_window_fullscreen_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self) { gboolean result; result = pdfpc_window_fullscreen_on_mouse_move (self, _sender, event); return result; } static gboolean _pdfpc_window_overview_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender, GdkEventMotion* event, gpointer self) { gboolean result; result = pdfpc_window_overview_on_mouse_move (self, _sender, event); return result; } static gboolean _pdfpc_window_overview_on_mouse_release_gtk_widget_button_release_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) { gboolean result; result = pdfpc_window_overview_on_mouse_release (self, event); return result; } static gboolean _pdfpc_window_overview_on_key_press_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) { gboolean result; result = pdfpc_window_overview_on_key_press (self, _sender, event); return result; } static void _pdfpc_window_overview_on_selection_changed_gtk_icon_view_selection_changed (GtkIconView* _sender, gpointer self) { pdfpc_window_overview_on_selection_changed (self, _sender); } static void _pdfpc_window_overview_on_parent_set_gtk_widget_parent_set (GtkWidget* _sender, GtkWidget* previous_parent, gpointer self) { pdfpc_window_overview_on_parent_set (self, previous_parent); } pdfpcWindowOverview* pdfpc_window_overview_construct (GType object_type, pdfpcMetadataPdf* metadata, pdfpcPresentationController* presentation_controller, pdfpcWindowPresenter* presenter) { pdfpcWindowOverview * self = NULL; GtkListStore* _tmp0_; GtkListStore* _tmp1_; GtkIconView* _tmp2_; GtkIconView* _tmp3_; GtkIconView* _tmp4_; pdfpcWindowCellRendererHighlight* _tmp5_; pdfpcWindowCellRendererHighlight* _tmp6_; pdfpcWindowCellRendererHighlight* renderer; GtkIconView* _tmp7_; GtkIconView* _tmp8_; GtkIconView* _tmp9_; GtkIconView* _tmp10_; GdkColor black = {0}; GdkColor white = {0}; GdkColor _tmp11_ = {0}; GdkColor _tmp12_ = {0}; GtkIconView* _tmp13_; GdkColor _tmp14_; GtkWidget* _tmp15_ = NULL; GtkScrollbar* _tmp16_; GtkScrollbar* vscrollbar; GdkColor _tmp17_; GdkColor _tmp18_; GdkColor _tmp19_; pdfpcMetadataPdf* _tmp20_; pdfpcMetadataPdf* _tmp21_; pdfpcPresentationController* _tmp22_; pdfpcPresentationController* _tmp23_; pdfpcWindowPresenter* _tmp24_; pdfpcWindowPresenter* _tmp25_; GtkIconView* _tmp26_; pdfpcWindowPresenter* _tmp27_; GtkIconView* _tmp28_; GtkIconView* _tmp29_; GtkIconView* _tmp30_; GtkIconView* _tmp31_; pdfpcMetadataPdf* _tmp32_; gdouble _tmp33_ = 0.0; pdfpcMetadataPdf* _tmp34_; gdouble _tmp35_ = 0.0; g_return_val_if_fail (metadata != NULL, NULL); g_return_val_if_fail (presentation_controller != NULL, NULL); g_return_val_if_fail (presenter != NULL, NULL); self = (pdfpcWindowOverview*) g_object_new (object_type, NULL); _tmp0_ = gtk_list_store_new (1, GDK_TYPE_PIXBUF); _g_object_unref0 (self->slides); self->slides = _tmp0_; _tmp1_ = self->slides; _tmp2_ = (GtkIconView*) gtk_icon_view_new_with_model ((GtkTreeModel*) _tmp1_); _tmp3_ = g_object_ref_sink (_tmp2_); _g_object_unref0 (self->slides_view); self->slides_view = _tmp3_; _tmp4_ = self->slides_view; gtk_icon_view_set_selection_mode (_tmp4_, GTK_SELECTION_SINGLE); _tmp5_ = pdfpc_window_cell_renderer_highlight_new (); _tmp6_ = g_object_ref_sink (_tmp5_); renderer = _tmp6_; _tmp7_ = self->slides_view; gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp7_, (GtkCellRenderer*) renderer, TRUE); _tmp8_ = self->slides_view; gtk_cell_layout_add_attribute ((GtkCellLayout*) _tmp8_, (GtkCellRenderer*) renderer, "pixbuf", 0); _tmp9_ = self->slides_view; gtk_icon_view_set_item_padding (_tmp9_, 0); _tmp10_ = self->slides_view; gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp10_); gtk_widget_show_all ((GtkWidget*) self); gdk_color_parse ("black", &_tmp11_); black = _tmp11_; gdk_color_parse ("white", &_tmp12_); white = _tmp12_; _tmp13_ = self->slides_view; _tmp14_ = black; gtk_widget_modify_base ((GtkWidget*) _tmp13_, GTK_STATE_NORMAL, &_tmp14_); _tmp15_ = gtk_scrolled_window_get_vscrollbar ((GtkScrolledWindow*) self); _tmp16_ = _g_object_ref0 (GTK_SCROLLBAR (_tmp15_)); vscrollbar = _tmp16_; _tmp17_ = white; gtk_widget_modify_bg ((GtkWidget*) vscrollbar, GTK_STATE_NORMAL, &_tmp17_); _tmp18_ = black; gtk_widget_modify_bg ((GtkWidget*) vscrollbar, GTK_STATE_ACTIVE, &_tmp18_); _tmp19_ = white; gtk_widget_modify_bg ((GtkWidget*) vscrollbar, GTK_STATE_PRELIGHT, &_tmp19_); _tmp20_ = metadata; _tmp21_ = _g_object_ref0 (_tmp20_); _g_object_unref0 (self->metadata); self->metadata = _tmp21_; _tmp22_ = presentation_controller; _tmp23_ = _g_object_ref0 (_tmp22_); _g_object_unref0 (self->presentation_controller); self->presentation_controller = _tmp23_; _tmp24_ = presenter; _tmp25_ = _g_object_ref0 (_tmp24_); _g_object_unref0 (self->presenter); self->presenter = _tmp25_; _tmp26_ = self->slides_view; _tmp27_ = self->presenter; g_signal_connect_object ((GtkWidget*) _tmp26_, "motion-notify-event", (GCallback) _pdfpc_window_fullscreen_on_mouse_move_gtk_widget_motion_notify_event, (pdfpcWindowFullscreen*) _tmp27_, 0); _tmp28_ = self->slides_view; g_signal_connect_object ((GtkWidget*) _tmp28_, "motion-notify-event", (GCallback) _pdfpc_window_overview_on_mouse_move_gtk_widget_motion_notify_event, self, 0); _tmp29_ = self->slides_view; g_signal_connect_object ((GtkWidget*) _tmp29_, "button-release-event", (GCallback) _pdfpc_window_overview_on_mouse_release_gtk_widget_button_release_event, self, 0); _tmp30_ = self->slides_view; g_signal_connect_object ((GtkWidget*) _tmp30_, "key-press-event", (GCallback) _pdfpc_window_overview_on_key_press_gtk_widget_key_press_event, self, 0); _tmp31_ = self->slides_view; g_signal_connect_object (_tmp31_, "selection-changed", (GCallback) _pdfpc_window_overview_on_selection_changed_gtk_icon_view_selection_changed, self, 0); g_signal_connect_object ((GtkWidget*) self, "parent-set", (GCallback) _pdfpc_window_overview_on_parent_set_gtk_widget_parent_set, self, 0); _tmp32_ = self->metadata; _tmp33_ = pdfpc_metadata_pdf_get_page_width (_tmp32_); _tmp34_ = self->metadata; _tmp35_ = pdfpc_metadata_pdf_get_page_height (_tmp34_); self->aspect_ratio = _tmp33_ / _tmp35_; _g_object_unref0 (vscrollbar); _g_object_unref0 (renderer); return self; } pdfpcWindowOverview* pdfpc_window_overview_new (pdfpcMetadataPdf* metadata, pdfpcPresentationController* presentation_controller, pdfpcWindowPresenter* presenter) { return pdfpc_window_overview_construct (PDFPC_WINDOW_TYPE_OVERVIEW, metadata, presentation_controller, presenter); } void pdfpc_window_overview_set_available_space (pdfpcWindowOverview* self, gint width, gint height) { gint _tmp0_; gint _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = width; self->max_width = _tmp0_; _tmp1_ = height; self->max_height = _tmp1_; pdfpc_window_overview_fill_structure (self); } static void _pdfpc_window_overview_on_show_gtk_widget_show (GtkWidget* _sender, gpointer self) { pdfpc_window_overview_on_show (self); } static void _pdfpc_window_overview_on_hide_gtk_widget_hide (GtkWidget* _sender, gpointer self) { pdfpc_window_overview_on_hide (self); } void pdfpc_window_overview_on_parent_set (pdfpcWindowOverview* self, GtkWidget* old_parent) { GtkContainer* _tmp0_; GtkContainer* _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = gtk_widget_get_parent ((GtkWidget*) self); _tmp1_ = _tmp0_; if (_tmp1_ != NULL) { GtkContainer* _tmp2_; GtkContainer* _tmp3_; GtkContainer* _tmp4_; GtkContainer* _tmp5_; _tmp2_ = gtk_widget_get_parent ((GtkWidget*) self); _tmp3_ = _tmp2_; g_signal_connect_object ((GtkWidget*) _tmp3_, "show", (GCallback) _pdfpc_window_overview_on_show_gtk_widget_show, self, 0); _tmp4_ = gtk_widget_get_parent ((GtkWidget*) self); _tmp5_ = _tmp4_; g_signal_connect_object ((GtkWidget*) _tmp5_, "hide", (GCallback) _pdfpc_window_overview_on_hide_gtk_widget_hide, self, 0); } } /** * Get keyboard focus. */ void pdfpc_window_overview_on_show (pdfpcWindowOverview* self) { GtkIconView* _tmp0_; g_return_if_fail (self != NULL); _tmp0_ = self->slides_view; gtk_widget_grab_focus ((GtkWidget*) _tmp0_); } void pdfpc_window_overview_on_hide (pdfpcWindowOverview* self) { gint _tmp0_; gint _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = self->n_slides; _tmp1_ = self->last_structure_n_slides; if (_tmp0_ != _tmp1_) { pdfpc_window_overview_fill_structure (self); } } /** * Figure out the sizes for the icons, and create entries in slides * for all the slides. */ void pdfpc_window_overview_fill_structure (pdfpcWindowOverview* self) { gint _tmp0_; GtkIconView* _tmp1_; GtkIconView* _tmp2_; gint _tmp3_ = 0; gint margin; GtkIconView* _tmp4_; gint _tmp5_ = 0; gint padding; GtkIconView* _tmp6_; gint _tmp7_ = 0; gint row_spacing; GtkIconView* _tmp8_; gint _tmp9_ = 0; gint col_spacing; gint _tmp10_; gint _tmp11_; gint eff_max_width; gint _tmp12_; gint _tmp13_; gint eff_max_height; gint _tmp14_; gint _tmp15_; gint _tmp16_; gint _tmp17_; gint cols; gint widthx = 0; gint widthy = 0; gint min_width = 0; gint rows = 0; gint tc; gint _tmp45_; gint _tmp46_; gint _tmp55_; gdouble _tmp56_; gdouble _tmp57_ = 0.0; gint _tmp58_; GtkIconView* _tmp59_; gint _tmp60_; gint _tmp61_; gdouble _tmp62_ = 0.0; gint _tmp63_; gint _tmp64_; gint _tmp65_; gint _tmp66_; gint _tmp67_; gint full_height; gint _tmp68_; gint _tmp69_; gint _tmp71_; gint _tmp72_; GtkListStore* _tmp73_; gint _tmp74_; gint _tmp75_; GdkPixbuf* _tmp76_; GdkPixbuf* pixbuf; GdkPixbuf* _tmp77_; GtkTreeIter iter = {0}; g_return_if_fail (self != NULL); _tmp0_ = self->max_width; if (_tmp0_ == (-1)) { return; } _tmp1_ = self->slides_view; gtk_icon_view_set_margin (_tmp1_, 0); _tmp2_ = self->slides_view; _tmp3_ = gtk_icon_view_get_margin (_tmp2_); margin = _tmp3_; _tmp4_ = self->slides_view; _tmp5_ = gtk_icon_view_get_item_padding (_tmp4_); padding = _tmp5_ + 1; _tmp6_ = self->slides_view; _tmp7_ = gtk_icon_view_get_row_spacing (_tmp6_); row_spacing = _tmp7_; _tmp8_ = self->slides_view; _tmp9_ = gtk_icon_view_get_column_spacing (_tmp8_); col_spacing = _tmp9_; _tmp10_ = self->max_width; _tmp11_ = margin; eff_max_width = _tmp10_ - (2 * _tmp11_); _tmp12_ = self->max_height; _tmp13_ = margin; eff_max_height = _tmp12_ - (2 * _tmp13_); _tmp14_ = eff_max_width; _tmp15_ = pdfpc_options_min_overview_width; _tmp16_ = padding; _tmp17_ = col_spacing; cols = _tmp14_ / ((_tmp15_ + (2 * _tmp16_)) + _tmp17_); tc = 0; self->target_width = 0; while (TRUE) { gint _tmp18_; gint _tmp19_; gint _tmp20_; gint _tmp21_; gint _tmp22_; gint _tmp23_; gint _tmp24_; gdouble _tmp25_ = 0.0; gint _tmp26_; gint _tmp27_; gint _tmp28_; gint _tmp29_; gdouble _tmp30_; gdouble _tmp31_ = 0.0; gint _tmp32_; gint _tmp33_; gint _tmp34_ = 0; gint _tmp35_; gint _tmp36_; gint _tmp39_; gint _tmp40_; gint _tmp41_; gint _tmp44_; _tmp18_ = cols; if (!(_tmp18_ > 0)) { break; } _tmp19_ = eff_max_width; _tmp20_ = cols; _tmp21_ = padding; _tmp22_ = col_spacing; widthx = ((_tmp19_ / _tmp20_) - (2 * _tmp21_)) - (2 * _tmp22_); _tmp23_ = self->n_slides; _tmp24_ = cols; _tmp25_ = ceil ((gdouble) (((gfloat) _tmp23_) / _tmp24_)); rows = (gint) _tmp25_; _tmp26_ = eff_max_height; _tmp27_ = rows; _tmp28_ = padding; _tmp29_ = row_spacing; _tmp30_ = self->aspect_ratio; _tmp31_ = floor ((((_tmp26_ / _tmp27_) - (2 * _tmp28_)) - (2 * _tmp29_)) * _tmp30_); widthy = (gint) _tmp31_; _tmp32_ = widthy; _tmp33_ = pdfpc_options_min_overview_width; if (_tmp32_ < _tmp33_) { break; } _tmp35_ = widthx; _tmp36_ = widthy; if (_tmp35_ < _tmp36_) { gint _tmp37_; _tmp37_ = widthx; _tmp34_ = _tmp37_; } else { gint _tmp38_; _tmp38_ = widthy; _tmp34_ = _tmp38_; } _tmp39_ = _tmp34_; min_width = _tmp39_; _tmp40_ = min_width; _tmp41_ = self->target_width; if (_tmp40_ >= _tmp41_) { gint _tmp42_; gint _tmp43_; _tmp42_ = min_width; self->target_width = _tmp42_; _tmp43_ = cols; tc = _tmp43_; } _tmp44_ = cols; cols = _tmp44_ - 1; } _tmp45_ = self->target_width; _tmp46_ = pdfpc_options_min_overview_width; if (_tmp45_ < _tmp46_) { gint _tmp47_; GtkIconView* _tmp48_; gint _tmp49_; gint _tmp50_; gint _tmp51_; gint _tmp52_; _tmp47_ = pdfpc_options_min_overview_width; self->target_width = _tmp47_; _tmp48_ = self->slides_view; _tmp49_ = eff_max_width; _tmp50_ = pdfpc_options_min_overview_width; _tmp51_ = padding; _tmp52_ = col_spacing; gtk_icon_view_set_columns (_tmp48_, (_tmp49_ - 20) / ((_tmp50_ + (2 * _tmp51_)) + _tmp52_)); } else { GtkIconView* _tmp53_; gint _tmp54_; _tmp53_ = self->slides_view; _tmp54_ = tc; gtk_icon_view_set_columns (_tmp53_, _tmp54_); } gtk_scrolled_window_set_policy ((GtkScrolledWindow*) self, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); _tmp55_ = self->target_width; _tmp56_ = self->aspect_ratio; _tmp57_ = round (_tmp55_ / _tmp56_); self->target_height = (gint) _tmp57_; _tmp58_ = self->n_slides; _tmp59_ = self->slides_view; _tmp60_ = gtk_icon_view_get_columns (_tmp59_); _tmp61_ = _tmp60_; _tmp62_ = ceil ((gdouble) (((gfloat) _tmp58_) / _tmp61_)); rows = (gint) _tmp62_; _tmp63_ = rows; _tmp64_ = self->target_height; _tmp65_ = padding; _tmp66_ = row_spacing; _tmp67_ = margin; full_height = (_tmp63_ * ((_tmp64_ + (2 * _tmp65_)) + (2 * _tmp66_))) + (2 * _tmp67_); _tmp68_ = full_height; _tmp69_ = self->max_height; if (_tmp68_ > _tmp69_) { gint _tmp70_; _tmp70_ = self->max_height; full_height = _tmp70_; } _tmp71_ = full_height; gtk_widget_set_size_request ((GtkWidget*) self, -1, _tmp71_); _tmp72_ = self->n_slides; self->last_structure_n_slides = _tmp72_; _tmp73_ = self->slides; gtk_list_store_clear (_tmp73_); _tmp74_ = self->target_width; _tmp75_ = self->target_height; _tmp76_ = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, _tmp74_, _tmp75_); pixbuf = _tmp76_; _tmp77_ = pixbuf; gdk_pixbuf_fill (_tmp77_, (guint32) 0x7f7f7fff); memset (&iter, 0, sizeof (GtkTreeIter)); { gint i; i = 0; { gboolean _tmp78_; _tmp78_ = TRUE; while (TRUE) { gboolean _tmp79_; gint _tmp81_; gint _tmp82_; GtkListStore* _tmp83_; GtkTreeIter _tmp84_ = {0}; GtkListStore* _tmp85_; GtkTreeIter _tmp86_; GdkPixbuf* _tmp87_; GValue _tmp88_ = {0}; _tmp79_ = _tmp78_; if (!_tmp79_) { gint _tmp80_; _tmp80_ = i; i = _tmp80_ + 1; } _tmp78_ = FALSE; _tmp81_ = i; _tmp82_ = self->n_slides; if (!(_tmp81_ < _tmp82_)) { break; } _tmp83_ = self->slides; gtk_list_store_append (_tmp83_, &_tmp84_); iter = _tmp84_; _tmp85_ = self->slides; _tmp86_ = iter; _tmp87_ = pixbuf; g_value_init (&_tmp88_, GDK_TYPE_PIXBUF); g_value_set_object (&_tmp88_, _tmp87_); gtk_list_store_set_value (_tmp85_, &_tmp86_, 0, &_tmp88_); G_IS_VALUE (&_tmp88_) ? (g_value_unset (&_tmp88_), NULL) : NULL; } } } pdfpc_window_overview_fill_previews (self); _g_object_unref0 (pixbuf); } /** * Fill the previews (only if we have a cache and we are displayed). * The size of the icons should be known already * * This is done in a progressive way (one slide at a time) instead of * all the slides in one go to provide some progress feedback to the * user. */ static gboolean __pdfpc_window_overview_fill_previews_gsource_func (gpointer self) { gboolean result; result = _pdfpc_window_overview_fill_previews (self); return result; } void pdfpc_window_overview_fill_previews (pdfpcWindowOverview* self) { guint _tmp0_; guint _tmp2_ = 0U; g_return_if_fail (self != NULL); _tmp0_ = self->idle_id; if (_tmp0_ != ((guint) 0)) { guint _tmp1_; _tmp1_ = self->idle_id; g_source_remove (_tmp1_); } self->next_undone_preview = 0; _tmp2_ = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, __pdfpc_window_overview_fill_previews_gsource_func, g_object_ref (self), g_object_unref); self->idle_id = _tmp2_; } gboolean _pdfpc_window_overview_fill_previews (pdfpcWindowOverview* self) { gboolean result = FALSE; gboolean _tmp0_ = FALSE; pdfpcRendererCacheBase* _tmp1_; gboolean _tmp4_; gint pixmap_width = 0; gint pixmap_height = 0; pdfpcRendererCacheBase* _tmp5_; GdkPixmap* _tmp6_ = NULL; GdkPixmap* _tmp7_; gint _tmp8_ = 0; gint _tmp9_ = 0; gint _tmp10_; gint _tmp11_; GdkPixbuf* _tmp12_; GdkPixbuf* pixbuf; GdkPixbuf* _tmp13_; pdfpcRendererCacheBase* _tmp14_; pdfpcMetadataPdf* _tmp15_; gint _tmp16_; gint _tmp17_ = 0; GdkPixmap* _tmp18_ = NULL; GdkPixmap* _tmp19_; gint _tmp20_; gint _tmp21_; GdkPixbuf* _tmp22_; gint _tmp23_; gint _tmp24_; GdkPixbuf* _tmp25_ = NULL; GdkPixbuf* pixbuf_scaled; GtkTreeIter iter = {0}; GtkListStore* _tmp26_; gint _tmp27_; gchar* _tmp28_ = NULL; gchar* _tmp29_; GtkTreeIter _tmp30_ = {0}; GtkListStore* _tmp31_; GtkTreeIter _tmp32_; GdkPixbuf* _tmp33_; GValue _tmp34_ = {0}; gint _tmp35_; gint _tmp36_; gint _tmp37_; g_return_val_if_fail (self != NULL, FALSE); _tmp1_ = self->cache; if (_tmp1_ == NULL) { _tmp0_ = TRUE; } else { gint _tmp2_; gint _tmp3_; _tmp2_ = self->next_undone_preview; _tmp3_ = self->n_slides; _tmp0_ = _tmp2_ >= _tmp3_; } _tmp4_ = _tmp0_; if (_tmp4_) { result = FALSE; return result; } _tmp5_ = self->cache; _tmp6_ = pdfpc_renderer_cache_base_retrieve (_tmp5_, (guint) 0); _tmp7_ = _tmp6_; gdk_drawable_get_size ((GdkDrawable*) _tmp7_, &_tmp8_, &_tmp9_); pixmap_width = _tmp8_; pixmap_height = _tmp9_; _g_object_unref0 (_tmp7_); _tmp10_ = pixmap_width; _tmp11_ = pixmap_height; _tmp12_ = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, _tmp10_, _tmp11_); pixbuf = _tmp12_; _tmp13_ = pixbuf; _tmp14_ = self->cache; _tmp15_ = self->metadata; _tmp16_ = self->next_undone_preview; _tmp17_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp15_, _tmp16_); _tmp18_ = pdfpc_renderer_cache_base_retrieve (_tmp14_, (guint) _tmp17_); _tmp19_ = _tmp18_; _tmp20_ = pixmap_width; _tmp21_ = pixmap_height; gdk_pixbuf_get_from_drawable (_tmp13_, (GdkDrawable*) _tmp19_, NULL, 0, 0, 0, 0, _tmp20_, _tmp21_); _g_object_unref0 (_tmp19_); _tmp22_ = pixbuf; _tmp23_ = self->target_width; _tmp24_ = self->target_height; _tmp25_ = gdk_pixbuf_scale_simple (_tmp22_, _tmp23_, _tmp24_, GDK_INTERP_BILINEAR); pixbuf_scaled = _tmp25_; memset (&iter, 0, sizeof (GtkTreeIter)); _tmp26_ = self->slides; _tmp27_ = self->next_undone_preview; _tmp28_ = g_strdup_printf ("%i", _tmp27_); _tmp29_ = _tmp28_; gtk_tree_model_get_iter_from_string ((GtkTreeModel*) _tmp26_, &_tmp30_, _tmp29_); iter = _tmp30_; _g_free0 (_tmp29_); _tmp31_ = self->slides; _tmp32_ = iter; _tmp33_ = pixbuf_scaled; g_value_init (&_tmp34_, GDK_TYPE_PIXBUF); g_value_set_object (&_tmp34_, _tmp33_); gtk_list_store_set_value (_tmp31_, &_tmp32_, 0, &_tmp34_); G_IS_VALUE (&_tmp34_) ? (g_value_unset (&_tmp34_), NULL) : NULL; _tmp35_ = self->next_undone_preview; self->next_undone_preview = _tmp35_ + 1; _tmp36_ = self->next_undone_preview; _tmp37_ = self->n_slides; result = _tmp36_ < _tmp37_; _g_object_unref0 (pixbuf_scaled); _g_object_unref0 (pixbuf); return result; } /** * Gives the cache to retrieve the images from. The caching process * itself should already be finished. */ void pdfpc_window_overview_set_cache (pdfpcWindowOverview* self, pdfpcRendererCacheBase* cache) { pdfpcRendererCacheBase* _tmp0_; pdfpcRendererCacheBase* _tmp1_; g_return_if_fail (self != NULL); g_return_if_fail (cache != NULL); _tmp0_ = cache; _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->cache); self->cache = _tmp1_; pdfpc_window_overview_fill_previews (self); } /** * Set the number of slides. If it is different to what we know, it * triggers a rebuilding of the widget. */ void pdfpc_window_overview_set_n_slides (pdfpcWindowOverview* self, gint n) { gint _tmp0_; gint _tmp1_; g_return_if_fail (self != NULL); _tmp0_ = n; _tmp1_ = self->n_slides; if (_tmp0_ != _tmp1_) { gint _tmp2_; gint _tmp3_; gint currently_selected; gint _tmp4_; gint _tmp5_; gint _tmp6_; gint _tmp8_; _tmp2_ = pdfpc_window_overview_get_current_slide (self); _tmp3_ = _tmp2_; currently_selected = _tmp3_; _tmp4_ = n; self->n_slides = _tmp4_; pdfpc_window_overview_fill_structure (self); _tmp5_ = currently_selected; _tmp6_ = self->n_slides; if (_tmp5_ >= _tmp6_) { gint _tmp7_; _tmp7_ = self->n_slides; currently_selected = _tmp7_ - 1; } _tmp8_ = currently_selected; pdfpc_window_overview_set_current_slide (self, _tmp8_); } } /** * Remove the current slide from the overview, and set the total number * of slides to the new value. Perpare to regenerate the structure the * next time the overview is hidden. */ void pdfpc_window_overview_remove_current (pdfpcWindowOverview* self, gint newn) { gint _tmp0_; GtkTreeIter iter = {0}; GtkListStore* _tmp1_; gint _tmp2_; gint _tmp3_; gchar* _tmp4_ = NULL; gchar* _tmp5_; GtkTreeIter _tmp6_ = {0}; GtkListStore* _tmp7_; GtkTreeIter _tmp8_; gint _tmp9_; gint _tmp10_; gint _tmp11_; g_return_if_fail (self != NULL); _tmp0_ = newn; self->n_slides = _tmp0_; memset (&iter, 0, sizeof (GtkTreeIter)); _tmp1_ = self->slides; _tmp2_ = pdfpc_window_overview_get_current_slide (self); _tmp3_ = _tmp2_; _tmp4_ = g_strdup_printf ("%i", _tmp3_); _tmp5_ = _tmp4_; gtk_tree_model_get_iter_from_string ((GtkTreeModel*) _tmp1_, &_tmp6_, _tmp5_); iter = _tmp6_; _g_free0 (_tmp5_); _tmp7_ = self->slides; _tmp8_ = iter; gtk_list_store_remove (_tmp7_, &_tmp8_); _tmp9_ = pdfpc_window_overview_get_current_slide (self); _tmp10_ = _tmp9_; _tmp11_ = self->n_slides; if (_tmp10_ >= _tmp11_) { gint _tmp12_; _tmp12_ = self->n_slides; pdfpc_window_overview_set_current_slide (self, _tmp12_ - 1); } } /** * We handle some "navigation" key presses ourselves. Others are left to * the standard IconView controls, the rest are passed back to the * PresentationController. */ gboolean pdfpc_window_overview_on_key_press (pdfpcWindowOverview* self, GtkWidget* source, GdkEventKey* key) { gboolean result = FALSE; gboolean handled; GdkEventKey _tmp0_; guint _tmp1_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (source != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); handled = FALSE; _tmp0_ = *key; _tmp1_ = _tmp0_.keyval; switch (_tmp1_) { case 0xff51: case 0xff55: { gint _tmp2_; gint _tmp3_; _tmp2_ = pdfpc_window_overview_get_current_slide (self); _tmp3_ = _tmp2_; if (_tmp3_ > 0) { gint _tmp4_; gint _tmp5_; _tmp4_ = pdfpc_window_overview_get_current_slide (self); _tmp5_ = _tmp4_; pdfpc_window_overview_set_current_slide (self, _tmp5_ - 1); } handled = TRUE; break; } case 0xff53: case 0xff56: { gint _tmp6_; gint _tmp7_; gint _tmp8_; _tmp6_ = pdfpc_window_overview_get_current_slide (self); _tmp7_ = _tmp6_; _tmp8_ = self->n_slides; if (_tmp7_ < (_tmp8_ - 1)) { gint _tmp9_; gint _tmp10_; _tmp9_ = pdfpc_window_overview_get_current_slide (self); _tmp10_ = _tmp9_; pdfpc_window_overview_set_current_slide (self, _tmp10_ + 1); } handled = TRUE; break; } case 0xff0d: { pdfpcPresentationController* _tmp11_; gint _tmp12_; gint _tmp13_; _tmp11_ = self->presentation_controller; _tmp12_ = pdfpc_window_overview_get_current_slide (self); _tmp13_ = _tmp12_; pdfpc_presentation_controller_goto_user_page (_tmp11_, _tmp13_ + 1); break; } default: break; } result = handled; return result; } gboolean pdfpc_window_overview_on_mouse_move (pdfpcWindowOverview* self, GtkWidget* source, GdkEventMotion* event) { gboolean result = FALSE; GtkTreePath* path = NULL; GtkIconView* _tmp0_; GdkEventMotion _tmp1_; gdouble _tmp2_; GdkEventMotion _tmp3_; gdouble _tmp4_; GtkTreePath* _tmp5_ = NULL; GtkTreePath* _tmp6_; gboolean _tmp7_ = FALSE; GtkTreePath* _tmp8_; gboolean _tmp14_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (source != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE); _tmp0_ = self->slides_view; _tmp1_ = *event; _tmp2_ = _tmp1_.x; _tmp3_ = *event; _tmp4_ = _tmp3_.y; _tmp5_ = gtk_icon_view_get_path_at_pos (_tmp0_, (gint) _tmp2_, (gint) _tmp4_); _tmp6_ = _gtk_tree_path_copy0 (_tmp5_); _gtk_tree_path_free0 (path); path = _tmp6_; _tmp8_ = path; if (_tmp8_ != NULL) { GtkTreePath* _tmp9_; gint* _tmp10_ = NULL; gint _tmp11_; gint _tmp12_; gint _tmp13_; _tmp9_ = path; _tmp10_ = gtk_tree_path_get_indices (_tmp9_); _tmp11_ = _tmp10_[0]; _tmp12_ = pdfpc_window_overview_get_current_slide (self); _tmp13_ = _tmp12_; _tmp7_ = _tmp11_ != _tmp13_; } else { _tmp7_ = FALSE; } _tmp14_ = _tmp7_; if (_tmp14_) { GtkTreePath* _tmp15_; gint* _tmp16_ = NULL; gint _tmp17_; _tmp15_ = path; _tmp16_ = gtk_tree_path_get_indices (_tmp15_); _tmp17_ = _tmp16_[0]; pdfpc_window_overview_set_current_slide (self, _tmp17_); } result = FALSE; _gtk_tree_path_free0 (path); return result; } gboolean pdfpc_window_overview_on_mouse_release (pdfpcWindowOverview* self, GdkEventButton* event) { gboolean result = FALSE; GdkEventButton _tmp0_; guint _tmp1_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE); _tmp0_ = *event; _tmp1_ = _tmp0_.button; if (_tmp1_ == ((guint) 1)) { pdfpcPresentationController* _tmp2_; gint _tmp3_; gint _tmp4_; _tmp2_ = self->presentation_controller; _tmp3_ = pdfpc_window_overview_get_current_slide (self); _tmp4_ = _tmp3_; pdfpc_presentation_controller_goto_user_page (_tmp2_, _tmp4_ + 1); } result = FALSE; return result; } gint pdfpc_window_overview_get_current_slide (pdfpcWindowOverview* self) { gint result; gint _tmp0_; g_return_val_if_fail (self != NULL, 0); _tmp0_ = self->priv->_current_slide; result = _tmp0_; return result; } void pdfpc_window_overview_set_current_slide (pdfpcWindowOverview* self, gint value) { gint _tmp0_; GtkTreePath* _tmp1_; GtkTreePath* path; GtkIconView* _tmp2_; GtkIconView* _tmp3_; g_return_if_fail (self != NULL); _tmp0_ = value; _tmp1_ = gtk_tree_path_new_from_indices (_tmp0_, -1); path = _tmp1_; _tmp2_ = self->slides_view; gtk_icon_view_select_path (_tmp2_, path); _tmp3_ = self->slides_view; gtk_icon_view_set_cursor (_tmp3_, path, NULL, FALSE); _gtk_tree_path_free0 (path); g_object_notify ((GObject *) self, "current-slide"); } static void pdfpc_window_overview_class_init (pdfpcWindowOverviewClass * klass) { pdfpc_window_overview_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (pdfpcWindowOverviewPrivate)); G_OBJECT_CLASS (klass)->get_property = _vala_pdfpc_window_overview_get_property; G_OBJECT_CLASS (klass)->set_property = _vala_pdfpc_window_overview_set_property; G_OBJECT_CLASS (klass)->finalize = pdfpc_window_overview_finalize; g_object_class_install_property (G_OBJECT_CLASS (klass), PDFPC_WINDOW_OVERVIEW_CURRENT_SLIDE, g_param_spec_int ("current-slide", "current-slide", "current-slide", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); } static void pdfpc_window_overview_instance_init (pdfpcWindowOverview * self) { self->priv = PDFPC_WINDOW_OVERVIEW_GET_PRIVATE (self); self->n_slides = 0; self->last_structure_n_slides = 0; self->next_undone_preview = 0; self->idle_id = (guint) 0; self->cache = NULL; self->max_width = -1; self->max_height = -1; self->priv->_current_slide = 0; } static void pdfpc_window_overview_finalize (GObject* obj) { pdfpcWindowOverview * self; self = PDFPC_WINDOW_OVERVIEW (obj); _g_object_unref0 (self->slides); _g_object_unref0 (self->slides_view); _g_object_unref0 (self->metadata); _g_object_unref0 (self->cache); _g_object_unref0 (self->presentation_controller); _g_object_unref0 (self->presenter); G_OBJECT_CLASS (pdfpc_window_overview_parent_class)->finalize (obj); } /** * An overview of all the slides in the form of a table */ GType pdfpc_window_overview_get_type (void) { static volatile gsize pdfpc_window_overview_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_window_overview_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcWindowOverviewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_window_overview_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcWindowOverview), 0, (GInstanceInitFunc) pdfpc_window_overview_instance_init, NULL }; GType pdfpc_window_overview_type_id; pdfpc_window_overview_type_id = g_type_register_static (GTK_TYPE_SCROLLED_WINDOW, "pdfpcWindowOverview", &g_define_type_info, 0); g_once_init_leave (&pdfpc_window_overview_type_id__volatile, pdfpc_window_overview_type_id); } return pdfpc_window_overview_type_id__volatile; } static void _vala_pdfpc_window_overview_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { pdfpcWindowOverview * self; self = PDFPC_WINDOW_OVERVIEW (object); switch (property_id) { case PDFPC_WINDOW_OVERVIEW_CURRENT_SLIDE: g_value_set_int (value, pdfpc_window_overview_get_current_slide (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void _vala_pdfpc_window_overview_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { pdfpcWindowOverview * self; self = PDFPC_WINDOW_OVERVIEW (object); switch (property_id) { case PDFPC_WINDOW_OVERVIEW_CURRENT_SLIDE: pdfpc_window_overview_set_current_slide (self, g_value_get_int (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void pdfpc_window_cell_renderer_highlight_real_render (GtkCellRenderer* base, GdkWindow* window, GtkWidget* widget, GdkRectangle* background_area, GdkRectangle* cell_area, GdkRectangle* expose_area, GtkCellRendererState flags) { pdfpcWindowCellRendererHighlight * self; GdkWindow* _tmp0_; GtkWidget* _tmp1_; GdkRectangle _tmp2_; GdkRectangle _tmp3_; GdkRectangle _tmp4_; GtkCellRendererState _tmp5_; GtkCellRendererState _tmp6_; self = (pdfpcWindowCellRendererHighlight*) base; g_return_if_fail (window != NULL); g_return_if_fail (widget != NULL); g_return_if_fail (background_area != NULL); g_return_if_fail (cell_area != NULL); g_return_if_fail (expose_area != NULL); _tmp0_ = window; _tmp1_ = widget; _tmp2_ = *background_area; _tmp3_ = *cell_area; _tmp4_ = *expose_area; _tmp5_ = flags; GTK_CELL_RENDERER_CLASS (pdfpc_window_cell_renderer_highlight_parent_class)->render ((GtkCellRenderer*) GTK_CELL_RENDERER_PIXBUF (self), _tmp0_, _tmp1_, &_tmp2_, &_tmp3_, &_tmp4_, _tmp5_); _tmp6_ = flags; if (_tmp6_ != GTK_CELL_RENDERER_SELECTED) { GdkWindow* _tmp7_; cairo_t* _tmp8_ = NULL; cairo_t* cr; cairo_t* _tmp9_; GdkRectangle _tmp10_; cairo_t* _tmp11_; cairo_t* _tmp12_; GdkRectangle _tmp13_; cairo_t* _tmp14_; cairo_t* _tmp15_; _tmp7_ = window; _tmp8_ = gdk_cairo_create ((GdkDrawable*) _tmp7_); cr = _tmp8_; _tmp9_ = cr; _tmp10_ = *expose_area; gdk_cairo_rectangle (_tmp9_, &_tmp10_); _tmp11_ = cr; cairo_clip (_tmp11_); _tmp12_ = cr; _tmp13_ = *cell_area; gdk_cairo_rectangle (_tmp12_, &_tmp13_); _tmp14_ = cr; cairo_set_source_rgba (_tmp14_, (gdouble) 0, (gdouble) 0, (gdouble) 0, 0.2); _tmp15_ = cr; cairo_fill (_tmp15_); _cairo_destroy0 (cr); } } pdfpcWindowCellRendererHighlight* pdfpc_window_cell_renderer_highlight_construct (GType object_type) { pdfpcWindowCellRendererHighlight * self = NULL; self = (pdfpcWindowCellRendererHighlight*) g_object_new (object_type, NULL); return self; } pdfpcWindowCellRendererHighlight* pdfpc_window_cell_renderer_highlight_new (void) { return pdfpc_window_cell_renderer_highlight_construct (PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT); } static void pdfpc_window_cell_renderer_highlight_class_init (pdfpcWindowCellRendererHighlightClass * klass) { pdfpc_window_cell_renderer_highlight_parent_class = g_type_class_peek_parent (klass); GTK_CELL_RENDERER_CLASS (klass)->render = pdfpc_window_cell_renderer_highlight_real_render; } static void pdfpc_window_cell_renderer_highlight_instance_init (pdfpcWindowCellRendererHighlight * self) { } GType pdfpc_window_cell_renderer_highlight_get_type (void) { static volatile gsize pdfpc_window_cell_renderer_highlight_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_window_cell_renderer_highlight_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcWindowCellRendererHighlightClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_window_cell_renderer_highlight_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcWindowCellRendererHighlight), 0, (GInstanceInitFunc) pdfpc_window_cell_renderer_highlight_instance_init, NULL }; GType pdfpc_window_cell_renderer_highlight_type_id; pdfpc_window_cell_renderer_highlight_type_id = g_type_register_static (GTK_TYPE_CELL_RENDERER_PIXBUF, "pdfpcWindowCellRendererHighlight", &g_define_type_info, 0); g_once_init_leave (&pdfpc_window_cell_renderer_highlight_type_id__volatile, pdfpc_window_cell_renderer_highlight_type_id); } return pdfpc_window_cell_renderer_highlight_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/window/presentation.c000066400000000000000000001007561177613036100232720ustar00rootroot00000000000000/* presentation.c generated by valac 0.16.0, the Vala compiler * generated from presentation.vala, do not modify */ #include #include #include #include #define PDFPC_WINDOW_TYPE_FULLSCREEN (pdfpc_window_fullscreen_get_type ()) #define PDFPC_WINDOW_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreen)) #define PDFPC_WINDOW_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) #define PDFPC_WINDOW_IS_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_IS_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_FULLSCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) typedef struct _pdfpcWindowFullscreen pdfpcWindowFullscreen; typedef struct _pdfpcWindowFullscreenClass pdfpcWindowFullscreenClass; typedef struct _pdfpcWindowFullscreenPrivate pdfpcWindowFullscreenPrivate; #define PDFPC_TYPE_CONTROLLABLE (pdfpc_controllable_get_type ()) #define PDFPC_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllable)) #define PDFPC_IS_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CONTROLLABLE)) #define PDFPC_CONTROLLABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllableIface)) typedef struct _pdfpcControllable pdfpcControllable; typedef struct _pdfpcControllableIface pdfpcControllableIface; #define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController)) #define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) #define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) typedef struct _pdfpcPresentationController pdfpcPresentationController; typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass; #define PDFPC_WINDOW_TYPE_PRESENTATION (pdfpc_window_presentation_get_type ()) #define PDFPC_WINDOW_PRESENTATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentation)) #define PDFPC_WINDOW_PRESENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentationClass)) #define PDFPC_WINDOW_IS_PRESENTATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_PRESENTATION)) #define PDFPC_WINDOW_IS_PRESENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_PRESENTATION)) #define PDFPC_WINDOW_PRESENTATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentationClass)) typedef struct _pdfpcWindowPresentation pdfpcWindowPresentation; typedef struct _pdfpcWindowPresentationClass pdfpcWindowPresentationClass; typedef struct _pdfpcWindowPresentationPrivate pdfpcWindowPresentationPrivate; #define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ()) #define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase)) #define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) #define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) typedef struct _pdfpcViewBase pdfpcViewBase; typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ()) #define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf)) #define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) #define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf; typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass; #define PDFPC_VIEW_TYPE_DEFAULT (pdfpc_view_default_get_type ()) #define PDFPC_VIEW_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefault)) #define PDFPC_VIEW_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) #define PDFPC_VIEW_IS_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_IS_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) typedef struct _pdfpcViewDefault pdfpcViewDefault; typedef struct _pdfpcViewDefaultClass pdfpcViewDefaultClass; #define PDFPC_VIEW_TYPE_PDF (pdfpc_view_pdf_get_type ()) #define PDFPC_VIEW_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdf)) #define PDFPC_VIEW_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) #define PDFPC_VIEW_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) typedef struct _pdfpcViewPdf pdfpcViewPdf; typedef struct _pdfpcViewPdfClass pdfpcViewPdfClass; #define PDFPC_RENDERER_TYPE_BASE (pdfpc_renderer_base_get_type ()) #define PDFPC_RENDERER_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBase)) #define PDFPC_RENDERER_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) #define PDFPC_RENDERER_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) typedef struct _pdfpcRendererBase pdfpcRendererBase; typedef struct _pdfpcRendererBaseClass pdfpcRendererBaseClass; #define PDFPC_RENDERER_TYPE_CACHING (pdfpc_renderer_caching_get_type ()) #define PDFPC_RENDERER_CACHING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCaching)) #define PDFPC_RENDERER_IS_CACHING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_CACHING)) #define PDFPC_RENDERER_CACHING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCachingIface)) typedef struct _pdfpcRendererCaching pdfpcRendererCaching; typedef struct _pdfpcRendererCachingIface pdfpcRendererCachingIface; #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) #define PDFPC_TYPE_CACHE_STATUS (pdfpc_cache_status_get_type ()) #define PDFPC_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatus)) #define PDFPC_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) #define PDFPC_IS_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_IS_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_CACHE_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) typedef struct _pdfpcCacheStatus pdfpcCacheStatus; typedef struct _pdfpcCacheStatusClass pdfpcCacheStatusClass; #define PDFPC_VIEW_TYPE_PRERENDERING (pdfpc_view_prerendering_get_type ()) #define PDFPC_VIEW_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerendering)) #define PDFPC_VIEW_IS_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PRERENDERING)) #define PDFPC_VIEW_PRERENDERING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerenderingIface)) typedef struct _pdfpcViewPrerendering pdfpcViewPrerendering; typedef struct _pdfpcViewPrerenderingIface pdfpcViewPrerenderingIface; struct _pdfpcWindowFullscreen { GtkWindow parent_instance; pdfpcWindowFullscreenPrivate * priv; GdkRectangle screen_geometry; guint hide_cursor_timeout; gboolean faded_to_black; gboolean frozen; }; struct _pdfpcWindowFullscreenClass { GtkWindowClass parent_class; }; struct _pdfpcControllableIface { GTypeInterface parent_iface; pdfpcPresentationController* (*get_controller) (pdfpcControllable* self); void (*update) (pdfpcControllable* self); void (*edit_note) (pdfpcControllable* self); void (*ask_goto_page) (pdfpcControllable* self); void (*show_overview) (pdfpcControllable* self); void (*hide_overview) (pdfpcControllable* self); }; struct _pdfpcWindowPresentation { pdfpcWindowFullscreen parent_instance; pdfpcWindowPresentationPrivate * priv; pdfpcPresentationController* presentation_controller; pdfpcViewBase* view; }; struct _pdfpcWindowPresentationClass { pdfpcWindowFullscreenClass parent_class; }; struct _pdfpcRendererCachingIface { GTypeInterface parent_iface; void (*set_cache) (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* (*get_cache) (pdfpcRendererCaching* self); }; typedef enum { PDFPC_RENDERER_RENDER_ERROR_SLIDE_DOES_NOT_EXIST } pdfpcRendererRenderError; #define PDFPC_RENDERER_RENDER_ERROR pdfpc_renderer_render_error_quark () struct _pdfpcViewPrerenderingIface { GTypeInterface parent_iface; }; static gpointer pdfpc_window_presentation_parent_class = NULL; extern gboolean pdfpc_options_black_on_end; extern gboolean pdfpc_options_disable_caching; static pdfpcControllableIface* pdfpc_window_presentation_pdfpc_controllable_parent_iface = NULL; GType pdfpc_window_fullscreen_get_type (void) G_GNUC_CONST; GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST; GType pdfpc_controllable_get_type (void) G_GNUC_CONST; GType pdfpc_window_presentation_get_type (void) G_GNUC_CONST; GType pdfpc_view_base_get_type (void) G_GNUC_CONST; enum { PDFPC_WINDOW_PRESENTATION_DUMMY_PROPERTY }; GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST; pdfpcWindowPresentation* pdfpc_window_presentation_new (pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); pdfpcWindowPresentation* pdfpc_window_presentation_construct (GType object_type, pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); pdfpcWindowFullscreen* pdfpc_window_fullscreen_new (gint screen_num); pdfpcWindowFullscreen* pdfpc_window_fullscreen_construct (GType object_type, gint screen_num); static void __lambda10_ (pdfpcWindowPresentation* self, GtkObject* source); static void ___lambda10__gtk_object_destroy (GtkObject* _sender, gpointer self); gboolean pdfpc_presentation_controller_register_controllable (pdfpcPresentationController* self, pdfpcControllable* controllable); GType pdfpc_view_default_get_type (void) G_GNUC_CONST; GType pdfpc_view_pdf_get_type (void) G_GNUC_CONST; pdfpcViewPdf* pdfpc_view_pdf_from_metadata (pdfpcMetadataPdf* metadata, gint width, gint height, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller, GdkRectangle* scale_rect); GType pdfpc_renderer_base_get_type (void) G_GNUC_CONST; pdfpcRendererBase* pdfpc_view_base_get_renderer (pdfpcViewBase* self); GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_caching_get_type (void) G_GNUC_CONST; void pdfpc_renderer_caching_set_cache (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* pdfpc_renderer_cache_option_factory_create (pdfpcMetadataBase* metadata); gboolean pdfpc_window_presentation_on_key_pressed (pdfpcWindowPresentation* self, GdkEventKey* key); static gboolean _pdfpc_window_presentation_on_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self); gboolean pdfpc_window_presentation_on_button_press (pdfpcWindowPresentation* self, GdkEventButton* button); static gboolean _pdfpc_window_presentation_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self); gboolean pdfpc_window_presentation_on_scroll (pdfpcWindowPresentation* self, GtkWidget* source, GdkEventScroll* scroll); static gboolean _pdfpc_window_presentation_on_scroll_gtk_widget_scroll_event (GtkWidget* _sender, GdkEventScroll* event, gpointer self); gboolean pdfpc_presentation_controller_key_press (pdfpcPresentationController* self, GdkEventKey* key); gboolean pdfpc_presentation_controller_button_press (pdfpcPresentationController* self, GdkEventButton* button); void pdfpc_presentation_controller_scroll (pdfpcPresentationController* self, GdkEventScroll* scroll); void pdfpc_window_presentation_set_controller (pdfpcWindowPresentation* self, pdfpcPresentationController* controller); static pdfpcPresentationController* pdfpc_window_presentation_real_get_controller (pdfpcControllable* base); static void pdfpc_window_presentation_real_update (pdfpcControllable* base); gboolean pdfpc_presentation_controller_is_faded_to_black (pdfpcPresentationController* self); void pdfpc_view_base_fade_to_black (pdfpcViewBase* self); gboolean pdfpc_presentation_controller_is_frozen (pdfpcPresentationController* self); GQuark pdfpc_renderer_render_error_quark (void); void pdfpc_view_base_display (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); gint pdfpc_presentation_controller_get_current_slide_number (pdfpcPresentationController* self); static void pdfpc_window_presentation_real_edit_note (pdfpcControllable* base); static void pdfpc_window_presentation_real_ask_goto_page (pdfpcControllable* base); static void pdfpc_window_presentation_real_show_overview (pdfpcControllable* base); static void pdfpc_window_presentation_real_hide_overview (pdfpcControllable* base); gpointer pdfpc_cache_status_ref (gpointer instance); void pdfpc_cache_status_unref (gpointer instance); GParamSpec* pdfpc_param_spec_cache_status (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_value_set_cache_status (GValue* value, gpointer v_object); void pdfpc_value_take_cache_status (GValue* value, gpointer v_object); gpointer pdfpc_value_get_cache_status (const GValue* value); GType pdfpc_cache_status_get_type (void) G_GNUC_CONST; void pdfpc_window_presentation_set_cache_observer (pdfpcWindowPresentation* self, pdfpcCacheStatus* observer); GType pdfpc_view_prerendering_get_type (void) G_GNUC_CONST; void pdfpc_cache_status_monitor_view (pdfpcCacheStatus* self, pdfpcViewPrerendering* view); static void pdfpc_window_presentation_finalize (GObject* obj); /** * Base constructor instantiating a new presentation window */ static void __lambda10_ (pdfpcWindowPresentation* self, GtkObject* source) { g_return_if_fail (source != NULL); gtk_main_quit (); } static void ___lambda10__gtk_object_destroy (GtkObject* _sender, gpointer self) { __lambda10_ (self, _sender); } static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } static gboolean _pdfpc_window_presentation_on_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) { gboolean result; result = pdfpc_window_presentation_on_key_pressed (self, event); return result; } static gboolean _pdfpc_window_presentation_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) { gboolean result; result = pdfpc_window_presentation_on_button_press (self, event); return result; } static gboolean _pdfpc_window_presentation_on_scroll_gtk_widget_scroll_event (GtkWidget* _sender, GdkEventScroll* event, gpointer self) { gboolean result; result = pdfpc_window_presentation_on_scroll (self, _sender, event); return result; } pdfpcWindowPresentation* pdfpc_window_presentation_construct (GType object_type, pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller) { pdfpcWindowPresentation * self = NULL; gint _tmp0_; pdfpcPresentationController* _tmp1_; pdfpcPresentationController* _tmp2_; pdfpcPresentationController* _tmp3_; GdkColor black = {0}; GdkColor _tmp4_ = {0}; GdkColor _tmp5_; GtkFixed* _tmp6_; GtkFixed* _tmp7_; GtkFixed* fixedLayout; GtkFixed* _tmp8_; GdkRectangle _tmp9_; gint _tmp10_; GdkRectangle _tmp11_; gint _tmp12_; GtkFixed* _tmp13_; GdkRectangle scale_rect = {0}; pdfpcMetadataPdf* _tmp14_; GdkRectangle _tmp15_; gint _tmp16_; GdkRectangle _tmp17_; gint _tmp18_; gboolean _tmp19_; pdfpcPresentationController* _tmp20_; GdkRectangle _tmp21_ = {0}; pdfpcViewPdf* _tmp22_ = NULL; gboolean _tmp23_; GtkFixed* _tmp30_; pdfpcViewBase* _tmp31_; GdkRectangle _tmp32_; gint _tmp33_; GdkRectangle _tmp34_; gint _tmp35_; g_return_val_if_fail (metadata != NULL, NULL); g_return_val_if_fail (presentation_controller != NULL, NULL); _tmp0_ = screen_num; self = (pdfpcWindowPresentation*) pdfpc_window_fullscreen_construct (object_type, _tmp0_); g_signal_connect_object ((GtkObject*) self, "destroy", (GCallback) ___lambda10__gtk_object_destroy, self, 0); _tmp1_ = presentation_controller; _tmp2_ = _g_object_ref0 (_tmp1_); _g_object_unref0 (self->presentation_controller); self->presentation_controller = _tmp2_; _tmp3_ = self->presentation_controller; pdfpc_presentation_controller_register_controllable (_tmp3_, (pdfpcControllable*) self); gdk_color_parse ("black", &_tmp4_); black = _tmp4_; _tmp5_ = black; gtk_widget_modify_bg ((GtkWidget*) self, GTK_STATE_NORMAL, &_tmp5_); _tmp6_ = (GtkFixed*) gtk_fixed_new (); _tmp7_ = g_object_ref_sink (_tmp6_); fixedLayout = _tmp7_; _tmp8_ = fixedLayout; _tmp9_ = ((pdfpcWindowFullscreen*) self)->screen_geometry; _tmp10_ = _tmp9_.width; _tmp11_ = ((pdfpcWindowFullscreen*) self)->screen_geometry; _tmp12_ = _tmp11_.height; gtk_widget_set_size_request ((GtkWidget*) _tmp8_, _tmp10_, _tmp12_); _tmp13_ = fixedLayout; gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp13_); _tmp14_ = metadata; _tmp15_ = ((pdfpcWindowFullscreen*) self)->screen_geometry; _tmp16_ = _tmp15_.width; _tmp17_ = ((pdfpcWindowFullscreen*) self)->screen_geometry; _tmp18_ = _tmp17_.height; _tmp19_ = pdfpc_options_black_on_end; _tmp20_ = self->presentation_controller; _tmp22_ = pdfpc_view_pdf_from_metadata (_tmp14_, _tmp16_, _tmp18_, _tmp19_, _tmp20_, &_tmp21_); scale_rect = _tmp21_; _g_object_unref0 (self->view); self->view = (pdfpcViewBase*) _tmp22_; _tmp23_ = pdfpc_options_disable_caching; if (!_tmp23_) { pdfpcViewBase* _tmp24_; pdfpcRendererBase* _tmp25_ = NULL; pdfpcRendererCaching* _tmp26_; pdfpcMetadataPdf* _tmp27_; pdfpcRendererCacheBase* _tmp28_ = NULL; pdfpcRendererCacheBase* _tmp29_; _tmp24_ = self->view; _tmp25_ = pdfpc_view_base_get_renderer (_tmp24_); _tmp26_ = PDFPC_RENDERER_CACHING (_tmp25_); _tmp27_ = metadata; _tmp28_ = pdfpc_renderer_cache_option_factory_create ((pdfpcMetadataBase*) _tmp27_); _tmp29_ = _tmp28_; pdfpc_renderer_caching_set_cache (_tmp26_, _tmp29_); _g_object_unref0 (_tmp29_); _g_object_unref0 (_tmp26_); } _tmp30_ = fixedLayout; _tmp31_ = self->view; _tmp32_ = scale_rect; _tmp33_ = _tmp32_.x; _tmp34_ = scale_rect; _tmp35_ = _tmp34_.y; gtk_fixed_put (_tmp30_, (GtkWidget*) _tmp31_, _tmp33_, _tmp35_); gtk_widget_add_events ((GtkWidget*) self, (gint) GDK_KEY_PRESS_MASK); gtk_widget_add_events ((GtkWidget*) self, (gint) GDK_BUTTON_PRESS_MASK); gtk_widget_add_events ((GtkWidget*) self, (gint) GDK_SCROLL_MASK); g_signal_connect_object ((GtkWidget*) self, "key-press-event", (GCallback) _pdfpc_window_presentation_on_key_pressed_gtk_widget_key_press_event, self, 0); g_signal_connect_object ((GtkWidget*) self, "button-press-event", (GCallback) _pdfpc_window_presentation_on_button_press_gtk_widget_button_press_event, self, 0); g_signal_connect_object ((GtkWidget*) self, "scroll-event", (GCallback) _pdfpc_window_presentation_on_scroll_gtk_widget_scroll_event, self, 0); _g_object_unref0 (fixedLayout); return self; } pdfpcWindowPresentation* pdfpc_window_presentation_new (pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller) { return pdfpc_window_presentation_construct (PDFPC_WINDOW_TYPE_PRESENTATION, metadata, screen_num, presentation_controller); } /** * Handle keypress vents on the window and, if neccessary send them to the * presentation controller */ gboolean pdfpc_window_presentation_on_key_pressed (pdfpcWindowPresentation* self, GdkEventKey* key) { gboolean result = FALSE; pdfpcPresentationController* _tmp0_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); _tmp0_ = self->presentation_controller; if (_tmp0_ != NULL) { pdfpcPresentationController* _tmp1_; GdkEventKey _tmp2_; _tmp1_ = self->presentation_controller; _tmp2_ = *key; pdfpc_presentation_controller_key_press (_tmp1_, &_tmp2_); } result = FALSE; return result; } /** * Handle mouse button events on the window and, if neccessary send * them to the presentation controller */ gboolean pdfpc_window_presentation_on_button_press (pdfpcWindowPresentation* self, GdkEventButton* button) { gboolean result = FALSE; pdfpcPresentationController* _tmp0_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (button != NULL, FALSE); _tmp0_ = self->presentation_controller; if (_tmp0_ != NULL) { pdfpcPresentationController* _tmp1_; GdkEventButton _tmp2_; _tmp1_ = self->presentation_controller; _tmp2_ = *button; pdfpc_presentation_controller_button_press (_tmp1_, &_tmp2_); } result = FALSE; return result; } /** * Handle mouse scrolling events on the window and, if neccessary send * them to the presentation controller */ gboolean pdfpc_window_presentation_on_scroll (pdfpcWindowPresentation* self, GtkWidget* source, GdkEventScroll* scroll) { gboolean result = FALSE; pdfpcPresentationController* _tmp0_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (source != NULL, FALSE); g_return_val_if_fail (scroll != NULL, FALSE); _tmp0_ = self->presentation_controller; if (_tmp0_ != NULL) { pdfpcPresentationController* _tmp1_; GdkEventScroll _tmp2_; _tmp1_ = self->presentation_controller; _tmp2_ = *scroll; pdfpc_presentation_controller_scroll (_tmp1_, &_tmp2_); } result = FALSE; return result; } /** * Set the presentation controller which is notified of keypresses and * other observed events */ void pdfpc_window_presentation_set_controller (pdfpcWindowPresentation* self, pdfpcPresentationController* controller) { pdfpcPresentationController* _tmp0_; pdfpcPresentationController* _tmp1_; g_return_if_fail (self != NULL); g_return_if_fail (controller != NULL); _tmp0_ = controller; _tmp1_ = _g_object_ref0 (_tmp0_); _g_object_unref0 (self->presentation_controller); self->presentation_controller = _tmp1_; } /** * Return the PresentationController */ static pdfpcPresentationController* pdfpc_window_presentation_real_get_controller (pdfpcControllable* base) { pdfpcWindowPresentation * self; pdfpcPresentationController* result = NULL; pdfpcPresentationController* _tmp0_; pdfpcPresentationController* _tmp1_; self = (pdfpcWindowPresentation*) base; _tmp0_ = self->presentation_controller; _tmp1_ = _g_object_ref0 (_tmp0_); result = _tmp1_; return result; } /** * Update the display */ static void pdfpc_window_presentation_real_update (pdfpcControllable* base) { pdfpcWindowPresentation * self; pdfpcPresentationController* _tmp0_; gboolean _tmp1_ = FALSE; pdfpcPresentationController* _tmp3_; gboolean _tmp4_ = FALSE; GError * _inner_error_ = NULL; self = (pdfpcWindowPresentation*) base; _tmp0_ = self->presentation_controller; _tmp1_ = pdfpc_presentation_controller_is_faded_to_black (_tmp0_); if (_tmp1_) { pdfpcViewBase* _tmp2_; _tmp2_ = self->view; pdfpc_view_base_fade_to_black (_tmp2_); return; } _tmp3_ = self->presentation_controller; _tmp4_ = pdfpc_presentation_controller_is_frozen (_tmp3_); if (_tmp4_) { return; } { pdfpcViewBase* _tmp5_; pdfpcPresentationController* _tmp6_; gint _tmp7_ = 0; _tmp5_ = self->view; _tmp6_ = self->presentation_controller; _tmp7_ = pdfpc_presentation_controller_get_current_slide_number (_tmp6_); pdfpc_view_base_display (_tmp5_, _tmp7_, TRUE, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { goto __catch9_pdfpc_renderer_render_error; } g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } goto __finally9; __catch9_pdfpc_renderer_render_error: { GError* e = NULL; pdfpcPresentationController* _tmp8_; gint _tmp9_ = 0; const gchar* _tmp10_; e = _inner_error_; _inner_error_ = NULL; _tmp8_ = self->presentation_controller; _tmp9_ = pdfpc_presentation_controller_get_current_slide_number (_tmp8_); _tmp10_ = e->message; g_error ("presentation.vala:163: The pdf page %d could not be rendered: %s", _tmp9_, _tmp10_); _g_error_free0 (e); } __finally9: if (_inner_error_ != NULL) { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } /** * Edit note for current slide. We don't do anything. */ static void pdfpc_window_presentation_real_edit_note (pdfpcControllable* base) { pdfpcWindowPresentation * self; self = (pdfpcWindowPresentation*) base; } /** * Ask for the page to jump to. We don't do anything */ static void pdfpc_window_presentation_real_ask_goto_page (pdfpcControllable* base) { pdfpcWindowPresentation * self; self = (pdfpcWindowPresentation*) base; } /** * Show an overview. We don't do anything (yet?) */ static void pdfpc_window_presentation_real_show_overview (pdfpcControllable* base) { pdfpcWindowPresentation * self; self = (pdfpcWindowPresentation*) base; } /** * Hide the overview. We don't do anything */ static void pdfpc_window_presentation_real_hide_overview (pdfpcControllable* base) { pdfpcWindowPresentation * self; self = (pdfpcWindowPresentation*) base; } /** * Set the cache observer for the Views on this window * * This method takes care of registering all Prerendering Views used by * this window correctly with the CacheStatus object to provide acurate * cache status measurements. */ void pdfpc_window_presentation_set_cache_observer (pdfpcWindowPresentation* self, pdfpcCacheStatus* observer) { pdfpcViewBase* _tmp0_; pdfpcViewPrerendering* _tmp1_; pdfpcViewPrerendering* prerendering_view; pdfpcViewPrerendering* _tmp2_; g_return_if_fail (self != NULL); g_return_if_fail (observer != NULL); _tmp0_ = self->view; _tmp1_ = _g_object_ref0 (PDFPC_VIEW_IS_PRERENDERING (_tmp0_) ? ((pdfpcViewPrerendering*) _tmp0_) : NULL); prerendering_view = _tmp1_; _tmp2_ = prerendering_view; if (_tmp2_ != NULL) { pdfpcCacheStatus* _tmp3_; pdfpcViewPrerendering* _tmp4_; _tmp3_ = observer; _tmp4_ = prerendering_view; pdfpc_cache_status_monitor_view (_tmp3_, _tmp4_); } _g_object_unref0 (prerendering_view); } static void pdfpc_window_presentation_class_init (pdfpcWindowPresentationClass * klass) { pdfpc_window_presentation_parent_class = g_type_class_peek_parent (klass); G_OBJECT_CLASS (klass)->finalize = pdfpc_window_presentation_finalize; } static void pdfpc_window_presentation_pdfpc_controllable_interface_init (pdfpcControllableIface * iface) { pdfpc_window_presentation_pdfpc_controllable_parent_iface = g_type_interface_peek_parent (iface); iface->get_controller = (pdfpcPresentationController* (*)(pdfpcControllable*)) pdfpc_window_presentation_real_get_controller; iface->update = (void (*)(pdfpcControllable*)) pdfpc_window_presentation_real_update; iface->edit_note = (void (*)(pdfpcControllable*)) pdfpc_window_presentation_real_edit_note; iface->ask_goto_page = (void (*)(pdfpcControllable*)) pdfpc_window_presentation_real_ask_goto_page; iface->show_overview = (void (*)(pdfpcControllable*)) pdfpc_window_presentation_real_show_overview; iface->hide_overview = (void (*)(pdfpcControllable*)) pdfpc_window_presentation_real_hide_overview; } static void pdfpc_window_presentation_instance_init (pdfpcWindowPresentation * self) { self->presentation_controller = NULL; } static void pdfpc_window_presentation_finalize (GObject* obj) { pdfpcWindowPresentation * self; self = PDFPC_WINDOW_PRESENTATION (obj); _g_object_unref0 (self->presentation_controller); _g_object_unref0 (self->view); G_OBJECT_CLASS (pdfpc_window_presentation_parent_class)->finalize (obj); } /** * Window showing the currently active slide to be presented on a beamer */ GType pdfpc_window_presentation_get_type (void) { static volatile gsize pdfpc_window_presentation_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_window_presentation_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcWindowPresentationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_window_presentation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcWindowPresentation), 0, (GInstanceInitFunc) pdfpc_window_presentation_instance_init, NULL }; static const GInterfaceInfo pdfpc_controllable_info = { (GInterfaceInitFunc) pdfpc_window_presentation_pdfpc_controllable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType pdfpc_window_presentation_type_id; pdfpc_window_presentation_type_id = g_type_register_static (PDFPC_WINDOW_TYPE_FULLSCREEN, "pdfpcWindowPresentation", &g_define_type_info, 0); g_type_add_interface_static (pdfpc_window_presentation_type_id, PDFPC_TYPE_CONTROLLABLE, &pdfpc_controllable_info); g_once_init_leave (&pdfpc_window_presentation_type_id__volatile, pdfpc_window_presentation_type_id); } return pdfpc_window_presentation_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/classes/window/presenter.in000066400000000000000000002416621177613036100227540ustar00rootroot00000000000000/* presenter.c generated by valac 0.16.0, the Vala compiler * generated from presenter.vala, do not modify */ #include #include #include #include #include #include #include #include #include #include #include #include #define PDFPC_WINDOW_TYPE_FULLSCREEN (pdfpc_window_fullscreen_get_type ()) #define PDFPC_WINDOW_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreen)) #define PDFPC_WINDOW_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) #define PDFPC_WINDOW_IS_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_IS_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_FULLSCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) typedef struct _pdfpcWindowFullscreen pdfpcWindowFullscreen; typedef struct _pdfpcWindowFullscreenClass pdfpcWindowFullscreenClass; typedef struct _pdfpcWindowFullscreenPrivate pdfpcWindowFullscreenPrivate; #define PDFPC_TYPE_CONTROLLABLE (pdfpc_controllable_get_type ()) #define PDFPC_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllable)) #define PDFPC_IS_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CONTROLLABLE)) #define PDFPC_CONTROLLABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllableIface)) typedef struct _pdfpcControllable pdfpcControllable; typedef struct _pdfpcControllableIface pdfpcControllableIface; #define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController)) #define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) #define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) typedef struct _pdfpcPresentationController pdfpcPresentationController; typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass; #define PDFPC_WINDOW_TYPE_PRESENTER (pdfpc_window_presenter_get_type ()) #define PDFPC_WINDOW_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenter)) #define PDFPC_WINDOW_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass)) #define PDFPC_WINDOW_IS_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_PRESENTER)) #define PDFPC_WINDOW_IS_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_PRESENTER)) #define PDFPC_WINDOW_PRESENTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass)) typedef struct _pdfpcWindowPresenter pdfpcWindowPresenter; typedef struct _pdfpcWindowPresenterClass pdfpcWindowPresenterClass; typedef struct _pdfpcWindowPresenterPrivate pdfpcWindowPresenterPrivate; #define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ()) #define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase)) #define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) #define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) typedef struct _pdfpcViewBase pdfpcViewBase; typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass; #define PDFPC_TYPE_TIMER_LABEL (pdfpc_timer_label_get_type ()) #define PDFPC_TIMER_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabel)) #define PDFPC_TIMER_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabelClass)) #define PDFPC_IS_TIMER_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_TIMER_LABEL)) #define PDFPC_IS_TIMER_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_TIMER_LABEL)) #define PDFPC_TIMER_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabelClass)) typedef struct _pdfpcTimerLabel pdfpcTimerLabel; typedef struct _pdfpcTimerLabelClass pdfpcTimerLabelClass; #define PDFPC_WINDOW_TYPE_OVERVIEW (pdfpc_window_overview_get_type ()) #define PDFPC_WINDOW_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverview)) #define PDFPC_WINDOW_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass)) #define PDFPC_WINDOW_IS_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_OVERVIEW)) #define PDFPC_WINDOW_IS_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_OVERVIEW)) #define PDFPC_WINDOW_OVERVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass)) typedef struct _pdfpcWindowOverview pdfpcWindowOverview; typedef struct _pdfpcWindowOverviewClass pdfpcWindowOverviewClass; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ()) #define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf)) #define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) #define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf; typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define PDFPC_VIEW_TYPE_DEFAULT (pdfpc_view_default_get_type ()) #define PDFPC_VIEW_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefault)) #define PDFPC_VIEW_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) #define PDFPC_VIEW_IS_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_IS_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) typedef struct _pdfpcViewDefault pdfpcViewDefault; typedef struct _pdfpcViewDefaultClass pdfpcViewDefaultClass; #define PDFPC_VIEW_TYPE_PDF (pdfpc_view_pdf_get_type ()) #define PDFPC_VIEW_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdf)) #define PDFPC_VIEW_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) #define PDFPC_VIEW_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) typedef struct _pdfpcViewPdf pdfpcViewPdf; typedef struct _pdfpcViewPdfClass pdfpcViewPdfClass; #define _gtk_border_free0(var) ((var == NULL) ? NULL : (var = (gtk_border_free (var), NULL))) #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) #define _pango_font_description_free0(var) ((var == NULL) ? NULL : (var = (pango_font_description_free (var), NULL))) #define PDFPC_RENDERER_TYPE_BASE (pdfpc_renderer_base_get_type ()) #define PDFPC_RENDERER_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBase)) #define PDFPC_RENDERER_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) #define PDFPC_RENDERER_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) typedef struct _pdfpcRendererBase pdfpcRendererBase; typedef struct _pdfpcRendererBaseClass pdfpcRendererBaseClass; #define PDFPC_RENDERER_TYPE_CACHING (pdfpc_renderer_caching_get_type ()) #define PDFPC_RENDERER_CACHING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCaching)) #define PDFPC_RENDERER_IS_CACHING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_CACHING)) #define PDFPC_RENDERER_CACHING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCachingIface)) typedef struct _pdfpcRendererCaching pdfpcRendererCaching; typedef struct _pdfpcRendererCachingIface pdfpcRendererCachingIface; #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; #define _g_free0(var) (var = (g_free (var), NULL)) #define PDFPC_TYPE_SLIDES_NOTES (pdfpc_slides_notes_get_type ()) #define PDFPC_SLIDES_NOTES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notes)) #define PDFPC_SLIDES_NOTES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notesClass)) #define PDFPC_IS_SLIDES_NOTES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_SLIDES_NOTES)) #define PDFPC_IS_SLIDES_NOTES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_SLIDES_NOTES)) #define PDFPC_SLIDES_NOTES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notesClass)) typedef struct _pdfpcslides_notes pdfpcslides_notes; typedef struct _pdfpcslides_notesClass pdfpcslides_notesClass; #define PDFPC_TYPE_CACHE_STATUS (pdfpc_cache_status_get_type ()) #define PDFPC_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatus)) #define PDFPC_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) #define PDFPC_IS_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_IS_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_CACHE_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) typedef struct _pdfpcCacheStatus pdfpcCacheStatus; typedef struct _pdfpcCacheStatusClass pdfpcCacheStatusClass; #define PDFPC_VIEW_TYPE_PRERENDERING (pdfpc_view_prerendering_get_type ()) #define PDFPC_VIEW_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerendering)) #define PDFPC_VIEW_IS_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PRERENDERING)) #define PDFPC_VIEW_PRERENDERING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerenderingIface)) typedef struct _pdfpcViewPrerendering pdfpcViewPrerendering; typedef struct _pdfpcViewPrerenderingIface pdfpcViewPrerenderingIface; struct _pdfpcWindowFullscreen { GtkWindow parent_instance; pdfpcWindowFullscreenPrivate * priv; GdkRectangle screen_geometry; guint hide_cursor_timeout; gboolean faded_to_black; gboolean frozen; }; struct _pdfpcWindowFullscreenClass { GtkWindowClass parent_class; }; struct _pdfpcControllableIface { GTypeInterface parent_iface; pdfpcPresentationController* (*get_controller) (pdfpcControllable* self); void (*update) (pdfpcControllable* self); void (*edit_note) (pdfpcControllable* self); void (*ask_goto_page) (pdfpcControllable* self); void (*show_overview) (pdfpcControllable* self); void (*hide_overview) (pdfpcControllable* self); }; struct _pdfpcWindowPresenter { pdfpcWindowFullscreen parent_instance; pdfpcWindowPresenterPrivate * priv; pdfpcPresentationController* presentation_controller; pdfpcViewBase* current_view; pdfpcViewBase* next_view; pdfpcViewBase* strict_next_view; pdfpcViewBase* strict_prev_view; pdfpcTimerLabel* timer; GtkEntry* slide_progress; GtkProgressBar* prerender_progress; GtkImage* blank_icon; GtkImage* frozen_icon; GtkImage* pause_icon; GtkTextView* notes_view; GtkHBox* slideViews; pdfpcWindowOverview* overview; GtkAlignment* centered_overview; gboolean overview_added; GtkVBox* fullLayout; guint slide_count; pdfpcMetadataPdf* metadata; GdkColor black; GdkColor white; }; struct _pdfpcWindowPresenterClass { pdfpcWindowFullscreenClass parent_class; }; struct _pdfpcRendererCachingIface { GTypeInterface parent_iface; void (*set_cache) (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* (*get_cache) (pdfpcRendererCaching* self); }; typedef enum { PDFPC_RENDERER_RENDER_ERROR_SLIDE_DOES_NOT_EXIST } pdfpcRendererRenderError; #define PDFPC_RENDERER_RENDER_ERROR pdfpc_renderer_render_error_quark () struct _pdfpcViewPrerenderingIface { GTypeInterface parent_iface; }; typedef void (*pdfpcCacheStatusUpdateFunction) (gdouble progress, void* user_data); typedef void (*pdfpcCacheStatusUpdateComplete) (void* user_data); static gpointer pdfpc_window_presenter_parent_class = NULL; extern guint pdfpc_options_current_size; extern gboolean pdfpc_options_black_on_end; extern gboolean pdfpc_options_disable_caching; static pdfpcControllableIface* pdfpc_window_presenter_pdfpc_controllable_parent_iface = NULL; GType pdfpc_window_fullscreen_get_type (void) G_GNUC_CONST; GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST; GType pdfpc_controllable_get_type (void) G_GNUC_CONST; GType pdfpc_window_presenter_get_type (void) G_GNUC_CONST; GType pdfpc_view_base_get_type (void) G_GNUC_CONST; GType pdfpc_timer_label_get_type (void) G_GNUC_CONST; GType pdfpc_window_overview_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST; enum { PDFPC_WINDOW_PRESENTER_DUMMY_PROPERTY }; pdfpcWindowPresenter* pdfpc_window_presenter_new (pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); pdfpcWindowPresenter* pdfpc_window_presenter_construct (GType object_type, pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); pdfpcWindowFullscreen* pdfpc_window_fullscreen_new (gint screen_num); pdfpcWindowFullscreen* pdfpc_window_fullscreen_construct (GType object_type, gint screen_num); static void __lambda4_ (pdfpcWindowPresenter* self, GtkObject* source); static void ___lambda4__gtk_object_destroy (GtkObject* _sender, gpointer self); gboolean pdfpc_presentation_controller_register_controllable (pdfpcPresentationController* self, pdfpcControllable* controllable); GType pdfpc_view_default_get_type (void) G_GNUC_CONST; GType pdfpc_view_pdf_get_type (void) G_GNUC_CONST; pdfpcViewPdf* pdfpc_view_pdf_from_metadata (pdfpcMetadataPdf* metadata, gint width, gint height, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller, GdkRectangle* scale_rect); gboolean pdfpc_window_presenter_on_key_press_notes_view (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key); static gboolean _pdfpc_window_presenter_on_key_press_notes_view_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self); pdfpcTimerLabel* pdfpc_presentation_controller_getTimer (pdfpcPresentationController* self); gboolean pdfpc_window_presenter_on_key_press_slide_progress (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key); static gboolean _pdfpc_window_presenter_on_key_press_slide_progress_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self); #define icon_path "@CMAKE_INSTALL_PREFIX@/share/pixmaps/pdfpc/" gboolean pdfpc_window_presenter_on_key_pressed (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key); static gboolean _pdfpc_window_presenter_on_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self); gboolean pdfpc_window_presenter_on_button_press (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventButton* button); static gboolean _pdfpc_window_presenter_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self); gboolean pdfpc_window_presenter_on_scroll (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventScroll* scroll); static gboolean _pdfpc_window_presenter_on_scroll_gtk_widget_scroll_event (GtkWidget* _sender, GdkEventScroll* event, gpointer self); guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self); pdfpcWindowOverview* pdfpc_window_overview_new (pdfpcMetadataPdf* metadata, pdfpcPresentationController* presentation_controller, pdfpcWindowPresenter* presenter); pdfpcWindowOverview* pdfpc_window_overview_construct (GType object_type, pdfpcMetadataPdf* metadata, pdfpcPresentationController* presentation_controller, pdfpcWindowPresenter* presenter); void pdfpc_window_overview_set_n_slides (pdfpcWindowOverview* self, gint n); gint pdfpc_presentation_controller_get_user_n_slides (pdfpcPresentationController* self); void pdfpc_presentation_controller_set_overview (pdfpcPresentationController* self, pdfpcWindowOverview* o); GType pdfpc_renderer_base_get_type (void) G_GNUC_CONST; pdfpcRendererBase* pdfpc_view_base_get_renderer (pdfpcViewBase* self); GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_caching_get_type (void) G_GNUC_CONST; void pdfpc_renderer_caching_set_cache (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* pdfpc_renderer_cache_option_factory_create (pdfpcMetadataBase* metadata); void pdfpc_window_presenter_build_layout (pdfpcWindowPresenter* self); static void pdfpc_window_presenter_real_show (GtkWidget* base); void pdfpc_window_overview_set_available_space (pdfpcWindowOverview* self, gint width, gint height); gboolean pdfpc_presentation_controller_key_press (pdfpcPresentationController* self, GdkEventKey* key); gboolean pdfpc_presentation_controller_button_press (pdfpcPresentationController* self, GdkEventButton* button); void pdfpc_presentation_controller_scroll (pdfpcPresentationController* self, GdkEventScroll* scroll); void pdfpc_window_presenter_update_slide_count (pdfpcWindowPresenter* self); void pdfpc_window_presenter_custom_slide_count (pdfpcWindowPresenter* self, gint current); gint pdfpc_presentation_controller_get_current_user_slide_number (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_end_user_slide (pdfpcPresentationController* self); static pdfpcPresentationController* pdfpc_window_presenter_real_get_controller (pdfpcControllable* base); static void pdfpc_window_presenter_real_update (pdfpcControllable* base); gint pdfpc_presentation_controller_get_current_slide_number (pdfpcPresentationController* self); GQuark pdfpc_renderer_render_error_quark (void); void pdfpc_view_base_display (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); gint pdfpc_metadata_pdf_user_slide_to_real_slide (pdfpcMetadataPdf* self, gint number); gboolean pdfpc_presentation_controller_skip_next (pdfpcPresentationController* self); void pdfpc_view_base_fade_to_black (pdfpcViewBase* self); gboolean pdfpc_presentation_controller_skip_previous (pdfpcPresentationController* self); void pdfpc_window_presenter_update_note (pdfpcWindowPresenter* self); gboolean pdfpc_timer_label_is_paused (pdfpcTimerLabel* self); gboolean pdfpc_presentation_controller_is_faded_to_black (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_is_frozen (pdfpcPresentationController* self); void pdfpc_window_presenter_goto_page (pdfpcWindowPresenter* self, gint page_number); static void pdfpc_window_presenter_real_ask_goto_page (pdfpcControllable* base); void pdfpc_presentation_controller_set_ignore_input_events (pdfpcPresentationController* self, gboolean v); void pdfpc_presentation_controller_goto_user_page (pdfpcPresentationController* self, gint page_number); static void pdfpc_window_presenter_real_edit_note (pdfpcControllable* base); GType pdfpc_slides_notes_get_type (void) G_GNUC_CONST; pdfpcslides_notes* pdfpc_metadata_pdf_get_notes (pdfpcMetadataPdf* self); void pdfpc_slides_notes_set_note (pdfpcslides_notes* self, const gchar* note, gint slide_number); gchar* pdfpc_slides_notes_get_note_for_slide (pdfpcslides_notes* self, gint number); static void pdfpc_window_presenter_real_show_overview (pdfpcControllable* base); void pdfpc_window_overview_set_current_slide (pdfpcWindowOverview* self, gint value); static void pdfpc_window_presenter_real_hide_overview (pdfpcControllable* base); gpointer pdfpc_cache_status_ref (gpointer instance); void pdfpc_cache_status_unref (gpointer instance); GParamSpec* pdfpc_param_spec_cache_status (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_value_set_cache_status (GValue* value, gpointer v_object); void pdfpc_value_take_cache_status (GValue* value, gpointer v_object); gpointer pdfpc_value_get_cache_status (const GValue* value); GType pdfpc_cache_status_get_type (void) G_GNUC_CONST; void pdfpc_window_presenter_set_cache_observer (pdfpcWindowPresenter* self, pdfpcCacheStatus* observer); GType pdfpc_view_prerendering_get_type (void) G_GNUC_CONST; void pdfpc_cache_status_monitor_view (pdfpcCacheStatus* self, pdfpcViewPrerendering* view); void pdfpc_cache_status_register_update (pdfpcCacheStatus* self, pdfpcCacheStatusUpdateFunction update, void* update_target, pdfpcCacheStatusUpdateComplete complete, void* complete_target); static void _gtk_progress_bar_set_fraction_pdfpc_cache_status_update_function (gdouble progress, gpointer self); void pdfpc_window_presenter_prerender_finished (pdfpcWindowPresenter* self); static void _pdfpc_window_presenter_prerender_finished_pdfpc_cache_status_update_complete (gpointer self); void pdfpc_window_overview_set_cache (pdfpcWindowOverview* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* pdfpc_renderer_caching_get_cache (pdfpcRendererCaching* self); static void pdfpc_window_presenter_finalize (GObject* obj); /** * Base constructor instantiating a new presenter window */ static void __lambda4_ (pdfpcWindowPresenter* self, GtkObject* source) { g_return_if_fail (source != NULL); gtk_main_quit (); } static void ___lambda4__gtk_object_destroy (GtkObject* _sender, gpointer self) { __lambda4_ (self, _sender); } static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } static gboolean _pdfpc_window_presenter_on_key_press_notes_view_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) { gboolean result; result = pdfpc_window_presenter_on_key_press_notes_view (self, _sender, event); return result; } static gboolean _pdfpc_window_presenter_on_key_press_slide_progress_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) { gboolean result; result = pdfpc_window_presenter_on_key_press_slide_progress (self, _sender, event); return result; } static gboolean _pdfpc_window_presenter_on_key_pressed_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) { gboolean result; result = pdfpc_window_presenter_on_key_pressed (self, _sender, event); return result; } static gboolean _pdfpc_window_presenter_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) { gboolean result; result = pdfpc_window_presenter_on_button_press (self, _sender, event); return result; } static gboolean _pdfpc_window_presenter_on_scroll_gtk_widget_scroll_event (GtkWidget* _sender, GdkEventScroll* event, gpointer self) { gboolean result; result = pdfpc_window_presenter_on_scroll (self, _sender, event); return result; } pdfpcWindowPresenter* pdfpc_window_presenter_construct (GType object_type, pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller) { pdfpcWindowPresenter * self = NULL; gint _tmp0_; pdfpcPresentationController* _tmp1_; pdfpcPresentationController* _tmp2_; pdfpcPresentationController* _tmp3_; pdfpcMetadataPdf* _tmp4_; pdfpcMetadataPdf* _tmp5_; GdkColor _tmp6_ = {0}; GdkColor _tmp7_ = {0}; GdkColor _tmp8_; GdkRectangle _tmp9_; gint _tmp10_; gdouble _tmp11_ = 0.0; gint bottom_position; GdkRectangle _tmp12_; gint _tmp13_; gint bottom_height; GdkRectangle current_scale_rect = {0}; GdkRectangle _tmp14_; gint _tmp15_; guint _tmp16_; gdouble _tmp17_ = 0.0; gint current_allocated_width; pdfpcMetadataPdf* _tmp18_; gdouble _tmp19_ = 0.0; gboolean _tmp20_; pdfpcPresentationController* _tmp21_; GdkRectangle _tmp22_ = {0}; pdfpcViewPdf* _tmp23_ = NULL; GdkRectangle next_scale_rect = {0}; GdkRectangle _tmp24_; gint _tmp25_; gint next_allocated_width; pdfpcMetadataPdf* _tmp26_; gdouble _tmp27_ = 0.0; pdfpcPresentationController* _tmp28_; GdkRectangle _tmp29_ = {0}; pdfpcViewPdf* _tmp30_ = NULL; pdfpcMetadataPdf* _tmp31_; gdouble _tmp32_ = 0.0; gdouble _tmp33_ = 0.0; pdfpcPresentationController* _tmp34_; GdkRectangle _tmp35_ = {0}; pdfpcViewPdf* _tmp36_ = NULL; pdfpcMetadataPdf* _tmp37_; gdouble _tmp38_ = 0.0; gdouble _tmp39_ = 0.0; pdfpcPresentationController* _tmp40_; GdkRectangle _tmp41_ = {0}; pdfpcViewPdf* _tmp42_ = NULL; PangoFontDescription* _tmp43_ = NULL; PangoFontDescription* notes_font; gdouble _tmp44_ = 0.0; GtkTextView* _tmp45_; GtkTextView* _tmp46_; GtkTextView* _tmp47_; GtkTextView* _tmp48_; GtkTextView* _tmp49_; GtkTextView* _tmp50_; GtkTextView* _tmp51_; GdkColor _tmp52_; GtkTextView* _tmp53_; GdkColor _tmp54_; GtkTextView* _tmp55_; GtkTextBuffer* _tmp56_; GtkTextBuffer* _tmp57_; GtkTextView* _tmp58_; PangoFontDescription* _tmp59_ = NULL; PangoFontDescription* font; gdouble _tmp60_ = 0.0; pdfpcPresentationController* _tmp61_; pdfpcTimerLabel* _tmp62_ = NULL; pdfpcTimerLabel* _tmp63_; pdfpcTimerLabel* _tmp64_; GtkEntry* _tmp65_; GtkEntry* _tmp66_; GtkEntry* _tmp67_; GtkEntry* _tmp68_; GdkColor _tmp69_; GtkEntry* _tmp70_; GdkColor _tmp71_; GtkEntry* _tmp72_; GtkEntry* _tmp73_; GtkEntry* _tmp74_; GtkEntry* _tmp75_; GtkEntry* _tmp76_; GtkBorder* _tmp77_; GtkBorder* _tmp78_; GtkProgressBar* _tmp79_; GtkProgressBar* _tmp80_; GtkProgressBar* _tmp81_; GtkProgressBar* _tmp82_; GtkProgressBar* _tmp83_; GdkColor _tmp84_; GtkProgressBar* _tmp85_; GdkColor _tmp86_; GtkProgressBar* _tmp87_; GdkColor _tmp88_; GtkProgressBar* _tmp89_; GdkColor _tmp90_; GtkProgressBar* _tmp91_; gint icon_height; pdfpcMetadataPdf* _tmp123_; guint _tmp124_ = 0U; pdfpcMetadataPdf* _tmp125_; pdfpcPresentationController* _tmp126_; pdfpcWindowOverview* _tmp127_; pdfpcWindowOverview* _tmp128_; pdfpcWindowOverview* _tmp129_; pdfpcPresentationController* _tmp130_; gint _tmp131_ = 0; pdfpcPresentationController* _tmp132_; pdfpcWindowOverview* _tmp133_; gboolean _tmp134_; GError * _inner_error_ = NULL; g_return_val_if_fail (metadata != NULL, NULL); g_return_val_if_fail (presentation_controller != NULL, NULL); _tmp0_ = screen_num; self = (pdfpcWindowPresenter*) pdfpc_window_fullscreen_construct (object_type, _tmp0_); g_signal_connect_object ((GtkObject*) self, "destroy", (GCallback) ___lambda4__gtk_object_destroy, self, 0); _tmp1_ = presentation_controller; _tmp2_ = _g_object_ref0 (_tmp1_); _g_object_unref0 (self->presentation_controller); self->presentation_controller = _tmp2_; _tmp3_ = self->presentation_controller; pdfpc_presentation_controller_register_controllable (_tmp3_, (pdfpcControllable*) self); _tmp4_ = metadata; _tmp5_ = _g_object_ref0 (_tmp4_); _g_object_unref0 (self->metadata); self->metadata = _tmp5_; gdk_color_parse ("black", &_tmp6_); self->black = _tmp6_; gdk_color_parse ("white", &_tmp7_); self->white = _tmp7_; _tmp8_ = self->black; gtk_widget_modify_bg ((GtkWidget*) self, GTK_STATE_NORMAL, &_tmp8_); _tmp9_ = ((pdfpcWindowFullscreen*) self)->screen_geometry; _tmp10_ = _tmp9_.height; _tmp11_ = floor (_tmp10_ * 0.9); bottom_position = (gint) _tmp11_; _tmp12_ = ((pdfpcWindowFullscreen*) self)->screen_geometry; _tmp13_ = _tmp12_.height; bottom_height = _tmp13_ - bottom_position; _tmp14_ = ((pdfpcWindowFullscreen*) self)->screen_geometry; _tmp15_ = _tmp14_.width; _tmp16_ = pdfpc_options_current_size; _tmp17_ = floor ((_tmp15_ * _tmp16_) / ((gdouble) 100)); current_allocated_width = (gint) _tmp17_; _tmp18_ = metadata; _tmp19_ = floor (0.8 * bottom_position); _tmp20_ = pdfpc_options_black_on_end; _tmp21_ = self->presentation_controller; _tmp23_ = pdfpc_view_pdf_from_metadata (_tmp18_, current_allocated_width, (gint) _tmp19_, _tmp20_, _tmp21_, &_tmp22_); current_scale_rect = _tmp22_; _g_object_unref0 (self->current_view); self->current_view = (pdfpcViewBase*) _tmp23_; _tmp24_ = ((pdfpcWindowFullscreen*) self)->screen_geometry; _tmp25_ = _tmp24_.width; next_allocated_width = (_tmp25_ - current_allocated_width) - 4; _tmp26_ = metadata; _tmp27_ = floor (0.7 * bottom_position); _tmp28_ = self->presentation_controller; _tmp30_ = pdfpc_view_pdf_from_metadata (_tmp26_, next_allocated_width, (gint) _tmp27_, TRUE, _tmp28_, &_tmp29_); next_scale_rect = _tmp29_; _g_object_unref0 (self->next_view); self->next_view = (pdfpcViewBase*) _tmp30_; _tmp31_ = metadata; _tmp32_ = floor (0.5 * current_allocated_width); _tmp33_ = floor (0.19 * bottom_position); _tmp34_ = self->presentation_controller; _tmp36_ = pdfpc_view_pdf_from_metadata (_tmp31_, (gint) _tmp32_, ((gint) _tmp33_) - 2, TRUE, _tmp34_, &_tmp35_); next_scale_rect = _tmp35_; _g_object_unref0 (self->strict_next_view); self->strict_next_view = (pdfpcViewBase*) _tmp36_; _tmp37_ = metadata; _tmp38_ = floor (0.5 * current_allocated_width); _tmp39_ = floor (0.19 * bottom_position); _tmp40_ = self->presentation_controller; _tmp42_ = pdfpc_view_pdf_from_metadata (_tmp37_, (gint) _tmp38_, ((gint) _tmp39_) - 2, TRUE, _tmp40_, &_tmp41_); next_scale_rect = _tmp41_; _g_object_unref0 (self->strict_prev_view); self->strict_prev_view = (pdfpcViewBase*) _tmp42_; _tmp43_ = pango_font_description_from_string ("Verdana"); notes_font = _tmp43_; _tmp44_ = floor (20 * 0.75); pango_font_description_set_size (notes_font, ((gint) _tmp44_) * PANGO_SCALE); _tmp45_ = (GtkTextView*) gtk_text_view_new (); _tmp46_ = g_object_ref_sink (_tmp45_); _g_object_unref0 (self->notes_view); self->notes_view = _tmp46_; _tmp47_ = self->notes_view; gtk_text_view_set_editable (_tmp47_, FALSE); _tmp48_ = self->notes_view; gtk_text_view_set_cursor_visible (_tmp48_, FALSE); _tmp49_ = self->notes_view; gtk_text_view_set_wrap_mode (_tmp49_, GTK_WRAP_WORD); _tmp50_ = self->notes_view; gtk_widget_modify_font ((GtkWidget*) _tmp50_, notes_font); _tmp51_ = self->notes_view; _tmp52_ = self->black; gtk_widget_modify_base ((GtkWidget*) _tmp51_, GTK_STATE_NORMAL, &_tmp52_); _tmp53_ = self->notes_view; _tmp54_ = self->white; gtk_widget_modify_text ((GtkWidget*) _tmp53_, GTK_STATE_NORMAL, &_tmp54_); _tmp55_ = self->notes_view; _tmp56_ = gtk_text_view_get_buffer (_tmp55_); _tmp57_ = _tmp56_; g_object_set (_tmp57_, "text", "", NULL); _tmp58_ = self->notes_view; g_signal_connect_object ((GtkWidget*) _tmp58_, "key-press-event", (GCallback) _pdfpc_window_presenter_on_key_press_notes_view_gtk_widget_key_press_event, self, 0); _tmp59_ = pango_font_description_from_string ("Verdana"); font = _tmp59_; _tmp60_ = floor ((bottom_height * 0.8) * 0.75); pango_font_description_set_size (font, ((gint) _tmp60_) * PANGO_SCALE); _tmp61_ = self->presentation_controller; _tmp62_ = pdfpc_presentation_controller_getTimer (_tmp61_); _g_object_unref0 (self->timer); self->timer = _tmp62_; _tmp63_ = self->timer; gtk_label_set_justify ((GtkLabel*) _tmp63_, GTK_JUSTIFY_CENTER); _tmp64_ = self->timer; gtk_widget_modify_font ((GtkWidget*) _tmp64_, font); _tmp65_ = (GtkEntry*) gtk_entry_new (); _tmp66_ = g_object_ref_sink (_tmp65_); _g_object_unref0 (self->slide_progress); self->slide_progress = _tmp66_; _tmp67_ = self->slide_progress; gtk_entry_set_alignment (_tmp67_, 1.f); _tmp68_ = self->slide_progress; _tmp69_ = self->black; gtk_widget_modify_base ((GtkWidget*) _tmp68_, GTK_STATE_NORMAL, &_tmp69_); _tmp70_ = self->slide_progress; _tmp71_ = self->white; gtk_widget_modify_text ((GtkWidget*) _tmp70_, GTK_STATE_NORMAL, &_tmp71_); _tmp72_ = self->slide_progress; gtk_widget_modify_font ((GtkWidget*) _tmp72_, font); _tmp73_ = self->slide_progress; g_object_set (_tmp73_, "editable", FALSE, NULL); _tmp74_ = self->slide_progress; gtk_entry_set_has_frame (_tmp74_, FALSE); _tmp75_ = self->slide_progress; g_signal_connect_object ((GtkWidget*) _tmp75_, "key-press-event", (GCallback) _pdfpc_window_presenter_on_key_press_slide_progress_gtk_widget_key_press_event, self, 0); _tmp76_ = self->slide_progress; _tmp77_ = gtk_border_new (); _tmp78_ = _tmp77_; gtk_entry_set_inner_border (_tmp76_, _tmp78_); _gtk_border_free0 (_tmp78_); _tmp79_ = (GtkProgressBar*) gtk_progress_bar_new (); _tmp80_ = g_object_ref_sink (_tmp79_); _g_object_unref0 (self->prerender_progress); self->prerender_progress = _tmp80_; _tmp81_ = self->prerender_progress; gtk_progress_bar_set_text (_tmp81_, "Prerendering..."); _tmp82_ = self->prerender_progress; gtk_widget_modify_font ((GtkWidget*) _tmp82_, notes_font); _tmp83_ = self->prerender_progress; _tmp84_ = self->black; gtk_widget_modify_bg ((GtkWidget*) _tmp83_, GTK_STATE_NORMAL, &_tmp84_); _tmp85_ = self->prerender_progress; _tmp86_ = self->white; gtk_widget_modify_bg ((GtkWidget*) _tmp85_, GTK_STATE_PRELIGHT, &_tmp86_); _tmp87_ = self->prerender_progress; _tmp88_ = self->white; gtk_widget_modify_fg ((GtkWidget*) _tmp87_, GTK_STATE_NORMAL, &_tmp88_); _tmp89_ = self->prerender_progress; _tmp90_ = self->black; gtk_widget_modify_fg ((GtkWidget*) _tmp89_, GTK_STATE_PRELIGHT, &_tmp90_); _tmp91_ = self->prerender_progress; gtk_widget_set_no_show_all ((GtkWidget*) _tmp91_, TRUE); icon_height = bottom_height - 10; { gdouble _tmp92_ = 0.0; GdkPixbuf* _tmp93_ = NULL; GdkPixbuf* _tmp94_; GdkPixbuf* blank_pixbuf; GtkImage* _tmp95_; GtkImage* _tmp96_; GtkImage* _tmp97_; _tmp92_ = floor (1.06 * icon_height); _tmp93_ = rsvg_pixbuf_from_file_at_size (icon_path "blank.svg", (gint) _tmp92_, icon_height, &_inner_error_); _tmp94_ = _g_object_ref0 (_tmp93_); blank_pixbuf = _tmp94_; if (_inner_error_ != NULL) { goto __catch10_g_error; } _tmp95_ = (GtkImage*) gtk_image_new_from_pixbuf (blank_pixbuf); _tmp96_ = g_object_ref_sink (_tmp95_); _g_object_unref0 (self->blank_icon); self->blank_icon = _tmp96_; _tmp97_ = self->blank_icon; gtk_widget_set_no_show_all ((GtkWidget*) _tmp97_, TRUE); _g_object_unref0 (blank_pixbuf); } goto __finally10; __catch10_g_error: { GError* e = NULL; FILE* _tmp98_; GError* _tmp99_; const gchar* _tmp100_; GtkImage* _tmp101_; GtkImage* _tmp102_; e = _inner_error_; _inner_error_ = NULL; _tmp98_ = stderr; _tmp99_ = e; _tmp100_ = _tmp99_->message; fprintf (_tmp98_, "Warning: Could not load icon %s (%s)\n", icon_path "blank.svg", _tmp100_); _tmp101_ = (GtkImage*) gtk_image_new_from_icon_name ("image-missing", GTK_ICON_SIZE_LARGE_TOOLBAR); _tmp102_ = g_object_ref_sink (_tmp101_); _g_object_unref0 (self->blank_icon); self->blank_icon = _tmp102_; _g_error_free0 (e); } __finally10: if (_inner_error_ != NULL) { _pango_font_description_free0 (font); _pango_font_description_free0 (notes_font); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } { GdkPixbuf* _tmp103_ = NULL; GdkPixbuf* _tmp104_; GdkPixbuf* frozen_pixbuf; GtkImage* _tmp105_; GtkImage* _tmp106_; GtkImage* _tmp107_; _tmp103_ = rsvg_pixbuf_from_file_at_size (icon_path "snow.svg", icon_height, icon_height, &_inner_error_); _tmp104_ = _g_object_ref0 (_tmp103_); frozen_pixbuf = _tmp104_; if (_inner_error_ != NULL) { goto __catch11_g_error; } _tmp105_ = (GtkImage*) gtk_image_new_from_pixbuf (frozen_pixbuf); _tmp106_ = g_object_ref_sink (_tmp105_); _g_object_unref0 (self->frozen_icon); self->frozen_icon = _tmp106_; _tmp107_ = self->frozen_icon; gtk_widget_set_no_show_all ((GtkWidget*) _tmp107_, TRUE); _g_object_unref0 (frozen_pixbuf); } goto __finally11; __catch11_g_error: { GError* e = NULL; FILE* _tmp108_; GError* _tmp109_; const gchar* _tmp110_; GtkImage* _tmp111_; GtkImage* _tmp112_; e = _inner_error_; _inner_error_ = NULL; _tmp108_ = stderr; _tmp109_ = e; _tmp110_ = _tmp109_->message; fprintf (_tmp108_, "Warning: Could not load icon %s (%s)\n", icon_path "snow.svg", _tmp110_); _tmp111_ = (GtkImage*) gtk_image_new_from_icon_name ("image-missing", GTK_ICON_SIZE_LARGE_TOOLBAR); _tmp112_ = g_object_ref_sink (_tmp111_); _g_object_unref0 (self->frozen_icon); self->frozen_icon = _tmp112_; _g_error_free0 (e); } __finally11: if (_inner_error_ != NULL) { _pango_font_description_free0 (font); _pango_font_description_free0 (notes_font); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } { GdkPixbuf* _tmp113_ = NULL; GdkPixbuf* _tmp114_; GdkPixbuf* pause_pixbuf; GtkImage* _tmp115_; GtkImage* _tmp116_; GtkImage* _tmp117_; _tmp113_ = rsvg_pixbuf_from_file_at_size (icon_path "pause.svg", icon_height, icon_height, &_inner_error_); _tmp114_ = _g_object_ref0 (_tmp113_); pause_pixbuf = _tmp114_; if (_inner_error_ != NULL) { goto __catch12_g_error; } _tmp115_ = (GtkImage*) gtk_image_new_from_pixbuf (pause_pixbuf); _tmp116_ = g_object_ref_sink (_tmp115_); _g_object_unref0 (self->pause_icon); self->pause_icon = _tmp116_; _tmp117_ = self->pause_icon; gtk_widget_set_no_show_all ((GtkWidget*) _tmp117_, TRUE); _g_object_unref0 (pause_pixbuf); } goto __finally12; __catch12_g_error: { GError* e = NULL; FILE* _tmp118_; GError* _tmp119_; const gchar* _tmp120_; GtkImage* _tmp121_; GtkImage* _tmp122_; e = _inner_error_; _inner_error_ = NULL; _tmp118_ = stderr; _tmp119_ = e; _tmp120_ = _tmp119_->message; fprintf (_tmp118_, "Warning: Could not load icon %s (%s)\n", icon_path "pause.svg", _tmp120_); _tmp121_ = (GtkImage*) gtk_image_new_from_icon_name ("image-missing", GTK_ICON_SIZE_LARGE_TOOLBAR); _tmp122_ = g_object_ref_sink (_tmp121_); _g_object_unref0 (self->pause_icon); self->pause_icon = _tmp122_; _g_error_free0 (e); } __finally12: if (_inner_error_ != NULL) { _pango_font_description_free0 (font); _pango_font_description_free0 (notes_font); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } gtk_widget_add_events ((GtkWidget*) self, (gint) GDK_KEY_PRESS_MASK); gtk_widget_add_events ((GtkWidget*) self, (gint) GDK_BUTTON_PRESS_MASK); gtk_widget_add_events ((GtkWidget*) self, (gint) GDK_SCROLL_MASK); g_signal_connect_object ((GtkWidget*) self, "key-press-event", (GCallback) _pdfpc_window_presenter_on_key_pressed_gtk_widget_key_press_event, self, 0); g_signal_connect_object ((GtkWidget*) self, "button-press-event", (GCallback) _pdfpc_window_presenter_on_button_press_gtk_widget_button_press_event, self, 0); g_signal_connect_object ((GtkWidget*) self, "scroll-event", (GCallback) _pdfpc_window_presenter_on_scroll_gtk_widget_scroll_event, self, 0); _tmp123_ = metadata; _tmp124_ = pdfpc_metadata_base_get_slide_count ((pdfpcMetadataBase*) _tmp123_); self->slide_count = _tmp124_; _tmp125_ = self->metadata; _tmp126_ = self->presentation_controller; _tmp127_ = pdfpc_window_overview_new (_tmp125_, _tmp126_, self); _tmp128_ = g_object_ref_sink (_tmp127_); _g_object_unref0 (self->overview); self->overview = _tmp128_; _tmp129_ = self->overview; _tmp130_ = self->presentation_controller; _tmp131_ = pdfpc_presentation_controller_get_user_n_slides (_tmp130_); pdfpc_window_overview_set_n_slides (_tmp129_, _tmp131_); _tmp132_ = self->presentation_controller; _tmp133_ = self->overview; pdfpc_presentation_controller_set_overview (_tmp132_, _tmp133_); _tmp134_ = pdfpc_options_disable_caching; if (!_tmp134_) { pdfpcViewBase* _tmp135_; pdfpcRendererBase* _tmp136_ = NULL; pdfpcRendererCaching* _tmp137_; pdfpcMetadataPdf* _tmp138_; pdfpcRendererCacheBase* _tmp139_ = NULL; pdfpcRendererCacheBase* _tmp140_; pdfpcViewBase* _tmp141_; pdfpcRendererBase* _tmp142_ = NULL; pdfpcRendererCaching* _tmp143_; pdfpcMetadataPdf* _tmp144_; pdfpcRendererCacheBase* _tmp145_ = NULL; pdfpcRendererCacheBase* _tmp146_; pdfpcViewBase* _tmp147_; pdfpcRendererBase* _tmp148_ = NULL; pdfpcRendererCaching* _tmp149_; pdfpcMetadataPdf* _tmp150_; pdfpcRendererCacheBase* _tmp151_ = NULL; pdfpcRendererCacheBase* _tmp152_; pdfpcViewBase* _tmp153_; pdfpcRendererBase* _tmp154_ = NULL; pdfpcRendererCaching* _tmp155_; pdfpcMetadataPdf* _tmp156_; pdfpcRendererCacheBase* _tmp157_ = NULL; pdfpcRendererCacheBase* _tmp158_; _tmp135_ = self->current_view; _tmp136_ = pdfpc_view_base_get_renderer (_tmp135_); _tmp137_ = PDFPC_RENDERER_CACHING (_tmp136_); _tmp138_ = metadata; _tmp139_ = pdfpc_renderer_cache_option_factory_create ((pdfpcMetadataBase*) _tmp138_); _tmp140_ = _tmp139_; pdfpc_renderer_caching_set_cache (_tmp137_, _tmp140_); _g_object_unref0 (_tmp140_); _g_object_unref0 (_tmp137_); _tmp141_ = self->next_view; _tmp142_ = pdfpc_view_base_get_renderer (_tmp141_); _tmp143_ = PDFPC_RENDERER_CACHING (_tmp142_); _tmp144_ = metadata; _tmp145_ = pdfpc_renderer_cache_option_factory_create ((pdfpcMetadataBase*) _tmp144_); _tmp146_ = _tmp145_; pdfpc_renderer_caching_set_cache (_tmp143_, _tmp146_); _g_object_unref0 (_tmp146_); _g_object_unref0 (_tmp143_); _tmp147_ = self->strict_next_view; _tmp148_ = pdfpc_view_base_get_renderer (_tmp147_); _tmp149_ = PDFPC_RENDERER_CACHING (_tmp148_); _tmp150_ = metadata; _tmp151_ = pdfpc_renderer_cache_option_factory_create ((pdfpcMetadataBase*) _tmp150_); _tmp152_ = _tmp151_; pdfpc_renderer_caching_set_cache (_tmp149_, _tmp152_); _g_object_unref0 (_tmp152_); _g_object_unref0 (_tmp149_); _tmp153_ = self->strict_prev_view; _tmp154_ = pdfpc_view_base_get_renderer (_tmp153_); _tmp155_ = PDFPC_RENDERER_CACHING (_tmp154_); _tmp156_ = metadata; _tmp157_ = pdfpc_renderer_cache_option_factory_create ((pdfpcMetadataBase*) _tmp156_); _tmp158_ = _tmp157_; pdfpc_renderer_caching_set_cache (_tmp155_, _tmp158_); _g_object_unref0 (_tmp158_); _g_object_unref0 (_tmp155_); } pdfpc_window_presenter_build_layout (self); _pango_font_description_free0 (font); _pango_font_description_free0 (notes_font); return self; } pdfpcWindowPresenter* pdfpc_window_presenter_new (pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller) { return pdfpc_window_presenter_construct (PDFPC_WINDOW_TYPE_PRESENTER, metadata, screen_num, presentation_controller); } static void pdfpc_window_presenter_real_show (GtkWidget* base) { pdfpcWindowPresenter * self; pdfpcWindowOverview* _tmp0_; GtkAllocation _tmp1_; gint _tmp2_; GtkAllocation _tmp3_; gint _tmp4_; gdouble _tmp5_ = 0.0; self = (pdfpcWindowPresenter*) base; GTK_WIDGET_CLASS (pdfpc_window_presenter_parent_class)->show ((GtkWidget*) PDFPC_WINDOW_FULLSCREEN (self)); _tmp0_ = self->overview; _tmp1_ = ((GtkWidget*) self)->allocation; _tmp2_ = _tmp1_.width; _tmp3_ = ((GtkWidget*) self)->allocation; _tmp4_ = _tmp3_.height; _tmp5_ = floor (_tmp4_ * 0.9); pdfpc_window_overview_set_available_space (_tmp0_, _tmp2_, (gint) _tmp5_); } void pdfpc_window_presenter_build_layout (pdfpcWindowPresenter* self) { GtkHBox* _tmp0_; GtkHBox* _tmp1_; GtkHBox* _tmp2_; GtkHBox* _tmp3_; GtkHBox* strict_views; pdfpcViewBase* _tmp4_; pdfpcViewBase* _tmp5_; GtkAlignment* _tmp6_; GtkAlignment* _tmp7_; GtkAlignment* center_current_view; pdfpcViewBase* _tmp8_; GtkVBox* _tmp9_; GtkVBox* _tmp10_; GtkVBox* current_view_and_stricts; GtkHBox* _tmp11_; GtkVBox* _tmp12_; GtkVBox* _tmp13_; GtkVBox* nextViewWithNotes; GtkAlignment* _tmp14_; GtkAlignment* _tmp15_; GtkAlignment* center_next_view; pdfpcViewBase* _tmp16_; GtkScrolledWindow* _tmp17_; GtkScrolledWindow* _tmp18_; GtkScrolledWindow* notes_sw; GtkWidget* _tmp19_ = NULL; GtkScrollbar* _tmp20_; GtkScrollbar* notes_scrollbar; GdkColor _tmp21_; GdkColor _tmp22_; GdkColor _tmp23_; GtkTextView* _tmp24_; GtkHBox* _tmp25_; GtkHBox* _tmp26_; GtkHBox* _tmp27_; GtkHBox* bottomRow; GtkHBox* _tmp28_; GtkHBox* _tmp29_; GtkHBox* status; GtkImage* _tmp30_; GtkImage* _tmp31_; GtkImage* _tmp32_; GtkAlignment* _tmp33_; GtkAlignment* _tmp34_; GtkAlignment* timer_alignment; pdfpcTimerLabel* _tmp35_; GtkHBox* _tmp36_; GtkHBox* _tmp37_; GtkHBox* progress_alignment; GtkEntry* _tmp38_; GtkAlignment* _tmp39_; GtkAlignment* _tmp40_; GtkAlignment* prerender_alignment; GtkProgressBar* _tmp41_; GtkVBox* _tmp42_; GtkVBox* _tmp43_; GtkVBox* _tmp44_; GdkRectangle _tmp45_; gint _tmp46_; GdkRectangle _tmp47_; gint _tmp48_; GtkVBox* _tmp49_; GtkHBox* _tmp50_; GtkVBox* _tmp51_; GtkVBox* _tmp52_; GtkAlignment* _tmp53_; GtkAlignment* _tmp54_; GtkAlignment* _tmp55_; pdfpcWindowOverview* _tmp56_; g_return_if_fail (self != NULL); _tmp0_ = (GtkHBox*) gtk_hbox_new (FALSE, 4); _tmp1_ = g_object_ref_sink (_tmp0_); _g_object_unref0 (self->slideViews); self->slideViews = _tmp1_; _tmp2_ = (GtkHBox*) gtk_hbox_new (FALSE, 0); _tmp3_ = g_object_ref_sink (_tmp2_); strict_views = _tmp3_; _tmp4_ = self->strict_prev_view; gtk_box_pack_start ((GtkBox*) strict_views, (GtkWidget*) _tmp4_, FALSE, FALSE, (guint) 0); _tmp5_ = self->strict_next_view; gtk_box_pack_end ((GtkBox*) strict_views, (GtkWidget*) _tmp5_, FALSE, FALSE, (guint) 0); _tmp6_ = (GtkAlignment*) gtk_alignment_new (0.5f, 0.5f, (gfloat) 0, (gfloat) 0); _tmp7_ = g_object_ref_sink (_tmp6_); center_current_view = _tmp7_; _tmp8_ = self->current_view; gtk_container_add ((GtkContainer*) center_current_view, (GtkWidget*) _tmp8_); _tmp9_ = (GtkVBox*) gtk_vbox_new (FALSE, 2); _tmp10_ = g_object_ref_sink (_tmp9_); current_view_and_stricts = _tmp10_; gtk_box_pack_start ((GtkBox*) current_view_and_stricts, (GtkWidget*) center_current_view, FALSE, FALSE, (guint) 2); gtk_box_pack_start ((GtkBox*) current_view_and_stricts, (GtkWidget*) strict_views, FALSE, FALSE, (guint) 2); _tmp11_ = self->slideViews; gtk_container_add ((GtkContainer*) _tmp11_, (GtkWidget*) current_view_and_stricts); _tmp12_ = (GtkVBox*) gtk_vbox_new (FALSE, 0); _tmp13_ = g_object_ref_sink (_tmp12_); nextViewWithNotes = _tmp13_; _tmp14_ = (GtkAlignment*) gtk_alignment_new (0.5f, 0.5f, (gfloat) 0, (gfloat) 0); _tmp15_ = g_object_ref_sink (_tmp14_); center_next_view = _tmp15_; _tmp16_ = self->next_view; gtk_container_add ((GtkContainer*) center_next_view, (GtkWidget*) _tmp16_); gtk_box_pack_start ((GtkBox*) nextViewWithNotes, (GtkWidget*) center_next_view, FALSE, FALSE, (guint) 0); _tmp17_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL); _tmp18_ = g_object_ref_sink (_tmp17_); notes_sw = _tmp18_; _tmp19_ = gtk_scrolled_window_get_vscrollbar (notes_sw); _tmp20_ = _g_object_ref0 (GTK_SCROLLBAR (_tmp19_)); notes_scrollbar = _tmp20_; _tmp21_ = self->white; gtk_widget_modify_bg ((GtkWidget*) notes_scrollbar, GTK_STATE_NORMAL, &_tmp21_); _tmp22_ = self->black; gtk_widget_modify_bg ((GtkWidget*) notes_scrollbar, GTK_STATE_ACTIVE, &_tmp22_); _tmp23_ = self->white; gtk_widget_modify_bg ((GtkWidget*) notes_scrollbar, GTK_STATE_PRELIGHT, &_tmp23_); _tmp24_ = self->notes_view; gtk_container_add ((GtkContainer*) notes_sw, (GtkWidget*) _tmp24_); gtk_scrolled_window_set_policy (notes_sw, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start ((GtkBox*) nextViewWithNotes, (GtkWidget*) notes_sw, TRUE, TRUE, (guint) 5); _tmp25_ = self->slideViews; gtk_container_add ((GtkContainer*) _tmp25_, (GtkWidget*) nextViewWithNotes); _tmp26_ = (GtkHBox*) gtk_hbox_new (TRUE, 0); _tmp27_ = g_object_ref_sink (_tmp26_); bottomRow = _tmp27_; _tmp28_ = (GtkHBox*) gtk_hbox_new (FALSE, 2); _tmp29_ = g_object_ref_sink (_tmp28_); status = _tmp29_; _tmp30_ = self->blank_icon; gtk_box_pack_start ((GtkBox*) status, (GtkWidget*) _tmp30_, FALSE, FALSE, (guint) 0); _tmp31_ = self->frozen_icon; gtk_box_pack_start ((GtkBox*) status, (GtkWidget*) _tmp31_, FALSE, FALSE, (guint) 0); _tmp32_ = self->pause_icon; gtk_box_pack_start ((GtkBox*) status, (GtkWidget*) _tmp32_, FALSE, FALSE, (guint) 0); _tmp33_ = (GtkAlignment*) gtk_alignment_new (0.5f, 0.5f, (gfloat) 0, (gfloat) 0); _tmp34_ = g_object_ref_sink (_tmp33_); timer_alignment = _tmp34_; _tmp35_ = self->timer; gtk_container_add ((GtkContainer*) timer_alignment, (GtkWidget*) _tmp35_); _tmp36_ = (GtkHBox*) gtk_hbox_new (FALSE, 0); _tmp37_ = g_object_ref_sink (_tmp36_); progress_alignment = _tmp37_; _tmp38_ = self->slide_progress; gtk_box_pack_end ((GtkBox*) progress_alignment, (GtkWidget*) _tmp38_, TRUE, TRUE, (guint) 0); _tmp39_ = (GtkAlignment*) gtk_alignment_new ((gfloat) 0, 0.5f, (gfloat) 1, (gfloat) 0); _tmp40_ = g_object_ref_sink (_tmp39_); prerender_alignment = _tmp40_; _tmp41_ = self->prerender_progress; gtk_container_add ((GtkContainer*) prerender_alignment, (GtkWidget*) _tmp41_); gtk_box_pack_start ((GtkBox*) progress_alignment, (GtkWidget*) prerender_alignment, TRUE, TRUE, (guint) 0); gtk_box_pack_start ((GtkBox*) bottomRow, (GtkWidget*) status, TRUE, TRUE, (guint) 0); gtk_box_pack_start ((GtkBox*) bottomRow, (GtkWidget*) timer_alignment, TRUE, TRUE, (guint) 0); gtk_box_pack_end ((GtkBox*) bottomRow, (GtkWidget*) progress_alignment, TRUE, TRUE, (guint) 0); _tmp42_ = (GtkVBox*) gtk_vbox_new (FALSE, 0); _tmp43_ = g_object_ref_sink (_tmp42_); _g_object_unref0 (self->fullLayout); self->fullLayout = _tmp43_; _tmp44_ = self->fullLayout; _tmp45_ = ((pdfpcWindowFullscreen*) self)->screen_geometry; _tmp46_ = _tmp45_.width; _tmp47_ = ((pdfpcWindowFullscreen*) self)->screen_geometry; _tmp48_ = _tmp47_.height; gtk_widget_set_size_request ((GtkWidget*) _tmp44_, _tmp46_, _tmp48_); _tmp49_ = self->fullLayout; _tmp50_ = self->slideViews; gtk_box_pack_start ((GtkBox*) _tmp49_, (GtkWidget*) _tmp50_, TRUE, TRUE, (guint) 0); _tmp51_ = self->fullLayout; gtk_box_pack_end ((GtkBox*) _tmp51_, (GtkWidget*) bottomRow, FALSE, FALSE, (guint) 0); _tmp52_ = self->fullLayout; gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp52_); _tmp53_ = (GtkAlignment*) gtk_alignment_new (0.5f, 0.5f, (gfloat) 0, (gfloat) 0); _tmp54_ = g_object_ref_sink (_tmp53_); _g_object_unref0 (self->centered_overview); self->centered_overview = _tmp54_; _tmp55_ = self->centered_overview; _tmp56_ = self->overview; gtk_container_add ((GtkContainer*) _tmp55_, (GtkWidget*) _tmp56_); _g_object_unref0 (prerender_alignment); _g_object_unref0 (progress_alignment); _g_object_unref0 (timer_alignment); _g_object_unref0 (status); _g_object_unref0 (bottomRow); _g_object_unref0 (notes_scrollbar); _g_object_unref0 (notes_sw); _g_object_unref0 (center_next_view); _g_object_unref0 (nextViewWithNotes); _g_object_unref0 (current_view_and_stricts); _g_object_unref0 (center_current_view); _g_object_unref0 (strict_views); } /** * Handle keypress events on the window and, if neccessary send them to the * presentation controller */ gboolean pdfpc_window_presenter_on_key_pressed (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key) { gboolean result = FALSE; pdfpcPresentationController* _tmp0_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (source != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); _tmp0_ = self->presentation_controller; if (_tmp0_ != NULL) { pdfpcPresentationController* _tmp1_; GdkEventKey _tmp2_; gboolean _tmp3_ = FALSE; _tmp1_ = self->presentation_controller; _tmp2_ = *key; _tmp3_ = pdfpc_presentation_controller_key_press (_tmp1_, &_tmp2_); result = _tmp3_; return result; } else { result = FALSE; return result; } } /** * Handle mouse button events on the window and, if neccessary send * them to the presentation controller */ gboolean pdfpc_window_presenter_on_button_press (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventButton* button) { gboolean result = FALSE; pdfpcPresentationController* _tmp0_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (source != NULL, FALSE); g_return_val_if_fail (button != NULL, FALSE); _tmp0_ = self->presentation_controller; if (_tmp0_ != NULL) { pdfpcPresentationController* _tmp1_; GdkEventButton _tmp2_; _tmp1_ = self->presentation_controller; _tmp2_ = *button; pdfpc_presentation_controller_button_press (_tmp1_, &_tmp2_); } result = FALSE; return result; } /** * Handle mouse scrolling events on the window and, if neccessary send * them to the presentation controller */ gboolean pdfpc_window_presenter_on_scroll (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventScroll* scroll) { gboolean result = FALSE; pdfpcPresentationController* _tmp0_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (source != NULL, FALSE); g_return_val_if_fail (scroll != NULL, FALSE); _tmp0_ = self->presentation_controller; if (_tmp0_ != NULL) { pdfpcPresentationController* _tmp1_; GdkEventScroll _tmp2_; _tmp1_ = self->presentation_controller; _tmp2_ = *scroll; pdfpc_presentation_controller_scroll (_tmp1_, &_tmp2_); } result = FALSE; return result; } /** * Update the slide count view */ void pdfpc_window_presenter_update_slide_count (pdfpcWindowPresenter* self) { pdfpcPresentationController* _tmp0_; gint _tmp1_ = 0; g_return_if_fail (self != NULL); _tmp0_ = self->presentation_controller; _tmp1_ = pdfpc_presentation_controller_get_current_user_slide_number (_tmp0_); pdfpc_window_presenter_custom_slide_count (self, _tmp1_ + 1); } void pdfpc_window_presenter_custom_slide_count (pdfpcWindowPresenter* self, gint current) { pdfpcPresentationController* _tmp0_; gint _tmp1_ = 0; gint total; GtkEntry* _tmp2_; gint _tmp3_; gchar* _tmp4_ = NULL; gchar* _tmp5_; g_return_if_fail (self != NULL); _tmp0_ = self->presentation_controller; _tmp1_ = pdfpc_presentation_controller_get_end_user_slide (_tmp0_); total = _tmp1_; _tmp2_ = self->slide_progress; _tmp3_ = current; _tmp4_ = g_strdup_printf ("%d/%u", _tmp3_, (guint) total); _tmp5_ = _tmp4_; gtk_entry_set_text (_tmp2_, _tmp5_); _g_free0 (_tmp5_); } /** * Return the registered PresentationController */ static pdfpcPresentationController* pdfpc_window_presenter_real_get_controller (pdfpcControllable* base) { pdfpcWindowPresenter * self; pdfpcPresentationController* result = NULL; pdfpcPresentationController* _tmp0_; pdfpcPresentationController* _tmp1_; self = (pdfpcWindowPresenter*) base; _tmp0_ = self->presentation_controller; _tmp1_ = _g_object_ref0 (_tmp0_); result = _tmp1_; return result; } static void pdfpc_window_presenter_real_update (pdfpcControllable* base) { pdfpcWindowPresenter * self; pdfpcPresentationController* _tmp0_; gint _tmp1_ = 0; gint current_slide_number; pdfpcPresentationController* _tmp2_; gint _tmp3_ = 0; gint current_user_slide_number; pdfpcTimerLabel* _tmp22_; gboolean _tmp23_ = FALSE; pdfpcPresentationController* _tmp26_; gboolean _tmp27_ = FALSE; pdfpcPresentationController* _tmp30_; gboolean _tmp31_ = FALSE; GError * _inner_error_ = NULL; self = (pdfpcWindowPresenter*) base; _tmp0_ = self->presentation_controller; _tmp1_ = pdfpc_presentation_controller_get_current_slide_number (_tmp0_); current_slide_number = _tmp1_; _tmp2_ = self->presentation_controller; _tmp3_ = pdfpc_presentation_controller_get_current_user_slide_number (_tmp2_); current_user_slide_number = _tmp3_; { pdfpcViewBase* _tmp4_; gint _tmp5_; pdfpcViewBase* _tmp6_; pdfpcMetadataPdf* _tmp7_; gint _tmp8_; gint _tmp9_ = 0; pdfpcPresentationController* _tmp10_; gboolean _tmp11_ = FALSE; pdfpcPresentationController* _tmp15_; gboolean _tmp16_ = FALSE; _tmp4_ = self->current_view; _tmp5_ = current_slide_number; pdfpc_view_base_display (_tmp4_, _tmp5_, FALSE, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { goto __catch13_pdfpc_renderer_render_error; } g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } _tmp6_ = self->next_view; _tmp7_ = self->metadata; _tmp8_ = current_user_slide_number; _tmp9_ = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp7_, _tmp8_ + 1); pdfpc_view_base_display (_tmp6_, _tmp9_, FALSE, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { goto __catch13_pdfpc_renderer_render_error; } g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } _tmp10_ = self->presentation_controller; _tmp11_ = pdfpc_presentation_controller_skip_next (_tmp10_); if (_tmp11_) { pdfpcViewBase* _tmp12_; gint _tmp13_; _tmp12_ = self->strict_next_view; _tmp13_ = current_slide_number; pdfpc_view_base_display (_tmp12_, _tmp13_ + 1, TRUE, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { goto __catch13_pdfpc_renderer_render_error; } g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } else { pdfpcViewBase* _tmp14_; _tmp14_ = self->strict_next_view; pdfpc_view_base_fade_to_black (_tmp14_); } _tmp15_ = self->presentation_controller; _tmp16_ = pdfpc_presentation_controller_skip_previous (_tmp15_); if (_tmp16_) { pdfpcViewBase* _tmp17_; gint _tmp18_; _tmp17_ = self->strict_prev_view; _tmp18_ = current_slide_number; pdfpc_view_base_display (_tmp17_, _tmp18_ - 1, TRUE, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { goto __catch13_pdfpc_renderer_render_error; } g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } else { pdfpcViewBase* _tmp19_; _tmp19_ = self->strict_prev_view; pdfpc_view_base_fade_to_black (_tmp19_); } } goto __finally13; __catch13_pdfpc_renderer_render_error: { GError* e = NULL; gint _tmp20_; const gchar* _tmp21_; e = _inner_error_; _inner_error_ = NULL; _tmp20_ = current_slide_number; _tmp21_ = e->message; g_error ("presenter.vala:483: The pdf page %d could not be rendered: %s", _tmp20_, _tmp21_); _g_error_free0 (e); } __finally13: if (_inner_error_ != NULL) { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } pdfpc_window_presenter_update_slide_count (self); pdfpc_window_presenter_update_note (self); _tmp22_ = self->timer; _tmp23_ = pdfpc_timer_label_is_paused (_tmp22_); if (_tmp23_) { GtkImage* _tmp24_; _tmp24_ = self->pause_icon; gtk_widget_show ((GtkWidget*) _tmp24_); } else { GtkImage* _tmp25_; _tmp25_ = self->pause_icon; gtk_widget_hide ((GtkWidget*) _tmp25_); } _tmp26_ = self->presentation_controller; _tmp27_ = pdfpc_presentation_controller_is_faded_to_black (_tmp26_); if (_tmp27_) { GtkImage* _tmp28_; _tmp28_ = self->blank_icon; gtk_widget_show ((GtkWidget*) _tmp28_); } else { GtkImage* _tmp29_; _tmp29_ = self->blank_icon; gtk_widget_hide ((GtkWidget*) _tmp29_); } _tmp30_ = self->presentation_controller; _tmp31_ = pdfpc_presentation_controller_is_frozen (_tmp30_); if (_tmp31_) { GtkImage* _tmp32_; _tmp32_ = self->frozen_icon; gtk_widget_show ((GtkWidget*) _tmp32_); } else { GtkImage* _tmp33_; _tmp33_ = self->frozen_icon; gtk_widget_hide ((GtkWidget*) _tmp33_); } ((pdfpcWindowFullscreen*) self)->faded_to_black = FALSE; } /** * Display a specific page */ void pdfpc_window_presenter_goto_page (pdfpcWindowPresenter* self, gint page_number) { GtkImage* _tmp6_; GError * _inner_error_ = NULL; g_return_if_fail (self != NULL); { pdfpcViewBase* _tmp0_; gint _tmp1_; pdfpcViewBase* _tmp2_; gint _tmp3_; _tmp0_ = self->current_view; _tmp1_ = page_number; pdfpc_view_base_display (_tmp0_, _tmp1_, FALSE, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { goto __catch14_pdfpc_renderer_render_error; } g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } _tmp2_ = self->next_view; _tmp3_ = page_number; pdfpc_view_base_display (_tmp2_, _tmp3_ + 1, FALSE, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == PDFPC_RENDERER_RENDER_ERROR) { goto __catch14_pdfpc_renderer_render_error; } g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } } goto __finally14; __catch14_pdfpc_renderer_render_error: { GError* e = NULL; gint _tmp4_; const gchar* _tmp5_; e = _inner_error_; _inner_error_ = NULL; _tmp4_ = page_number; _tmp5_ = e->message; g_error ("presenter.vala:513: The pdf page %d could not be rendered: %s", _tmp4_, _tmp5_); _g_error_free0 (e); } __finally14: if (_inner_error_ != NULL) { g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return; } pdfpc_window_presenter_update_slide_count (self); pdfpc_window_presenter_update_note (self); _tmp6_ = self->blank_icon; gtk_widget_hide ((GtkWidget*) _tmp6_); } /** * Ask for the page to jump to */ static void pdfpc_window_presenter_real_ask_goto_page (pdfpcControllable* base) { pdfpcWindowPresenter * self; GtkEntry* _tmp0_; pdfpcPresentationController* _tmp1_; gint _tmp2_ = 0; gchar* _tmp3_ = NULL; gchar* _tmp4_; GtkEntry* _tmp5_; GdkColor _tmp6_; GtkEntry* _tmp7_; GtkEntry* _tmp8_; GtkEntry* _tmp9_; pdfpcPresentationController* _tmp10_; self = (pdfpcWindowPresenter*) base; _tmp0_ = self->slide_progress; _tmp1_ = self->presentation_controller; _tmp2_ = pdfpc_presentation_controller_get_user_n_slides (_tmp1_); _tmp3_ = g_strdup_printf ("/%u", (guint) _tmp2_); _tmp4_ = _tmp3_; gtk_entry_set_text (_tmp0_, _tmp4_); _g_free0 (_tmp4_); _tmp5_ = self->slide_progress; _tmp6_ = self->white; gtk_widget_modify_cursor ((GtkWidget*) _tmp5_, &_tmp6_, NULL); _tmp7_ = self->slide_progress; g_object_set (_tmp7_, "editable", TRUE, NULL); _tmp8_ = self->slide_progress; gtk_widget_grab_focus ((GtkWidget*) _tmp8_); _tmp9_ = self->slide_progress; gtk_editable_set_position ((GtkEditable*) _tmp9_, 0); _tmp10_ = self->presentation_controller; pdfpc_presentation_controller_set_ignore_input_events (_tmp10_, TRUE); } /** * Handle key events for the slide_progress entry field */ static glong string_strnlen (gchar* str, glong maxlen) { glong result = 0L; gchar* _tmp0_; glong _tmp1_; gchar* _tmp2_ = NULL; gchar* end; gchar* _tmp3_; _tmp0_ = str; _tmp1_ = maxlen; _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_); end = _tmp2_; _tmp3_ = end; if (_tmp3_ == NULL) { glong _tmp4_; _tmp4_ = maxlen; result = _tmp4_; return result; } else { gchar* _tmp5_; gchar* _tmp6_; _tmp5_ = end; _tmp6_ = str; result = (glong) (_tmp5_ - _tmp6_); return result; } } static gchar* string_substring (const gchar* self, glong offset, glong len) { gchar* result = NULL; glong string_length = 0L; gboolean _tmp0_ = FALSE; glong _tmp1_; gboolean _tmp3_; glong _tmp9_; glong _tmp15_; glong _tmp18_; glong _tmp19_; glong _tmp20_; glong _tmp21_; glong _tmp22_; gchar* _tmp23_ = NULL; g_return_val_if_fail (self != NULL, NULL); _tmp1_ = offset; if (_tmp1_ >= ((glong) 0)) { glong _tmp2_; _tmp2_ = len; _tmp0_ = _tmp2_ >= ((glong) 0); } else { _tmp0_ = FALSE; } _tmp3_ = _tmp0_; if (_tmp3_) { glong _tmp4_; glong _tmp5_; glong _tmp6_ = 0L; _tmp4_ = offset; _tmp5_ = len; _tmp6_ = string_strnlen ((gchar*) self, _tmp4_ + _tmp5_); string_length = _tmp6_; } else { gint _tmp7_; gint _tmp8_; _tmp7_ = strlen (self); _tmp8_ = _tmp7_; string_length = (glong) _tmp8_; } _tmp9_ = offset; if (_tmp9_ < ((glong) 0)) { glong _tmp10_; glong _tmp11_; glong _tmp12_; _tmp10_ = string_length; _tmp11_ = offset; offset = _tmp10_ + _tmp11_; _tmp12_ = offset; g_return_val_if_fail (_tmp12_ >= ((glong) 0), NULL); } else { glong _tmp13_; glong _tmp14_; _tmp13_ = offset; _tmp14_ = string_length; g_return_val_if_fail (_tmp13_ <= _tmp14_, NULL); } _tmp15_ = len; if (_tmp15_ < ((glong) 0)) { glong _tmp16_; glong _tmp17_; _tmp16_ = string_length; _tmp17_ = offset; len = _tmp16_ - _tmp17_; } _tmp18_ = offset; _tmp19_ = len; _tmp20_ = string_length; g_return_val_if_fail ((_tmp18_ + _tmp19_) <= _tmp20_, NULL); _tmp21_ = offset; _tmp22_ = len; _tmp23_ = g_strndup (((gchar*) self) + _tmp21_, (gsize) _tmp22_); result = _tmp23_; return result; } static gint string_index_of (const gchar* self, const gchar* needle, gint start_index) { gint result = 0; gint _tmp0_; const gchar* _tmp1_; gchar* _tmp2_ = NULL; gchar* _result_; gchar* _tmp3_; g_return_val_if_fail (self != NULL, 0); g_return_val_if_fail (needle != NULL, 0); _tmp0_ = start_index; _tmp1_ = needle; _tmp2_ = strstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_); _result_ = _tmp2_; _tmp3_ = _result_; if (_tmp3_ != NULL) { gchar* _tmp4_; _tmp4_ = _result_; result = (gint) (_tmp4_ - ((gchar*) self)); return result; } else { result = -1; return result; } } gboolean pdfpc_window_presenter_on_key_press_slide_progress (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key) { gboolean result = FALSE; GdkEventKey _tmp0_; guint _tmp1_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (source != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); _tmp0_ = *key; _tmp1_ = _tmp0_.keyval; if (_tmp1_ == ((guint) 0xff0d)) { GtkEntry* _tmp2_; const gchar* _tmp3_; const gchar* _tmp4_; gchar* _tmp5_; gchar* input_text; const gchar* _tmp6_; const gchar* _tmp7_; gint _tmp8_ = 0; gchar* _tmp9_ = NULL; gchar* _tmp10_; gint _tmp11_ = 0; gint _tmp12_; gint destination; GtkEntry* _tmp13_; GdkColor _tmp14_; GtkEntry* _tmp15_; pdfpcPresentationController* _tmp16_; gint _tmp17_; _tmp2_ = self->slide_progress; _tmp3_ = gtk_entry_get_text (_tmp2_); _tmp4_ = _tmp3_; _tmp5_ = g_strdup (_tmp4_); input_text = _tmp5_; _tmp6_ = input_text; _tmp7_ = input_text; _tmp8_ = string_index_of (_tmp7_, "/", 0); _tmp9_ = string_substring (_tmp6_, (glong) 0, (glong) _tmp8_); _tmp10_ = _tmp9_; _tmp11_ = atoi (_tmp10_); _tmp12_ = _tmp11_; _g_free0 (_tmp10_); destination = _tmp12_; _tmp13_ = self->slide_progress; _tmp14_ = self->black; gtk_widget_modify_cursor ((GtkWidget*) _tmp13_, &_tmp14_, NULL); _tmp15_ = self->slide_progress; g_object_set (_tmp15_, "editable", FALSE, NULL); _tmp16_ = self->presentation_controller; pdfpc_presentation_controller_set_ignore_input_events (_tmp16_, FALSE); _tmp17_ = destination; if (_tmp17_ != 0) { pdfpcPresentationController* _tmp18_; gint _tmp19_; _tmp18_ = self->presentation_controller; _tmp19_ = destination; pdfpc_presentation_controller_goto_user_page (_tmp18_, _tmp19_); } else { pdfpc_window_presenter_update_slide_count (self); } result = TRUE; _g_free0 (input_text); return result; } else { result = FALSE; return result; } } /** * Edit a note. Basically give focus to notes_view */ static void pdfpc_window_presenter_real_edit_note (pdfpcControllable* base) { pdfpcWindowPresenter * self; GtkTextView* _tmp0_; GtkTextView* _tmp1_; GtkTextView* _tmp2_; pdfpcPresentationController* _tmp3_; self = (pdfpcWindowPresenter*) base; _tmp0_ = self->notes_view; gtk_text_view_set_editable (_tmp0_, TRUE); _tmp1_ = self->notes_view; gtk_text_view_set_cursor_visible (_tmp1_, TRUE); _tmp2_ = self->notes_view; gtk_widget_grab_focus ((GtkWidget*) _tmp2_); _tmp3_ = self->presentation_controller; pdfpc_presentation_controller_set_ignore_input_events (_tmp3_, TRUE); } /** * Handle key presses when editing a note */ gboolean pdfpc_window_presenter_on_key_press_notes_view (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key) { gboolean result = FALSE; GdkEventKey _tmp0_; guint _tmp1_; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (source != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); _tmp0_ = *key; _tmp1_ = _tmp0_.keyval; if (_tmp1_ == ((guint) 0xff1b)) { GtkTextView* _tmp2_; GtkTextView* _tmp3_; pdfpcMetadataPdf* _tmp4_; pdfpcslides_notes* _tmp5_ = NULL; pdfpcslides_notes* _tmp6_; GtkTextView* _tmp7_; GtkTextBuffer* _tmp8_; GtkTextBuffer* _tmp9_; gchar* _tmp10_ = NULL; gchar* _tmp11_; gchar* _tmp12_; pdfpcPresentationController* _tmp13_; gint _tmp14_ = 0; pdfpcPresentationController* _tmp15_; _tmp2_ = self->notes_view; gtk_text_view_set_editable (_tmp2_, FALSE); _tmp3_ = self->notes_view; gtk_text_view_set_cursor_visible (_tmp3_, FALSE); _tmp4_ = self->metadata; _tmp5_ = pdfpc_metadata_pdf_get_notes (_tmp4_); _tmp6_ = _tmp5_; _tmp7_ = self->notes_view; _tmp8_ = gtk_text_view_get_buffer (_tmp7_); _tmp9_ = _tmp8_; g_object_get (_tmp9_, "text", &_tmp10_, NULL); _tmp11_ = _tmp10_; _tmp12_ = _tmp11_; _tmp13_ = self->presentation_controller; _tmp14_ = pdfpc_presentation_controller_get_current_user_slide_number (_tmp13_); pdfpc_slides_notes_set_note (_tmp6_, _tmp12_, _tmp14_); _g_free0 (_tmp12_); _g_object_unref0 (_tmp6_); _tmp15_ = self->presentation_controller; pdfpc_presentation_controller_set_ignore_input_events (_tmp15_, FALSE); result = TRUE; return result; } else { result = FALSE; return result; } } /** * Update the text of the current note */ void pdfpc_window_presenter_update_note (pdfpcWindowPresenter* self) { pdfpcMetadataPdf* _tmp0_; pdfpcslides_notes* _tmp1_ = NULL; pdfpcslides_notes* _tmp2_; pdfpcPresentationController* _tmp3_; gint _tmp4_ = 0; gchar* _tmp5_ = NULL; gchar* _tmp6_; gchar* this_note; GtkTextView* _tmp7_; GtkTextBuffer* _tmp8_; GtkTextBuffer* _tmp9_; g_return_if_fail (self != NULL); _tmp0_ = self->metadata; _tmp1_ = pdfpc_metadata_pdf_get_notes (_tmp0_); _tmp2_ = _tmp1_; _tmp3_ = self->presentation_controller; _tmp4_ = pdfpc_presentation_controller_get_current_user_slide_number (_tmp3_); _tmp5_ = pdfpc_slides_notes_get_note_for_slide (_tmp2_, _tmp4_); _tmp6_ = _tmp5_; _g_object_unref0 (_tmp2_); this_note = _tmp6_; _tmp7_ = self->notes_view; _tmp8_ = gtk_text_view_get_buffer (_tmp7_); _tmp9_ = _tmp8_; g_object_set (_tmp9_, "text", this_note, NULL); _g_free0 (this_note); } static void pdfpc_window_presenter_real_show_overview (pdfpcControllable* base) { pdfpcWindowPresenter * self; GtkHBox* _tmp0_; gboolean _tmp1_; GtkAlignment* _tmp4_; pdfpcWindowOverview* _tmp5_; pdfpcPresentationController* _tmp6_; gint _tmp7_ = 0; self = (pdfpcWindowPresenter*) base; _tmp0_ = self->slideViews; gtk_widget_hide ((GtkWidget*) _tmp0_); _tmp1_ = self->overview_added; if (!_tmp1_) { GtkVBox* _tmp2_; GtkAlignment* _tmp3_; _tmp2_ = self->fullLayout; _tmp3_ = self->centered_overview; gtk_box_pack_start ((GtkBox*) _tmp2_, (GtkWidget*) _tmp3_, TRUE, TRUE, (guint) 0); self->overview_added = TRUE; } _tmp4_ = self->centered_overview; gtk_widget_show ((GtkWidget*) _tmp4_); _tmp5_ = self->overview; _tmp6_ = self->presentation_controller; _tmp7_ = pdfpc_presentation_controller_get_current_user_slide_number (_tmp6_); pdfpc_window_overview_set_current_slide (_tmp5_, _tmp7_); } static void pdfpc_window_presenter_real_hide_overview (pdfpcControllable* base) { pdfpcWindowPresenter * self; GtkAlignment* _tmp0_; GtkHBox* _tmp1_; self = (pdfpcWindowPresenter*) base; _tmp0_ = self->centered_overview; gtk_widget_hide ((GtkWidget*) _tmp0_); _tmp1_ = self->slideViews; gtk_widget_show ((GtkWidget*) _tmp1_); } /** * Take a cache observer and register it with all prerendering Views * shown on the window. * * Furthermore it is taken care of to add the cache observer to this window * for display, as it is a Image widget after all. */ static void _gtk_progress_bar_set_fraction_pdfpc_cache_status_update_function (gdouble progress, gpointer self) { gtk_progress_bar_set_fraction (self, progress); } static void _pdfpc_window_presenter_prerender_finished_pdfpc_cache_status_update_complete (gpointer self) { pdfpc_window_presenter_prerender_finished (self); } void pdfpc_window_presenter_set_cache_observer (pdfpcWindowPresenter* self, pdfpcCacheStatus* observer) { pdfpcViewBase* _tmp0_; pdfpcViewPrerendering* _tmp1_; pdfpcViewPrerendering* current_prerendering_view; pdfpcViewPrerendering* _tmp2_; pdfpcViewBase* _tmp5_; pdfpcViewPrerendering* _tmp6_; pdfpcViewPrerendering* next_prerendering_view; pdfpcViewPrerendering* _tmp7_; pdfpcCacheStatus* _tmp10_; GtkProgressBar* _tmp11_; GtkProgressBar* _tmp12_; g_return_if_fail (self != NULL); g_return_if_fail (observer != NULL); _tmp0_ = self->current_view; _tmp1_ = _g_object_ref0 (PDFPC_VIEW_IS_PRERENDERING (_tmp0_) ? ((pdfpcViewPrerendering*) _tmp0_) : NULL); current_prerendering_view = _tmp1_; _tmp2_ = current_prerendering_view; if (_tmp2_ != NULL) { pdfpcCacheStatus* _tmp3_; pdfpcViewPrerendering* _tmp4_; _tmp3_ = observer; _tmp4_ = current_prerendering_view; pdfpc_cache_status_monitor_view (_tmp3_, _tmp4_); } _tmp5_ = self->next_view; _tmp6_ = _g_object_ref0 (PDFPC_VIEW_IS_PRERENDERING (_tmp5_) ? ((pdfpcViewPrerendering*) _tmp5_) : NULL); next_prerendering_view = _tmp6_; _tmp7_ = next_prerendering_view; if (_tmp7_ != NULL) { pdfpcCacheStatus* _tmp8_; pdfpcViewPrerendering* _tmp9_; _tmp8_ = observer; _tmp9_ = next_prerendering_view; pdfpc_cache_status_monitor_view (_tmp8_, _tmp9_); } _tmp10_ = observer; _tmp11_ = self->prerender_progress; pdfpc_cache_status_register_update (_tmp10_, _gtk_progress_bar_set_fraction_pdfpc_cache_status_update_function, _tmp11_, _pdfpc_window_presenter_prerender_finished_pdfpc_cache_status_update_complete, self); _tmp12_ = self->prerender_progress; gtk_widget_show ((GtkWidget*) _tmp12_); _g_object_unref0 (next_prerendering_view); _g_object_unref0 (current_prerendering_view); } void pdfpc_window_presenter_prerender_finished (pdfpcWindowPresenter* self) { GtkProgressBar* _tmp0_; pdfpcWindowOverview* _tmp1_; pdfpcViewBase* _tmp2_; pdfpcRendererBase* _tmp3_ = NULL; pdfpcRendererCaching* _tmp4_; pdfpcRendererCacheBase* _tmp5_ = NULL; pdfpcRendererCacheBase* _tmp6_; g_return_if_fail (self != NULL); _tmp0_ = self->prerender_progress; gtk_widget_hide ((GtkWidget*) _tmp0_); _tmp1_ = self->overview; _tmp2_ = self->next_view; _tmp3_ = pdfpc_view_base_get_renderer (_tmp2_); _tmp4_ = PDFPC_RENDERER_CACHING (_tmp3_); _tmp5_ = pdfpc_renderer_caching_get_cache (_tmp4_); _tmp6_ = _tmp5_; pdfpc_window_overview_set_cache (_tmp1_, _tmp6_); _g_object_unref0 (_tmp6_); _g_object_unref0 (_tmp4_); } static void pdfpc_window_presenter_class_init (pdfpcWindowPresenterClass * klass) { pdfpc_window_presenter_parent_class = g_type_class_peek_parent (klass); GTK_WIDGET_CLASS (klass)->show = pdfpc_window_presenter_real_show; G_OBJECT_CLASS (klass)->finalize = pdfpc_window_presenter_finalize; } static void pdfpc_window_presenter_pdfpc_controllable_interface_init (pdfpcControllableIface * iface) { pdfpc_window_presenter_pdfpc_controllable_parent_iface = g_type_interface_peek_parent (iface); iface->get_controller = (pdfpcPresentationController* (*)(pdfpcControllable*)) pdfpc_window_presenter_real_get_controller; iface->update = (void (*)(pdfpcControllable*)) pdfpc_window_presenter_real_update; iface->ask_goto_page = (void (*)(pdfpcControllable*)) pdfpc_window_presenter_real_ask_goto_page; iface->edit_note = (void (*)(pdfpcControllable*)) pdfpc_window_presenter_real_edit_note; iface->show_overview = (void (*)(pdfpcControllable*)) pdfpc_window_presenter_real_show_overview; iface->hide_overview = (void (*)(pdfpcControllable*)) pdfpc_window_presenter_real_hide_overview; } static void pdfpc_window_presenter_instance_init (pdfpcWindowPresenter * self) { self->presentation_controller = NULL; self->slideViews = NULL; self->overview = NULL; self->centered_overview = NULL; self->overview_added = FALSE; self->fullLayout = NULL; } static void pdfpc_window_presenter_finalize (GObject* obj) { pdfpcWindowPresenter * self; self = PDFPC_WINDOW_PRESENTER (obj); _g_object_unref0 (self->presentation_controller); _g_object_unref0 (self->current_view); _g_object_unref0 (self->next_view); _g_object_unref0 (self->strict_next_view); _g_object_unref0 (self->strict_prev_view); _g_object_unref0 (self->timer); _g_object_unref0 (self->slide_progress); _g_object_unref0 (self->prerender_progress); _g_object_unref0 (self->blank_icon); _g_object_unref0 (self->frozen_icon); _g_object_unref0 (self->pause_icon); _g_object_unref0 (self->notes_view); _g_object_unref0 (self->slideViews); _g_object_unref0 (self->overview); _g_object_unref0 (self->centered_overview); _g_object_unref0 (self->fullLayout); _g_object_unref0 (self->metadata); G_OBJECT_CLASS (pdfpc_window_presenter_parent_class)->finalize (obj); } /** * Window showing the currently active and next slide. * * Other useful information like time slide count, ... can be displayed here as * well. */ GType pdfpc_window_presenter_get_type (void) { static volatile gsize pdfpc_window_presenter_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_window_presenter_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcWindowPresenterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_window_presenter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcWindowPresenter), 0, (GInstanceInitFunc) pdfpc_window_presenter_instance_init, NULL }; static const GInterfaceInfo pdfpc_controllable_info = { (GInterfaceInitFunc) pdfpc_window_presenter_pdfpc_controllable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; GType pdfpc_window_presenter_type_id; pdfpc_window_presenter_type_id = g_type_register_static (PDFPC_WINDOW_TYPE_FULLSCREEN, "pdfpcWindowPresenter", &g_define_type_info, 0); g_type_add_interface_static (pdfpc_window_presenter_type_id, PDFPC_TYPE_CONTROLLABLE, &pdfpc_controllable_info); g_once_init_leave (&pdfpc_window_presenter_type_id__volatile, pdfpc_window_presenter_type_id); } return pdfpc_window_presenter_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/interfaces/000077500000000000000000000000001177613036100175615ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/interfaces/controllable.c000066400000000000000000000120301177613036100224010ustar00rootroot00000000000000/* controllable.c generated by valac 0.16.0, the Vala compiler * generated from controllable.vala, do not modify */ /** * Set the presentation controller which needs to be informed of key * presses and such. */ #include #include #define PDFPC_TYPE_CONTROLLABLE (pdfpc_controllable_get_type ()) #define PDFPC_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllable)) #define PDFPC_IS_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CONTROLLABLE)) #define PDFPC_CONTROLLABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllableIface)) typedef struct _pdfpcControllable pdfpcControllable; typedef struct _pdfpcControllableIface pdfpcControllableIface; #define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController)) #define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) #define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) typedef struct _pdfpcPresentationController pdfpcPresentationController; typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass; struct _pdfpcControllableIface { GTypeInterface parent_iface; pdfpcPresentationController* (*get_controller) (pdfpcControllable* self); void (*update) (pdfpcControllable* self); void (*edit_note) (pdfpcControllable* self); void (*ask_goto_page) (pdfpcControllable* self); void (*show_overview) (pdfpcControllable* self); void (*hide_overview) (pdfpcControllable* self); }; GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST; GType pdfpc_controllable_get_type (void) G_GNUC_CONST; pdfpcPresentationController* pdfpc_controllable_get_controller (pdfpcControllable* self); void pdfpc_controllable_update (pdfpcControllable* self); void pdfpc_controllable_edit_note (pdfpcControllable* self); void pdfpc_controllable_ask_goto_page (pdfpcControllable* self); void pdfpc_controllable_show_overview (pdfpcControllable* self); void pdfpc_controllable_hide_overview (pdfpcControllable* self); /** * Return the registered PresentationController */ pdfpcPresentationController* pdfpc_controllable_get_controller (pdfpcControllable* self) { g_return_val_if_fail (self != NULL, NULL); return PDFPC_CONTROLLABLE_GET_INTERFACE (self)->get_controller (self); } /** * Update the display */ void pdfpc_controllable_update (pdfpcControllable* self) { g_return_if_fail (self != NULL); PDFPC_CONTROLLABLE_GET_INTERFACE (self)->update (self); } /** * Edit note for current slide */ void pdfpc_controllable_edit_note (pdfpcControllable* self) { g_return_if_fail (self != NULL); PDFPC_CONTROLLABLE_GET_INTERFACE (self)->edit_note (self); } /** * Ask for the page to jump to */ void pdfpc_controllable_ask_goto_page (pdfpcControllable* self) { g_return_if_fail (self != NULL); PDFPC_CONTROLLABLE_GET_INTERFACE (self)->ask_goto_page (self); } /** * Show an overview of all slides */ void pdfpc_controllable_show_overview (pdfpcControllable* self) { g_return_if_fail (self != NULL); PDFPC_CONTROLLABLE_GET_INTERFACE (self)->show_overview (self); } /** * Hide the overview */ void pdfpc_controllable_hide_overview (pdfpcControllable* self) { g_return_if_fail (self != NULL); PDFPC_CONTROLLABLE_GET_INTERFACE (self)->hide_overview (self); } static void pdfpc_controllable_base_init (pdfpcControllableIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; } } /** * Every window or object which wants to be controlled by the * PresentationController needs to implement this interface. */ GType pdfpc_controllable_get_type (void) { static volatile gsize pdfpc_controllable_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_controllable_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcControllableIface), (GBaseInitFunc) pdfpc_controllable_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; GType pdfpc_controllable_type_id; pdfpc_controllable_type_id = g_type_register_static (G_TYPE_INTERFACE, "pdfpcControllable", &g_define_type_info, 0); g_type_interface_add_prerequisite (pdfpc_controllable_type_id, G_TYPE_OBJECT); g_once_init_leave (&pdfpc_controllable_type_id__volatile, pdfpc_controllable_type_id); } return pdfpc_controllable_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/interfaces/renderer/000077500000000000000000000000001177613036100213675ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/interfaces/renderer/caching.c000066400000000000000000000074541177613036100231410ustar00rootroot00000000000000/* caching.c generated by valac 0.16.0, the Vala compiler * generated from caching.vala, do not modify */ #include #include #define PDFPC_RENDERER_TYPE_CACHING (pdfpc_renderer_caching_get_type ()) #define PDFPC_RENDERER_CACHING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCaching)) #define PDFPC_RENDERER_IS_CACHING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_CACHING)) #define PDFPC_RENDERER_CACHING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCachingIface)) typedef struct _pdfpcRendererCaching pdfpcRendererCaching; typedef struct _pdfpcRendererCachingIface pdfpcRendererCachingIface; #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; struct _pdfpcRendererCachingIface { GTypeInterface parent_iface; void (*set_cache) (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* (*get_cache) (pdfpcRendererCaching* self); }; GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_caching_get_type (void) G_GNUC_CONST; void pdfpc_renderer_caching_set_cache (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* pdfpc_renderer_caching_get_cache (pdfpcRendererCaching* self); /** * Set a Cache store to be used for caching */ void pdfpc_renderer_caching_set_cache (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache) { g_return_if_fail (self != NULL); PDFPC_RENDERER_CACHING_GET_INTERFACE (self)->set_cache (self, cache); } /** * Retrieve the currently used cache store * * If no cache store is set null will be returned. */ pdfpcRendererCacheBase* pdfpc_renderer_caching_get_cache (pdfpcRendererCaching* self) { g_return_val_if_fail (self != NULL, NULL); return PDFPC_RENDERER_CACHING_GET_INTERFACE (self)->get_cache (self); } static void pdfpc_renderer_caching_base_init (pdfpcRendererCachingIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; } } /** * Every renderer may decide to implement the Caching interface to improve * rendering speed. */ GType pdfpc_renderer_caching_get_type (void) { static volatile gsize pdfpc_renderer_caching_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_renderer_caching_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcRendererCachingIface), (GBaseInitFunc) pdfpc_renderer_caching_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; GType pdfpc_renderer_caching_type_id; pdfpc_renderer_caching_type_id = g_type_register_static (G_TYPE_INTERFACE, "pdfpcRendererCaching", &g_define_type_info, 0); g_type_interface_add_prerequisite (pdfpc_renderer_caching_type_id, G_TYPE_OBJECT); g_once_init_leave (&pdfpc_renderer_caching_type_id__volatile, pdfpc_renderer_caching_type_id); } return pdfpc_renderer_caching_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/interfaces/view/000077500000000000000000000000001177613036100205335ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/interfaces/view/behaviour/000077500000000000000000000000001177613036100225175ustar00rootroot00000000000000davvil-pdfpc-074a3c6/c-src/interfaces/view/behaviour/decoratable.c000066400000000000000000000075011177613036100251330ustar00rootroot00000000000000/* decoratable.c generated by valac 0.16.0, the Vala compiler * generated from decoratable.vala, do not modify */ #include #include #define PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE (pdfpc_view_behaviour_decoratable_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_DECORATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE, pdfpcViewBehaviourDecoratable)) #define PDFPC_VIEW_BEHAVIOUR_IS_DECORATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE)) #define PDFPC_VIEW_BEHAVIOUR_DECORATABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE, pdfpcViewBehaviourDecoratableIface)) typedef struct _pdfpcViewBehaviourDecoratable pdfpcViewBehaviourDecoratable; typedef struct _pdfpcViewBehaviourDecoratableIface pdfpcViewBehaviourDecoratableIface; #define PDFPC_VIEW_BEHAVIOUR_TYPE_BASE (pdfpc_view_behaviour_base_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBase)) #define PDFPC_VIEW_BEHAVIOUR_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) typedef struct _pdfpcViewBehaviourBase pdfpcViewBehaviourBase; typedef struct _pdfpcViewBehaviourBaseClass pdfpcViewBehaviourBaseClass; struct _pdfpcViewBehaviourDecoratableIface { GTypeInterface parent_iface; void (*associate_behaviour) (pdfpcViewBehaviourDecoratable* self, pdfpcViewBehaviourBase* behaviour); }; GType pdfpc_view_behaviour_base_get_type (void) G_GNUC_CONST; GType pdfpc_view_behaviour_decoratable_get_type (void) G_GNUC_CONST; void pdfpc_view_behaviour_decoratable_associate_behaviour (pdfpcViewBehaviourDecoratable* self, pdfpcViewBehaviourBase* behaviour); /** * Associate a new Behaviour with this Decoratable * * The implementation needs to support an arbitrary amount of different * behaviours. */ void pdfpc_view_behaviour_decoratable_associate_behaviour (pdfpcViewBehaviourDecoratable* self, pdfpcViewBehaviourBase* behaviour) { g_return_if_fail (self != NULL); PDFPC_VIEW_BEHAVIOUR_DECORATABLE_GET_INTERFACE (self)->associate_behaviour (self, behaviour); } static void pdfpc_view_behaviour_decoratable_base_init (pdfpcViewBehaviourDecoratableIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; } } /** * Every View which supports Behaviours needs to implement this interface. * * A Behaviour is a certain characteristic which is added to an existing * View on demand. */ GType pdfpc_view_behaviour_decoratable_get_type (void) { static volatile gsize pdfpc_view_behaviour_decoratable_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_view_behaviour_decoratable_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcViewBehaviourDecoratableIface), (GBaseInitFunc) pdfpc_view_behaviour_decoratable_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; GType pdfpc_view_behaviour_decoratable_type_id; pdfpc_view_behaviour_decoratable_type_id = g_type_register_static (G_TYPE_INTERFACE, "pdfpcViewBehaviourDecoratable", &g_define_type_info, 0); g_once_init_leave (&pdfpc_view_behaviour_decoratable_type_id__volatile, pdfpc_view_behaviour_decoratable_type_id); } return pdfpc_view_behaviour_decoratable_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/interfaces/view/prerendering.c000066400000000000000000000057631177613036100233760ustar00rootroot00000000000000/* prerendering.c generated by valac 0.16.0, the Vala compiler * generated from prerendering.vala, do not modify */ #include #include #define PDFPC_VIEW_TYPE_PRERENDERING (pdfpc_view_prerendering_get_type ()) #define PDFPC_VIEW_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerendering)) #define PDFPC_VIEW_IS_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PRERENDERING)) #define PDFPC_VIEW_PRERENDERING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerenderingIface)) typedef struct _pdfpcViewPrerendering pdfpcViewPrerendering; typedef struct _pdfpcViewPrerenderingIface pdfpcViewPrerenderingIface; struct _pdfpcViewPrerenderingIface { GTypeInterface parent_iface; }; GType pdfpc_view_prerendering_get_type (void) G_GNUC_CONST; static void pdfpc_view_prerendering_base_init (pdfpcViewPrerenderingIface * iface) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; /** * Signal emitted every time a precached slide has been created * * This signal should be emitted slide_count number of times during a * precaching cylce. */ g_signal_new ("slide_prerendered", PDFPC_VIEW_TYPE_PRERENDERING, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); /** * Signal emitted when the precaching cycle is complete */ g_signal_new ("prerendering_completed", PDFPC_VIEW_TYPE_PRERENDERING, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); /** * Signal emitted when the precaching cycle just started */ g_signal_new ("prerendering_started", PDFPC_VIEW_TYPE_PRERENDERING, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); } } /** * Every View may implement this interface to allow prerendering of slides * for display speed improvements. If however a renderer is used with the * view, which does not implement the Renderer.Caching interface the * prerender functionallity can't be used. */ GType pdfpc_view_prerendering_get_type (void) { static volatile gsize pdfpc_view_prerendering_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_view_prerendering_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcViewPrerenderingIface), (GBaseInitFunc) pdfpc_view_prerendering_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL }; GType pdfpc_view_prerendering_type_id; pdfpc_view_prerendering_type_id = g_type_register_static (G_TYPE_INTERFACE, "pdfpcViewPrerendering", &g_define_type_info, 0); g_type_interface_add_prerequisite (pdfpc_view_prerendering_type_id, G_TYPE_OBJECT); g_once_init_leave (&pdfpc_view_prerendering_type_id__volatile, pdfpc_view_prerendering_type_id); } return pdfpc_view_prerendering_type_id__volatile; } davvil-pdfpc-074a3c6/c-src/pdfpc.in000066400000000000000000001010071177613036100170610ustar00rootroot00000000000000/* pdfpc.c generated by valac 0.16.0, the Vala compiler * generated from pdfpc.vala, do not modify */ #include #include #include #include #include #include #include #define PDFPC_TYPE_APPLICATION (pdfpc_application_get_type ()) #define PDFPC_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_APPLICATION, pdfpcApplication)) #define PDFPC_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_APPLICATION, pdfpcApplicationClass)) #define PDFPC_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_APPLICATION)) #define PDFPC_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_APPLICATION)) #define PDFPC_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_APPLICATION, pdfpcApplicationClass)) typedef struct _pdfpcApplication pdfpcApplication; typedef struct _pdfpcApplicationClass pdfpcApplicationClass; typedef struct _pdfpcApplicationPrivate pdfpcApplicationPrivate; #define PDFPC_WINDOW_TYPE_FULLSCREEN (pdfpc_window_fullscreen_get_type ()) #define PDFPC_WINDOW_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreen)) #define PDFPC_WINDOW_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) #define PDFPC_WINDOW_IS_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_IS_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_FULLSCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) typedef struct _pdfpcWindowFullscreen pdfpcWindowFullscreen; typedef struct _pdfpcWindowFullscreenClass pdfpcWindowFullscreenClass; #define PDFPC_WINDOW_TYPE_PRESENTATION (pdfpc_window_presentation_get_type ()) #define PDFPC_WINDOW_PRESENTATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentation)) #define PDFPC_WINDOW_PRESENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentationClass)) #define PDFPC_WINDOW_IS_PRESENTATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_PRESENTATION)) #define PDFPC_WINDOW_IS_PRESENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_PRESENTATION)) #define PDFPC_WINDOW_PRESENTATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentationClass)) typedef struct _pdfpcWindowPresentation pdfpcWindowPresentation; typedef struct _pdfpcWindowPresentationClass pdfpcWindowPresentationClass; #define PDFPC_WINDOW_TYPE_PRESENTER (pdfpc_window_presenter_get_type ()) #define PDFPC_WINDOW_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenter)) #define PDFPC_WINDOW_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass)) #define PDFPC_WINDOW_IS_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_PRESENTER)) #define PDFPC_WINDOW_IS_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_PRESENTER)) #define PDFPC_WINDOW_PRESENTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass)) typedef struct _pdfpcWindowPresenter pdfpcWindowPresenter; typedef struct _pdfpcWindowPresenterClass pdfpcWindowPresenterClass; #define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController)) #define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) #define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) typedef struct _pdfpcPresentationController pdfpcPresentationController; typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass; #define PDFPC_TYPE_CACHE_STATUS (pdfpc_cache_status_get_type ()) #define PDFPC_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatus)) #define PDFPC_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) #define PDFPC_IS_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_IS_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_CACHE_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) typedef struct _pdfpcCacheStatus pdfpcCacheStatus; typedef struct _pdfpcCacheStatusClass pdfpcCacheStatusClass; #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define _pdfpc_cache_status_unref0(var) ((var == NULL) ? NULL : (var = (pdfpc_cache_status_unref (var), NULL))) #define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL))) #define _g_free0(var) (var = (g_free (var), NULL)) #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; #define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ()) #define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf)) #define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) #define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf; typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass; #define PDFPC_TYPE_CONFIG_FILE_READER (pdfpc_config_file_reader_get_type ()) #define PDFPC_CONFIG_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CONFIG_FILE_READER, pdfpcConfigFileReader)) #define PDFPC_CONFIG_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_CONFIG_FILE_READER, pdfpcConfigFileReaderClass)) #define PDFPC_IS_CONFIG_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CONFIG_FILE_READER)) #define PDFPC_IS_CONFIG_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_CONFIG_FILE_READER)) #define PDFPC_CONFIG_FILE_READER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_CONFIG_FILE_READER, pdfpcConfigFileReaderClass)) typedef struct _pdfpcConfigFileReader pdfpcConfigFileReader; typedef struct _pdfpcConfigFileReaderClass pdfpcConfigFileReaderClass; #define PDFPC_TYPE_CONTROLLABLE (pdfpc_controllable_get_type ()) #define PDFPC_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllable)) #define PDFPC_IS_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CONTROLLABLE)) #define PDFPC_CONTROLLABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllableIface)) typedef struct _pdfpcControllable pdfpcControllable; typedef struct _pdfpcControllableIface pdfpcControllableIface; #define _pdfpc_config_file_reader_unref0(var) ((var == NULL) ? NULL : (var = (pdfpc_config_file_reader_unref (var), NULL))) struct _pdfpcApplication { GObject parent_instance; pdfpcApplicationPrivate * priv; }; struct _pdfpcApplicationClass { GObjectClass parent_class; }; struct _pdfpcApplicationPrivate { pdfpcWindowPresentation* presentation_window; pdfpcWindowPresenter* presenter_window; pdfpcPresentationController* controller; pdfpcCacheStatus* cache_status; }; struct _pdfpcControllableIface { GTypeInterface parent_iface; pdfpcPresentationController* (*get_controller) (pdfpcControllable* self); void (*update) (pdfpcControllable* self); void (*edit_note) (pdfpcControllable* self); void (*ask_goto_page) (pdfpcControllable* self); void (*show_overview) (pdfpcControllable* self); void (*hide_overview) (pdfpcControllable* self); }; static gpointer pdfpc_application_parent_class = NULL; extern guint pdfpc_options_duration; extern gchar* pdfpc_options_end_time; extern guint pdfpc_options_last_minutes; extern gchar* pdfpc_options_start_time; extern guint pdfpc_options_current_size; extern gint pdfpc_options_min_overview_width; extern gboolean pdfpc_options_display_switch; extern gboolean pdfpc_options_disable_caching; extern gboolean pdfpc_options_disable_cache_compression; extern gboolean pdfpc_options_black_on_end; extern gboolean pdfpc_options_single_screen; extern gboolean pdfpc_options_list_actions; extern gboolean pdfpc_options_windowed; GType pdfpc_application_get_type (void) G_GNUC_CONST; GType pdfpc_window_fullscreen_get_type (void) G_GNUC_CONST; GType pdfpc_window_presentation_get_type (void) G_GNUC_CONST; GType pdfpc_window_presenter_get_type (void) G_GNUC_CONST; GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST; gpointer pdfpc_cache_status_ref (gpointer instance); void pdfpc_cache_status_unref (gpointer instance); GParamSpec* pdfpc_param_spec_cache_status (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_value_set_cache_status (GValue* value, gpointer v_object); void pdfpc_value_take_cache_status (GValue* value, gpointer v_object); gpointer pdfpc_value_get_cache_status (const GValue* value); GType pdfpc_cache_status_get_type (void) G_GNUC_CONST; #define PDFPC_APPLICATION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PDFPC_TYPE_APPLICATION, pdfpcApplicationPrivate)) enum { PDFPC_APPLICATION_DUMMY_PROPERTY }; gchar* pdfpc_application_parse_command_line_options (pdfpcApplication* self, gchar** args, int args_length1); GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST; static pdfpcWindowPresenter* pdfpc_application_create_presenter_window (pdfpcApplication* self, pdfpcMetadataPdf* metadata, gint monitor); pdfpcWindowPresenter* pdfpc_window_presenter_new (pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); pdfpcWindowPresenter* pdfpc_window_presenter_construct (GType object_type, pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); void pdfpc_window_presenter_set_cache_observer (pdfpcWindowPresenter* self, pdfpcCacheStatus* observer); static pdfpcWindowPresentation* pdfpc_application_create_presentation_window (pdfpcApplication* self, pdfpcMetadataPdf* metadata, gint monitor); pdfpcWindowPresentation* pdfpc_window_presentation_new (pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); pdfpcWindowPresentation* pdfpc_window_presentation_construct (GType object_type, pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); void pdfpc_window_presentation_set_cache_observer (pdfpcWindowPresentation* self, pdfpcCacheStatus* observer); void pdfpc_application_run (pdfpcApplication* self, gchar** args, int args_length1); gchar** pdfpc_presentation_controller_getActionDescriptions (int* result_length1); void pdfpc_mutex_locks_init (void); pdfpcMetadataPdf* pdfpc_metadata_pdf_new (const gchar* fname); pdfpcMetadataPdf* pdfpc_metadata_pdf_construct (GType object_type, const gchar* fname); void pdfpc_metadata_pdf_set_duration (pdfpcMetadataPdf* self, guint d); pdfpcPresentationController* pdfpc_presentation_controller_new (pdfpcMetadataPdf* metadata, gboolean allow_black_on_end); pdfpcPresentationController* pdfpc_presentation_controller_construct (GType object_type, pdfpcMetadataPdf* metadata, gboolean allow_black_on_end); pdfpcCacheStatus* pdfpc_cache_status_new (void); pdfpcCacheStatus* pdfpc_cache_status_construct (GType object_type); pdfpcConfigFileReader* pdfpc_config_file_reader_new (pdfpcPresentationController* controller); pdfpcConfigFileReader* pdfpc_config_file_reader_construct (GType object_type, pdfpcPresentationController* controller); gpointer pdfpc_config_file_reader_ref (gpointer instance); void pdfpc_config_file_reader_unref (gpointer instance); GParamSpec* pdfpc_param_spec_config_file_reader (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_value_set_config_file_reader (GValue* value, gpointer v_object); void pdfpc_value_take_config_file_reader (GValue* value, gpointer v_object); gpointer pdfpc_value_get_config_file_reader (const GValue* value); GType pdfpc_config_file_reader_get_type (void) G_GNUC_CONST; void pdfpc_config_file_reader_readConfig (pdfpcConfigFileReader* self, const gchar* fname); #define etc_path "@SYSCONFDIR@" GType pdfpc_controllable_get_type (void) G_GNUC_CONST; void pdfpc_controllable_update (pdfpcControllable* self); gint pdfpc_application_main (gchar** args, int args_length1); pdfpcApplication* pdfpc_application_new (void); pdfpcApplication* pdfpc_application_construct (GType object_type); static void pdfpc_application_finalize (GObject* obj); static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); static const GOptionEntry PDFPC_APPLICATION_options[14] = {{"duration", 'd', 0, G_OPTION_ARG_INT, &pdfpc_options_duration, "Duration in minutes of the presentation used for timer display.", "N"}, {"end-time", 'e', 0, G_OPTION_ARG_STRING, &pdfpc_options_end_time, "End time of the presentation. (Format: HH:MM (24h))", "T"}, {"last-minutes", 'l', 0, G_OPTION_ARG_INT, &pdfpc_options_last_minutes, "Time in minutes, from which on the timer changes its color. (Default 5" \ " minutes)", "N"}, {"start-time", 't', 0, G_OPTION_ARG_STRING, &pdfpc_options_start_time, "Start time of the presentation to be used as a countdown. (Format: HH:" \ "MM (24h))", "T"}, {"current-size", 'u', 0, G_OPTION_ARG_INT, &pdfpc_options_current_size, "Percentage of the presenter screen to be used for the current slide. (" \ "Default 60)", "N"}, {"overview-min-size", 'o', 0, G_OPTION_ARG_INT, &pdfpc_options_min_overview_width, "Minimum width for the overview miniatures, in pixels. (Default 150)", "N"}, {"switch-screens", 's', 0, 0, &pdfpc_options_display_switch, "Switch the presentation and the presenter screen.", NULL}, {"disable-cache", 'c', 0, 0, &pdfpc_options_disable_caching, "Disable caching and pre-rendering of slides to save memory at the cost" \ " of speed.", NULL}, {"disable-compression", 'z', 0, 0, &pdfpc_options_disable_cache_compression, "Disable the compression of slide images to trade memory consumption fo" \ "r speed. (Avg. factor 30)", NULL}, {"black-on-end", 'b', 0, 0, &pdfpc_options_black_on_end, "Add an additional black slide at the end of the presentation", NULL}, {"single-screen", 'S', 0, 0, &pdfpc_options_single_screen, "Force to use only one screen", NULL}, {"list-actions", 'L', 0, 0, &pdfpc_options_list_actions, "List actions supported in the config file(s)", NULL}, {"windowed", 'w', 0, 0, &pdfpc_options_windowed, "Run in windowed mode (devel tool)", NULL}, {NULL}}; /** * Parse the commandline and apply all found options to there according * static class members. * * Returns the name of the pdf file to open (or null if not present) */ gchar* pdfpc_application_parse_command_line_options (pdfpcApplication* self, gchar** args, int args_length1) { gchar* result = NULL; GOptionContext* _tmp0_; GOptionContext* context; gchar** _tmp7_; gint _tmp7__length1; GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_option_context_new (""); context = _tmp0_; g_option_context_add_main_entries (context, PDFPC_APPLICATION_options, NULL); { g_option_context_parse (context, &args_length1, &args, &_inner_error_); if (_inner_error_ != NULL) { if (_inner_error_->domain == G_OPTION_ERROR) { goto __catch15_g_option_error; } _g_option_context_free0 (context); g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } } goto __finally15; __catch15_g_option_error: { GError* e = NULL; FILE* _tmp1_; GError* _tmp2_; const gchar* _tmp3_; FILE* _tmp4_; gchar* _tmp5_ = NULL; gchar* _tmp6_; e = _inner_error_; _inner_error_ = NULL; _tmp1_ = stderr; _tmp2_ = e; _tmp3_ = _tmp2_->message; fprintf (_tmp1_, "\n%s\n\n", _tmp3_); _tmp4_ = stderr; _tmp5_ = g_option_context_get_help (context, TRUE, NULL); _tmp6_ = _tmp5_; fprintf (_tmp4_, "%s", _tmp6_); _g_free0 (_tmp6_); exit (1); _g_error_free0 (e); } __finally15: if (_inner_error_ != NULL) { _g_option_context_free0 (context); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } _tmp7_ = args; _tmp7__length1 = args_length1; if (_tmp7__length1 < 2) { result = NULL; _g_option_context_free0 (context); return result; } else { gchar** _tmp8_; gint _tmp8__length1; const gchar* _tmp9_; gchar* _tmp10_; _tmp8_ = args; _tmp8__length1 = args_length1; _tmp9_ = _tmp8_[1]; _tmp10_ = g_strdup (_tmp9_); result = _tmp10_; _g_option_context_free0 (context); return result; } _g_option_context_free0 (context); } /** * Create and return a PresenterWindow using the specified monitor * while displaying the given file */ static pdfpcWindowPresenter* pdfpc_application_create_presenter_window (pdfpcApplication* self, pdfpcMetadataPdf* metadata, gint monitor) { pdfpcWindowPresenter* result = NULL; pdfpcMetadataPdf* _tmp0_; gint _tmp1_; pdfpcPresentationController* _tmp2_; pdfpcWindowPresenter* _tmp3_; pdfpcWindowPresenter* _tmp4_; pdfpcWindowPresenter* presenter_window; pdfpcCacheStatus* _tmp5_; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (metadata != NULL, NULL); _tmp0_ = metadata; _tmp1_ = monitor; _tmp2_ = self->priv->controller; _tmp3_ = pdfpc_window_presenter_new (_tmp0_, _tmp1_, _tmp2_); _tmp4_ = g_object_ref_sink (_tmp3_); presenter_window = _tmp4_; _tmp5_ = self->priv->cache_status; pdfpc_window_presenter_set_cache_observer (presenter_window, _tmp5_); result = presenter_window; return result; } /** * Create and return a PresentationWindow using the specified monitor * while displaying the given file */ static pdfpcWindowPresentation* pdfpc_application_create_presentation_window (pdfpcApplication* self, pdfpcMetadataPdf* metadata, gint monitor) { pdfpcWindowPresentation* result = NULL; pdfpcMetadataPdf* _tmp0_; gint _tmp1_; pdfpcPresentationController* _tmp2_; pdfpcWindowPresentation* _tmp3_; pdfpcWindowPresentation* _tmp4_; pdfpcWindowPresentation* presentation_window; pdfpcCacheStatus* _tmp5_; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (metadata != NULL, NULL); _tmp0_ = metadata; _tmp1_ = monitor; _tmp2_ = self->priv->controller; _tmp3_ = pdfpc_window_presentation_new (_tmp0_, _tmp1_, _tmp2_); _tmp4_ = g_object_ref_sink (_tmp3_); presentation_window = _tmp4_; _tmp5_ = self->priv->cache_status; pdfpc_window_presentation_set_cache_observer (presentation_window, _tmp5_); result = presentation_window; return result; } /** * Main application function, which instantiates the windows and * initializes the Gtk system. */ static gpointer _g_object_ref0 (gpointer self) { return self ? g_object_ref (self) : NULL; } void pdfpc_application_run (pdfpcApplication* self, gchar** args, int args_length1) { FILE* _tmp0_; gchar** _tmp1_; gint _tmp1__length1; gchar* _tmp2_ = NULL; gchar* pdfFilename; gboolean _tmp3_; const gchar* _tmp28_; FILE* _tmp30_; const gchar* _tmp31_; pdfpcMetadataPdf* _tmp32_; pdfpcMetadataPdf* metadata; guint _tmp33_; pdfpcMetadataPdf* _tmp36_; gboolean _tmp37_; pdfpcPresentationController* _tmp38_; pdfpcCacheStatus* _tmp39_; pdfpcPresentationController* _tmp40_; pdfpcConfigFileReader* _tmp41_; pdfpcConfigFileReader* configFileReader; pdfpcConfigFileReader* _tmp42_; pdfpcConfigFileReader* _tmp43_; const gchar* _tmp44_ = NULL; gchar* _tmp45_; gchar* _tmp46_; GdkScreen* _tmp47_ = NULL; GdkScreen* _tmp48_; GdkScreen* screen; gboolean _tmp49_ = FALSE; gboolean _tmp50_ = FALSE; gboolean _tmp51_; gboolean _tmp53_; gboolean _tmp56_; pdfpcWindowPresentation* _tmp82_; pdfpcWindowPresenter* _tmp85_; g_return_if_fail (self != NULL); _tmp0_ = stdout; fprintf (_tmp0_, "%s", "pdfpc v3.1.1\n" "(C) 2012 David Vilar\n" "(C) 2009-2011 Jakob Westhoff\n\n"); gdk_threads_init (); gtk_init (&args_length1, &args); _tmp1_ = args; _tmp1__length1 = args_length1; _tmp2_ = pdfpc_application_parse_command_line_options (self, _tmp1_, _tmp1__length1); pdfFilename = _tmp2_; _tmp3_ = pdfpc_options_list_actions; if (_tmp3_) { FILE* _tmp4_; gint _tmp5_ = 0; gchar** _tmp6_ = NULL; gchar** actions; gint actions_length1; gint _actions_size_; _tmp4_ = stdout; fprintf (_tmp4_, "Config file commands accepted by pdfpc:\n"); _tmp6_ = pdfpc_presentation_controller_getActionDescriptions (&_tmp5_); actions = _tmp6_; actions_length1 = _tmp5_; _actions_size_ = actions_length1; { gint i; i = 0; { gboolean _tmp7_; _tmp7_ = TRUE; while (TRUE) { gboolean _tmp8_; gint _tmp10_; gchar** _tmp11_; gint _tmp11__length1; gchar* _tmp12_; gchar* tabAlignment; gchar** _tmp13_; gint _tmp13__length1; gint _tmp14_; const gchar* _tmp15_; gint _tmp16_; gint _tmp17_; FILE* _tmp20_; gchar** _tmp21_; gint _tmp21__length1; gint _tmp22_; const gchar* _tmp23_; const gchar* _tmp24_; gchar** _tmp25_; gint _tmp25__length1; gint _tmp26_; const gchar* _tmp27_; _tmp8_ = _tmp7_; if (!_tmp8_) { gint _tmp9_; _tmp9_ = i; i = _tmp9_ + 2; } _tmp7_ = FALSE; _tmp10_ = i; _tmp11_ = actions; _tmp11__length1 = actions_length1; if (!(_tmp10_ < _tmp11__length1)) { break; } _tmp12_ = g_strdup ("\t"); tabAlignment = _tmp12_; _tmp13_ = actions; _tmp13__length1 = actions_length1; _tmp14_ = i; _tmp15_ = _tmp13_[_tmp14_]; _tmp16_ = strlen (_tmp15_); _tmp17_ = _tmp16_; if (_tmp17_ < 8) { const gchar* _tmp18_; gchar* _tmp19_; _tmp18_ = tabAlignment; _tmp19_ = g_strconcat (_tmp18_, "\t", NULL); _g_free0 (tabAlignment); tabAlignment = _tmp19_; } _tmp20_ = stdout; _tmp21_ = actions; _tmp21__length1 = actions_length1; _tmp22_ = i; _tmp23_ = _tmp21_[_tmp22_]; _tmp24_ = tabAlignment; _tmp25_ = actions; _tmp25__length1 = actions_length1; _tmp26_ = i; _tmp27_ = _tmp25_[_tmp26_ + 1]; fprintf (_tmp20_, "\t%s%s=> %s\n", _tmp23_, _tmp24_, _tmp27_); _g_free0 (tabAlignment); } } } actions = (_vala_array_free (actions, actions_length1, (GDestroyNotify) g_free), NULL); _g_free0 (pdfFilename); return; } _tmp28_ = pdfFilename; if (_tmp28_ == NULL) { FILE* _tmp29_; _tmp29_ = stderr; fprintf (_tmp29_, "Error: No pdf file given\n"); exit (1); } pdfpc_mutex_locks_init (); _tmp30_ = stdout; fprintf (_tmp30_, "Initializing rendering...\n"); _tmp31_ = pdfFilename; _tmp32_ = pdfpc_metadata_pdf_new (_tmp31_); metadata = _tmp32_; _tmp33_ = pdfpc_options_duration; if (_tmp33_ != 987654321U) { pdfpcMetadataPdf* _tmp34_; guint _tmp35_; _tmp34_ = metadata; _tmp35_ = pdfpc_options_duration; pdfpc_metadata_pdf_set_duration (_tmp34_, _tmp35_); } _tmp36_ = metadata; _tmp37_ = pdfpc_options_black_on_end; _tmp38_ = pdfpc_presentation_controller_new (_tmp36_, _tmp37_); _g_object_unref0 (self->priv->controller); self->priv->controller = _tmp38_; _tmp39_ = pdfpc_cache_status_new (); _pdfpc_cache_status_unref0 (self->priv->cache_status); self->priv->cache_status = _tmp39_; _tmp40_ = self->priv->controller; _tmp41_ = pdfpc_config_file_reader_new (_tmp40_); configFileReader = _tmp41_; _tmp42_ = configFileReader; pdfpc_config_file_reader_readConfig (_tmp42_, etc_path "/pdfpcrc"); _tmp43_ = configFileReader; _tmp44_ = g_get_home_dir (); _tmp45_ = g_strconcat (_tmp44_, "/.pdfpcrc", NULL); _tmp46_ = _tmp45_; pdfpc_config_file_reader_readConfig (_tmp43_, _tmp46_); _g_free0 (_tmp46_); _tmp47_ = gdk_screen_get_default (); _tmp48_ = _g_object_ref0 (_tmp47_); screen = _tmp48_; _tmp51_ = pdfpc_options_windowed; if (!_tmp51_) { gboolean _tmp52_; _tmp52_ = pdfpc_options_single_screen; _tmp50_ = !_tmp52_; } else { _tmp50_ = FALSE; } _tmp53_ = _tmp50_; if (_tmp53_) { GdkScreen* _tmp54_; gint _tmp55_ = 0; _tmp54_ = screen; _tmp55_ = gdk_screen_get_n_monitors (_tmp54_); _tmp49_ = _tmp55_ > 1; } else { _tmp49_ = FALSE; } _tmp56_ = _tmp49_; if (_tmp56_) { gint presenter_monitor = 0; gint presentation_monitor = 0; gboolean _tmp57_; gint _tmp62_; pdfpcMetadataPdf* _tmp63_; gint _tmp64_; pdfpcWindowPresentation* _tmp65_ = NULL; pdfpcMetadataPdf* _tmp66_; gint _tmp67_; pdfpcWindowPresenter* _tmp68_ = NULL; _tmp57_ = pdfpc_options_display_switch; if (_tmp57_ != TRUE) { GdkScreen* _tmp58_; gint _tmp59_ = 0; _tmp58_ = screen; _tmp59_ = gdk_screen_get_primary_monitor (_tmp58_); presenter_monitor = _tmp59_; } else { GdkScreen* _tmp60_; gint _tmp61_ = 0; _tmp60_ = screen; _tmp61_ = gdk_screen_get_primary_monitor (_tmp60_); presenter_monitor = (_tmp61_ + 1) % 2; } _tmp62_ = presenter_monitor; presentation_monitor = (_tmp62_ + 1) % 2; _tmp63_ = metadata; _tmp64_ = presentation_monitor; _tmp65_ = pdfpc_application_create_presentation_window (self, _tmp63_, _tmp64_); _g_object_unref0 (self->priv->presentation_window); self->priv->presentation_window = _tmp65_; _tmp66_ = metadata; _tmp67_ = presenter_monitor; _tmp68_ = pdfpc_application_create_presenter_window (self, _tmp66_, _tmp67_); _g_object_unref0 (self->priv->presenter_window); self->priv->presenter_window = _tmp68_; } else { gboolean _tmp69_ = FALSE; gboolean _tmp70_; gboolean _tmp72_; _tmp70_ = pdfpc_options_windowed; if (_tmp70_) { gboolean _tmp71_; _tmp71_ = pdfpc_options_single_screen; _tmp69_ = !_tmp71_; } else { _tmp69_ = FALSE; } _tmp72_ = _tmp69_; if (_tmp72_) { pdfpcMetadataPdf* _tmp73_; pdfpcWindowPresenter* _tmp74_ = NULL; pdfpcMetadataPdf* _tmp75_; pdfpcWindowPresentation* _tmp76_ = NULL; _tmp73_ = metadata; _tmp74_ = pdfpc_application_create_presenter_window (self, _tmp73_, -1); _g_object_unref0 (self->priv->presenter_window); self->priv->presenter_window = _tmp74_; _tmp75_ = metadata; _tmp76_ = pdfpc_application_create_presentation_window (self, _tmp75_, -1); _g_object_unref0 (self->priv->presentation_window); self->priv->presentation_window = _tmp76_; } else { gboolean _tmp77_; _tmp77_ = pdfpc_options_display_switch; if (!_tmp77_) { pdfpcMetadataPdf* _tmp78_; pdfpcWindowPresenter* _tmp79_ = NULL; _tmp78_ = metadata; _tmp79_ = pdfpc_application_create_presenter_window (self, _tmp78_, -1); _g_object_unref0 (self->priv->presenter_window); self->priv->presenter_window = _tmp79_; } else { pdfpcMetadataPdf* _tmp80_; pdfpcWindowPresentation* _tmp81_ = NULL; _tmp80_ = metadata; _tmp81_ = pdfpc_application_create_presentation_window (self, _tmp80_, -1); _g_object_unref0 (self->priv->presentation_window); self->priv->presentation_window = _tmp81_; } } } _tmp82_ = self->priv->presentation_window; if (_tmp82_ != NULL) { pdfpcWindowPresentation* _tmp83_; pdfpcWindowPresentation* _tmp84_; _tmp83_ = self->priv->presentation_window; gtk_widget_show_all ((GtkWidget*) _tmp83_); _tmp84_ = self->priv->presentation_window; pdfpc_controllable_update ((pdfpcControllable*) _tmp84_); } _tmp85_ = self->priv->presenter_window; if (_tmp85_ != NULL) { pdfpcWindowPresenter* _tmp86_; pdfpcWindowPresenter* _tmp87_; _tmp86_ = self->priv->presenter_window; gtk_widget_show_all ((GtkWidget*) _tmp86_); _tmp87_ = self->priv->presenter_window; pdfpc_controllable_update ((pdfpcControllable*) _tmp87_); } gdk_threads_enter (); gtk_main (); gdk_threads_leave (); _g_object_unref0 (screen); _pdfpc_config_file_reader_unref0 (configFileReader); _g_object_unref0 (metadata); _g_free0 (pdfFilename); } /** * Basic application entry point */ gint pdfpc_application_main (gchar** args, int args_length1) { gint result = 0; pdfpcApplication* _tmp0_; pdfpcApplication* application; gchar** _tmp1_; gint _tmp1__length1; _tmp0_ = pdfpc_application_new (); application = _tmp0_; _tmp1_ = args; _tmp1__length1 = args_length1; pdfpc_application_run (application, _tmp1_, _tmp1__length1); result = 0; _g_object_unref0 (application); return result; } int main (int argc, char ** argv) { g_type_init (); return pdfpc_application_main (argv, argc); } pdfpcApplication* pdfpc_application_construct (GType object_type) { pdfpcApplication * self = NULL; self = (pdfpcApplication*) g_object_new (object_type, NULL); return self; } pdfpcApplication* pdfpc_application_new (void) { return pdfpc_application_construct (PDFPC_TYPE_APPLICATION); } static void pdfpc_application_class_init (pdfpcApplicationClass * klass) { pdfpc_application_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (pdfpcApplicationPrivate)); G_OBJECT_CLASS (klass)->finalize = pdfpc_application_finalize; } static void pdfpc_application_instance_init (pdfpcApplication * self) { self->priv = PDFPC_APPLICATION_GET_PRIVATE (self); } static void pdfpc_application_finalize (GObject* obj) { pdfpcApplication * self; self = PDFPC_APPLICATION (obj); _g_object_unref0 (self->priv->presentation_window); _g_object_unref0 (self->priv->presenter_window); _g_object_unref0 (self->priv->controller); _pdfpc_cache_status_unref0 (self->priv->cache_status); G_OBJECT_CLASS (pdfpc_application_parent_class)->finalize (obj); } /** * Pdf Presenter Console main application class * * This class contains the main method as well as all the logic needed for * initializing the application, like commandline parsing and window creation. */ GType pdfpc_application_get_type (void) { static volatile gsize pdfpc_application_type_id__volatile = 0; if (g_once_init_enter (&pdfpc_application_type_id__volatile)) { static const GTypeInfo g_define_type_info = { sizeof (pdfpcApplicationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_application_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcApplication), 0, (GInstanceInitFunc) pdfpc_application_instance_init, NULL }; GType pdfpc_application_type_id; pdfpc_application_type_id = g_type_register_static (G_TYPE_OBJECT, "pdfpcApplication", &g_define_type_info, 0); g_once_init_leave (&pdfpc_application_type_id__volatile, pdfpc_application_type_id); } return pdfpc_application_type_id__volatile; } static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { if ((array != NULL) && (destroy_func != NULL)) { int i; for (i = 0; i < array_length; i = i + 1) { if (((gpointer*) array)[i] != NULL) { destroy_func (((gpointer*) array)[i]); } } } } static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { _vala_array_destroy (array, array_length, destroy_func); g_free (array); } davvil-pdfpc-074a3c6/c-src/presenter.h000066400000000000000000002175551177613036100176350ustar00rootroot00000000000000/* presenter.h generated by valac 0.16.0, the Vala compiler, do not modify */ #ifndef __C_SRC_PRESENTER_H__ #define __C_SRC_PRESENTER_H__ #include #include #include #include #include #include #include #include #include #include #include G_BEGIN_DECLS #define PDFPC_TYPE_CACHE_STATUS (pdfpc_cache_status_get_type ()) #define PDFPC_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatus)) #define PDFPC_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) #define PDFPC_IS_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_IS_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_CACHE_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) typedef struct _pdfpcCacheStatus pdfpcCacheStatus; typedef struct _pdfpcCacheStatusClass pdfpcCacheStatusClass; typedef struct _pdfpcCacheStatusPrivate pdfpcCacheStatusPrivate; #define PDFPC_VIEW_TYPE_PRERENDERING (pdfpc_view_prerendering_get_type ()) #define PDFPC_VIEW_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerendering)) #define PDFPC_VIEW_IS_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PRERENDERING)) #define PDFPC_VIEW_PRERENDERING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerenderingIface)) typedef struct _pdfpcViewPrerendering pdfpcViewPrerendering; typedef struct _pdfpcViewPrerenderingIface pdfpcViewPrerenderingIface; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; typedef struct _pdfpcMetadataBasePrivate pdfpcMetadataBasePrivate; #define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ()) #define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf)) #define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) #define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf; typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass; typedef struct _pdfpcMetadataPdfPrivate pdfpcMetadataPdfPrivate; #define PDFPC_TYPE_SLIDES_NOTES (pdfpc_slides_notes_get_type ()) #define PDFPC_SLIDES_NOTES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notes)) #define PDFPC_SLIDES_NOTES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notesClass)) #define PDFPC_IS_SLIDES_NOTES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_SLIDES_NOTES)) #define PDFPC_IS_SLIDES_NOTES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_SLIDES_NOTES)) #define PDFPC_SLIDES_NOTES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notesClass)) typedef struct _pdfpcslides_notes pdfpcslides_notes; typedef struct _pdfpcslides_notesClass pdfpcslides_notesClass; typedef struct _pdfpcslides_notesPrivate pdfpcslides_notesPrivate; #define PDFPC_TYPE_MUTEX_LOCKS (pdfpc_mutex_locks_get_type ()) #define PDFPC_MUTEX_LOCKS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_MUTEX_LOCKS, pdfpcMutexLocks)) #define PDFPC_MUTEX_LOCKS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_MUTEX_LOCKS, pdfpcMutexLocksClass)) #define PDFPC_IS_MUTEX_LOCKS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_MUTEX_LOCKS)) #define PDFPC_IS_MUTEX_LOCKS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_MUTEX_LOCKS)) #define PDFPC_MUTEX_LOCKS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_MUTEX_LOCKS, pdfpcMutexLocksClass)) typedef struct _pdfpcMutexLocks pdfpcMutexLocks; typedef struct _pdfpcMutexLocksClass pdfpcMutexLocksClass; typedef struct _pdfpcMutexLocksPrivate pdfpcMutexLocksPrivate; #define PDFPC_TYPE_OPTIONS (pdfpc_options_get_type ()) #define PDFPC_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_OPTIONS, pdfpcOptions)) #define PDFPC_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_OPTIONS, pdfpcOptionsClass)) #define PDFPC_IS_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_OPTIONS)) #define PDFPC_IS_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_OPTIONS)) #define PDFPC_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_OPTIONS, pdfpcOptionsClass)) typedef struct _pdfpcOptions pdfpcOptions; typedef struct _pdfpcOptionsClass pdfpcOptionsClass; typedef struct _pdfpcOptionsPrivate pdfpcOptionsPrivate; #define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController)) #define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) #define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) typedef struct _pdfpcPresentationController pdfpcPresentationController; typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass; typedef struct _pdfpcPresentationControllerPrivate pdfpcPresentationControllerPrivate; #define PDFPC_TYPE_CONTROLLABLE (pdfpc_controllable_get_type ()) #define PDFPC_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllable)) #define PDFPC_IS_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CONTROLLABLE)) #define PDFPC_CONTROLLABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllableIface)) typedef struct _pdfpcControllable pdfpcControllable; typedef struct _pdfpcControllableIface pdfpcControllableIface; #define PDFPC_WINDOW_TYPE_OVERVIEW (pdfpc_window_overview_get_type ()) #define PDFPC_WINDOW_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverview)) #define PDFPC_WINDOW_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass)) #define PDFPC_WINDOW_IS_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_OVERVIEW)) #define PDFPC_WINDOW_IS_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_OVERVIEW)) #define PDFPC_WINDOW_OVERVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass)) typedef struct _pdfpcWindowOverview pdfpcWindowOverview; typedef struct _pdfpcWindowOverviewClass pdfpcWindowOverviewClass; #define PDFPC_TYPE_TIMER_LABEL (pdfpc_timer_label_get_type ()) #define PDFPC_TIMER_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabel)) #define PDFPC_TIMER_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabelClass)) #define PDFPC_IS_TIMER_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_TIMER_LABEL)) #define PDFPC_IS_TIMER_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_TIMER_LABEL)) #define PDFPC_TIMER_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabelClass)) typedef struct _pdfpcTimerLabel pdfpcTimerLabel; typedef struct _pdfpcTimerLabelClass pdfpcTimerLabelClass; #define PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION (pdfpc_presentation_controller_key_action_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, pdfpcPresentationControllerKeyAction)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, pdfpcPresentationControllerKeyActionClass)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, pdfpcPresentationControllerKeyActionClass)) typedef struct _pdfpcPresentationControllerKeyAction pdfpcPresentationControllerKeyAction; typedef struct _pdfpcPresentationControllerKeyActionClass pdfpcPresentationControllerKeyActionClass; #define PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF (pdfpc_presentation_controller_key_def_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER_KEY_DEF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, pdfpcPresentationControllerKeyDef)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_DEF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, pdfpcPresentationControllerKeyDefClass)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_DEF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_DEF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_DEF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, pdfpcPresentationControllerKeyDefClass)) typedef struct _pdfpcPresentationControllerKeyDef pdfpcPresentationControllerKeyDef; typedef struct _pdfpcPresentationControllerKeyDefClass pdfpcPresentationControllerKeyDefClass; typedef struct _pdfpcPresentationControllerKeyActionPrivate pdfpcPresentationControllerKeyActionPrivate; typedef struct _pdfpcPresentationControllerKeyDefPrivate pdfpcPresentationControllerKeyDefPrivate; #define PDFPC_RENDERER_TYPE_BASE (pdfpc_renderer_base_get_type ()) #define PDFPC_RENDERER_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBase)) #define PDFPC_RENDERER_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) #define PDFPC_RENDERER_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) typedef struct _pdfpcRendererBase pdfpcRendererBase; typedef struct _pdfpcRendererBaseClass pdfpcRendererBaseClass; typedef struct _pdfpcRendererBasePrivate pdfpcRendererBasePrivate; #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; typedef struct _pdfpcRendererCacheBasePrivate pdfpcRendererCacheBasePrivate; #define PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY (pdfpc_renderer_cache_option_factory_get_type ()) #define PDFPC_RENDERER_CACHE_OPTION_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactory)) #define PDFPC_RENDERER_CACHE_OPTION_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactoryClass)) #define PDFPC_RENDERER_CACHE_IS_OPTION_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY)) #define PDFPC_RENDERER_CACHE_IS_OPTION_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY)) #define PDFPC_RENDERER_CACHE_OPTION_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactoryClass)) typedef struct _pdfpcRendererCacheOptionFactory pdfpcRendererCacheOptionFactory; typedef struct _pdfpcRendererCacheOptionFactoryClass pdfpcRendererCacheOptionFactoryClass; typedef struct _pdfpcRendererCacheOptionFactoryPrivate pdfpcRendererCacheOptionFactoryPrivate; #define PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE (pdfpc_renderer_cache_png_engine_get_type ()) #define PDFPC_RENDERER_CACHE_PNG_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngine)) #define PDFPC_RENDERER_CACHE_PNG_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngineClass)) #define PDFPC_RENDERER_CACHE_PNG_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_PNG_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_PNG_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngineClass)) typedef struct _pdfpcRendererCachePNGEngine pdfpcRendererCachePNGEngine; typedef struct _pdfpcRendererCachePNGEngineClass pdfpcRendererCachePNGEngineClass; typedef struct _pdfpcRendererCachePNGEnginePrivate pdfpcRendererCachePNGEnginePrivate; #define PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM (pdfpc_renderer_cache_png_item_get_type ()) #define PDFPC_RENDERER_CACHE_PNG_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItem)) #define PDFPC_RENDERER_CACHE_PNG_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItemClass)) #define PDFPC_RENDERER_CACHE_PNG_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM)) #define PDFPC_RENDERER_CACHE_PNG_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM)) #define PDFPC_RENDERER_CACHE_PNG_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItemClass)) typedef struct _pdfpcRendererCachePNGItem pdfpcRendererCachePNGItem; typedef struct _pdfpcRendererCachePNGItemClass pdfpcRendererCachePNGItemClass; typedef struct _pdfpcRendererCachePNGItemPrivate pdfpcRendererCachePNGItemPrivate; #define PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE (pdfpc_renderer_cache_simple_engine_get_type ()) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngine)) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngineClass)) #define PDFPC_RENDERER_CACHE_SIMPLE_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_SIMPLE_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngineClass)) typedef struct _pdfpcRendererCacheSimpleEngine pdfpcRendererCacheSimpleEngine; typedef struct _pdfpcRendererCacheSimpleEngineClass pdfpcRendererCacheSimpleEngineClass; typedef struct _pdfpcRendererCacheSimpleEnginePrivate pdfpcRendererCacheSimpleEnginePrivate; #define PDFPC_RENDERER_TYPE_CACHING (pdfpc_renderer_caching_get_type ()) #define PDFPC_RENDERER_CACHING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCaching)) #define PDFPC_RENDERER_IS_CACHING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_CACHING)) #define PDFPC_RENDERER_CACHING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCachingIface)) typedef struct _pdfpcRendererCaching pdfpcRendererCaching; typedef struct _pdfpcRendererCachingIface pdfpcRendererCachingIface; #define PDFPC_RENDERER_TYPE_PDF (pdfpc_renderer_pdf_get_type ()) #define PDFPC_RENDERER_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdf)) #define PDFPC_RENDERER_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass)) #define PDFPC_RENDERER_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_PDF)) #define PDFPC_RENDERER_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_PDF)) #define PDFPC_RENDERER_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass)) typedef struct _pdfpcRendererPdf pdfpcRendererPdf; typedef struct _pdfpcRendererPdfClass pdfpcRendererPdfClass; typedef struct _pdfpcRendererPdfPrivate pdfpcRendererPdfPrivate; #define PDFPC_TYPE_SCALER (pdfpc_scaler_get_type ()) #define PDFPC_SCALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_SCALER, pdfpcScaler)) #define PDFPC_SCALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_SCALER, pdfpcScalerClass)) #define PDFPC_IS_SCALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_SCALER)) #define PDFPC_IS_SCALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_SCALER)) #define PDFPC_SCALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_SCALER, pdfpcScalerClass)) typedef struct _pdfpcScaler pdfpcScaler; typedef struct _pdfpcScalerClass pdfpcScalerClass; typedef struct _pdfpcScalerPrivate pdfpcScalerPrivate; typedef struct _pdfpcTimerLabelPrivate pdfpcTimerLabelPrivate; #define PDFPC_TYPE_COUNTDOWN_TIMER (pdfpc_countdown_timer_get_type ()) #define PDFPC_COUNTDOWN_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_COUNTDOWN_TIMER, pdfpcCountdownTimer)) #define PDFPC_COUNTDOWN_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_COUNTDOWN_TIMER, pdfpcCountdownTimerClass)) #define PDFPC_IS_COUNTDOWN_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_COUNTDOWN_TIMER)) #define PDFPC_IS_COUNTDOWN_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_COUNTDOWN_TIMER)) #define PDFPC_COUNTDOWN_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_COUNTDOWN_TIMER, pdfpcCountdownTimerClass)) typedef struct _pdfpcCountdownTimer pdfpcCountdownTimer; typedef struct _pdfpcCountdownTimerClass pdfpcCountdownTimerClass; typedef struct _pdfpcCountdownTimerPrivate pdfpcCountdownTimerPrivate; #define PDFPC_TYPE_END_TIME_TIMER (pdfpc_end_time_timer_get_type ()) #define PDFPC_END_TIME_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_END_TIME_TIMER, pdfpcEndTimeTimer)) #define PDFPC_END_TIME_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_END_TIME_TIMER, pdfpcEndTimeTimerClass)) #define PDFPC_IS_END_TIME_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_END_TIME_TIMER)) #define PDFPC_IS_END_TIME_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_END_TIME_TIMER)) #define PDFPC_END_TIME_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_END_TIME_TIMER, pdfpcEndTimeTimerClass)) typedef struct _pdfpcEndTimeTimer pdfpcEndTimeTimer; typedef struct _pdfpcEndTimeTimerClass pdfpcEndTimeTimerClass; typedef struct _pdfpcEndTimeTimerPrivate pdfpcEndTimeTimerPrivate; #define PDFPC_TYPE_COUNTUP_TIMER (pdfpc_countup_timer_get_type ()) #define PDFPC_COUNTUP_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_COUNTUP_TIMER, pdfpcCountupTimer)) #define PDFPC_COUNTUP_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_COUNTUP_TIMER, pdfpcCountupTimerClass)) #define PDFPC_IS_COUNTUP_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_COUNTUP_TIMER)) #define PDFPC_IS_COUNTUP_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_COUNTUP_TIMER)) #define PDFPC_COUNTUP_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_COUNTUP_TIMER, pdfpcCountupTimerClass)) typedef struct _pdfpcCountupTimer pdfpcCountupTimer; typedef struct _pdfpcCountupTimerClass pdfpcCountupTimerClass; typedef struct _pdfpcCountupTimerPrivate pdfpcCountupTimerPrivate; #define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ()) #define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase)) #define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) #define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) typedef struct _pdfpcViewBase pdfpcViewBase; typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass; typedef struct _pdfpcViewBasePrivate pdfpcViewBasePrivate; #define PDFPC_VIEW_BEHAVIOUR_TYPE_BASE (pdfpc_view_behaviour_base_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBase)) #define PDFPC_VIEW_BEHAVIOUR_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) typedef struct _pdfpcViewBehaviourBase pdfpcViewBehaviourBase; typedef struct _pdfpcViewBehaviourBaseClass pdfpcViewBehaviourBaseClass; typedef struct _pdfpcViewBehaviourBasePrivate pdfpcViewBehaviourBasePrivate; #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION (pdfpc_view_behaviour_pdf_link_implementation_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementation)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementationClass)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_IMPLEMENTATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_IMPLEMENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementationClass)) typedef struct _pdfpcViewBehaviourPdfLinkImplementation pdfpcViewBehaviourPdfLinkImplementation; typedef struct _pdfpcViewBehaviourPdfLinkImplementationClass pdfpcViewBehaviourPdfLinkImplementationClass; typedef struct _pdfpcViewBehaviourPdfLinkImplementationPrivate pdfpcViewBehaviourPdfLinkImplementationPrivate; #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER (pdfpc_view_behaviour_pdf_link_signal_provider_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProvider)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProviderClass)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_SIGNAL_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_SIGNAL_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProviderClass)) typedef struct _pdfpcViewBehaviourPdfLinkSignalProvider pdfpcViewBehaviourPdfLinkSignalProvider; typedef struct _pdfpcViewBehaviourPdfLinkSignalProviderClass pdfpcViewBehaviourPdfLinkSignalProviderClass; typedef struct _pdfpcViewBehaviourPdfLinkSignalProviderPrivate pdfpcViewBehaviourPdfLinkSignalProviderPrivate; #define PDFPC_VIEW_TYPE_DEFAULT (pdfpc_view_default_get_type ()) #define PDFPC_VIEW_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefault)) #define PDFPC_VIEW_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) #define PDFPC_VIEW_IS_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_IS_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) typedef struct _pdfpcViewDefault pdfpcViewDefault; typedef struct _pdfpcViewDefaultClass pdfpcViewDefaultClass; #define PDFPC_VIEW_TYPE_PDF (pdfpc_view_pdf_get_type ()) #define PDFPC_VIEW_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdf)) #define PDFPC_VIEW_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) #define PDFPC_VIEW_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) typedef struct _pdfpcViewPdf pdfpcViewPdf; typedef struct _pdfpcViewPdfClass pdfpcViewPdfClass; #define PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE (pdfpc_view_behaviour_decoratable_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_DECORATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE, pdfpcViewBehaviourDecoratable)) #define PDFPC_VIEW_BEHAVIOUR_IS_DECORATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE)) #define PDFPC_VIEW_BEHAVIOUR_DECORATABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE, pdfpcViewBehaviourDecoratableIface)) typedef struct _pdfpcViewBehaviourDecoratable pdfpcViewBehaviourDecoratable; typedef struct _pdfpcViewBehaviourDecoratableIface pdfpcViewBehaviourDecoratableIface; typedef struct _pdfpcViewDefaultPrivate pdfpcViewDefaultPrivate; typedef struct _pdfpcViewPdfPrivate pdfpcViewPdfPrivate; #define PDFPC_WINDOW_TYPE_FULLSCREEN (pdfpc_window_fullscreen_get_type ()) #define PDFPC_WINDOW_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreen)) #define PDFPC_WINDOW_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) #define PDFPC_WINDOW_IS_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_IS_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_FULLSCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) typedef struct _pdfpcWindowFullscreen pdfpcWindowFullscreen; typedef struct _pdfpcWindowFullscreenClass pdfpcWindowFullscreenClass; typedef struct _pdfpcWindowFullscreenPrivate pdfpcWindowFullscreenPrivate; typedef struct _pdfpcWindowOverviewPrivate pdfpcWindowOverviewPrivate; #define PDFPC_WINDOW_TYPE_PRESENTER (pdfpc_window_presenter_get_type ()) #define PDFPC_WINDOW_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenter)) #define PDFPC_WINDOW_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass)) #define PDFPC_WINDOW_IS_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_PRESENTER)) #define PDFPC_WINDOW_IS_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_PRESENTER)) #define PDFPC_WINDOW_PRESENTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass)) typedef struct _pdfpcWindowPresenter pdfpcWindowPresenter; typedef struct _pdfpcWindowPresenterClass pdfpcWindowPresenterClass; #define PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT (pdfpc_window_cell_renderer_highlight_get_type ()) #define PDFPC_WINDOW_CELL_RENDERER_HIGHLIGHT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT, pdfpcWindowCellRendererHighlight)) #define PDFPC_WINDOW_CELL_RENDERER_HIGHLIGHT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT, pdfpcWindowCellRendererHighlightClass)) #define PDFPC_WINDOW_IS_CELL_RENDERER_HIGHLIGHT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT)) #define PDFPC_WINDOW_IS_CELL_RENDERER_HIGHLIGHT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT)) #define PDFPC_WINDOW_CELL_RENDERER_HIGHLIGHT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT, pdfpcWindowCellRendererHighlightClass)) typedef struct _pdfpcWindowCellRendererHighlight pdfpcWindowCellRendererHighlight; typedef struct _pdfpcWindowCellRendererHighlightClass pdfpcWindowCellRendererHighlightClass; typedef struct _pdfpcWindowCellRendererHighlightPrivate pdfpcWindowCellRendererHighlightPrivate; #define PDFPC_WINDOW_TYPE_PRESENTATION (pdfpc_window_presentation_get_type ()) #define PDFPC_WINDOW_PRESENTATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentation)) #define PDFPC_WINDOW_PRESENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentationClass)) #define PDFPC_WINDOW_IS_PRESENTATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_PRESENTATION)) #define PDFPC_WINDOW_IS_PRESENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_PRESENTATION)) #define PDFPC_WINDOW_PRESENTATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentationClass)) typedef struct _pdfpcWindowPresentation pdfpcWindowPresentation; typedef struct _pdfpcWindowPresentationClass pdfpcWindowPresentationClass; typedef struct _pdfpcWindowPresentationPrivate pdfpcWindowPresentationPrivate; typedef struct _pdfpcWindowPresenterPrivate pdfpcWindowPresenterPrivate; #define PDFPC_TYPE_APPLICATION (pdfpc_application_get_type ()) #define PDFPC_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_APPLICATION, pdfpcApplication)) #define PDFPC_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_APPLICATION, pdfpcApplicationClass)) #define PDFPC_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_APPLICATION)) #define PDFPC_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_APPLICATION)) #define PDFPC_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_APPLICATION, pdfpcApplicationClass)) typedef struct _pdfpcApplication pdfpcApplication; typedef struct _pdfpcApplicationClass pdfpcApplicationClass; typedef struct _pdfpcApplicationPrivate pdfpcApplicationPrivate; struct _pdfpcCacheStatus { GTypeInstance parent_instance; volatile int ref_count; pdfpcCacheStatusPrivate * priv; gint current_value; gint max_value; }; struct _pdfpcCacheStatusClass { GTypeClass parent_class; void (*finalize) (pdfpcCacheStatus *self); }; typedef void (*pdfpcCacheStatusUpdateFunction) (gdouble progress, void* user_data); typedef void (*pdfpcCacheStatusUpdateComplete) (void* user_data); struct _pdfpcViewPrerenderingIface { GTypeInterface parent_iface; }; struct _pdfpcMetadataBase { GObject parent_instance; pdfpcMetadataBasePrivate * priv; gchar* fname; gchar* url; }; struct _pdfpcMetadataBaseClass { GObjectClass parent_class; guint (*get_slide_count) (pdfpcMetadataBase* self); }; struct _pdfpcMetadataPdf { pdfpcMetadataBase parent_instance; pdfpcMetadataPdfPrivate * priv; gchar* pdf_fname; gchar* pdf_url; gchar* pdfpc_url; PopplerDocument* document; gdouble page_width; gdouble page_height; guint page_count; pdfpcslides_notes* notes; gboolean skips_by_user; guint duration; }; struct _pdfpcMetadataPdfClass { pdfpcMetadataBaseClass parent_class; }; struct _pdfpcslides_notes { GObject parent_instance; pdfpcslides_notesPrivate * priv; gchar** notes; gint notes_length1; }; struct _pdfpcslides_notesClass { GObjectClass parent_class; }; struct _pdfpcMutexLocks { GObject parent_instance; pdfpcMutexLocksPrivate * priv; }; struct _pdfpcMutexLocksClass { GObjectClass parent_class; }; struct _pdfpcOptions { GObject parent_instance; pdfpcOptionsPrivate * priv; }; struct _pdfpcOptionsClass { GObjectClass parent_class; }; struct _pdfpcControllableIface { GTypeInterface parent_iface; pdfpcPresentationController* (*get_controller) (pdfpcControllable* self); void (*update) (pdfpcControllable* self); void (*edit_note) (pdfpcControllable* self); void (*ask_goto_page) (pdfpcControllable* self); void (*show_overview) (pdfpcControllable* self); void (*hide_overview) (pdfpcControllable* self); }; struct _pdfpcPresentationController { GObject parent_instance; pdfpcPresentationControllerPrivate * priv; gint current_slide_number; gint current_user_slide_number; gboolean faded_to_black; gboolean frozen; gboolean black_on_end; gint n_slides; GList* controllables; gboolean ignore_keyboard_events; gboolean ignore_mouse_events; pdfpcMetadataPdf* metadata; pdfpcWindowOverview* overview; gboolean overview_shown; guint last_key_event; pdfpcTimerLabel* timer; GeeHashMap* actionNames; GeeHashMap* keyBindings; GeeHashMap* mouseBindings; }; struct _pdfpcPresentationControllerClass { GObjectClass parent_class; }; typedef void (*pdfpcPresentationControllerKeyActionKeyActionDelegate) (void* user_data); struct _pdfpcPresentationControllerKeyAction { GTypeInstance parent_instance; volatile int ref_count; pdfpcPresentationControllerKeyActionPrivate * priv; pdfpcPresentationControllerKeyActionKeyActionDelegate d; gpointer d_target; GDestroyNotify d_target_destroy_notify; }; struct _pdfpcPresentationControllerKeyActionClass { GTypeClass parent_class; void (*finalize) (pdfpcPresentationControllerKeyAction *self); }; struct _pdfpcPresentationControllerKeyDef { GTypeInstance parent_instance; volatile int ref_count; pdfpcPresentationControllerKeyDefPrivate * priv; }; struct _pdfpcPresentationControllerKeyDefClass { GTypeClass parent_class; void (*finalize) (pdfpcPresentationControllerKeyDef *self); }; typedef enum { PDFPC_RENDERER_RENDER_ERROR_SLIDE_DOES_NOT_EXIST } pdfpcRendererRenderError; #define PDFPC_RENDERER_RENDER_ERROR pdfpc_renderer_render_error_quark () struct _pdfpcRendererBase { GObject parent_instance; pdfpcRendererBasePrivate * priv; pdfpcMetadataBase* metadata; gint width; gint height; }; struct _pdfpcRendererBaseClass { GObjectClass parent_class; GdkPixmap* (*render_to_pixmap) (pdfpcRendererBase* self, gint slide_number, GError** error); GdkPixmap* (*fade_to_black) (pdfpcRendererBase* self); }; struct _pdfpcRendererCacheBase { GObject parent_instance; pdfpcRendererCacheBasePrivate * priv; pdfpcMetadataBase* metadata; }; struct _pdfpcRendererCacheBaseClass { GObjectClass parent_class; void (*store) (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap); GdkPixmap* (*retrieve) (pdfpcRendererCacheBase* self, guint index); }; struct _pdfpcRendererCacheOptionFactory { GObject parent_instance; pdfpcRendererCacheOptionFactoryPrivate * priv; }; struct _pdfpcRendererCacheOptionFactoryClass { GObjectClass parent_class; }; struct _pdfpcRendererCachePNGEngine { pdfpcRendererCacheBase parent_instance; pdfpcRendererCachePNGEnginePrivate * priv; pdfpcRendererCachePNGItem** storage; gint storage_length1; GMutex* mutex; }; struct _pdfpcRendererCachePNGEngineClass { pdfpcRendererCacheBaseClass parent_class; }; struct _pdfpcRendererCachePNGItem { GObject parent_instance; pdfpcRendererCachePNGItemPrivate * priv; guint8* data; gint data_length1; }; struct _pdfpcRendererCachePNGItemClass { GObjectClass parent_class; }; struct _pdfpcRendererCacheSimpleEngine { pdfpcRendererCacheBase parent_instance; pdfpcRendererCacheSimpleEnginePrivate * priv; GdkPixmap** storage; gint storage_length1; GMutex* mutex; }; struct _pdfpcRendererCacheSimpleEngineClass { pdfpcRendererCacheBaseClass parent_class; }; struct _pdfpcRendererCachingIface { GTypeInterface parent_iface; void (*set_cache) (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* (*get_cache) (pdfpcRendererCaching* self); }; struct _pdfpcRendererPdf { pdfpcRendererBase parent_instance; pdfpcRendererPdfPrivate * priv; gdouble scaling_factor; pdfpcRendererCacheBase* cache; }; struct _pdfpcRendererPdfClass { pdfpcRendererBaseClass parent_class; }; struct _pdfpcScaler { GObject parent_instance; pdfpcScalerPrivate * priv; gdouble initial_width; gdouble initial_height; }; struct _pdfpcScalerClass { GObjectClass parent_class; }; struct _pdfpcTimerLabel { GtkLabel parent_instance; pdfpcTimerLabelPrivate * priv; gint time; time_t start_time; guint timeout; GdkColor normal_color; GdkColor pretalk_color; }; struct _pdfpcTimerLabelClass { GtkLabelClass parent_class; void (*start) (pdfpcTimerLabel* self); void (*stop) (pdfpcTimerLabel* self); void (*reset) (pdfpcTimerLabel* self); gboolean (*on_timeout) (pdfpcTimerLabel* self); void (*format_time) (pdfpcTimerLabel* self); }; struct _pdfpcCountdownTimer { pdfpcTimerLabel parent_instance; pdfpcCountdownTimerPrivate * priv; gint duration; guint last_minutes; GdkColor last_minutes_color; GdkColor negative_color; }; struct _pdfpcCountdownTimerClass { pdfpcTimerLabelClass parent_class; }; struct _pdfpcEndTimeTimer { pdfpcCountdownTimer parent_instance; pdfpcEndTimeTimerPrivate * priv; time_t end_time; struct tm end_time_object; }; struct _pdfpcEndTimeTimerClass { pdfpcCountdownTimerClass parent_class; }; struct _pdfpcCountupTimer { pdfpcTimerLabel parent_instance; pdfpcCountupTimerPrivate * priv; }; struct _pdfpcCountupTimerClass { pdfpcTimerLabelClass parent_class; }; struct _pdfpcViewBase { GtkDrawingArea parent_instance; pdfpcViewBasePrivate * priv; pdfpcRendererBase* renderer; }; struct _pdfpcViewBaseClass { GtkDrawingAreaClass parent_class; void (*display) (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); void (*fade_to_black) (pdfpcViewBase* self); void (*redraw) (pdfpcViewBase* self, GError** error); gint (*get_current_slide_number) (pdfpcViewBase* self); }; typedef enum { PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_BEHAVIOUR_ALREADY_ASSOCIATED, PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_VIEW_NOT_SUPPORTED } pdfpcViewBehaviourAssociationError; #define PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR pdfpc_view_behaviour_association_error_quark () struct _pdfpcViewBehaviourBase { GObject parent_instance; pdfpcViewBehaviourBasePrivate * priv; pdfpcViewBase* target; }; struct _pdfpcViewBehaviourBaseClass { GObjectClass parent_class; void (*associate) (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); }; struct _pdfpcViewBehaviourPdfLinkImplementation { pdfpcViewBehaviourBase parent_instance; pdfpcViewBehaviourPdfLinkImplementationPrivate * priv; pdfpcViewBehaviourPdfLinkSignalProvider* signal_provider; pdfpcPresentationController* presentation_controller; }; struct _pdfpcViewBehaviourPdfLinkImplementationClass { pdfpcViewBehaviourBaseClass parent_class; }; struct _pdfpcViewBehaviourPdfLinkSignalProvider { GObject parent_instance; pdfpcViewBehaviourPdfLinkSignalProviderPrivate * priv; pdfpcViewPdf* target; PopplerLinkMapping* active_mapping; GList* page_link_mappings; GdkRectangle* precalculated_mapping_rectangles; gint precalculated_mapping_rectangles_length1; }; struct _pdfpcViewBehaviourPdfLinkSignalProviderClass { GObjectClass parent_class; }; struct _pdfpcViewBehaviourDecoratableIface { GTypeInterface parent_iface; void (*associate_behaviour) (pdfpcViewBehaviourDecoratable* self, pdfpcViewBehaviourBase* behaviour); }; struct _pdfpcViewDefault { pdfpcViewBase parent_instance; pdfpcViewDefaultPrivate * priv; gint current_slide_number; GdkPixmap* current_slide; gint n_slides; gint slide_limit; GList* behaviours; }; struct _pdfpcViewDefaultClass { pdfpcViewBaseClass parent_class; }; struct _pdfpcViewPdf { pdfpcViewDefault parent_instance; pdfpcViewPdfPrivate * priv; }; struct _pdfpcViewPdfClass { pdfpcViewDefaultClass parent_class; }; struct _pdfpcWindowFullscreen { GtkWindow parent_instance; pdfpcWindowFullscreenPrivate * priv; GdkRectangle screen_geometry; guint hide_cursor_timeout; gboolean faded_to_black; gboolean frozen; }; struct _pdfpcWindowFullscreenClass { GtkWindowClass parent_class; }; struct _pdfpcWindowOverview { GtkScrolledWindow parent_instance; pdfpcWindowOverviewPrivate * priv; GtkListStore* slides; GtkIconView* slides_view; pdfpcMetadataPdf* metadata; gint n_slides; gint last_structure_n_slides; gint target_width; gint target_height; gint next_undone_preview; guint idle_id; pdfpcRendererCacheBase* cache; pdfpcPresentationController* presentation_controller; pdfpcWindowPresenter* presenter; gdouble aspect_ratio; gint max_width; gint max_height; }; struct _pdfpcWindowOverviewClass { GtkScrolledWindowClass parent_class; }; struct _pdfpcWindowCellRendererHighlight { GtkCellRendererPixbuf parent_instance; pdfpcWindowCellRendererHighlightPrivate * priv; }; struct _pdfpcWindowCellRendererHighlightClass { GtkCellRendererPixbufClass parent_class; }; struct _pdfpcWindowPresentation { pdfpcWindowFullscreen parent_instance; pdfpcWindowPresentationPrivate * priv; pdfpcPresentationController* presentation_controller; pdfpcViewBase* view; }; struct _pdfpcWindowPresentationClass { pdfpcWindowFullscreenClass parent_class; }; struct _pdfpcWindowPresenter { pdfpcWindowFullscreen parent_instance; pdfpcWindowPresenterPrivate * priv; pdfpcPresentationController* presentation_controller; pdfpcViewBase* current_view; pdfpcViewBase* next_view; pdfpcViewBase* strict_next_view; pdfpcViewBase* strict_prev_view; pdfpcTimerLabel* timer; GtkEntry* slide_progress; GtkProgressBar* prerender_progress; GtkImage* blank_icon; GtkImage* frozen_icon; GtkImage* pause_icon; GtkTextView* notes_view; GtkHBox* slideViews; pdfpcWindowOverview* overview; GtkAlignment* centered_overview; gboolean overview_added; GtkVBox* fullLayout; guint slide_count; pdfpcMetadataPdf* metadata; GdkColor black; GdkColor white; }; struct _pdfpcWindowPresenterClass { pdfpcWindowFullscreenClass parent_class; }; struct _pdfpcApplication { GObject parent_instance; pdfpcApplicationPrivate * priv; }; struct _pdfpcApplicationClass { GObjectClass parent_class; }; gpointer pdfpc_cache_status_ref (gpointer instance); void pdfpc_cache_status_unref (gpointer instance); GParamSpec* pdfpc_param_spec_cache_status (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_value_set_cache_status (GValue* value, gpointer v_object); void pdfpc_value_take_cache_status (GValue* value, gpointer v_object); gpointer pdfpc_value_get_cache_status (const GValue* value); GType pdfpc_cache_status_get_type (void) G_GNUC_CONST; void pdfpc_cache_status_register_update (pdfpcCacheStatus* self, pdfpcCacheStatusUpdateFunction update, void* update_target, pdfpcCacheStatusUpdateComplete complete, void* complete_target); void pdfpc_cache_status_update (pdfpcCacheStatus* self); GType pdfpc_view_prerendering_get_type (void) G_GNUC_CONST; void pdfpc_cache_status_monitor_view (pdfpcCacheStatus* self, pdfpcViewPrerendering* view); pdfpcCacheStatus* pdfpc_cache_status_new (void); pdfpcCacheStatus* pdfpc_cache_status_construct (GType object_type); GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; pdfpcMetadataBase* pdfpc_metadata_base_construct (GType object_type, const gchar* fname); gchar* pdfpc_metadata_base_get_url (pdfpcMetadataBase* self); guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self); GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST; GType pdfpc_slides_notes_get_type (void) G_GNUC_CONST; void pdfpc_metadata_pdf_save_to_disk (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_skips (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_end_user_slide (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_notes (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_duration (pdfpcMetadataPdf* self); pdfpcMetadataPdf* pdfpc_metadata_pdf_new (const gchar* fname); pdfpcMetadataPdf* pdfpc_metadata_pdf_construct (GType object_type, const gchar* fname); gint pdfpc_metadata_pdf_get_user_slide_count (pdfpcMetadataPdf* self); gint pdfpc_metadata_pdf_get_end_user_slide (pdfpcMetadataPdf* self); void pdfpc_metadata_pdf_set_end_user_slide (pdfpcMetadataPdf* self, gint slide); gint pdfpc_metadata_pdf_toggle_skip (pdfpcMetadataPdf* self, gint slide_number, gint user_slide_number); gint pdfpc_metadata_pdf_user_slide_to_real_slide (pdfpcMetadataPdf* self, gint number); gint pdfpc_metadata_pdf_real_slide_to_user_slide (pdfpcMetadataPdf* self, gint number); gdouble pdfpc_metadata_pdf_get_page_width (pdfpcMetadataPdf* self); gdouble pdfpc_metadata_pdf_get_page_height (pdfpcMetadataPdf* self); PopplerDocument* pdfpc_metadata_pdf_get_document (pdfpcMetadataPdf* self); pdfpcslides_notes* pdfpc_metadata_pdf_get_notes (pdfpcMetadataPdf* self); guint pdfpc_metadata_pdf_get_duration (pdfpcMetadataPdf* self); void pdfpc_metadata_pdf_set_duration (pdfpcMetadataPdf* self, guint d); PopplerDocument* pdfpc_metadata_pdf_open_pdf_document (pdfpcMetadataPdf* self, const gchar* url); void pdfpc_slides_notes_set_note (pdfpcslides_notes* self, const gchar* note, gint slide_number); gchar* pdfpc_slides_notes_get_note_for_slide (pdfpcslides_notes* self, gint number); gboolean pdfpc_slides_notes_has_notes (pdfpcslides_notes* self); gchar* pdfpc_slides_notes_format_to_save (pdfpcslides_notes* self); void pdfpc_slides_notes_parse_lines (pdfpcslides_notes* self, gchar** lines, int lines_length1); pdfpcslides_notes* pdfpc_slides_notes_new (void); pdfpcslides_notes* pdfpc_slides_notes_construct (GType object_type); GType pdfpc_mutex_locks_get_type (void) G_GNUC_CONST; extern GMutex* pdfpc_mutex_locks_poppler; void pdfpc_mutex_locks_init (void); pdfpcMutexLocks* pdfpc_mutex_locks_new (void); pdfpcMutexLocks* pdfpc_mutex_locks_construct (GType object_type); GType pdfpc_options_get_type (void) G_GNUC_CONST; extern gboolean pdfpc_options_display_switch; extern gboolean pdfpc_options_single_screen; extern gboolean pdfpc_options_windowed; extern gboolean pdfpc_options_disable_caching; extern gboolean pdfpc_options_disable_cache_compression; extern guint pdfpc_options_duration; extern guint pdfpc_options_last_minutes; extern guint pdfpc_options_current_size; extern gint pdfpc_options_min_overview_width; extern gchar* pdfpc_options_start_time; extern gchar* pdfpc_options_end_time; extern gboolean pdfpc_options_black_on_end; extern gboolean pdfpc_options_list_actions; pdfpcOptions* pdfpc_options_new (void); pdfpcOptions* pdfpc_options_construct (GType object_type); GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST; GType pdfpc_controllable_get_type (void) G_GNUC_CONST; GType pdfpc_window_overview_get_type (void) G_GNUC_CONST; GType pdfpc_timer_label_get_type (void) G_GNUC_CONST; gpointer pdfpc_presentation_controller_key_action_ref (gpointer instance); void pdfpc_presentation_controller_key_action_unref (gpointer instance); GParamSpec* pdfpc_presentation_controller_param_spec_key_action (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_presentation_controller_value_set_key_action (GValue* value, gpointer v_object); void pdfpc_presentation_controller_value_take_key_action (GValue* value, gpointer v_object); gpointer pdfpc_presentation_controller_value_get_key_action (const GValue* value); GType pdfpc_presentation_controller_key_action_get_type (void) G_GNUC_CONST; gpointer pdfpc_presentation_controller_key_def_ref (gpointer instance); void pdfpc_presentation_controller_key_def_unref (gpointer instance); GParamSpec* pdfpc_presentation_controller_param_spec_key_def (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_presentation_controller_value_set_key_def (GValue* value, gpointer v_object); void pdfpc_presentation_controller_value_take_key_def (GValue* value, gpointer v_object); gpointer pdfpc_presentation_controller_value_get_key_def (const GValue* value); GType pdfpc_presentation_controller_key_def_get_type (void) G_GNUC_CONST; pdfpcPresentationController* pdfpc_presentation_controller_new (pdfpcMetadataPdf* metadata, gboolean allow_black_on_end); pdfpcPresentationController* pdfpc_presentation_controller_construct (GType object_type, pdfpcMetadataPdf* metadata, gboolean allow_black_on_end); void pdfpc_presentation_controller_set_overview (pdfpcPresentationController* self, pdfpcWindowOverview* o); void pdfpc_presentation_controller_fillActionNames (pdfpcPresentationController* self); gchar** pdfpc_presentation_controller_getActionDescriptions (int* result_length1); void pdfpc_presentation_controller_bind (pdfpcPresentationController* self, guint keycode, guint modMask, const gchar* function); void pdfpc_presentation_controller_unbind (pdfpcPresentationController* self, guint keycode, guint modMask); void pdfpc_presentation_controller_unbindAll (pdfpcPresentationController* self); void pdfpc_presentation_controller_bindMouse (pdfpcPresentationController* self, guint button, guint modMask, const gchar* function); void pdfpc_presentation_controller_unbindMouse (pdfpcPresentationController* self, guint keycode, guint modMask); void pdfpc_presentation_controller_unbindAllMouse (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_key_press (pdfpcPresentationController* self, GdkEventKey* key); gboolean pdfpc_presentation_controller_button_press (pdfpcPresentationController* self, GdkEventButton* button); void pdfpc_presentation_controller_scroll (pdfpcPresentationController* self, GdkEventScroll* scroll); gint pdfpc_presentation_controller_get_current_slide_number (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_current_user_slide_number (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_skip_previous (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_skip_next (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_n_slide (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_user_n_slides (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_end_user_slide (pdfpcPresentationController* self); void pdfpc_presentation_controller_set_end_user_slide (pdfpcPresentationController* self); void pdfpc_presentation_controller_set_end_user_slide_overview (pdfpcPresentationController* self); void pdfpc_presentation_controller_page_change_request (pdfpcPresentationController* self, gint page_number); void pdfpc_presentation_controller_set_ignore_input_events (pdfpcPresentationController* self, gboolean v); void pdfpc_presentation_controller_set_ignore_mouse_events (pdfpcPresentationController* self, gboolean v); pdfpcTimerLabel* pdfpc_presentation_controller_getTimer (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_register_controllable (pdfpcPresentationController* self, pdfpcControllable* controllable); void pdfpc_presentation_controller_next_page (pdfpcPresentationController* self); void pdfpc_presentation_controller_next_user_page (pdfpcPresentationController* self); void pdfpc_presentation_controller_previous_page (pdfpcPresentationController* self); void pdfpc_presentation_controller_previous_user_page (pdfpcPresentationController* self); void pdfpc_presentation_controller_goto_first (pdfpcPresentationController* self); void pdfpc_presentation_controller_goto_last (pdfpcPresentationController* self); void pdfpc_presentation_controller_jump10 (pdfpcPresentationController* self); void pdfpc_presentation_controller_back10 (pdfpcPresentationController* self); void pdfpc_presentation_controller_goto_user_page (pdfpcPresentationController* self, gint page_number); void pdfpc_presentation_controller_history_back (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_update (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_reset (pdfpcPresentationController* self); void pdfpc_presentation_controller_toggle_overview (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_show_overview (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_hide_overview (pdfpcPresentationController* self); void pdfpc_presentation_controller_fade_to_black (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_is_faded_to_black (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_edit_note (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_ask_goto_page (pdfpcPresentationController* self); void pdfpc_presentation_controller_toggle_freeze (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_is_frozen (pdfpcPresentationController* self); void pdfpc_presentation_controller_toggle_skip (pdfpcPresentationController* self); void pdfpc_presentation_controller_start (pdfpcPresentationController* self); void pdfpc_presentation_controller_toggle_pause (pdfpcPresentationController* self); void pdfpc_presentation_controller_reset_timer (pdfpcPresentationController* self); void pdfpc_presentation_controller_exit_state (pdfpcPresentationController* self); void pdfpc_presentation_controller_quit (pdfpcPresentationController* self); guint pdfpc_presentation_controller_get_accepted_key_mods (pdfpcPresentationController* self); void pdfpc_presentation_controller_set_accepted_key_mods (pdfpcPresentationController* self, guint value); pdfpcPresentationControllerKeyAction* pdfpc_presentation_controller_key_action_new (pdfpcPresentationControllerKeyActionKeyActionDelegate d, void* d_target); pdfpcPresentationControllerKeyAction* pdfpc_presentation_controller_key_action_construct (GType object_type, pdfpcPresentationControllerKeyActionKeyActionDelegate d, void* d_target); pdfpcPresentationControllerKeyDef* pdfpc_presentation_controller_key_def_new (guint k, guint m); pdfpcPresentationControllerKeyDef* pdfpc_presentation_controller_key_def_construct (GType object_type, guint k, guint m); guint pdfpc_presentation_controller_key_def_hash (void* _a); gboolean pdfpc_presentation_controller_key_def_equal (void* _a, void* _b); guint pdfpc_presentation_controller_key_def_get_keycode (pdfpcPresentationControllerKeyDef* self); void pdfpc_presentation_controller_key_def_set_keycode (pdfpcPresentationControllerKeyDef* self, guint value); guint pdfpc_presentation_controller_key_def_get_modMask (pdfpcPresentationControllerKeyDef* self); void pdfpc_presentation_controller_key_def_set_modMask (pdfpcPresentationControllerKeyDef* self, guint value); GType pdfpc_renderer_base_get_type (void) G_GNUC_CONST; GQuark pdfpc_renderer_render_error_quark (void); pdfpcRendererBase* pdfpc_renderer_base_construct (GType object_type, pdfpcMetadataBase* metadata, gint width, gint height); pdfpcMetadataBase* pdfpc_renderer_base_get_metadata (pdfpcRendererBase* self); gint pdfpc_renderer_base_get_width (pdfpcRendererBase* self); gint pdfpc_renderer_base_get_height (pdfpcRendererBase* self); GdkPixmap* pdfpc_renderer_base_render_to_pixmap (pdfpcRendererBase* self, gint slide_number, GError** error); GdkPixmap* pdfpc_renderer_base_fade_to_black (pdfpcRendererBase* self); GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; pdfpcRendererCacheBase* pdfpc_renderer_cache_base_construct (GType object_type, pdfpcMetadataBase* metadata); gboolean pdfpc_renderer_cache_base_allows_prerendering (pdfpcRendererCacheBase* self); void pdfpc_renderer_cache_base_store (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap); GdkPixmap* pdfpc_renderer_cache_base_retrieve (pdfpcRendererCacheBase* self, guint index); GType pdfpc_renderer_cache_option_factory_get_type (void) G_GNUC_CONST; pdfpcRendererCacheBase* pdfpc_renderer_cache_option_factory_create (pdfpcMetadataBase* metadata); GType pdfpc_renderer_cache_png_engine_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_cache_png_item_get_type (void) G_GNUC_CONST; pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_new (pdfpcMetadataBase* metadata); pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_construct (GType object_type, pdfpcMetadataBase* metadata); pdfpcRendererCachePNGItem* pdfpc_renderer_cache_png_item_new (guint8* data, int data_length1); pdfpcRendererCachePNGItem* pdfpc_renderer_cache_png_item_construct (GType object_type, guint8* data, int data_length1); guint8* pdfpc_renderer_cache_png_item_get_png_data (pdfpcRendererCachePNGItem* self, int* result_length1); gint pdfpc_renderer_cache_png_item_get_length (pdfpcRendererCachePNGItem* self); GType pdfpc_renderer_cache_simple_engine_get_type (void) G_GNUC_CONST; pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_new (pdfpcMetadataBase* metadata); pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_construct (GType object_type, pdfpcMetadataBase* metadata); GType pdfpc_renderer_caching_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_pdf_get_type (void) G_GNUC_CONST; pdfpcRendererPdf* pdfpc_renderer_pdf_new (pdfpcMetadataPdf* metadata, gint width, gint height); pdfpcRendererPdf* pdfpc_renderer_pdf_construct (GType object_type, pdfpcMetadataPdf* metadata, gint width, gint height); GType pdfpc_scaler_get_type (void) G_GNUC_CONST; pdfpcScaler* pdfpc_scaler_new (gdouble width, gdouble height); pdfpcScaler* pdfpc_scaler_construct (GType object_type, gdouble width, gdouble height); void pdfpc_scaler_scale_to (pdfpcScaler* self, gint width, gint height, gboolean centered, gboolean allow_cutoff, GdkRectangle* result); pdfpcTimerLabel* pdfpc_timer_label_construct (GType object_type, time_t start_time); void pdfpc_timer_label_start (pdfpcTimerLabel* self); void pdfpc_timer_label_stop (pdfpcTimerLabel* self); gboolean pdfpc_timer_label_pause (pdfpcTimerLabel* self); gboolean pdfpc_timer_label_is_paused (pdfpcTimerLabel* self); void pdfpc_timer_label_reset (pdfpcTimerLabel* self); gint pdfpc_timer_label_calculate_countdown (pdfpcTimerLabel* self); gboolean pdfpc_timer_label_on_timeout (pdfpcTimerLabel* self); void pdfpc_timer_label_format_time (pdfpcTimerLabel* self); void pdfpc_timer_label_show_time (pdfpcTimerLabel* self, guint timeInSecs, const gchar* prefix); GType pdfpc_countdown_timer_get_type (void) G_GNUC_CONST; pdfpcCountdownTimer* pdfpc_countdown_timer_new (gint duration, guint last_minutes, time_t start_time); pdfpcCountdownTimer* pdfpc_countdown_timer_construct (GType object_type, gint duration, guint last_minutes, time_t start_time); GType pdfpc_end_time_timer_get_type (void) G_GNUC_CONST; pdfpcEndTimeTimer* pdfpc_end_time_timer_new (time_t end_time, guint last_minutes, time_t start_time); pdfpcEndTimeTimer* pdfpc_end_time_timer_construct (GType object_type, time_t end_time, guint last_minutes, time_t start_time); GType pdfpc_countup_timer_get_type (void) G_GNUC_CONST; pdfpcCountupTimer* pdfpc_countup_timer_new (time_t start_time); pdfpcCountupTimer* pdfpc_countup_timer_construct (GType object_type, time_t start_time); GType pdfpc_view_base_get_type (void) G_GNUC_CONST; pdfpcViewBase* pdfpc_view_base_construct (GType object_type, pdfpcRendererBase* renderer); pdfpcRendererBase* pdfpc_view_base_get_renderer (pdfpcViewBase* self); void pdfpc_view_base_display (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); void pdfpc_view_base_fade_to_black (pdfpcViewBase* self); void pdfpc_view_base_redraw (pdfpcViewBase* self, GError** error); gint pdfpc_view_base_get_current_slide_number (pdfpcViewBase* self); GType pdfpc_view_behaviour_base_get_type (void) G_GNUC_CONST; GQuark pdfpc_view_behaviour_association_error_quark (void); pdfpcViewBehaviourBase* pdfpc_view_behaviour_base_construct (GType object_type); pdfpcViewBase* pdfpc_view_behaviour_base_get_target (pdfpcViewBehaviourBase* self); void pdfpc_view_behaviour_base_enforce_exclusive_association (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); void pdfpc_view_behaviour_base_associate (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); gboolean pdfpc_view_behaviour_base_is_supported (pdfpcViewBehaviourBase* self, pdfpcViewBase* target); GType pdfpc_view_behaviour_pdf_link_implementation_get_type (void) G_GNUC_CONST; GType pdfpc_view_behaviour_pdf_link_signal_provider_get_type (void) G_GNUC_CONST; pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_new (pdfpcPresentationController* presentation_controller); pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_construct (GType object_type, pdfpcPresentationController* presentation_controller); gboolean pdfpc_view_behaviour_pdf_link_implementation_is_supported (pdfpcViewBehaviourPdfLinkImplementation* self, pdfpcViewBase* target); void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping); void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping); void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, guint target_page_number); void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, const gchar* command, const gchar* arguments); GType pdfpc_view_default_get_type (void) G_GNUC_CONST; GType pdfpc_view_pdf_get_type (void) G_GNUC_CONST; void pdfpc_view_behaviour_pdf_link_signal_provider_attach (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewPdf* view); PopplerLinkMapping* pdfpc_view_behaviour_pdf_link_signal_provider_get_link_mapping_by_coordinates (pdfpcViewBehaviourPdfLinkSignalProvider* self, gdouble x, gdouble y); void pdfpc_view_behaviour_pdf_link_signal_provider_handle_link_mapping (pdfpcViewBehaviourPdfLinkSignalProvider* self, PopplerLinkMapping* mapping); void pdfpc_view_behaviour_pdf_link_signal_provider_convert_poppler_rectangle_to_gdk_rectangle (pdfpcViewBehaviourPdfLinkSignalProvider* self, PopplerRectangle* poppler_rectangle, GdkRectangle* result); gboolean pdfpc_view_behaviour_pdf_link_signal_provider_on_button_press (pdfpcViewBehaviourPdfLinkSignalProvider* self, GtkWidget* source, GdkEventButton* e); gboolean pdfpc_view_behaviour_pdf_link_signal_provider_on_mouse_move (pdfpcViewBehaviourPdfLinkSignalProvider* self, GtkWidget* source, GdkEventMotion* event); void pdfpc_view_behaviour_pdf_link_signal_provider_on_entering_slide (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewBase* source, gint page_number); void pdfpc_view_behaviour_pdf_link_signal_provider_on_leaving_slide (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewBase* source, gint from, gint to); pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_new (void); pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_construct (GType object_type); GType pdfpc_view_behaviour_decoratable_get_type (void) G_GNUC_CONST; pdfpcViewDefault* pdfpc_view_default_new (pdfpcRendererBase* renderer); pdfpcViewDefault* pdfpc_view_default_construct (GType object_type, pdfpcRendererBase* renderer); void pdfpc_view_default_register_prerendering (pdfpcViewDefault* self); pdfpcViewPdf* pdfpc_view_pdf_new (pdfpcRendererPdf* renderer, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller); pdfpcViewPdf* pdfpc_view_pdf_construct (GType object_type, pdfpcRendererPdf* renderer, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller); pdfpcViewPdf* pdfpc_view_pdf_from_metadata (pdfpcMetadataPdf* metadata, gint width, gint height, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller, GdkRectangle* scale_rect); pdfpcRendererPdf* pdfpc_view_pdf_get_renderer (pdfpcViewPdf* self); GType pdfpc_window_fullscreen_get_type (void) G_GNUC_CONST; pdfpcWindowFullscreen* pdfpc_window_fullscreen_new (gint screen_num); pdfpcWindowFullscreen* pdfpc_window_fullscreen_construct (GType object_type, gint screen_num); gboolean pdfpc_window_fullscreen_on_configure (pdfpcWindowFullscreen* self, GdkEventConfigure* e); void pdfpc_window_fullscreen_on_size_allocate (pdfpcWindowFullscreen* self, GtkWidget* source, GdkRectangle* r); gboolean pdfpc_window_fullscreen_on_mouse_move (pdfpcWindowFullscreen* self, GtkWidget* source, GdkEventMotion* event); void pdfpc_window_fullscreen_restart_hide_cursor_timer (pdfpcWindowFullscreen* self); gboolean pdfpc_window_fullscreen_on_hide_cursor_timeout (pdfpcWindowFullscreen* self); GType pdfpc_window_presenter_get_type (void) G_GNUC_CONST; void pdfpc_window_overview_on_selection_changed (pdfpcWindowOverview* self, GtkWidget* source); pdfpcWindowOverview* pdfpc_window_overview_new (pdfpcMetadataPdf* metadata, pdfpcPresentationController* presentation_controller, pdfpcWindowPresenter* presenter); pdfpcWindowOverview* pdfpc_window_overview_construct (GType object_type, pdfpcMetadataPdf* metadata, pdfpcPresentationController* presentation_controller, pdfpcWindowPresenter* presenter); void pdfpc_window_overview_set_available_space (pdfpcWindowOverview* self, gint width, gint height); void pdfpc_window_overview_on_parent_set (pdfpcWindowOverview* self, GtkWidget* old_parent); void pdfpc_window_overview_on_show (pdfpcWindowOverview* self); void pdfpc_window_overview_on_hide (pdfpcWindowOverview* self); void pdfpc_window_overview_fill_structure (pdfpcWindowOverview* self); void pdfpc_window_overview_fill_previews (pdfpcWindowOverview* self); gboolean _pdfpc_window_overview_fill_previews (pdfpcWindowOverview* self); void pdfpc_window_overview_set_cache (pdfpcWindowOverview* self, pdfpcRendererCacheBase* cache); void pdfpc_window_overview_set_n_slides (pdfpcWindowOverview* self, gint n); void pdfpc_window_overview_remove_current (pdfpcWindowOverview* self, gint newn); gboolean pdfpc_window_overview_on_key_press (pdfpcWindowOverview* self, GtkWidget* source, GdkEventKey* key); gboolean pdfpc_window_overview_on_mouse_move (pdfpcWindowOverview* self, GtkWidget* source, GdkEventMotion* event); gboolean pdfpc_window_overview_on_mouse_release (pdfpcWindowOverview* self, GdkEventButton* event); gint pdfpc_window_overview_get_current_slide (pdfpcWindowOverview* self); void pdfpc_window_overview_set_current_slide (pdfpcWindowOverview* self, gint value); GType pdfpc_window_cell_renderer_highlight_get_type (void) G_GNUC_CONST; pdfpcWindowCellRendererHighlight* pdfpc_window_cell_renderer_highlight_new (void); pdfpcWindowCellRendererHighlight* pdfpc_window_cell_renderer_highlight_construct (GType object_type); GType pdfpc_window_presentation_get_type (void) G_GNUC_CONST; pdfpcWindowPresentation* pdfpc_window_presentation_new (pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); pdfpcWindowPresentation* pdfpc_window_presentation_construct (GType object_type, pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); gboolean pdfpc_window_presentation_on_key_pressed (pdfpcWindowPresentation* self, GdkEventKey* key); gboolean pdfpc_window_presentation_on_button_press (pdfpcWindowPresentation* self, GdkEventButton* button); gboolean pdfpc_window_presentation_on_scroll (pdfpcWindowPresentation* self, GtkWidget* source, GdkEventScroll* scroll); void pdfpc_window_presentation_set_controller (pdfpcWindowPresentation* self, pdfpcPresentationController* controller); void pdfpc_window_presentation_set_cache_observer (pdfpcWindowPresentation* self, pdfpcCacheStatus* observer); pdfpcWindowPresenter* pdfpc_window_presenter_new (pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); pdfpcWindowPresenter* pdfpc_window_presenter_construct (GType object_type, pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); void pdfpc_window_presenter_build_layout (pdfpcWindowPresenter* self); gboolean pdfpc_window_presenter_on_key_pressed (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key); gboolean pdfpc_window_presenter_on_button_press (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventButton* button); gboolean pdfpc_window_presenter_on_scroll (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventScroll* scroll); void pdfpc_window_presenter_update_slide_count (pdfpcWindowPresenter* self); void pdfpc_window_presenter_custom_slide_count (pdfpcWindowPresenter* self, gint current); void pdfpc_window_presenter_goto_page (pdfpcWindowPresenter* self, gint page_number); gboolean pdfpc_window_presenter_on_key_press_slide_progress (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key); gboolean pdfpc_window_presenter_on_key_press_notes_view (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key); void pdfpc_window_presenter_update_note (pdfpcWindowPresenter* self); void pdfpc_window_presenter_set_cache_observer (pdfpcWindowPresenter* self, pdfpcCacheStatus* observer); void pdfpc_window_presenter_prerender_finished (pdfpcWindowPresenter* self); pdfpcPresentationController* pdfpc_controllable_get_controller (pdfpcControllable* self); void pdfpc_controllable_update (pdfpcControllable* self); void pdfpc_controllable_edit_note (pdfpcControllable* self); void pdfpc_controllable_ask_goto_page (pdfpcControllable* self); void pdfpc_controllable_show_overview (pdfpcControllable* self); void pdfpc_controllable_hide_overview (pdfpcControllable* self); void pdfpc_renderer_caching_set_cache (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* pdfpc_renderer_caching_get_cache (pdfpcRendererCaching* self); void pdfpc_view_behaviour_decoratable_associate_behaviour (pdfpcViewBehaviourDecoratable* self, pdfpcViewBehaviourBase* behaviour); GType pdfpc_application_get_type (void) G_GNUC_CONST; gchar* pdfpc_application_parse_command_line_options (pdfpcApplication* self, gchar** args, int args_length1); void pdfpc_application_run (pdfpcApplication* self, gchar** args, int args_length1); gint pdfpc_application_main (gchar** args, int args_length1); pdfpcApplication* pdfpc_application_new (void); pdfpcApplication* pdfpc_application_construct (GType object_type); G_END_DECLS #endif davvil-pdfpc-074a3c6/c-src/presenter_internal.h000066400000000000000000002241641177613036100215230ustar00rootroot00000000000000/* presenter_internal.h generated by valac 0.16.0, the Vala compiler, do not modify */ #ifndef __C_SRC_PRESENTER_INTERNAL_H__ #define __C_SRC_PRESENTER_INTERNAL_H__ #include #include #include #include #include #include #include #include #include #include #include G_BEGIN_DECLS #define PDFPC_TYPE_CACHE_STATUS (pdfpc_cache_status_get_type ()) #define PDFPC_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatus)) #define PDFPC_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) #define PDFPC_IS_CACHE_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_IS_CACHE_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_CACHE_STATUS)) #define PDFPC_CACHE_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_CACHE_STATUS, pdfpcCacheStatusClass)) typedef struct _pdfpcCacheStatus pdfpcCacheStatus; typedef struct _pdfpcCacheStatusClass pdfpcCacheStatusClass; typedef struct _pdfpcCacheStatusPrivate pdfpcCacheStatusPrivate; #define PDFPC_VIEW_TYPE_PRERENDERING (pdfpc_view_prerendering_get_type ()) #define PDFPC_VIEW_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerendering)) #define PDFPC_VIEW_IS_PRERENDERING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PRERENDERING)) #define PDFPC_VIEW_PRERENDERING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_TYPE_PRERENDERING, pdfpcViewPrerenderingIface)) typedef struct _pdfpcViewPrerendering pdfpcViewPrerendering; typedef struct _pdfpcViewPrerenderingIface pdfpcViewPrerenderingIface; #define PDFPC_TYPE_CONFIG_FILE_READER (pdfpc_config_file_reader_get_type ()) #define PDFPC_CONFIG_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CONFIG_FILE_READER, pdfpcConfigFileReader)) #define PDFPC_CONFIG_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_CONFIG_FILE_READER, pdfpcConfigFileReaderClass)) #define PDFPC_IS_CONFIG_FILE_READER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CONFIG_FILE_READER)) #define PDFPC_IS_CONFIG_FILE_READER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_CONFIG_FILE_READER)) #define PDFPC_CONFIG_FILE_READER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_CONFIG_FILE_READER, pdfpcConfigFileReaderClass)) typedef struct _pdfpcConfigFileReader pdfpcConfigFileReader; typedef struct _pdfpcConfigFileReaderClass pdfpcConfigFileReaderClass; typedef struct _pdfpcConfigFileReaderPrivate pdfpcConfigFileReaderPrivate; #define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController)) #define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) #define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER)) #define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass)) typedef struct _pdfpcPresentationController pdfpcPresentationController; typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass; #define PDFPC_METADATA_TYPE_BASE (pdfpc_metadata_base_get_type ()) #define PDFPC_METADATA_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBase)) #define PDFPC_METADATA_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) #define PDFPC_METADATA_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_BASE)) #define PDFPC_METADATA_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_BASE, pdfpcMetadataBaseClass)) typedef struct _pdfpcMetadataBase pdfpcMetadataBase; typedef struct _pdfpcMetadataBaseClass pdfpcMetadataBaseClass; typedef struct _pdfpcMetadataBasePrivate pdfpcMetadataBasePrivate; #define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ()) #define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf)) #define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) #define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF)) #define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass)) typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf; typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass; typedef struct _pdfpcMetadataPdfPrivate pdfpcMetadataPdfPrivate; #define PDFPC_TYPE_SLIDES_NOTES (pdfpc_slides_notes_get_type ()) #define PDFPC_SLIDES_NOTES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notes)) #define PDFPC_SLIDES_NOTES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notesClass)) #define PDFPC_IS_SLIDES_NOTES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_SLIDES_NOTES)) #define PDFPC_IS_SLIDES_NOTES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_SLIDES_NOTES)) #define PDFPC_SLIDES_NOTES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_SLIDES_NOTES, pdfpcslides_notesClass)) typedef struct _pdfpcslides_notes pdfpcslides_notes; typedef struct _pdfpcslides_notesClass pdfpcslides_notesClass; typedef struct _pdfpcslides_notesPrivate pdfpcslides_notesPrivate; #define PDFPC_TYPE_MUTEX_LOCKS (pdfpc_mutex_locks_get_type ()) #define PDFPC_MUTEX_LOCKS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_MUTEX_LOCKS, pdfpcMutexLocks)) #define PDFPC_MUTEX_LOCKS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_MUTEX_LOCKS, pdfpcMutexLocksClass)) #define PDFPC_IS_MUTEX_LOCKS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_MUTEX_LOCKS)) #define PDFPC_IS_MUTEX_LOCKS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_MUTEX_LOCKS)) #define PDFPC_MUTEX_LOCKS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_MUTEX_LOCKS, pdfpcMutexLocksClass)) typedef struct _pdfpcMutexLocks pdfpcMutexLocks; typedef struct _pdfpcMutexLocksClass pdfpcMutexLocksClass; typedef struct _pdfpcMutexLocksPrivate pdfpcMutexLocksPrivate; #define PDFPC_TYPE_OPTIONS (pdfpc_options_get_type ()) #define PDFPC_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_OPTIONS, pdfpcOptions)) #define PDFPC_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_OPTIONS, pdfpcOptionsClass)) #define PDFPC_IS_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_OPTIONS)) #define PDFPC_IS_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_OPTIONS)) #define PDFPC_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_OPTIONS, pdfpcOptionsClass)) typedef struct _pdfpcOptions pdfpcOptions; typedef struct _pdfpcOptionsClass pdfpcOptionsClass; typedef struct _pdfpcOptionsPrivate pdfpcOptionsPrivate; typedef struct _pdfpcPresentationControllerPrivate pdfpcPresentationControllerPrivate; #define PDFPC_TYPE_CONTROLLABLE (pdfpc_controllable_get_type ()) #define PDFPC_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllable)) #define PDFPC_IS_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CONTROLLABLE)) #define PDFPC_CONTROLLABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllableIface)) typedef struct _pdfpcControllable pdfpcControllable; typedef struct _pdfpcControllableIface pdfpcControllableIface; #define PDFPC_WINDOW_TYPE_OVERVIEW (pdfpc_window_overview_get_type ()) #define PDFPC_WINDOW_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverview)) #define PDFPC_WINDOW_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass)) #define PDFPC_WINDOW_IS_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_OVERVIEW)) #define PDFPC_WINDOW_IS_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_OVERVIEW)) #define PDFPC_WINDOW_OVERVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass)) typedef struct _pdfpcWindowOverview pdfpcWindowOverview; typedef struct _pdfpcWindowOverviewClass pdfpcWindowOverviewClass; #define PDFPC_TYPE_TIMER_LABEL (pdfpc_timer_label_get_type ()) #define PDFPC_TIMER_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabel)) #define PDFPC_TIMER_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabelClass)) #define PDFPC_IS_TIMER_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_TIMER_LABEL)) #define PDFPC_IS_TIMER_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_TIMER_LABEL)) #define PDFPC_TIMER_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_TIMER_LABEL, pdfpcTimerLabelClass)) typedef struct _pdfpcTimerLabel pdfpcTimerLabel; typedef struct _pdfpcTimerLabelClass pdfpcTimerLabelClass; #define PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION (pdfpc_presentation_controller_key_action_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, pdfpcPresentationControllerKeyAction)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, pdfpcPresentationControllerKeyActionClass)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_ACTION, pdfpcPresentationControllerKeyActionClass)) typedef struct _pdfpcPresentationControllerKeyAction pdfpcPresentationControllerKeyAction; typedef struct _pdfpcPresentationControllerKeyActionClass pdfpcPresentationControllerKeyActionClass; #define PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF (pdfpc_presentation_controller_key_def_get_type ()) #define PDFPC_PRESENTATION_CONTROLLER_KEY_DEF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, pdfpcPresentationControllerKeyDef)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_DEF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, pdfpcPresentationControllerKeyDefClass)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_DEF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF)) #define PDFPC_PRESENTATION_CONTROLLER_IS_KEY_DEF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF)) #define PDFPC_PRESENTATION_CONTROLLER_KEY_DEF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_KEY_DEF, pdfpcPresentationControllerKeyDefClass)) typedef struct _pdfpcPresentationControllerKeyDef pdfpcPresentationControllerKeyDef; typedef struct _pdfpcPresentationControllerKeyDefClass pdfpcPresentationControllerKeyDefClass; typedef struct _pdfpcPresentationControllerKeyActionPrivate pdfpcPresentationControllerKeyActionPrivate; typedef struct _pdfpcPresentationControllerKeyDefPrivate pdfpcPresentationControllerKeyDefPrivate; #define PDFPC_RENDERER_TYPE_BASE (pdfpc_renderer_base_get_type ()) #define PDFPC_RENDERER_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBase)) #define PDFPC_RENDERER_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) #define PDFPC_RENDERER_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_BASE)) #define PDFPC_RENDERER_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_BASE, pdfpcRendererBaseClass)) typedef struct _pdfpcRendererBase pdfpcRendererBase; typedef struct _pdfpcRendererBaseClass pdfpcRendererBaseClass; typedef struct _pdfpcRendererBasePrivate pdfpcRendererBasePrivate; #define PDFPC_RENDERER_CACHE_TYPE_BASE (pdfpc_renderer_cache_base_get_type ()) #define PDFPC_RENDERER_CACHE_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBase)) #define PDFPC_RENDERER_CACHE_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) #define PDFPC_RENDERER_CACHE_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_BASE)) #define PDFPC_RENDERER_CACHE_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_BASE, pdfpcRendererCacheBaseClass)) typedef struct _pdfpcRendererCacheBase pdfpcRendererCacheBase; typedef struct _pdfpcRendererCacheBaseClass pdfpcRendererCacheBaseClass; typedef struct _pdfpcRendererCacheBasePrivate pdfpcRendererCacheBasePrivate; #define PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY (pdfpc_renderer_cache_option_factory_get_type ()) #define PDFPC_RENDERER_CACHE_OPTION_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactory)) #define PDFPC_RENDERER_CACHE_OPTION_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactoryClass)) #define PDFPC_RENDERER_CACHE_IS_OPTION_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY)) #define PDFPC_RENDERER_CACHE_IS_OPTION_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY)) #define PDFPC_RENDERER_CACHE_OPTION_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_TYPE_OPTION_FACTORY, pdfpcRendererCacheOptionFactoryClass)) typedef struct _pdfpcRendererCacheOptionFactory pdfpcRendererCacheOptionFactory; typedef struct _pdfpcRendererCacheOptionFactoryClass pdfpcRendererCacheOptionFactoryClass; typedef struct _pdfpcRendererCacheOptionFactoryPrivate pdfpcRendererCacheOptionFactoryPrivate; #define PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE (pdfpc_renderer_cache_png_engine_get_type ()) #define PDFPC_RENDERER_CACHE_PNG_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngine)) #define PDFPC_RENDERER_CACHE_PNG_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngineClass)) #define PDFPC_RENDERER_CACHE_PNG_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_PNG_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_PNG_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ENGINE, pdfpcRendererCachePNGEngineClass)) typedef struct _pdfpcRendererCachePNGEngine pdfpcRendererCachePNGEngine; typedef struct _pdfpcRendererCachePNGEngineClass pdfpcRendererCachePNGEngineClass; typedef struct _pdfpcRendererCachePNGEnginePrivate pdfpcRendererCachePNGEnginePrivate; #define PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM (pdfpc_renderer_cache_png_item_get_type ()) #define PDFPC_RENDERER_CACHE_PNG_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItem)) #define PDFPC_RENDERER_CACHE_PNG_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItemClass)) #define PDFPC_RENDERER_CACHE_PNG_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM)) #define PDFPC_RENDERER_CACHE_PNG_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM)) #define PDFPC_RENDERER_CACHE_PNG_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_PNG_TYPE_ITEM, pdfpcRendererCachePNGItemClass)) typedef struct _pdfpcRendererCachePNGItem pdfpcRendererCachePNGItem; typedef struct _pdfpcRendererCachePNGItemClass pdfpcRendererCachePNGItemClass; typedef struct _pdfpcRendererCachePNGItemPrivate pdfpcRendererCachePNGItemPrivate; #define PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE (pdfpc_renderer_cache_simple_engine_get_type ()) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngine)) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngineClass)) #define PDFPC_RENDERER_CACHE_SIMPLE_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_SIMPLE_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE)) #define PDFPC_RENDERER_CACHE_SIMPLE_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_CACHE_SIMPLE_TYPE_ENGINE, pdfpcRendererCacheSimpleEngineClass)) typedef struct _pdfpcRendererCacheSimpleEngine pdfpcRendererCacheSimpleEngine; typedef struct _pdfpcRendererCacheSimpleEngineClass pdfpcRendererCacheSimpleEngineClass; typedef struct _pdfpcRendererCacheSimpleEnginePrivate pdfpcRendererCacheSimpleEnginePrivate; #define PDFPC_RENDERER_TYPE_CACHING (pdfpc_renderer_caching_get_type ()) #define PDFPC_RENDERER_CACHING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCaching)) #define PDFPC_RENDERER_IS_CACHING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_CACHING)) #define PDFPC_RENDERER_CACHING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_RENDERER_TYPE_CACHING, pdfpcRendererCachingIface)) typedef struct _pdfpcRendererCaching pdfpcRendererCaching; typedef struct _pdfpcRendererCachingIface pdfpcRendererCachingIface; #define PDFPC_RENDERER_TYPE_PDF (pdfpc_renderer_pdf_get_type ()) #define PDFPC_RENDERER_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdf)) #define PDFPC_RENDERER_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass)) #define PDFPC_RENDERER_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_PDF)) #define PDFPC_RENDERER_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_PDF)) #define PDFPC_RENDERER_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass)) typedef struct _pdfpcRendererPdf pdfpcRendererPdf; typedef struct _pdfpcRendererPdfClass pdfpcRendererPdfClass; typedef struct _pdfpcRendererPdfPrivate pdfpcRendererPdfPrivate; #define PDFPC_TYPE_SCALER (pdfpc_scaler_get_type ()) #define PDFPC_SCALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_SCALER, pdfpcScaler)) #define PDFPC_SCALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_SCALER, pdfpcScalerClass)) #define PDFPC_IS_SCALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_SCALER)) #define PDFPC_IS_SCALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_SCALER)) #define PDFPC_SCALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_SCALER, pdfpcScalerClass)) typedef struct _pdfpcScaler pdfpcScaler; typedef struct _pdfpcScalerClass pdfpcScalerClass; typedef struct _pdfpcScalerPrivate pdfpcScalerPrivate; typedef struct _pdfpcTimerLabelPrivate pdfpcTimerLabelPrivate; #define PDFPC_TYPE_COUNTDOWN_TIMER (pdfpc_countdown_timer_get_type ()) #define PDFPC_COUNTDOWN_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_COUNTDOWN_TIMER, pdfpcCountdownTimer)) #define PDFPC_COUNTDOWN_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_COUNTDOWN_TIMER, pdfpcCountdownTimerClass)) #define PDFPC_IS_COUNTDOWN_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_COUNTDOWN_TIMER)) #define PDFPC_IS_COUNTDOWN_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_COUNTDOWN_TIMER)) #define PDFPC_COUNTDOWN_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_COUNTDOWN_TIMER, pdfpcCountdownTimerClass)) typedef struct _pdfpcCountdownTimer pdfpcCountdownTimer; typedef struct _pdfpcCountdownTimerClass pdfpcCountdownTimerClass; typedef struct _pdfpcCountdownTimerPrivate pdfpcCountdownTimerPrivate; #define PDFPC_TYPE_END_TIME_TIMER (pdfpc_end_time_timer_get_type ()) #define PDFPC_END_TIME_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_END_TIME_TIMER, pdfpcEndTimeTimer)) #define PDFPC_END_TIME_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_END_TIME_TIMER, pdfpcEndTimeTimerClass)) #define PDFPC_IS_END_TIME_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_END_TIME_TIMER)) #define PDFPC_IS_END_TIME_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_END_TIME_TIMER)) #define PDFPC_END_TIME_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_END_TIME_TIMER, pdfpcEndTimeTimerClass)) typedef struct _pdfpcEndTimeTimer pdfpcEndTimeTimer; typedef struct _pdfpcEndTimeTimerClass pdfpcEndTimeTimerClass; typedef struct _pdfpcEndTimeTimerPrivate pdfpcEndTimeTimerPrivate; #define PDFPC_TYPE_COUNTUP_TIMER (pdfpc_countup_timer_get_type ()) #define PDFPC_COUNTUP_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_COUNTUP_TIMER, pdfpcCountupTimer)) #define PDFPC_COUNTUP_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_COUNTUP_TIMER, pdfpcCountupTimerClass)) #define PDFPC_IS_COUNTUP_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_COUNTUP_TIMER)) #define PDFPC_IS_COUNTUP_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_COUNTUP_TIMER)) #define PDFPC_COUNTUP_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_COUNTUP_TIMER, pdfpcCountupTimerClass)) typedef struct _pdfpcCountupTimer pdfpcCountupTimer; typedef struct _pdfpcCountupTimerClass pdfpcCountupTimerClass; typedef struct _pdfpcCountupTimerPrivate pdfpcCountupTimerPrivate; #define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ()) #define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase)) #define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) #define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE)) #define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass)) typedef struct _pdfpcViewBase pdfpcViewBase; typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass; typedef struct _pdfpcViewBasePrivate pdfpcViewBasePrivate; #define PDFPC_VIEW_BEHAVIOUR_TYPE_BASE (pdfpc_view_behaviour_base_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBase)) #define PDFPC_VIEW_BEHAVIOUR_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE)) #define PDFPC_VIEW_BEHAVIOUR_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass)) typedef struct _pdfpcViewBehaviourBase pdfpcViewBehaviourBase; typedef struct _pdfpcViewBehaviourBaseClass pdfpcViewBehaviourBaseClass; typedef struct _pdfpcViewBehaviourBasePrivate pdfpcViewBehaviourBasePrivate; #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION (pdfpc_view_behaviour_pdf_link_implementation_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementation)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementationClass)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_IMPLEMENTATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_IMPLEMENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementationClass)) typedef struct _pdfpcViewBehaviourPdfLinkImplementation pdfpcViewBehaviourPdfLinkImplementation; typedef struct _pdfpcViewBehaviourPdfLinkImplementationClass pdfpcViewBehaviourPdfLinkImplementationClass; typedef struct _pdfpcViewBehaviourPdfLinkImplementationPrivate pdfpcViewBehaviourPdfLinkImplementationPrivate; #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER (pdfpc_view_behaviour_pdf_link_signal_provider_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProvider)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProviderClass)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_SIGNAL_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_SIGNAL_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER)) #define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProviderClass)) typedef struct _pdfpcViewBehaviourPdfLinkSignalProvider pdfpcViewBehaviourPdfLinkSignalProvider; typedef struct _pdfpcViewBehaviourPdfLinkSignalProviderClass pdfpcViewBehaviourPdfLinkSignalProviderClass; typedef struct _pdfpcViewBehaviourPdfLinkSignalProviderPrivate pdfpcViewBehaviourPdfLinkSignalProviderPrivate; #define PDFPC_VIEW_TYPE_DEFAULT (pdfpc_view_default_get_type ()) #define PDFPC_VIEW_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefault)) #define PDFPC_VIEW_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) #define PDFPC_VIEW_IS_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_IS_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_DEFAULT)) #define PDFPC_VIEW_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass)) typedef struct _pdfpcViewDefault pdfpcViewDefault; typedef struct _pdfpcViewDefaultClass pdfpcViewDefaultClass; #define PDFPC_VIEW_TYPE_PDF (pdfpc_view_pdf_get_type ()) #define PDFPC_VIEW_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdf)) #define PDFPC_VIEW_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) #define PDFPC_VIEW_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_PDF)) #define PDFPC_VIEW_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass)) typedef struct _pdfpcViewPdf pdfpcViewPdf; typedef struct _pdfpcViewPdfClass pdfpcViewPdfClass; #define PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE (pdfpc_view_behaviour_decoratable_get_type ()) #define PDFPC_VIEW_BEHAVIOUR_DECORATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE, pdfpcViewBehaviourDecoratable)) #define PDFPC_VIEW_BEHAVIOUR_IS_DECORATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE)) #define PDFPC_VIEW_BEHAVIOUR_DECORATABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_DECORATABLE, pdfpcViewBehaviourDecoratableIface)) typedef struct _pdfpcViewBehaviourDecoratable pdfpcViewBehaviourDecoratable; typedef struct _pdfpcViewBehaviourDecoratableIface pdfpcViewBehaviourDecoratableIface; typedef struct _pdfpcViewDefaultPrivate pdfpcViewDefaultPrivate; typedef struct _pdfpcViewPdfPrivate pdfpcViewPdfPrivate; #define PDFPC_WINDOW_TYPE_FULLSCREEN (pdfpc_window_fullscreen_get_type ()) #define PDFPC_WINDOW_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreen)) #define PDFPC_WINDOW_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) #define PDFPC_WINDOW_IS_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_IS_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN)) #define PDFPC_WINDOW_FULLSCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass)) typedef struct _pdfpcWindowFullscreen pdfpcWindowFullscreen; typedef struct _pdfpcWindowFullscreenClass pdfpcWindowFullscreenClass; typedef struct _pdfpcWindowFullscreenPrivate pdfpcWindowFullscreenPrivate; typedef struct _pdfpcWindowOverviewPrivate pdfpcWindowOverviewPrivate; #define PDFPC_WINDOW_TYPE_PRESENTER (pdfpc_window_presenter_get_type ()) #define PDFPC_WINDOW_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenter)) #define PDFPC_WINDOW_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass)) #define PDFPC_WINDOW_IS_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_PRESENTER)) #define PDFPC_WINDOW_IS_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_PRESENTER)) #define PDFPC_WINDOW_PRESENTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass)) typedef struct _pdfpcWindowPresenter pdfpcWindowPresenter; typedef struct _pdfpcWindowPresenterClass pdfpcWindowPresenterClass; #define PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT (pdfpc_window_cell_renderer_highlight_get_type ()) #define PDFPC_WINDOW_CELL_RENDERER_HIGHLIGHT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT, pdfpcWindowCellRendererHighlight)) #define PDFPC_WINDOW_CELL_RENDERER_HIGHLIGHT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT, pdfpcWindowCellRendererHighlightClass)) #define PDFPC_WINDOW_IS_CELL_RENDERER_HIGHLIGHT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT)) #define PDFPC_WINDOW_IS_CELL_RENDERER_HIGHLIGHT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT)) #define PDFPC_WINDOW_CELL_RENDERER_HIGHLIGHT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_CELL_RENDERER_HIGHLIGHT, pdfpcWindowCellRendererHighlightClass)) typedef struct _pdfpcWindowCellRendererHighlight pdfpcWindowCellRendererHighlight; typedef struct _pdfpcWindowCellRendererHighlightClass pdfpcWindowCellRendererHighlightClass; typedef struct _pdfpcWindowCellRendererHighlightPrivate pdfpcWindowCellRendererHighlightPrivate; #define PDFPC_WINDOW_TYPE_PRESENTATION (pdfpc_window_presentation_get_type ()) #define PDFPC_WINDOW_PRESENTATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentation)) #define PDFPC_WINDOW_PRESENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentationClass)) #define PDFPC_WINDOW_IS_PRESENTATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_PRESENTATION)) #define PDFPC_WINDOW_IS_PRESENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_PRESENTATION)) #define PDFPC_WINDOW_PRESENTATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_PRESENTATION, pdfpcWindowPresentationClass)) typedef struct _pdfpcWindowPresentation pdfpcWindowPresentation; typedef struct _pdfpcWindowPresentationClass pdfpcWindowPresentationClass; typedef struct _pdfpcWindowPresentationPrivate pdfpcWindowPresentationPrivate; typedef struct _pdfpcWindowPresenterPrivate pdfpcWindowPresenterPrivate; #define PDFPC_TYPE_APPLICATION (pdfpc_application_get_type ()) #define PDFPC_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_APPLICATION, pdfpcApplication)) #define PDFPC_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_APPLICATION, pdfpcApplicationClass)) #define PDFPC_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_APPLICATION)) #define PDFPC_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_APPLICATION)) #define PDFPC_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_APPLICATION, pdfpcApplicationClass)) typedef struct _pdfpcApplication pdfpcApplication; typedef struct _pdfpcApplicationClass pdfpcApplicationClass; typedef struct _pdfpcApplicationPrivate pdfpcApplicationPrivate; struct _pdfpcCacheStatus { GTypeInstance parent_instance; volatile int ref_count; pdfpcCacheStatusPrivate * priv; gint current_value; gint max_value; }; struct _pdfpcCacheStatusClass { GTypeClass parent_class; void (*finalize) (pdfpcCacheStatus *self); }; typedef void (*pdfpcCacheStatusUpdateFunction) (gdouble progress, void* user_data); typedef void (*pdfpcCacheStatusUpdateComplete) (void* user_data); struct _pdfpcViewPrerenderingIface { GTypeInterface parent_iface; }; struct _pdfpcConfigFileReader { GTypeInstance parent_instance; volatile int ref_count; pdfpcConfigFileReaderPrivate * priv; pdfpcPresentationController* presentation_controller; }; struct _pdfpcConfigFileReaderClass { GTypeClass parent_class; void (*finalize) (pdfpcConfigFileReader *self); }; struct _pdfpcMetadataBase { GObject parent_instance; pdfpcMetadataBasePrivate * priv; gchar* fname; gchar* url; }; struct _pdfpcMetadataBaseClass { GObjectClass parent_class; guint (*get_slide_count) (pdfpcMetadataBase* self); }; struct _pdfpcMetadataPdf { pdfpcMetadataBase parent_instance; pdfpcMetadataPdfPrivate * priv; gchar* pdf_fname; gchar* pdf_url; gchar* pdfpc_url; PopplerDocument* document; gdouble page_width; gdouble page_height; guint page_count; pdfpcslides_notes* notes; gboolean skips_by_user; guint duration; }; struct _pdfpcMetadataPdfClass { pdfpcMetadataBaseClass parent_class; }; struct _pdfpcslides_notes { GObject parent_instance; pdfpcslides_notesPrivate * priv; gchar** notes; gint notes_length1; }; struct _pdfpcslides_notesClass { GObjectClass parent_class; }; struct _pdfpcMutexLocks { GObject parent_instance; pdfpcMutexLocksPrivate * priv; }; struct _pdfpcMutexLocksClass { GObjectClass parent_class; }; struct _pdfpcOptions { GObject parent_instance; pdfpcOptionsPrivate * priv; }; struct _pdfpcOptionsClass { GObjectClass parent_class; }; struct _pdfpcControllableIface { GTypeInterface parent_iface; pdfpcPresentationController* (*get_controller) (pdfpcControllable* self); void (*update) (pdfpcControllable* self); void (*edit_note) (pdfpcControllable* self); void (*ask_goto_page) (pdfpcControllable* self); void (*show_overview) (pdfpcControllable* self); void (*hide_overview) (pdfpcControllable* self); }; struct _pdfpcPresentationController { GObject parent_instance; pdfpcPresentationControllerPrivate * priv; gint current_slide_number; gint current_user_slide_number; gboolean faded_to_black; gboolean frozen; gboolean black_on_end; gint n_slides; GList* controllables; gboolean ignore_keyboard_events; gboolean ignore_mouse_events; pdfpcMetadataPdf* metadata; pdfpcWindowOverview* overview; gboolean overview_shown; guint last_key_event; pdfpcTimerLabel* timer; GeeHashMap* actionNames; GeeHashMap* keyBindings; GeeHashMap* mouseBindings; }; struct _pdfpcPresentationControllerClass { GObjectClass parent_class; }; typedef void (*pdfpcPresentationControllerKeyActionKeyActionDelegate) (void* user_data); struct _pdfpcPresentationControllerKeyAction { GTypeInstance parent_instance; volatile int ref_count; pdfpcPresentationControllerKeyActionPrivate * priv; pdfpcPresentationControllerKeyActionKeyActionDelegate d; gpointer d_target; GDestroyNotify d_target_destroy_notify; }; struct _pdfpcPresentationControllerKeyActionClass { GTypeClass parent_class; void (*finalize) (pdfpcPresentationControllerKeyAction *self); }; struct _pdfpcPresentationControllerKeyDef { GTypeInstance parent_instance; volatile int ref_count; pdfpcPresentationControllerKeyDefPrivate * priv; }; struct _pdfpcPresentationControllerKeyDefClass { GTypeClass parent_class; void (*finalize) (pdfpcPresentationControllerKeyDef *self); }; typedef enum { PDFPC_RENDERER_RENDER_ERROR_SLIDE_DOES_NOT_EXIST } pdfpcRendererRenderError; #define PDFPC_RENDERER_RENDER_ERROR pdfpc_renderer_render_error_quark () struct _pdfpcRendererBase { GObject parent_instance; pdfpcRendererBasePrivate * priv; pdfpcMetadataBase* metadata; gint width; gint height; }; struct _pdfpcRendererBaseClass { GObjectClass parent_class; GdkPixmap* (*render_to_pixmap) (pdfpcRendererBase* self, gint slide_number, GError** error); GdkPixmap* (*fade_to_black) (pdfpcRendererBase* self); }; struct _pdfpcRendererCacheBase { GObject parent_instance; pdfpcRendererCacheBasePrivate * priv; pdfpcMetadataBase* metadata; }; struct _pdfpcRendererCacheBaseClass { GObjectClass parent_class; void (*store) (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap); GdkPixmap* (*retrieve) (pdfpcRendererCacheBase* self, guint index); }; struct _pdfpcRendererCacheOptionFactory { GObject parent_instance; pdfpcRendererCacheOptionFactoryPrivate * priv; }; struct _pdfpcRendererCacheOptionFactoryClass { GObjectClass parent_class; }; struct _pdfpcRendererCachePNGEngine { pdfpcRendererCacheBase parent_instance; pdfpcRendererCachePNGEnginePrivate * priv; pdfpcRendererCachePNGItem** storage; gint storage_length1; GMutex* mutex; }; struct _pdfpcRendererCachePNGEngineClass { pdfpcRendererCacheBaseClass parent_class; }; struct _pdfpcRendererCachePNGItem { GObject parent_instance; pdfpcRendererCachePNGItemPrivate * priv; guint8* data; gint data_length1; }; struct _pdfpcRendererCachePNGItemClass { GObjectClass parent_class; }; struct _pdfpcRendererCacheSimpleEngine { pdfpcRendererCacheBase parent_instance; pdfpcRendererCacheSimpleEnginePrivate * priv; GdkPixmap** storage; gint storage_length1; GMutex* mutex; }; struct _pdfpcRendererCacheSimpleEngineClass { pdfpcRendererCacheBaseClass parent_class; }; struct _pdfpcRendererCachingIface { GTypeInterface parent_iface; void (*set_cache) (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* (*get_cache) (pdfpcRendererCaching* self); }; struct _pdfpcRendererPdf { pdfpcRendererBase parent_instance; pdfpcRendererPdfPrivate * priv; gdouble scaling_factor; pdfpcRendererCacheBase* cache; }; struct _pdfpcRendererPdfClass { pdfpcRendererBaseClass parent_class; }; struct _pdfpcScaler { GObject parent_instance; pdfpcScalerPrivate * priv; gdouble initial_width; gdouble initial_height; }; struct _pdfpcScalerClass { GObjectClass parent_class; }; struct _pdfpcTimerLabel { GtkLabel parent_instance; pdfpcTimerLabelPrivate * priv; gint time; time_t start_time; guint timeout; GdkColor normal_color; GdkColor pretalk_color; }; struct _pdfpcTimerLabelClass { GtkLabelClass parent_class; void (*start) (pdfpcTimerLabel* self); void (*stop) (pdfpcTimerLabel* self); void (*reset) (pdfpcTimerLabel* self); gboolean (*on_timeout) (pdfpcTimerLabel* self); void (*format_time) (pdfpcTimerLabel* self); }; struct _pdfpcCountdownTimer { pdfpcTimerLabel parent_instance; pdfpcCountdownTimerPrivate * priv; gint duration; guint last_minutes; GdkColor last_minutes_color; GdkColor negative_color; }; struct _pdfpcCountdownTimerClass { pdfpcTimerLabelClass parent_class; }; struct _pdfpcEndTimeTimer { pdfpcCountdownTimer parent_instance; pdfpcEndTimeTimerPrivate * priv; time_t end_time; struct tm end_time_object; }; struct _pdfpcEndTimeTimerClass { pdfpcCountdownTimerClass parent_class; }; struct _pdfpcCountupTimer { pdfpcTimerLabel parent_instance; pdfpcCountupTimerPrivate * priv; }; struct _pdfpcCountupTimerClass { pdfpcTimerLabelClass parent_class; }; struct _pdfpcViewBase { GtkDrawingArea parent_instance; pdfpcViewBasePrivate * priv; pdfpcRendererBase* renderer; }; struct _pdfpcViewBaseClass { GtkDrawingAreaClass parent_class; void (*display) (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); void (*fade_to_black) (pdfpcViewBase* self); void (*redraw) (pdfpcViewBase* self, GError** error); gint (*get_current_slide_number) (pdfpcViewBase* self); }; typedef enum { PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_BEHAVIOUR_ALREADY_ASSOCIATED, PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_VIEW_NOT_SUPPORTED } pdfpcViewBehaviourAssociationError; #define PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR pdfpc_view_behaviour_association_error_quark () struct _pdfpcViewBehaviourBase { GObject parent_instance; pdfpcViewBehaviourBasePrivate * priv; pdfpcViewBase* target; }; struct _pdfpcViewBehaviourBaseClass { GObjectClass parent_class; void (*associate) (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); }; struct _pdfpcViewBehaviourPdfLinkImplementation { pdfpcViewBehaviourBase parent_instance; pdfpcViewBehaviourPdfLinkImplementationPrivate * priv; pdfpcViewBehaviourPdfLinkSignalProvider* signal_provider; pdfpcPresentationController* presentation_controller; }; struct _pdfpcViewBehaviourPdfLinkImplementationClass { pdfpcViewBehaviourBaseClass parent_class; }; struct _pdfpcViewBehaviourPdfLinkSignalProvider { GObject parent_instance; pdfpcViewBehaviourPdfLinkSignalProviderPrivate * priv; pdfpcViewPdf* target; PopplerLinkMapping* active_mapping; GList* page_link_mappings; GdkRectangle* precalculated_mapping_rectangles; gint precalculated_mapping_rectangles_length1; }; struct _pdfpcViewBehaviourPdfLinkSignalProviderClass { GObjectClass parent_class; }; struct _pdfpcViewBehaviourDecoratableIface { GTypeInterface parent_iface; void (*associate_behaviour) (pdfpcViewBehaviourDecoratable* self, pdfpcViewBehaviourBase* behaviour); }; struct _pdfpcViewDefault { pdfpcViewBase parent_instance; pdfpcViewDefaultPrivate * priv; gint current_slide_number; GdkPixmap* current_slide; gint n_slides; gint slide_limit; GList* behaviours; }; struct _pdfpcViewDefaultClass { pdfpcViewBaseClass parent_class; }; struct _pdfpcViewPdf { pdfpcViewDefault parent_instance; pdfpcViewPdfPrivate * priv; }; struct _pdfpcViewPdfClass { pdfpcViewDefaultClass parent_class; }; struct _pdfpcWindowFullscreen { GtkWindow parent_instance; pdfpcWindowFullscreenPrivate * priv; GdkRectangle screen_geometry; guint hide_cursor_timeout; gboolean faded_to_black; gboolean frozen; }; struct _pdfpcWindowFullscreenClass { GtkWindowClass parent_class; }; struct _pdfpcWindowOverview { GtkScrolledWindow parent_instance; pdfpcWindowOverviewPrivate * priv; GtkListStore* slides; GtkIconView* slides_view; pdfpcMetadataPdf* metadata; gint n_slides; gint last_structure_n_slides; gint target_width; gint target_height; gint next_undone_preview; guint idle_id; pdfpcRendererCacheBase* cache; pdfpcPresentationController* presentation_controller; pdfpcWindowPresenter* presenter; gdouble aspect_ratio; gint max_width; gint max_height; }; struct _pdfpcWindowOverviewClass { GtkScrolledWindowClass parent_class; }; struct _pdfpcWindowCellRendererHighlight { GtkCellRendererPixbuf parent_instance; pdfpcWindowCellRendererHighlightPrivate * priv; }; struct _pdfpcWindowCellRendererHighlightClass { GtkCellRendererPixbufClass parent_class; }; struct _pdfpcWindowPresentation { pdfpcWindowFullscreen parent_instance; pdfpcWindowPresentationPrivate * priv; pdfpcPresentationController* presentation_controller; pdfpcViewBase* view; }; struct _pdfpcWindowPresentationClass { pdfpcWindowFullscreenClass parent_class; }; struct _pdfpcWindowPresenter { pdfpcWindowFullscreen parent_instance; pdfpcWindowPresenterPrivate * priv; pdfpcPresentationController* presentation_controller; pdfpcViewBase* current_view; pdfpcViewBase* next_view; pdfpcViewBase* strict_next_view; pdfpcViewBase* strict_prev_view; pdfpcTimerLabel* timer; GtkEntry* slide_progress; GtkProgressBar* prerender_progress; GtkImage* blank_icon; GtkImage* frozen_icon; GtkImage* pause_icon; GtkTextView* notes_view; GtkHBox* slideViews; pdfpcWindowOverview* overview; GtkAlignment* centered_overview; gboolean overview_added; GtkVBox* fullLayout; guint slide_count; pdfpcMetadataPdf* metadata; GdkColor black; GdkColor white; }; struct _pdfpcWindowPresenterClass { pdfpcWindowFullscreenClass parent_class; }; struct _pdfpcApplication { GObject parent_instance; pdfpcApplicationPrivate * priv; }; struct _pdfpcApplicationClass { GObjectClass parent_class; }; gpointer pdfpc_cache_status_ref (gpointer instance); void pdfpc_cache_status_unref (gpointer instance); GParamSpec* pdfpc_param_spec_cache_status (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_value_set_cache_status (GValue* value, gpointer v_object); void pdfpc_value_take_cache_status (GValue* value, gpointer v_object); gpointer pdfpc_value_get_cache_status (const GValue* value); GType pdfpc_cache_status_get_type (void) G_GNUC_CONST; void pdfpc_cache_status_register_update (pdfpcCacheStatus* self, pdfpcCacheStatusUpdateFunction update, void* update_target, pdfpcCacheStatusUpdateComplete complete, void* complete_target); void pdfpc_cache_status_update (pdfpcCacheStatus* self); GType pdfpc_view_prerendering_get_type (void) G_GNUC_CONST; void pdfpc_cache_status_monitor_view (pdfpcCacheStatus* self, pdfpcViewPrerendering* view); pdfpcCacheStatus* pdfpc_cache_status_new (void); pdfpcCacheStatus* pdfpc_cache_status_construct (GType object_type); gpointer pdfpc_config_file_reader_ref (gpointer instance); void pdfpc_config_file_reader_unref (gpointer instance); GParamSpec* pdfpc_param_spec_config_file_reader (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_value_set_config_file_reader (GValue* value, gpointer v_object); void pdfpc_value_take_config_file_reader (GValue* value, gpointer v_object); gpointer pdfpc_value_get_config_file_reader (const GValue* value); GType pdfpc_config_file_reader_get_type (void) G_GNUC_CONST; GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST; pdfpcConfigFileReader* pdfpc_config_file_reader_new (pdfpcPresentationController* controller); pdfpcConfigFileReader* pdfpc_config_file_reader_construct (GType object_type, pdfpcPresentationController* controller); void pdfpc_config_file_reader_readConfig (pdfpcConfigFileReader* self, const gchar* fname); GType pdfpc_metadata_base_get_type (void) G_GNUC_CONST; pdfpcMetadataBase* pdfpc_metadata_base_construct (GType object_type, const gchar* fname); gchar* pdfpc_metadata_base_get_url (pdfpcMetadataBase* self); guint pdfpc_metadata_base_get_slide_count (pdfpcMetadataBase* self); GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST; GType pdfpc_slides_notes_get_type (void) G_GNUC_CONST; void pdfpc_metadata_pdf_save_to_disk (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_skips (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_end_user_slide (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_notes (pdfpcMetadataPdf* self); gchar* pdfpc_metadata_pdf_format_duration (pdfpcMetadataPdf* self); pdfpcMetadataPdf* pdfpc_metadata_pdf_new (const gchar* fname); pdfpcMetadataPdf* pdfpc_metadata_pdf_construct (GType object_type, const gchar* fname); gint pdfpc_metadata_pdf_get_user_slide_count (pdfpcMetadataPdf* self); gint pdfpc_metadata_pdf_get_end_user_slide (pdfpcMetadataPdf* self); void pdfpc_metadata_pdf_set_end_user_slide (pdfpcMetadataPdf* self, gint slide); gint pdfpc_metadata_pdf_toggle_skip (pdfpcMetadataPdf* self, gint slide_number, gint user_slide_number); gint pdfpc_metadata_pdf_user_slide_to_real_slide (pdfpcMetadataPdf* self, gint number); gint pdfpc_metadata_pdf_real_slide_to_user_slide (pdfpcMetadataPdf* self, gint number); gdouble pdfpc_metadata_pdf_get_page_width (pdfpcMetadataPdf* self); gdouble pdfpc_metadata_pdf_get_page_height (pdfpcMetadataPdf* self); PopplerDocument* pdfpc_metadata_pdf_get_document (pdfpcMetadataPdf* self); pdfpcslides_notes* pdfpc_metadata_pdf_get_notes (pdfpcMetadataPdf* self); guint pdfpc_metadata_pdf_get_duration (pdfpcMetadataPdf* self); void pdfpc_metadata_pdf_set_duration (pdfpcMetadataPdf* self, guint d); PopplerDocument* pdfpc_metadata_pdf_open_pdf_document (pdfpcMetadataPdf* self, const gchar* url); void pdfpc_slides_notes_set_note (pdfpcslides_notes* self, const gchar* note, gint slide_number); gchar* pdfpc_slides_notes_get_note_for_slide (pdfpcslides_notes* self, gint number); gboolean pdfpc_slides_notes_has_notes (pdfpcslides_notes* self); gchar* pdfpc_slides_notes_format_to_save (pdfpcslides_notes* self); void pdfpc_slides_notes_parse_lines (pdfpcslides_notes* self, gchar** lines, int lines_length1); pdfpcslides_notes* pdfpc_slides_notes_new (void); pdfpcslides_notes* pdfpc_slides_notes_construct (GType object_type); GType pdfpc_mutex_locks_get_type (void) G_GNUC_CONST; extern GMutex* pdfpc_mutex_locks_poppler; void pdfpc_mutex_locks_init (void); pdfpcMutexLocks* pdfpc_mutex_locks_new (void); pdfpcMutexLocks* pdfpc_mutex_locks_construct (GType object_type); GType pdfpc_options_get_type (void) G_GNUC_CONST; extern gboolean pdfpc_options_display_switch; extern gboolean pdfpc_options_single_screen; extern gboolean pdfpc_options_windowed; extern gboolean pdfpc_options_disable_caching; extern gboolean pdfpc_options_disable_cache_compression; extern guint pdfpc_options_duration; extern guint pdfpc_options_last_minutes; extern guint pdfpc_options_current_size; extern gint pdfpc_options_min_overview_width; extern gchar* pdfpc_options_start_time; extern gchar* pdfpc_options_end_time; extern gboolean pdfpc_options_black_on_end; extern gboolean pdfpc_options_list_actions; pdfpcOptions* pdfpc_options_new (void); pdfpcOptions* pdfpc_options_construct (GType object_type); GType pdfpc_controllable_get_type (void) G_GNUC_CONST; GType pdfpc_window_overview_get_type (void) G_GNUC_CONST; GType pdfpc_timer_label_get_type (void) G_GNUC_CONST; gpointer pdfpc_presentation_controller_key_action_ref (gpointer instance); void pdfpc_presentation_controller_key_action_unref (gpointer instance); GParamSpec* pdfpc_presentation_controller_param_spec_key_action (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_presentation_controller_value_set_key_action (GValue* value, gpointer v_object); void pdfpc_presentation_controller_value_take_key_action (GValue* value, gpointer v_object); gpointer pdfpc_presentation_controller_value_get_key_action (const GValue* value); GType pdfpc_presentation_controller_key_action_get_type (void) G_GNUC_CONST; gpointer pdfpc_presentation_controller_key_def_ref (gpointer instance); void pdfpc_presentation_controller_key_def_unref (gpointer instance); GParamSpec* pdfpc_presentation_controller_param_spec_key_def (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags); void pdfpc_presentation_controller_value_set_key_def (GValue* value, gpointer v_object); void pdfpc_presentation_controller_value_take_key_def (GValue* value, gpointer v_object); gpointer pdfpc_presentation_controller_value_get_key_def (const GValue* value); GType pdfpc_presentation_controller_key_def_get_type (void) G_GNUC_CONST; pdfpcPresentationController* pdfpc_presentation_controller_new (pdfpcMetadataPdf* metadata, gboolean allow_black_on_end); pdfpcPresentationController* pdfpc_presentation_controller_construct (GType object_type, pdfpcMetadataPdf* metadata, gboolean allow_black_on_end); void pdfpc_presentation_controller_set_overview (pdfpcPresentationController* self, pdfpcWindowOverview* o); void pdfpc_presentation_controller_fillActionNames (pdfpcPresentationController* self); gchar** pdfpc_presentation_controller_getActionDescriptions (int* result_length1); void pdfpc_presentation_controller_bind (pdfpcPresentationController* self, guint keycode, guint modMask, const gchar* function); void pdfpc_presentation_controller_unbind (pdfpcPresentationController* self, guint keycode, guint modMask); void pdfpc_presentation_controller_unbindAll (pdfpcPresentationController* self); void pdfpc_presentation_controller_bindMouse (pdfpcPresentationController* self, guint button, guint modMask, const gchar* function); void pdfpc_presentation_controller_unbindMouse (pdfpcPresentationController* self, guint keycode, guint modMask); void pdfpc_presentation_controller_unbindAllMouse (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_key_press (pdfpcPresentationController* self, GdkEventKey* key); gboolean pdfpc_presentation_controller_button_press (pdfpcPresentationController* self, GdkEventButton* button); void pdfpc_presentation_controller_scroll (pdfpcPresentationController* self, GdkEventScroll* scroll); gint pdfpc_presentation_controller_get_current_slide_number (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_current_user_slide_number (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_skip_previous (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_skip_next (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_n_slide (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_user_n_slides (pdfpcPresentationController* self); gint pdfpc_presentation_controller_get_end_user_slide (pdfpcPresentationController* self); void pdfpc_presentation_controller_set_end_user_slide (pdfpcPresentationController* self); void pdfpc_presentation_controller_set_end_user_slide_overview (pdfpcPresentationController* self); void pdfpc_presentation_controller_page_change_request (pdfpcPresentationController* self, gint page_number); void pdfpc_presentation_controller_set_ignore_input_events (pdfpcPresentationController* self, gboolean v); void pdfpc_presentation_controller_set_ignore_mouse_events (pdfpcPresentationController* self, gboolean v); pdfpcTimerLabel* pdfpc_presentation_controller_getTimer (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_register_controllable (pdfpcPresentationController* self, pdfpcControllable* controllable); void pdfpc_presentation_controller_next_page (pdfpcPresentationController* self); void pdfpc_presentation_controller_next_user_page (pdfpcPresentationController* self); void pdfpc_presentation_controller_previous_page (pdfpcPresentationController* self); void pdfpc_presentation_controller_previous_user_page (pdfpcPresentationController* self); void pdfpc_presentation_controller_goto_first (pdfpcPresentationController* self); void pdfpc_presentation_controller_goto_last (pdfpcPresentationController* self); void pdfpc_presentation_controller_jump10 (pdfpcPresentationController* self); void pdfpc_presentation_controller_back10 (pdfpcPresentationController* self); void pdfpc_presentation_controller_goto_user_page (pdfpcPresentationController* self, gint page_number); void pdfpc_presentation_controller_history_back (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_update (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_reset (pdfpcPresentationController* self); void pdfpc_presentation_controller_toggle_overview (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_show_overview (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_hide_overview (pdfpcPresentationController* self); void pdfpc_presentation_controller_fade_to_black (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_is_faded_to_black (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_edit_note (pdfpcPresentationController* self); void pdfpc_presentation_controller_controllables_ask_goto_page (pdfpcPresentationController* self); void pdfpc_presentation_controller_toggle_freeze (pdfpcPresentationController* self); gboolean pdfpc_presentation_controller_is_frozen (pdfpcPresentationController* self); void pdfpc_presentation_controller_toggle_skip (pdfpcPresentationController* self); void pdfpc_presentation_controller_start (pdfpcPresentationController* self); void pdfpc_presentation_controller_toggle_pause (pdfpcPresentationController* self); void pdfpc_presentation_controller_reset_timer (pdfpcPresentationController* self); void pdfpc_presentation_controller_exit_state (pdfpcPresentationController* self); void pdfpc_presentation_controller_quit (pdfpcPresentationController* self); guint pdfpc_presentation_controller_get_accepted_key_mods (pdfpcPresentationController* self); void pdfpc_presentation_controller_set_accepted_key_mods (pdfpcPresentationController* self, guint value); pdfpcPresentationControllerKeyAction* pdfpc_presentation_controller_key_action_new (pdfpcPresentationControllerKeyActionKeyActionDelegate d, void* d_target); pdfpcPresentationControllerKeyAction* pdfpc_presentation_controller_key_action_construct (GType object_type, pdfpcPresentationControllerKeyActionKeyActionDelegate d, void* d_target); pdfpcPresentationControllerKeyDef* pdfpc_presentation_controller_key_def_new (guint k, guint m); pdfpcPresentationControllerKeyDef* pdfpc_presentation_controller_key_def_construct (GType object_type, guint k, guint m); guint pdfpc_presentation_controller_key_def_hash (void* _a); gboolean pdfpc_presentation_controller_key_def_equal (void* _a, void* _b); guint pdfpc_presentation_controller_key_def_get_keycode (pdfpcPresentationControllerKeyDef* self); void pdfpc_presentation_controller_key_def_set_keycode (pdfpcPresentationControllerKeyDef* self, guint value); guint pdfpc_presentation_controller_key_def_get_modMask (pdfpcPresentationControllerKeyDef* self); void pdfpc_presentation_controller_key_def_set_modMask (pdfpcPresentationControllerKeyDef* self, guint value); GType pdfpc_renderer_base_get_type (void) G_GNUC_CONST; GQuark pdfpc_renderer_render_error_quark (void); pdfpcRendererBase* pdfpc_renderer_base_construct (GType object_type, pdfpcMetadataBase* metadata, gint width, gint height); pdfpcMetadataBase* pdfpc_renderer_base_get_metadata (pdfpcRendererBase* self); gint pdfpc_renderer_base_get_width (pdfpcRendererBase* self); gint pdfpc_renderer_base_get_height (pdfpcRendererBase* self); GdkPixmap* pdfpc_renderer_base_render_to_pixmap (pdfpcRendererBase* self, gint slide_number, GError** error); GdkPixmap* pdfpc_renderer_base_fade_to_black (pdfpcRendererBase* self); GType pdfpc_renderer_cache_base_get_type (void) G_GNUC_CONST; pdfpcRendererCacheBase* pdfpc_renderer_cache_base_construct (GType object_type, pdfpcMetadataBase* metadata); gboolean pdfpc_renderer_cache_base_allows_prerendering (pdfpcRendererCacheBase* self); void pdfpc_renderer_cache_base_store (pdfpcRendererCacheBase* self, guint index, GdkPixmap* pixmap); GdkPixmap* pdfpc_renderer_cache_base_retrieve (pdfpcRendererCacheBase* self, guint index); GType pdfpc_renderer_cache_option_factory_get_type (void) G_GNUC_CONST; pdfpcRendererCacheBase* pdfpc_renderer_cache_option_factory_create (pdfpcMetadataBase* metadata); GType pdfpc_renderer_cache_png_engine_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_cache_png_item_get_type (void) G_GNUC_CONST; pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_new (pdfpcMetadataBase* metadata); pdfpcRendererCachePNGEngine* pdfpc_renderer_cache_png_engine_construct (GType object_type, pdfpcMetadataBase* metadata); pdfpcRendererCachePNGItem* pdfpc_renderer_cache_png_item_new (guint8* data, int data_length1); pdfpcRendererCachePNGItem* pdfpc_renderer_cache_png_item_construct (GType object_type, guint8* data, int data_length1); guint8* pdfpc_renderer_cache_png_item_get_png_data (pdfpcRendererCachePNGItem* self, int* result_length1); gint pdfpc_renderer_cache_png_item_get_length (pdfpcRendererCachePNGItem* self); GType pdfpc_renderer_cache_simple_engine_get_type (void) G_GNUC_CONST; pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_new (pdfpcMetadataBase* metadata); pdfpcRendererCacheSimpleEngine* pdfpc_renderer_cache_simple_engine_construct (GType object_type, pdfpcMetadataBase* metadata); GType pdfpc_renderer_caching_get_type (void) G_GNUC_CONST; GType pdfpc_renderer_pdf_get_type (void) G_GNUC_CONST; pdfpcRendererPdf* pdfpc_renderer_pdf_new (pdfpcMetadataPdf* metadata, gint width, gint height); pdfpcRendererPdf* pdfpc_renderer_pdf_construct (GType object_type, pdfpcMetadataPdf* metadata, gint width, gint height); GType pdfpc_scaler_get_type (void) G_GNUC_CONST; pdfpcScaler* pdfpc_scaler_new (gdouble width, gdouble height); pdfpcScaler* pdfpc_scaler_construct (GType object_type, gdouble width, gdouble height); void pdfpc_scaler_scale_to (pdfpcScaler* self, gint width, gint height, gboolean centered, gboolean allow_cutoff, GdkRectangle* result); pdfpcTimerLabel* pdfpc_getTimerLabel (gint duration, time_t end_time, guint last_minutes, time_t start_time); pdfpcTimerLabel* pdfpc_timer_label_construct (GType object_type, time_t start_time); void pdfpc_timer_label_start (pdfpcTimerLabel* self); void pdfpc_timer_label_stop (pdfpcTimerLabel* self); gboolean pdfpc_timer_label_pause (pdfpcTimerLabel* self); gboolean pdfpc_timer_label_is_paused (pdfpcTimerLabel* self); void pdfpc_timer_label_reset (pdfpcTimerLabel* self); gint pdfpc_timer_label_calculate_countdown (pdfpcTimerLabel* self); gboolean pdfpc_timer_label_on_timeout (pdfpcTimerLabel* self); void pdfpc_timer_label_format_time (pdfpcTimerLabel* self); void pdfpc_timer_label_show_time (pdfpcTimerLabel* self, guint timeInSecs, const gchar* prefix); GType pdfpc_countdown_timer_get_type (void) G_GNUC_CONST; pdfpcCountdownTimer* pdfpc_countdown_timer_new (gint duration, guint last_minutes, time_t start_time); pdfpcCountdownTimer* pdfpc_countdown_timer_construct (GType object_type, gint duration, guint last_minutes, time_t start_time); GType pdfpc_end_time_timer_get_type (void) G_GNUC_CONST; pdfpcEndTimeTimer* pdfpc_end_time_timer_new (time_t end_time, guint last_minutes, time_t start_time); pdfpcEndTimeTimer* pdfpc_end_time_timer_construct (GType object_type, time_t end_time, guint last_minutes, time_t start_time); GType pdfpc_countup_timer_get_type (void) G_GNUC_CONST; pdfpcCountupTimer* pdfpc_countup_timer_new (time_t start_time); pdfpcCountupTimer* pdfpc_countup_timer_construct (GType object_type, time_t start_time); GType pdfpc_view_base_get_type (void) G_GNUC_CONST; pdfpcViewBase* pdfpc_view_base_construct (GType object_type, pdfpcRendererBase* renderer); pdfpcRendererBase* pdfpc_view_base_get_renderer (pdfpcViewBase* self); void pdfpc_view_base_display (pdfpcViewBase* self, gint slide_number, gboolean force_redraw, GError** error); void pdfpc_view_base_fade_to_black (pdfpcViewBase* self); void pdfpc_view_base_redraw (pdfpcViewBase* self, GError** error); gint pdfpc_view_base_get_current_slide_number (pdfpcViewBase* self); GType pdfpc_view_behaviour_base_get_type (void) G_GNUC_CONST; GQuark pdfpc_view_behaviour_association_error_quark (void); pdfpcViewBehaviourBase* pdfpc_view_behaviour_base_construct (GType object_type); pdfpcViewBase* pdfpc_view_behaviour_base_get_target (pdfpcViewBehaviourBase* self); void pdfpc_view_behaviour_base_enforce_exclusive_association (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); void pdfpc_view_behaviour_base_associate (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error); gboolean pdfpc_view_behaviour_base_is_supported (pdfpcViewBehaviourBase* self, pdfpcViewBase* target); GType pdfpc_view_behaviour_pdf_link_implementation_get_type (void) G_GNUC_CONST; GType pdfpc_view_behaviour_pdf_link_signal_provider_get_type (void) G_GNUC_CONST; pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_new (pdfpcPresentationController* presentation_controller); pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_construct (GType object_type, pdfpcPresentationController* presentation_controller); gboolean pdfpc_view_behaviour_pdf_link_implementation_is_supported (pdfpcViewBehaviourPdfLinkImplementation* self, pdfpcViewBase* target); void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping); void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping); void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, guint target_page_number); void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, const gchar* command, const gchar* arguments); GType pdfpc_view_default_get_type (void) G_GNUC_CONST; GType pdfpc_view_pdf_get_type (void) G_GNUC_CONST; void pdfpc_view_behaviour_pdf_link_signal_provider_attach (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewPdf* view); PopplerLinkMapping* pdfpc_view_behaviour_pdf_link_signal_provider_get_link_mapping_by_coordinates (pdfpcViewBehaviourPdfLinkSignalProvider* self, gdouble x, gdouble y); void pdfpc_view_behaviour_pdf_link_signal_provider_handle_link_mapping (pdfpcViewBehaviourPdfLinkSignalProvider* self, PopplerLinkMapping* mapping); void pdfpc_view_behaviour_pdf_link_signal_provider_convert_poppler_rectangle_to_gdk_rectangle (pdfpcViewBehaviourPdfLinkSignalProvider* self, PopplerRectangle* poppler_rectangle, GdkRectangle* result); gboolean pdfpc_view_behaviour_pdf_link_signal_provider_on_button_press (pdfpcViewBehaviourPdfLinkSignalProvider* self, GtkWidget* source, GdkEventButton* e); gboolean pdfpc_view_behaviour_pdf_link_signal_provider_on_mouse_move (pdfpcViewBehaviourPdfLinkSignalProvider* self, GtkWidget* source, GdkEventMotion* event); void pdfpc_view_behaviour_pdf_link_signal_provider_on_entering_slide (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewBase* source, gint page_number); void pdfpc_view_behaviour_pdf_link_signal_provider_on_leaving_slide (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewBase* source, gint from, gint to); pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_new (void); pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_construct (GType object_type); GType pdfpc_view_behaviour_decoratable_get_type (void) G_GNUC_CONST; pdfpcViewDefault* pdfpc_view_default_new (pdfpcRendererBase* renderer); pdfpcViewDefault* pdfpc_view_default_construct (GType object_type, pdfpcRendererBase* renderer); void pdfpc_view_default_register_prerendering (pdfpcViewDefault* self); pdfpcViewPdf* pdfpc_view_pdf_new (pdfpcRendererPdf* renderer, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller); pdfpcViewPdf* pdfpc_view_pdf_construct (GType object_type, pdfpcRendererPdf* renderer, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller); pdfpcViewPdf* pdfpc_view_pdf_from_metadata (pdfpcMetadataPdf* metadata, gint width, gint height, gboolean allow_black_on_end, pdfpcPresentationController* presentation_controller, GdkRectangle* scale_rect); pdfpcRendererPdf* pdfpc_view_pdf_get_renderer (pdfpcViewPdf* self); GType pdfpc_window_fullscreen_get_type (void) G_GNUC_CONST; pdfpcWindowFullscreen* pdfpc_window_fullscreen_new (gint screen_num); pdfpcWindowFullscreen* pdfpc_window_fullscreen_construct (GType object_type, gint screen_num); gboolean pdfpc_window_fullscreen_on_configure (pdfpcWindowFullscreen* self, GdkEventConfigure* e); void pdfpc_window_fullscreen_on_size_allocate (pdfpcWindowFullscreen* self, GtkWidget* source, GdkRectangle* r); gboolean pdfpc_window_fullscreen_on_mouse_move (pdfpcWindowFullscreen* self, GtkWidget* source, GdkEventMotion* event); void pdfpc_window_fullscreen_restart_hide_cursor_timer (pdfpcWindowFullscreen* self); gboolean pdfpc_window_fullscreen_on_hide_cursor_timeout (pdfpcWindowFullscreen* self); GType pdfpc_window_presenter_get_type (void) G_GNUC_CONST; void pdfpc_window_overview_on_selection_changed (pdfpcWindowOverview* self, GtkWidget* source); pdfpcWindowOverview* pdfpc_window_overview_new (pdfpcMetadataPdf* metadata, pdfpcPresentationController* presentation_controller, pdfpcWindowPresenter* presenter); pdfpcWindowOverview* pdfpc_window_overview_construct (GType object_type, pdfpcMetadataPdf* metadata, pdfpcPresentationController* presentation_controller, pdfpcWindowPresenter* presenter); void pdfpc_window_overview_set_available_space (pdfpcWindowOverview* self, gint width, gint height); void pdfpc_window_overview_on_parent_set (pdfpcWindowOverview* self, GtkWidget* old_parent); void pdfpc_window_overview_on_show (pdfpcWindowOverview* self); void pdfpc_window_overview_on_hide (pdfpcWindowOverview* self); void pdfpc_window_overview_fill_structure (pdfpcWindowOverview* self); void pdfpc_window_overview_fill_previews (pdfpcWindowOverview* self); gboolean _pdfpc_window_overview_fill_previews (pdfpcWindowOverview* self); void pdfpc_window_overview_set_cache (pdfpcWindowOverview* self, pdfpcRendererCacheBase* cache); void pdfpc_window_overview_set_n_slides (pdfpcWindowOverview* self, gint n); void pdfpc_window_overview_remove_current (pdfpcWindowOverview* self, gint newn); gboolean pdfpc_window_overview_on_key_press (pdfpcWindowOverview* self, GtkWidget* source, GdkEventKey* key); gboolean pdfpc_window_overview_on_mouse_move (pdfpcWindowOverview* self, GtkWidget* source, GdkEventMotion* event); gboolean pdfpc_window_overview_on_mouse_release (pdfpcWindowOverview* self, GdkEventButton* event); gint pdfpc_window_overview_get_current_slide (pdfpcWindowOverview* self); void pdfpc_window_overview_set_current_slide (pdfpcWindowOverview* self, gint value); GType pdfpc_window_cell_renderer_highlight_get_type (void) G_GNUC_CONST; pdfpcWindowCellRendererHighlight* pdfpc_window_cell_renderer_highlight_new (void); pdfpcWindowCellRendererHighlight* pdfpc_window_cell_renderer_highlight_construct (GType object_type); GType pdfpc_window_presentation_get_type (void) G_GNUC_CONST; pdfpcWindowPresentation* pdfpc_window_presentation_new (pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); pdfpcWindowPresentation* pdfpc_window_presentation_construct (GType object_type, pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); gboolean pdfpc_window_presentation_on_key_pressed (pdfpcWindowPresentation* self, GdkEventKey* key); gboolean pdfpc_window_presentation_on_button_press (pdfpcWindowPresentation* self, GdkEventButton* button); gboolean pdfpc_window_presentation_on_scroll (pdfpcWindowPresentation* self, GtkWidget* source, GdkEventScroll* scroll); void pdfpc_window_presentation_set_controller (pdfpcWindowPresentation* self, pdfpcPresentationController* controller); void pdfpc_window_presentation_set_cache_observer (pdfpcWindowPresentation* self, pdfpcCacheStatus* observer); pdfpcWindowPresenter* pdfpc_window_presenter_new (pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); pdfpcWindowPresenter* pdfpc_window_presenter_construct (GType object_type, pdfpcMetadataPdf* metadata, gint screen_num, pdfpcPresentationController* presentation_controller); void pdfpc_window_presenter_build_layout (pdfpcWindowPresenter* self); gboolean pdfpc_window_presenter_on_key_pressed (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key); gboolean pdfpc_window_presenter_on_button_press (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventButton* button); gboolean pdfpc_window_presenter_on_scroll (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventScroll* scroll); void pdfpc_window_presenter_update_slide_count (pdfpcWindowPresenter* self); void pdfpc_window_presenter_custom_slide_count (pdfpcWindowPresenter* self, gint current); void pdfpc_window_presenter_goto_page (pdfpcWindowPresenter* self, gint page_number); gboolean pdfpc_window_presenter_on_key_press_slide_progress (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key); gboolean pdfpc_window_presenter_on_key_press_notes_view (pdfpcWindowPresenter* self, GtkWidget* source, GdkEventKey* key); void pdfpc_window_presenter_update_note (pdfpcWindowPresenter* self); void pdfpc_window_presenter_set_cache_observer (pdfpcWindowPresenter* self, pdfpcCacheStatus* observer); void pdfpc_window_presenter_prerender_finished (pdfpcWindowPresenter* self); pdfpcPresentationController* pdfpc_controllable_get_controller (pdfpcControllable* self); void pdfpc_controllable_update (pdfpcControllable* self); void pdfpc_controllable_edit_note (pdfpcControllable* self); void pdfpc_controllable_ask_goto_page (pdfpcControllable* self); void pdfpc_controllable_show_overview (pdfpcControllable* self); void pdfpc_controllable_hide_overview (pdfpcControllable* self); void pdfpc_renderer_caching_set_cache (pdfpcRendererCaching* self, pdfpcRendererCacheBase* cache); pdfpcRendererCacheBase* pdfpc_renderer_caching_get_cache (pdfpcRendererCaching* self); void pdfpc_view_behaviour_decoratable_associate_behaviour (pdfpcViewBehaviourDecoratable* self, pdfpcViewBehaviourBase* behaviour); #define icon_path "/@CMAKE_INSTALL_PREFIX@/share/pixmaps/pdfpc/" #define etc_path "/@SYSCONFDIR@" GType pdfpc_application_get_type (void) G_GNUC_CONST; gchar* pdfpc_application_parse_command_line_options (pdfpcApplication* self, gchar** args, int args_length1); void pdfpc_application_run (pdfpcApplication* self, gchar** args, int args_length1); gint pdfpc_application_main (gchar** args, int args_length1); pdfpcApplication* pdfpc_application_new (void); pdfpcApplication* pdfpc_application_construct (GType object_type); G_END_DECLS #endif davvil-pdfpc-074a3c6/cmake/000077500000000000000000000000001177613036100155075ustar00rootroot00000000000000davvil-pdfpc-074a3c6/cmake/Vala_CMake/000077500000000000000000000000001177613036100174325ustar00rootroot00000000000000davvil-pdfpc-074a3c6/create-c-src.sh000077500000000000000000000023541177613036100172420ustar00rootroot00000000000000#!/bin/zsh # *Very* ad-hoc script for creating the C sources, which can also be # parametrized with cmake (INSTALL_PREFIX and SYSCONFDIR) CBUILDTMP=`mktemp -d` BASEDIR=`readlink -f $(dirname $0)` function parametrizedFiles() { VAR=$1 files=(`grep -l $VAR **/*.c`) for f in $files; do echo $f sed -i "s:/$VAR:$VAR:g" $f mv $f ${f/.c/.in} sed -i "/BEGIN_CONFIGURE_FILES/ a\ CONFIGURE_FILE(\$\{CMAKE_CURRENT_SOURCE_DIR\}/${f/.c/.in} \$\{CMAKE_CURRENT_SOURCE_DIR}/$f)" CMakeLists.txt done } cd $BASEDIR git checkout master cd $CBUILDTMP cmake -DCMAKE_INSTALL_PREFIX="/@CMAKE_INSTALL_PREFIX@" -DSYSCONFDIR="/@SYSCONFDIR@" $BASEDIR cd $BASEDIR rm -rf $CBUILDTMP git checkout release find src -name '*.vala' | xargs valac -b src -d c-src --pkg gtk+-2.0 --pkg poppler-glib --pkg posix --pkg librsvg-2.0 --pkg gee-1.0 -C --header=c-src/presenter.h --internal-header=c-src/presenter_internal.h cd c-src rm paths.c # Modify the CMakeLists.txt for parametrized files # Cleanup if we have something sed -i '/BEGIN_CONFIGURE_FILES/,/END_CONFIGURE_FILES/ { /BEGIN_CONFIGURE_FILES/n /END_CONFIGURE_FILES/ !{d} }' CMakeLists.txt parametrizedFiles @CMAKE_INSTALL_PREFIX@ parametrizedFiles @SYSCONFDIR@ davvil-pdfpc-074a3c6/icons/000077500000000000000000000000001177613036100155425ustar00rootroot00000000000000davvil-pdfpc-074a3c6/icons/CMakeLists.txt000066400000000000000000000001561177613036100203040ustar00rootroot00000000000000install(FILES blank.svg snow.svg pause.svg DESTINATION share/pixmaps/pdfpc ) davvil-pdfpc-074a3c6/icons/README.icons000066400000000000000000000007721177613036100175420ustar00rootroot00000000000000pause.svg --------- (c) 2007 Nuno Pinheiro & David Vignoni & David Miller & Johann Ollivier Lapeyre & Kenneth Wimer & Riccardo Iaconelli / KDE / LGPL 3 Downloaded from: http://commons.wikimedia.org/wiki/File:Oxygen480-actions-media-playback-pause.svg snow.svg -------- Author: bocian Downloaded from: http://openclipart.org/detail/30829/snowflake-by-bocian blank.svg --------- Author: unknown Downloaded from: http://www.easyvectors.com/browse/other/e8432a941aa77d96971bf0f536215494-lcd-monitor-clip-art davvil-pdfpc-074a3c6/icons/blank.svg000066400000000000000000000217021177613036100173540ustar00rootroot00000000000000 image/svg+xml Layer 1 davvil-pdfpc-074a3c6/icons/pause.svg000066400000000000000000000201651177613036100174040ustar00rootroot00000000000000 image/svg+xml davvil-pdfpc-074a3c6/icons/snow.svg000066400000000000000000000246611177613036100172620ustar00rootroot00000000000000 image/svg+xml davvil-pdfpc-074a3c6/man/000077500000000000000000000000001177613036100152025ustar00rootroot00000000000000davvil-pdfpc-074a3c6/man/CMakeLists.txt000066400000000000000000000002351177613036100177420ustar00rootroot00000000000000CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/pdfpc.in ${CMAKE_CURRENT_SOURCE_DIR}/pdfpc.1) install(FILES pdfpc.1 DESTINATION share/man/man1 ) davvil-pdfpc-074a3c6/man/pdfpc.in000066400000000000000000000302011177613036100166220ustar00rootroot00000000000000.TH pdfpc "1" "Jun 2012" .SH NAME pdfpc \- pdf presentater console with multi-monitor support .SH SYNOPSIS .B pdfpc [options] PDF-file .SH DESCRIPTION .PP pdfpc is a GTK based presentation viewer application which uses Keynote like multi-monitor output to provide meta information to the speaker during the presentation. It is able to show a normal presentation window on one screen, while showing a more sophisticated overview on the other one providing information like a picture of the next slide, as well as the left over time till the end of the presentation. The input files processed by pdfpc are PDF documents, which can be created using nearly any of today\[aq]s presentation software. .PP To run pdfppc, simply type .RS .PP pdfpc file.pdf .RE .PP By default the presenter view appears in the primary monitor and the presentation view in the second monitor (provided you have two monitors). If you want to swith displays, start with the \-s option (see below). .SH OPTIONS .TP .BI "\-d, \-\-duration"=N Duration in minutes of the presentation used for timer display. If not given or if a value of 0 is specified, the clock just measures the time in the presentation. .TP .BI "\-e, \-\-end\-time"=T End time of the presentation. (Format: HH:MM (24h)) .TP .BI "\-l, \-\-last\-minutes"=N Time in minutes, from which on the timer changes its color. (Default 5 minutes) .TP .BI "\-t, \-\-start\-time"=T Start time of the presentation to be used as a countdown. (Format: HH:MM (24h)) .TP .BI "\-u, \-\-current\-size"=N Percentage of the presenter screen to be used for the current slide. (Default 60) .TP .BI "\-o, \-\-overview\-min\-size"=N Minimum width for the overview miniatures, in pixels. (Default 150) .TP .BI "\-s, \-\-switch\-screens" Switch the presentation and the presenter screen. .TP .BI "\-c, \-\-disable\-cache" Disable caching and pre-rendering of slides to save memory at the cost of speed. .TP .BI "\-z, \-\-disable\-compression" Disable the compression of slide images to trade memory consumption for speed. (Avg. factor 30) .TP .BI "\-b, \-\-black\-on\-end" Add an additional black slide at the end of the presentation .TP .BI "\-S, \-\-single\-screen" Force to use only one screen .TP .BI "\-L, \-\-list\-actions" List actions supported in the config file(s) .TP .BI "\-h, \-\-help" Shows the help .SH KEYBINDINGS These are the default keybindings for pdfpc: .TP .B Right cursor key / Page down / Return / Space / Left mouse button Go forward one slide .TP .B Shift + Right cursor key / Page down / Return / Space / Left mouse button / Mouse wheel down or right Go forward 10 slides .TP .B Down cursor key Go forward one user slide (see .B Overlays below) .TP .B Left cursor key / Page up / Right mouse button / Mouse wheel up or left Go back one slide .TP .B Shift + Left cursor key / Page up / Right mouse button Go back 10 slides .TP .B Up cursor key Go back one "user slide" (see .B Overlays below) .TP .B Home Go to the first slide .TP .B End Go to the last slide .TP .B Backspace Go back in history. Note that history is defined by "jump" commands, not by normal slide movement. .TP .B Tab / Middle mouse button Overview mode .TP .B g Input a slide number to jump to .TP .B Escape / q Exit pdfpc .TP .B b Turn off the presentation view (i.e. fill it with a black color) .TP .B n Edit note for current slide .TP .B f Freeze the current presentation display (the presenter display is still fully active) .TP .B o Toggle the overlay flag for one particular slide (see Overlays below) .TP .B p Pause timer .TP .B r Reset presentation (reset timer and go back to first slide) .TP .B e Define end slide .P See .B CONFIG FILE below if you want to customize the keybindings. .SH FEATURES .SS Caching / Prerendering To allow fast changes between the different slides of the presentation the pdf pages are prerendered to memory. The progress bar on the bottom of the presenter screen indicates how many percent of the slides have been pre-rendered already. During the initial rendering phase this will slow down slide changes, as most cpu power is used for the rendering process in the background. After the cache is fully primed however the changing of slides should be much faster, as with normal pdf viewers. As the prerendering takes a lot of memory it can be disabled using the \-\-disable\-cache switch at the cost of speed. .SS Cache compression The prerendered and cached slides can be compressed in memory to save up some memory. Without compression a set of about 100 pdf pages can easily grow up to about 1.5gb size. Netbooks with only 1gb of memory would swap themselves to death if prerendering is enabled in such a situation. The compression is enabled by default as it does not harm rendering speed in a noticeable way on most systems. It does however slows down prerendering by about a factor of 2. If you have got enough memory and want to ensure the fastest possible prerendering you can disable slide compression by using the \-z switch. But be warned using the uncompressed prerendering storage will use about 30 times the memory the new compressed storage utilizes (aka the 1.5gb become about 50mb) .SS Timer If a duration is given (\-d option), the timer will show a countdown with the given parameters. If no duration is specified (or if a value of 0 is given to the \-d option), the timer will show how much time has been spent. The duration is stored automatically, so you do not need to repeat it for every invocation. The timer is started if you are navigating away from the first page for the first time. This feature is quite useful as you may want to show the titlepage of your presentation while people are still entering the room and the presentation hasn\[aq]t really begun yet. If you want to start over you can use the r key which will make the presenter reset the timer. If a duration is given, at the moment the timer reaches the defined last-minutes value it will change color to indicate your talk is nearing its end. As soon as the timer reaches the zero mark (00:00:00) it will turn red and count further down showing a negative time, to provide information on how many minutes you are overtime. .SS Notes Textual notes can be displayed for each slide. While in the presentation, pressing n will allow you to take notes for the screen. To go out of editing mode, press the Escape key. Note that while editing a note the keybindings stop working, i.e. you are not able to change slides. The notes are stored in the given file in a plain text format, easy to edit also from outside the program. See the section about the pdfpc format below. .SS Overview mode Pressing tab you can enter the overview mode, where miniatures for the slides are shown. You can select one slide to jump to with the mouse or with the arrow keys. You can also define overlays and the end slide (see next sections) in this mode. .SS Overlays Many slide preparation systems allow for overlays, i.e. sets of slides that are logically grouped together as a single, changing slide. Examples include enumerations where the single items are displayed one after another or rough "animations", where parts of a picture change from slide to slide. Pdf Presenter Console includes facilities for dealing with such overlays. In this description, we will differentiation between slides (i.e. pages in the pdf document) and "user slides", that are the logical slides. The standard forward movement command (page down, enter, etc.) moves through one slide at a time, as expected. That means that every step in the overlay is traversed. The backward movement command works differently depending if the current and previous slides are part of an overlay: .IP \[bu] 2 If the current slide is part of an overlay we just jump to the previous slide. That means that we are in the middle of an overlay we can jump forward and backward through the single steps of it .IP \[bu] 2 If the current slide is not part of an overlay (or if it is the first one), but the previous slides are, we jump to the previous user slide. This means that when going back in the presentation you do not have to go through every step of the overlay, Pdf Presenter Console just shows the first slide of the each overlay. As you normally only go back in a presentation when looking for a concrete slide, this is more convenient. .PP The up and down cursor keys work on a user slide basis. You can use them to skip the rest of an overlay or to jump to the previous user slide, ignoring the state of the current slide. When going through an overlay, two additional previews may be activated in the presenter view, just below the main view, showing the next and the previous slide in an overlay. Pdf Presenter Console tries to find these overlays automatically by looking into the page labels in the pdf file. For LaTeX this works correctly at least with the beamer class and also modifying the page numbers manually (compiling with pdflatex). If your preferred slide-producing method does not work correctly with this detection, you can supply this information using the o key for each slide that is part of an overlay (except the first one!). The page numbering is also adapted. This information is automatically stored. .SS End slide .PP Some people like to have some additional, backup slides after the last slide in the actual presentation. Things like bibliographic references or slides referring to specialized questions are typical examples. Pdf Presenter Console lets you define which is the last slide in the actual presentation vie the \[aq]e\[aq] key. This just changes the progress display in the presenter screen, as to have a better overview of how many slides are left. .SS pdfpc Files .PP The notes and other additional information are stored in a file with the extension "pdfpc". When invoking Pdf Presenter Console with a non pdfpc file, it automatically checks if there exists such a file and in this case loads the additional information. This means that you normally do not have to deal with this kind of files explicitly. .PP There are however cases where you may want to edit the files manually. The most typical case is if you add or remove some slides after you have edited notes or defined overlays. It may be quicker to edit the pdfpc file than to re-enter the whole information. Future versions may include external tools for dealing with this case automatically. .PP The files are plain-text files that should be fairly self-explanatory. A couple of things to note: .IP \[bu] 2 The slide numbers of the notes refer to user slides .IP \[bu] 2 The [notes] sections must be the last one in the file .IP \[bu] 2 For the programmers out there: slide indexes start at 1 .PP .SH CONFIG FILE The main configuration file for pdfpc is located in @SYSCONFDIR@/pdfpcrc. Additionally, $HOME/.pdfpcrc is also read, if present. Following commands are aceepted .TP .B bind Bind a key to a function .TP .B unbind Unbinds the given key .TP .B unbind_all Unbinds all the keybindings .TP .B mouse