Skip to content

Commit

Permalink
20151123
Browse files Browse the repository at this point in the history
- Updated touch event handling.
- Overlay views, drawable and touchables accept coordinates in both PDF page and UI space.
- Minor tweaks and improvements
  • Loading branch information
Nicolò Tosi committed Nov 24, 2015
1 parent ce46baa commit 9766651
Show file tree
Hide file tree
Showing 99 changed files with 314 additions and 173 deletions.
Binary file modified Bundle/FPKKioskBundle.bundle/Info.plist
Binary file not shown.
Binary file modified Bundle/FPKKioskBundle.bundle/Kiosk_ipad.nib
Binary file not shown.
Binary file modified Bundle/FPKKioskBundle.bundle/Kiosk_phone.nib
Binary file not shown.
Binary file modified Bundle/FPKKioskBundle.bundle/Kiosk_phone5.nib
Binary file not shown.
Binary file modified Bundle/FPKKioskBundle.bundle/backThumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/backThumb_iphone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/header_iphone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/remove.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/resume.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKKioskBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKReaderBundle.bundle/AudioViewController.nib
Binary file not shown.
Binary file modified Bundle/FPKReaderBundle.bundle/BookmarkView.nib
Binary file not shown.
Binary file modified Bundle/FPKReaderBundle.bundle/Info.plist
Binary file not shown.
Binary file modified Bundle/FPKReaderBundle.bundle/OutlineView.nib
Binary file not shown.
Binary file modified Bundle/FPKReaderBundle.bundle/SearchView2_pad.nib
Binary file not shown.
Binary file modified Bundle/FPKReaderBundle.bundle/SearchView2_phone.nib
Binary file not shown.
Binary file modified Bundle/FPKReaderBundle.bundle/TextDisplayView.nib
Binary file not shown.
Binary file modified Bundle/FPKReaderBundle.bundle/WebBrowser.nib
Binary file not shown.
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKReaderBundle.bundle/bookmark_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/changeModeDouble.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/changeModeOverflow.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/changeModeSingle.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/direction_l2r.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/direction_r2l.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/img_outline_triangledown.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/indice.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/pagelead.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/play_player.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/prew.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/search.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/text.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/zoomLock.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
Binary file modified Bundle/FPKReaderBundle.bundle/zoomUnlock.png
Binary file modified Bundle/FPKReaderBundle.bundle/[email protected]
5 changes: 3 additions & 2 deletions Classes/Reader/ReaderViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,10 @@ -(void)handleSearchGotCancelledNotification:(NSNotification *)notification {
-(void)handleSearchUpdateNotification:(NSNotification *)notification {

NSDictionary * userInfo = notification.userInfo;
NSUInteger page = [userInfo[kNotificationSearchInfoPage] unsignedIntegerValue];
NSInteger page = [userInfo[kNotificationSearchInfoPage] integerValue];
NSInteger delta = page - self.page;

if(self.isViewLoaded && (fabs(page - self.page) < 2)) {
if(self.isViewLoaded && (delta < 2)) {
// We get up to two false 'current' page positives but it is good enogh for now.
[self reloadOverlay];
}
Expand Down
10 changes: 1 addition & 9 deletions Classes/SimpleApp/Controllers/Drawable.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@ @implementation Drawable
-(CFDictionaryRef)fontAttributes {
if(!_fontAttributes) {

CFStringRef fontName = CFStringCreateWithCString(NULL, "Helvetica-Neue", kCFStringEncodingMacRoman);

CTFontRef font = CTFontCreateWithName(fontName, 12.0, NULL);
CTFontRef font = CTFontCreateWithName((CFStringRef)@"Helvetica-Neue", 12.0, NULL);

CFStringRef keys[] = { kCTFontAttributeName };

CFTypeRef values[] = { font };

_fontAttributes = CFDictionaryCreate(kCFAllocatorDefault, (const void **)&keys, (const void **)&values, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);

CFRelease(fontName);

CFRelease(font);
}
return _fontAttributes;
Expand Down Expand Up @@ -60,12 +56,8 @@ -(void)drawInContext:(CGContextRef)context{

CGRect clipBoundingBox = CGContextGetClipBoundingBox(context);

CGContextTranslateCTM(context, 0, clipBoundingBox.size.height);
CGContextScaleCTM(context, 1.0, -1.0);

const char *text = "Hello World!";


CGContextSetTextPosition(context, 101, 113);
CTLineDraw([self firstLine], context);

Expand Down
25 changes: 19 additions & 6 deletions FPKCore/FPKOverlayViewDataSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,32 @@
@optional

/**
This method shall return a set of view to display over the pdf page.
Returns an array of UIView to be displayed as overlay on the PDF page view.
*/
-(NSArray *)documentViewController:(MFDocumentViewController *)dvc overlayViewsForPage:(NSUInteger)page;

/**
This method needs to return the frame in page-coordinates for the view passed as arguments. Remember that, like drawables
and touchables, the coordinate system's origin is in the bottom left corner of the page.
Return the frame of the overlay view in the page view.
Remember that the
CGRect returned must be in PDF Coordinate System, that is with the origin in the
lower left.
*/
-(CGRect)documentViewController:(MFDocumentViewController *)dvc rectForOverlayView:(UIView *)view onPage:(NSUInteger)page;

/**
These callbacks will be invoked when the overlay view is going to be added, after is added, when is going to be removed
and when it is actually removed from the page view. Use these to change the status of the view and or start/stop any
Return the frame of the overlay view int the page view.
Note that, as opposed to
documentViewController:frameForOverlayView:onPage: the CGRect returned is in
UIView coordinate space, that is with the origin in the upper left.
*/
-(CGRect)documentViewController:(MFDocumentViewController *)dvc frameForOverlayView:(UIView *)view onPage:(NSUInteger)page;

/**
These callbacks will be invoked when the overlay view is going to be added,
after is added, when is going to be removed and when it is actually removed from
the page view. Use these to change the status of the view and or start/stop any
action that needs to be synchronized with the lifecycle of the view.
*/
-(void)documentViewController:(MFDocumentViewController *)dvc willAddOverlayView:(UIView *)view;
Expand All @@ -44,7 +57,7 @@

/**
This method is called when the Overlay View have been removed
*/
-(void)documentViewController:(MFDocumentViewController *)dvc didRemoveOverlayView:(UIView *)view;

Expand Down
53 changes: 33 additions & 20 deletions FPKCore/MFDocumentManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,27 +145,40 @@ Convert a CGRect from iOS view space to a PDF page coordinate space.
*/
-(void)emptyCache;

/**
* Return an array of MFTextItem representing the matches of teh search term on
* the page passed as arguments. It is a good idea running this method in a
* secondary thread.
*
* mode is of type FPKSearchMode and has the following values:
* FPKSearchModeHard - if you search for 'bèzier' it will match 'bèzier' only
* but not 'bezier'. If you search for 'bezier' it will match 'bezier' only.
* FPKSearchModeSoft - if you search for term 'bèzier' it will match both
* 'bezier' and 'bèzier'. Same if you search for 'bezier'.
* FPKSearchModeSmart - if you search for term 'bezier', it will also match
* 'bèzier', but if you search for 'bèzier' it will match 'bèzier' only.
*
* ignoreOrNot tell the function if it should ignore case or not.
*
* exactMatchOrNot tell the function if it should match the term as a whole or
* search for each component separated by spaces.
*
* Default parameters are FPKSearchModeSmart, ignoreCase to YES and exactMatch
* to NO.
/*!
Return an array of MFTextItem representing the matches of teh search term on
the page passed as arguments. It is a good idea running this method in a
secondary thread.
@param mode is of type FPKSearchMode and has the following values:
FPKSearchModeHard - if you search for 'bèzier' it will match 'bèzier' only
but not 'bezier'. If you search for 'bezier' it will match 'bezier' only.
FPKSearchModeSoft - if you search for term 'bèzier' it will match both
'bezier' and 'bèzier'. Same if you search for 'bezier'.
FPKSearchModeSmart - if you search for term 'bezier', it will also match
'bèzier', but if you search for 'bèzier' it will match 'bèzier' only.
@param ignoreOrNot tell the function if it should ignore case or not.
@param exactMatchOrNot tell the function if it should match the term as a whole or
search for each component separated by spaces.
@param pdfCoordinates If set to YES, the coordinates of the MFTextItem will be
in PDF Coordinate System (origin on the lower left). If set to NO the coordinates
will be in UI interface space, that is origin on the upper left.
Default parameters are FPKSearchModeSmart, ignoreCase to YES, exactMatch
to NO and pdfCoordinates to YES.
@return NSArray An array of MFTextItem or nil if no match is found.
*/
-(NSArray *)searchResultOnPage:(NSUInteger)pageNr
forSearchTerms:(NSString *)searchTerm
mode:(FPKSearchMode)mode
ignoreCase:(BOOL)ignoreOrNot
exactMatch:(BOOL)exactMatchOrNot
pdfCoordinates:(BOOL)pdfCoordinates;

-(NSArray *)searchResultOnPage:(NSUInteger)pageNr
forSearchTerms:(NSString *)searchTerm
mode:(FPKSearchMode)mode
Expand Down
Loading

0 comments on commit 9766651

Please sign in to comment.