Changeset 261 for trunk/src


Ignore:
Timestamp:
Oct 25, 2010, 4:06:07 AM (15 years ago)
Author:
lpino
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT PI/pm/library/swt.c

    r250 r261  
    1919#include "editcol.h"
    2020#include "ft2lib.h"
     21#include "progress.h"
    2122#include <malloc.h>
    2223#include <memory.h>
     
    30023003
    30033004
     3005JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_pm_OS_PrgShowDlg
     3006        (JNIEnv *env, jclass that, jint hwndParent, jint hwndOwner, jshort fsFlags, jint hmodResource, jint ulIcon, jint ulBar, jshort usId, jobject pszTitle, jobject pszButton1, jobject pszCaption1, jobject pszCaption2, jobject pszCaption3)
     3007{
     3008    PSZ c_pszTitle = NULL;
     3009    PSZ c_pszButton1 = NULL;
     3010    PSZ c_pszCaption1 = NULL;
     3011    PSZ c_pszCaption2 = NULL;
     3012    PSZ c_pszCaption3 = NULL;
     3013    jint rc;
     3014
     3015    DEBUG_CALL("PrgShowDlg\n")
     3016    if (pszTitle) c_pszTitle = getPSZBytes(env, pszTitle);
     3017    if (pszButton1) c_pszButton1 = getPSZBytes(env, pszButton1);
     3018    if (pszCaption1) c_pszCaption1 = getPSZBytes(env, pszCaption1);
     3019    if (pszCaption2) c_pszCaption2 = getPSZBytes(env, pszCaption2);
     3020    if (pszCaption3) c_pszCaption3 = getPSZBytes(env, pszCaption3);
     3021    rc = (jint)PrgShowDlg((HWND)hwndParent, (HWND)hwndOwner, fsFlags, (HMODULE)hmodResource, ulIcon, ulBar, usId, c_pszTitle, c_pszButton1, c_pszCaption1, c_pszCaption2, c_pszCaption3);
     3022    if (pszTitle) releasePSZBytes(env, pszTitle, c_pszTitle);
     3023    if (pszButton1) releasePSZBytes(env, pszButton1, c_pszButton1);
     3024    if (pszCaption1) releasePSZBytes(env, pszCaption1, c_pszCaption1);
     3025    if (pszCaption2) releasePSZBytes(env, pszCaption2, c_pszCaption2);
     3026     if (pszCaption3) releasePSZBytes(env, pszCaption3, c_pszCaption3);
     3027
     3028    return rc;
     3029}
     3030
     3031JNIEXPORT jboolean JNICALL Java_org_eclipse_swt_internal_pm_OS_PrgSetupAttributes
     3032        (JNIEnv *env, jclass that, jint hwndDlg, jint ulControlIndex,jintArray pulForegroundColor, jintArray pulBackgroundColor, jobject pszFontNameSize, jboolean flUpdate)
     3033{
     3034    DECL_GLOB(pGlob)
     3035    jboolean rc;
     3036
     3037    jint *c_pulForegroundColor = NULL;
     3038    jint *c_pulBackgroundColor = NULL;
     3039    PSZ c_pszFontNameSize = NULL;
     3040
     3041    DEBUG_CALL("PrgSetupAttributes\n")
     3042
     3043    if (pulForegroundColor) c_pulForegroundColor = (*env)->GetIntArrayElements(env, pulForegroundColor, NULL);
     3044    if (pulBackgroundColor) c_pulBackgroundColor = (*env)->GetIntArrayElements(env, pulBackgroundColor, NULL);
     3045    if (pszFontNameSize) c_pszFontNameSize = getPSZBytes(env, pszFontNameSize);
     3046
     3047    rc = (jboolean)PrgSetupAttributes((HWND)hwndDlg, ulControlIndex, c_pulForegroundColor, c_pulBackgroundColor, c_pszFontNameSize, flUpdate);
     3048
     3049    if (pszFontNameSize) releasePSZBytes(env, pszFontNameSize, c_pszFontNameSize);
     3050    if (pulBackgroundColor) (*env)->ReleaseIntArrayElements(env, pulBackgroundColor, c_pulBackgroundColor, 0);
     3051    if (pulForegroundColor) (*env)->ReleaseIntArrayElements(env, pulForegroundColor, c_pulForegroundColor, 0);
     3052
     3053    return rc;
     3054}
     3055
     3056JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_pm_OS_PrgSetPercentage
     3057        (JNIEnv *env, jclass that, jint hwndProgress, jshort usPercent)
     3058{
     3059    DECL_GLOB(pGlob)
     3060    jint rc;
     3061
     3062    DEBUG_CALL("PrgSetPercentage\n")
     3063
     3064    rc = (jint)PrgSetPercentage((HWND)hwndProgress, usPercent);
     3065
     3066
     3067    return rc;
     3068}
     3069
     3070
     3071
Note: See TracChangeset for help on using the changeset viewer.