public XPCOMObject (int[] argCounts) { int /*long*/[] callbackAddresses = new int /*long*/[argCounts.length + OS_OFFSET]; synchronized (Callbacks) { for (int i = 0, length = argCounts.length; i < length; i++) { if ((Callbacks[i + OS_OFFSET][argCounts[i]]) == null) { Callbacks[i + OS_OFFSET][argCounts[i]] = new Callback (getClass (), "callback"+i, argCounts[i] + 1, true, XPCOM.NS_ERROR_FAILURE); //$NON-NLS-1$ } callbackAddresses[i + OS_OFFSET] = Callbacks[i + OS_OFFSET][argCounts[i]].getAddress (); if (callbackAddresses[i + OS_OFFSET] == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); } } int /*long*/ pVtable = C.malloc (C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); XPCOM.memmove (pVtable, callbackAddresses, C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); ppVtable = C.malloc (C.PTR_SIZEOF); XPCOM.memmove (ppVtable, new int /*long*/[] {pVtable}, C.PTR_SIZEOF); ObjectMap.put (new LONG (ppVtable), this); }
public XPCOMObject (int[] argCounts) { int /*long*/[] callbackAddresses = new int /*long*/[argCounts.length + OS_OFFSET]; synchronized (Callbacks) { for (int i = 0, length = argCounts.length; i < length; i++) { if ((Callbacks[i + OS_OFFSET][argCounts[i]]) == null) { Callbacks[i + OS_OFFSET][argCounts[i]] = new Callback (getClass (), "callback"+i, argCounts[i] + 1, true, XPCOM.NS_ERROR_FAILURE); //$NON-NLS-1$ } callbackAddresses[i + OS_OFFSET] = Callbacks[i + OS_OFFSET][argCounts[i]].getAddress (); if (callbackAddresses[i + OS_OFFSET] == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); } } int /*long*/ pVtable = C.malloc (C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); XPCOM.memmove (pVtable, callbackAddresses, C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); ppVtable = C.malloc (C.PTR_SIZEOF); XPCOM.memmove (ppVtable, new int /*long*/[] {pVtable}, C.PTR_SIZEOF); ObjectMap.put (new LONG (ppVtable), this); }
public XPCOMObject (int[] argCounts) { long /*int*/[] callbackAddresses = new long /*int*/[argCounts.length + OS_OFFSET]; synchronized (Callbacks) { for (int i = 0, length = argCounts.length; i < length; i++) { if ((Callbacks[i + OS_OFFSET][argCounts[i]]) == null) { Callbacks[i + OS_OFFSET][argCounts[i]] = new Callback (getClass (), "callback"+i, argCounts[i] + 1, true, XPCOM.NS_ERROR_FAILURE); //$NON-NLS-1$ } callbackAddresses[i + OS_OFFSET] = Callbacks[i + OS_OFFSET][argCounts[i]].getAddress (); if (callbackAddresses[i + OS_OFFSET] == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); } } long /*int*/ pVtable = C.malloc (C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); XPCOM.memmove (pVtable, callbackAddresses, C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); ppVtable = C.malloc (C.PTR_SIZEOF); XPCOM.memmove (ppVtable, new long /*int*/[] {pVtable}, C.PTR_SIZEOF); ObjectMap.put (new LONG (ppVtable), this); }
public XPCOMObject (int[] argCounts) { int /*long*/[] callbackAddresses = new int /*long*/[argCounts.length + OS_OFFSET]; synchronized (Callbacks) { for (int i = 0, length = argCounts.length; i < length; i++) { if ((Callbacks[i + OS_OFFSET][argCounts[i]]) == null) { Callbacks[i + OS_OFFSET][argCounts[i]] = new Callback (getClass (), "callback"+i, argCounts[i] + 1, true, XPCOM.NS_ERROR_FAILURE); //$NON-NLS-1$ } callbackAddresses[i + OS_OFFSET] = Callbacks[i + OS_OFFSET][argCounts[i]].getAddress (); if (callbackAddresses[i + OS_OFFSET] == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); } } int /*long*/ pVtable = C.malloc (C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); XPCOM.memmove (pVtable, callbackAddresses, C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); ppVtable = C.malloc (C.PTR_SIZEOF); XPCOM.memmove (ppVtable, new int /*long*/[] {pVtable}, C.PTR_SIZEOF); ObjectMap.put (new LONG (ppVtable), this); }
public XPCOMObject (int[] argCounts) { long /*int*/[] callbackAddresses = new long /*int*/[argCounts.length + OS_OFFSET]; synchronized (Callbacks) { for (int i = 0, length = argCounts.length; i < length; i++) { if ((Callbacks[i + OS_OFFSET][argCounts[i]]) == null) { Callbacks[i + OS_OFFSET][argCounts[i]] = new Callback (getClass (), "callback"+i, argCounts[i] + 1, true, XPCOM.NS_ERROR_FAILURE); //$NON-NLS-1$ } callbackAddresses[i + OS_OFFSET] = Callbacks[i + OS_OFFSET][argCounts[i]].getAddress (); if (callbackAddresses[i + OS_OFFSET] == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); } } long /*int*/ pVtable = C.malloc (C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); XPCOM.memmove (pVtable, callbackAddresses, C.PTR_SIZEOF * (argCounts.length + OS_OFFSET)); ppVtable = C.malloc (C.PTR_SIZEOF); XPCOM.memmove (ppVtable, new long /*int*/[] {pVtable}, C.PTR_SIZEOF); ObjectMap.put (new LONG (ppVtable), this); }
int /*long*/ body = WebKitGTK.SoupMessage_request_body (message); byte[] bytes = Converter.wcsToMbcs (null, postData, false); int /*long*/ data = C.malloc (bytes.length); C.memmove (data, bytes, bytes.length); WebKitGTK.soup_message_body_append (body, WebKitGTK.SOUP_MEMORY_TAKE, data, bytes.length);
int /*long*/ body = WebKitGTK.SoupMessage_request_body (message); byte[] bytes = Converter.wcsToMbcs (null, postData, false); int /*long*/ data = C.malloc (bytes.length); C.memmove (data, bytes, bytes.length); WebKitGTK.soup_message_body_append (body, WebKitGTK.SOUP_MEMORY_TAKE, data, bytes.length);
long /*int*/ body = WebKitGTK.SoupMessage_request_body (message); byte[] bytes = Converter.wcsToMbcs (null, postData, false); long /*int*/ data = C.malloc (bytes.length); C.memmove (data, bytes, bytes.length); WebKitGTK.soup_message_body_append (body, WebKitGTK.SOUP_MEMORY_TAKE, data, bytes.length);
long /*int*/ lower = C.malloc (bytes.length); C.memmove (lower, bytes, bytes.length); range.lower = lower; long /*int*/ upper = C.malloc (bytes.length); C.memmove (upper, bytes, bytes.length); range.upper = upper; long /*int*/ name = C.malloc (bytes.length); C.memmove (name, bytes, bytes.length); property.property = name; bytes = MozillaDelegate.wcsToMbcs (null, Arch () + GCC3, true); long /*int*/ value = C.malloc (bytes.length); C.memmove (value, bytes, bytes.length); property.value = value; long /*int*/ greBuffer = C.malloc (length); int rc = XPCOMInit.GRE_GetGREPathWithProperties (range, 1, property, 1, greBuffer, length); lower = C.malloc (bytes.length); C.memmove (lower, bytes, bytes.length); range.lower = lower;
int /*long*/ lower = C.malloc (bytes.length); C.memmove (lower, bytes, bytes.length); range.lower = lower; int /*long*/ upper = C.malloc (bytes.length); C.memmove (upper, bytes, bytes.length); range.upper = upper; int /*long*/ name = C.malloc (bytes.length); C.memmove (name, bytes, bytes.length); property.property = name; bytes = MozillaDelegate.wcsToMbcs (null, Arch () + GCC3, true); int /*long*/ value = C.malloc (bytes.length); C.memmove (value, bytes, bytes.length); property.value = value; int /*long*/ greBuffer = C.malloc (length); int rc = XPCOMInit.GRE_GetGREPathWithProperties (range, 1, property, 1, greBuffer, length); lower = C.malloc (bytes.length); C.memmove (lower, bytes, bytes.length); range.lower = lower;
int size = XPCOM.nsDynamicFunctionLoad_sizeof (); long /*int*/ ptr = C.malloc (size * 2); C.memset (ptr, 0, size * 2); nsDynamicFunctionLoad functionLoad = new nsDynamicFunctionLoad (); byte[] bytes = MozillaDelegate.wcsToMbcs (null, "XRE_NotifyProfile", true); //$NON-NLS-1$ functionLoad.functionName = C.malloc (bytes.length); C.memmove (functionLoad.functionName, bytes, bytes.length); functionLoad.function = C.malloc (C.PTR_SIZEOF); C.memmove (functionLoad.function, new long /*int*/[] {0} , C.PTR_SIZEOF); XPCOM.memmove (ptr, functionLoad, XPCOM.nsDynamicFunctionLoad_sizeof ());
if (rc != XPCOM.NS_OK) Mozilla.error (rc); } else { long /*int*/ arrayPtr = C.malloc (C.PTR_SIZEOF * length); for (int i = 0; i < length; i++) { Object currentObject = arrayValue[i]; long /*int*/ idPtr = C.malloc (nsID.sizeof); XPCOM.memmove (idPtr, Mozilla.IsPre_4 ? nsIVariant.NS_IVARIANT_IID : nsIVariant.NS_IVARIANT_10_IID, nsID.sizeof); rc = variant.SetAsArray (nsIDataType.VTYPE_INTERFACE_IS, idPtr, length, arrayPtr);
if (rc != XPCOM.NS_OK) Mozilla.error (rc); } else { int /*long*/ arrayPtr = C.malloc (C.PTR_SIZEOF * length); for (int i = 0; i < length; i++) { Object currentObject = arrayValue[i]; int /*long*/ idPtr = C.malloc (nsID.sizeof); XPCOM.memmove (idPtr, IIDStore.GetIID (nsIVariant.class), nsID.sizeof); rc = variant.SetAsArray (nsIDataType.VTYPE_INTERFACE_IS, idPtr, length, arrayPtr);
if (rc != XPCOM.NS_OK) Mozilla.error (rc); } else { int /*long*/ arrayPtr = C.malloc (C.PTR_SIZEOF * length); for (int i = 0; i < length; i++) { Object currentObject = arrayValue[i]; int /*long*/ idPtr = C.malloc (nsID.sizeof); XPCOM.memmove (idPtr, IIDStore.GetIID (nsIVariant.class), nsID.sizeof); rc = variant.SetAsArray (nsIDataType.VTYPE_INTERFACE_IS, idPtr, length, arrayPtr);
int size = XPCOM.nsDynamicFunctionLoad_sizeof (); long /*int*/ ptr = C.malloc (size * 2); C.memset (ptr, 0, size * 2); nsDynamicFunctionLoad functionLoad = new nsDynamicFunctionLoad (); byte[] bytes = MozillaDelegate.wcsToMbcs (null, "XRE_NotifyProfile", true); //$NON-NLS-1$ functionLoad.functionName = C.malloc (bytes.length); C.memmove (functionLoad.functionName, bytes, bytes.length); functionLoad.function = C.malloc (C.PTR_SIZEOF); C.memmove (functionLoad.function, new long /*int*/[] {0} , C.PTR_SIZEOF); XPCOM.memmove (ptr, functionLoad, XPCOM.nsDynamicFunctionLoad_sizeof ());
if (rc != XPCOM.NS_OK) Mozilla.error (rc); } else { int /*long*/ arrayPtr = C.malloc (C.PTR_SIZEOF * length); for (int i = 0; i < length; i++) { Object currentObject = arrayValue[i]; int /*long*/ idPtr = C.malloc (nsID.sizeof); XPCOM.memmove (idPtr, IIDStore.GetIID (nsIVariant.class), nsID.sizeof); rc = variant.SetAsArray (nsIDataType.VTYPE_INTERFACE_IS, idPtr, length, arrayPtr);
if (rc != XPCOM.NS_OK) Mozilla.error (rc); } else { long /*int*/ arrayPtr = C.malloc (C.PTR_SIZEOF * length); for (int i = 0; i < length; i++) { Object currentObject = arrayValue[i]; long /*int*/ idPtr = C.malloc (nsID.sizeof); XPCOM.memmove (idPtr, IIDStore.GetIID (nsIVariant.class), nsID.sizeof); rc = variant.SetAsArray (nsIDataType.VTYPE_INTERFACE_IS, idPtr, length, arrayPtr);
int size = XPCOM.nsDynamicFunctionLoad_sizeof (); int /*long*/ ptr = C.malloc (size * 2); C.memset (ptr, 0, size * 2); nsDynamicFunctionLoad functionLoad = new nsDynamicFunctionLoad (); byte[] bytes = MozillaDelegate.wcsToMbcs (null, "XRE_NotifyProfile", true); //$NON-NLS-1$ functionLoad.functionName = C.malloc (bytes.length); C.memmove (functionLoad.functionName, bytes, bytes.length); functionLoad.function = C.malloc (C.PTR_SIZEOF); C.memmove (functionLoad.function, new int /*long*/[] {0} , C.PTR_SIZEOF); XPCOM.memmove (ptr, functionLoad, XPCOM.nsDynamicFunctionLoad_sizeof ());
int size = XPCOM.nsDynamicFunctionLoad_sizeof (); int /*long*/ ptr = C.malloc (size * 2); C.memset (ptr, 0, size * 2); nsDynamicFunctionLoad functionLoad = new nsDynamicFunctionLoad (); byte[] bytes = MozillaDelegate.wcsToMbcs (null, "XRE_NotifyProfile", true); //$NON-NLS-1$ functionLoad.functionName = C.malloc (bytes.length); C.memmove (functionLoad.functionName, bytes, bytes.length); functionLoad.function = C.malloc (C.PTR_SIZEOF); C.memmove (functionLoad.function, new int /*long*/[] {0} , C.PTR_SIZEOF); XPCOM.memmove (ptr, functionLoad, XPCOM.nsDynamicFunctionLoad_sizeof ());
int size = XPCOM.nsDynamicFunctionLoad_sizeof (); int /*long*/ ptr = C.malloc (size * 2); C.memset (ptr, 0, size * 2); nsDynamicFunctionLoad functionLoad = new nsDynamicFunctionLoad (); byte[] bytes = MozillaDelegate.wcsToMbcs (null, "XRE_NotifyProfile", true); //$NON-NLS-1$ functionLoad.functionName = C.malloc (bytes.length); C.memmove (functionLoad.functionName, bytes, bytes.length); functionLoad.function = C.malloc (C.PTR_SIZEOF); C.memmove (functionLoad.function, new int /*long*/[] {0} , C.PTR_SIZEOF); XPCOM.memmove (ptr, functionLoad, XPCOM.nsDynamicFunctionLoad_sizeof ());