Mercurial > hg > release > icedtea7-forest-2.0 > jdk
changeset 4537:8008e5233d16
House all dynamic dependencies in the same common location
author | andrew |
---|---|
date | Wed, 24 Aug 2011 04:53:54 +0100 |
parents | 0c4ae84c071e |
children | 3cb9c8dc1cdc |
files | make/java/net/Makefile make/java/nio/Makefile make/sun/awt/mawt.gmk make/sun/xawt/Makefile src/solaris/native/common/deps/cups_fp.c src/solaris/native/common/deps/cups_fp.h src/solaris/native/common/deps/fontconfig/fontconfig.h src/solaris/native/common/deps/fontconfig2/fontconfig/fontconfig.h src/solaris/native/common/deps/fontconfig2/fontconfig_fp.c src/solaris/native/common/deps/fontconfig2/fontconfig_fp.h src/solaris/native/common/deps/fontconfig_fp.c src/solaris/native/common/deps/fontconfig_fp.h src/solaris/native/common/deps/gconf2/gconf/gconf-client.h src/solaris/native/common/deps/gconf2/gconf_fp.c src/solaris/native/common/deps/gconf2/gconf_fp.h src/solaris/native/common/deps/glib2/gio/gio.h src/solaris/native/common/deps/glib2/gio_fp.c src/solaris/native/common/deps/glib2/gio_fp.h src/solaris/native/common/deps/gtk2/gtk/gtk.h src/solaris/native/common/deps/gtk2/gtk_fp.c src/solaris/native/common/deps/gtk2/gtk_fp.h src/solaris/native/sun/awt/cups_fp.c src/solaris/native/sun/awt/cups_fp.h src/solaris/native/sun/awt/gtk2/gtk/gtk.h src/solaris/native/sun/awt/gtk2/gtk_fp.c src/solaris/native/sun/awt/gtk2/gtk_fp.h src/solaris/native/sun/net/spi/gconf2/gconf/gconf-client.h src/solaris/native/sun/net/spi/gconf2/gconf_fp.c src/solaris/native/sun/net/spi/gconf2/gconf_fp.h src/solaris/native/sun/nio/fs/glib2/gio/gio.h src/solaris/native/sun/nio/fs/glib2/gio_fp.c src/solaris/native/sun/nio/fs/glib2/gio_fp.h |
diffstat | 32 files changed, 2572 insertions(+), 2564 deletions(-) [+] |
line wrap: on
line diff
--- a/make/java/net/Makefile Wed Aug 24 03:39:33 2011 +0100 +++ b/make/java/net/Makefile Wed Aug 24 04:53:54 2011 +0100 @@ -85,7 +85,7 @@ $(PLATFORM_SRC)/native/sun/net/sdp $(PLATFORM_SRC)/native/sun/net/spi ifndef USE_SYSTEM_GCONF - vpath %.c $(PLATFORM_SRC)/native/sun/net/spi/gconf2 + vpath %.c $(PLATFORM_SRC)/native/common/deps/gconf2 endif # @@ -110,7 +110,7 @@ OTHER_LDLIBS += $(GCONF_LIBS) $(GOBJECT_LIBS) CPPFLAGS += $(GCONF_CFLAGS) $(GOBJECT_CFLAGS) -DUSE_SYSTEM_GCONF else - CPPFLAGS += -I$(PLATFORM_SRC)/native/sun/net/spi/gconf2 + CPPFLAGS += -I$(PLATFORM_SRC)/native/common/deps/gconf2 endif CLASSES.export += java.lang.Integer java.io.FileDescriptor java.net.InetAddressImplFactory java.net.Inet4AddressImpl java.net.Inet6AddressImpl
--- a/make/java/nio/Makefile Wed Aug 24 03:39:33 2011 +0100 +++ b/make/java/nio/Makefile Wed Aug 24 04:53:54 2011 +0100 @@ -273,7 +273,7 @@ vpath %.c $(SHARE_SRC)/native/sun/nio/ch ifndef USE_SYSTEM_GIO - vpath %.c $(PLATFORM_SRC)/native/sun/nio/fs/glib2 + vpath %.c $(PLATFORM_SRC)/native/common/deps/glib2 endif # @@ -307,7 +307,7 @@ OTHER_LDLIBS += $(GIO_LIBS) OTHER_INCLUDES += $(GIO_CFLAGS) -DUSE_SYSTEM_GIO else - OTHER_INCLUDES += -I$(PLATFORM_SRC)/native/sun/nio/fs/glib2 + OTHER_INCLUDES += -I$(PLATFORM_SRC)/native/common/deps/glib2 endif endif
--- a/make/sun/awt/mawt.gmk Wed Aug 24 03:39:33 2011 +0100 +++ b/make/sun/awt/mawt.gmk Wed Aug 24 04:53:54 2011 +0100 @@ -104,7 +104,7 @@ vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/robot_child ifndef USE_SYSTEM_FONTCONFIG -vpath %.c $(PLATFORM_SRC)/native/common/deps +vpath %.c $(PLATFORM_SRC)/native/common/deps/fontconfig2 endif # @@ -210,12 +210,14 @@ ifdef USE_SYSTEM_CUPS CPPFLAGS += -DUSE_SYSTEM_CUPS LDFLAGS += $(CUPS_LIBS) +else + CPPFLAGS += -I$(PLATFORM_SRC)/native/common/deps endif ifdef USE_SYSTEM_FONTCONFIG CPPFLAGS += $(FONTCONFIG_CFLAGS) -DUSE_SYSTEM_FONTCONFIG else - CPPFLAGS += -I$(PLATFORM_SRC)/native/common/deps + CPPFLAGS += -I$(PLATFORM_SRC)/native/common/deps/fontconfig2 endif ifndef HEADLESS
--- a/make/sun/xawt/Makefile Wed Aug 24 03:39:33 2011 +0100 +++ b/make/sun/xawt/Makefile Wed Aug 24 04:53:54 2011 +0100 @@ -93,11 +93,15 @@ vpath %.c $(PLATFORM_SRC)/native/sun/java2d/x11 ifndef USE_SYSTEM_GTK -vpath %.c $(PLATFORM_SRC)/native/sun/awt/gtk2 +vpath %.c $(PLATFORM_SRC)/native/common/deps/gtk2 +endif + +ifndef USE_SYSTEM_CUPS +vpath %.c $(PLATFORM_SRC)/native/common/deps endif ifndef USE_SYSTEM_FONTCONFIG -vpath %.c $(PLATFORM_SRC)/native/common/deps +vpath %.c $(PLATFORM_SRC)/native/common/deps/fontconfig2 endif OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender -ldl \ @@ -155,17 +159,19 @@ ifdef USE_SYSTEM_GTK CPPFLAGS += $(GTK_CFLAGS) -DUSE_SYSTEM_GTK else - CPPFLAGS += -I$(PLATFORM_SRC)/native/sun/awt/gtk2 + CPPFLAGS += -I$(PLATFORM_SRC)/native/common/deps/gtk2 endif ifdef USE_SYSTEM_CUPS CPPFLAGS += -DUSE_SYSTEM_CUPS +else + CPPFLAGS += -I$(PLATFORM_SRC)/native/common/deps endif ifdef USE_SYSTEM_FONTCONFIG CPPFLAGS += $(FONTCONFIG_CFLAGS) -DUSE_SYSTEM_FONTCONFIG else - CPPFLAGS += -I$(PLATFORM_SRC)/native/common/deps + CPPFLAGS += -I$(PLATFORM_SRC)/native/common/deps/fontconfig2 endif ifeq ($(PLATFORM), linux)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/cups_fp.c Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include <dlfcn.h> +#include <jni.h> + +#include <cups/cups.h> +#include <cups/ppd.h> + +#include <cups_fp.h> + +jboolean cups_init() +{ + void *handle = dlopen("libcups.so.2", RTLD_LAZY | RTLD_GLOBAL); + + if (handle == NULL) { + handle = dlopen("libcups.so", RTLD_LAZY | RTLD_GLOBAL); + if (handle == NULL) { + return JNI_FALSE; + } + } + + j2d_cupsServer = (fn_cupsServer)dlsym(handle, "cupsServer"); + if (j2d_cupsServer == NULL) { + dlclose(handle); + return JNI_FALSE; + } + + j2d_ippPort = (fn_ippPort)dlsym(handle, "ippPort"); + if (j2d_ippPort == NULL) { + dlclose(handle); + return JNI_FALSE; + } + + j2d_httpConnect = (fn_httpConnect)dlsym(handle, "httpConnect"); + if (j2d_httpConnect == NULL) { + dlclose(handle); + return JNI_FALSE; + } + + j2d_httpClose = (fn_httpClose)dlsym(handle, "httpClose"); + if (j2d_httpClose == NULL) { + dlclose(handle); + return JNI_FALSE; + } + + j2d_cupsGetPPD = (fn_cupsGetPPD)dlsym(handle, "cupsGetPPD"); + if (j2d_cupsGetPPD == NULL) { + dlclose(handle); + return JNI_FALSE; + } + + j2d_ppdOpenFile = (fn_ppdOpenFile)dlsym(handle, "ppdOpenFile"); + if (j2d_ppdOpenFile == NULL) { + dlclose(handle); + return JNI_FALSE; + + } + + j2d_ppdClose = (fn_ppdClose)dlsym(handle, "ppdClose"); + if (j2d_ppdClose == NULL) { + dlclose(handle); + return JNI_FALSE; + + } + + j2d_ppdFindOption = (fn_ppdFindOption)dlsym(handle, "ppdFindOption"); + if (j2d_ppdFindOption == NULL) { + dlclose(handle); + return JNI_FALSE; + } + + j2d_ppdPageSize = (fn_ppdPageSize)dlsym(handle, "ppdPageSize"); + if (j2d_ppdPageSize == NULL) { + dlclose(handle); + return JNI_FALSE; + } + + return JNI_TRUE; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/cups_fp.h Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef __CUPS_FP_H__ +#define __CUPS_FP_H__ + +typedef const char* (*fn_cupsServer)(void); +typedef int (*fn_ippPort)(void); +typedef http_t* (*fn_httpConnect)(const char *, int); +typedef void (*fn_httpClose)(http_t *); +typedef char* (*fn_cupsGetPPD)(const char *); +typedef ppd_file_t* (*fn_ppdOpenFile)(const char *); +typedef void (*fn_ppdClose)(ppd_file_t *); +typedef ppd_option_t* (*fn_ppdFindOption)(ppd_file_t *, const char *); +typedef ppd_size_t* (*fn_ppdPageSize)(ppd_file_t *, char *); + +fn_cupsServer j2d_cupsServer; +fn_ippPort j2d_ippPort; +fn_httpConnect j2d_httpConnect; +fn_httpClose j2d_httpClose; +fn_cupsGetPPD j2d_cupsGetPPD; +fn_ppdOpenFile j2d_ppdOpenFile; +fn_ppdClose j2d_ppdClose; +fn_ppdFindOption j2d_ppdFindOption; +fn_ppdPageSize j2d_ppdPageSize; + +#define cupsServer (*j2d_cupsServer) +#define ippPort (*j2d_ippPort) +#define httpConnect (*j2d_httpConnect) +#define httpClose (*j2d_httpClose) +#define cupsGetPPD (*j2d_cupsGetPPD) +#define ppdOpenFile (*j2d_ppdOpenFile) +#define ppdClose (*j2d_ppdClose) +#define ppdFindOption (*j2d_ppdFindOption) +#define ppdPageSize (*j2d_ppdPageSize) + +jboolean cups_init(); + +#endif
--- a/src/solaris/native/common/deps/fontconfig/fontconfig.h Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,302 +0,0 @@ -/* - * $RCSId: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.30 2002/09/26 00:17:27 keithp Exp $ - * - * Copyright © 2001 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _FONTCONFIG_H_ -#define _FONTCONFIG_H_ - -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <stdarg.h> - -#if defined(__GNUC__) && (__GNUC__ >= 4) -#define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0))) -#else -#define FC_ATTRIBUTE_SENTINEL(x) -#endif - -#ifndef FcPublic -#define FcPublic -#endif - -typedef unsigned char FcChar8; -typedef unsigned short FcChar16; -typedef unsigned int FcChar32; -typedef int FcBool; - -/* - * Current Fontconfig version number. This same number - * must appear in the fontconfig configure.in file. Yes, - * it'a a pain to synchronize version numbers like this. - */ - -#define FC_MAJOR 2 -#define FC_MINOR 5 -#define FC_REVISION 0 - -#define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION)) - -/* - * Current font cache file format version - * This is appended to the cache files so that multiple - * versions of the library will peacefully coexist - * - * Change this value whenever the disk format for the cache file - * changes in any non-compatible way. Try to avoid such changes as - * it means multiple copies of the font information. - */ - -#define FC_CACHE_VERSION "2" - -#define FcTrue 1 -#define FcFalse 0 - -#define FC_FAMILY "family" /* String */ -#define FC_STYLE "style" /* String */ -#define FC_SLANT "slant" /* Int */ -#define FC_WEIGHT "weight" /* Int */ -#define FC_SIZE "size" /* Double */ -#define FC_ASPECT "aspect" /* Double */ -#define FC_PIXEL_SIZE "pixelsize" /* Double */ -#define FC_SPACING "spacing" /* Int */ -#define FC_FOUNDRY "foundry" /* String */ -#define FC_ANTIALIAS "antialias" /* Bool (depends) */ -#define FC_HINTING "hinting" /* Bool (true) */ -#define FC_HINT_STYLE "hintstyle" /* Int */ -#define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */ -#define FC_AUTOHINT "autohint" /* Bool (false) */ -#define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */ -#define FC_WIDTH "width" /* Int */ -#define FC_FILE "file" /* String */ -#define FC_INDEX "index" /* Int */ -#define FC_FT_FACE "ftface" /* FT_Face */ -#define FC_RASTERIZER "rasterizer" /* String */ -#define FC_OUTLINE "outline" /* Bool */ -#define FC_SCALABLE "scalable" /* Bool */ -#define FC_SCALE "scale" /* double */ -#define FC_DPI "dpi" /* double */ -#define FC_RGBA "rgba" /* Int */ -#define FC_MINSPACE "minspace" /* Bool use minimum line spacing */ -#define FC_SOURCE "source" /* String (deprecated) */ -#define FC_CHARSET "charset" /* CharSet */ -#define FC_LANG "lang" /* String RFC 3066 langs */ -#define FC_FONTVERSION "fontversion" /* Int from 'head' table */ -#define FC_FULLNAME "fullname" /* String */ -#define FC_FAMILYLANG "familylang" /* String RFC 3066 langs */ -#define FC_STYLELANG "stylelang" /* String RFC 3066 langs */ -#define FC_FULLNAMELANG "fullnamelang" /* String RFC 3066 langs */ -#define FC_CAPABILITY "capability" /* String */ -#define FC_FONTFORMAT "fontformat" /* String */ -#define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/ -#define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */ -#define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */ - -#define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION -#define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION -#define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION - -/* Adjust outline rasterizer */ -#define FC_CHAR_WIDTH "charwidth" /* Int */ -#define FC_CHAR_HEIGHT "charheight"/* Int */ -#define FC_MATRIX "matrix" /* FcMatrix */ - -#define FC_WEIGHT_THIN 0 -#define FC_WEIGHT_EXTRALIGHT 40 -#define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT -#define FC_WEIGHT_LIGHT 50 -#define FC_WEIGHT_BOOK 75 -#define FC_WEIGHT_REGULAR 80 -#define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR -#define FC_WEIGHT_MEDIUM 100 -#define FC_WEIGHT_DEMIBOLD 180 -#define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD -#define FC_WEIGHT_BOLD 200 -#define FC_WEIGHT_EXTRABOLD 205 -#define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD -#define FC_WEIGHT_BLACK 210 -#define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK -#define FC_WEIGHT_EXTRABLACK 215 -#define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK - -#define FC_SLANT_ROMAN 0 -#define FC_SLANT_ITALIC 100 -#define FC_SLANT_OBLIQUE 110 - -#define FC_WIDTH_ULTRACONDENSED 50 -#define FC_WIDTH_EXTRACONDENSED 63 -#define FC_WIDTH_CONDENSED 75 -#define FC_WIDTH_SEMICONDENSED 87 -#define FC_WIDTH_NORMAL 100 -#define FC_WIDTH_SEMIEXPANDED 113 -#define FC_WIDTH_EXPANDED 125 -#define FC_WIDTH_EXTRAEXPANDED 150 -#define FC_WIDTH_ULTRAEXPANDED 200 - -#define FC_PROPORTIONAL 0 -#define FC_DUAL 90 -#define FC_MONO 100 -#define FC_CHARCELL 110 - -/* sub-pixel order */ -#define FC_RGBA_UNKNOWN 0 -#define FC_RGBA_RGB 1 -#define FC_RGBA_BGR 2 -#define FC_RGBA_VRGB 3 -#define FC_RGBA_VBGR 4 -#define FC_RGBA_NONE 5 - -/* hinting style */ -#define FC_HINT_NONE 0 -#define FC_HINT_SLIGHT 1 -#define FC_HINT_MEDIUM 2 -#define FC_HINT_FULL 3 - -typedef enum _FcType { - FcTypeVoid, - FcTypeInteger, - FcTypeDouble, - FcTypeString, - FcTypeBool, - FcTypeMatrix, - FcTypeCharSet, - FcTypeFTFace, - FcTypeLangSet -} FcType; - -typedef struct _FcMatrix { - double xx, xy, yx, yy; -} FcMatrix; - -#define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \ - (m)->xy = (m)->yx = 0) - -/* - * A data structure to represent the available glyphs in a font. - * This is represented as a sparse boolean btree. - */ - -typedef struct _FcCharSet FcCharSet; - -typedef struct _FcObjectType { - const char *object; - FcType type; -} FcObjectType; - -typedef struct _FcConstant { - const FcChar8 *name; - const char *object; - int value; -} FcConstant; - -typedef enum _FcResult { - FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId, - FcResultOutOfMemory -} FcResult; - -typedef struct _FcPattern FcPattern; - -typedef struct _FcLangSet FcLangSet; - -typedef struct _FcValue { - FcType type; - union { - const FcChar8 *s; - int i; - FcBool b; - double d; - const FcMatrix *m; - const FcCharSet *c; - void *f; - const FcLangSet *l; - } u; -} FcValue; - -typedef struct _FcFontSet { - int nfont; - int sfont; - FcPattern **fonts; -} FcFontSet; - -typedef struct _FcObjectSet { - int nobject; - int sobject; - const char **objects; -} FcObjectSet; - -typedef enum _FcMatchKind { - FcMatchPattern, FcMatchFont, FcMatchScan -} FcMatchKind; - -typedef enum _FcLangResult { - FcLangEqual = 0, - FcLangDifferentCountry = 1, - FcLangDifferentTerritory = 1, - FcLangDifferentLang = 2 -} FcLangResult; - -typedef enum _FcSetName { - FcSetSystem = 0, - FcSetApplication = 1 -} FcSetName; - -typedef struct _FcAtomic FcAtomic; - -#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */ -#define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */ -#define _FCFUNCPROTOEND } -#else -#define _FCFUNCPROTOBEGIN -#define _FCFUNCPROTOEND -#endif - -typedef enum { FcEndianBig, FcEndianLittle } FcEndian; - -typedef struct _FcConfig FcConfig; - -typedef struct _FcGlobalCache FcFileCache; - -typedef struct _FcBlanks FcBlanks; - -typedef struct _FcStrList FcStrList; - -typedef struct _FcStrSet FcStrSet; - -typedef struct _FcCache FcCache; - -#undef FC_ATTRIBUTE_SENTINEL - - -#ifndef _FCINT_H_ - -/* - * Deprecated functions are placed here to help users fix their code without - * digging through documentation - */ - -#define FcConfigGetRescanInverval FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval -#define FcConfigSetRescanInverval FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval - -#endif - -#endif /* _FONTCONFIG_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/fontconfig2/fontconfig/fontconfig.h Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,302 @@ +/* + * $RCSId: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.30 2002/09/26 00:17:27 keithp Exp $ + * + * Copyright © 2001 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _FONTCONFIG_H_ +#define _FONTCONFIG_H_ + +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> +#include <stdarg.h> + +#if defined(__GNUC__) && (__GNUC__ >= 4) +#define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0))) +#else +#define FC_ATTRIBUTE_SENTINEL(x) +#endif + +#ifndef FcPublic +#define FcPublic +#endif + +typedef unsigned char FcChar8; +typedef unsigned short FcChar16; +typedef unsigned int FcChar32; +typedef int FcBool; + +/* + * Current Fontconfig version number. This same number + * must appear in the fontconfig configure.in file. Yes, + * it'a a pain to synchronize version numbers like this. + */ + +#define FC_MAJOR 2 +#define FC_MINOR 5 +#define FC_REVISION 0 + +#define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION)) + +/* + * Current font cache file format version + * This is appended to the cache files so that multiple + * versions of the library will peacefully coexist + * + * Change this value whenever the disk format for the cache file + * changes in any non-compatible way. Try to avoid such changes as + * it means multiple copies of the font information. + */ + +#define FC_CACHE_VERSION "2" + +#define FcTrue 1 +#define FcFalse 0 + +#define FC_FAMILY "family" /* String */ +#define FC_STYLE "style" /* String */ +#define FC_SLANT "slant" /* Int */ +#define FC_WEIGHT "weight" /* Int */ +#define FC_SIZE "size" /* Double */ +#define FC_ASPECT "aspect" /* Double */ +#define FC_PIXEL_SIZE "pixelsize" /* Double */ +#define FC_SPACING "spacing" /* Int */ +#define FC_FOUNDRY "foundry" /* String */ +#define FC_ANTIALIAS "antialias" /* Bool (depends) */ +#define FC_HINTING "hinting" /* Bool (true) */ +#define FC_HINT_STYLE "hintstyle" /* Int */ +#define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */ +#define FC_AUTOHINT "autohint" /* Bool (false) */ +#define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */ +#define FC_WIDTH "width" /* Int */ +#define FC_FILE "file" /* String */ +#define FC_INDEX "index" /* Int */ +#define FC_FT_FACE "ftface" /* FT_Face */ +#define FC_RASTERIZER "rasterizer" /* String */ +#define FC_OUTLINE "outline" /* Bool */ +#define FC_SCALABLE "scalable" /* Bool */ +#define FC_SCALE "scale" /* double */ +#define FC_DPI "dpi" /* double */ +#define FC_RGBA "rgba" /* Int */ +#define FC_MINSPACE "minspace" /* Bool use minimum line spacing */ +#define FC_SOURCE "source" /* String (deprecated) */ +#define FC_CHARSET "charset" /* CharSet */ +#define FC_LANG "lang" /* String RFC 3066 langs */ +#define FC_FONTVERSION "fontversion" /* Int from 'head' table */ +#define FC_FULLNAME "fullname" /* String */ +#define FC_FAMILYLANG "familylang" /* String RFC 3066 langs */ +#define FC_STYLELANG "stylelang" /* String RFC 3066 langs */ +#define FC_FULLNAMELANG "fullnamelang" /* String RFC 3066 langs */ +#define FC_CAPABILITY "capability" /* String */ +#define FC_FONTFORMAT "fontformat" /* String */ +#define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/ +#define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */ +#define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */ + +#define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION +#define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION +#define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION + +/* Adjust outline rasterizer */ +#define FC_CHAR_WIDTH "charwidth" /* Int */ +#define FC_CHAR_HEIGHT "charheight"/* Int */ +#define FC_MATRIX "matrix" /* FcMatrix */ + +#define FC_WEIGHT_THIN 0 +#define FC_WEIGHT_EXTRALIGHT 40 +#define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT +#define FC_WEIGHT_LIGHT 50 +#define FC_WEIGHT_BOOK 75 +#define FC_WEIGHT_REGULAR 80 +#define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR +#define FC_WEIGHT_MEDIUM 100 +#define FC_WEIGHT_DEMIBOLD 180 +#define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD +#define FC_WEIGHT_BOLD 200 +#define FC_WEIGHT_EXTRABOLD 205 +#define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD +#define FC_WEIGHT_BLACK 210 +#define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK +#define FC_WEIGHT_EXTRABLACK 215 +#define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK + +#define FC_SLANT_ROMAN 0 +#define FC_SLANT_ITALIC 100 +#define FC_SLANT_OBLIQUE 110 + +#define FC_WIDTH_ULTRACONDENSED 50 +#define FC_WIDTH_EXTRACONDENSED 63 +#define FC_WIDTH_CONDENSED 75 +#define FC_WIDTH_SEMICONDENSED 87 +#define FC_WIDTH_NORMAL 100 +#define FC_WIDTH_SEMIEXPANDED 113 +#define FC_WIDTH_EXPANDED 125 +#define FC_WIDTH_EXTRAEXPANDED 150 +#define FC_WIDTH_ULTRAEXPANDED 200 + +#define FC_PROPORTIONAL 0 +#define FC_DUAL 90 +#define FC_MONO 100 +#define FC_CHARCELL 110 + +/* sub-pixel order */ +#define FC_RGBA_UNKNOWN 0 +#define FC_RGBA_RGB 1 +#define FC_RGBA_BGR 2 +#define FC_RGBA_VRGB 3 +#define FC_RGBA_VBGR 4 +#define FC_RGBA_NONE 5 + +/* hinting style */ +#define FC_HINT_NONE 0 +#define FC_HINT_SLIGHT 1 +#define FC_HINT_MEDIUM 2 +#define FC_HINT_FULL 3 + +typedef enum _FcType { + FcTypeVoid, + FcTypeInteger, + FcTypeDouble, + FcTypeString, + FcTypeBool, + FcTypeMatrix, + FcTypeCharSet, + FcTypeFTFace, + FcTypeLangSet +} FcType; + +typedef struct _FcMatrix { + double xx, xy, yx, yy; +} FcMatrix; + +#define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \ + (m)->xy = (m)->yx = 0) + +/* + * A data structure to represent the available glyphs in a font. + * This is represented as a sparse boolean btree. + */ + +typedef struct _FcCharSet FcCharSet; + +typedef struct _FcObjectType { + const char *object; + FcType type; +} FcObjectType; + +typedef struct _FcConstant { + const FcChar8 *name; + const char *object; + int value; +} FcConstant; + +typedef enum _FcResult { + FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId, + FcResultOutOfMemory +} FcResult; + +typedef struct _FcPattern FcPattern; + +typedef struct _FcLangSet FcLangSet; + +typedef struct _FcValue { + FcType type; + union { + const FcChar8 *s; + int i; + FcBool b; + double d; + const FcMatrix *m; + const FcCharSet *c; + void *f; + const FcLangSet *l; + } u; +} FcValue; + +typedef struct _FcFontSet { + int nfont; + int sfont; + FcPattern **fonts; +} FcFontSet; + +typedef struct _FcObjectSet { + int nobject; + int sobject; + const char **objects; +} FcObjectSet; + +typedef enum _FcMatchKind { + FcMatchPattern, FcMatchFont, FcMatchScan +} FcMatchKind; + +typedef enum _FcLangResult { + FcLangEqual = 0, + FcLangDifferentCountry = 1, + FcLangDifferentTerritory = 1, + FcLangDifferentLang = 2 +} FcLangResult; + +typedef enum _FcSetName { + FcSetSystem = 0, + FcSetApplication = 1 +} FcSetName; + +typedef struct _FcAtomic FcAtomic; + +#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */ +#define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */ +#define _FCFUNCPROTOEND } +#else +#define _FCFUNCPROTOBEGIN +#define _FCFUNCPROTOEND +#endif + +typedef enum { FcEndianBig, FcEndianLittle } FcEndian; + +typedef struct _FcConfig FcConfig; + +typedef struct _FcGlobalCache FcFileCache; + +typedef struct _FcBlanks FcBlanks; + +typedef struct _FcStrList FcStrList; + +typedef struct _FcStrSet FcStrSet; + +typedef struct _FcCache FcCache; + +#undef FC_ATTRIBUTE_SENTINEL + + +#ifndef _FCINT_H_ + +/* + * Deprecated functions are placed here to help users fix their code without + * digging through documentation + */ + +#define FcConfigGetRescanInverval FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval +#define FcConfigSetRescanInverval FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval + +#endif + +#endif /* _FONTCONFIG_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/fontconfig2/fontconfig_fp.c Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,188 @@ +/* + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include <fontconfig_fp.h> + +#include <stdlib.h> +#include <string.h> + +void* dlOpenFontConfig() { + + char *homeEnv; + static char *homeEnvStr = "HOME="; /* must be static */ + void* libfontconfig = NULL; +#ifdef __solaris__ +#define SYSINFOBUFSZ 8 + char sysinfobuf[SYSINFOBUFSZ]; +#endif + + /* Private workaround to not use fontconfig library. + * May be useful during testing/debugging + */ + char *useFC = getenv("USE_J2D_FONTCONFIG"); + if (useFC != NULL && !strcmp(useFC, "no")) { + return NULL; + } + +#ifdef __solaris__ + /* fontconfig is likely not properly configured on S8/S9 - skip it, + * although allow user to override this behaviour with an env. variable + * ie if USE_J2D_FONTCONFIG=yes then we skip this test. + * NB "4" is the length of a string which matches our patterns. + */ + if (useFC == NULL || strcmp(useFC, "yes")) { + if (sysinfo(SI_RELEASE, sysinfobuf, SYSINFOBUFSZ) == 4) { + if ((!strcmp(sysinfobuf, "5.8") || !strcmp(sysinfobuf, "5.9"))) { + return NULL; + } + } + } +#endif + /* 64 bit sparc should pick up the right version from the lib path. + * New features may be added to libfontconfig, this is expected to + * be compatible with old features, but we may need to start + * distinguishing the library version, to know whether to expect + * certain symbols - and functionality - to be available. + * Also add explicit search for .so.1 in case .so symlink doesn't exist. + */ + libfontconfig = dlopen("libfontconfig.so.1", RTLD_LOCAL|RTLD_LAZY); + if (libfontconfig == NULL) { + libfontconfig = dlopen("libfontconfig.so", RTLD_LOCAL|RTLD_LAZY); + if (libfontconfig == NULL) { + return NULL; + } + } + + /* Version 1.0 of libfontconfig crashes if HOME isn't defined in + * the environment. This should generally never happen, but we can't + * control it, and can't control the version of fontconfig, so iff + * its not defined we set it to an empty value which is sufficient + * to prevent a crash. I considered unsetting it before exit, but + * it doesn't appear to work on Solaris, so I will leave it set. + */ + homeEnv = getenv("HOME"); + if (homeEnv == NULL) { + putenv(homeEnvStr); + } + + if (libfontconfig == NULL) { + return NULL; + } + + PatternBuild = + (FcPatternBuildFuncType)dlsym(libfontconfig, "FcPatternBuild"); + ObjectSetBuild = + (FcObjectSetFuncType)dlsym(libfontconfig, "FcObjectSetBuild"); + FontList = + (FcFontListFuncType)dlsym(libfontconfig, "FcFontList"); + PatternGetString = + (FcPatternGetStringFuncType)dlsym(libfontconfig, "FcPatternGetString"); + StrDirname = + (FcStrDirnameFuncType)dlsym(libfontconfig, "FcStrDirname"); + PatternDestroy = + (FcPatternDestroyFuncType)dlsym(libfontconfig, "FcPatternDestroy"); + FontSetDestroy = + (FcFontSetDestroyFuncType)dlsym(libfontconfig, "FcFontSetDestroy"); +#if 0 + Fini = + (FcFiniFuncType)dlsym(libfontconfig, "FcFini"); +#endif + NameParse = (FcNameParseFuncType)dlsym(libfontconfig, "FcNameParse"); + PatternAddString = + (FcPatternAddStringFuncType)dlsym(libfontconfig, "FcPatternAddString"); + ConfigSubstitute = + (FcConfigSubstituteFuncType)dlsym(libfontconfig, "FcConfigSubstitute"); + DefaultSubstitute = (FcDefaultSubstituteFuncType) + dlsym(libfontconfig, "FcDefaultSubstitute"); + FontMatch = (FcFontMatchFuncType)dlsym(libfontconfig, "FcFontMatch"); + PatternGetBool = (FcPatternGetBoolFuncType) + dlsym(libfontconfig, "FcPatternGetBool"); + PatternGetInteger = (FcPatternGetIntegerFuncType) + dlsym(libfontconfig, "FcPatternGetInteger"); + PatternDestroy = + (FcPatternDestroyFuncType)dlsym(libfontconfig, "FcPatternDestroy"); + GetVersion = (FcGetVersionFuncType)dlsym(libfontconfig, "FcGetVersion"); + PatternGetCharSet = + (FcPatternGetCharSetFuncType)dlsym(libfontconfig, + "FcPatternGetCharSet"); + FontSort = + (FcFontSortFuncType)dlsym(libfontconfig, "FcFontSort"); + FontSetDestroy = + (FcFontSetDestroyFuncType)dlsym(libfontconfig, "FcFontSetDestroy"); + CharSetUnion = + (FcCharSetUnionFuncType)dlsym(libfontconfig, "FcCharSetUnion"); + CharSetSubtractCount = + (FcCharSetSubtractCountFuncType)dlsym(libfontconfig, + "FcCharSetSubtractCount"); + + if (PatternBuild == NULL || + ObjectSetBuild == NULL || + PatternGetString == NULL || + FontList == NULL || + StrDirname == NULL || + PatternDestroy == NULL || + FontSetDestroy == NULL || + NameParse == NULL || + PatternAddString == NULL || + ConfigSubstitute == NULL || + DefaultSubstitute == NULL || + FontMatch == NULL || + PatternGetBool == NULL || + PatternGetInteger == NULL || + PatternDestroy == NULL || + GetVersion == NULL || + PatternGetCharSet == NULL || + CharSetUnion == NULL || + GetVersion == NULL || + CharSetSubtractCount == NULL) {/* problem with the library: return.*/ + dlCloseFontConfig (libfontconfig); + return NULL; + } + + /* Optionally get the cache dir locations. This isn't + * available until v 2.4.x, but this is OK since on those later versions + * we can check the time stamps on the cache dirs to see if we + * are out of date. There are a couple of assumptions here. First + * that the time stamp on the directory changes when the contents are + * updated. Secondly that the locations don't change. The latter is + * most likely if a new version of fontconfig is installed, but we also + * invalidate the cache if we detect that. Arguably even that is "rare", + * and most likely is tied to an OS upgrade which gets a new file anyway. + */ + ConfigGetCacheDirs = + (FcConfigGetCacheDirsFuncType)dlsym(libfontconfig, + "FcConfigGetCacheDirs"); + StrListNext = + (FcStrListNextFuncType)dlsym(libfontconfig, "FcStrListNext"); + StrListDone = + (FcStrListDoneFuncType)dlsym(libfontconfig, "FcStrListDone"); + + return libfontconfig; +} + +void dlCloseFontConfig(void* libfontconfig) +{ + dlclose(libfontconfig); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/fontconfig2/fontconfig_fp.h Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,146 @@ +/* + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef __FONTCONFIG_FP_H__ +#define __FONTCONFIG_FP_H__ + +#include <dlfcn.h> +#ifndef __linux__ /* i.e. is solaris */ +#include <link.h> +#endif + +#include <fontconfig/fontconfig.h> + +void* dlOpenFontConfig(); +void dlCloseFontConfig(void *libfontconfig); + +typedef void* (FcFiniFuncType)(); +typedef FcConfig* (*FcInitLoadConfigFuncType)(); +typedef FcPattern* (*FcPatternBuildFuncType)(FcPattern *orig, ...); +typedef FcObjectSet* (*FcObjectSetFuncType)(const char *first, ...); +typedef FcFontSet* (*FcFontListFuncType)(FcConfig *config, + FcPattern *p, + FcObjectSet *os); +typedef FcResult (*FcPatternGetBoolFuncType)(const FcPattern *p, + const char *object, + int n, + FcBool *b); +typedef FcResult (*FcPatternGetIntegerFuncType)(const FcPattern *p, + const char *object, + int n, + int *i); +typedef FcResult (*FcPatternGetStringFuncType)(const FcPattern *p, + const char *object, + int n, + FcChar8 ** s); +typedef FcChar8* (*FcStrDirnameFuncType)(const FcChar8 *file); +typedef void (*FcPatternDestroyFuncType)(FcPattern *p); +typedef void (*FcFontSetDestroyFuncType)(FcFontSet *s); +typedef FcPattern* (*FcNameParseFuncType)(const FcChar8 *name); +typedef FcBool (*FcPatternAddStringFuncType)(FcPattern *p, + const char *object, + const FcChar8 *s); +typedef void (*FcDefaultSubstituteFuncType)(FcPattern *p); +typedef FcBool (*FcConfigSubstituteFuncType)(FcConfig *config, + FcPattern *p, + FcMatchKind kind); +typedef FcPattern* (*FcFontMatchFuncType)(FcConfig *config, + FcPattern *p, + FcResult *result); +typedef FcFontSet* (*FcFontSetCreateFuncType)(); +typedef FcBool (*FcFontSetAddFuncType)(FcFontSet *s, FcPattern *font); + +typedef FcResult (*FcPatternGetCharSetFuncType)(FcPattern *p, + const char *object, + int n, + FcCharSet **c); +typedef FcFontSet* (*FcFontSortFuncType)(FcConfig *config, + FcPattern *p, + FcBool trim, + FcCharSet **csp, + FcResult *result); +typedef FcCharSet* (*FcCharSetUnionFuncType)(const FcCharSet *a, + const FcCharSet *b); +typedef FcChar32 (*FcCharSetSubtractCountFuncType)(const FcCharSet *a, + const FcCharSet *b); + +typedef int (*FcGetVersionFuncType)(); + +typedef FcStrList* (*FcConfigGetCacheDirsFuncType)(FcConfig *config); +typedef FcChar8* (*FcStrListNextFuncType)(FcStrList *list); +typedef FcChar8* (*FcStrListDoneFuncType)(FcStrList *list); + +FcInitLoadConfigFuncType InitLoadConfig; +FcPatternBuildFuncType PatternBuild; +FcObjectSetFuncType ObjectSetBuild; +FcFontListFuncType FontList; +FcPatternGetStringFuncType PatternGetString; +FcStrDirnameFuncType StrDirname; +FcPatternDestroyFuncType PatternDestroy; +FcFontSetDestroyFuncType FontSetDestroy; +FcNameParseFuncType NameParse; +FcPatternAddStringFuncType PatternAddString; +FcConfigSubstituteFuncType ConfigSubstitute; +FcDefaultSubstituteFuncType DefaultSubstitute; +FcFontMatchFuncType FontMatch; +FcPatternGetBoolFuncType PatternGetBool; +FcPatternGetIntegerFuncType PatternGetInteger; +FcGetVersionFuncType GetVersion; +FcPatternGetCharSetFuncType PatternGetCharSet; +FcFontSortFuncType FontSort; +FcFontSetDestroyFuncType FontSetDestroy; +FcCharSetUnionFuncType CharSetUnion; +FcCharSetSubtractCountFuncType CharSetSubtractCount; +FcConfigGetCacheDirsFuncType ConfigGetCacheDirs; +FcStrListNextFuncType StrListNext; +FcStrListDoneFuncType StrListDone; +#if 0 +FcFiniFuncType Fini; +#endif + +#define FcPatternBuild (*PatternBuild) +#define FcObjectSetBuild (*ObjectSetBuild) +#define FcFontList (*FontList) +#define FcPatternGetString (*PatternGetString) +#define FcStrDirname (*StrDirname) +#define FcFontSetDestroy (*FontSetDestroy) +#define FcPatternDestroy (*PatternDestroy) +#define FcNameParse (*NameParse) +#define FcPatternAddString (*PatternAddString) +#define FcConfigSubstitute (*ConfigSubstitute) +#define FcDefaultSubstitute (*DefaultSubstitute) +#define FcFontMatch (*FontMatch) +#define FcPatternGetBool (*PatternGetBool) +#define FcPatternGetInteger (*PatternGetInteger) +#define FcGetVersion (*GetVersion) +#define FcStrListNext (*StrListNext) +#define FcStrListDone (*StrListDone) +#define FcConfigGetCacheDirs (*ConfigGetCacheDirs) +#define FcFontSort (*FontSort) +#define FcPatternGetCharSet (*PatternGetCharSet) +#define FcCharSetSubtractCount (*CharSetSubtractCount) +#define FcCharSetUnion (*CharSetUnion) + +#endif
--- a/src/solaris/native/common/deps/fontconfig_fp.c Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -/* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include <fontconfig_fp.h> - -#include <stdlib.h> -#include <string.h> - -void* dlOpenFontConfig() { - - char *homeEnv; - static char *homeEnvStr = "HOME="; /* must be static */ - void* libfontconfig = NULL; -#ifdef __solaris__ -#define SYSINFOBUFSZ 8 - char sysinfobuf[SYSINFOBUFSZ]; -#endif - - /* Private workaround to not use fontconfig library. - * May be useful during testing/debugging - */ - char *useFC = getenv("USE_J2D_FONTCONFIG"); - if (useFC != NULL && !strcmp(useFC, "no")) { - return NULL; - } - -#ifdef __solaris__ - /* fontconfig is likely not properly configured on S8/S9 - skip it, - * although allow user to override this behaviour with an env. variable - * ie if USE_J2D_FONTCONFIG=yes then we skip this test. - * NB "4" is the length of a string which matches our patterns. - */ - if (useFC == NULL || strcmp(useFC, "yes")) { - if (sysinfo(SI_RELEASE, sysinfobuf, SYSINFOBUFSZ) == 4) { - if ((!strcmp(sysinfobuf, "5.8") || !strcmp(sysinfobuf, "5.9"))) { - return NULL; - } - } - } -#endif - /* 64 bit sparc should pick up the right version from the lib path. - * New features may be added to libfontconfig, this is expected to - * be compatible with old features, but we may need to start - * distinguishing the library version, to know whether to expect - * certain symbols - and functionality - to be available. - * Also add explicit search for .so.1 in case .so symlink doesn't exist. - */ - libfontconfig = dlopen("libfontconfig.so.1", RTLD_LOCAL|RTLD_LAZY); - if (libfontconfig == NULL) { - libfontconfig = dlopen("libfontconfig.so", RTLD_LOCAL|RTLD_LAZY); - if (libfontconfig == NULL) { - return NULL; - } - } - - /* Version 1.0 of libfontconfig crashes if HOME isn't defined in - * the environment. This should generally never happen, but we can't - * control it, and can't control the version of fontconfig, so iff - * its not defined we set it to an empty value which is sufficient - * to prevent a crash. I considered unsetting it before exit, but - * it doesn't appear to work on Solaris, so I will leave it set. - */ - homeEnv = getenv("HOME"); - if (homeEnv == NULL) { - putenv(homeEnvStr); - } - - if (libfontconfig == NULL) { - return NULL; - } - - PatternBuild = - (FcPatternBuildFuncType)dlsym(libfontconfig, "FcPatternBuild"); - ObjectSetBuild = - (FcObjectSetFuncType)dlsym(libfontconfig, "FcObjectSetBuild"); - FontList = - (FcFontListFuncType)dlsym(libfontconfig, "FcFontList"); - PatternGetString = - (FcPatternGetStringFuncType)dlsym(libfontconfig, "FcPatternGetString"); - StrDirname = - (FcStrDirnameFuncType)dlsym(libfontconfig, "FcStrDirname"); - PatternDestroy = - (FcPatternDestroyFuncType)dlsym(libfontconfig, "FcPatternDestroy"); - FontSetDestroy = - (FcFontSetDestroyFuncType)dlsym(libfontconfig, "FcFontSetDestroy"); -#if 0 - Fini = - (FcFiniFuncType)dlsym(libfontconfig, "FcFini"); -#endif - NameParse = (FcNameParseFuncType)dlsym(libfontconfig, "FcNameParse"); - PatternAddString = - (FcPatternAddStringFuncType)dlsym(libfontconfig, "FcPatternAddString"); - ConfigSubstitute = - (FcConfigSubstituteFuncType)dlsym(libfontconfig, "FcConfigSubstitute"); - DefaultSubstitute = (FcDefaultSubstituteFuncType) - dlsym(libfontconfig, "FcDefaultSubstitute"); - FontMatch = (FcFontMatchFuncType)dlsym(libfontconfig, "FcFontMatch"); - PatternGetBool = (FcPatternGetBoolFuncType) - dlsym(libfontconfig, "FcPatternGetBool"); - PatternGetInteger = (FcPatternGetIntegerFuncType) - dlsym(libfontconfig, "FcPatternGetInteger"); - PatternDestroy = - (FcPatternDestroyFuncType)dlsym(libfontconfig, "FcPatternDestroy"); - GetVersion = (FcGetVersionFuncType)dlsym(libfontconfig, "FcGetVersion"); - PatternGetCharSet = - (FcPatternGetCharSetFuncType)dlsym(libfontconfig, - "FcPatternGetCharSet"); - FontSort = - (FcFontSortFuncType)dlsym(libfontconfig, "FcFontSort"); - FontSetDestroy = - (FcFontSetDestroyFuncType)dlsym(libfontconfig, "FcFontSetDestroy"); - CharSetUnion = - (FcCharSetUnionFuncType)dlsym(libfontconfig, "FcCharSetUnion"); - CharSetSubtractCount = - (FcCharSetSubtractCountFuncType)dlsym(libfontconfig, - "FcCharSetSubtractCount"); - - if (PatternBuild == NULL || - ObjectSetBuild == NULL || - PatternGetString == NULL || - FontList == NULL || - StrDirname == NULL || - PatternDestroy == NULL || - FontSetDestroy == NULL || - NameParse == NULL || - PatternAddString == NULL || - ConfigSubstitute == NULL || - DefaultSubstitute == NULL || - FontMatch == NULL || - PatternGetBool == NULL || - PatternGetInteger == NULL || - PatternDestroy == NULL || - GetVersion == NULL || - PatternGetCharSet == NULL || - CharSetUnion == NULL || - GetVersion == NULL || - CharSetSubtractCount == NULL) {/* problem with the library: return.*/ - dlCloseFontConfig (libfontconfig); - return NULL; - } - - /* Optionally get the cache dir locations. This isn't - * available until v 2.4.x, but this is OK since on those later versions - * we can check the time stamps on the cache dirs to see if we - * are out of date. There are a couple of assumptions here. First - * that the time stamp on the directory changes when the contents are - * updated. Secondly that the locations don't change. The latter is - * most likely if a new version of fontconfig is installed, but we also - * invalidate the cache if we detect that. Arguably even that is "rare", - * and most likely is tied to an OS upgrade which gets a new file anyway. - */ - ConfigGetCacheDirs = - (FcConfigGetCacheDirsFuncType)dlsym(libfontconfig, - "FcConfigGetCacheDirs"); - StrListNext = - (FcStrListNextFuncType)dlsym(libfontconfig, "FcStrListNext"); - StrListDone = - (FcStrListDoneFuncType)dlsym(libfontconfig, "FcStrListDone"); - - return libfontconfig; -} - -void dlCloseFontConfig(void* libfontconfig) -{ - dlclose(libfontconfig); -}
--- a/src/solaris/native/common/deps/fontconfig_fp.h Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef __FONTCONFIG_FP_H__ -#define __FONTCONFIG_FP_H__ - -#include <dlfcn.h> -#ifndef __linux__ /* i.e. is solaris */ -#include <link.h> -#endif - -#include <fontconfig/fontconfig.h> - -void* dlOpenFontConfig(); -void dlCloseFontConfig(void *libfontconfig); - -typedef void* (FcFiniFuncType)(); -typedef FcConfig* (*FcInitLoadConfigFuncType)(); -typedef FcPattern* (*FcPatternBuildFuncType)(FcPattern *orig, ...); -typedef FcObjectSet* (*FcObjectSetFuncType)(const char *first, ...); -typedef FcFontSet* (*FcFontListFuncType)(FcConfig *config, - FcPattern *p, - FcObjectSet *os); -typedef FcResult (*FcPatternGetBoolFuncType)(const FcPattern *p, - const char *object, - int n, - FcBool *b); -typedef FcResult (*FcPatternGetIntegerFuncType)(const FcPattern *p, - const char *object, - int n, - int *i); -typedef FcResult (*FcPatternGetStringFuncType)(const FcPattern *p, - const char *object, - int n, - FcChar8 ** s); -typedef FcChar8* (*FcStrDirnameFuncType)(const FcChar8 *file); -typedef void (*FcPatternDestroyFuncType)(FcPattern *p); -typedef void (*FcFontSetDestroyFuncType)(FcFontSet *s); -typedef FcPattern* (*FcNameParseFuncType)(const FcChar8 *name); -typedef FcBool (*FcPatternAddStringFuncType)(FcPattern *p, - const char *object, - const FcChar8 *s); -typedef void (*FcDefaultSubstituteFuncType)(FcPattern *p); -typedef FcBool (*FcConfigSubstituteFuncType)(FcConfig *config, - FcPattern *p, - FcMatchKind kind); -typedef FcPattern* (*FcFontMatchFuncType)(FcConfig *config, - FcPattern *p, - FcResult *result); -typedef FcFontSet* (*FcFontSetCreateFuncType)(); -typedef FcBool (*FcFontSetAddFuncType)(FcFontSet *s, FcPattern *font); - -typedef FcResult (*FcPatternGetCharSetFuncType)(FcPattern *p, - const char *object, - int n, - FcCharSet **c); -typedef FcFontSet* (*FcFontSortFuncType)(FcConfig *config, - FcPattern *p, - FcBool trim, - FcCharSet **csp, - FcResult *result); -typedef FcCharSet* (*FcCharSetUnionFuncType)(const FcCharSet *a, - const FcCharSet *b); -typedef FcChar32 (*FcCharSetSubtractCountFuncType)(const FcCharSet *a, - const FcCharSet *b); - -typedef int (*FcGetVersionFuncType)(); - -typedef FcStrList* (*FcConfigGetCacheDirsFuncType)(FcConfig *config); -typedef FcChar8* (*FcStrListNextFuncType)(FcStrList *list); -typedef FcChar8* (*FcStrListDoneFuncType)(FcStrList *list); - -FcInitLoadConfigFuncType InitLoadConfig; -FcPatternBuildFuncType PatternBuild; -FcObjectSetFuncType ObjectSetBuild; -FcFontListFuncType FontList; -FcPatternGetStringFuncType PatternGetString; -FcStrDirnameFuncType StrDirname; -FcPatternDestroyFuncType PatternDestroy; -FcFontSetDestroyFuncType FontSetDestroy; -FcNameParseFuncType NameParse; -FcPatternAddStringFuncType PatternAddString; -FcConfigSubstituteFuncType ConfigSubstitute; -FcDefaultSubstituteFuncType DefaultSubstitute; -FcFontMatchFuncType FontMatch; -FcPatternGetBoolFuncType PatternGetBool; -FcPatternGetIntegerFuncType PatternGetInteger; -FcGetVersionFuncType GetVersion; -FcPatternGetCharSetFuncType PatternGetCharSet; -FcFontSortFuncType FontSort; -FcFontSetDestroyFuncType FontSetDestroy; -FcCharSetUnionFuncType CharSetUnion; -FcCharSetSubtractCountFuncType CharSetSubtractCount; -FcConfigGetCacheDirsFuncType ConfigGetCacheDirs; -FcStrListNextFuncType StrListNext; -FcStrListDoneFuncType StrListDone; -#if 0 -FcFiniFuncType Fini; -#endif - -#define FcPatternBuild (*PatternBuild) -#define FcObjectSetBuild (*ObjectSetBuild) -#define FcFontList (*FontList) -#define FcPatternGetString (*PatternGetString) -#define FcStrDirname (*StrDirname) -#define FcFontSetDestroy (*FontSetDestroy) -#define FcPatternDestroy (*PatternDestroy) -#define FcNameParse (*NameParse) -#define FcPatternAddString (*PatternAddString) -#define FcConfigSubstitute (*ConfigSubstitute) -#define FcDefaultSubstitute (*DefaultSubstitute) -#define FcFontMatch (*FontMatch) -#define FcPatternGetBool (*PatternGetBool) -#define FcPatternGetInteger (*PatternGetInteger) -#define FcGetVersion (*GetVersion) -#define FcStrListNext (*StrListNext) -#define FcStrListDone (*StrListDone) -#define FcConfigGetCacheDirs (*ConfigGetCacheDirs) -#define FcFontSort (*FontSort) -#define FcPatternGetCharSet (*PatternGetCharSet) -#define FcCharSetSubtractCount (*CharSetSubtractCount) -#define FcCharSetUnion (*CharSetUnion) - -#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/gconf2/gconf/gconf-client.h Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef GCONF_GCONF_H +#define GCONF_GCONF_H + +/** + * These functions are used by the sun.net.spi.DefaultProxySelector class + * to access some platform specific settings. + * This is the Solaris/Linux Gnome 2.x code using the GConf-2 library. + * Everything is loaded dynamically so no hard link with any library exists. + */ +typedef void* fp_client_get_default_func(); +typedef char* fp_client_get_string_func(void *, char *, void**); +typedef int fp_client_get_int_func(void*, char *, void**); +typedef int fp_client_get_bool_func(void*, char *, void**); +typedef int fp_conf_init_func(int, char**, void**); +typedef void fp_type_init_func (); + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/gconf2/gconf_fp.c Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include <gconf_fp.h> +#include <dlfcn.h> + +fp_client_get_default_func* my_get_default_func = NULL; +fp_client_get_string_func* my_get_string_func = NULL; +fp_client_get_int_func* my_get_int_func = NULL; +fp_client_get_bool_func* my_get_bool_func = NULL; +fp_conf_init_func* my_gconf_init_func = NULL; +fp_type_init_func* my_g_type_init_func = NULL; + +jboolean init_gconf(int* gconf_ver, void** gconf_client) +{ + /** + * Let's try to load le GConf-2 library + */ + if (dlopen("libgconf-2.so", RTLD_GLOBAL | RTLD_LAZY) != NULL || + dlopen("libgconf-2.so.4", RTLD_GLOBAL | RTLD_LAZY) != NULL) { + *gconf_ver = 2; + } + if (*gconf_ver > 0) { + /* + * Now let's get pointer to the functions we need. + */ + my_g_type_init_func = (fp_type_init_func*) dlsym(RTLD_DEFAULT, "g_type_init"); + my_get_default_func = (fp_client_get_default_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_default"); + if (my_g_type_init_func != NULL && my_get_default_func != NULL) { + /** + * Try to connect to GConf. + */ + (*my_g_type_init_func)(); + (*gconf_client) = (*my_get_default_func)(); + if ((*gconf_client) != NULL) { + my_get_string_func = (fp_client_get_string_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_string"); + my_get_int_func = (fp_client_get_int_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_int"); + my_get_bool_func = (fp_client_get_bool_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_bool"); + if (my_get_int_func != NULL && my_get_string_func != NULL && + my_get_bool_func != NULL) { + /** + * We did get all we need. Let's enable the System Proxy Settings. + */ + return JNI_TRUE; + } + } + } + } + return JNI_FALSE; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/gconf2/gconf_fp.h Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef GCONF_GCONF_FP_H +#define GCONF_GCONF_FP_H + +#include <gconf/gconf-client.h> +#include <jni.h> +#include <stddef.h> + +extern fp_client_get_default_func* my_get_default_func; +extern fp_client_get_string_func* my_get_string_func; +extern fp_client_get_int_func* my_get_int_func; +extern fp_client_get_bool_func* my_get_bool_func; +extern fp_conf_init_func* my_gconf_init_func; +extern fp_type_init_func* my_g_type_init_func; + +#define gconf_client_get_default (*my_get_default_func) +#define gconf_client_get_string (*my_get_string_func) +#define gconf_client_get_int (*my_get_int_func) +#define gconf_client_get_bool (*my_get_bool_func) +#define gconf_init (*my_gconf_init_func) +#define g_type_init (*my_g_type_init_func) + +jboolean init_gconf(int* gconf_ver, void** gconf_client); + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/glib2/gio/gio.h Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* Definitions for GIO */ + +#ifndef __GIO_H__ +#define __GIO_H__ + +#define G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "standard::content-type" + +typedef void* gpointer; +typedef struct _GFile GFile; +typedef struct _GFileInfo GFileInfo; +typedef struct _GCancellable GCancellable; +typedef struct _GError GError; + +typedef enum { + G_FILE_QUERY_INFO_NONE = 0 +} GFileQueryInfoFlags; + +typedef void (*type_init_func)(void); +typedef void (*object_unref_func)(gpointer object); +typedef GFile* (*file_new_for_path_func)(const char* path); +typedef GFileInfo* (*file_query_info_func)(GFile *file, + const char *attributes, GFileQueryInfoFlags flags, + GCancellable *cancellable, GError **error); +typedef char* (*file_info_get_content_type_func)(GFileInfo *info); + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/glib2/gio_fp.c Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include <dlfcn.h> +#include <jvm.h> + +#include "gio_fp.h" + +type_init_func type_init; +object_unref_func object_unref; +file_new_for_path_func file_new_for_path; +file_query_info_func file_query_info; +file_info_get_content_type_func file_info_get_content_type; + +jboolean init() +{ + void* gio_handle; + + gio_handle = dlopen("libgio-2.0.so", RTLD_LAZY); + if (gio_handle == NULL) { + gio_handle = dlopen("libgio-2.0.so.0", RTLD_LAZY); + if (gio_handle == NULL) { + return JNI_FALSE; + } + } + + type_init = (type_init_func)dlsym(gio_handle, "g_type_init"); + (*g_type_init)(); + + object_unref = (object_unref_func)dlsym(gio_handle, "g_object_unref"); + + file_new_for_path = + (file_new_for_path_func)dlsym(gio_handle, "g_file_new_for_path"); + + file_query_info = + (file_query_info_func)dlsym(gio_handle, "g_file_query_info"); + + file_info_get_content_type = (file_info_get_content_type_func) + dlsym(gio_handle, "g_file_info_get_content_type"); + + + if (g_type_init == NULL || + g_object_unref == NULL || + g_file_new_for_path == NULL || + g_file_query_info == NULL || + g_file_info_get_content_type == NULL) + { + dlclose(gio_handle); + return JNI_FALSE; + } + + return JNI_TRUE; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/glib2/gio_fp.h Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef __GIO_FP_H__ +#define __GIO_FP_H__ + +#include <gio/gio.h> + +extern type_init_func type_init; +extern object_unref_func object_unref; +extern file_new_for_path_func file_new_for_path; +extern file_query_info_func file_query_info; +extern file_info_get_content_type_func file_info_get_content_type; + +#define g_type_init (*type_init) +#define g_object_unref (*object_unref) +#define g_file_new_for_path (*file_new_for_path) +#define g_file_query_info (*file_query_info) +#define g_file_info_get_content_type (*file_info_get_content_type) + +jboolean init(); + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/gtk2/gtk/gtk.h Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,567 @@ +/* + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +#ifndef __GTK_H__ +#define __GTK_H__ + +#define _G_TYPE_CIC(ip, gt, ct) ((ct*) ip) +#define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) +#define GTK_TYPE_FILE_CHOOSER (fp_gtk_file_chooser_get_type ()) +#define GTK_FILE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_CHOOSER, GtkFileChooser)) +#define fp_g_signal_connect(instance, detailed_signal, c_handler, data) \ + fp_g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0) +#define G_CALLBACK(f) ((GCallback) (f)) +#define G_TYPE_FUNDAMENTAL_SHIFT (2) +#define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) +#define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) +#define G_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_OBJECT, GObject)) +#define GTK_STOCK_CANCEL "gtk-cancel" +#define GTK_STOCK_SAVE "gtk-save" +#define GTK_STOCK_OPEN "gtk-open" + +/* GTK types, here to eliminate need for GTK headers at compile time */ + +#ifndef FALSE +#define FALSE (0) +#define TRUE (!FALSE) +#endif + +#define GTK_HAS_FOCUS (1 << 12) +#define GTK_HAS_DEFAULT (1 << 14) + + +/* basic types */ +typedef char gchar; +typedef short gshort; +typedef int gint; +typedef long glong; +typedef float gfloat; +typedef double gdouble; +typedef void* gpointer; +typedef gint gboolean; + +typedef signed char gint8; +typedef signed short gint16; +typedef signed int gint32; + +typedef unsigned char guchar; +typedef unsigned char guint8; +typedef unsigned short gushort; +typedef unsigned short guint16; +typedef unsigned int guint; +typedef unsigned int guint32; +typedef unsigned int gsize; +typedef unsigned long gulong; + +typedef signed long long gint64; +typedef unsigned long long guint64; + +/* enumerated constants */ +typedef enum +{ + GTK_ARROW_UP, + GTK_ARROW_DOWN, + GTK_ARROW_LEFT, + GTK_ARROW_RIGHT +} GtkArrowType; + +typedef enum { + GDK_COLORSPACE_RGB +} GdkColorspace; + +typedef enum +{ + GTK_EXPANDER_COLLAPSED, + GTK_EXPANDER_SEMI_COLLAPSED, + GTK_EXPANDER_SEMI_EXPANDED, + GTK_EXPANDER_EXPANDED +} GtkExpanderStyle; + +typedef enum +{ + GTK_ICON_SIZE_INVALID, + GTK_ICON_SIZE_MENU, + GTK_ICON_SIZE_SMALL_TOOLBAR, + GTK_ICON_SIZE_LARGE_TOOLBAR, + GTK_ICON_SIZE_BUTTON, + GTK_ICON_SIZE_DND, + GTK_ICON_SIZE_DIALOG +} GtkIconSize; + +typedef enum +{ + GTK_ORIENTATION_HORIZONTAL, + GTK_ORIENTATION_VERTICAL +} GtkOrientation; + +typedef enum +{ + GTK_POS_LEFT, + GTK_POS_RIGHT, + GTK_POS_TOP, + GTK_POS_BOTTOM +} GtkPositionType; + +typedef enum +{ + GTK_SHADOW_NONE, + GTK_SHADOW_IN, + GTK_SHADOW_OUT, + GTK_SHADOW_ETCHED_IN, + GTK_SHADOW_ETCHED_OUT +} GtkShadowType; + +typedef enum +{ + GTK_STATE_NORMAL, + GTK_STATE_ACTIVE, + GTK_STATE_PRELIGHT, + GTK_STATE_SELECTED, + GTK_STATE_INSENSITIVE +} GtkStateType; + +typedef enum +{ + GTK_TEXT_DIR_NONE, + GTK_TEXT_DIR_LTR, + GTK_TEXT_DIR_RTL +} GtkTextDirection; + +typedef enum +{ + GTK_WINDOW_TOPLEVEL, + GTK_WINDOW_POPUP +} GtkWindowType; + +typedef enum +{ + G_PARAM_READABLE = 1 << 0, + G_PARAM_WRITABLE = 1 << 1, + G_PARAM_CONSTRUCT = 1 << 2, + G_PARAM_CONSTRUCT_ONLY = 1 << 3, + G_PARAM_LAX_VALIDATION = 1 << 4, + G_PARAM_PRIVATE = 1 << 5 +} GParamFlags; + +/* We define all structure pointers to be void* */ +typedef void GError; +typedef void GMainContext; + +typedef struct _GSList GSList; +struct _GSList +{ + gpointer data; + GSList *next; +}; + +typedef void GdkColormap; +typedef void GdkDrawable; +typedef void GdkGC; +typedef void GdkPixbuf; +typedef void GdkPixmap; +typedef void GdkWindow; + +typedef void GtkFixed; +typedef void GtkMenuItem; +typedef void GtkMenuShell; +typedef void GtkWidgetClass; +typedef void PangoFontDescription; +typedef void GtkSettings; + +/* Some real structures */ +typedef struct +{ + guint32 pixel; + guint16 red; + guint16 green; + guint16 blue; +} GdkColor; + +typedef struct { + gint fd; + gushort events; + gushort revents; +} GPollFD; + +typedef struct { + gint x; + gint y; + gint width; + gint height; +} GdkRectangle; + +typedef struct { + gint x; + gint y; + gint width; + gint height; +} GtkAllocation; + +typedef struct { + gint width; + gint height; +} GtkRequisition; + +typedef struct { + GtkWidgetClass *g_class; +} GTypeInstance; + +typedef struct { + gint left; + gint right; + gint top; + gint bottom; +} GtkBorder; + +/****************************************************** + * FIXME: it is more safe to include gtk headers for + * the precise type definition of GType and other + * structures. This is a place where getting rid of gtk + * headers may be dangerous. + ******************************************************/ +typedef gulong GType; + +typedef struct +{ + GType g_type; + + union { + gint v_int; + guint v_uint; + glong v_long; + gulong v_ulong; + gint64 v_int64; + guint64 v_uint64; + gfloat v_float; + gdouble v_double; + gpointer v_pointer; + } data[2]; +} GValue; + +typedef struct +{ + GTypeInstance g_type_instance; + + gchar *name; + GParamFlags flags; + GType value_type; + GType owner_type; +} GParamSpec; + +typedef struct { + GTypeInstance g_type_instance; + guint ref_count; + void *qdata; +} GObject; + +typedef struct { + GObject parent_instance; + guint32 flags; +} GtkObject; + +typedef struct +{ + GObject parent_instance; + + GdkColor fg[5]; + GdkColor bg[5]; + GdkColor light[5]; + GdkColor dark[5]; + GdkColor mid[5]; + GdkColor text[5]; + GdkColor base[5]; + GdkColor text_aa[5]; /* Halfway between text/base */ + + GdkColor black; + GdkColor white; + PangoFontDescription *font_desc; + + gint xthickness; + gint ythickness; + + GdkGC *fg_gc[5]; + GdkGC *bg_gc[5]; + GdkGC *light_gc[5]; + GdkGC *dark_gc[5]; + GdkGC *mid_gc[5]; + GdkGC *text_gc[5]; + GdkGC *base_gc[5]; + GdkGC *text_aa_gc[5]; + GdkGC *black_gc; + GdkGC *white_gc; + + GdkPixmap *bg_pixmap[5]; +} GtkStyle; + +typedef struct _GtkWidget GtkWidget; +struct _GtkWidget +{ + GtkObject object; + guint16 private_flags; + guint8 state; + guint8 saved_state; + gchar *name; + GtkStyle *style; + GtkRequisition requisition; + GtkAllocation allocation; + GdkWindow *window; + GtkWidget *parent; +}; + +typedef struct +{ + GtkWidget widget; + + gfloat xalign; + gfloat yalign; + + guint16 xpad; + guint16 ypad; +} GtkMisc; + +typedef struct { + GtkWidget widget; + GtkWidget *focus_child; + guint border_width : 16; + guint need_resize : 1; + guint resize_mode : 2; + guint reallocate_redraws : 1; + guint has_focus_chain : 1; +} GtkContainer; + +typedef struct { + GtkContainer container; + GtkWidget *child; +} GtkBin; + +typedef struct { + GtkBin bin; + GdkWindow *event_window; + gchar *label_text; + guint activate_timeout; + guint constructed : 1; + guint in_button : 1; + guint button_down : 1; + guint relief : 2; + guint use_underline : 1; + guint use_stock : 1; + guint depressed : 1; + guint depress_on_activate : 1; + guint focus_on_click : 1; +} GtkButton; + +typedef struct { + GtkButton button; + guint active : 1; + guint draw_indicator : 1; + guint inconsistent : 1; +} GtkToggleButton; + +typedef struct _GtkAdjustment GtkAdjustment; +struct _GtkAdjustment +{ + GtkObject parent_instance; + + gdouble lower; + gdouble upper; + gdouble value; + gdouble step_increment; + gdouble page_increment; + gdouble page_size; +}; + +typedef enum +{ + GTK_UPDATE_CONTINUOUS, + GTK_UPDATE_DISCONTINUOUS, + GTK_UPDATE_DELAYED +} GtkUpdateType; + +typedef struct _GtkRange GtkRange; +struct _GtkRange +{ + GtkWidget widget; + GtkAdjustment *adjustment; + GtkUpdateType update_policy; + guint inverted : 1; + /*< protected >*/ + guint flippable : 1; + guint has_stepper_a : 1; + guint has_stepper_b : 1; + guint has_stepper_c : 1; + guint has_stepper_d : 1; + guint need_recalc : 1; + guint slider_size_fixed : 1; + gint min_slider_size; + GtkOrientation orientation; + GdkRectangle range_rect; + gint slider_start, slider_end; + gint round_digits; + /*< private >*/ + guint trough_click_forward : 1; + guint update_pending : 1; + /*GtkRangeLayout * */ void *layout; + /*GtkRangeStepTimer * */ void* timer; + gint slide_initial_slider_position; + gint slide_initial_coordinate; + guint update_timeout_id; + GdkWindow *event_window; +}; + +typedef struct _GtkProgressBar GtkProgressBar; + +typedef enum +{ + GTK_PROGRESS_CONTINUOUS, + GTK_PROGRESS_DISCRETE +} GtkProgressBarStyle; + +typedef enum +{ + GTK_PROGRESS_LEFT_TO_RIGHT, + GTK_PROGRESS_RIGHT_TO_LEFT, + GTK_PROGRESS_BOTTOM_TO_TOP, + GTK_PROGRESS_TOP_TO_BOTTOM +} GtkProgressBarOrientation; + +typedef struct _GtkProgress GtkProgress; + +struct _GtkProgress +{ + GtkWidget widget; + GtkAdjustment *adjustment; + GdkPixmap *offscreen_pixmap; + gchar *format; + gfloat x_align; + gfloat y_align; + guint show_text : 1; + guint activity_mode : 1; + guint use_text_format : 1; +}; + +struct _GtkProgressBar +{ + GtkProgress progress; + GtkProgressBarStyle bar_style; + GtkProgressBarOrientation orientation; + guint blocks; + gint in_block; + gint activity_pos; + guint activity_step; + guint activity_blocks; + gdouble pulse_fraction; + guint activity_dir : 1; + guint ellipsize : 3; +}; + +typedef enum { + GTK_RESPONSE_NONE = -1, + GTK_RESPONSE_REJECT = -2, + GTK_RESPONSE_ACCEPT = -3, + GTK_RESPONSE_DELETE_EVENT = -4, + GTK_RESPONSE_OK = -5, + GTK_RESPONSE_CANCEL = -6, + GTK_RESPONSE_CLOSE = -7, + GTK_RESPONSE_YES = -8, + GTK_RESPONSE_NO = -9, + GTK_RESPONSE_APPLY = -10, + GTK_RESPONSE_HELP = -11 +} GtkResponseType; + +typedef struct _GtkWindow GtkWindow; + +typedef struct _GtkFileChooser GtkFileChooser; + +typedef enum { + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, + GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER +} GtkFileChooserAction; + +typedef struct _GtkFileFilter GtkFileFilter; + +typedef enum { + GTK_FILE_FILTER_FILENAME = 1 << 0, + GTK_FILE_FILTER_URI = 1 << 1, + GTK_FILE_FILTER_DISPLAY_NAME = 1 << 2, + GTK_FILE_FILTER_MIME_TYPE = 1 << 3 +} GtkFileFilterFlags; + +typedef struct { + GtkFileFilterFlags contains; + const gchar *filename; + const gchar *uri; + const gchar *display_name; + const gchar *mime_type; +} GtkFileFilterInfo; + +typedef gboolean (*GtkFileFilterFunc)(const GtkFileFilterInfo *filter_info, + gpointer data); + +typedef void (*GDestroyNotify)(gpointer data); + +typedef void (*GCallback)(void); + +typedef struct _GClosure GClosure; + +typedef void (*GClosureNotify)(gpointer data, GClosure *closure); + +typedef enum { + G_CONNECT_AFTER = 1 << 0, G_CONNECT_SWAPPED = 1 << 1 +} GConnectFlags; + +typedef struct _GThreadFunctions GThreadFunctions; + +#define G_TYPE_INVALID G_TYPE_MAKE_FUNDAMENTAL (0) +#define G_TYPE_NONE G_TYPE_MAKE_FUNDAMENTAL (1) +#define G_TYPE_INTERFACE G_TYPE_MAKE_FUNDAMENTAL (2) +#define G_TYPE_CHAR G_TYPE_MAKE_FUNDAMENTAL (3) +#define G_TYPE_UCHAR G_TYPE_MAKE_FUNDAMENTAL (4) +#define G_TYPE_BOOLEAN G_TYPE_MAKE_FUNDAMENTAL (5) +#define G_TYPE_INT G_TYPE_MAKE_FUNDAMENTAL (6) +#define G_TYPE_UINT G_TYPE_MAKE_FUNDAMENTAL (7) +#define G_TYPE_LONG G_TYPE_MAKE_FUNDAMENTAL (8) +#define G_TYPE_ULONG G_TYPE_MAKE_FUNDAMENTAL (9) +#define G_TYPE_INT64 G_TYPE_MAKE_FUNDAMENTAL (10) +#define G_TYPE_UINT64 G_TYPE_MAKE_FUNDAMENTAL (11) +#define G_TYPE_ENUM G_TYPE_MAKE_FUNDAMENTAL (12) +#define G_TYPE_FLAGS G_TYPE_MAKE_FUNDAMENTAL (13) +#define G_TYPE_FLOAT G_TYPE_MAKE_FUNDAMENTAL (14) +#define G_TYPE_DOUBLE G_TYPE_MAKE_FUNDAMENTAL (15) +#define G_TYPE_STRING G_TYPE_MAKE_FUNDAMENTAL (16) +#define G_TYPE_POINTER G_TYPE_MAKE_FUNDAMENTAL (17) +#define G_TYPE_BOXED G_TYPE_MAKE_FUNDAMENTAL (18) +#define G_TYPE_PARAM G_TYPE_MAKE_FUNDAMENTAL (19) +#define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) + +#define GTK_TYPE_BORDER gtk_border_get_type() + +#define G_TYPE_FUNDAMENTAL_SHIFT (2) +#define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) + +#define g_signal_connect(instance, detailed_signal, c_handler, data) \ + g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0) + +#endif /* __GTK_H__ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/gtk2/gtk_fp.c Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,385 @@ +/* + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +#include <dlfcn.h> +#include <setjmp.h> +#include <stddef.h> + +#include "gtk_fp.h" + +#define GTK2_LIB "libgtk-x11-2.0.so.0" +#define GTHREAD_LIB "libgthread-2.0.so.0" +#define NO_SYMBOL_EXCEPTION 1 + +static gboolean new_combo_used = TRUE; +static void *gtk2_libhandle = NULL; +static void *gthread_libhandle = NULL; +static jmp_buf j; + +/* This is a workaround for the bug: + * http://sourceware.org/bugzilla/show_bug.cgi?id=1814 + * (dlsym/dlopen clears dlerror state) + * This bug is specific to Linux, but there is no harm in + * applying this workaround on Solaris as well. + */ +static void* dl_symbol(const char* name) +{ + void* result = dlsym(gtk2_libhandle, name); + if (!result) + longjmp(j, NO_SYMBOL_EXCEPTION); + + return result; +} + +static void* dl_symbol_gthread(const char* name) +{ + void* result = dlsym(gthread_libhandle, name); + if (!result) + longjmp(j, NO_SYMBOL_EXCEPTION); + + return result; +} + +gboolean gtk2_check_dlversion() +{ + if (gtk2_libhandle != NULL) { + /* We've already successfully opened the GTK libs, so return true. */ + return TRUE; + } + void *lib = NULL; + gboolean result = FALSE; + + lib = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL); + if (lib == NULL) { + return FALSE; + } + + fp_gtk_check_version = dlsym(lib, "gtk_check_version"); + /* Check for GTK 2.2+ */ + if (!fp_gtk_check_version(2, 2, 0)) { + result = TRUE; + } + + dlclose(lib); + + return result; +} + +/** + * Functions for sun_awt_X11_GtkFileDialogPeer.c + */ +void gtk2_file_chooser_load() +{ + fp_gtk_file_chooser_get_filename = dl_symbol( + "gtk_file_chooser_get_filename"); + fp_gtk_file_chooser_dialog_new = dl_symbol("gtk_file_chooser_dialog_new"); + fp_gtk_file_chooser_set_current_folder = dl_symbol( + "gtk_file_chooser_set_current_folder"); + fp_gtk_file_chooser_set_filename = dl_symbol( + "gtk_file_chooser_set_filename"); + fp_gtk_file_chooser_set_current_name = dl_symbol( + "gtk_file_chooser_set_current_name"); + fp_gtk_file_filter_add_custom = dl_symbol("gtk_file_filter_add_custom"); + fp_gtk_file_chooser_set_filter = dl_symbol("gtk_file_chooser_set_filter"); + fp_gtk_file_chooser_get_type = dl_symbol("gtk_file_chooser_get_type"); + fp_gtk_file_filter_new = dl_symbol("gtk_file_filter_new"); + if (fp_gtk_check_version(2, 8, 0) == NULL) { + fp_gtk_file_chooser_set_do_overwrite_confirmation = dl_symbol( + "gtk_file_chooser_set_do_overwrite_confirmation"); + } + fp_gtk_file_chooser_set_select_multiple = dl_symbol( + "gtk_file_chooser_set_select_multiple"); + fp_gtk_file_chooser_get_current_folder = dl_symbol( + "gtk_file_chooser_get_current_folder"); + fp_gtk_file_chooser_get_filenames = dl_symbol( + "gtk_file_chooser_get_filenames"); + fp_gtk_g_slist_length = dl_symbol("g_slist_length"); +} + +gboolean gtk2_dlload() +{ + gtk2_libhandle = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL); + gthread_libhandle = dlopen(GTHREAD_LIB, RTLD_LAZY | RTLD_LOCAL); + + if (gtk2_libhandle == NULL || gthread_libhandle == NULL) + return FALSE; + + if (setjmp(j) == 0) + { + fp_gtk_check_version = dl_symbol("gtk_check_version"); + /* Check for GTK 2.2+ */ + if (fp_gtk_check_version(2, 2, 0)) { + longjmp(j, NO_SYMBOL_EXCEPTION); + } + + /* GLib */ + fp_g_free = dl_symbol("g_free"); + fp_g_object_unref = dl_symbol("g_object_unref"); + + fp_g_main_context_iteration = + dl_symbol("g_main_context_iteration"); + + fp_g_value_init = dl_symbol("g_value_init"); + fp_g_type_is_a = dl_symbol("g_type_is_a"); + + fp_g_value_get_boolean = dl_symbol("g_value_get_boolean"); + fp_g_value_get_char = dl_symbol("g_value_get_char"); + fp_g_value_get_uchar = dl_symbol("g_value_get_uchar"); + fp_g_value_get_int = dl_symbol("g_value_get_int"); + fp_g_value_get_uint = dl_symbol("g_value_get_uint"); + fp_g_value_get_long = dl_symbol("g_value_get_long"); + fp_g_value_get_ulong = dl_symbol("g_value_get_ulong"); + fp_g_value_get_int64 = dl_symbol("g_value_get_int64"); + fp_g_value_get_uint64 = dl_symbol("g_value_get_uint64"); + fp_g_value_get_float = dl_symbol("g_value_get_float"); + fp_g_value_get_double = dl_symbol("g_value_get_double"); + fp_g_value_get_string = dl_symbol("g_value_get_string"); + fp_g_value_get_enum = dl_symbol("g_value_get_enum"); + fp_g_value_get_flags = dl_symbol("g_value_get_flags"); + fp_g_value_get_param = dl_symbol("g_value_get_param"); + fp_g_value_get_boxed = dl_symbol("g_value_get_boxed"); + fp_g_value_get_pointer = dl_symbol("g_value_get_pointer"); + fp_g_value_get_object = dl_symbol("g_value_get_object"); + fp_g_param_spec_int = dl_symbol("g_param_spec_int"); + fp_g_object_get = dl_symbol("g_object_get"); + fp_g_object_set = dl_symbol("g_object_set"); + + /* GDK */ + fp_gdk_pixmap_new = dl_symbol("gdk_pixmap_new"); + fp_gdk_pixbuf_get_from_drawable = + dl_symbol("gdk_pixbuf_get_from_drawable"); + fp_gdk_gc_new = dl_symbol("gdk_gc_new"); + fp_gdk_rgb_gc_set_foreground = + dl_symbol("gdk_rgb_gc_set_foreground"); + fp_gdk_draw_rectangle = dl_symbol("gdk_draw_rectangle"); + fp_gdk_drawable_get_size = dl_symbol("gdk_drawable_get_size"); + + /* Pixbuf */ + fp_gdk_pixbuf_new = dl_symbol("gdk_pixbuf_new"); + fp_gdk_pixbuf_new_from_file = + dl_symbol("gdk_pixbuf_new_from_file"); + fp_gdk_pixbuf_get_width = dl_symbol("gdk_pixbuf_get_width"); + fp_gdk_pixbuf_get_height = dl_symbol("gdk_pixbuf_get_height"); + fp_gdk_pixbuf_get_pixels = dl_symbol("gdk_pixbuf_get_pixels"); + fp_gdk_pixbuf_get_rowstride = + dl_symbol("gdk_pixbuf_get_rowstride"); + fp_gdk_pixbuf_get_has_alpha = + dl_symbol("gdk_pixbuf_get_has_alpha"); + fp_gdk_pixbuf_get_bits_per_sample = + dl_symbol("gdk_pixbuf_get_bits_per_sample"); + fp_gdk_pixbuf_get_n_channels = + dl_symbol("gdk_pixbuf_get_n_channels"); + + /* GTK painting */ + fp_gtk_init_check = dl_symbol("gtk_init_check"); + fp_gtk_paint_hline = dl_symbol("gtk_paint_hline"); + fp_gtk_paint_vline = dl_symbol("gtk_paint_vline"); + fp_gtk_paint_shadow = dl_symbol("gtk_paint_shadow"); + fp_gtk_paint_arrow = dl_symbol("gtk_paint_arrow"); + fp_gtk_paint_diamond = dl_symbol("gtk_paint_diamond"); + fp_gtk_paint_box = dl_symbol("gtk_paint_box"); + fp_gtk_paint_flat_box = dl_symbol("gtk_paint_flat_box"); + fp_gtk_paint_check = dl_symbol("gtk_paint_check"); + fp_gtk_paint_option = dl_symbol("gtk_paint_option"); + fp_gtk_paint_box_gap = dl_symbol("gtk_paint_box_gap"); + fp_gtk_paint_extension = dl_symbol("gtk_paint_extension"); + fp_gtk_paint_focus = dl_symbol("gtk_paint_focus"); + fp_gtk_paint_slider = dl_symbol("gtk_paint_slider"); + fp_gtk_paint_handle = dl_symbol("gtk_paint_handle"); + fp_gtk_paint_expander = dl_symbol("gtk_paint_expander"); + fp_gtk_style_apply_default_background = + dl_symbol("gtk_style_apply_default_background"); + + /* GTK widgets */ + fp_gtk_arrow_new = dl_symbol("gtk_arrow_new"); + fp_gtk_button_new = dl_symbol("gtk_button_new"); + fp_gtk_spin_button_new = dl_symbol("gtk_spin_button_new"); + fp_gtk_check_button_new = dl_symbol("gtk_check_button_new"); + fp_gtk_check_menu_item_new = + dl_symbol("gtk_check_menu_item_new"); + fp_gtk_color_selection_dialog_new = + dl_symbol("gtk_color_selection_dialog_new"); + fp_gtk_entry_new = dl_symbol("gtk_entry_new"); + fp_gtk_fixed_new = dl_symbol("gtk_fixed_new"); + fp_gtk_handle_box_new = dl_symbol("gtk_handle_box_new"); + fp_gtk_image_new = dl_symbol("gtk_image_new"); + fp_gtk_hpaned_new = dl_symbol("gtk_hpaned_new"); + fp_gtk_vpaned_new = dl_symbol("gtk_vpaned_new"); + fp_gtk_hscale_new = dl_symbol("gtk_hscale_new"); + fp_gtk_vscale_new = dl_symbol("gtk_vscale_new"); + fp_gtk_hscrollbar_new = dl_symbol("gtk_hscrollbar_new"); + fp_gtk_vscrollbar_new = dl_symbol("gtk_vscrollbar_new"); + fp_gtk_hseparator_new = dl_symbol("gtk_hseparator_new"); + fp_gtk_vseparator_new = dl_symbol("gtk_vseparator_new"); + fp_gtk_label_new = dl_symbol("gtk_label_new"); + fp_gtk_menu_new = dl_symbol("gtk_menu_new"); + fp_gtk_menu_bar_new = dl_symbol("gtk_menu_bar_new"); + fp_gtk_menu_item_new = dl_symbol("gtk_menu_item_new"); + fp_gtk_menu_item_set_submenu = + dl_symbol("gtk_menu_item_set_submenu"); + fp_gtk_notebook_new = dl_symbol("gtk_notebook_new"); + fp_gtk_progress_bar_new = + dl_symbol("gtk_progress_bar_new"); + fp_gtk_progress_bar_set_orientation = + dl_symbol("gtk_progress_bar_set_orientation"); + fp_gtk_radio_button_new = + dl_symbol("gtk_radio_button_new"); + fp_gtk_radio_menu_item_new = + dl_symbol("gtk_radio_menu_item_new"); + fp_gtk_scrolled_window_new = + dl_symbol("gtk_scrolled_window_new"); + fp_gtk_separator_menu_item_new = + dl_symbol("gtk_separator_menu_item_new"); + fp_gtk_text_view_new = dl_symbol("gtk_text_view_new"); + fp_gtk_toggle_button_new = + dl_symbol("gtk_toggle_button_new"); + fp_gtk_toolbar_new = dl_symbol("gtk_toolbar_new"); + fp_gtk_tree_view_new = dl_symbol("gtk_tree_view_new"); + fp_gtk_viewport_new = dl_symbol("gtk_viewport_new"); + fp_gtk_window_new = dl_symbol("gtk_window_new"); + fp_gtk_window_present = dl_symbol("gtk_window_present"); + fp_gtk_window_move = dl_symbol("gtk_window_move"); + fp_gtk_window_resize = dl_symbol("gtk_window_resize"); + + fp_gtk_dialog_new = dl_symbol("gtk_dialog_new"); + fp_gtk_frame_new = dl_symbol("gtk_frame_new"); + + fp_gtk_adjustment_new = dl_symbol("gtk_adjustment_new"); + fp_gtk_container_add = dl_symbol("gtk_container_add"); + fp_gtk_menu_shell_append = + dl_symbol("gtk_menu_shell_append"); + fp_gtk_widget_realize = dl_symbol("gtk_widget_realize"); + fp_gtk_widget_destroy = dl_symbol("gtk_widget_destroy"); + fp_gtk_widget_render_icon = + dl_symbol("gtk_widget_render_icon"); + fp_gtk_widget_set_name = + dl_symbol("gtk_widget_set_name"); + fp_gtk_widget_set_parent = + dl_symbol("gtk_widget_set_parent"); + fp_gtk_widget_set_direction = + dl_symbol("gtk_widget_set_direction"); + fp_gtk_widget_style_get = + dl_symbol("gtk_widget_style_get"); + fp_gtk_widget_class_install_style_property = + dl_symbol("gtk_widget_class_install_style_property"); + fp_gtk_widget_class_find_style_property = + dl_symbol("gtk_widget_class_find_style_property"); + fp_gtk_widget_style_get_property = + dl_symbol("gtk_widget_style_get_property"); + fp_pango_font_description_to_string = + dl_symbol("pango_font_description_to_string"); + fp_gtk_settings_get_default = + dl_symbol("gtk_settings_get_default"); + fp_gtk_widget_get_settings = + dl_symbol("gtk_widget_get_settings"); + fp_gtk_border_get_type = dl_symbol("gtk_border_get_type"); + fp_gtk_arrow_set = dl_symbol("gtk_arrow_set"); + fp_gtk_widget_size_request = + dl_symbol("gtk_widget_size_request"); + fp_gtk_range_get_adjustment = + dl_symbol("gtk_range_get_adjustment"); + + fp_gtk_widget_hide = dl_symbol("gtk_widget_hide"); + fp_gtk_main_quit = dl_symbol("gtk_main_quit"); + fp_g_signal_connect_data = dl_symbol("g_signal_connect_data"); + fp_gtk_widget_show = dl_symbol("gtk_widget_show"); + fp_gtk_main = dl_symbol("gtk_main"); + + /** + * GLib thread system + */ + fp_g_thread_init = dl_symbol_gthread("g_thread_init"); + fp_gdk_threads_init = dl_symbol("gdk_threads_init"); + fp_gdk_threads_enter = dl_symbol("gdk_threads_enter"); + fp_gdk_threads_leave = dl_symbol("gdk_threads_leave"); + + /** + * Functions for sun_awt_X11_GtkFileDialogPeer.c + */ + if (fp_gtk_check_version(2, 4, 0) == NULL) { + // The current GtkFileChooser is available from GTK+ 2.4 + gtk2_file_chooser_load(); + } + + /* Some functions may be missing in pre-2.4 GTK. + We handle them specially here. + */ + fp_gtk_combo_box_new = dlsym(gtk2_libhandle, "gtk_combo_box_new"); + if (fp_gtk_combo_box_new == NULL) { + fp_gtk_combo_box_new = dl_symbol("gtk_combo_new"); + } + + fp_gtk_combo_box_entry_new = + dlsym(gtk2_libhandle, "gtk_combo_box_entry_new"); + if (fp_gtk_combo_box_entry_new == NULL) { + fp_gtk_combo_box_entry_new = dl_symbol("gtk_combo_new"); + new_combo_used = FALSE; + } + + fp_gtk_separator_tool_item_new = + dlsym(gtk2_libhandle, "gtk_separator_tool_item_new"); + if (fp_gtk_separator_tool_item_new == NULL) { + fp_gtk_separator_tool_item_new = + dl_symbol("gtk_vseparator_new"); + } + } + /* Now we have only one kind of exceptions: NO_SYMBOL_EXCEPTION + * Otherwise we can check the return value of setjmp method. + */ + else + { + dlclose(gtk2_libhandle); + gtk2_libhandle = NULL; + + dlclose(gthread_libhandle); + gthread_libhandle = NULL; + + return FALSE; + } + + return TRUE; +} + +int gtk2_dlunload() +{ + char *gtk2_error; + + if (!gtk2_libhandle) + return TRUE; + + dlerror(); + dlclose(gtk2_libhandle); + dlclose(gthread_libhandle); + if ((gtk2_error = dlerror()) != NULL) + { + return FALSE; + } + return TRUE; +} + +gboolean new_combo() +{ + return new_combo_used; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/solaris/native/common/deps/gtk2/gtk_fp.h Wed Aug 24 04:53:54 2011 +0100 @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +#ifndef __GTK_FP_H__ +#define __GTK_FP_H__ + +#include <gtk/gtk.h> + +gboolean gtk2_check_dlversion(); +gboolean gtk2_dlload(); +int gtk2_dlunload(); +gboolean new_combo(); + +/************************* + * Glib function pointers + *************************/ + +gboolean (*fp_g_main_context_iteration)(GMainContext *context, + gboolean may_block); + +GValue* (*fp_g_value_init)(GValue *value, GType g_type); +gboolean (*fp_g_type_is_a)(GType type, GType is_a_type); +gboolean (*fp_g_value_get_boolean)(const GValue *value); +gchar (*fp_g_value_get_char)(const GValue *value); +guchar (*fp_g_value_get_uchar)(const GValue *value); +gint (*fp_g_value_get_int)(const GValue *value); +guint (*fp_g_value_get_uint)(const GValue *value); +glong (*fp_g_value_get_long)(const GValue *value); +gulong (*fp_g_value_get_ulong)(const GValue *value); +gint64 (*fp_g_value_get_int64)(const GValue *value); +guint64 (*fp_g_value_get_uint64)(const GValue *value); +gfloat (*fp_g_value_get_float)(const GValue *value); +gdouble (*fp_g_value_get_double)(const GValue *value); +const gchar* (*fp_g_value_get_string)(const GValue *value); +gint (*fp_g_value_get_enum)(const GValue *value); +guint (*fp_g_value_get_flags)(const GValue *value); +GParamSpec* (*fp_g_value_get_param)(const GValue *value); +gpointer* (*fp_g_value_get_boxed)(const GValue *value); +gpointer* (*fp_g_value_get_pointer)(const GValue *value); +GObject* (*fp_g_value_get_object)(const GValue *value); +GParamSpec* (*fp_g_param_spec_int)(const gchar *name, + const gchar *nick, const gchar *blurb, + gint minimum, gint maximum, gint default_value, + GParamFlags flags); +void (*fp_g_object_get)(gpointer object, + const gchar* fpn, ...); +void (*fp_g_object_set)(gpointer object, + const gchar *first_property_name, + ...); +/************************ + * GDK function pointers + ************************/ +GdkPixmap *(*fp_gdk_pixmap_new)(GdkDrawable *drawable, + gint width, gint height, gint depth); +GdkGC *(*fp_gdk_gc_new)(GdkDrawable*); +void (*fp_gdk_rgb_gc_set_foreground)(GdkGC*, guint32); +void (*fp_gdk_draw_rectangle)(GdkDrawable*, GdkGC*, gboolean, + gint, gint, gint, gint); +GdkPixbuf *(*fp_gdk_pixbuf_new)(GdkColorspace colorspace, + gboolean has_alpha, int bits_per_sample, int width, int height); +GdkPixbuf *(*fp_gdk_pixbuf_get_from_drawable)(GdkPixbuf *dest, + GdkDrawable *src, GdkColormap *cmap, int src_x, int src_y, + int dest_x, int dest_y, int width, int height); +void (*fp_gdk_drawable_get_size)(GdkDrawable *drawable, + gint* width, gint* height); + +/************************ + * Gtk function pointers + ************************/ +gboolean (*fp_gtk_init_check)(int* argc, char** argv); + +/* Painting */ +void (*fp_gtk_paint_hline)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GdkRectangle* area, GtkWidget* widget, + const gchar* detail, gint x1, gint x2, gint y); +void (*fp_gtk_paint_vline)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GdkRectangle* area, GtkWidget* widget, + const gchar* detail, gint y1, gint y2, gint x); +void (*fp_gtk_paint_shadow)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GtkShadowType shadow_type, + GdkRectangle* area, GtkWidget* widget, const gchar* detail, + gint x, gint y, gint width, gint height); +void (*fp_gtk_paint_arrow)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GtkShadowType shadow_type, + GdkRectangle* area, GtkWidget* widget, const gchar* detail, + GtkArrowType arrow_type, gboolean fill, gint x, gint y, + gint width, gint height); +void (*fp_gtk_paint_diamond)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GtkShadowType shadow_type, + GdkRectangle* area, GtkWidget* widget, const gchar* detail, + gint x, gint y, gint width, gint height); +void (*fp_gtk_paint_box)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GtkShadowType shadow_type, + GdkRectangle* area, GtkWidget* widget, const gchar* detail, + gint x, gint y, gint width, gint height); +void (*fp_gtk_paint_flat_box)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GtkShadowType shadow_type, + GdkRectangle* area, GtkWidget* widget, const gchar* detail, + gint x, gint y, gint width, gint height); +void (*fp_gtk_paint_check)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GtkShadowType shadow_type, + GdkRectangle* area, GtkWidget* widget, const gchar* detail, + gint x, gint y, gint width, gint height); +void (*fp_gtk_paint_option)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GtkShadowType shadow_type, + GdkRectangle* area, GtkWidget* widget, const gchar* detail, + gint x, gint y, gint width, gint height); +void (*fp_gtk_paint_box_gap)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GtkShadowType shadow_type, + GdkRectangle* area, GtkWidget* widget, const gchar* detail, + gint x, gint y, gint width, gint height, + GtkPositionType gap_side, gint gap_x, gint gap_width); +void (*fp_gtk_paint_extension)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GtkShadowType shadow_type, + GdkRectangle* area, GtkWidget* widget, const gchar* detail, + gint x, gint y, gint width, gint height, GtkPositionType gap_side); +void (*fp_gtk_paint_focus)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GdkRectangle* area, GtkWidget* widget, + const gchar* detail, gint x, gint y, gint width, gint height); +void (*fp_gtk_paint_slider)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GtkShadowType shadow_type, + GdkRectangle* area, GtkWidget* widget, const gchar* detail, + gint x, gint y, gint width, gint height, GtkOrientation orientation); +void (*fp_gtk_paint_handle)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GtkShadowType shadow_type, + GdkRectangle* area, GtkWidget* widget, const gchar* detail, + gint x, gint y, gint width, gint height, GtkOrientation orientation); +void (*fp_gtk_paint_expander)(GtkStyle* style, GdkWindow* window, + GtkStateType state_type, GdkRectangle* area, GtkWidget* widget, + const gchar* detail, gint x, gint y, GtkExpanderStyle expander_style); +void (*fp_gtk_style_apply_default_background)(GtkStyle* style, + GdkWindow* window, gboolean set_bg, GtkStateType state_type, + GdkRectangle* area, gint x, gint y, gint width, gint height); + +/* Widget creation */ +GtkWidget* (*fp_gtk_arrow_new)(GtkArrowType arrow_type, + GtkShadowType shadow_type); +GtkWidget* (*fp_gtk_button_new)(); +GtkWidget* (*fp_gtk_check_button_new)(); +GtkWidget* (*fp_gtk_check_menu_item_new)(); +GtkWidget* (*fp_gtk_color_selection_dialog_new)(const gchar* title); +GtkWidget* (*fp_gtk_combo_box_new)(); +GtkWidget* (*fp_gtk_combo_box_entry_new)(); +GtkWidget* (*fp_gtk_entry_new)(); +GtkWidget* (*fp_gtk_fixed_new)(); +GtkWidget* (*fp_gtk_handle_box_new)(); +GtkWidget* (*fp_gtk_hpaned_new)(); +GtkWidget* (*fp_gtk_vpaned_new)(); +GtkWidget* (*fp_gtk_hscale_new)(GtkAdjustment* adjustment); +GtkWidget* (*fp_gtk_vscale_new)(GtkAdjustment* adjustment); +GtkWidget* (*fp_gtk_hscrollbar_new)(GtkAdjustment* adjustment); +GtkWidget* (*fp_gtk_vscrollbar_new)(GtkAdjustment* adjustment); +GtkWidget* (*fp_gtk_hseparator_new)(); +GtkWidget* (*fp_gtk_vseparator_new)(); +GtkWidget* (*fp_gtk_image_new)(); +GtkWidget* (*fp_gtk_label_new)(const gchar* str); +GtkWidget* (*fp_gtk_menu_new)(); +GtkWidget* (*fp_gtk_menu_bar_new)(); +GtkWidget* (*fp_gtk_menu_item_new)(); +GtkWidget* (*fp_gtk_notebook_new)(); +GtkWidget* (*fp_gtk_progress_bar_new)(); +GtkWidget* (*fp_gtk_progress_bar_set_orientation)( + GtkProgressBar *pbar, + GtkProgressBarOrientation orientation); +GtkWidget* (*fp_gtk_radio_button_new)(GSList *group); +GtkWidget* (*fp_gtk_radio_menu_item_new)(GSList *group); +GtkWidget* (*fp_gtk_scrolled_window_new)(GtkAdjustment *hadjustment, + GtkAdjustment *vadjustment); +GtkWidget* (*fp_gtk_separator_menu_item_new)(); +GtkWidget* (*fp_gtk_separator_tool_item_new)(); +GtkWidget* (*fp_gtk_text_view_new)(); +GtkWidget* (*fp_gtk_toggle_button_new)(); +GtkWidget* (*fp_gtk_toolbar_new)(); +GtkWidget* (*fp_gtk_tree_view_new)(); +GtkWidget* (*fp_gtk_viewport_new)(GtkAdjustment *hadjustment, + GtkAdjustment *vadjustment); +GtkWidget* (*fp_gtk_window_new)(GtkWindowType type); +GtkWidget* (*fp_gtk_dialog_new)(); +GtkWidget* (*fp_gtk_spin_button_new)(GtkAdjustment *adjustment, + gdouble climb_rate, guint digits); +GtkWidget* (*fp_gtk_frame_new)(const gchar *label); + +/* Other widget operations */ +GtkObject* (*fp_gtk_adjustment_new)(gdouble value, + gdouble lower, gdouble upper, gdouble step_increment, + gdouble page_increment, gdouble page_size); +void (*fp_gtk_container_add)(GtkContainer *window, GtkWidget *widget); +void (*fp_gtk_menu_shell_append)(GtkMenuShell *menu_shell, + GtkWidget *child); +void (*fp_gtk_menu_item_set_submenu)(GtkMenuItem *menu_item, + GtkWidget *submenu); +void (*fp_gtk_widget_realize)(GtkWidget *widget); +GdkPixbuf* (*fp_gtk_widget_render_icon)(GtkWidget *widget, + const gchar *stock_id, GtkIconSize size, const gchar *detail); +void (*fp_gtk_widget_set_name)(GtkWidget *widget, const gchar *name); +void (*fp_gtk_widget_set_parent)(GtkWidget *widget, GtkWidget *parent); +void (*fp_gtk_widget_set_direction)(GtkWidget *widget, + GtkTextDirection direction); +void (*fp_gtk_widget_style_get)(GtkWidget *widget, + const gchar *first_property_name, ...); +void (*fp_gtk_widget_class_install_style_property)( + GtkWidgetClass* class, GParamSpec *pspec); +GParamSpec* (*fp_gtk_widget_class_find_style_property)( + GtkWidgetClass* class, const gchar* property_name); +void (*fp_gtk_widget_style_get_property)(GtkWidget* widget, + const gchar* property_name, GValue* value); +char* (*fp_pango_font_description_to_string)( + const PangoFontDescription* fd); +GtkSettings* (*fp_gtk_settings_get_default)(); +GtkSettings* (*fp_gtk_widget_get_settings)(GtkWidget *widget); +GType (*fp_gtk_border_get_type)(); +void (*fp_gtk_arrow_set)(GtkWidget* arrow, + GtkArrowType arrow_type, + GtkShadowType shadow_type); +void (*fp_gtk_widget_size_request)(GtkWidget *widget, + GtkRequisition *requisition); +GtkAdjustment* (*fp_gtk_range_get_adjustment)(GtkRange* range); + +void (*fp_g_free)(gpointer mem); +void (*fp_g_object_unref)(gpointer object); +int (*fp_gdk_pixbuf_get_bits_per_sample)(const GdkPixbuf *pixbuf); +guchar *(*fp_gdk_pixbuf_get_pixels)(const GdkPixbuf *pixbuf); +gboolean (*fp_gdk_pixbuf_get_has_alpha)(const GdkPixbuf *pixbuf); +int (*fp_gdk_pixbuf_get_height)(const GdkPixbuf *pixbuf); +int (*fp_gdk_pixbuf_get_n_channels)(const GdkPixbuf *pixbuf); +int (*fp_gdk_pixbuf_get_rowstride)(const GdkPixbuf *pixbuf); +int (*fp_gdk_pixbuf_get_width)(const GdkPixbuf *pixbuf); +GdkPixbuf *(*fp_gdk_pixbuf_new_from_file)(const char *filename, GError **error); +void (*fp_gtk_widget_destroy)(GtkWidget *widget); +void (*fp_gtk_window_present)(GtkWindow *window); +void (*fp_gtk_window_move)(GtkWindow *window, gint x, gint y); +void (*fp_gtk_window_resize)(GtkWindow *window, gint width, gint height); + +/** + * Function Pointers for GtkFileChooser + */ +gchar* (*fp_gtk_file_chooser_get_filename)(GtkFileChooser *chooser); +void (*fp_gtk_widget_hide)(GtkWidget *widget); +void (*fp_gtk_main_quit)(void); +GtkWidget* (*fp_gtk_file_chooser_dialog_new)(const gchar *title, + GtkWindow *parent, GtkFileChooserAction action, + const gchar *first_button_text, ...); +gboolean (*fp_gtk_file_chooser_set_current_folder)(GtkFileChooser *chooser, + const gchar *filename); +gboolean (*fp_gtk_file_chooser_set_filename)(GtkFileChooser *chooser, + const char *filename); +void (*fp_gtk_file_chooser_set_current_name)(GtkFileChooser *chooser, + const gchar *name); +void (*fp_gtk_file_filter_add_custom)(GtkFileFilter *filter, + GtkFileFilterFlags needed, GtkFileFilterFunc func, gpointer data, + GDestroyNotify notify); +void (*fp_gtk_file_chooser_set_filter)(GtkFileChooser *chooser, + GtkFileFilter *filter); +GType (*fp_gtk_file_chooser_get_type)(void); +GtkFileFilter* (*fp_gtk_file_filter_new)(void); +void (*fp_gtk_file_chooser_set_do_overwrite_confirmation)( + GtkFileChooser *chooser, gboolean do_overwrite_confirmation); +void (*fp_gtk_file_chooser_set_select_multiple)( + GtkFileChooser *chooser, gboolean select_multiple); +gchar* (*fp_gtk_file_chooser_get_current_folder)(GtkFileChooser *chooser); +GSList* (*fp_gtk_file_chooser_get_filenames)(GtkFileChooser *chooser); +guint (*fp_gtk_g_slist_length)(GSList *list); +gulong (*fp_g_signal_connect_data)(gpointer instance, + const gchar *detailed_signal, GCallback c_handler, gpointer data, + GClosureNotify destroy_data, GConnectFlags connect_flags); +void (*fp_gtk_widget_show)(GtkWidget *widget); +void (*fp_gtk_main)(void); +guint (*fp_gtk_main_level)(void); + +/** + * Returns : + * NULL if the GTK+ library is compatible with the given version, or a string + * describing the version mismatch. + */ +gchar* (*fp_gtk_check_version)(guint required_major, guint required_minor, + guint required_micro); + +void (*fp_g_thread_init)(GThreadFunctions *vtable); +void (*fp_gdk_threads_init)(void); +void (*fp_gdk_threads_enter)(void); +void (*fp_gdk_threads_leave)(void); + +/* Glib */ +#define g_main_context_iteration (*fp_g_main_context_iteration) +#define g_value_init (*fp_g_value_init) +#define g_type_is_a (*fp_g_type_is_a) +#define g_value_get_boolean (*fp_g_value_get_boolean) +#define g_value_get_char (*fp_g_value_get_char) +#define g_value_get_uchar (*fp_g_value_get_uchar) +#define g_value_get_int (*fp_g_value_get_int) +#define g_value_get_uint (*fp_g_value_get_uint) +#define g_value_get_long (*fp_g_value_get_long) +#define g_value_get_ulong (*fp_g_value_get_ulong) +#define g_value_get_int64 (*fp_g_value_get_int64) +#define g_value_get_uint64 (*fp_g_value_get_uint64) +#define g_value_get_float (*fp_g_value_get_float) +#define g_value_get_double (*fp_g_value_get_double) +#define g_value_get_string (*fp_g_value_get_string) +#define g_value_get_enum (*fp_g_value_get_enum) +#define g_value_get_flags (*fp_g_value_get_flags) +#define g_value_get_param (*fp_g_value_get_param) +#define g_value_get_boxed (*fp_g_value_get_boxed) +#define g_value_get_object (*fp_g_value_get_object) +#define g_param_spec_int (*fp_g_param_spec_int) +#define g_object_get (*fp_g_object_get) +#define g_object_set (*fp_g_object_set) +#define g_thread_init (*fp_g_thread_init) +#define g_object_unref (*fp_g_object_unref) +#define g_free (*fp_g_free) +#define g_slist_length (*fp_gtk_g_slist_length) +#define g_signal_connect_data (*fp_g_signal_connect_data) + +/* GDK */ +#define gdk_pixmap_new (*fp_gdk_pixmap_new) +#define gdk_gc_new (*fp_gdk_gc_new) +#define gdk_rgb_gc_set_foreground (*fp_gdk_rgb_gc_set_foreground) +#define gdk_draw_rectangle (*fp_gdk_draw_rectangle) +#define gdk_pixbuf_get_from_drawable (*fp_gdk_pixbuf_get_from_drawable) +#define gdk_drawable_get_size (*fp_gdk_drawable_get_size) +#define gdk_threads_leave (*fp_gdk_threads_leave) +#define gdk_threads_init (*fp_gdk_threads_init) +#define gdk_threads_enter (*fp_gdk_threads_enter) + +/************************ + * Gtk function pointers + ************************/ +#define gtk_init_check (*fp_gtk_init_check) + +/* Painting */ +#define gtk_paint_hline (*fp_gtk_paint_hline) +#define gtk_paint_vline (*fp_gtk_paint_vline) +#define gtk_paint_shadow (*fp_gtk_paint_shadow) +#define gtk_paint_arrow (*fp_gtk_paint_arrow) +#define gtk_paint_diamond (*fp_gtk_paint_diamond) +#define gtk_paint_box (*fp_gtk_paint_box) +#define gtk_paint_flat_box (*fp_gtk_paint_flat_box) +#define gtk_paint_check (*fp_gtk_paint_check) +#define gtk_paint_option (*fp_gtk_paint_option) +#define gtk_paint_box_gap (*fp_gtk_paint_box_gap) +#define gtk_paint_extension (*fp_gtk_paint_extension) +#define gtk_paint_focus (*fp_gtk_paint_focus) +#define gtk_paint_slider (*fp_gtk_paint_slider) +#define gtk_paint_handle (*fp_gtk_paint_handle) +#define gtk_paint_expander (*fp_gtk_paint_expander) +#define gtk_style_apply_default_background (*fp_gtk_style_apply_default_background) + +/* Widget creation */ +#define gtk_arrow_new (*fp_gtk_arrow_new) +#define gtk_button_new (*fp_gtk_button_new) +#define gtk_check_button_new (*fp_gtk_check_button_new) +#define gtk_check_menu_item_new (*fp_gtk_check_menu_item_new) +#define gtk_color_selection_dialog_new (*fp_gtk_color_selection_dialog_new) +#define gtk_combo_box_new (*fp_gtk_combo_box_new) +#define gtk_combo_box_entry_new (*fp_gtk_combo_box_entry_new) +#define gtk_entry_new (*fp_gtk_entry_new) +#define gtk_fixed_new (*fp_gtk_fixed_new) +#define gtk_handle_box_new (*fp_gtk_handle_box_new) +#define gtk_hpaned_new (*fp_gtk_hpaned_new) +#define gtk_vpaned_new (*fp_gtk_vpaned_new) +#define gtk_hscale_new (*fp_gtk_hscale_new) +#define gtk_vscale_new (*fp_gtk_vscale_new) +#define gtk_hscrollbar_new (*fp_gtk_hscrollbar_new) +#define gtk_vscrollbar_new (*fp_gtk_vscrollbar_new) +#define gtk_hseparator_new (*fp_gtk_hseparator_new) +#define gtk_vseparator_new (*fp_gtk_vseparator_new) +#define gtk_image_new (*fp_gtk_image_new) +#define gtk_label_new (*fp_gtk_label_new) +#define gtk_menu_new (*fp_gtk_menu_new) +#define gtk_menu_bar_new (*fp_gtk_menu_bar_new) +#define gtk_menu_item_new (*fp_gtk_menu_item_new) +#define gtk_notebook_new (*fp_gtk_notebook_new) +#define gtk_progress_bar_new (*fp_gtk_progress_bar_new) +#define gtk_progress_bar_set_orientation (*fp_gtk_progress_bar_set_orientation) +#define gtk_radio_button_new (*fp_gtk_radio_button_new) +#define gtk_radio_menu_item_new (*fp_gtk_radio_menu_item_new) +#define gtk_scrolled_window_new (*fp_gtk_scrolled_window_new) +#define gtk_separator_menu_item_new (*fp_gtk_separator_menu_item_new) +#define gtk_separator_tool_item_new (*fp_gtk_separator_tool_item_new) +#define gtk_text_view_new (*fp_gtk_text_view_new) +#define gtk_toggle_button_new (*fp_gtk_toggle_button_new) +#define gtk_toolbar_new (*fp_gtk_toolbar_new) +#define gtk_tree_view_new (*fp_gtk_tree_view_new) +#define gtk_viewport_new (*fp_gtk_viewport_new) +#define gtk_window_new (*fp_gtk_window_new) +#define gtk_dialog_new (*fp_gtk_dialog_new) +#define gtk_spin_button_new (*fp_gtk_spin_button_new) +#define gtk_frame_new (*fp_gtk_frame_new) + +/* Other widget operations */ +#define gtk_adjustment_new (*fp_gtk_adjustment_new) +#define gtk_container_add (*fp_gtk_container_add) +#define gtk_menu_shell_append (*fp_gtk_menu_shell_append) +#define gtk_menu_item_set_submenu (*fp_gtk_menu_item_set_submenu) +#define gtk_widget_realize (*fp_gtk_widget_realize) +#define gtk_widget_render_icon (*fp_gtk_widget_render_icon) +#define gtk_widget_set_name (*fp_gtk_widget_set_name) +#define gtk_widget_set_parent (*fp_gtk_widget_set_parent) +#define gtk_widget_set_direction (*fp_gtk_widget_set_direction) +#define gtk_widget_style_get (*fp_gtk_widget_style_get) +#define gtk_widget_class_install_style_property (*fp_gtk_widget_class_install_style_property) +#define gtk_widget_class_find_style_property (*fp_gtk_widget_class_find_style_property) +#define gtk_widget_style_get_property (*fp_gtk_widget_style_get_property) +#define pango_font_description_to_string (*fp_pango_font_description_to_string) +#define gtk_settings_get_default (*fp_gtk_settings_get_default) +#define gtk_widget_get_settings (*fp_gtk_widget_get_settings) +#define gtk_border_get_type (*fp_gtk_border_get_type) +#define gtk_arrow_set (*fp_gtk_arrow_set) +#define gtk_widget_size_request (*fp_gtk_widget_size_request) +#define gtk_range_get_adjustment (*fp_gtk_range_get_adjustment) +#define gtk_widget_destroy (*fp_gtk_widget_destroy) +#define gtk_window_present (*fp_gtk_window_present) +#define gtk_window_move (*fp_gtk_window_move) +#define gtk_window_resize (*fp_gtk_window_resize) +#define gtk_widget_show (*fp_gtk_widget_show) +#define gtk_widget_hide (*fp_gtk_widget_hide) +#define gtk_main (*fp_gtk_main) +#define gtk_main_level (*fp_gtk_main_level) +#define gtk_main_quit (*fp_gtk_main_quit) +#define gtk_check_version (*fp_gtk_check_version) +#define gtk_init_check (*fp_gtk_init_check) + +/* GdkPixbuf */ +#define gdk_pixbuf_get_bits_per_sample (*fp_gdk_pixbuf_get_bits_per_sample) +#define gdk_pixbuf_get_pixels (*fp_gdk_pixbuf_get_pixels) +#define gdk_pixbuf_get_has_alpha (*fp_gdk_pixbuf_get_has_alpha) +#define gdk_pixbuf_get_height (*fp_gdk_pixbuf_get_height) +#define gdk_pixbuf_get_n_channels (*fp_gdk_pixbuf_get_n_channels) +#define gdk_pixbuf_get_rowstride (*fp_gdk_pixbuf_get_rowstride) +#define gdk_pixbuf_get_width (*fp_gdk_pixbuf_get_width) +#define gdk_pixbuf_new_from_file (*fp_gdk_pixbuf_new_from_file) +#define gdk_pixbuf_new (*fp_gdk_pixbuf_new) + +/* GtkFileChooser */ +#define gtk_file_chooser_get_filename (*fp_gtk_file_chooser_get_filename) +#define gtk_file_chooser_dialog_new (*fp_gtk_file_chooser_dialog_new) +#define gtk_file_chooser_set_current_folder (*fp_gtk_file_chooser_set_current_folder) +#define gtk_file_chooser_set_filename (*fp_gtk_file_chooser_set_filename) +#define gtk_file_chooser_set_current_name (*fp_gtk_file_chooser_set_current_name) +#define gtk_file_chooser_set_filter (*fp_gtk_file_chooser_set_filter) +#define gtk_file_chooser_get_type (*fp_gtk_file_chooser_get_type) +#define gtk_file_chooser_set_do_overwrite_confirmation (*fp_gtk_file_chooser_set_do_overwrite_confirmation) +#define gtk_file_chooser_set_select_multiple (*fp_gtk_file_chooser_set_select_multiple) +#define gtk_file_chooser_get_current_folder (*fp_gtk_file_chooser_get_current_folder) +#define gtk_file_chooser_get_filenames (*fp_gtk_file_chooser_get_filenames) +#define gtk_file_filter_add_custom (*fp_gtk_file_filter_add_custom) +#define gtk_file_filter_new (*fp_gtk_file_filter_new) + +#endif /* __GTK_FP_H__ */
--- a/src/solaris/native/sun/awt/cups_fp.c Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include <dlfcn.h> -#include <jni.h> - -#include <cups/cups.h> -#include <cups/ppd.h> - -#include <cups_fp.h> - -jboolean cups_init() -{ - void *handle = dlopen("libcups.so.2", RTLD_LAZY | RTLD_GLOBAL); - - if (handle == NULL) { - handle = dlopen("libcups.so", RTLD_LAZY | RTLD_GLOBAL); - if (handle == NULL) { - return JNI_FALSE; - } - } - - j2d_cupsServer = (fn_cupsServer)dlsym(handle, "cupsServer"); - if (j2d_cupsServer == NULL) { - dlclose(handle); - return JNI_FALSE; - } - - j2d_ippPort = (fn_ippPort)dlsym(handle, "ippPort"); - if (j2d_ippPort == NULL) { - dlclose(handle); - return JNI_FALSE; - } - - j2d_httpConnect = (fn_httpConnect)dlsym(handle, "httpConnect"); - if (j2d_httpConnect == NULL) { - dlclose(handle); - return JNI_FALSE; - } - - j2d_httpClose = (fn_httpClose)dlsym(handle, "httpClose"); - if (j2d_httpClose == NULL) { - dlclose(handle); - return JNI_FALSE; - } - - j2d_cupsGetPPD = (fn_cupsGetPPD)dlsym(handle, "cupsGetPPD"); - if (j2d_cupsGetPPD == NULL) { - dlclose(handle); - return JNI_FALSE; - } - - j2d_ppdOpenFile = (fn_ppdOpenFile)dlsym(handle, "ppdOpenFile"); - if (j2d_ppdOpenFile == NULL) { - dlclose(handle); - return JNI_FALSE; - - } - - j2d_ppdClose = (fn_ppdClose)dlsym(handle, "ppdClose"); - if (j2d_ppdClose == NULL) { - dlclose(handle); - return JNI_FALSE; - - } - - j2d_ppdFindOption = (fn_ppdFindOption)dlsym(handle, "ppdFindOption"); - if (j2d_ppdFindOption == NULL) { - dlclose(handle); - return JNI_FALSE; - } - - j2d_ppdPageSize = (fn_ppdPageSize)dlsym(handle, "ppdPageSize"); - if (j2d_ppdPageSize == NULL) { - dlclose(handle); - return JNI_FALSE; - } - - return JNI_TRUE; -}
--- a/src/solaris/native/sun/awt/cups_fp.h Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef __CUPS_FP_H__ -#define __CUPS_FP_H__ - -typedef const char* (*fn_cupsServer)(void); -typedef int (*fn_ippPort)(void); -typedef http_t* (*fn_httpConnect)(const char *, int); -typedef void (*fn_httpClose)(http_t *); -typedef char* (*fn_cupsGetPPD)(const char *); -typedef ppd_file_t* (*fn_ppdOpenFile)(const char *); -typedef void (*fn_ppdClose)(ppd_file_t *); -typedef ppd_option_t* (*fn_ppdFindOption)(ppd_file_t *, const char *); -typedef ppd_size_t* (*fn_ppdPageSize)(ppd_file_t *, char *); - -fn_cupsServer j2d_cupsServer; -fn_ippPort j2d_ippPort; -fn_httpConnect j2d_httpConnect; -fn_httpClose j2d_httpClose; -fn_cupsGetPPD j2d_cupsGetPPD; -fn_ppdOpenFile j2d_ppdOpenFile; -fn_ppdClose j2d_ppdClose; -fn_ppdFindOption j2d_ppdFindOption; -fn_ppdPageSize j2d_ppdPageSize; - -#define cupsServer (*j2d_cupsServer) -#define ippPort (*j2d_ippPort) -#define httpConnect (*j2d_httpConnect) -#define httpClose (*j2d_httpClose) -#define cupsGetPPD (*j2d_cupsGetPPD) -#define ppdOpenFile (*j2d_ppdOpenFile) -#define ppdClose (*j2d_ppdClose) -#define ppdFindOption (*j2d_ppdFindOption) -#define ppdPageSize (*j2d_ppdPageSize) - -jboolean cups_init(); - -#endif
--- a/src/solaris/native/sun/awt/gtk2/gtk/gtk.h Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,567 +0,0 @@ -/* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -#ifndef __GTK_H__ -#define __GTK_H__ - -#define _G_TYPE_CIC(ip, gt, ct) ((ct*) ip) -#define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type)) -#define GTK_TYPE_FILE_CHOOSER (fp_gtk_file_chooser_get_type ()) -#define GTK_FILE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_CHOOSER, GtkFileChooser)) -#define fp_g_signal_connect(instance, detailed_signal, c_handler, data) \ - fp_g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0) -#define G_CALLBACK(f) ((GCallback) (f)) -#define G_TYPE_FUNDAMENTAL_SHIFT (2) -#define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) -#define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) -#define G_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_OBJECT, GObject)) -#define GTK_STOCK_CANCEL "gtk-cancel" -#define GTK_STOCK_SAVE "gtk-save" -#define GTK_STOCK_OPEN "gtk-open" - -/* GTK types, here to eliminate need for GTK headers at compile time */ - -#ifndef FALSE -#define FALSE (0) -#define TRUE (!FALSE) -#endif - -#define GTK_HAS_FOCUS (1 << 12) -#define GTK_HAS_DEFAULT (1 << 14) - - -/* basic types */ -typedef char gchar; -typedef short gshort; -typedef int gint; -typedef long glong; -typedef float gfloat; -typedef double gdouble; -typedef void* gpointer; -typedef gint gboolean; - -typedef signed char gint8; -typedef signed short gint16; -typedef signed int gint32; - -typedef unsigned char guchar; -typedef unsigned char guint8; -typedef unsigned short gushort; -typedef unsigned short guint16; -typedef unsigned int guint; -typedef unsigned int guint32; -typedef unsigned int gsize; -typedef unsigned long gulong; - -typedef signed long long gint64; -typedef unsigned long long guint64; - -/* enumerated constants */ -typedef enum -{ - GTK_ARROW_UP, - GTK_ARROW_DOWN, - GTK_ARROW_LEFT, - GTK_ARROW_RIGHT -} GtkArrowType; - -typedef enum { - GDK_COLORSPACE_RGB -} GdkColorspace; - -typedef enum -{ - GTK_EXPANDER_COLLAPSED, - GTK_EXPANDER_SEMI_COLLAPSED, - GTK_EXPANDER_SEMI_EXPANDED, - GTK_EXPANDER_EXPANDED -} GtkExpanderStyle; - -typedef enum -{ - GTK_ICON_SIZE_INVALID, - GTK_ICON_SIZE_MENU, - GTK_ICON_SIZE_SMALL_TOOLBAR, - GTK_ICON_SIZE_LARGE_TOOLBAR, - GTK_ICON_SIZE_BUTTON, - GTK_ICON_SIZE_DND, - GTK_ICON_SIZE_DIALOG -} GtkIconSize; - -typedef enum -{ - GTK_ORIENTATION_HORIZONTAL, - GTK_ORIENTATION_VERTICAL -} GtkOrientation; - -typedef enum -{ - GTK_POS_LEFT, - GTK_POS_RIGHT, - GTK_POS_TOP, - GTK_POS_BOTTOM -} GtkPositionType; - -typedef enum -{ - GTK_SHADOW_NONE, - GTK_SHADOW_IN, - GTK_SHADOW_OUT, - GTK_SHADOW_ETCHED_IN, - GTK_SHADOW_ETCHED_OUT -} GtkShadowType; - -typedef enum -{ - GTK_STATE_NORMAL, - GTK_STATE_ACTIVE, - GTK_STATE_PRELIGHT, - GTK_STATE_SELECTED, - GTK_STATE_INSENSITIVE -} GtkStateType; - -typedef enum -{ - GTK_TEXT_DIR_NONE, - GTK_TEXT_DIR_LTR, - GTK_TEXT_DIR_RTL -} GtkTextDirection; - -typedef enum -{ - GTK_WINDOW_TOPLEVEL, - GTK_WINDOW_POPUP -} GtkWindowType; - -typedef enum -{ - G_PARAM_READABLE = 1 << 0, - G_PARAM_WRITABLE = 1 << 1, - G_PARAM_CONSTRUCT = 1 << 2, - G_PARAM_CONSTRUCT_ONLY = 1 << 3, - G_PARAM_LAX_VALIDATION = 1 << 4, - G_PARAM_PRIVATE = 1 << 5 -} GParamFlags; - -/* We define all structure pointers to be void* */ -typedef void GError; -typedef void GMainContext; - -typedef struct _GSList GSList; -struct _GSList -{ - gpointer data; - GSList *next; -}; - -typedef void GdkColormap; -typedef void GdkDrawable; -typedef void GdkGC; -typedef void GdkPixbuf; -typedef void GdkPixmap; -typedef void GdkWindow; - -typedef void GtkFixed; -typedef void GtkMenuItem; -typedef void GtkMenuShell; -typedef void GtkWidgetClass; -typedef void PangoFontDescription; -typedef void GtkSettings; - -/* Some real structures */ -typedef struct -{ - guint32 pixel; - guint16 red; - guint16 green; - guint16 blue; -} GdkColor; - -typedef struct { - gint fd; - gushort events; - gushort revents; -} GPollFD; - -typedef struct { - gint x; - gint y; - gint width; - gint height; -} GdkRectangle; - -typedef struct { - gint x; - gint y; - gint width; - gint height; -} GtkAllocation; - -typedef struct { - gint width; - gint height; -} GtkRequisition; - -typedef struct { - GtkWidgetClass *g_class; -} GTypeInstance; - -typedef struct { - gint left; - gint right; - gint top; - gint bottom; -} GtkBorder; - -/****************************************************** - * FIXME: it is more safe to include gtk headers for - * the precise type definition of GType and other - * structures. This is a place where getting rid of gtk - * headers may be dangerous. - ******************************************************/ -typedef gulong GType; - -typedef struct -{ - GType g_type; - - union { - gint v_int; - guint v_uint; - glong v_long; - gulong v_ulong; - gint64 v_int64; - guint64 v_uint64; - gfloat v_float; - gdouble v_double; - gpointer v_pointer; - } data[2]; -} GValue; - -typedef struct -{ - GTypeInstance g_type_instance; - - gchar *name; - GParamFlags flags; - GType value_type; - GType owner_type; -} GParamSpec; - -typedef struct { - GTypeInstance g_type_instance; - guint ref_count; - void *qdata; -} GObject; - -typedef struct { - GObject parent_instance; - guint32 flags; -} GtkObject; - -typedef struct -{ - GObject parent_instance; - - GdkColor fg[5]; - GdkColor bg[5]; - GdkColor light[5]; - GdkColor dark[5]; - GdkColor mid[5]; - GdkColor text[5]; - GdkColor base[5]; - GdkColor text_aa[5]; /* Halfway between text/base */ - - GdkColor black; - GdkColor white; - PangoFontDescription *font_desc; - - gint xthickness; - gint ythickness; - - GdkGC *fg_gc[5]; - GdkGC *bg_gc[5]; - GdkGC *light_gc[5]; - GdkGC *dark_gc[5]; - GdkGC *mid_gc[5]; - GdkGC *text_gc[5]; - GdkGC *base_gc[5]; - GdkGC *text_aa_gc[5]; - GdkGC *black_gc; - GdkGC *white_gc; - - GdkPixmap *bg_pixmap[5]; -} GtkStyle; - -typedef struct _GtkWidget GtkWidget; -struct _GtkWidget -{ - GtkObject object; - guint16 private_flags; - guint8 state; - guint8 saved_state; - gchar *name; - GtkStyle *style; - GtkRequisition requisition; - GtkAllocation allocation; - GdkWindow *window; - GtkWidget *parent; -}; - -typedef struct -{ - GtkWidget widget; - - gfloat xalign; - gfloat yalign; - - guint16 xpad; - guint16 ypad; -} GtkMisc; - -typedef struct { - GtkWidget widget; - GtkWidget *focus_child; - guint border_width : 16; - guint need_resize : 1; - guint resize_mode : 2; - guint reallocate_redraws : 1; - guint has_focus_chain : 1; -} GtkContainer; - -typedef struct { - GtkContainer container; - GtkWidget *child; -} GtkBin; - -typedef struct { - GtkBin bin; - GdkWindow *event_window; - gchar *label_text; - guint activate_timeout; - guint constructed : 1; - guint in_button : 1; - guint button_down : 1; - guint relief : 2; - guint use_underline : 1; - guint use_stock : 1; - guint depressed : 1; - guint depress_on_activate : 1; - guint focus_on_click : 1; -} GtkButton; - -typedef struct { - GtkButton button; - guint active : 1; - guint draw_indicator : 1; - guint inconsistent : 1; -} GtkToggleButton; - -typedef struct _GtkAdjustment GtkAdjustment; -struct _GtkAdjustment -{ - GtkObject parent_instance; - - gdouble lower; - gdouble upper; - gdouble value; - gdouble step_increment; - gdouble page_increment; - gdouble page_size; -}; - -typedef enum -{ - GTK_UPDATE_CONTINUOUS, - GTK_UPDATE_DISCONTINUOUS, - GTK_UPDATE_DELAYED -} GtkUpdateType; - -typedef struct _GtkRange GtkRange; -struct _GtkRange -{ - GtkWidget widget; - GtkAdjustment *adjustment; - GtkUpdateType update_policy; - guint inverted : 1; - /*< protected >*/ - guint flippable : 1; - guint has_stepper_a : 1; - guint has_stepper_b : 1; - guint has_stepper_c : 1; - guint has_stepper_d : 1; - guint need_recalc : 1; - guint slider_size_fixed : 1; - gint min_slider_size; - GtkOrientation orientation; - GdkRectangle range_rect; - gint slider_start, slider_end; - gint round_digits; - /*< private >*/ - guint trough_click_forward : 1; - guint update_pending : 1; - /*GtkRangeLayout * */ void *layout; - /*GtkRangeStepTimer * */ void* timer; - gint slide_initial_slider_position; - gint slide_initial_coordinate; - guint update_timeout_id; - GdkWindow *event_window; -}; - -typedef struct _GtkProgressBar GtkProgressBar; - -typedef enum -{ - GTK_PROGRESS_CONTINUOUS, - GTK_PROGRESS_DISCRETE -} GtkProgressBarStyle; - -typedef enum -{ - GTK_PROGRESS_LEFT_TO_RIGHT, - GTK_PROGRESS_RIGHT_TO_LEFT, - GTK_PROGRESS_BOTTOM_TO_TOP, - GTK_PROGRESS_TOP_TO_BOTTOM -} GtkProgressBarOrientation; - -typedef struct _GtkProgress GtkProgress; - -struct _GtkProgress -{ - GtkWidget widget; - GtkAdjustment *adjustment; - GdkPixmap *offscreen_pixmap; - gchar *format; - gfloat x_align; - gfloat y_align; - guint show_text : 1; - guint activity_mode : 1; - guint use_text_format : 1; -}; - -struct _GtkProgressBar -{ - GtkProgress progress; - GtkProgressBarStyle bar_style; - GtkProgressBarOrientation orientation; - guint blocks; - gint in_block; - gint activity_pos; - guint activity_step; - guint activity_blocks; - gdouble pulse_fraction; - guint activity_dir : 1; - guint ellipsize : 3; -}; - -typedef enum { - GTK_RESPONSE_NONE = -1, - GTK_RESPONSE_REJECT = -2, - GTK_RESPONSE_ACCEPT = -3, - GTK_RESPONSE_DELETE_EVENT = -4, - GTK_RESPONSE_OK = -5, - GTK_RESPONSE_CANCEL = -6, - GTK_RESPONSE_CLOSE = -7, - GTK_RESPONSE_YES = -8, - GTK_RESPONSE_NO = -9, - GTK_RESPONSE_APPLY = -10, - GTK_RESPONSE_HELP = -11 -} GtkResponseType; - -typedef struct _GtkWindow GtkWindow; - -typedef struct _GtkFileChooser GtkFileChooser; - -typedef enum { - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_FILE_CHOOSER_ACTION_SAVE, - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, - GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER -} GtkFileChooserAction; - -typedef struct _GtkFileFilter GtkFileFilter; - -typedef enum { - GTK_FILE_FILTER_FILENAME = 1 << 0, - GTK_FILE_FILTER_URI = 1 << 1, - GTK_FILE_FILTER_DISPLAY_NAME = 1 << 2, - GTK_FILE_FILTER_MIME_TYPE = 1 << 3 -} GtkFileFilterFlags; - -typedef struct { - GtkFileFilterFlags contains; - const gchar *filename; - const gchar *uri; - const gchar *display_name; - const gchar *mime_type; -} GtkFileFilterInfo; - -typedef gboolean (*GtkFileFilterFunc)(const GtkFileFilterInfo *filter_info, - gpointer data); - -typedef void (*GDestroyNotify)(gpointer data); - -typedef void (*GCallback)(void); - -typedef struct _GClosure GClosure; - -typedef void (*GClosureNotify)(gpointer data, GClosure *closure); - -typedef enum { - G_CONNECT_AFTER = 1 << 0, G_CONNECT_SWAPPED = 1 << 1 -} GConnectFlags; - -typedef struct _GThreadFunctions GThreadFunctions; - -#define G_TYPE_INVALID G_TYPE_MAKE_FUNDAMENTAL (0) -#define G_TYPE_NONE G_TYPE_MAKE_FUNDAMENTAL (1) -#define G_TYPE_INTERFACE G_TYPE_MAKE_FUNDAMENTAL (2) -#define G_TYPE_CHAR G_TYPE_MAKE_FUNDAMENTAL (3) -#define G_TYPE_UCHAR G_TYPE_MAKE_FUNDAMENTAL (4) -#define G_TYPE_BOOLEAN G_TYPE_MAKE_FUNDAMENTAL (5) -#define G_TYPE_INT G_TYPE_MAKE_FUNDAMENTAL (6) -#define G_TYPE_UINT G_TYPE_MAKE_FUNDAMENTAL (7) -#define G_TYPE_LONG G_TYPE_MAKE_FUNDAMENTAL (8) -#define G_TYPE_ULONG G_TYPE_MAKE_FUNDAMENTAL (9) -#define G_TYPE_INT64 G_TYPE_MAKE_FUNDAMENTAL (10) -#define G_TYPE_UINT64 G_TYPE_MAKE_FUNDAMENTAL (11) -#define G_TYPE_ENUM G_TYPE_MAKE_FUNDAMENTAL (12) -#define G_TYPE_FLAGS G_TYPE_MAKE_FUNDAMENTAL (13) -#define G_TYPE_FLOAT G_TYPE_MAKE_FUNDAMENTAL (14) -#define G_TYPE_DOUBLE G_TYPE_MAKE_FUNDAMENTAL (15) -#define G_TYPE_STRING G_TYPE_MAKE_FUNDAMENTAL (16) -#define G_TYPE_POINTER G_TYPE_MAKE_FUNDAMENTAL (17) -#define G_TYPE_BOXED G_TYPE_MAKE_FUNDAMENTAL (18) -#define G_TYPE_PARAM G_TYPE_MAKE_FUNDAMENTAL (19) -#define G_TYPE_OBJECT G_TYPE_MAKE_FUNDAMENTAL (20) - -#define GTK_TYPE_BORDER gtk_border_get_type() - -#define G_TYPE_FUNDAMENTAL_SHIFT (2) -#define G_TYPE_MAKE_FUNDAMENTAL(x) ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT)) - -#define g_signal_connect(instance, detailed_signal, c_handler, data) \ - g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0) - -#endif /* __GTK_H__ */
--- a/src/solaris/native/sun/awt/gtk2/gtk_fp.c Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,385 +0,0 @@ -/* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -#include <dlfcn.h> -#include <setjmp.h> -#include <stddef.h> - -#include "gtk_fp.h" - -#define GTK2_LIB "libgtk-x11-2.0.so.0" -#define GTHREAD_LIB "libgthread-2.0.so.0" -#define NO_SYMBOL_EXCEPTION 1 - -static gboolean new_combo_used = TRUE; -static void *gtk2_libhandle = NULL; -static void *gthread_libhandle = NULL; -static jmp_buf j; - -/* This is a workaround for the bug: - * http://sourceware.org/bugzilla/show_bug.cgi?id=1814 - * (dlsym/dlopen clears dlerror state) - * This bug is specific to Linux, but there is no harm in - * applying this workaround on Solaris as well. - */ -static void* dl_symbol(const char* name) -{ - void* result = dlsym(gtk2_libhandle, name); - if (!result) - longjmp(j, NO_SYMBOL_EXCEPTION); - - return result; -} - -static void* dl_symbol_gthread(const char* name) -{ - void* result = dlsym(gthread_libhandle, name); - if (!result) - longjmp(j, NO_SYMBOL_EXCEPTION); - - return result; -} - -gboolean gtk2_check_dlversion() -{ - if (gtk2_libhandle != NULL) { - /* We've already successfully opened the GTK libs, so return true. */ - return TRUE; - } - void *lib = NULL; - gboolean result = FALSE; - - lib = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL); - if (lib == NULL) { - return FALSE; - } - - fp_gtk_check_version = dlsym(lib, "gtk_check_version"); - /* Check for GTK 2.2+ */ - if (!fp_gtk_check_version(2, 2, 0)) { - result = TRUE; - } - - dlclose(lib); - - return result; -} - -/** - * Functions for sun_awt_X11_GtkFileDialogPeer.c - */ -void gtk2_file_chooser_load() -{ - fp_gtk_file_chooser_get_filename = dl_symbol( - "gtk_file_chooser_get_filename"); - fp_gtk_file_chooser_dialog_new = dl_symbol("gtk_file_chooser_dialog_new"); - fp_gtk_file_chooser_set_current_folder = dl_symbol( - "gtk_file_chooser_set_current_folder"); - fp_gtk_file_chooser_set_filename = dl_symbol( - "gtk_file_chooser_set_filename"); - fp_gtk_file_chooser_set_current_name = dl_symbol( - "gtk_file_chooser_set_current_name"); - fp_gtk_file_filter_add_custom = dl_symbol("gtk_file_filter_add_custom"); - fp_gtk_file_chooser_set_filter = dl_symbol("gtk_file_chooser_set_filter"); - fp_gtk_file_chooser_get_type = dl_symbol("gtk_file_chooser_get_type"); - fp_gtk_file_filter_new = dl_symbol("gtk_file_filter_new"); - if (fp_gtk_check_version(2, 8, 0) == NULL) { - fp_gtk_file_chooser_set_do_overwrite_confirmation = dl_symbol( - "gtk_file_chooser_set_do_overwrite_confirmation"); - } - fp_gtk_file_chooser_set_select_multiple = dl_symbol( - "gtk_file_chooser_set_select_multiple"); - fp_gtk_file_chooser_get_current_folder = dl_symbol( - "gtk_file_chooser_get_current_folder"); - fp_gtk_file_chooser_get_filenames = dl_symbol( - "gtk_file_chooser_get_filenames"); - fp_gtk_g_slist_length = dl_symbol("g_slist_length"); -} - -gboolean gtk2_dlload() -{ - gtk2_libhandle = dlopen(GTK2_LIB, RTLD_LAZY | RTLD_LOCAL); - gthread_libhandle = dlopen(GTHREAD_LIB, RTLD_LAZY | RTLD_LOCAL); - - if (gtk2_libhandle == NULL || gthread_libhandle == NULL) - return FALSE; - - if (setjmp(j) == 0) - { - fp_gtk_check_version = dl_symbol("gtk_check_version"); - /* Check for GTK 2.2+ */ - if (fp_gtk_check_version(2, 2, 0)) { - longjmp(j, NO_SYMBOL_EXCEPTION); - } - - /* GLib */ - fp_g_free = dl_symbol("g_free"); - fp_g_object_unref = dl_symbol("g_object_unref"); - - fp_g_main_context_iteration = - dl_symbol("g_main_context_iteration"); - - fp_g_value_init = dl_symbol("g_value_init"); - fp_g_type_is_a = dl_symbol("g_type_is_a"); - - fp_g_value_get_boolean = dl_symbol("g_value_get_boolean"); - fp_g_value_get_char = dl_symbol("g_value_get_char"); - fp_g_value_get_uchar = dl_symbol("g_value_get_uchar"); - fp_g_value_get_int = dl_symbol("g_value_get_int"); - fp_g_value_get_uint = dl_symbol("g_value_get_uint"); - fp_g_value_get_long = dl_symbol("g_value_get_long"); - fp_g_value_get_ulong = dl_symbol("g_value_get_ulong"); - fp_g_value_get_int64 = dl_symbol("g_value_get_int64"); - fp_g_value_get_uint64 = dl_symbol("g_value_get_uint64"); - fp_g_value_get_float = dl_symbol("g_value_get_float"); - fp_g_value_get_double = dl_symbol("g_value_get_double"); - fp_g_value_get_string = dl_symbol("g_value_get_string"); - fp_g_value_get_enum = dl_symbol("g_value_get_enum"); - fp_g_value_get_flags = dl_symbol("g_value_get_flags"); - fp_g_value_get_param = dl_symbol("g_value_get_param"); - fp_g_value_get_boxed = dl_symbol("g_value_get_boxed"); - fp_g_value_get_pointer = dl_symbol("g_value_get_pointer"); - fp_g_value_get_object = dl_symbol("g_value_get_object"); - fp_g_param_spec_int = dl_symbol("g_param_spec_int"); - fp_g_object_get = dl_symbol("g_object_get"); - fp_g_object_set = dl_symbol("g_object_set"); - - /* GDK */ - fp_gdk_pixmap_new = dl_symbol("gdk_pixmap_new"); - fp_gdk_pixbuf_get_from_drawable = - dl_symbol("gdk_pixbuf_get_from_drawable"); - fp_gdk_gc_new = dl_symbol("gdk_gc_new"); - fp_gdk_rgb_gc_set_foreground = - dl_symbol("gdk_rgb_gc_set_foreground"); - fp_gdk_draw_rectangle = dl_symbol("gdk_draw_rectangle"); - fp_gdk_drawable_get_size = dl_symbol("gdk_drawable_get_size"); - - /* Pixbuf */ - fp_gdk_pixbuf_new = dl_symbol("gdk_pixbuf_new"); - fp_gdk_pixbuf_new_from_file = - dl_symbol("gdk_pixbuf_new_from_file"); - fp_gdk_pixbuf_get_width = dl_symbol("gdk_pixbuf_get_width"); - fp_gdk_pixbuf_get_height = dl_symbol("gdk_pixbuf_get_height"); - fp_gdk_pixbuf_get_pixels = dl_symbol("gdk_pixbuf_get_pixels"); - fp_gdk_pixbuf_get_rowstride = - dl_symbol("gdk_pixbuf_get_rowstride"); - fp_gdk_pixbuf_get_has_alpha = - dl_symbol("gdk_pixbuf_get_has_alpha"); - fp_gdk_pixbuf_get_bits_per_sample = - dl_symbol("gdk_pixbuf_get_bits_per_sample"); - fp_gdk_pixbuf_get_n_channels = - dl_symbol("gdk_pixbuf_get_n_channels"); - - /* GTK painting */ - fp_gtk_init_check = dl_symbol("gtk_init_check"); - fp_gtk_paint_hline = dl_symbol("gtk_paint_hline"); - fp_gtk_paint_vline = dl_symbol("gtk_paint_vline"); - fp_gtk_paint_shadow = dl_symbol("gtk_paint_shadow"); - fp_gtk_paint_arrow = dl_symbol("gtk_paint_arrow"); - fp_gtk_paint_diamond = dl_symbol("gtk_paint_diamond"); - fp_gtk_paint_box = dl_symbol("gtk_paint_box"); - fp_gtk_paint_flat_box = dl_symbol("gtk_paint_flat_box"); - fp_gtk_paint_check = dl_symbol("gtk_paint_check"); - fp_gtk_paint_option = dl_symbol("gtk_paint_option"); - fp_gtk_paint_box_gap = dl_symbol("gtk_paint_box_gap"); - fp_gtk_paint_extension = dl_symbol("gtk_paint_extension"); - fp_gtk_paint_focus = dl_symbol("gtk_paint_focus"); - fp_gtk_paint_slider = dl_symbol("gtk_paint_slider"); - fp_gtk_paint_handle = dl_symbol("gtk_paint_handle"); - fp_gtk_paint_expander = dl_symbol("gtk_paint_expander"); - fp_gtk_style_apply_default_background = - dl_symbol("gtk_style_apply_default_background"); - - /* GTK widgets */ - fp_gtk_arrow_new = dl_symbol("gtk_arrow_new"); - fp_gtk_button_new = dl_symbol("gtk_button_new"); - fp_gtk_spin_button_new = dl_symbol("gtk_spin_button_new"); - fp_gtk_check_button_new = dl_symbol("gtk_check_button_new"); - fp_gtk_check_menu_item_new = - dl_symbol("gtk_check_menu_item_new"); - fp_gtk_color_selection_dialog_new = - dl_symbol("gtk_color_selection_dialog_new"); - fp_gtk_entry_new = dl_symbol("gtk_entry_new"); - fp_gtk_fixed_new = dl_symbol("gtk_fixed_new"); - fp_gtk_handle_box_new = dl_symbol("gtk_handle_box_new"); - fp_gtk_image_new = dl_symbol("gtk_image_new"); - fp_gtk_hpaned_new = dl_symbol("gtk_hpaned_new"); - fp_gtk_vpaned_new = dl_symbol("gtk_vpaned_new"); - fp_gtk_hscale_new = dl_symbol("gtk_hscale_new"); - fp_gtk_vscale_new = dl_symbol("gtk_vscale_new"); - fp_gtk_hscrollbar_new = dl_symbol("gtk_hscrollbar_new"); - fp_gtk_vscrollbar_new = dl_symbol("gtk_vscrollbar_new"); - fp_gtk_hseparator_new = dl_symbol("gtk_hseparator_new"); - fp_gtk_vseparator_new = dl_symbol("gtk_vseparator_new"); - fp_gtk_label_new = dl_symbol("gtk_label_new"); - fp_gtk_menu_new = dl_symbol("gtk_menu_new"); - fp_gtk_menu_bar_new = dl_symbol("gtk_menu_bar_new"); - fp_gtk_menu_item_new = dl_symbol("gtk_menu_item_new"); - fp_gtk_menu_item_set_submenu = - dl_symbol("gtk_menu_item_set_submenu"); - fp_gtk_notebook_new = dl_symbol("gtk_notebook_new"); - fp_gtk_progress_bar_new = - dl_symbol("gtk_progress_bar_new"); - fp_gtk_progress_bar_set_orientation = - dl_symbol("gtk_progress_bar_set_orientation"); - fp_gtk_radio_button_new = - dl_symbol("gtk_radio_button_new"); - fp_gtk_radio_menu_item_new = - dl_symbol("gtk_radio_menu_item_new"); - fp_gtk_scrolled_window_new = - dl_symbol("gtk_scrolled_window_new"); - fp_gtk_separator_menu_item_new = - dl_symbol("gtk_separator_menu_item_new"); - fp_gtk_text_view_new = dl_symbol("gtk_text_view_new"); - fp_gtk_toggle_button_new = - dl_symbol("gtk_toggle_button_new"); - fp_gtk_toolbar_new = dl_symbol("gtk_toolbar_new"); - fp_gtk_tree_view_new = dl_symbol("gtk_tree_view_new"); - fp_gtk_viewport_new = dl_symbol("gtk_viewport_new"); - fp_gtk_window_new = dl_symbol("gtk_window_new"); - fp_gtk_window_present = dl_symbol("gtk_window_present"); - fp_gtk_window_move = dl_symbol("gtk_window_move"); - fp_gtk_window_resize = dl_symbol("gtk_window_resize"); - - fp_gtk_dialog_new = dl_symbol("gtk_dialog_new"); - fp_gtk_frame_new = dl_symbol("gtk_frame_new"); - - fp_gtk_adjustment_new = dl_symbol("gtk_adjustment_new"); - fp_gtk_container_add = dl_symbol("gtk_container_add"); - fp_gtk_menu_shell_append = - dl_symbol("gtk_menu_shell_append"); - fp_gtk_widget_realize = dl_symbol("gtk_widget_realize"); - fp_gtk_widget_destroy = dl_symbol("gtk_widget_destroy"); - fp_gtk_widget_render_icon = - dl_symbol("gtk_widget_render_icon"); - fp_gtk_widget_set_name = - dl_symbol("gtk_widget_set_name"); - fp_gtk_widget_set_parent = - dl_symbol("gtk_widget_set_parent"); - fp_gtk_widget_set_direction = - dl_symbol("gtk_widget_set_direction"); - fp_gtk_widget_style_get = - dl_symbol("gtk_widget_style_get"); - fp_gtk_widget_class_install_style_property = - dl_symbol("gtk_widget_class_install_style_property"); - fp_gtk_widget_class_find_style_property = - dl_symbol("gtk_widget_class_find_style_property"); - fp_gtk_widget_style_get_property = - dl_symbol("gtk_widget_style_get_property"); - fp_pango_font_description_to_string = - dl_symbol("pango_font_description_to_string"); - fp_gtk_settings_get_default = - dl_symbol("gtk_settings_get_default"); - fp_gtk_widget_get_settings = - dl_symbol("gtk_widget_get_settings"); - fp_gtk_border_get_type = dl_symbol("gtk_border_get_type"); - fp_gtk_arrow_set = dl_symbol("gtk_arrow_set"); - fp_gtk_widget_size_request = - dl_symbol("gtk_widget_size_request"); - fp_gtk_range_get_adjustment = - dl_symbol("gtk_range_get_adjustment"); - - fp_gtk_widget_hide = dl_symbol("gtk_widget_hide"); - fp_gtk_main_quit = dl_symbol("gtk_main_quit"); - fp_g_signal_connect_data = dl_symbol("g_signal_connect_data"); - fp_gtk_widget_show = dl_symbol("gtk_widget_show"); - fp_gtk_main = dl_symbol("gtk_main"); - - /** - * GLib thread system - */ - fp_g_thread_init = dl_symbol_gthread("g_thread_init"); - fp_gdk_threads_init = dl_symbol("gdk_threads_init"); - fp_gdk_threads_enter = dl_symbol("gdk_threads_enter"); - fp_gdk_threads_leave = dl_symbol("gdk_threads_leave"); - - /** - * Functions for sun_awt_X11_GtkFileDialogPeer.c - */ - if (fp_gtk_check_version(2, 4, 0) == NULL) { - // The current GtkFileChooser is available from GTK+ 2.4 - gtk2_file_chooser_load(); - } - - /* Some functions may be missing in pre-2.4 GTK. - We handle them specially here. - */ - fp_gtk_combo_box_new = dlsym(gtk2_libhandle, "gtk_combo_box_new"); - if (fp_gtk_combo_box_new == NULL) { - fp_gtk_combo_box_new = dl_symbol("gtk_combo_new"); - } - - fp_gtk_combo_box_entry_new = - dlsym(gtk2_libhandle, "gtk_combo_box_entry_new"); - if (fp_gtk_combo_box_entry_new == NULL) { - fp_gtk_combo_box_entry_new = dl_symbol("gtk_combo_new"); - new_combo_used = FALSE; - } - - fp_gtk_separator_tool_item_new = - dlsym(gtk2_libhandle, "gtk_separator_tool_item_new"); - if (fp_gtk_separator_tool_item_new == NULL) { - fp_gtk_separator_tool_item_new = - dl_symbol("gtk_vseparator_new"); - } - } - /* Now we have only one kind of exceptions: NO_SYMBOL_EXCEPTION - * Otherwise we can check the return value of setjmp method. - */ - else - { - dlclose(gtk2_libhandle); - gtk2_libhandle = NULL; - - dlclose(gthread_libhandle); - gthread_libhandle = NULL; - - return FALSE; - } - - return TRUE; -} - -int gtk2_dlunload() -{ - char *gtk2_error; - - if (!gtk2_libhandle) - return TRUE; - - dlerror(); - dlclose(gtk2_libhandle); - dlclose(gthread_libhandle); - if ((gtk2_error = dlerror()) != NULL) - { - return FALSE; - } - return TRUE; -} - -gboolean new_combo() -{ - return new_combo_used; -} -
--- a/src/solaris/native/sun/awt/gtk2/gtk_fp.h Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,469 +0,0 @@ -/* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -#ifndef __GTK_FP_H__ -#define __GTK_FP_H__ - -#include <gtk/gtk.h> - -gboolean gtk2_check_dlversion(); -gboolean gtk2_dlload(); -int gtk2_dlunload(); -gboolean new_combo(); - -/************************* - * Glib function pointers - *************************/ - -gboolean (*fp_g_main_context_iteration)(GMainContext *context, - gboolean may_block); - -GValue* (*fp_g_value_init)(GValue *value, GType g_type); -gboolean (*fp_g_type_is_a)(GType type, GType is_a_type); -gboolean (*fp_g_value_get_boolean)(const GValue *value); -gchar (*fp_g_value_get_char)(const GValue *value); -guchar (*fp_g_value_get_uchar)(const GValue *value); -gint (*fp_g_value_get_int)(const GValue *value); -guint (*fp_g_value_get_uint)(const GValue *value); -glong (*fp_g_value_get_long)(const GValue *value); -gulong (*fp_g_value_get_ulong)(const GValue *value); -gint64 (*fp_g_value_get_int64)(const GValue *value); -guint64 (*fp_g_value_get_uint64)(const GValue *value); -gfloat (*fp_g_value_get_float)(const GValue *value); -gdouble (*fp_g_value_get_double)(const GValue *value); -const gchar* (*fp_g_value_get_string)(const GValue *value); -gint (*fp_g_value_get_enum)(const GValue *value); -guint (*fp_g_value_get_flags)(const GValue *value); -GParamSpec* (*fp_g_value_get_param)(const GValue *value); -gpointer* (*fp_g_value_get_boxed)(const GValue *value); -gpointer* (*fp_g_value_get_pointer)(const GValue *value); -GObject* (*fp_g_value_get_object)(const GValue *value); -GParamSpec* (*fp_g_param_spec_int)(const gchar *name, - const gchar *nick, const gchar *blurb, - gint minimum, gint maximum, gint default_value, - GParamFlags flags); -void (*fp_g_object_get)(gpointer object, - const gchar* fpn, ...); -void (*fp_g_object_set)(gpointer object, - const gchar *first_property_name, - ...); -/************************ - * GDK function pointers - ************************/ -GdkPixmap *(*fp_gdk_pixmap_new)(GdkDrawable *drawable, - gint width, gint height, gint depth); -GdkGC *(*fp_gdk_gc_new)(GdkDrawable*); -void (*fp_gdk_rgb_gc_set_foreground)(GdkGC*, guint32); -void (*fp_gdk_draw_rectangle)(GdkDrawable*, GdkGC*, gboolean, - gint, gint, gint, gint); -GdkPixbuf *(*fp_gdk_pixbuf_new)(GdkColorspace colorspace, - gboolean has_alpha, int bits_per_sample, int width, int height); -GdkPixbuf *(*fp_gdk_pixbuf_get_from_drawable)(GdkPixbuf *dest, - GdkDrawable *src, GdkColormap *cmap, int src_x, int src_y, - int dest_x, int dest_y, int width, int height); -void (*fp_gdk_drawable_get_size)(GdkDrawable *drawable, - gint* width, gint* height); - -/************************ - * Gtk function pointers - ************************/ -gboolean (*fp_gtk_init_check)(int* argc, char** argv); - -/* Painting */ -void (*fp_gtk_paint_hline)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GdkRectangle* area, GtkWidget* widget, - const gchar* detail, gint x1, gint x2, gint y); -void (*fp_gtk_paint_vline)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GdkRectangle* area, GtkWidget* widget, - const gchar* detail, gint y1, gint y2, gint x); -void (*fp_gtk_paint_shadow)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GtkShadowType shadow_type, - GdkRectangle* area, GtkWidget* widget, const gchar* detail, - gint x, gint y, gint width, gint height); -void (*fp_gtk_paint_arrow)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GtkShadowType shadow_type, - GdkRectangle* area, GtkWidget* widget, const gchar* detail, - GtkArrowType arrow_type, gboolean fill, gint x, gint y, - gint width, gint height); -void (*fp_gtk_paint_diamond)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GtkShadowType shadow_type, - GdkRectangle* area, GtkWidget* widget, const gchar* detail, - gint x, gint y, gint width, gint height); -void (*fp_gtk_paint_box)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GtkShadowType shadow_type, - GdkRectangle* area, GtkWidget* widget, const gchar* detail, - gint x, gint y, gint width, gint height); -void (*fp_gtk_paint_flat_box)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GtkShadowType shadow_type, - GdkRectangle* area, GtkWidget* widget, const gchar* detail, - gint x, gint y, gint width, gint height); -void (*fp_gtk_paint_check)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GtkShadowType shadow_type, - GdkRectangle* area, GtkWidget* widget, const gchar* detail, - gint x, gint y, gint width, gint height); -void (*fp_gtk_paint_option)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GtkShadowType shadow_type, - GdkRectangle* area, GtkWidget* widget, const gchar* detail, - gint x, gint y, gint width, gint height); -void (*fp_gtk_paint_box_gap)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GtkShadowType shadow_type, - GdkRectangle* area, GtkWidget* widget, const gchar* detail, - gint x, gint y, gint width, gint height, - GtkPositionType gap_side, gint gap_x, gint gap_width); -void (*fp_gtk_paint_extension)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GtkShadowType shadow_type, - GdkRectangle* area, GtkWidget* widget, const gchar* detail, - gint x, gint y, gint width, gint height, GtkPositionType gap_side); -void (*fp_gtk_paint_focus)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GdkRectangle* area, GtkWidget* widget, - const gchar* detail, gint x, gint y, gint width, gint height); -void (*fp_gtk_paint_slider)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GtkShadowType shadow_type, - GdkRectangle* area, GtkWidget* widget, const gchar* detail, - gint x, gint y, gint width, gint height, GtkOrientation orientation); -void (*fp_gtk_paint_handle)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GtkShadowType shadow_type, - GdkRectangle* area, GtkWidget* widget, const gchar* detail, - gint x, gint y, gint width, gint height, GtkOrientation orientation); -void (*fp_gtk_paint_expander)(GtkStyle* style, GdkWindow* window, - GtkStateType state_type, GdkRectangle* area, GtkWidget* widget, - const gchar* detail, gint x, gint y, GtkExpanderStyle expander_style); -void (*fp_gtk_style_apply_default_background)(GtkStyle* style, - GdkWindow* window, gboolean set_bg, GtkStateType state_type, - GdkRectangle* area, gint x, gint y, gint width, gint height); - -/* Widget creation */ -GtkWidget* (*fp_gtk_arrow_new)(GtkArrowType arrow_type, - GtkShadowType shadow_type); -GtkWidget* (*fp_gtk_button_new)(); -GtkWidget* (*fp_gtk_check_button_new)(); -GtkWidget* (*fp_gtk_check_menu_item_new)(); -GtkWidget* (*fp_gtk_color_selection_dialog_new)(const gchar* title); -GtkWidget* (*fp_gtk_combo_box_new)(); -GtkWidget* (*fp_gtk_combo_box_entry_new)(); -GtkWidget* (*fp_gtk_entry_new)(); -GtkWidget* (*fp_gtk_fixed_new)(); -GtkWidget* (*fp_gtk_handle_box_new)(); -GtkWidget* (*fp_gtk_hpaned_new)(); -GtkWidget* (*fp_gtk_vpaned_new)(); -GtkWidget* (*fp_gtk_hscale_new)(GtkAdjustment* adjustment); -GtkWidget* (*fp_gtk_vscale_new)(GtkAdjustment* adjustment); -GtkWidget* (*fp_gtk_hscrollbar_new)(GtkAdjustment* adjustment); -GtkWidget* (*fp_gtk_vscrollbar_new)(GtkAdjustment* adjustment); -GtkWidget* (*fp_gtk_hseparator_new)(); -GtkWidget* (*fp_gtk_vseparator_new)(); -GtkWidget* (*fp_gtk_image_new)(); -GtkWidget* (*fp_gtk_label_new)(const gchar* str); -GtkWidget* (*fp_gtk_menu_new)(); -GtkWidget* (*fp_gtk_menu_bar_new)(); -GtkWidget* (*fp_gtk_menu_item_new)(); -GtkWidget* (*fp_gtk_notebook_new)(); -GtkWidget* (*fp_gtk_progress_bar_new)(); -GtkWidget* (*fp_gtk_progress_bar_set_orientation)( - GtkProgressBar *pbar, - GtkProgressBarOrientation orientation); -GtkWidget* (*fp_gtk_radio_button_new)(GSList *group); -GtkWidget* (*fp_gtk_radio_menu_item_new)(GSList *group); -GtkWidget* (*fp_gtk_scrolled_window_new)(GtkAdjustment *hadjustment, - GtkAdjustment *vadjustment); -GtkWidget* (*fp_gtk_separator_menu_item_new)(); -GtkWidget* (*fp_gtk_separator_tool_item_new)(); -GtkWidget* (*fp_gtk_text_view_new)(); -GtkWidget* (*fp_gtk_toggle_button_new)(); -GtkWidget* (*fp_gtk_toolbar_new)(); -GtkWidget* (*fp_gtk_tree_view_new)(); -GtkWidget* (*fp_gtk_viewport_new)(GtkAdjustment *hadjustment, - GtkAdjustment *vadjustment); -GtkWidget* (*fp_gtk_window_new)(GtkWindowType type); -GtkWidget* (*fp_gtk_dialog_new)(); -GtkWidget* (*fp_gtk_spin_button_new)(GtkAdjustment *adjustment, - gdouble climb_rate, guint digits); -GtkWidget* (*fp_gtk_frame_new)(const gchar *label); - -/* Other widget operations */ -GtkObject* (*fp_gtk_adjustment_new)(gdouble value, - gdouble lower, gdouble upper, gdouble step_increment, - gdouble page_increment, gdouble page_size); -void (*fp_gtk_container_add)(GtkContainer *window, GtkWidget *widget); -void (*fp_gtk_menu_shell_append)(GtkMenuShell *menu_shell, - GtkWidget *child); -void (*fp_gtk_menu_item_set_submenu)(GtkMenuItem *menu_item, - GtkWidget *submenu); -void (*fp_gtk_widget_realize)(GtkWidget *widget); -GdkPixbuf* (*fp_gtk_widget_render_icon)(GtkWidget *widget, - const gchar *stock_id, GtkIconSize size, const gchar *detail); -void (*fp_gtk_widget_set_name)(GtkWidget *widget, const gchar *name); -void (*fp_gtk_widget_set_parent)(GtkWidget *widget, GtkWidget *parent); -void (*fp_gtk_widget_set_direction)(GtkWidget *widget, - GtkTextDirection direction); -void (*fp_gtk_widget_style_get)(GtkWidget *widget, - const gchar *first_property_name, ...); -void (*fp_gtk_widget_class_install_style_property)( - GtkWidgetClass* class, GParamSpec *pspec); -GParamSpec* (*fp_gtk_widget_class_find_style_property)( - GtkWidgetClass* class, const gchar* property_name); -void (*fp_gtk_widget_style_get_property)(GtkWidget* widget, - const gchar* property_name, GValue* value); -char* (*fp_pango_font_description_to_string)( - const PangoFontDescription* fd); -GtkSettings* (*fp_gtk_settings_get_default)(); -GtkSettings* (*fp_gtk_widget_get_settings)(GtkWidget *widget); -GType (*fp_gtk_border_get_type)(); -void (*fp_gtk_arrow_set)(GtkWidget* arrow, - GtkArrowType arrow_type, - GtkShadowType shadow_type); -void (*fp_gtk_widget_size_request)(GtkWidget *widget, - GtkRequisition *requisition); -GtkAdjustment* (*fp_gtk_range_get_adjustment)(GtkRange* range); - -void (*fp_g_free)(gpointer mem); -void (*fp_g_object_unref)(gpointer object); -int (*fp_gdk_pixbuf_get_bits_per_sample)(const GdkPixbuf *pixbuf); -guchar *(*fp_gdk_pixbuf_get_pixels)(const GdkPixbuf *pixbuf); -gboolean (*fp_gdk_pixbuf_get_has_alpha)(const GdkPixbuf *pixbuf); -int (*fp_gdk_pixbuf_get_height)(const GdkPixbuf *pixbuf); -int (*fp_gdk_pixbuf_get_n_channels)(const GdkPixbuf *pixbuf); -int (*fp_gdk_pixbuf_get_rowstride)(const GdkPixbuf *pixbuf); -int (*fp_gdk_pixbuf_get_width)(const GdkPixbuf *pixbuf); -GdkPixbuf *(*fp_gdk_pixbuf_new_from_file)(const char *filename, GError **error); -void (*fp_gtk_widget_destroy)(GtkWidget *widget); -void (*fp_gtk_window_present)(GtkWindow *window); -void (*fp_gtk_window_move)(GtkWindow *window, gint x, gint y); -void (*fp_gtk_window_resize)(GtkWindow *window, gint width, gint height); - -/** - * Function Pointers for GtkFileChooser - */ -gchar* (*fp_gtk_file_chooser_get_filename)(GtkFileChooser *chooser); -void (*fp_gtk_widget_hide)(GtkWidget *widget); -void (*fp_gtk_main_quit)(void); -GtkWidget* (*fp_gtk_file_chooser_dialog_new)(const gchar *title, - GtkWindow *parent, GtkFileChooserAction action, - const gchar *first_button_text, ...); -gboolean (*fp_gtk_file_chooser_set_current_folder)(GtkFileChooser *chooser, - const gchar *filename); -gboolean (*fp_gtk_file_chooser_set_filename)(GtkFileChooser *chooser, - const char *filename); -void (*fp_gtk_file_chooser_set_current_name)(GtkFileChooser *chooser, - const gchar *name); -void (*fp_gtk_file_filter_add_custom)(GtkFileFilter *filter, - GtkFileFilterFlags needed, GtkFileFilterFunc func, gpointer data, - GDestroyNotify notify); -void (*fp_gtk_file_chooser_set_filter)(GtkFileChooser *chooser, - GtkFileFilter *filter); -GType (*fp_gtk_file_chooser_get_type)(void); -GtkFileFilter* (*fp_gtk_file_filter_new)(void); -void (*fp_gtk_file_chooser_set_do_overwrite_confirmation)( - GtkFileChooser *chooser, gboolean do_overwrite_confirmation); -void (*fp_gtk_file_chooser_set_select_multiple)( - GtkFileChooser *chooser, gboolean select_multiple); -gchar* (*fp_gtk_file_chooser_get_current_folder)(GtkFileChooser *chooser); -GSList* (*fp_gtk_file_chooser_get_filenames)(GtkFileChooser *chooser); -guint (*fp_gtk_g_slist_length)(GSList *list); -gulong (*fp_g_signal_connect_data)(gpointer instance, - const gchar *detailed_signal, GCallback c_handler, gpointer data, - GClosureNotify destroy_data, GConnectFlags connect_flags); -void (*fp_gtk_widget_show)(GtkWidget *widget); -void (*fp_gtk_main)(void); -guint (*fp_gtk_main_level)(void); - -/** - * Returns : - * NULL if the GTK+ library is compatible with the given version, or a string - * describing the version mismatch. - */ -gchar* (*fp_gtk_check_version)(guint required_major, guint required_minor, - guint required_micro); - -void (*fp_g_thread_init)(GThreadFunctions *vtable); -void (*fp_gdk_threads_init)(void); -void (*fp_gdk_threads_enter)(void); -void (*fp_gdk_threads_leave)(void); - -/* Glib */ -#define g_main_context_iteration (*fp_g_main_context_iteration) -#define g_value_init (*fp_g_value_init) -#define g_type_is_a (*fp_g_type_is_a) -#define g_value_get_boolean (*fp_g_value_get_boolean) -#define g_value_get_char (*fp_g_value_get_char) -#define g_value_get_uchar (*fp_g_value_get_uchar) -#define g_value_get_int (*fp_g_value_get_int) -#define g_value_get_uint (*fp_g_value_get_uint) -#define g_value_get_long (*fp_g_value_get_long) -#define g_value_get_ulong (*fp_g_value_get_ulong) -#define g_value_get_int64 (*fp_g_value_get_int64) -#define g_value_get_uint64 (*fp_g_value_get_uint64) -#define g_value_get_float (*fp_g_value_get_float) -#define g_value_get_double (*fp_g_value_get_double) -#define g_value_get_string (*fp_g_value_get_string) -#define g_value_get_enum (*fp_g_value_get_enum) -#define g_value_get_flags (*fp_g_value_get_flags) -#define g_value_get_param (*fp_g_value_get_param) -#define g_value_get_boxed (*fp_g_value_get_boxed) -#define g_value_get_object (*fp_g_value_get_object) -#define g_param_spec_int (*fp_g_param_spec_int) -#define g_object_get (*fp_g_object_get) -#define g_object_set (*fp_g_object_set) -#define g_thread_init (*fp_g_thread_init) -#define g_object_unref (*fp_g_object_unref) -#define g_free (*fp_g_free) -#define g_slist_length (*fp_gtk_g_slist_length) -#define g_signal_connect_data (*fp_g_signal_connect_data) - -/* GDK */ -#define gdk_pixmap_new (*fp_gdk_pixmap_new) -#define gdk_gc_new (*fp_gdk_gc_new) -#define gdk_rgb_gc_set_foreground (*fp_gdk_rgb_gc_set_foreground) -#define gdk_draw_rectangle (*fp_gdk_draw_rectangle) -#define gdk_pixbuf_get_from_drawable (*fp_gdk_pixbuf_get_from_drawable) -#define gdk_drawable_get_size (*fp_gdk_drawable_get_size) -#define gdk_threads_leave (*fp_gdk_threads_leave) -#define gdk_threads_init (*fp_gdk_threads_init) -#define gdk_threads_enter (*fp_gdk_threads_enter) - -/************************ - * Gtk function pointers - ************************/ -#define gtk_init_check (*fp_gtk_init_check) - -/* Painting */ -#define gtk_paint_hline (*fp_gtk_paint_hline) -#define gtk_paint_vline (*fp_gtk_paint_vline) -#define gtk_paint_shadow (*fp_gtk_paint_shadow) -#define gtk_paint_arrow (*fp_gtk_paint_arrow) -#define gtk_paint_diamond (*fp_gtk_paint_diamond) -#define gtk_paint_box (*fp_gtk_paint_box) -#define gtk_paint_flat_box (*fp_gtk_paint_flat_box) -#define gtk_paint_check (*fp_gtk_paint_check) -#define gtk_paint_option (*fp_gtk_paint_option) -#define gtk_paint_box_gap (*fp_gtk_paint_box_gap) -#define gtk_paint_extension (*fp_gtk_paint_extension) -#define gtk_paint_focus (*fp_gtk_paint_focus) -#define gtk_paint_slider (*fp_gtk_paint_slider) -#define gtk_paint_handle (*fp_gtk_paint_handle) -#define gtk_paint_expander (*fp_gtk_paint_expander) -#define gtk_style_apply_default_background (*fp_gtk_style_apply_default_background) - -/* Widget creation */ -#define gtk_arrow_new (*fp_gtk_arrow_new) -#define gtk_button_new (*fp_gtk_button_new) -#define gtk_check_button_new (*fp_gtk_check_button_new) -#define gtk_check_menu_item_new (*fp_gtk_check_menu_item_new) -#define gtk_color_selection_dialog_new (*fp_gtk_color_selection_dialog_new) -#define gtk_combo_box_new (*fp_gtk_combo_box_new) -#define gtk_combo_box_entry_new (*fp_gtk_combo_box_entry_new) -#define gtk_entry_new (*fp_gtk_entry_new) -#define gtk_fixed_new (*fp_gtk_fixed_new) -#define gtk_handle_box_new (*fp_gtk_handle_box_new) -#define gtk_hpaned_new (*fp_gtk_hpaned_new) -#define gtk_vpaned_new (*fp_gtk_vpaned_new) -#define gtk_hscale_new (*fp_gtk_hscale_new) -#define gtk_vscale_new (*fp_gtk_vscale_new) -#define gtk_hscrollbar_new (*fp_gtk_hscrollbar_new) -#define gtk_vscrollbar_new (*fp_gtk_vscrollbar_new) -#define gtk_hseparator_new (*fp_gtk_hseparator_new) -#define gtk_vseparator_new (*fp_gtk_vseparator_new) -#define gtk_image_new (*fp_gtk_image_new) -#define gtk_label_new (*fp_gtk_label_new) -#define gtk_menu_new (*fp_gtk_menu_new) -#define gtk_menu_bar_new (*fp_gtk_menu_bar_new) -#define gtk_menu_item_new (*fp_gtk_menu_item_new) -#define gtk_notebook_new (*fp_gtk_notebook_new) -#define gtk_progress_bar_new (*fp_gtk_progress_bar_new) -#define gtk_progress_bar_set_orientation (*fp_gtk_progress_bar_set_orientation) -#define gtk_radio_button_new (*fp_gtk_radio_button_new) -#define gtk_radio_menu_item_new (*fp_gtk_radio_menu_item_new) -#define gtk_scrolled_window_new (*fp_gtk_scrolled_window_new) -#define gtk_separator_menu_item_new (*fp_gtk_separator_menu_item_new) -#define gtk_separator_tool_item_new (*fp_gtk_separator_tool_item_new) -#define gtk_text_view_new (*fp_gtk_text_view_new) -#define gtk_toggle_button_new (*fp_gtk_toggle_button_new) -#define gtk_toolbar_new (*fp_gtk_toolbar_new) -#define gtk_tree_view_new (*fp_gtk_tree_view_new) -#define gtk_viewport_new (*fp_gtk_viewport_new) -#define gtk_window_new (*fp_gtk_window_new) -#define gtk_dialog_new (*fp_gtk_dialog_new) -#define gtk_spin_button_new (*fp_gtk_spin_button_new) -#define gtk_frame_new (*fp_gtk_frame_new) - -/* Other widget operations */ -#define gtk_adjustment_new (*fp_gtk_adjustment_new) -#define gtk_container_add (*fp_gtk_container_add) -#define gtk_menu_shell_append (*fp_gtk_menu_shell_append) -#define gtk_menu_item_set_submenu (*fp_gtk_menu_item_set_submenu) -#define gtk_widget_realize (*fp_gtk_widget_realize) -#define gtk_widget_render_icon (*fp_gtk_widget_render_icon) -#define gtk_widget_set_name (*fp_gtk_widget_set_name) -#define gtk_widget_set_parent (*fp_gtk_widget_set_parent) -#define gtk_widget_set_direction (*fp_gtk_widget_set_direction) -#define gtk_widget_style_get (*fp_gtk_widget_style_get) -#define gtk_widget_class_install_style_property (*fp_gtk_widget_class_install_style_property) -#define gtk_widget_class_find_style_property (*fp_gtk_widget_class_find_style_property) -#define gtk_widget_style_get_property (*fp_gtk_widget_style_get_property) -#define pango_font_description_to_string (*fp_pango_font_description_to_string) -#define gtk_settings_get_default (*fp_gtk_settings_get_default) -#define gtk_widget_get_settings (*fp_gtk_widget_get_settings) -#define gtk_border_get_type (*fp_gtk_border_get_type) -#define gtk_arrow_set (*fp_gtk_arrow_set) -#define gtk_widget_size_request (*fp_gtk_widget_size_request) -#define gtk_range_get_adjustment (*fp_gtk_range_get_adjustment) -#define gtk_widget_destroy (*fp_gtk_widget_destroy) -#define gtk_window_present (*fp_gtk_window_present) -#define gtk_window_move (*fp_gtk_window_move) -#define gtk_window_resize (*fp_gtk_window_resize) -#define gtk_widget_show (*fp_gtk_widget_show) -#define gtk_widget_hide (*fp_gtk_widget_hide) -#define gtk_main (*fp_gtk_main) -#define gtk_main_level (*fp_gtk_main_level) -#define gtk_main_quit (*fp_gtk_main_quit) -#define gtk_check_version (*fp_gtk_check_version) -#define gtk_init_check (*fp_gtk_init_check) - -/* GdkPixbuf */ -#define gdk_pixbuf_get_bits_per_sample (*fp_gdk_pixbuf_get_bits_per_sample) -#define gdk_pixbuf_get_pixels (*fp_gdk_pixbuf_get_pixels) -#define gdk_pixbuf_get_has_alpha (*fp_gdk_pixbuf_get_has_alpha) -#define gdk_pixbuf_get_height (*fp_gdk_pixbuf_get_height) -#define gdk_pixbuf_get_n_channels (*fp_gdk_pixbuf_get_n_channels) -#define gdk_pixbuf_get_rowstride (*fp_gdk_pixbuf_get_rowstride) -#define gdk_pixbuf_get_width (*fp_gdk_pixbuf_get_width) -#define gdk_pixbuf_new_from_file (*fp_gdk_pixbuf_new_from_file) -#define gdk_pixbuf_new (*fp_gdk_pixbuf_new) - -/* GtkFileChooser */ -#define gtk_file_chooser_get_filename (*fp_gtk_file_chooser_get_filename) -#define gtk_file_chooser_dialog_new (*fp_gtk_file_chooser_dialog_new) -#define gtk_file_chooser_set_current_folder (*fp_gtk_file_chooser_set_current_folder) -#define gtk_file_chooser_set_filename (*fp_gtk_file_chooser_set_filename) -#define gtk_file_chooser_set_current_name (*fp_gtk_file_chooser_set_current_name) -#define gtk_file_chooser_set_filter (*fp_gtk_file_chooser_set_filter) -#define gtk_file_chooser_get_type (*fp_gtk_file_chooser_get_type) -#define gtk_file_chooser_set_do_overwrite_confirmation (*fp_gtk_file_chooser_set_do_overwrite_confirmation) -#define gtk_file_chooser_set_select_multiple (*fp_gtk_file_chooser_set_select_multiple) -#define gtk_file_chooser_get_current_folder (*fp_gtk_file_chooser_get_current_folder) -#define gtk_file_chooser_get_filenames (*fp_gtk_file_chooser_get_filenames) -#define gtk_file_filter_add_custom (*fp_gtk_file_filter_add_custom) -#define gtk_file_filter_new (*fp_gtk_file_filter_new) - -#endif /* __GTK_FP_H__ */
--- a/src/solaris/native/sun/net/spi/gconf2/gconf/gconf-client.h Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef GCONF_GCONF_H -#define GCONF_GCONF_H - -/** - * These functions are used by the sun.net.spi.DefaultProxySelector class - * to access some platform specific settings. - * This is the Solaris/Linux Gnome 2.x code using the GConf-2 library. - * Everything is loaded dynamically so no hard link with any library exists. - */ -typedef void* fp_client_get_default_func(); -typedef char* fp_client_get_string_func(void *, char *, void**); -typedef int fp_client_get_int_func(void*, char *, void**); -typedef int fp_client_get_bool_func(void*, char *, void**); -typedef int fp_conf_init_func(int, char**, void**); -typedef void fp_type_init_func (); - -#endif
--- a/src/solaris/native/sun/net/spi/gconf2/gconf_fp.c Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include <gconf_fp.h> -#include <dlfcn.h> - -fp_client_get_default_func* my_get_default_func = NULL; -fp_client_get_string_func* my_get_string_func = NULL; -fp_client_get_int_func* my_get_int_func = NULL; -fp_client_get_bool_func* my_get_bool_func = NULL; -fp_conf_init_func* my_gconf_init_func = NULL; -fp_type_init_func* my_g_type_init_func = NULL; - -jboolean init_gconf(int* gconf_ver, void** gconf_client) -{ - /** - * Let's try to load le GConf-2 library - */ - if (dlopen("libgconf-2.so", RTLD_GLOBAL | RTLD_LAZY) != NULL || - dlopen("libgconf-2.so.4", RTLD_GLOBAL | RTLD_LAZY) != NULL) { - *gconf_ver = 2; - } - if (*gconf_ver > 0) { - /* - * Now let's get pointer to the functions we need. - */ - my_g_type_init_func = (fp_type_init_func*) dlsym(RTLD_DEFAULT, "g_type_init"); - my_get_default_func = (fp_client_get_default_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_default"); - if (my_g_type_init_func != NULL && my_get_default_func != NULL) { - /** - * Try to connect to GConf. - */ - (*my_g_type_init_func)(); - (*gconf_client) = (*my_get_default_func)(); - if ((*gconf_client) != NULL) { - my_get_string_func = (fp_client_get_string_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_string"); - my_get_int_func = (fp_client_get_int_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_int"); - my_get_bool_func = (fp_client_get_bool_func*) dlsym(RTLD_DEFAULT, "gconf_client_get_bool"); - if (my_get_int_func != NULL && my_get_string_func != NULL && - my_get_bool_func != NULL) { - /** - * We did get all we need. Let's enable the System Proxy Settings. - */ - return JNI_TRUE; - } - } - } - } - return JNI_FALSE; -}
--- a/src/solaris/native/sun/net/spi/gconf2/gconf_fp.h Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef GCONF_GCONF_FP_H -#define GCONF_GCONF_FP_H - -#include <gconf/gconf-client.h> -#include <jni.h> -#include <stddef.h> - -extern fp_client_get_default_func* my_get_default_func; -extern fp_client_get_string_func* my_get_string_func; -extern fp_client_get_int_func* my_get_int_func; -extern fp_client_get_bool_func* my_get_bool_func; -extern fp_conf_init_func* my_gconf_init_func; -extern fp_type_init_func* my_g_type_init_func; - -#define gconf_client_get_default (*my_get_default_func) -#define gconf_client_get_string (*my_get_string_func) -#define gconf_client_get_int (*my_get_int_func) -#define gconf_client_get_bool (*my_get_bool_func) -#define gconf_init (*my_gconf_init_func) -#define g_type_init (*my_g_type_init_func) - -jboolean init_gconf(int* gconf_ver, void** gconf_client); - -#endif
--- a/src/solaris/native/sun/nio/fs/glib2/gio/gio.h Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Definitions for GIO */ - -#ifndef __GIO_H__ -#define __GIO_H__ - -#define G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "standard::content-type" - -typedef void* gpointer; -typedef struct _GFile GFile; -typedef struct _GFileInfo GFileInfo; -typedef struct _GCancellable GCancellable; -typedef struct _GError GError; - -typedef enum { - G_FILE_QUERY_INFO_NONE = 0 -} GFileQueryInfoFlags; - -typedef void (*type_init_func)(void); -typedef void (*object_unref_func)(gpointer object); -typedef GFile* (*file_new_for_path_func)(const char* path); -typedef GFileInfo* (*file_query_info_func)(GFile *file, - const char *attributes, GFileQueryInfoFlags flags, - GCancellable *cancellable, GError **error); -typedef char* (*file_info_get_content_type_func)(GFileInfo *info); - -#endif
--- a/src/solaris/native/sun/nio/fs/glib2/gio_fp.c Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include <dlfcn.h> -#include <jvm.h> - -#include "gio_fp.h" - -type_init_func type_init; -object_unref_func object_unref; -file_new_for_path_func file_new_for_path; -file_query_info_func file_query_info; -file_info_get_content_type_func file_info_get_content_type; - -jboolean init() -{ - void* gio_handle; - - gio_handle = dlopen("libgio-2.0.so", RTLD_LAZY); - if (gio_handle == NULL) { - gio_handle = dlopen("libgio-2.0.so.0", RTLD_LAZY); - if (gio_handle == NULL) { - return JNI_FALSE; - } - } - - type_init = (type_init_func)dlsym(gio_handle, "g_type_init"); - (*g_type_init)(); - - object_unref = (object_unref_func)dlsym(gio_handle, "g_object_unref"); - - file_new_for_path = - (file_new_for_path_func)dlsym(gio_handle, "g_file_new_for_path"); - - file_query_info = - (file_query_info_func)dlsym(gio_handle, "g_file_query_info"); - - file_info_get_content_type = (file_info_get_content_type_func) - dlsym(gio_handle, "g_file_info_get_content_type"); - - - if (g_type_init == NULL || - g_object_unref == NULL || - g_file_new_for_path == NULL || - g_file_query_info == NULL || - g_file_info_get_content_type == NULL) - { - dlclose(gio_handle); - return JNI_FALSE; - } - - return JNI_TRUE; -}
--- a/src/solaris/native/sun/nio/fs/glib2/gio_fp.h Wed Aug 24 03:39:33 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef __GIO_FP_H__ -#define __GIO_FP_H__ - -#include <gio/gio.h> - -extern type_init_func type_init; -extern object_unref_func object_unref; -extern file_new_for_path_func file_new_for_path; -extern file_query_info_func file_query_info; -extern file_info_get_content_type_func file_info_get_content_type; - -#define g_type_init (*type_init) -#define g_object_unref (*object_unref) -#define g_file_new_for_path (*file_new_for_path) -#define g_file_query_info (*file_query_info) -#define g_file_info_get_content_type (*file_info_get_content_type) - -jboolean init(); - -#endif