diff options
Diffstat (limited to 'winrt/mupdfwinrt/muctx.h')
-rw-r--r-- | winrt/mupdfwinrt/muctx.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/winrt/mupdfwinrt/muctx.h b/winrt/mupdfwinrt/muctx.h index 61aec5a4..2c8e45d7 100644 --- a/winrt/mupdfwinrt/muctx.h +++ b/winrt/mupdfwinrt/muctx.h @@ -3,11 +3,10 @@ #include <memory> #include <functional> #include <vector> -#include "utils.h" - #include <windows.h> #include <Winerror.h> #include <mutex> +#include "utils.h" extern "C" { #include "fitz.h" @@ -18,8 +17,13 @@ extern "C" { #define MAX_SEARCH 500 +using namespace Platform; /* For String */ using namespace Windows::Foundation; /* For Point */ +/* These are the std objects used to interface to muctx. We do use windows + String and Point types however */ + +/* Links */ typedef struct document_link_s { link_t type; @@ -28,19 +32,28 @@ typedef struct document_link_s std::unique_ptr<char[]> uri; int page_num; } document_link_t; - #define sh_link std::shared_ptr<document_link_t> #define sh_vector_link std::shared_ptr<std::vector<sh_link>> +/* Text Search */ typedef struct text_search_s { Point upper_left; Point lower_right; } text_search_t; - #define sh_text std::shared_ptr<text_search_t> #define sh_vector_text std::shared_ptr<std::vector<sh_text>> +/* Content Results */ +typedef struct content_s +{ + int page; + String^ string_orig; + String^ string_margin; +} content_t; +#define sh_content std::shared_ptr<content_t> +#define sh_vector_content std::shared_ptr<std::vector<sh_content>> + /* Needed for file handling */ using namespace Windows::Storage::Streams; using namespace Windows::Foundation; @@ -62,6 +75,8 @@ private: fz_rect mu_hit_bbox[MAX_SEARCH]; fz_cookie *mu_cookie; fz_stream *mu_stream; + void FlattenOutline(fz_outline *outline, int level, + sh_vector_content contents_vec); public: muctx(void); @@ -74,8 +89,5 @@ public: Point MeasurePage(fz_page *page); int GetLinks(int page_num, sh_vector_link links_vec); int GetTextSearch(int page_num, char* needle, sh_vector_text texts_vec); + int GetContents(sh_vector_content contents_vec); }; - - - - |