1 16 package com.google.gwt.dev.shell.ie; 17 18 import com.google.gwt.dev.shell.LowLevel; 19 20 import org.eclipse.swt.internal.ole.win32.COMObject; 21 22 import java.util.Map ; 23 24 29 class COMObjectProxy extends COMObject { 30 31 private static final int MAX_METHODS_WRAPPED = 23; 32 33 private COMObject target; 34 35 41 public COMObjectProxy(int[] argCounts) { 42 super(argCounts); 46 47 dispose(); 53 54 if (argCounts != null && argCounts.length >= MAX_METHODS_WRAPPED) { 56 throw new IllegalArgumentException ("No more than " + MAX_METHODS_WRAPPED 57 + " methods can be wrapped right now."); 58 } 59 } 60 61 64 public void interpose(COMObject victim) { 65 if (this.target != null) { 66 throw new IllegalStateException ("interpose() can only be called once"); 67 } 68 69 this.target = victim; 71 72 Map objectMap = (Map ) LowLevel.snatchFieldObjectValue(COMObject.class, 74 null, "ObjectMap"); 75 Integer ppVtableTarget = new Integer (target.getAddress()); 76 77 Object currValue = objectMap.get(ppVtableTarget); 80 if (currValue != target) { 81 throw new IllegalStateException ("target object is not currently mapped"); 82 } 83 84 objectMap.put(ppVtableTarget, this); 89 } 90 91 public int method0(int[] args) { 92 return target.method0(args); 93 } 94 95 public int method1(int[] args) { 96 return target.method1(args); 97 } 98 99 public int method10(int[] args) { 100 return target.method10(args); 101 } 102 103 public int method11(int[] args) { 104 return target.method11(args); 105 } 106 107 public int method12(int[] args) { 108 return target.method12(args); 109 } 110 111 public int method13(int[] args) { 112 return target.method13(args); 113 } 114 115 public int method14(int[] args) { 116 return target.method14(args); 117 } 118 119 public int method15(int[] args) { 120 return target.method15(args); 121 } 122 123 public int method16(int[] args) { 124 return target.method16(args); 125 } 126 127 public int method17(int[] args) { 128 return target.method17(args); 129 } 130 131 public int method18(int[] args) { 132 return target.method18(args); 133 } 134 135 public int method19(int[] args) { 136 return target.method19(args); 137 } 138 139 public int method2(int[] args) { 140 return target.method2(args); 141 } 142 143 public int method20(int[] args) { 144 return target.method20(args); 145 } 146 147 public int method21(int[] args) { 148 return target.method21(args); 149 } 150 151 public int method22(int[] args) { 152 return target.method22(args); 153 } 154 } | Popular Tags |