~ubuntu-branches/debian/sid/swt-gtk/sid

« back to all changes in this revision

Viewing changes to xpcom_structs.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adrian Perez
  • Date: 2009-12-07 10:22:24 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20091207102224-70w2tax575mcks1w
Tags: 3.5.1-1
* New upstream release. Closes: #558663.
* debian/control: 
  - Add Vcs-* fields for Git repository.
  - Allow DM-Uploads.
  - Remove "Conflicts", package should live with eclipse.
* debian/rules: Fix default-java path around AWT_LIB_PATH.
* debian/copyright: Minor update.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*******************************************************************************
2
 
 * Copyright (c) 2000, 2007 IBM Corporation and others.
 
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
3
3
 * All rights reserved. This program and the accompanying materials
4
4
 * are made available under the terms of the Eclipse Public License v1.0
5
5
 * which accompanies this distribution, and is available at
12
12
#include "swt.h"
13
13
#include "xpcom_structs.h"
14
14
 
 
15
#ifndef NO_nsDynamicFunctionLoad
 
16
typedef struct nsDynamicFunctionLoad_FID_CACHE {
 
17
        int cached;
 
18
        jclass clazz;
 
19
        jfieldID functionName, function;
 
20
} nsDynamicFunctionLoad_FID_CACHE;
 
21
 
 
22
nsDynamicFunctionLoad_FID_CACHE nsDynamicFunctionLoadFc;
 
23
 
 
24
void cachensDynamicFunctionLoadFields(JNIEnv *env, jobject lpObject)
 
25
{
 
26
        if (nsDynamicFunctionLoadFc.cached) return;
 
27
        nsDynamicFunctionLoadFc.clazz = env->GetObjectClass(lpObject);
 
28
        nsDynamicFunctionLoadFc.functionName = env->GetFieldID(nsDynamicFunctionLoadFc.clazz, "functionName", I_J);
 
29
        nsDynamicFunctionLoadFc.function = env->GetFieldID(nsDynamicFunctionLoadFc.clazz, "function", I_J);
 
30
        nsDynamicFunctionLoadFc.cached = 1;
 
31
}
 
32
 
 
33
nsDynamicFunctionLoad *getnsDynamicFunctionLoadFields(JNIEnv *env, jobject lpObject, nsDynamicFunctionLoad *lpStruct)
 
34
{
 
35
        if (!nsDynamicFunctionLoadFc.cached) cachensDynamicFunctionLoadFields(env, lpObject);
 
36
        lpStruct->functionName = (const char *)env->GetIntLongField(lpObject, nsDynamicFunctionLoadFc.functionName);
 
37
        lpStruct->function = (NSFuncPtr  *)env->GetIntLongField(lpObject, nsDynamicFunctionLoadFc.function);
 
38
        return lpStruct;
 
39
}
 
40
 
 
41
void setnsDynamicFunctionLoadFields(JNIEnv *env, jobject lpObject, nsDynamicFunctionLoad *lpStruct)
 
42
{
 
43
        if (!nsDynamicFunctionLoadFc.cached) cachensDynamicFunctionLoadFields(env, lpObject);
 
44
        env->SetIntLongField(lpObject, nsDynamicFunctionLoadFc.functionName, (jintLong)lpStruct->functionName);
 
45
        env->SetIntLongField(lpObject, nsDynamicFunctionLoadFc.function, (jintLong)lpStruct->function);
 
46
}
 
47
#endif
 
48
 
15
49
#ifndef NO_nsID
16
50
typedef struct nsID_FID_CACHE {
17
51
        int cached;