Project

General

Profile

Download (2.78 KB) Statistics
| Branch: | Revision:

distorted-objectlib / src / main / java / org / distorted / objectlib / helpers / OperatingSystemInterface.java @ 9c7d220a

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2023 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8
///////////////////////////////////////////////////////////////////////////////////////////////////
9

    
10
package org.distorted.objectlib.helpers;
11

    
12
///////////////////////////////////////////////////////////////////////////////////////////////////
13

    
14
import java.io.InputStream;
15

    
16
public interface OperatingSystemInterface
17
  {
18
  ///////////////////////////////////////////
19
  // SCREEN
20
  ///////////////////////////////////////////
21
  int getScreenDensity();
22

    
23
  ///////////////////////////////////////////
24
  // TOUCH CONTROL
25
  ///////////////////////////////////////////
26
  int ACTION_DOWN_1 = 0;
27
  int ACTION_UP_1   = 1;
28
  int ACTION_DOWN_2 = 3;
29
  int ACTION_UP_2   = 4;
30
  int ACTION_MOVE   = 5;
31

    
32
  int INVALID_POINTER_ID = -1;
33

    
34
  int getAction();
35
  void upOneOfThem();
36
  int getFirstPointerIndex();
37
  int getSecondPointerIndex();
38
  boolean isFirstPressed();
39
  boolean isSecondPressed();
40
  void pressFirst();
41
  void unpressFirst();
42
  void pressSecond();
43
  void unpressSecond();
44
  float getFirstX();
45
  float getFirstY();
46
  float getSecondX();
47
  float getSecondY();
48
  float getX(int index);
49
  float getY(int index);
50

    
51
  ///////////////////////////////////////////
52
  // LOCAL FILES
53
  ///////////////////////////////////////////
54
  InputStream openLocalFile(String name);
55
  InputStream openLocalFile(int id);
56

    
57
  ///////////////////////////////////////////
58
  // PREFERENCES
59
  ///////////////////////////////////////////
60
  void remove(String key);
61
  void putInt(String key, int value);
62
  int getInt(String key, int def);
63
  void putFloat(String key, float value);
64
  float getFloat(String key, float def);
65
  void putString(String key, String value);
66
  String getString(String key, String def);
67

    
68
  ///////////////////////////////////////////
69
  // STRINGS
70
  ///////////////////////////////////////////
71
  String getString(int id);
72
  String getString(int id, String s1);
73
  String getString(int id, String s1, String s2);
74
  String getString(int id, String s1, String s2, String s3);
75

    
76
  ///////////////////////////////////////////
77
  // ERROR REPORTING
78
  ///////////////////////////////////////////
79
  void reportError(String error);
80
  ObjectLibInterface getInterface();
81
  }
(12-12/13)