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


C++ JAWT类代码示例

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


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

示例1: MOZILLA_NATIVE

extern "C" NS_EXPORT jlong JNICALL
MOZILLA_NATIVE(getNativeHandleFromAWT) (JNIEnv* env, jobject clazz,
                                        jobject widget)
{
  PRUint64 handle = 0;

#ifdef XP_MACOSX
  JAWT awt;
  awt.version = JAWT_VERSION_1_4;
  jboolean result = JAWT_GetAWT(env, &awt);
  if (result == JNI_FALSE)
    return 0;
    
  JAWT_DrawingSurface* ds = awt.GetDrawingSurface(env, widget);
  if (ds != nullptr) {
    jint lock = ds->Lock(ds);
    if (!(lock & JAWT_LOCK_ERROR)) {
      JAWT_DrawingSurfaceInfo* dsi = ds->GetDrawingSurfaceInfo(ds);
      if (dsi) {
        handle = GetPlatformHandle(dsi);
        ds->FreeDrawingSurfaceInfo(dsi);
      }

      ds->Unlock(ds);
    }

    awt.FreeDrawingSurface(ds);
  }
#else
  NS_WARNING("getNativeHandleFromAWT JNI method not implemented");
#endif

  return handle;
}
开发者ID:my2iu,项目名称:Mozilla-JavaXPCom,代码行数:34,代码来源:nsJavaInterfaces.cpp

示例2: throwException

JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_lockAndInitHandle
  (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject canvas) {
	JAWT awt;
	JAWT_DrawingSurface* ds;
	JAWT_DrawingSurfaceInfo *dsi;
	AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
	awt.version = JAWT_VERSION_1_4;
	if (JAWT_GetAWT(env, &awt) == JNI_FALSE) {
		throwException(env, "Could not get the JAWT interface");
		return JNI_FALSE;
	}

	ds = awt.GetDrawingSurface(env, canvas);
	if (ds == NULL) {
		throwException(env, "Could not get the drawing surface");
		return JNI_FALSE;
	}

	if((ds->Lock(ds) & JAWT_LOCK_ERROR) != 0) {
		awt.FreeDrawingSurface(ds);
		throwException(env, "Could not lock the drawing surface");
		return JNI_FALSE;
	}

	dsi = ds->GetDrawingSurfaceInfo(ds);
	if (dsi != NULL) {
		awt_lock->awt = awt;
		awt_lock->ds = ds;
		awt_lock->dsi = dsi;
		return JNI_TRUE;
  	}
	ds->Unlock(ds);
	awt.FreeDrawingSurface(ds);
	return JNI_FALSE;
}
开发者ID:DanSze,项目名称:DungeonGame,代码行数:35,代码来源:org_lwjgl_opengl_AWTSurfaceLock.c

示例3: SWT_AWT_NATIVE

JNIEXPORT jintLong JNICALL SWT_AWT_NATIVE(getAWTHandle)
	(JNIEnv *env, jclass that, jobject canvas)
{
	JAWT awt;
	JAWT_DrawingSurface* ds;
	JAWT_DrawingSurfaceInfo* dsi;
	JAWT_Win32DrawingSurfaceInfo* dsi_win;
	jintLong result = 0;
	jint lock;

	awt.version = JAWT_VERSION_1_3;
	if (JAWT_GetAWT(env, &awt) != 0) {
		ds = awt.GetDrawingSurface(env, canvas);
		if (ds != NULL) {
			lock = ds->Lock(ds);
		 	if ((lock & JAWT_LOCK_ERROR) == 0) {
			 	dsi = ds->GetDrawingSurfaceInfo(ds);
				dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
				result = (jintLong)dsi_win->hwnd;
				ds->FreeDrawingSurfaceInfo(dsi);
				ds->Unlock(ds);
			}
		}
		awt.FreeDrawingSurface(ds);
	}
	return result;
}
开发者ID:PaulLoizeaux,项目名称:TicketWatcher,代码行数:27,代码来源:swt_awt.c

示例4: SWT_AWT_NATIVE

JNIEXPORT void JNICALL SWT_AWT_NATIVE(setDebug)
	(JNIEnv *env, jclass that, jobject frame, jboolean debug)
{
	JAWT awt;
	JAWT_DrawingSurface* ds;
	JAWT_DrawingSurfaceInfo* dsi;
	JAWT_X11DrawingSurfaceInfo* dsi_x11;
	jint lock;

	awt.version = JAWT_VERSION_1_3;
	if (JAWT_GetAWT(env, &awt) != 0) {
		ds = awt.GetDrawingSurface(env, frame);
		if (ds != NULL) {
			lock = ds->Lock(ds);
		 	if ((lock & JAWT_LOCK_ERROR) == 0) {
			 	dsi = ds->GetDrawingSurfaceInfo(ds);
				dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo;
				XSynchronize(dsi_x11->display, debug);
				ds->FreeDrawingSurfaceInfo(dsi);
				ds->Unlock(ds);
			}
		}
		awt.FreeDrawingSurface(ds);
	}
}
开发者ID:HendrikPeilke,项目名称:eclipse.platform.swt,代码行数:25,代码来源:swt_awt.c

示例5: Java_org_lwjgl_opengl_LinuxDisplay_nUnlockAWT

JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUnlockAWT(JNIEnv *env, jclass clazz) {
	JAWT jawt;
	jawt.version = JAWT_VERSION_1_4;
	if (JAWT_GetAWT(env, &jawt) != JNI_TRUE) {
		throwException(env, "GetAWT failed");
		return;
	}
	jawt.Unlock(env);
}
开发者ID:edubrunaldi,项目名称:SpaceSample,代码行数:9,代码来源:org_lwjgl_opengl_Display.c

示例6: JAWT_GetAWT

/*****************************************************************************
 *
 * Class      : NativeView
 * Method     : getNativeWindow
 * Signature  : ()J
 * Description: returns the native systemw window handle of this object
 */
JNIEXPORT jlong JNICALL Java_NativeView_getNativeWindow
  (JNIEnv * env, jobject obj_this)
{
    jboolean                      result  ;
    jint                          lock    ;
    JAWT                          awt     ;
    JAWT_DrawingSurface*          ds      ;
    JAWT_DrawingSurfaceInfo*      dsi     ;
    JAWT_Win32DrawingSurfaceInfo* dsi_win ;
    HDC                           hdc     ;
    HWND                          hWnd    ;
    LONG                          hFuncPtr;

    /* Get the AWT */
    awt.version = JAWT_VERSION_1_3;
    result      = JAWT_GetAWT(env, &awt);
    MY_ASSERT(result!=JNI_FALSE,"wrong jawt version");

    /* Get the drawing surface */
    if ((ds = awt.GetDrawingSurface(env, obj_this)) == NULL)
        return 0L;

    /* Lock the drawing surface */
    lock = ds->Lock(ds);
    MY_ASSERT((lock & JAWT_LOCK_ERROR)==0,"can't lock the drawing surface");

    /* Get the drawing surface info */
    dsi = ds->GetDrawingSurfaceInfo(ds);

    /* Get the platform-specific drawing info */
    dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
    hdc     = dsi_win->hdc;
    hWnd    = dsi_win->hwnd;

    /* Free the drawing surface info */
    ds->FreeDrawingSurfaceInfo(dsi);
    /* Unlock the drawing surface */
    ds->Unlock(ds);
    /* Free the drawing surface */
    awt.FreeDrawingSurface(ds);

    /* Register own window procedure
       Do it one times only! Otherwhise
       multiple instances will be registered
       and calls on such construct produce
       a stack overflow.
     */
    if (GetProp( hWnd, OLD_PROC_KEY )==0)
    {
        hFuncPtr = SetWindowLong( hWnd, GWL_WNDPROC, (DWORD)NativeViewWndProc );
        SetProp( hWnd, OLD_PROC_KEY, (HANDLE)hFuncPtr );
    }

    return ((jlong)hWnd);
}
开发者ID:CaoMomo,项目名称:core,代码行数:62,代码来源:nativeview.c

示例7: printf

JNIEXPORT jint JNICALL Java_vnmr_ui_VNMRFrame_syncXwin
  (JNIEnv *env, jobject obj, jobject source)
{
        JAWT awt;
        JAWT_DrawingSurface *ds;
        JAWT_DrawingSurfaceInfo *dsi;
        JAWT_X11DrawingSurfaceInfo *dsi_win;
        Display* dpy;
        Drawable xwin;
        GC       gc;
        jint     ret;
	jint lock;

        ret = 0;
	awt.version = JAWT_VERSION_1_4;
	if (JAWT_GetAWT(env, &awt) == JNI_FALSE) {
	    printf(" JAVA AWT not found \n");
	    return (ret);
	}

	ds = awt.GetDrawingSurface(env, source);
	if (ds == NULL) {
	    printf(" JAVA Window not found \n");
	    return (ret);
	}

	lock = ds->Lock(ds);
	if ((lock & JAWT_LOCK_ERROR) != 0) {
	    printf(" JAVA Error on locking window \n");
	    awt.FreeDrawingSurface(ds);
	    return (ret);
	}

	dsi = ds->GetDrawingSurfaceInfo(ds);
	if (dsi != NULL) {
	    dsi_win = (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo;
	    if (dsi_win != NULL) {
                xwin = dsi_win->drawable;
                dpy = dsi_win->display;
                XSynchronize(dpy, 1);
                gc = XCreateGC(dpy, xwin, 0, 0);
                XSetForeground(dpy, gc, 2);
                XFreeGC(dpy, gc);
                XSynchronize(dpy, 0);
		ret = 1;
	    }
	    ds->FreeDrawingSurfaceInfo(dsi);
	}
	ds->Unlock(ds);
	awt.FreeDrawingSurface(ds);
	return (ret);
}
开发者ID:timburrow,项目名称:ovj3,代码行数:52,代码来源:vnmrjNative.c

示例8: JAWT_GetAWT

/*****************************************************************************
 *
 * Class      : NativeView
 * Method     : getNativeWindow
 * Signature  : ()J
 * Description: returns the native systemw window handle of this object
 */
JNIEXPORT jlong JNICALL Java_embeddedobj_test_NativeView_getNativeWindow
  (JNIEnv * env, jobject obj_this)
{
    jboolean                      result  ;
    jint                          lock    ;
    JAWT                          awt     ;
    JAWT_DrawingSurface*          ds      ;
    JAWT_DrawingSurfaceInfo*      dsi     ;
#ifdef WNT
    JAWT_Win32DrawingSurfaceInfo* dsi_win ;
#else
    // FIXME: Where is dsi_x11 defined?
    // Added below because I'm guessing this test breaks

    // JAWT_X11DrawingSurfaceInfo*dsi_x11 ;
#endif
    jlong                         drawable;

    /* Get the AWT */
    awt.version = JAWT_VERSION_1_3;
    result      = JAWT_GetAWT(env, &awt);
    MY_ASSERT(result!=JNI_FALSE,"wrong jawt version");

    /* Get the drawing surface */
    if ((ds = awt.GetDrawingSurface(env, obj_this)) == NULL)
        return 0L;

    /* Lock the drawing surface */
    lock = ds->Lock(ds);
    MY_ASSERT((lock & JAWT_LOCK_ERROR)==0,"can't lock the drawing surface");

    /* Get the drawing surface info */
    dsi = ds->GetDrawingSurfaceInfo(ds);

    /* Get the platform-specific drawing info */
#ifdef WNT
    dsi_win  = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
    drawable = (jlong)dsi_win->hwnd;
#else
    dsi_x11  = (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo;
    drawable = (jlong)dsi_x11->drawable;
#endif

    /* Free the drawing surface info */
    ds->FreeDrawingSurfaceInfo(dsi);
    /* Unlock the drawing surface */
    ds->Unlock(ds);
    /* Free the drawing surface */
    awt.FreeDrawingSurface(ds);

    return drawable;
}
开发者ID:MItsutoshiNAKANO,项目名称:core,代码行数:59,代码来源:nativeview.c

示例9: _throw

JNIEXPORT void JNICALL Java_com_turbovnc_vncviewer_Viewport_x11FullScreen
  (JNIEnv *env, jobject obj, jboolean on)
{
  JAWT awt;
  JAWT_DrawingSurface *ds = NULL;
  JAWT_DrawingSurfaceInfo *dsi = NULL;
  JAWT_X11DrawingSurfaceInfo *x11dsi = NULL;
  jfieldID fid;
  jclass cls;

  awt.version = JAWT_VERSION_1_3;
  if (!handle) {
    if ((handle = dlopen("libjawt.so", RTLD_LAZY)) == NULL)
      _throw(dlerror());
    if ((__JAWT_GetAWT =
         (__JAWT_GetAWT_type)dlsym(handle, "JAWT_GetAWT")) == NULL)
      _throw(dlerror());
  }

  if (__JAWT_GetAWT(env, &awt) == JNI_FALSE)
    _throw("Could not initialize AWT native interface");

  if ((ds = awt.GetDrawingSurface(env, obj)) == NULL)
    _throw("Could not get drawing surface");

  if ((ds->Lock(ds) & JAWT_LOCK_ERROR) != 0)
    _throw("Could not lock surface");

  if ((dsi = ds->GetDrawingSurfaceInfo(ds)) == NULL)
    _throw("Could not get drawing surface info");

  if ((x11dsi = (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo) == NULL)
    _throw("Could not get X11 drawing surface info");

  netwm_fullscreen(x11dsi->display, x11dsi->drawable, on);
  XSync(x11dsi->display, False);

  if ((cls = (*env)->GetObjectClass(env, obj)) == NULL ||
      (fid = (*env)->GetFieldID(env, cls, "x11win", "J")) == 0)
    _throw("Could not store X window handle");
  (*env)->SetLongField(env, obj, fid, x11dsi->drawable);

  printf("TurboVNC Helper: %s X11 full-screen mode for window 0x%.8lx\n",
         on ? "Enabling" : "Disabling", x11dsi->drawable);

  bailout:
  if (ds) {
    if (dsi) ds->FreeDrawingSurfaceInfo(dsi);
    ds->Unlock(ds);
    awt.FreeDrawingSurface(ds);
  }
}
开发者ID:coffee8651,项目名称:turbovnc,代码行数:52,代码来源:turbovnchelper.c

示例10: _throww32

JNIEXPORT void JNICALL Java_com_turbovnc_vncviewer_Viewport_grabKeyboard
  (JNIEnv *env, jobject obj, jboolean on, jboolean pointer)
{
  JAWT awt;
  JAWT_DrawingSurface *ds = NULL;
  JAWT_DrawingSurfaceInfo *dsi = NULL;
  JAWT_Win32DrawingSurfaceInfo *w32dsi = NULL;

  if (on) {
    awt.version = JAWT_VERSION_1_3;
    if (!handle) {
      if ((handle = LoadLibrary("jawt")) == NULL)
        _throww32();
      if ((__JAWT_GetAWT =
           (__JAWT_GetAWT_type)GetProcAddress(handle, "JAWT_GetAWT")) == NULL)
        _throww32();
    }

    if (__JAWT_GetAWT(env, &awt) == JNI_FALSE)
      _throw("Could not initialize AWT native interface");

    if ((ds = awt.GetDrawingSurface(env, obj)) == NULL)
      _throw("Could not get drawing surface");

    if ((ds->Lock(ds) & JAWT_LOCK_ERROR) != 0)
      _throw("Could not lock surface");

    if ((dsi = ds->GetDrawingSurfaceInfo(ds)) == NULL)
      _throw("Could not get drawing surface info");

    if ((w32dsi = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo) == NULL)
      _throw("Could not get Win32 drawing surface info");

    LowLevelHook::Activate(w32dsi->hwnd);
    printf("TurboVNC Helper: Grabbed keyboard for window 0x%.8llx\n",
           (unsigned long long)w32dsi->hwnd);
  } else {
    LowLevelHook::Deactivate();
    printf("TurboVNC Helper: Ungrabbed keyboard\n");
  }

  bailout:
  if (ds) {
    if (dsi) ds->FreeDrawingSurfaceInfo(dsi);
    ds->Unlock(ds);
    awt.FreeDrawingSurface(ds);
  }
}
开发者ID:TurboVNC,项目名称:turbovnc,代码行数:48,代码来源:turbovnchelper.cpp

示例11: JAWT_GetAWT

JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_AWTSurfaceLock_lockAndInitHandle
  (JNIEnv *env, jclass clazz, jobject lock_buffer_handle, jobject canvas) {
	JAWT awt;
	JAWT_DrawingSurface* ds;
	JAWT_DrawingSurfaceInfo *dsi;
	AWTSurfaceLock *awt_lock = (AWTSurfaceLock *)(*env)->GetDirectBufferAddress(env, lock_buffer_handle);
    
	jboolean result = JNI_FALSE;
	
	#ifdef __MACH__
	// try get JAWT with JAWT_MACOSX_USE_CALAYER Opt In
	awt.version = JAWT_VERSION_1_4 | 0x80000000;//JAWT_MACOSX_USE_CALAYER;
	result = JAWT_GetAWT(env, &awt);
	#endif
	
	if (result == JNI_FALSE) {
		// now try without CALAYER
		awt.version = JAWT_VERSION_1_4;
		if (JAWT_GetAWT(env, &awt) == JNI_FALSE) {
			throwException(env, "Could not get the JAWT interface");
			return JNI_FALSE;
		}
	}

	ds = awt.GetDrawingSurface(env, canvas);
	if (ds == NULL) {
		throwException(env, "Could not get the drawing surface");
		return JNI_FALSE;
	}

	if((ds->Lock(ds) & JAWT_LOCK_ERROR) != 0) {
		awt.FreeDrawingSurface(ds);
		throwException(env, "Could not lock the drawing surface");
		return JNI_FALSE;
	}

	dsi = ds->GetDrawingSurfaceInfo(ds);
	if (dsi != NULL) {
		awt_lock->awt = awt;
		awt_lock->ds = ds;
		awt_lock->dsi = dsi;
		return JNI_TRUE;
  	}
	ds->Unlock(ds);
	awt.FreeDrawingSurface(ds);
	return JNI_FALSE;
}
开发者ID:2048Studio,项目名称:lwjgl,代码行数:47,代码来源:org_lwjgl_opengl_AWTSurfaceLock.c

示例12: JAWT_GetAWT

/*
 * Class:     com_sun_star_beans_LocalOfficeWindow
 * Method:    getNativeWindow
 * Signature: ()J
 */
SAL_DLLPUBLIC_EXPORT jlong JNICALL Java_com_sun_star_comp_beans_LocalOfficeWindow_getNativeWindow
  (JNIEnv * env, jobject obj_this)
{
    jboolean result;
    jint lock;

    JAWT awt;
    JAWT_DrawingSurface* ds;
    JAWT_DrawingSurfaceInfo* dsi;
    JAWT_X11DrawingSurfaceInfo* dsi_x11;

    Drawable drawable;

    /* Get the AWT */
    awt.version = JAWT_VERSION_1_3;
    result = JAWT_GetAWT(env, &awt);
    if (result == JNI_FALSE)
        ThrowException(env, "java/lang/RuntimeException", "JAWT_GetAWT failed");

                                /* Get the drawing surface */
    if ((ds = awt.GetDrawingSurface(env, obj_this)) == NULL)
        return 0L;

    /* Lock the drawing surface */
    lock = ds->Lock(ds);
    if ( (lock & JAWT_LOCK_ERROR) != 0)
        ThrowException(env, "java/lang/RuntimeException",
                       "Could not get AWT drawing surface.");

    /* Get the drawing surface info */
    dsi = ds->GetDrawingSurfaceInfo(ds);

    /* Get the platform-specific drawing info */
    dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo;

    drawable = dsi_x11->drawable;

    /* Free the drawing surface info */
    ds->FreeDrawingSurfaceInfo(dsi);
    /* Unlock the drawing surface */
    ds->Unlock(ds);
    /* Free the drawing surface */
    awt.FreeDrawingSurface(ds);

    return ((jlong)drawable);
}
开发者ID:h4ck3rm1k3,项目名称:libre-office-core,代码行数:51,代码来源:com_sun_star_comp_beans_LocalOfficeWindow.c

示例13: Java_org_jclutter_awt_JClutterCanvas_paint

JNIEXPORT void JNICALL Java_org_jclutter_awt_JClutterCanvas_paint(JNIEnv *env, jobject canvas, jobject graphics){
	 JAWT awt;
	 JAWT_DrawingSurface* ds;
	 JAWT_DrawingSurfaceInfo* dsi;
	 JAWT_Win32DrawingSurfaceInfo* dsi_win;
	 jboolean result;
	 jint lock;

	 // Get the AWT
	 awt.version = JAWT_VERSION_1_3;
	 result = JAWT_GetAWT(env, &awt);
	 assert(result != JNI_FALSE);

	 // Get the drawing surface
	 ds = awt.GetDrawingSurface(env, canvas);
	 assert(ds != NULL);

	 // Lock the drawing surface
	 lock = ds->Lock(ds);
	 assert((lock & JAWT_LOCK_ERROR) == 0);

	 // Get the drawing surface info
	 dsi = ds->GetDrawingSurfaceInfo(ds);

	 // Get the platform-specific drawing info
	 dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;

	 // TODO : What to do next ?
	 HWND hWnd = dsi_win->hwnd;

	 clutter_win32_set_stage_foreign( clutter_stage_get_default(), hWnd);

	 // Free the drawing surface info
	 ds->FreeDrawingSurfaceInfo(dsi);

	 // Unlock the drawing surface
	 ds->Unlock(ds);

	 // Free the drawing surface
	 awt.FreeDrawingSurface(ds);


}
开发者ID:clutter-project,项目名称:jclutter,代码行数:43,代码来源:jclutter-awt-cvs.c

示例14: JAWT_GetAWT

/*
 * Class:     NativeView
 * Method:    getNativeWindow
 * Signature: ()J
 */
JNIEXPORT jlong JNICALL Java_NativeView_getNativeWindow
  (JNIEnv * env, jobject obj_this)
{
    jboolean                    result  ;
    jint                        lock    ;
    JAWT                        awt     ;
    JAWT_DrawingSurface*        ds      ;
    JAWT_DrawingSurfaceInfo*    dsi     ;
    JAWT_X11DrawingSurfaceInfo* dsi_x11 ;
    Drawable                    drawable;
    Display*                    display ;

	/* Get the AWT */
	awt.version = JAWT_VERSION_1_3;
    result      = JAWT_GetAWT(env, &awt);
    MY_ASSERT(result != JNI_FALSE,"wrong jawt version");

    /* Get the drawing surface */
	if ((ds = awt.GetDrawingSurface(env, obj_this)) == NULL)
		return 0L;

	/* Lock the drawing surface */
	lock = ds->Lock(ds);
    MY_ASSERT((lock & JAWT_LOCK_ERROR)==0,"can't lock the drawing surface");

	/* Get the drawing surface info */
	dsi = ds->GetDrawingSurfaceInfo(ds);

	/* Get the platform-specific drawing info */
    dsi_x11  = (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo;
	drawable = dsi_x11->drawable;
	display  = dsi_x11->display;

	/* Free the drawing surface info */
	ds->FreeDrawingSurfaceInfo(dsi);
	/* Unlock the drawing surface */
	ds->Unlock(ds);
	/* Free the drawing surface */
	awt.FreeDrawingSurface(ds);

	return ((jlong)drawable);
}
开发者ID:beppec56,项目名称:openoffice,代码行数:47,代码来源:nativeview.c

示例15: JAWT_GetAWT

JNIEXPORT void JNICALL Java_win32_WindowsUtils_flash
(JNIEnv *env, jobject f, jobject component, jboolean bool)
{
	JAWT awt;
	JAWT_DrawingSurface* ds;
	JAWT_DrawingSurfaceInfo* dsi;
	JAWT_Win32DrawingSurfaceInfo* dsi_win;
	jboolean result;

	jint lock;

	// Get the AWT
	awt.version = JAWT_VERSION_1_3;
	result = JAWT_GetAWT(env, &awt);
	assert(result != JNI_FALSE);
	// Get the drawing surface
	ds = awt.GetDrawingSurface(env, component);
	if(ds == NULL)
		return;
	// Lock the drawing surface
	lock = ds->Lock(ds);
	assert((lock & JAWT_LOCK_ERROR) == 0);

	// Get the drawing surface info
	dsi = ds->GetDrawingSurfaceInfo(ds);

	// Get the platform-specific drawing info
	dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;

	FlashWindow(dsi_win->hwnd,bool);

	// Free the drawing surface info
	ds->FreeDrawingSurfaceInfo(dsi);
	// Unlock the drawing surface
	ds->Unlock(ds);
	// Free the drawing surface
	awt.FreeDrawingSurface(ds);

}
开发者ID:j78310,项目名称:zterm,代码行数:39,代码来源:win32_WindowsUtils.c


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