2013-02-14 17:59:12 +04:00
|
|
|
/*
|
|
|
|
Utility functions
|
2019-11-06 17:24:51 +03:00
|
|
|
|
2013-12-04 14:37:57 +04:00
|
|
|
Copyright 2013 Thincast Technologies GmbH, Authors: Martin Fleisz, Dorian Johnson
|
2019-11-06 17:24:51 +03:00
|
|
|
|
|
|
|
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
|
|
If a copy of the MPL was not distributed with this file, You can obtain one at
|
|
|
|
http://mozilla.org/MPL/2.0/.
|
2013-02-14 17:59:12 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
2013-03-29 17:28:27 +04:00
|
|
|
#import <CoreGraphics/CoreGraphics.h>
|
2013-02-14 17:59:12 +04:00
|
|
|
#import "TSXTypes.h"
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
// helper macro to encode a table path into a tag value (used to identify controls in their delegate
|
|
|
|
// handlers)
|
2013-02-14 17:59:12 +04:00
|
|
|
#define GET_TAG(section, row) ((((int)section) << 16) | ((int)(row)))
|
|
|
|
#define GET_TAG_FROM_PATH(path) ((((int)path.section) << 16) | ((int)(path.row)))
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
BOOL ScanHostNameAndPort(NSString *address, NSString **host, unsigned short *port);
|
2013-02-14 17:59:12 +04:00
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
#pragma mark Screen Resolutions
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
NSString *ScreenResolutionDescription(TSXScreenOptions type, int width, int height);
|
|
|
|
BOOL ScanScreenResolution(NSString *description, int *width, int *height, TSXScreenOptions *type);
|
2013-02-14 17:59:12 +04:00
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
NSDictionary *SelectionForColorSetting(void);
|
|
|
|
NSArray *ResolutionModes(void);
|
2013-02-14 17:59:12 +04:00
|
|
|
|
|
|
|
#pragma mark Security Protocol
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
NSString *ProtocolSecurityDescription(TSXProtocolSecurityOptions type);
|
|
|
|
BOOL ScanProtocolSecurity(NSString *description, TSXProtocolSecurityOptions *type);
|
|
|
|
NSDictionary *SelectionForSecuritySetting(void);
|
2013-02-14 17:59:12 +04:00
|
|
|
|
|
|
|
#pragma mark Bookmarks
|
|
|
|
@class BookmarkBase;
|
2019-11-06 17:24:51 +03:00
|
|
|
NSMutableArray *FilterBookmarks(NSArray *bookmarks, NSArray *filter_words);
|
|
|
|
NSMutableArray *FilterHistory(NSArray *history, NSString *filterStr);
|
2013-02-14 17:59:12 +04:00
|
|
|
|
|
|
|
#pragma mark iPad/iPhone detection
|
|
|
|
|
2013-02-16 02:07:10 +04:00
|
|
|
BOOL IsPad(void);
|
|
|
|
BOOL IsPhone(void);
|
2013-02-14 17:59:12 +04:00
|
|
|
|
|
|
|
#pragma mark Version Info
|
2019-11-06 17:24:51 +03:00
|
|
|
NSString *TSXAppFullVersion(void);
|
2013-02-14 17:59:12 +04:00
|
|
|
|
|
|
|
#pragma mark Touch/Mouse handling
|
|
|
|
|
|
|
|
// set mouse buttons swapped flag
|
|
|
|
void SetSwapMouseButtonsFlag(BOOL swapped);
|
|
|
|
|
|
|
|
// set invert scrolling flag
|
|
|
|
void SetInvertScrollingFlag(BOOL invert);
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
// return event value for left mouse button
|
2013-02-14 17:59:12 +04:00
|
|
|
int GetLeftMouseButtonClickEvent(BOOL down);
|
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
// return event value for right mouse button
|
2013-02-14 17:59:12 +04:00
|
|
|
int GetRightMouseButtonClickEvent(BOOL down);
|
|
|
|
|
|
|
|
// return event value for mouse move event
|
2013-02-16 02:07:10 +04:00
|
|
|
int GetMouseMoveEvent(void);
|
2013-02-14 17:59:12 +04:00
|
|
|
|
|
|
|
// return mouse wheel event
|
|
|
|
int GetMouseWheelEvent(BOOL down);
|
|
|
|
|
|
|
|
// scrolling gesture detection delta
|
2013-02-16 02:07:10 +04:00
|
|
|
CGFloat GetScrollGestureDelta(void);
|
2013-02-14 17:59:12 +04:00
|
|
|
|
|
|
|
#pragma mark Connectivity tools
|
|
|
|
// activates the iphone's WWAN interface in case it is offline
|
2013-02-16 02:07:10 +04:00
|
|
|
void WakeUpWWAN(void);
|
2013-02-14 17:59:12 +04:00
|
|
|
|
|
|
|
#pragma mark System Info functions
|
2019-11-06 17:24:51 +03:00
|
|
|
NSString *TSXGetPlatform(void);
|
2013-02-16 02:07:10 +04:00
|
|
|
BOOL TSXDeviceHasJailBreak(void);
|
2019-11-06 17:24:51 +03:00
|
|
|
NSString *TSXGetPrimaryMACAddress(NSString *sep);
|