summaryrefslogtreecommitdiff
path: root/remoting/ios/utility.h
blob: ac6a2a43e24222c684a08e59b941573786569aa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_IOS_UTILITY_H_
#define REMOTING_IOS_UTILITY_H_

#import <Foundation/Foundation.h>

#include "base/memory/scoped_ptr.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"

#import "remoting/ios/bridge/host_proxy.h"

typedef struct {
  scoped_ptr<webrtc::BasicDesktopFrame> image;
  scoped_ptr<webrtc::DesktopVector> offset;
} GLRegion;

@interface Utility : NSObject

+ (BOOL)isPad;

+ (BOOL)isInLandscapeMode;

// Return the resolution in respect to orientation
+ (CGSize)getOrientatedSize:(CGSize)size
    shouldWidthBeLongestSide:(BOOL)shouldWidthBeLongestSide;

+ (void)showAlert:(NSString*)title message:(NSString*)message;

+ (NSString*)appVersionNumberDisplayString;

// GL Binding Context requires some specific flags for the type of textures
// being drawn
+ (void)bindTextureForIOS:(GLuint)glName;

// Sometimes its necessary to read gl errors.  This is called in various places
// while working in the GL Context
+ (void)logGLErrorCode:(NSString*)funcName;

+ (void)drawSubRectToGLFromRectOfSize:(const webrtc::DesktopSize&)rectSize
                              subRect:(const webrtc::DesktopRect&)subRect
                                 data:(const uint8_t*)data;

+ (void)moveMouse:(HostProxy*)controller at:(const webrtc::DesktopVector&)point;

+ (void)leftClickOn:(HostProxy*)controller
                 at:(const webrtc::DesktopVector&)point;

+ (void)middleClickOn:(HostProxy*)controller
                   at:(const webrtc::DesktopVector&)point;

+ (void)rightClickOn:(HostProxy*)controller
                  at:(const webrtc::DesktopVector&)point;

+ (void)mouseScroll:(HostProxy*)controller
                 at:(const webrtc::DesktopVector&)point
              delta:(const webrtc::DesktopVector&)delta;

@end

#endif  // REMOTING_IOS_UTILITY_H_