summaryrefslogtreecommitdiff
path: root/platform/ios
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-10-07 17:03:12 +0200
committerTor Andersson <tor.andersson@artifex.com>2015-12-11 12:11:31 +0100
commite3275837d5738c5092b2e452829919e31ad553e5 (patch)
tree0b1ffed536e6887236c4e50cbb808808bbe2684e /platform/ios
parentc22e6a6dc2bf6acbac955bd5fbdd896329dfd725 (diff)
downloadmupdf-e3275837d5738c5092b2e452829919e31ad553e5.tar.xz
Rename structured text structs and functions to 'stext'.
Less risk of confusion with the text type used in the device interface.
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/Classes/MuPageViewNormal.m24
-rw-r--r--platform/ios/Classes/MuPageViewReflow.m18
-rw-r--r--platform/ios/common.m12
3 files changed, 27 insertions, 27 deletions
diff --git a/platform/ios/Classes/MuPageViewNormal.m b/platform/ios/Classes/MuPageViewNormal.m
index 429785fe..f82c3413 100644
--- a/platform/ios/Classes/MuPageViewNormal.m
+++ b/platform/ios/Classes/MuPageViewNormal.m
@@ -56,8 +56,8 @@ static NSArray *enumerateAnnotations(fz_document *doc, fz_page *page)
static NSArray *enumerateWords(fz_document *doc, fz_page *page)
{
- fz_text_sheet *sheet = NULL;
- fz_text_page *text = NULL;
+ fz_stext_sheet *sheet = NULL;
+ fz_stext_page *text = NULL;
fz_device *dev = NULL;
NSMutableArray *lns = [NSMutableArray array];
NSMutableArray *wds;
@@ -74,16 +74,16 @@ static NSArray *enumerateWords(fz_document *doc, fz_page *page)
{
int b, l, c;
- sheet = fz_new_text_sheet(ctx);
- text = fz_new_text_page(ctx);
- dev = fz_new_text_device(ctx, sheet, text);
+ sheet = fz_new_stext_sheet(ctx);
+ text = fz_new_stext_page(ctx);
+ dev = fz_new_stext_device(ctx, sheet, text);
fz_run_page(ctx, page, dev, &fz_identity, NULL);
fz_drop_device(ctx, dev);
dev = NULL;
for (b = 0; b < text->len; b++)
{
- fz_text_block *block;
+ fz_stext_block *block;
if (text->blocks[b].type != FZ_PAGE_BLOCK_TEXT)
continue;
@@ -92,8 +92,8 @@ static NSArray *enumerateWords(fz_document *doc, fz_page *page)
for (l = 0; l < block->len; l++)
{
- fz_text_line *line = &block->lines[l];
- fz_text_span *span;
+ fz_stext_line *line = &block->lines[l];
+ fz_stext_span *span;
wds = [NSMutableArray array];
if (!wds)
@@ -107,11 +107,11 @@ static NSArray *enumerateWords(fz_document *doc, fz_page *page)
{
for (c = 0; c < span->len; c++)
{
- fz_text_char *ch = &span->text[c];
+ fz_stext_char *ch = &span->text[c];
fz_rect bbox;
CGRect rect;
- fz_text_char_bbox(ctx, &bbox, span, c);
+ fz_stext_char_bbox(ctx, &bbox, span, c);
rect = CGRectMake(bbox.x0, bbox.y0, bbox.x1 - bbox.x0, bbox.y1 - bbox.y0);
if (ch->c != ' ')
@@ -138,8 +138,8 @@ static NSArray *enumerateWords(fz_document *doc, fz_page *page)
}
fz_always(ctx);
{
- fz_drop_text_page(ctx, text);
- fz_drop_text_sheet(ctx, sheet);
+ fz_drop_stext_page(ctx, text);
+ fz_drop_stext_sheet(ctx, sheet);
fz_drop_device(ctx, dev);
}
fz_catch(ctx)
diff --git a/platform/ios/Classes/MuPageViewReflow.m b/platform/ios/Classes/MuPageViewReflow.m
index 44f4f4ae..2c093fd9 100644
--- a/platform/ios/Classes/MuPageViewReflow.m
+++ b/platform/ios/Classes/MuPageViewReflow.m
@@ -5,8 +5,8 @@ NSString *textAsHtml(fz_document *doc, int pageNum)
{
NSString *str = nil;
fz_page *page = NULL;
- fz_text_sheet *sheet = NULL;
- fz_text_page *text = NULL;
+ fz_stext_sheet *sheet = NULL;
+ fz_stext_page *text = NULL;
fz_device *dev = NULL;
fz_matrix ctm;
fz_buffer *buf = NULL;
@@ -22,9 +22,9 @@ NSString *textAsHtml(fz_document *doc, int pageNum)
fz_try(ctx)
{
ctm = fz_identity;
- sheet = fz_new_text_sheet(ctx);
- text = fz_new_text_page(ctx);
- dev = fz_new_text_device(ctx, sheet, text);
+ sheet = fz_new_stext_sheet(ctx);
+ text = fz_new_stext_page(ctx);
+ dev = fz_new_stext_device(ctx, sheet, text);
page = fz_load_page(ctx, doc, pageNum);
fz_run_page(ctx, page, dev, &ctm, NULL);
fz_drop_device(ctx, dev);
@@ -45,10 +45,10 @@ NSString *textAsHtml(fz_document *doc, int pageNum)
//fz_printf(ctx, out, "p{margin:0;padding:0;}\n");
fz_printf(ctx, out, "</style>\n");
fz_printf(ctx, out, "<body style=\"margin:0\"><div style=\"padding:10px\" id=\"content\">");
- fz_print_text_page_html(ctx, out, text);
+ fz_print_stext_page_html(ctx, out, text);
fz_printf(ctx, out, "</div></body>\n");
fz_printf(ctx, out, "<style>\n");
- fz_print_text_sheet(ctx, out, sheet);
+ fz_print_stext_sheet(ctx, out, sheet);
fz_printf(ctx, out, "</style>\n</html>\n");
out = NULL;
@@ -57,8 +57,8 @@ NSString *textAsHtml(fz_document *doc, int pageNum)
}
fz_always(ctx)
{
- fz_drop_text_page(ctx, text);
- fz_drop_text_sheet(ctx, sheet);
+ fz_drop_stext_page(ctx, text);
+ fz_drop_stext_sheet(ctx, sheet);
fz_drop_device(ctx, dev);
fz_drop_output(ctx, out);
fz_drop_buffer(ctx, buf);
diff --git a/platform/ios/common.m b/platform/ios/common.m
index 6f62329a..6ee3653f 100644
--- a/platform/ios/common.m
+++ b/platform/ios/common.m
@@ -21,16 +21,16 @@ int search_page(fz_document *doc, int number, char *needle, fz_cookie *cookie)
{
fz_page *page = fz_load_page(ctx, doc, number);
- fz_text_sheet *sheet = fz_new_text_sheet(ctx);
- fz_text_page *text = fz_new_text_page(ctx);
- fz_device *dev = fz_new_text_device(ctx, sheet, text);
+ fz_stext_sheet *sheet = fz_new_stext_sheet(ctx);
+ fz_stext_page *text = fz_new_stext_page(ctx);
+ fz_device *dev = fz_new_stext_device(ctx, sheet, text);
fz_run_page(ctx, page, dev, &fz_identity, cookie);
fz_drop_device(ctx, dev);
- hit_count = fz_search_text_page(ctx, text, needle, hit_bbox, nelem(hit_bbox));
+ hit_count = fz_search_stext_page(ctx, text, needle, hit_bbox, nelem(hit_bbox));
- fz_drop_text_page(ctx, text);
- fz_drop_text_sheet(ctx, sheet);
+ fz_drop_stext_page(ctx, text);
+ fz_drop_stext_sheet(ctx, sheet);
fz_drop_page(ctx, page);
return hit_count;