pdf Namespace Reference

A simple observer implementation. More...

Data Structures

class  Cond
class  Mutex
class  ScopeMutex
class  PDFAnchor
class  PDFCollectionBase
class  PDFInstanceCollection
class  PDFCollection
class  PDFElemCollection
class  PluginRangeImpl
class  PDFController
 The document class. More...
class  PDFLibrary
struct  empty
class  IFunctor
class  Functor
class  ReceiversOperations
class  Signal
 Signal supporting five parameters. This is the primary class which provides the template for all partial specialized classes. More...
class  Signal< R, UNUSABLE, UNUSABLE, UNUSABLE, UNUSABLE, UNUSABLE >
 Signal supporting none parameter. More...
class  Signal< R, A1, UNUSABLE, UNUSABLE, UNUSABLE, UNUSABLE >
 Signal supporting one parameter. More...
class  Signal< R, A1, A2, UNUSABLE, UNUSABLE, UNUSABLE >
 Signal supporting two parameters. More...
class  Signal< R, A1, A2, A3, UNUSABLE, UNUSABLE >
 Signal supporting three parameters. More...
class  Signal< R, A1, A2, A3, A4, UNUSABLE >
 Signal supporting four parameters. More...
class  PDFRenderAttributes
struct  SearchWordRecord
class  PDFPage
 The page information. More...
class  PagesCache
class  PDFPrerenderPolicy
class  PDFPrerenderPolicyNormal
class  PDFRenderRequests
class  PDFRenderTask
 The rendering task. More...
class  PDFViewAttributes
class  PDFRenderer
 The document renderer class. More...
struct  PDFSearchCriteria
 PDFSearchCriteria. More...
class  PDFSearchTask
 The search task. More...
struct  SearchContext
 the search context wrappers not only the search criteria, but also the page number and start index. It would be only used in our searching algorithm. More...
struct  PDFSearchTaskInfo
 Information of a search task. More...
class  PDFSearcher
class  Thread
struct  TocItem
class  PDFToc
class  Task
class  PluginCollectionImpl
class  PluginDocImpl
 Implement all necessary interfaces for document object. If the interface is not supported, the impl can remove them from parent class list. More...
class  PluginLibraryImpl
 Implement Plugin Library object for pdf plugin. More...
class  PDFCollection< MarkerEntry * >
class  PluginRenderResultImpl
class  PluginRenderSettingsImpl
class  PluginSearchCriteria
class  StringImpl
class  PluginViewImpl
 Implement all interfaces of view object. If view object provider does not want to support optional interface, it may remove the interface from parent class list. More...
class  PDFGlobalParams

Typedefs

typedef PDFCollection
< PluginRangeImpl * > 
PDFRangeCollection
typedef string string
typedef vector< std::string > stringlist
typedef emptyUNUSABLE
typedef PDFInstanceCollection
< PluginRectangle
PDFRectangles
typedef PDFInstanceCollection
< SearchWordRecord
SearchWords
typedef PDFPagePagePtr
typedef enum pdf::RenderStatus_ RenderStatus
typedef PDFElemCollection
< PluginRangeImpl *, int > 
PDFSearchPage
typedef PDFCollection
< PDFSearchPage * > 
PDFSearchDocument
typedef PluginRenderResultImplRenderResultPtr

Enumerations

enum  PDFSearchType { PDF_SEARCH_ALL = 0, PDF_SEARCH_NEXT }
enum  RenderStatus_ { TASK_RENDER_DONE = 0, TASK_RENDER_OOM, TASK_RENDER_INVALID_PAGE }
enum  SearchResult {
  RES_OK = 0, RES_NOT_FOUND, RES_BEGIN, RES_END,
  RES_ERROR, RES_ABORTED, RES_PAUSED
}
enum  TaskType { TASK_RENDER = 0, TASK_SEARCH, TASK_INVALID }

Functions

int get_cur_time ()
 Get current time.
bool is_render_area_valid (const RenderArea &area)
 Estimate whether the render area is valid.
void get_content_area_in_pixel (const RenderArea &area, const int origin_width, const int origin_height, PluginRectangle &rect)
 Get the content area in pixel.
bool operator< (const PDFPage &left, const PDFPage &right)
bool operator>= (const PDFPage &left, const PDFPage &right)
int compare_priority (const int src_page, const int dst_page, PDFPrerenderPolicy *policy)
MarkerEntrymarker_entry_new (unsigned int uds_private_size)
void marker_entry_free_recursive (MarkerEntry *self)
unsigned long get_system_free_memory ()
void init_render_area (RenderArea &area)
void get_std_string_from_text_word (TextWord *word, std::string &result)
bool merge_rectangle (const double x_min, const double y_min, const double x_max, const double y_max, PDFRectangle *rect)
void add_request_page (const int current_page, const int offset, const int total, bool forward, std::vector< size_t > &result)
bool is_ignore_char (const char c)
bool is_end_char (const char c)
static const char * unicode_to_utf8 (const Unicode *uni_str, int len)

Variables

static const std::string g_ext_table []
 Internal file extension table. dummy file is a index file which contains a list of file names.
static const int EXT_TABLE_SIZE
static const int ALLOWED_HYPERLINKS_NUMBER = 3
static const int PRIORITY_MIN = 0xFFFF

Detailed Description

A simple observer implementation.

Copyright (C) 2008 iRex Technologies B.V. All rights reserved.


Typedef Documentation

Definition at line 350 of file pdf_page.h.

Definition at line 196 of file pdf_collection.h.

Definition at line 37 of file pdf_page.h.

Definition at line 81 of file pdf_searcher.h.

Definition at line 79 of file pdf_searcher.h.

Definition at line 130 of file pdf/plugin_impl/render_result_impl.h.

Definition at line 119 of file pdf_page.h.

Definition at line 68 of file pdf_define.h.

typedef vector<std::string> pdf::stringlist

Definition at line 69 of file pdf_define.h.

typedef empty* pdf::UNUSABLE

Definition at line 40 of file pdf_observer.h.


Enumeration Type Documentation

Enumerator:
PDF_SEARCH_ALL 
PDF_SEARCH_NEXT 

Definition at line 91 of file pdf_define.h.

00092 {
00093     PDF_SEARCH_ALL = 0,
00094     PDF_SEARCH_NEXT
00095 }PDFSearchType;

Enumerator:
TASK_RENDER_DONE 
TASK_RENDER_OOM 
TASK_RENDER_INVALID_PAGE 

Definition at line 119 of file pdf_renderer.h.

00120 {
00121     TASK_RENDER_DONE = 0,
00122     TASK_RENDER_OOM,
00123     TASK_RENDER_INVALID_PAGE
00124 } RenderStatus;

Enumerator:
RES_OK 
RES_NOT_FOUND 
RES_BEGIN 
RES_END 
RES_ERROR 
RES_ABORTED 
RES_PAUSED 

Definition at line 83 of file pdf_searcher.h.

00084 {
00085     RES_OK = 0,
00086     RES_NOT_FOUND,
00087     RES_BEGIN,
00088     RES_END,
00089     RES_ERROR,
00090     RES_ABORTED,
00091     RES_PAUSED
00092 }SearchResult;

Enumerator:
TASK_RENDER 
TASK_SEARCH 
TASK_INVALID 

Definition at line 37 of file task.h.

00038 {
00039     TASK_RENDER = 0,
00040     TASK_SEARCH,
00041     TASK_INVALID
00042 };


Function Documentation

void pdf::add_request_page ( const int  current_page,
const int  offset,
const int  total,
bool  forward,
std::vector< size_t > &  result 
)

Definition at line 96 of file pdf_prerender_policy.cpp.

00101 {
00102     int next_page = forward ? (current_page + offset) : (current_page - offset);
00103     if ((next_page > 0 && next_page <= total))
00104     {
00105         result.push_back(next_page);
00106     }
00107 }

int pdf::compare_priority ( const int  src_page,
const int  dst_page,
PDFPrerenderPolicy *  policy 
)

Definition at line 37 of file pdf_prerender_policy.cpp.

References pdf::PDFRenderRequests::get_priority(), and pdf::PDFPrerenderPolicy::get_requests().

Referenced by operator<().

00040 {
00041     int src_pri = policy->get_requests().get_priority(src_page);
00042     int dst_pri = policy->get_requests().get_priority(dst_page);
00043     // the value of priority is lower, the priority is higher
00044     if (src_pri > dst_pri)
00045     {
00046         return -1;
00047     }
00048     else if (src_pri < dst_pri)
00049     {
00050         return 1;
00051     }
00052     return 0;
00053 }

Here is the call graph for this function:

Here is the caller graph for this function:

void pdf::get_content_area_in_pixel ( const RenderArea area,
const int  origin_width,
const int  origin_height,
PluginRectangle rect 
)

Get the content area in pixel.

Definition at line 51 of file pdf_page.cpp.

References RenderArea::height, PluginRectangle::height, RenderArea::width, PluginRectangle::width, PluginRectangle::x, RenderArea::x_offset, PluginRectangle::y, and RenderArea::y_offset.

00055 {
00056     rect.x = static_cast<int>(origin_width * area.x_offset);
00057     rect.y = static_cast<int>(origin_height * area.y_offset);
00058     rect.width = static_cast<int>(origin_width * area.width);
00059     rect.height = static_cast<int>(origin_height * area.height);
00060 }

int pdf::get_cur_time (  ) 

Get current time.

Definition at line 56 of file poppler_test.cpp.

Referenced by main().

00057 {
00058     int now;
00059 #ifdef WIN32
00060     now = GetTickCount();
00061 #else
00062     struct timeval cur_time_struct;
00063     gettimeofday(&cur_time_struct, 0);
00064     now = cur_time_struct.tv_sec;
00065 #endif
00066     return now;
00067 }

Here is the caller graph for this function:

void pdf::get_std_string_from_text_word ( TextWord *  word,
std::string &  result 
)

Definition at line 62 of file pdf_page.cpp.

Referenced by pdf::PDFPage::get_text_by_range().

00063 {
00064     /*UGooString u_str(*(word->getText()));
00065 
00066     int len = u_str.getLength() * sizeof(Unicode);
00067 
00068     char *res_buf = new char[len];
00069     if (ucs2utf8(reinterpret_cast<char*>(u_str.unicode()), len, res_buf, len))
00070     {
00071         result = std::string(res_buf);
00072     }*/
00073 
00074     GooString * text = word->getText();
00075     if (text != 0)
00076     {
00077         result = std::string(text->getCString());
00078         delete text;
00079     }
00080 }

Here is the caller graph for this function:

unsigned long pdf::get_system_free_memory (  ) 

Definition at line 39 of file pdf_library.cpp.

Referenced by pdf::PDFLibrary::make_enough_memory().

00040 {
00041 #ifdef _WIN32
00042     MEMORYSTATUS info;
00043     GlobalMemoryStatus(&info);
00044     return info.dwAvailPhys;
00045 #else
00046     struct sysinfo info;
00047     sysinfo(&info);
00048     return info.freeram * info.mem_unit;
00049 #endif
00050 }

Here is the caller graph for this function:

void pdf::init_render_area ( RenderArea area  ) 

Definition at line 38 of file pdf_page.cpp.

References RenderArea::height, RenderArea::width, RenderArea::x_offset, and RenderArea::y_offset.

00039 {
00040     area.x_offset = 0.0f;
00041     area.y_offset = 0.0f;
00042     area.width  = -1.0f;
00043     area.height = -1.0f;
00044 }

bool pdf::is_end_char ( const char  c  ) 

Definition at line 43 of file pdf_searcher.cpp.

00044 {
00045     return (c == '\0');
00046 }

bool pdf::is_ignore_char ( const char  c  ) 

Definition at line 38 of file pdf_searcher.cpp.

00039 {
00040     return (c == ' ');
00041 }

bool pdf::is_render_area_valid ( const RenderArea area  ) 

Estimate whether the render area is valid.

Definition at line 46 of file pdf_page.cpp.

References RenderArea::height, and RenderArea::width.

Referenced by pdf::PDFPage::get_content_area().

00047 {
00048     return (area.width > 0.0f && area.height > 0.0f);
00049 }

Here is the caller graph for this function:

void pdf::marker_entry_free_recursive ( MarkerEntry self  ) 

Referenced by pdf::PDFCollection< MarkerEntry * >::clear().

Here is the caller graph for this function:

MarkerEntry * pdf::marker_entry_new ( unsigned int  uds_private_size  ) 
bool pdf::merge_rectangle ( const double  x_min,
const double  y_min,
const double  x_max,
const double  y_max,
PDFRectangle *  rect 
)

Definition at line 1014 of file pdf_page.cpp.

References ZERO_RANGE.

Referenced by pdf::PDFPage::get_bounding_rectangles().

01017 {
01018     if (!rect->isValid())
01019     {
01020         // initialize the rectangle
01021         rect->x1 = x_min;
01022         rect->x2 = x_max;
01023         rect->y1 = y_min;
01024         rect->y2 = y_max;
01025         return true;
01026     }
01027 
01028     if (fabs(y_min - rect->y1) < ZERO_RANGE
01029         && fabs(y_max - rect->y2) < ZERO_RANGE)
01030     {
01031         rect->x1 = min(x_min, rect->x1);
01032         rect->x2 = max(x_max, rect->x2);
01033         return true;
01034     }
01035 
01036     return false;
01037 }

Here is the caller graph for this function:

bool pdf::operator< ( const PDFPage &  left,
const PDFPage &  right 
)

Definition at line 55 of file pdf_prerender_policy.cpp.

References compare_priority(), pdf::PDFPage::get_bitmap(), pdf::PDFPage::get_doc_controller(), pdf::PDFPage::get_page_num(), pdf::PDFController::get_prerender_policy(), and pdf::PDFPage::locked().

00056 {
00057     // check bitmap
00058     // Has Bitmap < Doesn't have Bitmap
00059     if (left.get_bitmap() != 0 && right.get_bitmap() == 0)
00060     {
00061         return true;
00062     }
00063     else if (left.get_bitmap() == 0 && right.get_bitmap() != 0)
00064     {
00065         return false;
00066     }
00067 
00068     // check lock
00069     // Unlocked one < Locked one
00070     if (!left.locked() && right.locked())
00071     {
00072         return true;
00073     }
00074     else if (left.locked() && !right.locked())
00075     {
00076         return false;
00077     }
00078 
00079     // check GLOBAL requests list
00080     // compare the priority of two pages
00081     int ret_priority = compare_priority(left.get_page_num(),
00082                                         right.get_page_num(),
00083                                         left.get_doc_controller()->get_prerender_policy());
00084     if (ret_priority < 0)
00085     {
00086         return true;
00087     }
00088     return false;
00089 }

Here is the call graph for this function:

bool pdf::operator>= ( const PDFPage &  left,
const PDFPage &  right 
)

Definition at line 91 of file pdf_prerender_policy.cpp.

00092 {
00093     return !(left < right);
00094 }

static const char* pdf::unicode_to_utf8 ( const Unicode *  uni_str,
int  len 
) [static]

Definition at line 35 of file pdf_toc.cpp.

00036 {
00037     gsize bytes_read;
00038     gsize bytes_written;
00039     GError *error = NULL;
00040 
00041     gchar * utf8_str = g_convert((const gchar *)uni_str, len * 4,
00042                                  "UTF-8", "UCS-4LE",
00043                                  &bytes_read,
00044                                  &bytes_written,
00045                                  &error);
00046 
00047     //LOGPRINTF("%s", utf8_str);
00048 
00049     return utf8_str;
00050 }


Variable Documentation

const int pdf::ALLOWED_HYPERLINKS_NUMBER = 3 [static]
const int pdf::EXT_TABLE_SIZE [static]
Initial value:
 
                 sizeof(g_ext_table) / sizeof(g_ext_table[0])

Definition at line 40 of file pdf/plugin_impl/library_impl.cpp.

const std::string pdf::g_ext_table[] [static]
Initial value:
 
{
    ".pdf"
}

Internal file extension table. dummy file is a index file which contains a list of file names.

Definition at line 36 of file pdf/plugin_impl/library_impl.cpp.

const int pdf::PRIORITY_MIN = 0xFFFF [static]

Definition at line 32 of file pdf_render_requests.cpp.

Referenced by pdf::PDFRenderRequests::get_priority().

Generated by  doxygen 1.6.2-20100208