summaryrefslogtreecommitdiff
path: root/winrt
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-05-16 20:42:13 +0200
committerRobin Watts <robin.watts@artifex.com>2013-05-16 19:47:59 +0100
commitbd608dea4271ae256bad7dacee6acc605c2d6580 (patch)
tree3305952b198f66a2a877f1fc33f6efc0289543b8 /winrt
parent0451cf6d814f172f6370b46553865c66d0933c14 (diff)
downloadmupdf-bd608dea4271ae256bad7dacee6acc605c2d6580.tar.xz
winrt: Strip trailing whitespace.
Diffstat (limited to 'winrt')
-rw-r--r--winrt/mupdf_cpp/App.xaml2
-rw-r--r--winrt/mupdf_cpp/Common/StandardStyles.xaml16
-rw-r--r--winrt/mupdf_cpp/DocumentPage.cpp2
-rw-r--r--winrt/mupdf_cpp/DocumentPage.h27
-rw-r--r--winrt/mupdf_cpp/MainPage.xaml31
-rw-r--r--winrt/mupdf_cpp/MainPage.xaml.cpp158
-rw-r--r--winrt/mupdf_cpp/MainPage.xaml.h16
-rw-r--r--winrt/mupdf_cpp/Package.appxmanifest2
-rw-r--r--winrt/mupdf_cpp/RectList.h16
-rw-r--r--winrt/mupdfwinrt/ContentItem.h2
-rw-r--r--winrt/mupdfwinrt/Links.h4
-rw-r--r--winrt/mupdfwinrt/muctx.cpp26
-rw-r--r--winrt/mupdfwinrt/muctx.h14
-rw-r--r--winrt/mupdfwinrt/mudocument.cpp26
-rw-r--r--winrt/mupdfwinrt/mudocument.h12
15 files changed, 174 insertions, 180 deletions
diff --git a/winrt/mupdf_cpp/App.xaml b/winrt/mupdf_cpp/App.xaml
index 4dabc5cc..dfb5d11c 100644
--- a/winrt/mupdf_cpp/App.xaml
+++ b/winrt/mupdf_cpp/App.xaml
@@ -8,7 +8,7 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
- <!--
+ <!--
Styles that define common aspects of the platform look and feel
Required by Visual Studio project and item templates
-->
diff --git a/winrt/mupdf_cpp/Common/StandardStyles.xaml b/winrt/mupdf_cpp/Common/StandardStyles.xaml
index 414be872..716cf8e2 100644
--- a/winrt/mupdf_cpp/Common/StandardStyles.xaml
+++ b/winrt/mupdf_cpp/Common/StandardStyles.xaml
@@ -142,7 +142,7 @@
</Style>
<!-- Button styles -->
-
+
<!--
TextButtonStyle is used to style a Button using subheader-styled text with no other adornment. There
are two styles that are based on TextButtonStyle (TextPrimaryButtonStyle and TextSecondaryButtonStyle)
@@ -242,8 +242,8 @@
</Style>
<!--
- AppBarButtonStyle is used to style a Button (or ToggleButton) for use in an App Bar. Content will be centered
- and should fit within the 40 pixel radius glyph provided. 16-point Segoe UI Symbol is used for content text
+ AppBarButtonStyle is used to style a Button (or ToggleButton) for use in an App Bar. Content will be centered
+ and should fit within the 40 pixel radius glyph provided. 16-point Segoe UI Symbol is used for content text
to simplify the use of glyphs from that font. AutomationProperties.Name is used for the text below the glyph.
-->
<Style x:Key="AppBarButtonStyle" TargetType="ButtonBase">
@@ -399,10 +399,10 @@
</Setter>
</Style>
- <!--
+ <!--
Standard AppBarButton Styles for use with Button and ToggleButton
-
- An AppBarButton Style is provided for each of the glyphs in the Segoe UI Symbol font.
+
+ An AppBarButton Style is provided for each of the glyphs in the Segoe UI Symbol font.
Uncomment any style you reference (as not all may be required).
-->
<Style x:Key="HelpAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
@@ -457,7 +457,7 @@
</Style>
<!--
-
+
<Style x:Key="SkipBackAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SkipBackAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Skip Back"/>
@@ -1586,7 +1586,7 @@
<!--
SnappedBackButtonStyle is used to style a Button for use in the title area of a snapped page. Margins appropriate
for the conventional page layout are included as part of the style.
-
+
The obvious duplication here is necessary as the glyphs used in snapped are not merely smaller versions of the same
glyph but are actually distinct.
-->
diff --git a/winrt/mupdf_cpp/DocumentPage.cpp b/winrt/mupdf_cpp/DocumentPage.cpp
index ace6138f..3ee99dcd 100644
--- a/winrt/mupdf_cpp/DocumentPage.cpp
+++ b/winrt/mupdf_cpp/DocumentPage.cpp
@@ -13,5 +13,3 @@ namespace mupdf_cpp
_isPropertyChangedObserved = false;
}
}
-
-
diff --git a/winrt/mupdf_cpp/DocumentPage.h b/winrt/mupdf_cpp/DocumentPage.h
index 3307ec3a..1ea1f669 100644
--- a/winrt/mupdf_cpp/DocumentPage.h
+++ b/winrt/mupdf_cpp/DocumentPage.h
@@ -3,7 +3,6 @@
#include "RectList.h"
#include <collection.h>
-
/* Used for binding to the xaml in the scroll view. */
using namespace Windows::UI::Xaml::Media::Imaging;
using namespace Windows::UI::Xaml::Controls;
@@ -17,11 +16,10 @@ typedef enum {
NOTSET
} Page_Content_t;
-
namespace mupdf_cpp
{
// enables data binding with this class
- [Windows::UI::Xaml::Data::Bindable]
+ [Windows::UI::Xaml::Data::Bindable]
public ref class DocumentPage sealed : Windows::UI::Xaml::Data::INotifyPropertyChanged
{
private:
@@ -74,8 +72,8 @@ namespace mupdf_cpp
void set(int value)
{
if (value > NOTSET)
- {
- throw ref new Platform::InvalidArgumentException();
+ {
+ throw ref new Platform::InvalidArgumentException();
}
content = (Page_Content_t) value;
}
@@ -90,9 +88,9 @@ namespace mupdf_cpp
void set(int value)
{
- if (value < 0)
- {
- throw ref new Platform::InvalidArgumentException();
+ if (value < 0)
+ {
+ throw ref new Platform::InvalidArgumentException();
}
height = value;
}
@@ -107,9 +105,9 @@ namespace mupdf_cpp
void set(int value)
{
- if (value < 0)
- {
- throw ref new Platform::InvalidArgumentException();
+ if (value < 0)
+ {
+ throw ref new Platform::InvalidArgumentException();
}
width = value;
}
@@ -124,9 +122,9 @@ namespace mupdf_cpp
void set(double value)
{
- if (value < 0)
- {
- throw ref new Platform::InvalidArgumentException();
+ if (value < 0)
+ {
+ throw ref new Platform::InvalidArgumentException();
}
zoom = value;
}
@@ -150,7 +148,6 @@ namespace mupdf_cpp
bool _isPropertyChangedObserved;
event Windows::UI::Xaml::Data::PropertyChangedEventHandler^ _privatePropertyChanged;
-
protected:
/// <summary>
/// Notifies listeners that a property value has changed.
diff --git a/winrt/mupdf_cpp/MainPage.xaml b/winrt/mupdf_cpp/MainPage.xaml
index 184b3668..9ddd2873 100644
--- a/winrt/mupdf_cpp/MainPage.xaml
+++ b/winrt/mupdf_cpp/MainPage.xaml
@@ -72,7 +72,7 @@
<FlipView.ItemTemplate>
<DataTemplate>
<ScrollViewer
- ZoomMode="Enabled"
+ ZoomMode="Enabled"
ViewChanged="ScrollChanged"
HorizontalScrollMode="Auto"
VerticalScrollMode="Auto"
@@ -80,10 +80,10 @@
HorizontalSnapPointsType="None"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
- MinZoomFactor="0.25"
+ MinZoomFactor="0.25"
MaxZoomFactor="4">
<Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="{Binding Height}" Width="{Binding Width}">
- <Image Source="{Binding Image}" Width="{Binding Width}" Height="{Binding Height}"
+ <Image Source="{Binding Image}" Width="{Binding Width}" Height="{Binding Height}"
Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0"/>
<!-- After much work, figured out how to have a binding for the rectangles. TextBox and LinkBox are
a collection that is in the other main collection used for the scroll viewer. It works
@@ -150,7 +150,7 @@
<FlipView.ItemTemplate>
<DataTemplate>
<ScrollViewer
- ZoomMode="Enabled"
+ ZoomMode="Enabled"
ViewChanged="ScrollChanged"
HorizontalScrollMode="Auto"
VerticalScrollMode="Auto"
@@ -158,10 +158,10 @@
HorizontalSnapPointsType="None"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
- MinZoomFactor="0.25"
+ MinZoomFactor="0.25"
MaxZoomFactor="4">
<Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="{Binding Height}" Width="{Binding Width}">
- <Image Source="{Binding Image}" Width="{Binding Width}" Height="{Binding Height}"
+ <Image Source="{Binding Image}" Width="{Binding Width}" Height="{Binding Height}"
Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0"/>
<ItemsControl ItemsSource="{Binding Path=TextBox}">
<ItemsControl.ItemsPanel>
@@ -214,8 +214,8 @@
</FlipView.ItemTemplate>
</FlipView>
</Canvas>
- <ListView x:Name="xaml_ListView" Foreground="Black" HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch" Opacity="0" IsItemClickEnabled="True"
+ <ListView x:Name="xaml_ListView" Foreground="Black" HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch" Opacity="0" IsItemClickEnabled="True"
ItemClick="ContentSelected" SelectionMode="Single" IsEnabled="False">
<ListView.ItemTemplate>
@@ -232,19 +232,19 @@
</ListView>
</Grid>
<WebView x:Name="xaml_WebView" HorizontalAlignment="Stretch" Width="Auto" Height="Auto"
- VerticalAlignment="Stretch" Visibility="Collapsed"
- ScrollViewer.HorizontalScrollBarVisibility="Visible"
- ScrollViewer.VerticalScrollBarVisibility="Visible"
- ScrollViewer.VerticalScrollMode="Enabled"
- ScrollViewer.HorizontalScrollMode="Enabled"
+ VerticalAlignment="Stretch" Visibility="Collapsed"
+ ScrollViewer.HorizontalScrollBarVisibility="Visible"
+ ScrollViewer.VerticalScrollBarVisibility="Visible"
+ ScrollViewer.VerticalScrollMode="Enabled"
+ ScrollViewer.HorizontalScrollMode="Enabled"
ScrollViewer.ZoomMode="Enabled"/>
<StackPanel x:Name="xaml_ProgressStack" Opacity="1" VerticalAlignment="Center" Visibility="Collapsed">
<Border BorderThickness="5" BorderBrush="Black" Margin="300">
<StackPanel Background="LightGray" >
- <TextBlock HorizontalAlignment="Center" Margin="10"
+ <TextBlock HorizontalAlignment="Center" Margin="10"
Text="Text Search Progress" FontSize="20"/>
- <ProgressBar x:Name="xaml_Progress" Margin="5" Height="15"
+ <ProgressBar x:Name="xaml_Progress" Margin="5" Height="15"
IsIndeterminate="False" Maximum="100" VerticalAlignment="Stretch" />
<Button HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10" Click="CancelSearch" Height="39">
<TextBlock HorizontalAlignment="Center" Text="Cancel"/>
@@ -255,4 +255,3 @@
</Grid>
</Page>
-
diff --git a/winrt/mupdf_cpp/MainPage.xaml.cpp b/winrt/mupdf_cpp/MainPage.xaml.cpp
index 5b8dfeab..0e36ffbe 100644
--- a/winrt/mupdf_cpp/MainPage.xaml.cpp
+++ b/winrt/mupdf_cpp/MainPage.xaml.cpp
@@ -10,7 +10,7 @@
#define THUMB_PREADD 10
#define MIN_SCALE 0.5
-#define SCALE_THUMB 0.1
+#define SCALE_THUMB 0.1
#define BLANK_WIDTH 17
#define BLANK_HEIGHT 22
@@ -112,8 +112,8 @@ void mupdf_cpp::MainPage::NotifyUser(String^ strMessage, NotifyType_t type)
switch (type)
{
case StatusMessage:
- OKCommand = ref new UICommand("OK",
- ref new UICommandInvokedHandler(this, &mupdf_cpp::MainPage::OKInvokedHandler));
+ OKCommand = ref new UICommand("OK",
+ ref new UICommandInvokedHandler(this, &mupdf_cpp::MainPage::OKInvokedHandler));
msg->Commands->Append(OKCommand);
/// Set the command that will be invoked by default
msg->DefaultCommandIndex = 0;
@@ -121,7 +121,7 @@ void mupdf_cpp::MainPage::NotifyUser(String^ strMessage, NotifyType_t type)
msg->CancelCommandIndex = 1;
break;
case ErrorMessage:
- ExitCommand = ref new UICommand("Exit",
+ ExitCommand = ref new UICommand("Exit",
ref new UICommandInvokedHandler(this, &mupdf_cpp::MainPage::ExitInvokedHandler));
msg->Commands->Append(ExitCommand);
/// Set the command that will be invoked by default
@@ -141,7 +141,7 @@ bool mupdf_cpp::MainPage::EnsureUnsnapped()
// FilePicker APIs will not work if the application is in a snapped state.
// If an app wants to show a FilePicker while snapped, it must attempt to unsnap first
- bool unsnapped = (ApplicationView::Value != ApplicationViewState::Snapped ||
+ bool unsnapped = (ApplicationView::Value != ApplicationViewState::Snapped ||
ApplicationView::TryUnsnap());
if (!unsnapped)
{
@@ -162,21 +162,21 @@ void mupdf_cpp::MainPage::Picker(Platform::Object^ sender, Windows::UI::Xaml::Ro
openPicker->FileTypeFilter->Append(".xps");
openPicker->FileTypeFilter->Append(".oxps");
- create_task(openPicker->PickSingleFileAsync()).then([this](StorageFile^ file)
- {
- if (file)
- {
+ create_task(openPicker->PickSingleFileAsync()).then([this](StorageFile^ file)
+ {
+ if (file)
+ {
this->OpenDocumentPrep(file);
- }
- else
- {
+ }
+ else
+ {
/* Nothing selected */
- }
+ }
});
}
/* Set the page with the new raster information */
-void MainPage::UpdatePage(int page_num, InMemoryRandomAccessStream^ ras,
+void MainPage::UpdatePage(int page_num, InMemoryRandomAccessStream^ ras,
Point ras_size, Page_Content_t content_type)
{
assert(IsMainThread());
@@ -206,7 +206,7 @@ void MainPage::UpdatePage(int page_num, InMemoryRandomAccessStream^ ras,
}
/* Set the page with the new raster information but only the image data */
-void MainPage::ReplaceImage(int page_num, InMemoryRandomAccessStream^ ras,
+void MainPage::ReplaceImage(int page_num, InMemoryRandomAccessStream^ ras,
Point ras_size)
{
assert(IsMainThread());
@@ -291,11 +291,11 @@ void Prepare_bmp(int width, int height, DataWriter ^dw)
void MainPage::ReleasePages(int old_page, int new_page)
{
if (old_page == new_page) return;
- /* To keep from having memory issue reset the page back to
+ /* To keep from having memory issue reset the page back to
the thumb if we are done rendering the thumbnails */
- for (int k = old_page - LOOK_AHEAD; k <= old_page + LOOK_AHEAD; k++)
+ for (int k = old_page - LOOK_AHEAD; k <= old_page + LOOK_AHEAD; k++)
{
- if (k < new_page - LOOK_AHEAD || k > new_page + LOOK_AHEAD)
+ if (k < new_page - LOOK_AHEAD || k > new_page + LOOK_AHEAD)
{
if (k >= 0 && k < this->m_num_pages)
{
@@ -375,14 +375,14 @@ void mupdf_cpp::MainPage::CleanUp()
if (m_page_link_list != nullptr && m_page_link_list->Size > 0)
m_page_link_list->Clear();
if (m_text_list->Size > 0)
- m_text_list->Clear();
+ m_text_list->Clear();
if (m_linkset != nullptr && m_linkset->Size > 0)
m_linkset->Clear();
- if (this->mu_doc != nullptr)
+ if (this->mu_doc != nullptr)
mu_doc->CleanUp();
- mu_doc = ref new mudocument();
+ mu_doc = ref new mudocument();
if (mu_doc == nullptr)
throw ref new FailureException("Document allocation failed!");
@@ -406,7 +406,7 @@ void mupdf_cpp::MainPage::CleanUp()
this->xaml_PageSlider->Minimum = m_slider_min;
this->xaml_PageSlider->Maximum = m_slider_max;
- this->xaml_PageSlider->IsEnabled = false;
+ this->xaml_PageSlider->IsEnabled = false;
}
/* Create the thumbnail images */
@@ -465,20 +465,20 @@ void mupdf_cpp::MainPage::RenderThumbs()
/* If cancelled then save the last one as the continuation will not
have occured. */
- if (is_task_cancellation_requested())
+ if (is_task_cancellation_requested())
{
cancel_current_task();
}
}
return num_pages; /* all done with thumbnails! */
- }, token).then([this](task<int> the_task)
+ }, token).then([this](task<int> the_task)
{
/* Finish adding them, but not if we were cancelled. */
bool is_cancelled = false;
try
{
the_task.get();
- }
+ }
catch (const task_canceled& e)
{
is_cancelled = true;
@@ -495,7 +495,7 @@ void mupdf_cpp::MainPage::RenderThumbs()
void mupdf_cpp::MainPage::OpenDocumentPrep(StorageFile^ file)
{
- if (this->m_num_pages != -1)
+ if (this->m_num_pages != -1)
{
m_init_done = false;
@@ -521,12 +521,12 @@ void mupdf_cpp::MainPage::OpenDocumentPrep(StorageFile^ file)
return 0;
}, task_continuation_context::use_current()).then([this, file](task<int> the_task)
{
- OpenDocument(file);
+ OpenDocument(file);
}, task_continuation_context::use_current());
}
else
{
- OpenDocument(file);
+ OpenDocument(file);
}
}
@@ -539,7 +539,7 @@ void mupdf_cpp::MainPage::OpenDocument(StorageFile^ file)
WideCharToMultiByte(CP_UTF8, 0, w ,-1 ,name ,cb ,nullptr, nullptr);
char *ext = strrchr(name, '.');
-
+
this->SetFlipView();
/* Open document and when open, push on */
@@ -551,16 +551,16 @@ void mupdf_cpp::MainPage::OpenDocument(StorageFile^ file)
m_num_pages = mu_doc->GetNumPages();
- if ((m_currpage) >= m_num_pages)
+ if ((m_currpage) >= m_num_pages)
{
m_currpage = m_num_pages - 1;
- }
- else if (m_currpage < 0)
+ }
+ else if (m_currpage < 0)
{
m_currpage = 0;
}
/* Initialize all the flipvew items with blanks and the thumbnails. */
- for (int k = 0; k < m_num_pages; k++)
+ for (int k = 0; k < m_num_pages; k++)
{
/* Blank pages */
DocumentPage^ doc_page = ref new DocumentPage();
@@ -579,18 +579,18 @@ void mupdf_cpp::MainPage::OpenDocument(StorageFile^ file)
m_linkset->Append(false);
}
- this->xaml_horiz_flipView->ItemsSource = m_docPages;
+ this->xaml_horiz_flipView->ItemsSource = m_docPages;
this->xaml_vert_flipView->ItemsSource = m_docPages;
/* Do the first few pages, then start the thumbs */
spatial_info_t spatial_info = InitSpatial(1);
- for (int k = 0; k < LOOK_AHEAD + 2; k++)
+ for (int k = 0; k < LOOK_AHEAD + 2; k++)
{
- if (m_num_pages > k )
+ if (m_num_pages > k )
{
Point ras_size = ComputePageSize(spatial_info, k);
- auto render_task =
+ auto render_task =
create_task(mu_doc->RenderPageAsync(k, ras_size.X, ras_size.Y));
render_task.then([this, k, ras_size] (InMemoryRandomAccessStream^ ras)
@@ -600,12 +600,12 @@ void mupdf_cpp::MainPage::OpenDocument(StorageFile^ file)
}
}
/* Update the slider settings, if more than one page */
- if (m_num_pages > 1)
+ if (m_num_pages > 1)
{
this->xaml_PageSlider->Maximum = m_num_pages;
this->xaml_PageSlider->Minimum = 1;
this->xaml_PageSlider->IsEnabled = true;
- }
+ }
else
{
this->xaml_PageSlider->Maximum = 0;
@@ -630,45 +630,45 @@ void mupdf_cpp::MainPage::RenderRange(int curr_page)
assert(IsMainThread());
if (m_flip_from_searchlink)
range = 0;
- for (int k = curr_page - LOOK_AHEAD; k <= curr_page + LOOK_AHEAD; k++)
+ for (int k = curr_page - LOOK_AHEAD; k <= curr_page + LOOK_AHEAD; k++)
{
- if (k >= 0 && k < m_num_pages)
+ if (k >= 0 && k < m_num_pages)
{
/* Check if page is already rendered */
auto doc = this->m_docPages->GetAt(k);
- if (doc->Content != FULL_RESOLUTION)
+ if (doc->Content != FULL_RESOLUTION)
{
Point ras_size = ComputePageSize(spatial_info, k);
- auto render_task =
+ auto render_task =
create_task(mu_doc->RenderPageAsync(k, ras_size.X, ras_size.Y));
render_task.then([this, k, ras_size] (InMemoryRandomAccessStream^ ras)
- {
+ {
UpdatePage(k, ras, ras_size, FULL_RESOLUTION);
}, task_continuation_context::use_current()).then([this, k, curr_page]()
{
if (k == curr_page && this->m_links_on)
AddLinkCanvas();
- if (k == curr_page && this->m_text_list->Size > 0 &&
- m_flip_from_searchlink)
+ if (k == curr_page && this->m_text_list->Size > 0 &&
+ m_flip_from_searchlink)
{
AddTextCanvas();
m_flip_from_searchlink = false;
}
},task_continuation_context::use_current());
}
- else
+ else
{
/* We did not need to render the curr_page, so add links below if
- needed. Otherwise, we need to wait for the task above to
+ needed. Otherwise, we need to wait for the task above to
complete before we add the links. */
if (k == curr_page)
curr_page_rendered = false;
}
}
- }
+ }
m_currpage = curr_page;
- if (this->m_links_on && !curr_page_rendered)
+ if (this->m_links_on && !curr_page_rendered)
AddLinkCanvas();
if (this->m_text_list->Size > 0 && !curr_page_rendered && m_flip_from_searchlink)
{
@@ -686,24 +686,24 @@ void mupdf_cpp::MainPage::Slider_ValueChanged(Platform::Object^ sender, Windows:
m_update_flip = false;
return;
}
- if (m_init_done && this->xaml_PageSlider->IsEnabled)
+ if (m_init_done && this->xaml_PageSlider->IsEnabled)
{
/* Make sure to clear any text search */
auto doc_old = this->m_docPages->GetAt(m_currpage);
doc_old->TextBox = nullptr;
auto doc = this->m_docPages->GetAt(newValue);
- if (doc->Content != FULL_RESOLUTION)
+ if (doc->Content != FULL_RESOLUTION)
{
spatial_info_t spatial_info = InitSpatial(1);
Point ras_size = ComputePageSize(spatial_info, newValue);
- auto render_task =
+ auto render_task =
create_task(mu_doc->RenderPageAsync(newValue, ras_size.X, ras_size.Y));
render_task.then([this, newValue, ras_size] (InMemoryRandomAccessStream^ ras)
{
UpdatePage(newValue, ras, ras_size, FULL_RESOLUTION);
- this->m_ren_status = REN_AVAILABLE;
+ this->m_ren_status = REN_AVAILABLE;
this->m_currpage = newValue;
m_sliderchange = true;
this->m_curr_flipView->SelectedIndex = newValue;
@@ -718,7 +718,7 @@ void mupdf_cpp::MainPage::FlipView_SelectionChanged(Object^ sender, SelectionCha
{
int pos = this->m_curr_flipView->SelectedIndex;
- if (pos >= 0)
+ if (pos >= 0)
{
m_update_flip = true;
if (xaml_PageSlider->IsEnabled)
@@ -759,7 +759,7 @@ void mupdf_cpp::MainPage::Searcher(Platform::Object^ sender, Windows::UI::Xaml::
}
else if (leftPanel != nullptr && !m_insearch)
{
- /* Search is not going to work in snapped view for now to simplify UI
+ /* Search is not going to work in snapped view for now to simplify UI
in this cramped case. So see if we can get out of snapped mode. */
if (!EnsureUnsnapped())
@@ -769,7 +769,7 @@ void mupdf_cpp::MainPage::Searcher(Platform::Object^ sender, Windows::UI::Xaml::
Windows::UI::Xaml::Controls::Button^ PrevButton = ref new Button();
PrevButton->Style = safe_cast<Windows::UI::Xaml::Style^>(App::Current->Resources->Lookup("PreviousAppBarButtonStyle"));
PrevButton->Click += ref new RoutedEventHandler(this, &mupdf_cpp::MainPage::SearchPrev);
-
+
Windows::UI::Xaml::Controls::Button^ NextButton = ref new Button();
NextButton->Style = safe_cast<Windows::UI::Xaml::Style^>(App::Current->Resources->Lookup("NextAppBarButtonStyle"));
NextButton->Click += ref new RoutedEventHandler(this, &mupdf_cpp::MainPage::SearchNext);
@@ -778,7 +778,7 @@ void mupdf_cpp::MainPage::Searcher(Platform::Object^ sender, Windows::UI::Xaml::
SearchBox->Name = "findBox";
SearchBox->Width = 200;
SearchBox->Height = 20;
-
+
leftPanel->Children->Append(SearchBox);
leftPanel->Children->Append(PrevButton);
leftPanel->Children->Append(NextButton);
@@ -922,7 +922,7 @@ void mupdf_cpp::MainPage::SearchInDirection(int dir, String^ textToFind)
xaml_ProgressStack->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
if (page_num == TEXT_NOT_FOUND)
{
- auto str1 = "\"" + textToFind + "\" Was Not Found In The Search";
+ auto str1 = "\"" + textToFind + "\" Was Not Found In The Search";
NotifyUser(str1, StatusMessage);
this->m_search_active = false;
}
@@ -984,7 +984,7 @@ void mupdf_cpp::MainPage::GridSizeChanged()
{
int height = xaml_OutsideGrid->ActualHeight;
int height_app = TopAppBar1->ActualHeight;
-
+
xaml_WebView->Height = height - height_app;
}
@@ -1020,7 +1020,7 @@ void mupdf_cpp::MainPage::UpDatePageSizes()
thumb_page->Height = curr_height / min_scale;
thumb_page->Width = curr_width / min_scale;
}
- }
+ }
}
};
@@ -1028,18 +1028,18 @@ void mupdf_cpp::MainPage::UpDatePageSizes()
void mupdf_cpp::MainPage::Linker(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
m_links_on = !m_links_on;
-
+
if (m_links_on)
AddLinkCanvas();
else
{
/* Make sure surrounding render pages lose their links */
- for (int k = m_currpage - LOOK_AHEAD; k <= m_currpage + LOOK_AHEAD; k++)
+ for (int k = m_currpage - LOOK_AHEAD; k <= m_currpage + LOOK_AHEAD; k++)
{
- if (k >= 0 && k < m_num_pages)
+ if (k >= 0 && k < m_num_pages)
{
auto doc_page = this->m_docPages->GetAt(k);
- if (doc_page->Content == FULL_RESOLUTION)
+ if (doc_page->Content == FULL_RESOLUTION)
{
doc_page->LinkBox = nullptr;
}
@@ -1114,9 +1114,9 @@ void mupdf_cpp::MainPage::LinkTapped(Platform::Object^ sender, Windows::UI::Xaml
{
Rectangle^ rect = safe_cast<Rectangle^>(e->OriginalSource);
String^ str_index = safe_cast<String^>(rect->Tag);
- int index = _wtof(str_index->Data());
-
- if (index >= 0 && index < m_num_pages)
+ int index = _wtof(str_index->Data());
+
+ if (index >= 0 && index < m_num_pages)
{
auto link_list = m_page_link_list->GetAt(m_currpage);
auto link = link_list->GetAt(index);
@@ -1124,7 +1124,7 @@ void mupdf_cpp::MainPage::LinkTapped(Platform::Object^ sender, Windows::UI::Xaml
if (link->Type == LINK_GOTO)
{
this->m_curr_flipView->SelectedIndex = link->PageNum;
- }
+ }
else if (link->Type == LINK_URI)
{
// Set the option to show a warning
@@ -1151,16 +1151,16 @@ void mupdf_cpp::MainPage::LinkTapped(Platform::Object^ sender, Windows::UI::Xaml
/* Bring up the contents */
void mupdf_cpp::MainPage::ContentDisplay(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
- if (this->m_num_pages < 0)
+ if (this->m_num_pages < 0)
return;
- if (this->xaml_ListView->IsEnabled)
+ if (this->xaml_ListView->IsEnabled)
{
this->xaml_ListView->Opacity = 0.0;
this->xaml_ListView->IsEnabled = false;
this->m_curr_flipView->Opacity = 1.0;
this->m_curr_flipView->IsEnabled = true;
- }
+ }
else
{
if (xaml_ListView->Items->Size == 0)
@@ -1179,15 +1179,15 @@ void mupdf_cpp::MainPage::ContentDisplay(Platform::Object^ sender, Windows::UI::
this->m_curr_flipView->Opacity = 0.0;
this->m_curr_flipView->IsEnabled = false;
}
- }
- else
+ }
+ else
{
this->xaml_ListView->Opacity = 1.0;
this->xaml_ListView->IsEnabled = true;
this->m_curr_flipView->Opacity = 0.0;
this->m_curr_flipView->IsEnabled = false;
}
- }
+ }
}
void mupdf_cpp::MainPage::ContentSelected(Platform::Object^ sender, Windows::UI::Xaml::Controls::ItemClickEventArgs^ e)
@@ -1221,7 +1221,7 @@ void mupdf_cpp::MainPage::Reflower(Platform::Object^ sender, Windows::UI::Xaml::
xaml_WebView->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
xaml_WebView->Opacity = 0.0;
- }
+ }
else if (this->m_curr_flipView->IsEnabled)
{
String^ html_string = mu_doc->ComputeHTML(this->m_currpage);
@@ -1248,11 +1248,11 @@ void mupdf_cpp::MainPage::UpdateAppBarButtonViewState()
VisualStateManager::GoToState(Contents, viewState, true);
VisualStateManager::GoToState(Links, viewState, true);
VisualStateManager::GoToState(Reflow, viewState, true);
- VisualStateManager::GoToState(Help, viewState, true);
+ VisualStateManager::GoToState(Help, viewState, true);
}
/* Manipulation zooming with touch input */
-void mupdf_cpp::MainPage::ScrollChanged(Platform::Object^ sender,
+void mupdf_cpp::MainPage::ScrollChanged(Platform::Object^ sender,
Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs^ e)
{
ScrollViewer^ scrollviewer = safe_cast<ScrollViewer^> (sender);
@@ -1269,7 +1269,7 @@ void mupdf_cpp::MainPage::ScrollChanged(Platform::Object^ sender,
spatial_info_t spatial_info = InitSpatial(doc_page->Zoom);
Point ras_size = ComputePageSize(spatial_info, page);
- auto render_task =
+ auto render_task =
create_task(mu_doc->RenderPageAsync(page, ras_size.X, ras_size.Y));
render_task.then([this, page, ras_size] (InMemoryRandomAccessStream^ ras)
diff --git a/winrt/mupdf_cpp/MainPage.xaml.h b/winrt/mupdf_cpp/MainPage.xaml.h
index f6cdb218..040d03c4 100644
--- a/winrt/mupdf_cpp/MainPage.xaml.h
+++ b/winrt/mupdf_cpp/MainPage.xaml.h
@@ -41,12 +41,12 @@ typedef enum {
REN_AVAILABLE = 0,
REN_THUMBS,
REN_UPDATE_THUMB_CANVAS,
- REN_PAGE /* Used to ignore value when source based setting */
+ REN_PAGE /* Used to ignore value when source based setting */
} RenderingStatus_t;
typedef struct spatial_info_s
{
- Point size;
+ Point size;
double scale_factor;
} spatial_info_t;
@@ -69,10 +69,10 @@ namespace mupdf_cpp
Vector<DocumentPage^>^ m_docPages;
Vector<DocumentPage^>^ m_thumbnails;
Vector<IVector<RectList^>^>^ m_page_link_list;
- Vector<int>^ m_linkset;
+ Vector<int>^ m_linkset;
Vector<RectList^>^ m_text_list;
int m_rectlist_page;
- mudocument^ mu_doc;
+ mudocument^ mu_doc;
bool m_file_open;
int m_currpage;
int m_searchpage;
@@ -87,8 +87,8 @@ namespace mupdf_cpp
bool m_page_update;
long long m_memory_use;
WriteableBitmap ^m_BlankBmp;
- String^ m_textcolor;
- String^ m_linkcolor;
+ String^ m_textcolor;
+ String^ m_linkcolor;
FlipView^ m_curr_flipView;
RenderingStatus_t m_ren_status;
cancellation_token_source m_ThumbCancel;
@@ -108,7 +108,7 @@ namespace mupdf_cpp
void CleanUp();
void UpdatePage(int page_num, InMemoryRandomAccessStream^ ras, Point ras_size, Page_Content_t content_type);
void CreateBlank(int width, int height);
- void HandleFileNotFoundException(Platform::COMException^ e);
+ void HandleFileNotFoundException(Platform::COMException^ e);
void NotifyUserFileNotExist();
void SetFlipView();
void Slider_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e);
@@ -117,7 +117,7 @@ namespace mupdf_cpp
void SearchNext(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void SearchPrev(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void CancelSearch(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
- void SearchInDirection(int dir, String^ textToFind);
+ void SearchInDirection(int dir, String^ textToFind);
void ShowSearchResults(int page_num, int box_count);
void ClearTextSearch();
void AddTextCanvas();
diff --git a/winrt/mupdf_cpp/Package.appxmanifest b/winrt/mupdf_cpp/Package.appxmanifest
index a071179b..6184bea8 100644
--- a/winrt/mupdf_cpp/Package.appxmanifest
+++ b/winrt/mupdf_cpp/Package.appxmanifest
@@ -45,4 +45,4 @@
<Capability Name="documentsLibrary" />
<Capability Name="internetClient" />
</Capabilities>
-</Package> \ No newline at end of file
+</Package>
diff --git a/winrt/mupdf_cpp/RectList.h b/winrt/mupdf_cpp/RectList.h
index 5d802327..999fe3d2 100644
--- a/winrt/mupdf_cpp/RectList.h
+++ b/winrt/mupdf_cpp/RectList.h
@@ -7,7 +7,7 @@ using namespace Platform; /* For String */
namespace mupdf_cpp
{
- [Windows::UI::Xaml::Data::Bindable] // in c++, adding this attribute to ref classes enables data binding for more info search for 'Bindable' on the page http://go.microsoft.com/fwlink/?LinkId=254639
+ [Windows::UI::Xaml::Data::Bindable] // in c++, adding this attribute to ref classes enables data binding for more info search for 'Bindable' on the page http://go.microsoft.com/fwlink/?LinkId=254639
public ref class RectList sealed
{
@@ -15,13 +15,13 @@ namespace mupdf_cpp
int height;
int width;
int x;
- int y;
+ int y;
String^ color;
/* These are used to store the link infomation */
int type;
int pagenum;
Windows::Foundation::Uri ^uri;
- String^ index; // For identify which rectangle was tapped
+ String^ index; // For identify which rectangle was tapped
public:
RectList(void);
@@ -61,8 +61,8 @@ namespace mupdf_cpp
void set(int value)
{
if (value < 0)
- {
- throw ref new Platform::InvalidArgumentException();
+ {
+ throw ref new Platform::InvalidArgumentException();
}
height = value;
}
@@ -77,9 +77,9 @@ namespace mupdf_cpp
void set(int value)
{
- if (value < 0)
- {
- throw ref new Platform::InvalidArgumentException();
+ if (value < 0)
+ {
+ throw ref new Platform::InvalidArgumentException();
}
width = value;
}
diff --git a/winrt/mupdfwinrt/ContentItem.h b/winrt/mupdfwinrt/ContentItem.h
index ec2e2121..90069459 100644
--- a/winrt/mupdfwinrt/ContentItem.h
+++ b/winrt/mupdfwinrt/ContentItem.h
@@ -24,7 +24,7 @@ namespace mupdfwinrt {
void set(int value)
{
if (value < 0)
- throw ref new Platform::InvalidArgumentException();
+ throw ref new Platform::InvalidArgumentException();
page = value;
}
}
diff --git a/winrt/mupdfwinrt/Links.h b/winrt/mupdfwinrt/Links.h
index 00a08f73..bb5b87bb 100644
--- a/winrt/mupdfwinrt/Links.h
+++ b/winrt/mupdfwinrt/Links.h
@@ -13,7 +13,7 @@ namespace mupdfwinrt
Point upper_left;
Point lower_right;
Windows::Foundation::Uri ^uri;
- int page_num;
+ int page_num;
public:
Links(void);
@@ -27,7 +27,7 @@ namespace mupdfwinrt
void set(int value)
{
if (value > NOT_SET)
- throw ref new Platform::InvalidArgumentException();
+ throw ref new Platform::InvalidArgumentException();
type = value;
}
}
diff --git a/winrt/mupdfwinrt/muctx.cpp b/winrt/mupdfwinrt/muctx.cpp
index 8651ffa5..f855e1b3 100644
--- a/winrt/mupdfwinrt/muctx.cpp
+++ b/winrt/mupdfwinrt/muctx.cpp
@@ -52,10 +52,10 @@ static void win_seek_file(fz_stream *stm, int offset, int whence)
unsigned long long length = Stream->Size;
unsigned long long n;
- if (whence == SEEK_END)
+ if (whence == SEEK_END)
{
n = length + offset;
- }
+ }
else if (whence == SEEK_CUR)
{
n = curr_pos + offset;
@@ -63,7 +63,7 @@ static void win_seek_file(fz_stream *stm, int offset, int whence)
else if (whence == SEEK_SET)
{
n = offset;
- }
+ }
Stream->Seek(n);
curr_pos = Stream->Position;
stm->pos = n;
@@ -174,7 +174,7 @@ HRESULT muctx::InitializeStream(IRandomAccessStream^ readStream, char *ext)
this->mu_stream = fz_new_stream(mu_ctx, 0, win_read_file, win_close_file);
this->mu_stream->seek = win_seek_file;
this->mu_stream->state = reinterpret_cast <void*> (&win_stream);
-
+
/* Now lets see if we can open the file */
mu_doc = fz_open_document_with_stream(mu_ctx, ext, this->mu_stream);
@@ -223,7 +223,7 @@ Point muctx::MeasurePage(fz_page *page)
return pageSize;
}
-void muctx::FlattenOutline(fz_outline *outline, int level,
+void muctx::FlattenOutline(fz_outline *outline, int level,
sh_vector_content contents_vec)
{
char indent[8*4+1];
@@ -246,7 +246,7 @@ void muctx::FlattenOutline(fz_outline *outline, int level,
sh_content content_item(new content_t());
content_item->page = page;
content_item->string_orig = char_to_String(outline->title);
- content_item->string_margin =
+ content_item->string_margin =
str_indent->Concat(indent_str, content_item->string_orig);
contents_vec->push_back(content_item);
}
@@ -262,7 +262,7 @@ int muctx::GetContents(sh_vector_content contents_vec)
fz_context *ctx_clone = NULL;
int has_content = 0;
- if (mu_cookie->abort == 1)
+ if (mu_cookie->abort == 1)
return has_content;
ctx_clone = fz_clone_context(mu_ctx);
@@ -303,13 +303,13 @@ int muctx::GetTextSearch(int page_num, char* needle, sh_vector_text texts_vec)
int hit_count = 0;
int k;
- if (mu_cookie->abort == 1)
+ if (mu_cookie->abort == 1)
return hit_count;
ctx_clone = fz_clone_context(mu_ctx);
fz_var(page);
- fz_var(sheet);
+ fz_var(sheet);
fz_var(dev);
fz_try(ctx_clone)
{
@@ -369,7 +369,7 @@ int muctx::GetLinks(int page_num, sh_vector_link links_vec)
int k = 0;
int num_links = 0;
- if (mu_cookie->abort == 1)
+ if (mu_cookie->abort == 1)
return num_links;
ctx_clone = fz_clone_context(mu_ctx);
@@ -444,7 +444,7 @@ int muctx::GetLinks(int page_num, sh_vector_link links_vec)
}
/* Render page_num to size width by height into bmp_data buffer */
-HRESULT muctx::RenderPage(int page_num, int width, int height,
+HRESULT muctx::RenderPage(int page_num, int width, int height,
unsigned char *bmp_data)
{
fz_device *dev = NULL;
@@ -454,7 +454,7 @@ HRESULT muctx::RenderPage(int page_num, int width, int height,
Point page_size;
fz_context *ctx_clone = NULL;
- if (mu_cookie->abort == 1)
+ if (mu_cookie->abort == 1)
return S_OK;
ctx_clone = fz_clone_context(mu_ctx);
@@ -525,7 +525,7 @@ String^ muctx::GetHTML(int page_num)
fz_buffer *buf = NULL;
String^ html;
- if (mu_cookie->abort == 1)
+ if (mu_cookie->abort == 1)
return nullptr;
ctx_clone = fz_clone_context(mu_ctx);
diff --git a/winrt/mupdfwinrt/muctx.h b/winrt/mupdfwinrt/muctx.h
index c43c7404..c2a49ae1 100644
--- a/winrt/mupdfwinrt/muctx.h
+++ b/winrt/mupdfwinrt/muctx.h
@@ -20,7 +20,7 @@ extern "C" {
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
+/* These are the std objects used to interface to muctx. We do use windows
String and Point types however */
/* Links */
@@ -33,7 +33,7 @@ typedef struct document_link_s
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>>
+#define sh_vector_link std::shared_ptr<std::vector<sh_link>>
/* Text Search */
typedef struct text_search_s
@@ -42,7 +42,7 @@ typedef struct text_search_s
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>>
+#define sh_vector_text std::shared_ptr<std::vector<sh_text>>
/* Content Results */
typedef struct content_s
@@ -52,10 +52,10 @@ typedef struct content_s
String^ string_margin;
} content_t;
#define sh_content std::shared_ptr<content_t>
-#define sh_vector_content std::shared_ptr<std::vector<sh_content>>
+#define sh_vector_content std::shared_ptr<std::vector<sh_content>>
/* Used for HTML return */
-#define sh_vector_char std::shared_ptr<std::vector<char>>
+#define sh_vector_char std::shared_ptr<std::vector<char>>
/* Needed for file handling */
using namespace Windows::Storage::Streams;
@@ -78,7 +78,7 @@ private:
fz_rect mu_hit_bbox[MAX_SEARCH];
fz_cookie *mu_cookie;
fz_stream *mu_stream;
- void FlattenOutline(fz_outline *outline, int level,
+ void FlattenOutline(fz_outline *outline, int level,
sh_vector_content contents_vec);
public:
@@ -86,7 +86,7 @@ public:
~muctx(void);
void CleanUp(void);
HRESULT InitializeStream(IRandomAccessStream^ readStream, char *ext);
- int GetPageCount();
+ int GetPageCount();
HRESULT InitializeContext();
HRESULT RenderPage(int page_num, int width, int height, unsigned char *bmp_data);
Point MeasurePage(int page_num);
diff --git a/winrt/mupdfwinrt/mudocument.cpp b/winrt/mupdfwinrt/mudocument.cpp
index ec661b27..2779bb25 100644
--- a/winrt/mupdfwinrt/mudocument.cpp
+++ b/winrt/mupdfwinrt/mudocument.cpp
@@ -1,7 +1,7 @@
// mudocument.cpp
-/* This file contains the interface between the muctx class, which
- implements the mupdf calls and the WinRT objects enabling calling from
+/* This file contains the interface between the muctx class, which
+ implements the mupdf calls and the WinRT objects enabling calling from
C#, C++, Visual Basic, JavaScript applications */
#include "pch.h"
@@ -38,7 +38,7 @@ int mudocument::GetNumPages()
}
Point mudocument::GetPageSize(int page_num)
-{
+{
std::lock_guard<std::mutex> lock(mutex_lock);
return this->mu_object.MeasurePage(page_num);
}
@@ -56,14 +56,14 @@ Windows::Foundation::IAsyncAction^ mudocument::OpenFileAsync(StorageFile^ file)
char *ext = strrchr(name, '.');
auto t = create_task(file->OpenAsync(FileAccessMode::Read));
-
+
return t.then([this, file, ext](task<IRandomAccessStream^> task)
{
try
{
IRandomAccessStream^ readStream = task.get();
UINT64 const size = readStream->Size;
-
+
if (size <= MAXUINT32)
{
HRESULT code = this->mu_object.InitializeStream(readStream, ext);
@@ -71,7 +71,7 @@ Windows::Foundation::IAsyncAction^ mudocument::OpenFileAsync(StorageFile^ file)
}
else
{
- delete readStream;
+ delete readStream;
return;
}
}
@@ -158,7 +158,7 @@ Windows::Foundation::IAsyncOperationWithProgress<int, double>^
}
/* Pack the page into a bmp stream */
-Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^
+Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^
mudocument::RenderPageAsync(int page_num, int width, int height)
{
return create_async([this, width, height, page_num](cancellation_token ct) -> InMemoryRandomAccessStream^
@@ -171,12 +171,12 @@ Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^
/* Go ahead and write our header data into the memory stream */
Prepare_bmp(width, height, dw);
-
+
std::lock_guard<std::mutex> lock(mutex_lock);
/* Get raster bitmap stream */
- HRESULT code = mu_object.RenderPage(page_num, width, height, &(bmp_data[0]));
- if (code != S_OK)
+ HRESULT code = mu_object.RenderPage(page_num, width, height, &(bmp_data[0]));
+ if (code != S_OK)
{
throw ref new FailureException("Page Rendering Failed");
}
@@ -204,7 +204,7 @@ int mudocument::ComputeLinks(int page_num)
this->links = ref new Platform::Collections::Vector<Links^>();
for (int k = 0; k < num_items; k++)
{
- auto new_link = ref new Links();
+ auto new_link = ref new Links();
sh_link muctx_link = link_smart_ptr_vec->at(k);
new_link->LowerRight = muctx_link->lower_right;
new_link->UpperLeft = muctx_link->upper_left;
@@ -243,7 +243,7 @@ int mudocument::ComputeTextSearch(String^ text, int page_num)
this->textsearch = ref new Platform::Collections::Vector<Links^>();
for (int k = 0; k < num_items; k++)
{
- auto new_link = ref new Links();
+ auto new_link = ref new Links();
sh_text muctx_text = text_smart_ptr_vec->at(k);
new_link->LowerRight = muctx_text->lower_right;
new_link->UpperLeft = muctx_text->upper_left;
@@ -289,7 +289,7 @@ int mudocument::ComputeContents()
for (int k = 0; k < num_items; k++)
{
- auto new_content = ref new ContentItem();
+ auto new_content = ref new ContentItem();
sh_content muctx_content = content_smart_ptr_vec->at(k);
new_content->Page = muctx_content->page;
new_content->StringMargin = muctx_content->string_margin;
diff --git a/winrt/mupdfwinrt/mudocument.h b/winrt/mupdfwinrt/mudocument.h
index d9bd7c1f..9f4911f5 100644
--- a/winrt/mupdfwinrt/mudocument.h
+++ b/winrt/mupdfwinrt/mudocument.h
@@ -1,7 +1,7 @@
#pragma once
-/* This file contains the interface between the muctx class, which
- implements the mupdf calls and the WinRT objects enabling calling from
+/* This file contains the interface between the muctx class, which
+ implements the mupdf calls and the WinRT objects enabling calling from
C#, C++, and JavaScript applications */
#include "muctx.h"
@@ -26,7 +26,7 @@ namespace mupdfwinrt
{
private:
muctx mu_object;
- std::mutex mutex_lock;
+ std::mutex mutex_lock;
Platform::Collections::Vector<Links^>^ links;
Platform::Collections::Vector<Links^>^ textsearch;
Platform::Collections::Vector<ContentItem^>^ contents;
@@ -36,11 +36,11 @@ namespace mupdfwinrt
Windows::Foundation::IAsyncAction^ OpenFileAsync(StorageFile^ file);
int GetNumPages(void);
Point GetPageSize(int page_num);
- Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^
+ Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^
RenderPageAsync(int page_num, int width, int height);
- Windows::Foundation::IAsyncOperationWithProgress<int, double>^
+ Windows::Foundation::IAsyncOperationWithProgress<int, double>^
SearchDocumentWithProgressAsync(String^ textToFind, int dir, int start_page);
- String^ ComputeHTML(int page_num);
+ String^ ComputeHTML(int page_num);
int ComputeTextSearch(String^ text, int page_num);
Links^ GetTextSearch(int k);
int TextSearchCount(void);