diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2013-05-10 22:10:33 -0700 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-05-16 19:25:58 +0100 |
commit | 99a850eefe43ba55ac34114db586d82637f0af0f (patch) | |
tree | 596127b8257d7fe47aa970800df448bcca7e25bc | |
parent | 7afefc8342853df50dc1e1a192415cd1164a7382 (diff) | |
download | mupdf-99a850eefe43ba55ac34114db586d82637f0af0f.tar.xz |
Code cleanup and removal of c++ if def in fitz headers
-rw-r--r-- | fitz/fitz-internal.h | 8 | ||||
-rw-r--r-- | fitz/fitz.h | 8 | ||||
-rw-r--r-- | winrt/mupdf.sln | 62 | ||||
-rw-r--r-- | winrt/mupdf_cpp/MainPage.xaml.cpp | 44 | ||||
-rw-r--r-- | winrt/mupdf_cpp/MainPage.xaml.h | 1 |
5 files changed, 12 insertions, 111 deletions
diff --git a/fitz/fitz-internal.h b/fitz/fitz-internal.h index 04ff5fd6..22947cf4 100644 --- a/fitz/fitz-internal.h +++ b/fitz/fitz-internal.h @@ -19,10 +19,6 @@ typedef unsigned __int64 uint64_t; #include <inttypes.h> #endif -#ifdef __cplusplus -extern "C" { -#endif - struct fz_warn_context_s { char message[256]; @@ -1629,8 +1625,4 @@ struct fz_document_s fz_rect *(*bound_annot)(fz_document *doc, fz_annot *annot, fz_rect *rect); }; -#ifdef __cplusplus -} -#endif - #endif diff --git a/fitz/fitz.h b/fitz/fitz.h index c6e8fa04..5eb570d0 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -133,10 +133,6 @@ FILE *fopen_utf8(const char *name, const char *mode); #endif #endif -#ifdef __cplusplus -extern "C" { -#endif - /* Shut the compiler up about unused variables */ @@ -3345,8 +3341,4 @@ enum */ void fz_write_document(fz_document *doc, char *filename, fz_write_options *opts); -#ifdef __cplusplus -} -#endif - #endif diff --git a/winrt/mupdf.sln b/winrt/mupdf.sln index cac7645f..b3abfadc 100644 --- a/winrt/mupdf.sln +++ b/winrt/mupdf.sln @@ -17,8 +17,12 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libthirdparty_winRT", "libthirdparty_winRT.vcxproj", "{C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupdfwinrt", "mupdfwinrt\mupdfwinrt.vcxproj", "{9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mupdf_csharp", "mupdf_csharp\mupdf_csharp.csproj", "{FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}" + ProjectSection(ProjectDependencies) = postProject + {5AFFE821-C5C8-45FB-B834-10FED76E49A7} = {5AFFE821-C5C8-45FB-B834-10FED76E49A7} + {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396} = {C0D1C355-1BEE-40E1-9EF4-FD9FFFDBF396} + {A5053AA7-02E5-4903-B596-04F17AEB1526} = {A5053AA7-02E5-4903-B596-04F17AEB1526} + {0715F3CF-5D1B-4617-A331-6527371365B7} = {0715F3CF-5D1B-4617-A331-6527371365B7} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupdf_cpp", "mupdf_cpp\mupdf_cpp.vcxproj", "{0204A4E7-F1B8-4268-A67C-A2C674B4742D}" ProjectSection(ProjectDependencies) = postProject @@ -207,60 +211,6 @@ Global {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|x64.Build.0 = Release|x64 {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|x86.ActiveCfg = Release|Win32 {9E6AB41D-09A7-45A6-A53B-1E4BF3AC5B33}.Release|x86.Build.0 = Release|Win32 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|ARM.ActiveCfg = Debug|ARM - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|ARM.Build.0 = Debug|ARM - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|ARM.Deploy.0 = Debug|ARM - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Mixed Platforms.Deploy.0 = Debug|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Win32.ActiveCfg = Debug|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Win32.Build.0 = Debug|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|Win32.Deploy.0 = Debug|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x64.ActiveCfg = Debug|x64 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x64.Build.0 = Debug|x64 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x64.Deploy.0 = Debug|x64 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x86.ActiveCfg = Debug|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x86.Build.0 = Debug|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Debug|x86.Deploy.0 = Debug|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Any CPU.ActiveCfg = Release|Any CPU - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Any CPU.Build.0 = Release|Any CPU - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Any CPU.Deploy.0 = Release|Any CPU - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|ARM.ActiveCfg = Release|ARM - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|ARM.Build.0 = Release|ARM - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|ARM.Deploy.0 = Release|ARM - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Mixed Platforms.ActiveCfg = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Mixed Platforms.Build.0 = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Mixed Platforms.Deploy.0 = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Win32.ActiveCfg = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Win32.Build.0 = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|Win32.Deploy.0 = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x64.ActiveCfg = Release|x64 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x64.Build.0 = Release|x64 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x64.Deploy.0 = Release|x64 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x86.ActiveCfg = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x86.Build.0 = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Memento|x86.Deploy.0 = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Any CPU.Build.0 = Release|Any CPU - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Any CPU.Deploy.0 = Release|Any CPU - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|ARM.ActiveCfg = Release|ARM - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|ARM.Build.0 = Release|ARM - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|ARM.Deploy.0 = Release|ARM - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Mixed Platforms.Build.0 = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Mixed Platforms.Deploy.0 = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Win32.ActiveCfg = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Win32.Build.0 = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|Win32.Deploy.0 = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x64.ActiveCfg = Release|x64 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x64.Build.0 = Release|x64 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x64.Deploy.0 = Release|x64 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x86.ActiveCfg = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x86.Build.0 = Release|x86 - {FD99D78F-9DF5-49FB-A848-AEA86FF51ADD}.Release|x86.Deploy.0 = Release|x86 {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|Any CPU.ActiveCfg = Debug|Win32 {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|ARM.ActiveCfg = Debug|ARM {0204A4E7-F1B8-4268-A67C-A2C674B4742D}.Debug|ARM.Build.0 = Debug|ARM diff --git a/winrt/mupdf_cpp/MainPage.xaml.cpp b/winrt/mupdf_cpp/MainPage.xaml.cpp index 685024e6..a4ceb070 100644 --- a/winrt/mupdf_cpp/MainPage.xaml.cpp +++ b/winrt/mupdf_cpp/MainPage.xaml.cpp @@ -7,7 +7,7 @@ #include "MainPage.xaml.h" #define LOOK_AHEAD 1 /* A +/- count on the pages to pre-render */ -#define THUMB_PREADD 30 +#define THUMB_PREADD 10 #define MIN_SCALE 0.5 #define MAX_SCALE 4 #define MARGIN_BUFF 400 @@ -243,24 +243,13 @@ Point MainPage::ComputePageSize(spatial_info_t spatial_info, int page_num) return pageSize; } -Point MainPage::currPageSize(int page) -{ - Point Size; - - FlipViewItem ^flipview_temp = (FlipViewItem^) m_curr_flipView->Items->GetAt(page); - - Size.Y = flipview_temp->ActualHeight; - Size.X = flipview_temp->ActualWidth; - return Size; -} - static Point fitPageToScreen(Point page, Point screen) { Point pageSize; float hscale = screen.X / page.X; float vscale = screen.Y / page.Y; - float scale = fz_min(hscale, vscale); + float scale = min(hscale, vscale); pageSize.X = floorf(page.X * scale) / page.X; pageSize.Y = floorf(page.Y * scale) / page.Y; return pageSize; @@ -755,7 +744,6 @@ void mupdf_cpp::MainPage::FlipView_SelectionChanged(Object^ sender, SelectionCha } /* Search Related Code */ - void mupdf_cpp::MainPage::Searcher(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e) { /* Update the app bar so that we can do the search */ @@ -805,7 +793,6 @@ void mupdf_cpp::MainPage::ClearTextSearch() void mupdf_cpp::MainPage::ShowSearchResults(SearchResult_t result) { - int height, width; int old_page = this->m_currpage; int new_page = result.page_num; @@ -912,28 +899,11 @@ void mupdf_cpp::MainPage::SearchInDirection(int dir, String^ textToFind) else start = pos; - /* ProgressBar^ my_xaml_Progress = (ProgressBar^) (this->FindName("xaml_Progress")); + /* ProgressBar^ my_xaml_Progress = (ProgressBar^) (this->FindName("xaml_Progress")); my_xaml_Progress->Value = start; my_xaml_Progress->IsEnabled = true; my_xaml_Progress->Opacity = 1.0; */ - /* ProgressBar^ my_bar = (ProgressBar^) (xaml_MainGrid->FindName("search_progress")); - - if (my_bar == nullptr) - { - my_bar = ref new ProgressBar(); - my_bar->Name = "search_progress"; - my_bar->Maximum = this->m_num_pages; - my_bar->Value = start; - my_bar->IsIndeterminate = false; - my_bar->Height = 10; - my_bar->Width = 400; - xaml_MainGrid->Children->Append(my_bar); - } - else - { - my_bar->Value = start; - } */ if (start < 0) return; if (start > this->m_num_pages - 1) @@ -948,8 +918,9 @@ void mupdf_cpp::MainPage::SearchInDirection(int dir, String^ textToFind) result.box_count = this->mu_doc->ComputeTextSearch(textToFind, i); result.page_num = i; - //my_xaml_Progress->Value = i; - if (result.box_count > 0) + // my_xaml_Progress->Value = i; + + if (result.box_count > 0) { return result; } @@ -966,9 +937,6 @@ void mupdf_cpp::MainPage::SearchInDirection(int dir, String^ textToFind) SearchResult_t the_result = the_task.get(); if (the_result.box_count > 0) { - // ProgressBar^ xaml_Progress = (ProgressBar^) (this->FindName("xaml_Progress")); - // xaml_Progress->IsEnabled = false; - // xaml_Progress->Opacity = 0.0; this->ShowSearchResults(the_result); } }, task_continuation_context::use_current()); diff --git a/winrt/mupdf_cpp/MainPage.xaml.h b/winrt/mupdf_cpp/MainPage.xaml.h index ad66787f..e3f9a782 100644 --- a/winrt/mupdf_cpp/MainPage.xaml.h +++ b/winrt/mupdf_cpp/MainPage.xaml.h @@ -115,7 +115,6 @@ namespace mupdf_cpp void HandleFileNotFoundException(Platform::COMException^ e); void NotifyUserFileNotExist(); void SetFlipView(); - Point currPageSize(int page); void Slider_ValueChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e); void Slider_Released(Platform::Object^ sender, Windows::UI::Xaml::Controls::Primitives::RangeBaseValueChangedEventArgs^ e); void FlipView_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e); |