当前位置: 首页>>代码示例>>Java>>正文


Java Function类代码示例

本文整理汇总了Java中com.sun.jna.Function的典型用法代码示例。如果您正苦于以下问题:Java Function类的具体用法?Java Function怎么用?Java Function使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Function类属于com.sun.jna包,在下文中一共展示了Function类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isAeroEnabled

import com.sun.jna.Function; //导入依赖的package包/类
public static boolean isAeroEnabled(){		
    if( HearthHelper.getOSName().equals("win") && DWM == null){
    	try{
    		DWM = NativeLibrary.getInstance("dwmapi");
    	} catch(Throwable e) {}
    }
    
    boolean dwmEnabled = false;
    
       if(DWM != null){
       	boolean[] bool = { false };
       	Object[] args = { bool };
       	Function DwmIsCompositionEnabled = DWM.getFunction("DwmIsCompositionEnabled");
       	HRESULT result = (HRESULT) DwmIsCompositionEnabled.invoke(HRESULT.class, args);
       	boolean success = result.intValue()==0;
       	
       	if(success && bool[0]){
       		dwmEnabled = true;
       	}
       }  

    return dwmEnabled;
}
 
开发者ID:megablue,项目名称:Hearthtracker,代码行数:24,代码来源:HearthRobot.java

示例2: toString

import com.sun.jna.Function; //导入依赖的package包/类
@Override
public String toString() {
	if (getPointer() == null) {
		return "null";
	}
	if (getPointer() instanceof Function || getPointer() instanceof Memory) {
		return "Java initialized, not a real CF type";
	}
	CFStringRef description = INSTANCE.CFCopyDescription(this);
	try {
		return description.toString();
	} finally {
		INSTANCE.CFRelease(description);
	}
}
 
开发者ID:DigitalMediaServer,项目名称:DigitalMediaServer,代码行数:16,代码来源:CoreFoundation.java

示例3: initialize

import com.sun.jna.Function; //导入依赖的package包/类
private static void initialize() {
  if (ApplicationManager.getApplication().isUnitTestMode()) {
    return;
  }

  Ole32 ole32 = Ole32.INSTANCE;
  ole32.CoInitializeEx(Pointer.NULL, 0);

  Guid.GUID CLSID_TaskbarList = Ole32Util.getGUIDFromString("{56FDF344-FD6D-11d0-958A-006097C9A090}");
  Guid.GUID IID_ITaskbarList3 = Ole32Util.getGUIDFromString("{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}");
  PointerByReference p = new PointerByReference();
  WinNT.HRESULT hr = ole32.CoCreateInstance(CLSID_TaskbarList, Pointer.NULL, ObjBase.CLSCTX_ALL, IID_ITaskbarList3, p);
  if (!W32Errors.S_OK.equals(hr)) {
    LOG.error("Win7TaskBar CoCreateInstance(IID_ITaskbarList3) hResult: " + hr);
    ourInitialized = false;
    return;
  }

  myInterfacePointer = p.getValue();
  Pointer vTablePointer = myInterfacePointer.getPointer(0);
  Pointer[] vTable = new Pointer[TaskBarList_Methods];
  vTablePointer.read(0, vTable, 0, vTable.length);

  mySetProgressValue = Function.getFunction(vTable[TaskBarList_SetProgressValue], Function.ALT_CONVENTION);
  mySetProgressState = Function.getFunction(vTable[TaskBarList_SetProgressState], Function.ALT_CONVENTION);
  mySetOverlayIcon = Function.getFunction(vTable[TaskBarList_SetOverlayIcon], Function.ALT_CONVENTION);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:Win7TaskBar.java

示例4: _readdir

import com.sun.jna.Function; //导入依赖的package包/类
@FuseMethod
final int _readdir(final String path, final Pointer buf,
		final Pointer fillFunction, final TypeOff offset,
		final StructFuseFileInfo info) {
	return readdir(
			path,
			new DirectoryFillerImpl(buf, Function.getFunction(fillFunction)));
}
 
开发者ID:Rohde-Schwarz-Cybersecurity,项目名称:PanBox,代码行数:9,代码来源:FuseFilesystem.java

示例5: createFunction

import com.sun.jna.Function; //导入依赖的package包/类
@Override
public INativeFunction createFunction(long address, Object callingConvention) {
	int callFlags;
	if (callingConvention == INativeFunction.CallingConventionCdecl) {
		callFlags = Function.C_CONVENTION;
	} else if (callingConvention == INativeFunction.CallingConventionStdcall) {
		callFlags = Function.ALT_CONVENTION;
	} else {
		throw new IllegalArgumentException("illegal calling convention");
	}
	Pointer pointer = new Pointer(address);
	Function function = Function.getFunction(pointer, callFlags);
	return new JnaNativeFunction(function);
}
 
开发者ID:intarsys,项目名称:native-c,代码行数:15,代码来源:JnaNativeInterface.java

示例6: createLibrary

import com.sun.jna.Function; //导入依赖的package包/类
@Override
public INativeLibrary createLibrary(String name, Object callingConvention) {
	Map<String, Object> options = new HashMap<>(2);
	if (callingConvention == INativeFunction.CallingConventionCdecl) {
		options.put(Library.OPTION_CALLING_CONVENTION,
				Function.C_CONVENTION);
	} else if (callingConvention == INativeFunction.CallingConventionStdcall) {
		options.put(Library.OPTION_CALLING_CONVENTION,
				Function.ALT_CONVENTION);
	} else {
		throw new IllegalArgumentException("illegal calling convention");
	}
	options.put(Library.OPTION_OPEN_FLAGS, -1);
	return new JnaNativeLibrary(this, name, options);
}
 
开发者ID:intarsys,项目名称:native-c,代码行数:16,代码来源:JnaNativeInterface.java

示例7: onWindows

import com.sun.jna.Function; //导入依赖的package包/类
public static void onWindows() {
	// Windows taskbar fix: provideAppUserModelID
	try {
		NativeLibrary lib = NativeLibrary.getInstance("shell32");
	    Function function = lib.getFunction("SetCurrentProcessExplicitAppUserModelID");
	    Object[] args = {new WString(APPID)}; 
	    function.invokeInt(args);
	} catch (Error e) {
	    return;
	} catch (Exception x) {
		return;
	}
}
 
开发者ID:chms,项目名称:jdotxt,代码行数:14,代码来源:Jdotxt.java

示例8: SECKFMGetPublicKey

import com.sun.jna.Function; //导入依赖的package包/类
public native short SECKFMGetPublicKey(
Memory pName,
short Function,
short Flags,
IntByReference rethPubKey);
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:6,代码来源:NotesNativeAPI.java

示例9: _readdir

import com.sun.jna.Function; //导入依赖的package包/类
@FuseMethod
final int _readdir(final String path, final Pointer buf, final Pointer fillFunction, final TypeOff offset,
		final StructFuseFileInfo info)
{
	return readdir(path, new DirectoryFillerImpl(buf, Function.getFunction(fillFunction)));
}
 
开发者ID:lisgie,项目名称:ChallengeTask_Group2,代码行数:7,代码来源:FuseFilesystem.java

示例10: DirectoryFillerImpl

import com.sun.jna.Function; //导入依赖的package包/类
DirectoryFillerImpl(final Pointer buf, final Function nativeFunction)
{
	this.buf = buf;
	this.nativeFunction = nativeFunction;
	add(currentDirectory, parentDirectory);
}
 
开发者ID:lisgie,项目名称:ChallengeTask_Group2,代码行数:7,代码来源:DirectoryFillerImpl.java

示例11: getFunction

import com.sun.jna.Function; //导入依赖的package包/类
@Override
public INativeFunction getFunction(String name) {
	Function function = getLibrary().getFunction(name);
	return new JnaNativeFunction(function);
}
 
开发者ID:intarsys,项目名称:native-c,代码行数:6,代码来源:JnaNativeLibrary.java

示例12: JnaNativeFunction

import com.sun.jna.Function; //导入依赖的package包/类
public JnaNativeFunction(Function function) {
	this.function = function;
}
 
开发者ID:intarsys,项目名称:native-c,代码行数:4,代码来源:JnaNativeFunction.java

示例13: getFunction

import com.sun.jna.Function; //导入依赖的package包/类
protected Function getFunction() {
	return function;
}
 
开发者ID:intarsys,项目名称:native-c,代码行数:4,代码来源:JnaNativeFunction.java


注:本文中的com.sun.jna.Function类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。