1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
4  *
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  *
7  * This file is hereby licensed under the terms of the GNU GPL v2.0,
8  * pursuant to article 5.3.4 of the CeCILL v.2.1.
9  * This file was originally licensed under the terms of the CeCILL v2.1,
10  * and continues to be available under such terms.
11  * For more information, see the COPYING file which you should have received
12  * along with this program.
13  *
14  */
15 /* Messages.i */
16 /**
17  * Windows: swig -java -package org.scilab.modules.localization -outdir ../java/org/scilab/modules/localization/ setdefaultlanguage.i
18  * Others: Use the option --enable-build-swig to the configure
19 */
20 %module WindowsDefaultLanguage
21 
22 %{
23 #include "setgetlanguage.h"
24 %}
25 
26 /* JavaDoc for WindowsDefaultLanguage class */
27 %pragma(java) jniclassclassmodifiers=%{
28 /* It is generated code. Disable checkstyle */
29 //CHECKSTYLE:OFF
30  /**
31    * @author Calixte DENIZET
32    * @copyright Scilab Enterprises - 2012
33    */
34 public class%}
35 
36 /* Constructor for WindowsDefaultLanguageJNI class */
37 %pragma(java) jniclasscode="
38   /**
39     * Constructor
40     */
41   protected WindowsDefaultLanguageJNI() {
42     throw new UnsupportedOperationException();
43   }";
44 
45 /* static load of library */
46 %pragma(java) jniclasscode=%{
47   static {
48     try {
49         System.loadLibrary("scilocalization");
catch(SecurityException e)50     } catch (SecurityException e) {
51         System.err.println("A security manager exists and does not allow the loading of the specified dynamic library.");
52         System.err.println(e.getLocalizedMessage());
53         e.printStackTrace(System.err);
54     } catch (UnsatisfiedLinkError e)    {
55         System.err.println("The native library scilocalization does not exist or cannot be found.");
56         System.err.println(e.getLocalizedMessage());
57         e.printStackTrace(System.err);
58     }
59   }
60 %}
61 
62 /* JavaDoc for WindowsDefaultLanguage class */
63 %pragma(java) moduleclassmodifiers="
64  /**
65    * @author Calixte DENIZET
66    * @copyright Scilab Enterprises - 2012
67    */
68 public class";
69 
70 /* Constructor for WindowsDefaultLanguage class */
71 %pragma(java) modulecode="
72  /**
73    * Constructor
74    */
75  protected WindowsDefaultLanguage() {
76     throw new UnsupportedOperationException();
77  }";
78 
79 /* JavaDoc */
80 %javamethodmodifiers setdefaultlanguage(const char *locale) "
81 /**
82 * Set and save the language in the registry (Windows only)
83 * @param[in] lang the language to set and save.
84 */
85 public";
86 
87 
88 void setdefaultlanguage(const char *lang);
89 
90 %javamethodmodifiers getdefaultlanguage(void) "
91 /**
92 * Get the language from the registry (Windows only)
93 * @return the default language.
94 */
95 public";
96 
97 
98 char * getdefaultlanguage(void);
99