View Javadoc

1   /***
2    * Created by IntelliJ IDEA.
3    * User: gareth
4    * Date: Sep 11, 2003
5    * Time: 6:43:19 PM
6    */
7   package com.tapina.robe.swi;
8   
9   import com.tapina.robe.runtime.Environment;
10  
11  import java.lang.reflect.Method;
12  
13  public final class Toolbox extends SWIHandler {
14      private static Toolbox ourInstance;
15  
16      public synchronized static Toolbox getInstance() {
17          if (ourInstance == null) {
18              ourInstance = new Toolbox();
19          }
20          return ourInstance;
21      }
22  
23      private Toolbox() {
24      }
25  
26      public static int getBase() {
27          return 0x44ec0;
28      }
29  
30      private static final String[] methodNames = new String[] {
31          "", "", "", "", "", "", "", "", // 0x44ec0
32          "", "", "", "", "", "", "", "Initialise", // 0x44ec8
33          "", "", "", "", "", "", "", "", // 0x44ed0
34          "", "", "", "", "", "", "", "", // 0x44ed8
35          "", "", "", "", "", "", "", "", // 0x44ee0
36          "", "", "", "", "", "", "", "", // 0x44ee8
37          "", "", "", "", "", "", "", "", // 0x44ef0
38          "", "", "", "", "", "", "", ""  // 0x44ef8
39      };
40  
41      public static Method getMethod(Integer offset) throws NoSuchMethodException {
42          return getMethod(methodNames[offset.intValue()]);
43      }
44  
45      private static final Method getMethod(String name) throws NoSuchMethodException {
46          return Toolbox.class.getMethod(name, METHOD_PARAMETERS);
47      }
48  
49  
50      /***
51       * Method is used to initialise a toolbox application.
52       * Entry:
53       * r0 = flags
54       * r1 = last wimp version known to task
55       * r2 = pointer to list of wimp messages which client wishes to receive.
56       * r3 = pointer to list of toolbox event codes which client wishes to receive.
57       * r4 = pointer to directory name in which to find resources.
58       * r5 = pointer to messages file descriptor block.
59       * r6 = pointer to buffer to hold object Ids on return from Wimp Poll.
60       * Exit:
61       * r0 = current wimp version number.
62       * r1 = wimp task handle for client.
63       * r2 = pointer to sprite area used.
64       * Buffer pointed to by r5 is filled with a MessageTrans file descriptor.
65       * @param env
66       */
67      public final void Initialise(Environment env) {
68          final int[] R = env.getCpu().R;
69          final int flags = R[0];
70          final int wimpVersion = R[1];
71          throw new SWIError(0, "Toolbox_Initialise not implemented.");
72      }
73  }
74