more explicit patches;
authorwenzelm
Sun, 04 Mar 2012 21:46:22 +0100
changeset 46816 a96b25141220
parent 46815 6bccb1dc9bc3
child 46817 90c8620852cf
more explicit patches;
src/Tools/jEdit/patches/cobra
src/Tools/jEdit/patches/cobra-0.98.4/create_font
src/Tools/jEdit/patches/extended_styles
src/Tools/jEdit/patches/jedit-4.4.1/extended_styles
src/Tools/jEdit/patches/jedit-4.4.1/render_context
src/Tools/jEdit/patches/render_context
--- a/src/Tools/jEdit/patches/cobra	Sun Mar 04 19:24:05 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-diff -ru cobra-0.98.4/src/org/lobobrowser/util/gui/FontFactory.java cobra-0.98.4-patched/src/org/lobobrowser/util/gui/FontFactory.java
---- cobra-0.98.4/src/org/lobobrowser/util/gui/FontFactory.java	2008-12-28 17:33:38.000000000 +0100
-+++ cobra-0.98.4-patched/src/org/lobobrowser/util/gui/FontFactory.java	2011-12-17 15:57:03.000000000 +0100
-@@ -29,8 +29,6 @@
- import java.util.logging.*;
- 
- import org.lobobrowser.util.Objects;
--/** Note: Undocumented class? */
--import sun.font.FontManager;
- 
- /**
-  * @author J. H. S.
-@@ -206,8 +204,7 @@
- 	}
- 	
- 	private Font createFont(String name, int style, int size) {
--		// Proprietary Sun API. Maybe shouldn't use it. Works well for Chinese.
--	    return FontManager.getCompositeFontUIResource(new Font(name, style, size));
-+	    return new javax.swing.plaf.FontUIResource(name, style, size);
- 	}
- 	
- 	private static class FontKey {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Tools/jEdit/patches/cobra-0.98.4/create_font	Sun Mar 04 21:46:22 2012 +0100
@@ -0,0 +1,22 @@
+diff -ru cobra-0.98.4/src/org/lobobrowser/util/gui/FontFactory.java cobra-0.98.4-patched/src/org/lobobrowser/util/gui/FontFactory.java
+--- cobra-0.98.4/src/org/lobobrowser/util/gui/FontFactory.java	2008-12-28 17:33:38.000000000 +0100
++++ cobra-0.98.4-patched/src/org/lobobrowser/util/gui/FontFactory.java	2011-12-17 15:57:03.000000000 +0100
+@@ -29,8 +29,6 @@
+ import java.util.logging.*;
+ 
+ import org.lobobrowser.util.Objects;
+-/** Note: Undocumented class? */
+-import sun.font.FontManager;
+ 
+ /**
+  * @author J. H. S.
+@@ -206,8 +204,7 @@
+ 	}
+ 	
+ 	private Font createFont(String name, int style, int size) {
+-		// Proprietary Sun API. Maybe shouldn't use it. Works well for Chinese.
+-	    return FontManager.getCompositeFontUIResource(new Font(name, style, size));
++	    return new javax.swing.plaf.FontUIResource(name, style, size);
+ 	}
+ 	
+ 	private static class FontKey {
--- a/src/Tools/jEdit/patches/extended_styles	Sun Mar 04 19:24:05 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-diff -ru 4.4.1/jEdit/org/gjt/sp/jedit/gui/StyleEditor.java 4.4.1/jEdit-patched/org/gjt/sp/jedit/gui/StyleEditor.java
---- 4.4.1/jEdit/org/gjt/sp/jedit/gui/StyleEditor.java	2011-06-21 01:28:56.000000000 +0200
-+++ 4.4.1/jEdit-patched/org/gjt/sp/jedit/gui/StyleEditor.java	2011-06-22 16:07:32.000000000 +0200
-@@ -78,7 +78,7 @@
- 			start = next;
- 			token = token.next;
- 		}
--		if (token.id == Token.END || token.id == Token.NULL)
-+		if (token.id == Token.END || (token.id % Token.ID_COUNT) == Token.NULL)
- 		{
- 			JOptionPane.showMessageDialog(textArea.getView(),
- 				jEdit.getProperty("syntax-style-no-token.message"),
-diff -ru 4.4.1/jEdit/org/gjt/sp/jedit/syntax/Chunk.java 4.4.1/jEdit-patched/org/gjt/sp/jedit/syntax/Chunk.java
---- 4.4.1/jEdit/org/gjt/sp/jedit/syntax/Chunk.java	2011-06-21 01:29:10.000000000 +0200
-+++ 4.4.1/jEdit-patched/org/gjt/sp/jedit/syntax/Chunk.java	2011-06-22 16:02:07.000000000 +0200
-@@ -380,7 +380,7 @@
- 	// this is either style.getBackgroundColor() or
- 	// styles[defaultID].getBackgroundColor()
- 	private Color background;
--	private String str;
-+	public String str;
- 	//private GlyphVector gv;
- 	private List<GlyphVector> glyphs;
- 	private boolean visible;
-diff -ru 4.4.1/jEdit/org/gjt/sp/jedit/syntax/Token.java 4.4.1/jEdit-patched/org/gjt/sp/jedit/syntax/Token.java
---- 4.4.1/jEdit/org/gjt/sp/jedit/syntax/Token.java	2011-06-21 01:29:10.000000000 +0200
-+++ 4.4.1/jEdit-patched/org/gjt/sp/jedit/syntax/Token.java	2011-06-22 16:08:47.000000000 +0200
-@@ -57,7 +57,7 @@
- 	 */
- 	public static String tokenToString(byte token)
- 	{
--		return (token == Token.END) ? "END" : TOKEN_TYPES[token];
-+		return (token == Token.END) ? "END" : TOKEN_TYPES[token % ID_COUNT];
- 	} //}}}
- 
- 	//{{{ Token types
-diff -ru 4.4.1/jEdit/org/gjt/sp/util/SyntaxUtilities.java 4.4.1/jEdit-patched/org/gjt/sp/util/SyntaxUtilities.java
---- 4.4.1/jEdit/org/gjt/sp/util/SyntaxUtilities.java	2011-06-21 01:29:11.000000000 +0200
-+++ 4.4.1/jEdit-patched/org/gjt/sp/util/SyntaxUtilities.java	2011-06-22 16:05:28.000000000 +0200
-@@ -194,6 +194,23 @@
- 	}
- 	
- 	/**
-+	 * Extended styles derived from the user-specified style array.
-+	 */
-+
-+	public static class StyleExtender
-+	{
-+		public SyntaxStyle[] extendStyles(SyntaxStyle[] styles)
-+		{
-+			return styles;
-+		}
-+	}
-+	volatile private static StyleExtender _styleExtender = new StyleExtender();
-+	public static void setStyleExtender(StyleExtender ext)
-+	{
-+		_styleExtender = ext;
-+	}
-+
-+	/**
- 	 * Loads the syntax styles from the properties, giving them the specified
- 	 * base font family and size.
- 	 * @param family The font family
-@@ -222,8 +239,9 @@
- 				Log.log(Log.ERROR,StandardUtilities.class,e);
- 			}
- 		}
-+		styles[0] = new SyntaxStyle(Color.black, null, new Font(family, 0, size));
- 
--		return styles;
-+		return _styleExtender.extendStyles(styles);
- 	} //}}}
- 	
- 	private SyntaxUtilities(){}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Tools/jEdit/patches/jedit-4.4.1/extended_styles	Sun Mar 04 21:46:22 2012 +0100
@@ -0,0 +1,74 @@
+diff -ru 4.4.1/jEdit/org/gjt/sp/jedit/gui/StyleEditor.java 4.4.1/jEdit-patched/org/gjt/sp/jedit/gui/StyleEditor.java
+--- 4.4.1/jEdit/org/gjt/sp/jedit/gui/StyleEditor.java	2011-06-21 01:28:56.000000000 +0200
++++ 4.4.1/jEdit-patched/org/gjt/sp/jedit/gui/StyleEditor.java	2011-06-22 16:07:32.000000000 +0200
+@@ -78,7 +78,7 @@
+ 			start = next;
+ 			token = token.next;
+ 		}
+-		if (token.id == Token.END || token.id == Token.NULL)
++		if (token.id == Token.END || (token.id % Token.ID_COUNT) == Token.NULL)
+ 		{
+ 			JOptionPane.showMessageDialog(textArea.getView(),
+ 				jEdit.getProperty("syntax-style-no-token.message"),
+diff -ru 4.4.1/jEdit/org/gjt/sp/jedit/syntax/Chunk.java 4.4.1/jEdit-patched/org/gjt/sp/jedit/syntax/Chunk.java
+--- 4.4.1/jEdit/org/gjt/sp/jedit/syntax/Chunk.java	2011-06-21 01:29:10.000000000 +0200
++++ 4.4.1/jEdit-patched/org/gjt/sp/jedit/syntax/Chunk.java	2011-06-22 16:02:07.000000000 +0200
+@@ -380,7 +380,7 @@
+ 	// this is either style.getBackgroundColor() or
+ 	// styles[defaultID].getBackgroundColor()
+ 	private Color background;
+-	private String str;
++	public String str;
+ 	//private GlyphVector gv;
+ 	private List<GlyphVector> glyphs;
+ 	private boolean visible;
+diff -ru 4.4.1/jEdit/org/gjt/sp/jedit/syntax/Token.java 4.4.1/jEdit-patched/org/gjt/sp/jedit/syntax/Token.java
+--- 4.4.1/jEdit/org/gjt/sp/jedit/syntax/Token.java	2011-06-21 01:29:10.000000000 +0200
++++ 4.4.1/jEdit-patched/org/gjt/sp/jedit/syntax/Token.java	2011-06-22 16:08:47.000000000 +0200
+@@ -57,7 +57,7 @@
+ 	 */
+ 	public static String tokenToString(byte token)
+ 	{
+-		return (token == Token.END) ? "END" : TOKEN_TYPES[token];
++		return (token == Token.END) ? "END" : TOKEN_TYPES[token % ID_COUNT];
+ 	} //}}}
+ 
+ 	//{{{ Token types
+diff -ru 4.4.1/jEdit/org/gjt/sp/util/SyntaxUtilities.java 4.4.1/jEdit-patched/org/gjt/sp/util/SyntaxUtilities.java
+--- 4.4.1/jEdit/org/gjt/sp/util/SyntaxUtilities.java	2011-06-21 01:29:11.000000000 +0200
++++ 4.4.1/jEdit-patched/org/gjt/sp/util/SyntaxUtilities.java	2011-06-22 16:05:28.000000000 +0200
+@@ -194,6 +194,23 @@
+ 	}
+ 	
+ 	/**
++	 * Extended styles derived from the user-specified style array.
++	 */
++
++	public static class StyleExtender
++	{
++		public SyntaxStyle[] extendStyles(SyntaxStyle[] styles)
++		{
++			return styles;
++		}
++	}
++	volatile private static StyleExtender _styleExtender = new StyleExtender();
++	public static void setStyleExtender(StyleExtender ext)
++	{
++		_styleExtender = ext;
++	}
++
++	/**
+ 	 * Loads the syntax styles from the properties, giving them the specified
+ 	 * base font family and size.
+ 	 * @param family The font family
+@@ -222,8 +239,9 @@
+ 				Log.log(Log.ERROR,StandardUtilities.class,e);
+ 			}
+ 		}
++		styles[0] = new SyntaxStyle(Color.black, null, new Font(family, 0, size));
+ 
+-		return styles;
++		return _styleExtender.extendStyles(styles);
+ 	} //}}}
+ 	
+ 	private SyntaxUtilities(){}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Tools/jEdit/patches/jedit-4.4.1/render_context	Sun Mar 04 21:46:22 2012 +0100
@@ -0,0 +1,13 @@
+diff -ru 4.4.1/jEdit/org/gjt/sp/jedit/gui/PanelWindowContainer.java 4.4.1/jEdit-patched/org/gjt/sp/jedit/gui/PanelWindowContainer.java
+--- 4.4.1/jEdit/org/gjt/sp/jedit/gui/PanelWindowContainer.java	2011-06-21 01:28:56.000000000 +0200
++++ 4.4.1/jEdit-patched/org/gjt/sp/jedit/gui/PanelWindowContainer.java	2011-06-22 16:18:43.000000000 +0200
+@@ -646,7 +646,7 @@
+ 			this.font = font;
+ 
+ 			FontRenderContext fontRenderContext
+-				= new FontRenderContext(null,true,true);
++				= new FontRenderContext(null,true,false);
+ 			glyphs = font.createGlyphVector(fontRenderContext,text);
+ 			width = (int)glyphs.getLogicalBounds().getWidth() + 4;
+ 			//height = (int)glyphs.getLogicalBounds().getHeight();
+
--- a/src/Tools/jEdit/patches/render_context	Sun Mar 04 19:24:05 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-diff -ru 4.4.1/jEdit/org/gjt/sp/jedit/gui/PanelWindowContainer.java 4.4.1/jEdit-patched/org/gjt/sp/jedit/gui/PanelWindowContainer.java
---- 4.4.1/jEdit/org/gjt/sp/jedit/gui/PanelWindowContainer.java	2011-06-21 01:28:56.000000000 +0200
-+++ 4.4.1/jEdit-patched/org/gjt/sp/jedit/gui/PanelWindowContainer.java	2011-06-22 16:18:43.000000000 +0200
-@@ -646,7 +646,7 @@
- 			this.font = font;
- 
- 			FontRenderContext fontRenderContext
--				= new FontRenderContext(null,true,true);
-+				= new FontRenderContext(null,true,false);
- 			glyphs = font.createGlyphVector(fontRenderContext,text);
- 			width = (int)glyphs.getLogicalBounds().getWidth() + 4;
- 			//height = (int)glyphs.getLogicalBounds().getHeight();
-