1 /*
   2  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Sun designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Sun in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  22  * CA 95054 USA or visit www.sun.com if you need additional information or
  23  * have any questions.
  24  */
  25 
  26 #include <stdlib.h>
  27 #include "gtk2_interface.h"
  28 #include "com_sun_java_swing_plaf_gtk_GTKStyle.h"
  29 
  30 /*
  31  * Class:     com_sun_java_swing_plaf_gtk_GTKStyle
  32  * Method:    nativeGetXThickness
  33  * Signature: (I)I
  34  */
  35 JNIEXPORT jint JNICALL
  36 Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetXThickness(
  37     JNIEnv *env, jclass klass, jint widget_type)
  38 {
  39     return gtk2_get_xthickness(env, widget_type);
  40 }
  41 
  42 /*
  43  * Class:     com_sun_java_swing_plaf_gtk_GTKStyle
  44  * Method:    nativeGetYThickness
  45  * Signature: (I)I
  46  */
  47 JNIEXPORT jint JNICALL
  48 Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetYThickness(
  49     JNIEnv *env, jclass klass, jint widget_type)
  50 {
  51     return gtk2_get_ythickness(env, widget_type);
  52 }
  53 
  54 /*
  55  * Class:     com_sun_java_swing_plaf_gtk_GTKStyle
  56  * Method:    nativeGetColorForState
  57  * Signature: (III)I
  58  */
  59 JNIEXPORT jint JNICALL
  60 Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetColorForState(
  61     JNIEnv *env, jclass klass, jint widget_type,
  62     jint state_type, jint type_id)
  63 {
  64     return gtk2_get_color_for_state(env, widget_type, state_type, type_id);
  65 }
  66 
  67 /*
  68  * Class:     com_sun_java_swing_plaf_gtk_GTKStyle
  69  * Method:    nativeGetClassValue
  70  * Signature: (ILjava/lang/String;)Ljava/lang/Object;
  71  */
  72 JNIEXPORT jobject JNICALL
  73 Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetClassValue(
  74     JNIEnv *env, jclass klass, jint widget_type, jstring key)
  75 {
  76     return gtk2_get_class_value(env, widget_type, key);
  77 }
  78 
  79 /*
  80  * Class:     com_sun_java_swing_plaf_gtk_GTKStyle
  81  * Method:    nativeGetPangoFontName
  82  * Signature: (I)Ljava/lang/String;
  83  */
  84 JNIEXPORT jstring JNICALL
  85 Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetPangoFontName(
  86     JNIEnv *env, jclass klass, jint widget_type)
  87 {
  88     return gtk2_get_pango_font_name(env, widget_type);
  89 }