1 /* Generated by GIWS (version 2.0.1) with command:
2 giws --disable-return-size-array --output-dir src/jni/ --throws-exception-on-error --description-file src/jni/Palette.giws.xml
6 This is generated code.
8 This software is a computer program whose purpose is to hide the complexity
9 of accessing Java objects/methods from C++ code.
11 This software is governed by the CeCILL-B license under French law and
12 abiding by the rules of distribution of free software. You can use,
13 modify and/ or redistribute the software under the terms of the CeCILL-B
14 license as circulated by CEA, CNRS and INRIA at the following URL
15 "http://www.cecill.info".
17 As a counterpart to the access to the source code and rights to copy,
18 modify and redistribute granted by the license, users are provided only
19 with a limited warranty and the software's author, the holder of the
20 economic rights, and the successive licensors have only limited
23 In this respect, the user's attention is drawn to the risks associated
24 with loading, using, modifying and/or developing or reproducing the
25 software by the user in light of its specific status of free software,
26 that may mean that it is complicated to manipulate, and that also
27 therefore means that it is reserved for developers and experienced
28 professionals having in-depth computer knowledge. Users are therefore
29 encouraged to load and test the software's suitability as regards their
30 requirements in conditions enabling the security of their systems and/or
31 data to be ensured and, more generally, to use and operate it in the
32 same conditions as regards security.
34 The fact that you are presently reading this means that you have had
35 knowledge of the CeCILL-B license and that you accept its terms.
39 #ifndef __ORG_SCILAB_MODULES_XCOS_PALETTE_PALETTE__
40 #define __ORG_SCILAB_MODULES_XCOS_PALETTE_PALETTE__
47 #include "GiwsException.hxx"
49 #if defined(_MSC_VER) /* Defined anyway with Visual */
52 typedef signed char byte;
57 # if defined(_MSC_VER) || defined(__WIN32__) || defined(__CYGWIN__)
58 # if defined(STATIC_LINKED)
61 # define GIWSEXPORT __declspec(dllexport)
65 # define GIWSEXPORT __attribute__ ((visibility ("default")))
72 namespace org_scilab_modules_xcos_palette {
73 class GIWSEXPORT Palette {
79 jmethodID voidloadPaljstringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_StringID; // cache method id
80 jclass stringArrayClass;
81 jmethodID voidloadPaljstringjava_lang_StringID; // cache method id
82 jmethodID voidaddCategoryjobjectArray_java_lang_Stringjava_lang_StringjbooleanbooleanID; // cache method id
83 jmethodID voidremovejobjectArray_java_lang_Stringjava_lang_StringID; // cache method id
84 jmethodID voidenablejobjectArray_java_lang_Stringjava_lang_StringjbooleanbooleanID; // cache method id
85 jmethodID voidmovejobjectArray_java_lang_Stringjava_lang_StringjobjectArray_java_lang_Stringjava_lang_StringID; // cache method id
86 jmethodID voidgeneratePaletteIconjstringjava_lang_StringID; // cache method id
87 jmethodID voidgenerateAllImagesjobjectArray_java_lang_Stringjava_lang_StringID; // cache method id
92 jclass instanceClass; // cache class
99 * Get the environment matching to the current thread.
101 virtual JNIEnv * getCurrentEnv();
106 * Create a wrapping of the object from a JNIEnv.
107 * It will call the default constructor
108 * @param JEnv_ the Java Env
110 Palette(JavaVM * jvm_);
113 * Create a wrapping of an already existing object from a JNIEnv.
114 * The object must have already been instantiated
115 * @param JEnv_ the Java Env
116 * @param JObj the object
118 Palette(JavaVM * jvm_, jobject JObj);
122 * This is a fake constructor to avoid the constructor
123 * chaining when dealing with extended giws classes
125 #ifdef FAKEGIWSDATATYPE
126 Palette(fakeGiwsDataType::fakeGiwsDataType /* unused */) {}
133 // Synchronization methods
135 * Enter monitor associated with the object.
136 * Equivalent of creating a "synchronized(obj)" scope in Java.
141 * Exit monitor associated with the object.
142 * Equivalent of ending a "synchronized(obj)" scope.
144 void endSynchronize();
147 static void loadPal(JavaVM * jvm_, char const* name, char const* const* category, int categorySize);
149 static void loadPal(JavaVM * jvm_, char const* name);
151 static void addCategory(JavaVM * jvm_, char const* const* name, int nameSize, bool visible);
153 static void remove(JavaVM * jvm_, char const* const* name, int nameSize);
155 static void enable(JavaVM * jvm_, char const* const* name, int nameSize, bool status);
157 static void move(JavaVM * jvm_, char const* const* source, int sourceSize, char const* const* target, int targetSize);
159 static void generatePaletteIcon(JavaVM * jvm_, char const* iconPath);
161 static void generateAllImages(JavaVM * jvm_, char const* const* path, int pathSize);
165 * Get class name to use for static methods
166 * @return class name to use for static methods
169 static const std::string className()
171 return "org/scilab/modules/xcos/palette/Palette";