mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-18 13:45:45 +02:00
[226282] [api][WinCE] Encapsulate the public native methods in org.eclipse.tm.rapi.Rapi
This commit is contained in:
parent
03ad2b0171
commit
e15277d253
4 changed files with 24 additions and 24 deletions
|
@ -39,7 +39,7 @@ public class WinCEConnectorService extends BasicConnectorService implements IRap
|
||||||
|
|
||||||
protected void internalConnect(IProgressMonitor monitor) throws Exception {
|
protected void internalConnect(IProgressMonitor monitor) throws Exception {
|
||||||
fireCommunicationsEvent(CommunicationsEvent.BEFORE_CONNECT);
|
fireCommunicationsEvent(CommunicationsEvent.BEFORE_CONNECT);
|
||||||
Rapi.CoInitializeEx(0, Rapi.COINIT_MULTITHREADED);
|
Rapi.initialize(Rapi.COINIT_MULTITHREADED);
|
||||||
desktop = IRapiDesktop.getInstance();
|
desktop = IRapiDesktop.getInstance();
|
||||||
enumDevices = desktop.enumDevices();
|
enumDevices = desktop.enumDevices();
|
||||||
device = enumDevices.next();
|
device = enumDevices.next();
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class RapiExamples {
|
||||||
* Initialize the underlying natives.
|
* Initialize the underlying natives.
|
||||||
*/
|
*/
|
||||||
public void initRapi() {
|
public void initRapi() {
|
||||||
Rapi.CoInitializeEx(0, Rapi.COINIT_MULTITHREADED);
|
Rapi.initialize(Rapi.COINIT_MULTITHREADED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,7 +56,7 @@ public class RapiExamples {
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
session.release();
|
session.release();
|
||||||
}
|
}
|
||||||
Rapi.CoUninitialize();
|
Rapi.uninitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class RapiTestCase extends TestCase {
|
||||||
enumDevices = null;
|
enumDevices = null;
|
||||||
device = null;
|
device = null;
|
||||||
session = null;
|
session = null;
|
||||||
Rapi.CoInitializeEx(0, Rapi.COINIT_MULTITHREADED);
|
Rapi.initialize(Rapi.COINIT_MULTITHREADED);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
|
@ -48,7 +48,7 @@ public class RapiTestCase extends TestCase {
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
session.release();
|
session.release();
|
||||||
}
|
}
|
||||||
Rapi.CoUninitialize();
|
Rapi.uninitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,16 +81,16 @@ public final class Rapi {
|
||||||
public static final int COINIT_SPEED_OVER_MEMORY = 0x8;
|
public static final int COINIT_SPEED_OVER_MEMORY = 0x8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the library, the clients must call this method before any
|
* Initializes the library, the clients must call this method before any
|
||||||
* other. The meaning of the <code>init</code> parameter and the returned
|
* other. The meaning of the <code>init</code> parameter and the returned
|
||||||
* value is platform dependent. On Win32 platforms this method is directly
|
* value is platform dependent. On Win32 platforms this method is directly
|
||||||
* mapped to <code>CoInitializeEx</code>.
|
* mapped to <code>CoInitializeEx</code>.
|
||||||
*
|
*
|
||||||
* @param init on Win32 it is either {@link #COINIT_APARTMENTTHREADED} or
|
* @param init on Win32 it is either {@link #COINIT_APARTMENTTHREADED} or
|
||||||
* {@link #COINIT_MULTITHREADED}
|
* {@link #COINIT_MULTITHREADED}
|
||||||
* @return on Win32 this is the returned value from
|
* @return on Win32 this is the returned value from
|
||||||
* <code>CoInitializeEx</code>
|
* <code>CoInitializeEx</code>
|
||||||
*/
|
*/
|
||||||
public static final int initialize(int init) {
|
public static final int initialize(int init) {
|
||||||
return CoInitializeEx(0, init);
|
return CoInitializeEx(0, init);
|
||||||
}
|
}
|
||||||
|
@ -106,21 +106,21 @@ public final class Rapi {
|
||||||
/**
|
/**
|
||||||
* Initializes the COM library.
|
* Initializes the COM library.
|
||||||
*/
|
*/
|
||||||
public static final native int CoInitializeEx(int pvReserved, int dwCoInit);
|
static final native int CoInitializeEx(int pvReserved, int dwCoInit);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes the COM library on the current thread.
|
* Closes the COM library on the current thread.
|
||||||
*/
|
*/
|
||||||
public static final native void CoUninitialize();
|
static final native void CoUninitialize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the first element of the specified array with the address of a newly
|
* Sets the first element of the specified array with the address of a newly
|
||||||
* instantiated <code>IRAPIDesktop</code> native interface.
|
* instantiated <code>IRAPIDesktop</code> native interface.
|
||||||
*
|
*
|
||||||
* @param pIRAPIDesktop an array with one element
|
* @param pIRAPIDesktop an array with one element
|
||||||
* @return {@link #NOERROR} if the function succeeds; otherwise an error
|
* @return {@link #NOERROR} if the function succeeds; otherwise an error
|
||||||
* code
|
* code
|
||||||
*/
|
*/
|
||||||
final static native int CreateRapiDesktop(int[] pIRAPIDesktop);
|
final static native int CreateRapiDesktop(int[] pIRAPIDesktop);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue