libspectre/spectre-page.h

Go to the documentation of this file.
00001 /* This file is part of Libspectre.
00002  * 
00003  * Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
00004  * Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
00005  *
00006  * Libspectre is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2, or (at your option)
00009  * any later version.
00010  *
00011  * Libspectre is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 #ifndef SPECTRE_PAGE_H
00022 #define SPECTRE_PAGE_H
00023 
00024 #include <libspectre/spectre-macros.h>
00025 #include <libspectre/spectre-status.h>
00026 #include <libspectre/spectre-render-context.h>
00027 
00028 SPECTRE_BEGIN_DECLS
00029 
00030 typedef enum {
00031         SPECTRE_ORIENTATION_PORTRAIT ,
00032         SPECTRE_ORIENTATION_REVERSE_LANDSCAPE ,
00034         SPECTRE_ORIENTATION_REVERSE_PORTRAIT ,
00035         SPECTRE_ORIENTATION_LANDSCAPE 
00036 } SpectreOrientation;
00037 
00041 typedef struct SpectrePage SpectrePage;
00042 
00046 SpectreStatus      spectre_page_status          (SpectrePage          *page);
00047 
00051 void               spectre_page_free            (SpectrePage          *page);
00052 
00056 unsigned int       spectre_page_get_index       (SpectrePage          *page);
00057 
00061 const char        *spectre_page_get_label       (SpectrePage          *page);
00062 
00066 SpectreOrientation spectre_page_get_orientation (SpectrePage          *page);
00067 
00075 void               spectre_page_get_size        (SpectrePage          *page,
00076                                                  int                  *width,
00077                                                  int                  *height);
00078 
00088 void               spectre_page_render          (SpectrePage          *page,
00089                                                  SpectreRenderContext *rc,
00090                                                  unsigned char       **page_data,
00091                                                  int                  *row_length);
00092 
00093 /* ! Renders a rectangle of the page to RGB32 format. This function can fail
00094      @param page The page to renderer
00095      @param rc The rendering context specifying how the page has to be rendered
00096      @param x The X coordinate of the top left corner of the rectangle
00097      @param y The Y coordinate to the top left corner of the rectangle
00098      @param width The width of the rectangle
00099      @param height The height of the rectangle
00100      @param page_data A pointer that will point to the image data
00101                       if the call succeeds
00102      @param row_length The length of an image row will be returned here. It can
00103                        happen that row_length is different than width * 4
00104      @see spectre_page_status
00105 */
00106 void               spectre_page_render_slice    (SpectrePage          *page,
00107                                                  SpectreRenderContext *rc,
00108                                                  int                   x,
00109                                                  int                   y,
00110                                                  int                   width,
00111                                                  int                   height,
00112                                                  unsigned char       **page_data,
00113                                                  int                  *row_length);
00114 
00115 SPECTRE_END_DECLS
00116 
00117 #endif /* SPECTRE_PAGE_H */

Generated on Thu Jan 3 17:29:34 2008 for libspectre by  doxygen 1.5.3