page_handler.hpp

来自「ncbi源码」· HPP 代码 · 共 185 行

HPP
185
字号
/* * =========================================================================== * PRODUCTION $Log: page_handler.hpp,v $ * PRODUCTION Revision 1000.0  2003/10/31 22:05:36  gouriano * PRODUCTION PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.8 * PRODUCTION * =========================================================================== */#ifndef GUI_UTILS__PAGE_HANDLER_HPP#define GUI_UTILS__PAGE_HANDLER_HPP/*  $Id: page_handler.hpp,v 1000.0 2003/10/31 22:05:36 gouriano Exp $ * =========================================================================== * *                            PUBLIC DOMAIN NOTICE *               National Center for Biotechnology Information * *  This software/database is a "United States Government Work" under the *  terms of the United States Copyright Act.  It was written as part of *  the author's official duties as a United States Government employee and *  thus cannot be copyrighted.  This software/database is freely available *  to the public for use. The National Library of Medicine and the U.S. *  Government have not placed any restriction on its use or reproduction. * *  Although all reasonable efforts have been taken to ensure the accuracy *  and reliability of the software and data, the NLM and the U.S. *  Government do not and cannot warrant the performance or results that *  may be obtained by using this software or data. The NLM and the U.S. *  Government disclaim all warranties, express or implied, including *  warranties of performance, merchantability or fitness for any particular *  purpose. * *  Please cite the author in any work or product based on this material. * * =========================================================================== * * Authors:  Peter Meric * * File Description: *   CPageHandler - manage pages in a PDF document */#include <corelib/ncbiobj.hpp>#include <gui/print/print_utils.hpp>#include "page_buffers.hpp"#include "panel.hpp"BEGIN_NCBI_SCOPEclass CPdfObject;class CPrintOptions;class CPdfObjectWriter;class CPdfArray;class CIdGenerator;class CPageGrid;class CPanelGrid;class CPageHandler{private:    typedef CRef<CPdfObject> TPdfObjectRef;    typedef CUnit::TPdfUnit TPdfUnit;    typedef pair<TPdfUnit, TPdfUnit> TSize;    typedef pair<TPdfUnit, TPdfUnit> TOffset;    typedef CPrintOptions::TAlignment TAlignment;    enum Side    {        eTop,        eBottom,        eLeft,        eRight    };public:    CPageHandler(const CPageBuffers& buffers,                 CPdfObjectWriter& obj_writer,                 CIdGenerator& objid_gen                );    virtual ~CPageHandler();    TPdfObjectRef GetObject(void) const;    void SetOptions(const CPrintOptions& options);    void SetContent(const TPdfObjectRef& content);    unsigned int WritePages(void);    void WritePageTree(const CRef<CPdfDictionary>& pagedict);protected:    void x_Update(const CRef<CPdfDictionary>& pagedict);    const TSize x_GetScaledPageSize(void) const;    void x_UpdatePageTreeRoot(const CRef<CPdfDictionary>& pagedict);    TPdfObjectRef x_CreateHeaderFooter(void);    TPdfObjectRef x_CreatePrintersMarks(const CRef<CPanel>& panel);    TPdfObjectRef x_CreatePageClipObject(void);    TPdfObjectRef x_CreateContentXForm(void);    TPdfObjectRef x_CreatePageXForm(const CRef<CPanel>& panel);    void x_CreatePage(TPdfObjectRef page, CRef<CPdfArray>& contents);    pair<float, float> x_GetPageScaling(TPdfUnit w,                                        TPdfUnit h,                                        bool keepAspect = true                                       ) const;    TOffset x_GetPanelOffset(const CRef<CPanel>& panel) const;    void x_DrawCornerCropMarks(CPdfObject& obj, TPdfUnit margin) const;    CRef<CPdfArray> x_DrawPanelLink(CPdfObject& obj,                                    unsigned int panel_num,                                    TPdfUnit x,                                    TPdfUnit y,                                     enum Side side = eTop                                   ) const;    void x_DrawTriangle(CPdfObject& obj,                        TPdfUnit x,                        TPdfUnit y,                        TPdfUnit width,                        TPdfUnit height                       ) const;private:    CPdfObjectWriter* m_ObjWriter;    CIdGenerator* m_ObjIdGenerator;    bool m_Finalized;    const CPrintOptions* m_Options;    vector<TPdfObjectRef> m_Pages;    vector<TPdfObjectRef> m_StdContents;    TPdfObjectRef m_PageTreeRootObj;    TPdfObjectRef m_ContentPagesXForm;    //TPdfObjectRef m_IndexPageXForm;    TPdfObjectRef m_Clip;    TPdfObjectRef m_Content;    const CPageBuffers* m_PageBuffers;    CRef<CPanelGrid> m_PanelGrid;};END_NCBI_SCOPE#endif // GUI_UTILS__PAGE_HANDLER_HPP/* * =========================================================================== * $Log: page_handler.hpp,v $ * Revision 1000.0  2003/10/31 22:05:36  gouriano * PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.8 * * Revision 1.8  2003/08/15 17:02:15  meric * Updates include paths for print-related files from gui/utils to gui/print * * Revision 1.7  2003/06/25 18:02:51  meric * Source rearrangement: move "private" headers into the src/ tree * * Revision 1.6  2003/06/24 17:26:38  meric * Use CUnit::TPdfUnit * * Revision 1.5  2003/06/24 15:45:54  meric * Added x_GetPageScaling() and x_GetPanelOffset(), from CPrintOptions * Added x_GetPanelOffset(), x_DrawPanelLink() and misc functions * * Revision 1.4  2003/06/18 17:25:27  meric * Final phase of print reorg: remove dependence on gui/opengl and OpenGL * * Revision 1.3  2003/06/16 21:17:28  meric * Added multi-page support * * Revision 1.2  2003/06/16 12:46:21  dicuccio * Clean-up after initial commit * * Revision 1.1  2003/06/13 19:00:30  meric * Initial version * * * =========================================================================== */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?