4.1.2-8
This commit is contained in:
parent
9ca88bbdad
commit
912fdb15c7
@ -1 +1 @@
|
||||
gcc-4.1.2-20070329.tar.bz2
|
||||
gcc-4.1.2-20070403.tar.bz2
|
||||
|
@ -18,20 +18,19 @@
|
||||
CLASS_P (class_type) = 1;
|
||||
--- gcc/java/jcf-parse.c (revision 122746)
|
||||
+++ gcc/java/jcf-parse.c (working copy)
|
||||
@@ -1221,9 +1221,12 @@
|
||||
main_input_filename = sfname;
|
||||
@@ -1221,9 +1221,12 @@ give_name_to_class (JCF *jcf, int i)
|
||||
main_input_filename = sfname;
|
||||
}
|
||||
#else
|
||||
- input_location = DECL_SOURCE_LOCATION (TYPE_NAME (this_class));
|
||||
- if (main_input_filename == NULL && jcf == main_jcf)
|
||||
- main_input_filename = input_filename;
|
||||
- main_input_filename = input_filename;
|
||||
+ if (! DECL_ARTIFICIAL (TYPE_NAME (this_class)))
|
||||
+ {
|
||||
+ input_location = DECL_SOURCE_LOCATION (TYPE_NAME (this_class));
|
||||
+ if (main_input_filename == NULL && jcf == main_jcf)
|
||||
+ main_input_filename = input_filename;
|
||||
+ }
|
||||
+ {
|
||||
+ input_location = DECL_SOURCE_LOCATION (TYPE_NAME (this_class));
|
||||
+ if (main_input_filename == NULL && jcf == main_jcf)
|
||||
+ main_input_filename = input_filename;
|
||||
+ }
|
||||
#endif
|
||||
|
||||
jcf->cpool.data[i].t = this_class;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
2007-03-23 Andrew Haley <aph@redhat.com>
|
||||
2007-03-29 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* jvgenmain.c (main): Change main to use class$, not class$$.
|
||||
(do_mangle_classname): Likewise.
|
||||
@ -9,10 +9,11 @@
|
||||
(build_classdollar_field): Likewise.
|
||||
(make_class_data): Likewise.
|
||||
(layout_class_method): Likewise.
|
||||
|
||||
--- gcc/java/class.c (revision 123084)
|
||||
* expr.c (special_method_p): New function.
|
||||
|
||||
--- gcc/java/class.c (revision 122746)
|
||||
+++ gcc/java/class.c (working copy)
|
||||
@@ -691,6 +691,13 @@
|
||||
@@ -689,6 +688,13 @@
|
||||
return fntype;
|
||||
}
|
||||
|
||||
@ -26,7 +27,7 @@
|
||||
tree
|
||||
add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
|
||||
{
|
||||
@@ -801,6 +808,10 @@
|
||||
@@ -799,6 +805,10 @@
|
||||
/* Always make field externally visible. This is required so
|
||||
that native methods can always access the field. */
|
||||
TREE_PUBLIC (field) = 1;
|
||||
@ -37,7 +38,7 @@
|
||||
/* Considered external unless we are compiling it into this
|
||||
object file. */
|
||||
DECL_EXTERNAL (field) = (is_compiled_class (class) != 2);
|
||||
@@ -958,7 +969,11 @@
|
||||
@@ -956,7 +966,11 @@
|
||||
decl = build_decl (VAR_DECL, decl_name, class_type_node);
|
||||
TREE_STATIC (decl) = 1;
|
||||
if (! flag_indirect_classes)
|
||||
@ -50,7 +51,7 @@
|
||||
DECL_IGNORED_P (decl) = 1;
|
||||
DECL_ARTIFICIAL (decl) = 1;
|
||||
if (is_compiled_class (type) == 1)
|
||||
@@ -997,6 +1012,7 @@
|
||||
@@ -995,6 +1009,7 @@
|
||||
TREE_CONSTANT (decl) = 1;
|
||||
TREE_READONLY (decl) = 1;
|
||||
TREE_PUBLIC (decl) = 1;
|
||||
@ -58,7 +59,7 @@
|
||||
DECL_IGNORED_P (decl) = 1;
|
||||
DECL_ARTIFICIAL (decl) = 1;
|
||||
MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (decl);
|
||||
@@ -1684,6 +1700,10 @@
|
||||
@@ -1640,6 +1655,10 @@
|
||||
|
||||
TREE_PUBLIC (dtable_decl) = 1;
|
||||
DECL_INITIAL (dtable_decl) = dtable;
|
||||
@ -69,18 +70,20 @@
|
||||
if (! flag_indirect_classes)
|
||||
rest_of_decl_compilation (dtable_decl, 1, 0);
|
||||
/* Maybe we're compiling Class as the first class. If so, set
|
||||
@@ -2553,6 +2573,10 @@
|
||||
@@ -2509,6 +2528,12 @@
|
||||
|
||||
TREE_PUBLIC (method_decl) = 1;
|
||||
|
||||
+ if (flag_indirect_classes
|
||||
+ || (METHOD_PRIVATE (method_decl) && METHOD_STATIC (method_decl)))
|
||||
+ || (METHOD_PRIVATE (method_decl) && METHOD_STATIC (method_decl)
|
||||
+ && ! METHOD_NATIVE (method_decl)
|
||||
+ && ! special_method_p (method_decl)))
|
||||
+ hide (method_decl);
|
||||
+
|
||||
/* Considered external unless it is being compiled into this object
|
||||
file, or it was already flagged as external. */
|
||||
if (!DECL_EXTERNAL (method_decl))
|
||||
--- gcc/java/jvgenmain.c (revision 123084)
|
||||
--- gcc/java/jvgenmain.c (revision 122746)
|
||||
+++ gcc/java/jvgenmain.c (working copy)
|
||||
@@ -143,8 +143,8 @@
|
||||
fprintf (stream, " JvRunMainName (\"%s\", argc, argv);\n", classname);
|
||||
@ -102,5 +105,41 @@
|
||||
obstack_1grow (mangle_obstack, '\0');
|
||||
return obstack_finish (mangle_obstack);
|
||||
}
|
||||
|
||||
|
||||
--- gcc/java/expr.c (revision 122746)
|
||||
+++ gcc/java/expr.c (working copy)
|
||||
@@ -2121,6 +2121,25 @@
|
||||
|
||||
{NULL, NULL, NULL, NULL, 0, NULL}};
|
||||
|
||||
+/* True if this method is special, i.e. it's a private method that
|
||||
+ should be exported fro a DSO. */
|
||||
+
|
||||
+bool
|
||||
+special_method_p (tree candidate_method)
|
||||
+{
|
||||
+ tree context = DECL_NAME (TYPE_NAME (DECL_CONTEXT (candidate_method)));
|
||||
+ tree method = DECL_NAME (candidate_method);
|
||||
+ rewrite_rule *p;
|
||||
+
|
||||
+ for (p = rules; p->classname; p++)
|
||||
+ {
|
||||
+ if (get_identifier (p->classname) == context
|
||||
+ && get_identifier (p->method) == method)
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
/* Scan the rules list for replacements for *METHOD_P and replace the
|
||||
args accordingly. If the rewrite results in an access to a private
|
||||
method, update SPECIAL.*/
|
||||
--- gcc/java/java-tree.h (revision 122746)
|
||||
+++ gcc/java/java-tree.h (working copy)
|
||||
@@ -1171,6 +1171,7 @@
|
||||
extern void initialize_builtins (void);
|
||||
|
||||
extern tree lookup_name (tree);
|
||||
+extern bool special_method_p (tree);
|
||||
extern void maybe_rewrite_invocation (tree *, tree *, tree *, tree *);
|
||||
extern tree build_known_method_ref (tree, tree, tree, tree, tree, tree);
|
||||
extern tree build_class_init (tree, tree);
|
||||
|
113
gcc41-pr31187.patch
Normal file
113
gcc41-pr31187.patch
Normal file
@ -0,0 +1,113 @@
|
||||
2007-03-30 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/31187
|
||||
* typeck.c (cp_type_readonly): New fn.
|
||||
* cp-tree.h: Declare it.
|
||||
* decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
|
||||
(cp_finish_decl): Not here.
|
||||
|
||||
2007-04-02 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/31187
|
||||
* g++.dg/ext/visibility/anon3.C: New test.
|
||||
|
||||
--- gcc/cp/typeck.c (revision 123431)
|
||||
+++ gcc/cp/typeck.c (revision 123432)
|
||||
@@ -6897,6 +6897,16 @@ cp_type_quals (tree type)
|
||||
return TYPE_QUALS (type);
|
||||
}
|
||||
|
||||
+/* Returns nonzero if the TYPE is const from a C++ perspective: look inside
|
||||
+ arrays. */
|
||||
+
|
||||
+bool
|
||||
+cp_type_readonly (tree type)
|
||||
+{
|
||||
+ type = strip_array_types (type);
|
||||
+ return TYPE_READONLY (type);
|
||||
+}
|
||||
+
|
||||
/* Returns nonzero if the TYPE contains a mutable member. */
|
||||
|
||||
bool
|
||||
--- gcc/cp/decl.c (revision 123431)
|
||||
+++ gcc/cp/decl.c (revision 123432)
|
||||
@@ -3797,6 +3797,7 @@ start_decl (const cp_declarator *declara
|
||||
tree decl;
|
||||
tree type, tem;
|
||||
tree context;
|
||||
+ bool was_public;
|
||||
|
||||
*pushed_scope_p = NULL_TREE;
|
||||
|
||||
@@ -3951,6 +3952,8 @@ start_decl (const cp_declarator *declara
|
||||
decl);
|
||||
}
|
||||
|
||||
+ was_public = TREE_PUBLIC (decl);
|
||||
+
|
||||
/* Enter this declaration into the symbol table. */
|
||||
tem = maybe_push_decl (decl);
|
||||
|
||||
@@ -3971,6 +3974,17 @@ start_decl (const cp_declarator *declara
|
||||
&& !have_global_bss_p ())
|
||||
DECL_COMMON (tem) = 1;
|
||||
|
||||
+ if (TREE_CODE (tem) == VAR_DECL
|
||||
+ && DECL_NAMESPACE_SCOPE_P (tem) && !TREE_PUBLIC (tem) && !was_public
|
||||
+ && !DECL_THIS_STATIC (tem) && !DECL_ARTIFICIAL (tem))
|
||||
+ {
|
||||
+ /* This is a const variable with implicit 'static'. Set
|
||||
+ DECL_THIS_STATIC so we can tell it from variables that are
|
||||
+ !TREE_PUBLIC because of the anonymous namespace. */
|
||||
+ gcc_assert (cp_type_readonly (TREE_TYPE (tem)));
|
||||
+ DECL_THIS_STATIC (tem) = 1;
|
||||
+ }
|
||||
+
|
||||
if (!processing_template_decl && TREE_CODE (tem) == VAR_DECL)
|
||||
start_decl_1 (tem, initialized);
|
||||
|
||||
@@ -5283,14 +5297,6 @@ cp_finish_decl (tree decl, tree init, bo
|
||||
{
|
||||
layout_var_decl (decl);
|
||||
maybe_commonize_var (decl);
|
||||
- if (DECL_NAMESPACE_SCOPE_P (decl) && !TREE_PUBLIC (decl)
|
||||
- && !DECL_THIS_STATIC (decl) && !DECL_ARTIFICIAL (decl))
|
||||
- {
|
||||
- /* This is a const variable with implicit 'static'. Set
|
||||
- DECL_THIS_STATIC so we can tell it from variables that are
|
||||
- !TREE_PUBLIC because of the anonymous namespace. */
|
||||
- DECL_THIS_STATIC (decl) = 1;
|
||||
- }
|
||||
}
|
||||
|
||||
make_rtl_for_nonlocal_decl (decl, init, asmspec);
|
||||
--- gcc/cp/cp-tree.h (revision 123431)
|
||||
+++ gcc/cp/cp-tree.h (revision 123432)
|
||||
@@ -4742,6 +4742,7 @@ extern bool comp_ptr_ttypes_const (tree
|
||||
extern int ptr_reasonably_similar (tree, tree);
|
||||
extern tree build_ptrmemfunc (tree, tree, int, bool);
|
||||
extern int cp_type_quals (tree);
|
||||
+extern bool cp_type_readonly (tree);
|
||||
extern bool cp_has_mutable_p (tree);
|
||||
extern bool at_least_as_qualified_p (tree, tree);
|
||||
extern void cp_apply_type_quals_to_decl (int, tree);
|
||||
--- gcc/testsuite/g++.dg/ext/visibility/anon3.C (revision 0)
|
||||
+++ gcc/testsuite/g++.dg/ext/visibility/anon3.C (revision 123432)
|
||||
@@ -0,0 +1,16 @@
|
||||
+// PR c++/31187
|
||||
+// Bug: the repeated declaration was confusing the compiler into
|
||||
+// thinking that foo1 had language internal linkage.
|
||||
+
|
||||
+class foo { };
|
||||
+
|
||||
+namespace
|
||||
+{
|
||||
+ extern foo foo1;
|
||||
+ foo foo1;
|
||||
+}
|
||||
+
|
||||
+template< foo * >
|
||||
+class bar { };
|
||||
+
|
||||
+bar< &foo1 > bar1;
|
668
gcc41-rh231818.patch
Normal file
668
gcc41-rh231818.patch
Normal file
@ -0,0 +1,668 @@
|
||||
2007-04-02 Francis Kung <fkung@redhat.com>
|
||||
|
||||
* gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
|
||||
(fontSet): Initialize to null.
|
||||
(FreetypeGlyphVector(Font, int[], FontRenderContext)): Populate fontSet
|
||||
array with default font if needed.
|
||||
(FreetypeGlyphVector(FreetypeGlyphVector)): Clone all fields.
|
||||
(getNativeFontPointer): New native method.
|
||||
* include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h: Regenerated.
|
||||
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
|
||||
(Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getNativeFontPointer):
|
||||
New function.
|
||||
|
||||
2007-04-02 Francis Kung <fkung@redhat.com>
|
||||
|
||||
* gnu/java/awt/peer/gtk/CairoGraphics2D.java
|
||||
(cairoDrawGlyphVector): Added parameter.
|
||||
(drawGlyphVector): Retrieve and pass fontset parameter.
|
||||
* gnu/java/awt/peer/gtk/ComponentGraphics.java
|
||||
(cairoDrawGlyphVector): Added parameter.
|
||||
(lock): Removed unnecessary cast.
|
||||
(unlock): Removed unnecessary cast and explicitly set to ONE variable.
|
||||
* gnu/java/awt/peer/gtk/FreetypeGlyphVector.java
|
||||
(fontSet): New field.
|
||||
(dispose): New native method.
|
||||
(finalize): New method.
|
||||
(getGlyphFonts): New method.
|
||||
(getGlyphOutline): Pass fontSet parameter to native method.
|
||||
(getGlyphOutlineNative): Added parameter.
|
||||
(getGlyphs): Pass extra parameters to native method.
|
||||
(getGlyphsNative): Added parameters.
|
||||
(getKerning): Added fontSet parameter.
|
||||
(getMetricsNative): Added fontSet parameter.
|
||||
(performDefaultLayout): Only check kerning if glyphs use the same font.
|
||||
(setupGlyphMetrics): Pass extra parameters to native methods.
|
||||
* include/gnu_java_awt_peer_gtk_CairoGraphics2D.h,
|
||||
* include/gnu_java_awt_peer_gtk_FreetypGlyphVector.h: Regenerated.
|
||||
* native/jni/gtk-peer/gdkfont.h: Enable pango engine.
|
||||
(peerfont): Add variable for fontset.
|
||||
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c
|
||||
(Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawGlyphVector): Accept
|
||||
array of font pointers to use when drawing glyphs.
|
||||
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c
|
||||
(getFontSet): New function.
|
||||
(Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_dispose): New function.
|
||||
(Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphOutlineNative):
|
||||
Added and use new fontSet parameter.
|
||||
(Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphs): Use pango
|
||||
to retrieve glyphs and estimate font, if the current font does not contain
|
||||
a requested glyph.
|
||||
(Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getKerning): Added and use
|
||||
new fontSet parameter.
|
||||
(Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getMetricsNative): Added
|
||||
and use new fontSet parameter.
|
||||
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
|
||||
(Java_gnu_java_awt_peer_gtk_GdkFontPeer_dispose): Free fontset.
|
||||
(Java_gnu_java_awt_peer_gtk_GdkFontPeer_setFont): Load fontset.
|
||||
|
||||
--- libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java 16 Mar 2007 15:14:53 -0000 1.67
|
||||
+++ libjava/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java 2 Apr 2007 19:39:26 -0000 1.68
|
||||
@@ -402,7 +402,7 @@ public abstract class CairoGraphics2D ex
|
||||
*/
|
||||
protected native void cairoDrawGlyphVector(long pointer, GdkFontPeer font,
|
||||
float x, float y, int n,
|
||||
- int[] codes, float[] positions);
|
||||
+ int[] codes, float[] positions, long[] fontset);
|
||||
|
||||
/**
|
||||
* Set the font in cairo.
|
||||
@@ -1730,6 +1730,7 @@ public abstract class CairoGraphics2D ex
|
||||
{
|
||||
int n = gv.getNumGlyphs ();
|
||||
int[] codes = gv.getGlyphCodes (0, n, null);
|
||||
+ long[] fontset = ((FreetypeGlyphVector)gv).getGlyphFonts (0, n, null);
|
||||
float[] positions = gv.getGlyphPositions (0, n, null);
|
||||
|
||||
setFont (gv.getFont ());
|
||||
@@ -1737,7 +1738,7 @@ public abstract class CairoGraphics2D ex
|
||||
synchronized (fontPeer)
|
||||
{
|
||||
cairoDrawGlyphVector(nativePointer, fontPeer,
|
||||
- x, y, n, codes, positions);
|
||||
+ x, y, n, codes, positions, fontset);
|
||||
}
|
||||
}
|
||||
else
|
||||
--- libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java 16 Mar 2007 15:14:53 -0000 1.25
|
||||
+++ libjava/classpath/gnu/java/awt/peer/gtk/ComponentGraphics.java 2 Apr 2007 19:39:26 -0000 1.26
|
||||
@@ -121,7 +121,7 @@ public class ComponentGraphics extends C
|
||||
*/
|
||||
private void lock()
|
||||
{
|
||||
- Integer i = (Integer) hasLock.get();
|
||||
+ Integer i = hasLock.get();
|
||||
if (i == null)
|
||||
{
|
||||
start_gdk_drawing();
|
||||
@@ -136,7 +136,7 @@ public class ComponentGraphics extends C
|
||||
*/
|
||||
private void unlock()
|
||||
{
|
||||
- Integer i = (Integer) hasLock.get();
|
||||
+ Integer i = hasLock.get();
|
||||
if (i == null)
|
||||
throw new IllegalStateException();
|
||||
if (i == ONE)
|
||||
@@ -144,6 +144,8 @@ public class ComponentGraphics extends C
|
||||
hasLock.set(null);
|
||||
end_gdk_drawing();
|
||||
}
|
||||
+ else if (i.intValue() == 2)
|
||||
+ hasLock.set(ONE);
|
||||
else
|
||||
hasLock.set(Integer.valueOf(i.intValue() - 1));
|
||||
}
|
||||
@@ -744,12 +746,14 @@ public class ComponentGraphics extends C
|
||||
@Override
|
||||
protected void cairoDrawGlyphVector(long pointer, GdkFontPeer font,
|
||||
float x, float y, int n,
|
||||
- int[] codes, float[] positions)
|
||||
+ int[] codes, float[] positions,
|
||||
+ long[] fontset)
|
||||
{
|
||||
try
|
||||
{
|
||||
lock();
|
||||
- super.cairoDrawGlyphVector(pointer, font, x, y, n, codes, positions);
|
||||
+ super.cairoDrawGlyphVector(pointer, font, x, y, n, codes, positions,
|
||||
+ fontset);
|
||||
}
|
||||
finally
|
||||
{
|
||||
--- libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java 6 Mar 2007 19:38:31 -0000 1.16
|
||||
+++ libjava/classpath/gnu/java/awt/peer/gtk/FreetypeGlyphVector.java 2 Apr 2007 21:28:58 -0000 1.18
|
||||
@@ -79,6 +79,11 @@ public class FreetypeGlyphVector extends
|
||||
* The glyph codes
|
||||
*/
|
||||
private int[] glyphCodes;
|
||||
+
|
||||
+ /**
|
||||
+ * The set of fonts used in this glyph vector.
|
||||
+ */
|
||||
+ private long[] fontSet = null;
|
||||
|
||||
/**
|
||||
* Glyph transforms. (de facto only the translation is used)
|
||||
@@ -86,6 +91,19 @@ public class FreetypeGlyphVector extends
|
||||
private AffineTransform[] glyphTransforms;
|
||||
|
||||
private GlyphMetrics[] metricsCache;
|
||||
+
|
||||
+ private native void dispose(long[] fonts);
|
||||
+
|
||||
+ /**
|
||||
+ * Returns a pointer to the native PangoFcFont object.
|
||||
+ *
|
||||
+ * The object will be referenced with g_object_ref n times before being
|
||||
+ * returned, and must be unreferenced a corresponding number of times.
|
||||
+ *
|
||||
+ * @param n Number of times to reference the object.
|
||||
+ * @return Pointer to the native default font.
|
||||
+ */
|
||||
+ private native long getNativeFontPointer(int n);
|
||||
|
||||
/**
|
||||
* Create a glyphvector from a given (Freetype) font and a String.
|
||||
@@ -135,6 +153,13 @@ public class FreetypeGlyphVector extends
|
||||
glyphCodes = new int[ codes.length ];
|
||||
System.arraycopy(codes, 0, glyphCodes, 0, codes.length);
|
||||
nGlyphs = glyphCodes.length;
|
||||
+
|
||||
+ if (fontSet == null)
|
||||
+ {
|
||||
+ fontSet = new long[nGlyphs];
|
||||
+ Arrays.fill(fontSet, getNativeFontPointer(nGlyphs));
|
||||
+ }
|
||||
+
|
||||
performDefaultLayout();
|
||||
}
|
||||
|
||||
@@ -157,6 +182,7 @@ public class FreetypeGlyphVector extends
|
||||
}
|
||||
|
||||
glyphCodes = new int[ nGlyphs ];
|
||||
+ fontSet = new long[nGlyphs];
|
||||
glyphPositions = new float[(nGlyphs + 1) * 2];
|
||||
glyphTransforms = new AffineTransform[ nGlyphs ];
|
||||
for(int i = 0; i < nGlyphs; i++ )
|
||||
@@ -166,6 +192,13 @@ public class FreetypeGlyphVector extends
|
||||
}
|
||||
System.arraycopy(gv.glyphPositions, 0, glyphPositions, 0,
|
||||
glyphPositions.length);
|
||||
+ System.arraycopy(gv.glyphCodes, 0, glyphCodes, 0, nGlyphs);
|
||||
+ System.arraycopy(gv.fontSet, 0, fontSet, 0, nGlyphs);
|
||||
+ }
|
||||
+
|
||||
+ public void finalize()
|
||||
+ {
|
||||
+ dispose(fontSet);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,6 +208,7 @@ public class FreetypeGlyphVector extends
|
||||
{
|
||||
nGlyphs = s.codePointCount( 0, s.length() );
|
||||
glyphCodes = new int[ nGlyphs ];
|
||||
+ fontSet = new long[ nGlyphs ];
|
||||
int[] codePoints = new int[ nGlyphs ];
|
||||
int stringIndex = 0;
|
||||
|
||||
@@ -194,22 +228,22 @@ public class FreetypeGlyphVector extends
|
||||
}
|
||||
}
|
||||
|
||||
- glyphCodes = getGlyphs( codePoints );
|
||||
+ getGlyphs( codePoints, glyphCodes, fontSet );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the glyph code within the font for a given character
|
||||
*/
|
||||
- public native int[] getGlyphs(int[] codepoints);
|
||||
+ public native int[] getGlyphs(int[] codepoints, int[] glyphs, long[] fonts);
|
||||
|
||||
/**
|
||||
* Returns the kerning of a glyph pair
|
||||
*/
|
||||
- private native Point2D getKerning(int leftGlyph, int rightGlyph);
|
||||
+ private native Point2D getKerning(int leftGlyph, int rightGlyph, long font);
|
||||
|
||||
- private native double[] getMetricsNative( int glyphCode );
|
||||
+ private native double[] getMetricsNative(int glyphCode, long font);
|
||||
|
||||
- private native GeneralPath getGlyphOutlineNative(int glyphIndex);
|
||||
+ private native GeneralPath getGlyphOutlineNative(int glyphIndex, long font);
|
||||
|
||||
|
||||
public Object clone()
|
||||
@@ -267,10 +301,12 @@ public class FreetypeGlyphVector extends
|
||||
|
||||
x += gm.getAdvanceX();
|
||||
y += gm.getAdvanceY();
|
||||
-
|
||||
- if (i != nGlyphs-1)
|
||||
+
|
||||
+ // Get the kerning only if it's not the last glyph, and the two glyphs are
|
||||
+ // using the same font
|
||||
+ if (i != nGlyphs-1 && fontSet[i] == fontSet[i+1])
|
||||
{
|
||||
- Point2D p = getKerning(glyphCodes[i], glyphCodes[i + 1]);
|
||||
+ Point2D p = getKerning(glyphCodes[i], glyphCodes[i + 1], fontSet[i]);
|
||||
x += p.getX();
|
||||
y += p.getY();
|
||||
}
|
||||
@@ -305,6 +341,26 @@ public class FreetypeGlyphVector extends
|
||||
return rval;
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Returns pointers to the fonts used in this glyph vector.
|
||||
+ *
|
||||
+ * The array index matches that of the glyph vector itself.
|
||||
+ */
|
||||
+ protected long[] getGlyphFonts(int beginGlyphIndex, int numEntries,
|
||||
+ long[] codeReturn)
|
||||
+ {
|
||||
+ long[] rval;
|
||||
+
|
||||
+ if( codeReturn == null || codeReturn.length < numEntries)
|
||||
+ rval = new long[ numEntries ];
|
||||
+ else
|
||||
+ rval = codeReturn;
|
||||
+
|
||||
+ System.arraycopy(fontSet, beginGlyphIndex, rval, 0, numEntries);
|
||||
+
|
||||
+ return rval;
|
||||
+ }
|
||||
+
|
||||
public Shape getGlyphLogicalBounds(int glyphIndex)
|
||||
{
|
||||
GlyphMetrics gm = getGlyphMetrics( glyphIndex );
|
||||
@@ -335,11 +391,10 @@ public class FreetypeGlyphVector extends
|
||||
|
||||
for(int i = 0; i < nGlyphs; i++)
|
||||
{
|
||||
- GlyphMetrics gm = (GlyphMetrics)
|
||||
- peer.getGlyphMetrics( glyphCodes[ i ] );
|
||||
+ GlyphMetrics gm = (GlyphMetrics)peer.getGlyphMetrics(glyphCodes[i]);
|
||||
if( gm == null )
|
||||
{
|
||||
- double[] val = getMetricsNative( glyphCodes[ i ] );
|
||||
+ double[] val = getMetricsNative(glyphCodes[i], fontSet[i]);
|
||||
if( val == null )
|
||||
gm = null;
|
||||
else
|
||||
@@ -376,7 +431,8 @@ public class FreetypeGlyphVector extends
|
||||
*/
|
||||
public Shape getGlyphOutline(int glyphIndex)
|
||||
{
|
||||
- GeneralPath gp = getGlyphOutlineNative( glyphCodes[ glyphIndex ] );
|
||||
+ GeneralPath gp = getGlyphOutlineNative(glyphCodes[glyphIndex],
|
||||
+ fontSet[glyphIndex]);
|
||||
|
||||
AffineTransform tx = AffineTransform.getTranslateInstance(glyphPositions[glyphIndex*2],
|
||||
glyphPositions[glyphIndex*2+1]);
|
||||
--- libjava/classpath/include/gnu_java_awt_peer_gtk_CairoGraphics2D.h 16 Mar 2007 15:14:53 -0000 1.17
|
||||
+++ libjava/classpath/include/gnu_java_awt_peer_gtk_CairoGraphics2D.h 2 Apr 2007 19:39:26 -0000 1.18
|
||||
@@ -22,7 +22,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetFillRule (JNIEnv *env, jobject, jlong, jint);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetLine (JNIEnv *env, jobject, jlong, jdouble, jint, jint, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetDash (JNIEnv *env, jobject, jlong, jdoubleArray, jint, jdouble);
|
||||
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawGlyphVector (JNIEnv *env, jobject, jlong, jobject, jfloat, jfloat, jint, jintArray, jfloatArray);
|
||||
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoDrawGlyphVector (JNIEnv *env, jobject, jlong, jobject, jfloat, jfloat, jint, jintArray, jfloatArray, jlongArray);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoSetFont (JNIEnv *env, jobject, jlong, jobject);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoRectangle (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble);
|
||||
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_CairoGraphics2D_cairoArc (JNIEnv *env, jobject, jlong, jdouble, jdouble, jdouble, jdouble, jdouble);
|
||||
--- libjava/classpath/include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h 11 Jun 2006 08:29:57 -0000 1.2
|
||||
+++ libjava/classpath/include/gnu_java_awt_peer_gtk_FreetypeGlyphVector.h 2 Apr 2007 21:28:58 -0000 1.4
|
||||
@@ -10,10 +10,12 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
-JNIEXPORT jintArray JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphs (JNIEnv *env, jobject, jintArray);
|
||||
-JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getKerning (JNIEnv *env, jobject, jint, jint);
|
||||
-JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getMetricsNative (JNIEnv *env, jobject, jint);
|
||||
-JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphOutlineNative (JNIEnv *env, jobject, jint);
|
||||
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphs (JNIEnv *env, jobject, jintArray, jintArray, jlongArray);
|
||||
+JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getKerning (JNIEnv *env, jobject, jint, jint, jlong);
|
||||
+JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getMetricsNative (JNIEnv *env, jobject, jint, jlong);
|
||||
+JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphOutlineNative (JNIEnv *env, jobject, jint, jlong);
|
||||
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_dispose (JNIEnv *env, jobject, jlongArray);
|
||||
+JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getNativeFontPointer (JNIEnv *env, jobject, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
--- libjava/classpath/native/jni/gtk-peer/gdkfont.h 21 Nov 2006 14:14:25 -0000 1.10
|
||||
+++ libjava/classpath/native/jni/gtk-peer/gdkfont.h 2 Apr 2007 19:39:26 -0000 1.11
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include "gtkpeer.h"
|
||||
|
||||
+#define PANGO_ENABLE_ENGINE
|
||||
#include <pango/pango.h>
|
||||
#include <pango/pango-context.h>
|
||||
#include <pango/pango-fontmap.h>
|
||||
@@ -123,6 +124,7 @@ extern struct state_table *cp_gtk_native
|
||||
struct peerfont
|
||||
{
|
||||
PangoFont *font;
|
||||
+ PangoFontset *set;
|
||||
PangoFontDescription *desc;
|
||||
PangoContext *ctx;
|
||||
PangoLayout *layout;
|
||||
--- libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c 16 Mar 2007 15:14:55 -0000 1.21
|
||||
+++ libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c 2 Apr 2007 19:39:26 -0000 1.22
|
||||
@@ -308,9 +308,8 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics
|
||||
jobject font,
|
||||
jfloat x, jfloat y, jint n,
|
||||
jintArray java_codes,
|
||||
- jfloatArray java_positions)
|
||||
+ jfloatArray java_positions, jlongArray java_fontset)
|
||||
{
|
||||
-
|
||||
struct cairographics2d *gr = NULL;
|
||||
struct peerfont *pfont = NULL;
|
||||
cairo_glyph_t *glyphs = NULL;
|
||||
@@ -333,6 +332,7 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics
|
||||
native_codes = (*env)->GetIntArrayElements (env, java_codes, NULL);
|
||||
native_positions = (*env)->GetFloatArrayElements (env, java_positions, NULL);
|
||||
|
||||
+ /* Set up glyphs and layout */
|
||||
for (i = 0; i < n; ++i)
|
||||
{
|
||||
glyphs[i].index = native_codes[i];
|
||||
@@ -343,10 +343,31 @@ Java_gnu_java_awt_peer_gtk_CairoGraphics
|
||||
(*env)->ReleaseFloatArrayElements (env, java_positions, native_positions, 0);
|
||||
(*env)->ReleaseIntArrayElements (env, java_codes, native_codes, 0);
|
||||
|
||||
- pango_fc_font_lock_face( (PangoFcFont *)pfont->font );
|
||||
- cairo_show_glyphs (gr->cr, glyphs, n);
|
||||
- pango_fc_font_unlock_face( (PangoFcFont *)pfont->font );
|
||||
+ /* Iterate through glyphs and draw */
|
||||
+ jlong* fonts = (*env)->GetLongArrayElements (env, java_fontset, NULL);
|
||||
+ for (i = 0; i < n; i++)
|
||||
+ {
|
||||
+ PangoFcFont *font = JLONG_TO_PTR(PangoFcFont, fonts[i]);
|
||||
+
|
||||
+ /* Draw as many glyphs as possible with the current font */
|
||||
+ int length = 0;
|
||||
+ while (i < n-1 && fonts[i] == fonts[i+1])
|
||||
+ {
|
||||
+ length++;
|
||||
+ i++;
|
||||
+ }
|
||||
+
|
||||
+ FT_Face face = pango_fc_font_lock_face( font );
|
||||
+ cairo_font_face_t *ft = cairo_ft_font_face_create_for_ft_face (face, 0);
|
||||
+ g_assert (ft != NULL);
|
||||
|
||||
+ cairo_set_font_face (gr->cr, ft);
|
||||
+ cairo_show_glyphs (gr->cr, &glyphs[i-length], length+1);
|
||||
+
|
||||
+ cairo_font_face_destroy (ft);
|
||||
+ pango_fc_font_unlock_face(font);
|
||||
+ }
|
||||
+
|
||||
g_free(glyphs);
|
||||
}
|
||||
|
||||
--- libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c 11 Jun 2006 11:31:03 -0000 1.4
|
||||
+++ libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_FreetypeGlyphVector.c 2 Apr 2007 21:28:59 -0000 1.6
|
||||
@@ -35,6 +35,7 @@ this exception to your version of the li
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
+#define PANGO_ENABLE_ENGINE
|
||||
#include <jni.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
@@ -43,6 +44,7 @@ exception statement from your version. *
|
||||
#include <pango/pangofc-font.h>
|
||||
#include <freetype/ftglyph.h>
|
||||
#include <freetype/ftoutln.h>
|
||||
+#include "jcl.h"
|
||||
#include "native_state.h"
|
||||
#include "gdkfont.h"
|
||||
#include "gnu_java_awt_peer_gtk_FreetypeGlyphVector.h"
|
||||
@@ -81,42 +83,92 @@ getFont(JNIEnv *env, jobject obj)
|
||||
return (PangoFcFont *)pfont->font;
|
||||
}
|
||||
|
||||
-JNIEXPORT jintArray JNICALL
|
||||
+static PangoFontset *
|
||||
+getFontSet(JNIEnv *env, jobject obj)
|
||||
+{
|
||||
+ jfieldID fid;
|
||||
+ jobject data;
|
||||
+ jclass cls;
|
||||
+ struct peerfont *pfont;
|
||||
+
|
||||
+ cls = (*env)->GetObjectClass (env, obj);
|
||||
+ fid = (*env)->GetFieldID (env, cls, "peer",
|
||||
+ "Lgnu/java/awt/peer/gtk/GdkFontPeer;");
|
||||
+ g_assert (fid != 0);
|
||||
+
|
||||
+ data = (*env)->GetObjectField (env, obj, fid);
|
||||
+ g_assert (data != NULL);
|
||||
+
|
||||
+ pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, data);
|
||||
+ g_assert (pfont != NULL);
|
||||
+ g_assert (pfont->font != NULL);
|
||||
+
|
||||
+ return (PangoFontset *)pfont->set;
|
||||
+}
|
||||
+
|
||||
+JNIEXPORT void JNICALL
|
||||
Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphs
|
||||
- (JNIEnv *env, jobject obj, jintArray codepoints)
|
||||
+ (JNIEnv *env, jobject obj, jintArray codepoints, jintArray glyphs,
|
||||
+ jlongArray fonts)
|
||||
{
|
||||
- FT_Face ft_face;
|
||||
- jintArray retArray;
|
||||
- PangoFcFont *font;
|
||||
- jint *values, *cpvals;
|
||||
+ PangoFcFont *default_font, *current_font;
|
||||
+ PangoFontset *pfs;
|
||||
+ jint *cpvals;
|
||||
jint length;
|
||||
int i;
|
||||
|
||||
- font = getFont(env, obj);
|
||||
-
|
||||
- ft_face = pango_fc_font_lock_face( font );
|
||||
- g_assert (ft_face != NULL);
|
||||
+ /* Set up default font and fontset */
|
||||
+ default_font = getFont(env, obj);
|
||||
+ current_font = default_font;
|
||||
+ pfs = getFontSet(env, obj);
|
||||
|
||||
+ /* Retrieve string information */
|
||||
length = (*env)->GetArrayLength (env, codepoints);
|
||||
cpvals = (*env)->GetIntArrayElements (env, codepoints, NULL);
|
||||
+
|
||||
+ jint *glyphArray = (*env)->GetIntArrayElements (env, glyphs, NULL);
|
||||
+ jlong *fontArray = (*env)->GetLongArrayElements (env, fonts, NULL);
|
||||
|
||||
- retArray = (*env)->NewIntArray (env, length);
|
||||
- values = (*env)->GetIntArrayElements (env, retArray, NULL);
|
||||
+ /* A design goal of Pango is to be threadsafe, but it's admitted that it is
|
||||
+ * not actually threadsafe at the moment. Using gdk locking here to be safe,
|
||||
+ * but I don't know if if actually helps at all... */
|
||||
+ gdk_threads_enter();
|
||||
|
||||
for( i = 0; i < length; i++ )
|
||||
- values[i] = FT_Get_Char_Index( ft_face, cpvals[i] );
|
||||
+ {
|
||||
+ /* Ensure the current font has the requested character; if it doesn't,
|
||||
+ * try the default font before pulling a new font out of the fontset.
|
||||
+ * Once chosen, a font will be used until a character not in the font is
|
||||
+ * encountered. */
|
||||
+ if (!pango_fc_font_has_char(current_font, cpvals[i]))
|
||||
+ {
|
||||
+ if (pango_fc_font_has_char(default_font, cpvals[i]))
|
||||
+ {
|
||||
+ current_font = default_font;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ current_font = (PangoFcFont*)pango_fontset_get_font(pfs, cpvals[i]);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Get glyph, and store both glyph and pointer to font */
|
||||
+ glyphArray[i] = (int)pango_fc_font_get_glyph(current_font,
|
||||
+ (gunichar)cpvals[i]);
|
||||
+ g_object_ref(current_font);
|
||||
+ fontArray[i] = PTR_TO_JLONG(current_font);
|
||||
+ }
|
||||
+
|
||||
+ gdk_threads_leave();
|
||||
|
||||
- (*env)->ReleaseIntArrayElements (env, retArray, values, 0);
|
||||
+ (*env)->ReleaseIntArrayElements (env, glyphs, glyphArray, 0);
|
||||
(*env)->ReleaseIntArrayElements (env, codepoints, cpvals, 0);
|
||||
-
|
||||
- pango_fc_font_unlock_face (font);
|
||||
-
|
||||
- return retArray;
|
||||
+ (*env)->ReleaseLongArrayElements (env, fonts, fontArray, 0);
|
||||
}
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getKerning
|
||||
-(JNIEnv *env, jobject obj, jint rightGlyph, jint leftGlyph)
|
||||
+(JNIEnv *env, jobject obj __attribute__((unused)), jint rightGlyph, jint leftGlyph, jlong fnt)
|
||||
{
|
||||
FT_Face ft_face;
|
||||
FT_Vector kern;
|
||||
@@ -125,7 +177,7 @@ Java_gnu_java_awt_peer_gtk_FreetypeGlyph
|
||||
jvalue values[2];
|
||||
PangoFcFont *font;
|
||||
|
||||
- font = getFont(env, obj);
|
||||
+ font = JLONG_TO_PTR(PangoFcFont, fnt);
|
||||
ft_face = pango_fc_font_lock_face( font );
|
||||
g_assert (ft_face != NULL);
|
||||
FT_Get_Kerning( ft_face, rightGlyph, leftGlyph, FT_KERNING_DEFAULT, &kern );
|
||||
@@ -142,14 +194,14 @@ Java_gnu_java_awt_peer_gtk_FreetypeGlyph
|
||||
|
||||
JNIEXPORT jdoubleArray JNICALL
|
||||
Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getMetricsNative
|
||||
-(JNIEnv *env, jobject obj, jint glyphIndex )
|
||||
+(JNIEnv *env, jobject obj __attribute__((unused)), jint glyphIndex, jlong fnt)
|
||||
{
|
||||
FT_Face ft_face;
|
||||
jdouble *values;
|
||||
jdoubleArray retArray = NULL;
|
||||
PangoFcFont *font;
|
||||
|
||||
- font = getFont(env, obj);
|
||||
+ font = JLONG_TO_PTR(PangoFcFont, fnt);
|
||||
ft_face = pango_fc_font_lock_face( font );
|
||||
|
||||
g_assert (ft_face != NULL);
|
||||
@@ -285,7 +337,7 @@ static int _curveTo( const FT_Vector* c
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getGlyphOutlineNative
|
||||
- (JNIEnv *env, jobject obj, jint glyphIndex)
|
||||
+ (JNIEnv *env, jobject obj __attribute__((unused)), jint glyphIndex, jlong fnt)
|
||||
{
|
||||
generalpath *path;
|
||||
jobject gp;
|
||||
@@ -302,7 +354,7 @@ Java_gnu_java_awt_peer_gtk_FreetypeGlyph
|
||||
FT_Face ft_face;
|
||||
FT_Glyph glyph;
|
||||
|
||||
- font = getFont(env, obj);
|
||||
+ font = JLONG_TO_PTR(PangoFcFont, fnt);
|
||||
ft_face = pango_fc_font_lock_face( font );
|
||||
|
||||
g_assert (ft_face != NULL);
|
||||
@@ -345,4 +397,39 @@ Java_gnu_java_awt_peer_gtk_FreetypeGlyph
|
||||
return gp;
|
||||
}
|
||||
|
||||
+JNIEXPORT void JNICALL
|
||||
+Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_dispose
|
||||
+ (JNIEnv *env, jobject obj __attribute__((unused)), jlongArray fontset)
|
||||
+{
|
||||
+ PangoFcFont *font;
|
||||
+ jlong *fontArray;
|
||||
+ int i, length;
|
||||
|
||||
+ length = (*env)->GetArrayLength (env, fontset);
|
||||
+ fontArray = (*env)->GetLongArrayElements (env, fontset, NULL);
|
||||
+
|
||||
+ gdk_threads_enter();
|
||||
+
|
||||
+ for( i = 0; i < length; i++ )
|
||||
+ {
|
||||
+ font = JLONG_TO_PTR(PangoFcFont, fontArray[i]);
|
||||
+ g_object_unref(font);
|
||||
+ }
|
||||
+
|
||||
+ gdk_threads_leave();
|
||||
+
|
||||
+ (*env)->ReleaseLongArrayElements (env, fontset, fontArray, 0);
|
||||
+}
|
||||
+
|
||||
+JNIEXPORT jlong JNICALL
|
||||
+Java_gnu_java_awt_peer_gtk_FreetypeGlyphVector_getNativeFontPointer
|
||||
+ (JNIEnv *env, jobject obj, jint n)
|
||||
+{
|
||||
+ int i;
|
||||
+ PangoFcFont *font = getFont(env, obj);
|
||||
+
|
||||
+ for (i = 0; i < n; i++)
|
||||
+ g_object_ref(font);
|
||||
+
|
||||
+ return PTR_TO_JLONG(font);
|
||||
+}
|
||||
--- libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c 26 Feb 2007 22:11:38 -0000 1.22
|
||||
+++ libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c 2 Apr 2007 19:39:26 -0000 1.23
|
||||
@@ -35,6 +35,7 @@
|
||||
obligated to do so. If you do not wish to do so, delete this
|
||||
exception statement from your version. */
|
||||
|
||||
+#define PANGO_ENABLE_ENGINE
|
||||
#include <pango/pango.h>
|
||||
#include <pango/pangoft2.h>
|
||||
#include <pango/pangofc-font.h>
|
||||
@@ -97,6 +98,8 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_d
|
||||
g_object_unref (pfont->layout);
|
||||
if (pfont->font != NULL)
|
||||
g_object_unref (pfont->font);
|
||||
+ if (pfont->set != NULL)
|
||||
+ g_object_unref (pfont->set);
|
||||
if (pfont->ctx != NULL)
|
||||
g_object_unref (pfont->ctx);
|
||||
if (pfont->desc != NULL)
|
||||
@@ -257,6 +260,8 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_s
|
||||
g_object_unref (pfont->ctx);
|
||||
if (pfont->font != NULL)
|
||||
g_object_unref (pfont->font);
|
||||
+ if (pfont->set != NULL)
|
||||
+ g_object_unref (pfont->set);
|
||||
if (pfont->desc != NULL)
|
||||
pango_font_description_free (pfont->desc);
|
||||
|
||||
@@ -268,7 +273,6 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_s
|
||||
pango_font_description_set_family (pfont->desc, family_name);
|
||||
(*env)->ReleaseStringUTFChars(env, family_name_str, family_name);
|
||||
|
||||
-
|
||||
if (style & java_awt_font_BOLD)
|
||||
pango_font_description_set_weight (pfont->desc, PANGO_WEIGHT_BOLD);
|
||||
|
||||
@@ -293,6 +297,8 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_s
|
||||
|
||||
pango_context_set_font_description (pfont->ctx, pfont->desc);
|
||||
pango_context_set_language (pfont->ctx, gtk_get_default_language());
|
||||
+ pfont->set = pango_context_load_fontset(pfont->ctx, pfont->desc,
|
||||
+ gtk_get_default_language());
|
||||
pfont->font = pango_context_load_font (pfont->ctx, pfont->desc);
|
||||
g_assert (pfont->font != NULL);
|
||||
|
73
gcc41-rh234515.patch
Normal file
73
gcc41-rh234515.patch
Normal file
@ -0,0 +1,73 @@
|
||||
2007-01-24 Steve LoBasso <slobasso@yahoo.com>
|
||||
Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
* include/bits/deque.tcc (deque<>::erase(iterator, iterator)):
|
||||
Fix condition.
|
||||
* testsuite/23_containers/deque/modifiers/erase/3.cc: New.
|
||||
|
||||
--- libstdc++-v3/include/bits/deque.tcc (revision 121146)
|
||||
+++ libstdc++-v3/include/bits/deque.tcc (revision 121147)
|
||||
@@ -143,7 +143,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL
|
||||
{
|
||||
const difference_type __n = __last - __first;
|
||||
const difference_type __elems_before = __first - begin();
|
||||
- if (static_cast<size_type>(__elems_before) < (size() - __n) / 2)
|
||||
+ if (static_cast<size_type>(__elems_before) <= (size() - __n) / 2)
|
||||
{
|
||||
if (__first != begin())
|
||||
std::copy_backward(begin(), __first, __last);
|
||||
--- libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/3.cc (revision 0)
|
||||
+++ libstdc++-v3/testsuite/23_containers/deque/modifiers/erase/3.cc (revision 121147)
|
||||
@@ -0,0 +1,52 @@
|
||||
+// Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
+//
|
||||
+// This file is part of the GNU ISO C++ Library. This library is free
|
||||
+// software; you can redistribute it and/or modify it under the
|
||||
+// terms of the GNU General Public License as published by the
|
||||
+// Free Software Foundation; either version 2, or (at your option)
|
||||
+// any later version.
|
||||
+
|
||||
+// This library 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 for more details.
|
||||
+
|
||||
+// You should have received a copy of the GNU General Public License along
|
||||
+// with this library; see the file COPYING. If not, write to the Free
|
||||
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
+// USA.
|
||||
+
|
||||
+// 23.2.1.3 deque modifiers
|
||||
+
|
||||
+#include <deque>
|
||||
+#include <testsuite_hooks.h>
|
||||
+
|
||||
+void erase(size_t num_elm, size_t elm_strt, size_t elm_end)
|
||||
+{
|
||||
+ bool test __attribute__((unused)) = true;
|
||||
+ using __gnu_test::copy_tracker;
|
||||
+ using __gnu_test::assignment_operator;
|
||||
+
|
||||
+ std::deque<copy_tracker> x(num_elm);
|
||||
+ copy_tracker::reset();
|
||||
+
|
||||
+ x.erase(x.begin() + elm_strt, x.begin() + elm_end);
|
||||
+
|
||||
+ const size_t min_num_cpy = std::min(elm_strt, num_elm - elm_end);
|
||||
+ VERIFY( assignment_operator::count() == min_num_cpy );
|
||||
+}
|
||||
+
|
||||
+// http://gcc.gnu.org/ml/libstdc++/2007-01/msg00098.html
|
||||
+void test01()
|
||||
+{
|
||||
+ for (size_t num_elm = 0; num_elm <= 10; ++num_elm)
|
||||
+ for (size_t elm_strt = 0; elm_strt <= num_elm; ++elm_strt)
|
||||
+ for (size_t elm_end = elm_strt; elm_end <= num_elm; ++elm_end)
|
||||
+ erase(num_elm, elm_strt, elm_end);
|
||||
+}
|
||||
+
|
||||
+int main()
|
||||
+{
|
||||
+ test01();
|
||||
+ return 0;
|
||||
+}
|
88
gcc41.spec
88
gcc41.spec
@ -1,6 +1,6 @@
|
||||
%define DATE 20070329
|
||||
%define DATE 20070403
|
||||
%define gcc_version 4.1.2
|
||||
%define gcc_release 7
|
||||
%define gcc_release 8
|
||||
%define _unpackaged_files_terminate_build 0
|
||||
%define multilib_64_archs sparc64 ppc64 s390x x86_64
|
||||
%define include_gappletviewer 1
|
||||
@ -125,27 +125,22 @@ Patch13: gcc41-pr20297-test.patch
|
||||
Patch14: gcc41-objc-rh185398.patch
|
||||
Patch15: gcc41-tests.patch
|
||||
Patch16: gcc41-pr25874.patch
|
||||
Patch17: gcc41-pr27351.patch
|
||||
Patch18: gcc41-hash-style-gnu.patch
|
||||
Patch19: gcc41-pr30001.patch
|
||||
Patch20: gcc41-java-libdotdotlib.patch
|
||||
Patch21: gcc41-pr28709.patch
|
||||
Patch22: gcc41-pr28755.patch
|
||||
Patch23: gcc41-pr27898.patch
|
||||
Patch24: gcc41-pr27567.patch
|
||||
Patch25: gcc41-pr29272.patch
|
||||
Patch26: gcc41-pr29059.patch
|
||||
Patch27: gcc41-strncat-chk.patch
|
||||
Patch28: gcc41-pr29299.patch
|
||||
Patch29: gcc41-pr30113.patch
|
||||
Patch30: gcc41-rh228769.patch
|
||||
Patch31: gcc41-pr30045.patch
|
||||
Patch32: gcc41-rh227376.patch
|
||||
Patch33: gcc41-pr30863.patch
|
||||
Patch34: gcc41-java-bogus-debugline.patch
|
||||
Patch35: gcc41-libffi-selinux.patch
|
||||
Patch36: gcc41-libjava-visibility.patch
|
||||
Patch37: gcc41-pr30847.patch
|
||||
Patch17: gcc41-hash-style-gnu.patch
|
||||
Patch18: gcc41-java-libdotdotlib.patch
|
||||
Patch19: gcc41-pr28709.patch
|
||||
Patch20: gcc41-pr28755.patch
|
||||
Patch21: gcc41-pr27898.patch
|
||||
Patch22: gcc41-pr27567.patch
|
||||
Patch23: gcc41-pr29272.patch
|
||||
Patch24: gcc41-pr29059.patch
|
||||
Patch25: gcc41-strncat-chk.patch
|
||||
Patch26: gcc41-pr29299.patch
|
||||
Patch27: gcc41-java-bogus-debugline.patch
|
||||
Patch28: gcc41-libjava-visibility.patch
|
||||
Patch29: gcc41-pr31187.patch
|
||||
Patch30: gcc41-rh231818.patch
|
||||
Patch31: gcc41-rh234515.patch
|
||||
|
||||
%define _gnu %{nil}
|
||||
%ifarch sparc
|
||||
%define gcc_target_platform sparc64-%{_vendor}-%{_target_os}
|
||||
@ -438,27 +433,21 @@ which are required to run programs compiled with the GNAT.
|
||||
%patch14 -p0 -b .objc-rh185398~
|
||||
%patch15 -p0 -b .tests~
|
||||
%patch16 -p0 -b .pr25874~
|
||||
%patch17 -p0 -b .pr27351~
|
||||
%patch18 -p0 -b .hash-style-gnu~
|
||||
%patch19 -p0 -b .pr30001~
|
||||
%patch20 -p0 -b .java-libdotdotlib~
|
||||
%patch21 -p0 -b .pr28709~
|
||||
%patch22 -p0 -b .pr28755~
|
||||
%patch23 -p0 -b .pr27898~
|
||||
%patch24 -p0 -b .pr27567~
|
||||
%patch25 -p0 -b .pr29272~
|
||||
%patch26 -p0 -b .pr29059~
|
||||
%patch27 -p0 -b .strncat-chk~
|
||||
%patch28 -p0 -b .pr29299~
|
||||
%patch29 -p0 -b .pr30113~
|
||||
%patch30 -p0 -b .rh228769~
|
||||
%patch31 -p0 -b .pr30045~
|
||||
%patch32 -p0 -b .rh227376~
|
||||
%patch33 -p0 -b .pr30863~
|
||||
%patch34 -p0 -b .java-bogus-debugline~
|
||||
%patch35 -p0 -b .libffi-selinux~
|
||||
#%patch36 -p0 -b .libjava-visibility~
|
||||
%patch37 -p0 -b .pr30847~
|
||||
%patch17 -p0 -b .hash-style-gnu~
|
||||
%patch18 -p0 -b .java-libdotdotlib~
|
||||
%patch19 -p0 -b .pr28709~
|
||||
%patch20 -p0 -b .pr28755~
|
||||
%patch21 -p0 -b .pr27898~
|
||||
%patch22 -p0 -b .pr27567~
|
||||
%patch23 -p0 -b .pr29272~
|
||||
%patch24 -p0 -b .pr29059~
|
||||
%patch25 -p0 -b .strncat-chk~
|
||||
%patch26 -p0 -b .pr29299~
|
||||
%patch27 -p0 -b .java-bogus-debugline~
|
||||
%patch28 -p0 -b .libjava-visibility~
|
||||
%patch29 -p0 -b .pr31187~
|
||||
%patch30 -p0 -b .rh231818~
|
||||
%patch31 -p0 -b .rh234515~
|
||||
|
||||
sed -i -e 's/4\.1\.3/4.1.2/' gcc/BASE-VER gcc/version.c
|
||||
sed -i -e 's/" (Red Hat[^)]*)"/" (Red Hat %{version}-%{gcc_release})"/' gcc/version.c
|
||||
@ -1582,6 +1571,17 @@ fi
|
||||
%doc rpm.doc/changelogs/libmudflap/ChangeLog*
|
||||
|
||||
%changelog
|
||||
* Tue Apr 3 2007 Jakub Jelinek <jakub@redhat.com> 4.1.2-8
|
||||
- update from gcc-4_1-branch (-r123245:123462)
|
||||
- PRs target/31137, target/31380
|
||||
- libjava fixes (PRs classpath/31302, classpath/31303, libgcj/29869)
|
||||
- java Proxy fix (Andrew Haley, #234836)
|
||||
- deque::erase fix (Steve LoBasso, Paolo Carlini, #234515)
|
||||
- fix java font rendering (Francis Kung, #231818)
|
||||
- fix a regression caused by C++ visibility fixes (Jason Merrill,
|
||||
PR c++/31187)
|
||||
- use hidden visibility for non-native java private methods (Andrew Haley)
|
||||
|
||||
* Thu Mar 29 2007 Jakub Jelinek <jakub@redhat.com> 4.1.2-7
|
||||
- make sure boehm-gc doesn't use PROT_EXEC (#202209)
|
||||
- fix C++ ICE on i ? j : k = (void) 0; (PR c++/30847)
|
||||
|
Loading…
Reference in New Issue
Block a user