[scite] Re: 1.74 crashes under FC7 X86_64

2007-08-23 Thread Jan Boehme
Hi!

Maxime Carron wrote:
> I'm a bit new to SciTE, but I don't suffer from any problem with it on
> F-7.x86_64.
> SciTE crashes with every files or only with SciTEGlobal.properties?

SciTE crashes with some files not only with SciTEGlobal.properties. I
removed my personal properties file and now it works. At least it
doesn't crash anymore.

I get pango warnings

(scite:4552): Pango-WARNING **: Invalid UTF-8 string passed to
pango_layout_set_text()

when I open SciTEGlobal.properties and scroll down to:

# Define values for use in the imported properties files
chars.alpha=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
chars.numeric=0123456789
chars.accented=ŠšŒœŸÿÀàÁáÂâÃãÄäÅåÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖØøÙùÚúÛûÜüÝýÞþßö
# This is a better set for Russian:
#chars.accented=ÀàÁáÂâÃãÄäÅ娸ÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖö×÷ØøÙùÚúÛûÜüÝýÞþßÿ

I have to say that on the system SciTE crashes I see this section in a
different way. Instead of the chars after 'accented=' I only see a lot
of '?'.

If I change the encoding type in the file menu from 8bit to utf8 nothing
happens excepts that a lot of pango warnings occur.

I don't know if this is a system problem. The LANG env variable is set
to 'en_US.UTF-8'. Other editors like gedit do their job and I see the
chars.accented in the right way (I assume), even using the same font as
scite (bitstream vera sans).

Thanks for helping, jan.
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] [PATCH] SciTE 1.74 GTK+: layout based on native GtkPaned widget

2007-08-23 Thread Stanislav Maslovski
Hello,

Here goes the 3rd version of the patch (attached).
  - focus behaviour corrected (finally?)
  - LayoutUI() is now called after the properties have been read
  - set minimum size hint to wContent

Please check.

-- 
Stanislav

On Tue, Aug 21, 2007 at 09:33:33AM +1000, Neil Hodgson wrote:
> Stanislav Maslovski:
> 
> >   - problem with cursors solved.
> 
>Using cursorInvalid in this way is good.
> 
> > >   - focus issues fixed.
> >
> > Oops, not all of them. When the output window is opened to
> > the maximum width the focus goes nowhere...
> 
>Its OK to be a bit heavy-handed, forcing the focus into a visible
> window even if it doesn't seem to be currently associated with an
> editing pane. That's better than any situation where typing goes
> nowhere.
> 
>   Neil
> ___
> Scite-interest mailing list
> Scite-interest@lyra.org
> http://mailman.lyra.org/mailman/listinfo/scite-interest

diff -urN scite-1.74-orig/scintilla/gtk/PlatGTK.cxx scite-1.74/scintilla/gtk/PlatGTK.cxx
--- scite-1.74-orig/scintilla/gtk/PlatGTK.cxx	2007-06-15 15:24:38.0 +0400
+++ scite-1.74/scintilla/gtk/PlatGTK.cxx	2007-08-23 11:53:24.847560293 +0400
@@ -1841,6 +1841,8 @@
 	cursorLast = curs;
 	GdkCursor *gdkCurs;
 	switch (curs) {
+	case cursorInvalid:
+		return;
 	case cursorText:
 		gdkCurs = gdk_cursor_new(GDK_XTERM);
 		break;
diff -urN scite-1.74-orig/scintilla/gtk/ScintillaGTK.cxx scite-1.74/scintilla/gtk/ScintillaGTK.cxx
--- scite-1.74-orig/scintilla/gtk/ScintillaGTK.cxx	2007-06-12 07:55:11.0 +0400
+++ scite-1.74/scintilla/gtk/ScintillaGTK.cxx	2007-08-23 11:53:24.847560721 +0400
@@ -568,6 +568,9 @@
 	gtk_widget_unmap(PWidget(wText));
 	gtk_widget_unmap(PWidget(scrollbarh));
 	gtk_widget_unmap(PWidget(scrollbarv));
+	wText.SetCursor(Window::cursorInvalid);
+	scrollbarv.SetCursor(Window::cursorInvalid);
+	scrollbarh.SetCursor(Window::cursorInvalid);
 }
 
 void ScintillaGTK::UnMap(GtkWidget *widget) {
diff -urN scite-1.74-orig/scite/gtk/SciTEGTK.cxx scite-1.74/scite/gtk/SciTEGTK.cxx
--- scite-1.74-orig/scite/gtk/SciTEGTK.cxx	2007-06-13 18:09:09.0 +0400
+++ scite-1.74/scite/gtk/SciTEGTK.cxx	2007-08-23 14:18:04.023497756 +0400
@@ -307,11 +307,9 @@
 
 protected:
 
-	Window wDivider;
+	GtkWidget *splitPane;
 	Point ptOld;
 	GdkGC *xor_gc;
-	bool focusEditor;
-	bool focusOutput;
 
 	guint sbContextID;
 	Window wToolBarBox;
@@ -497,11 +495,6 @@
 	static gint MousePress(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
 	gint Mouse(GdkEventButton *event);
 
-	void DividerXOR(Point pt);
-	static gint DividerExpose(GtkWidget *widget, GdkEventExpose *ose, SciTEGTK *scitew);
-	static gint DividerMotion(GtkWidget *widget, GdkEventMotion *event, SciTEGTK *scitew);
-	static gint DividerPress(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
-	static gint DividerRelease(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
 	static void DragDataReceived(GtkWidget *widget, GdkDragContext *context,
 	 gint x, gint y, GtkSelectionData *selection_data, guint info, guint time, SciTEGTK *scitew);
 
@@ -538,6 +531,7 @@
 	  int startID = 0, const char *radioStart = 0);
 	void CreateMenu();
 	void CreateUI();
+	void LayoutUI();
 	void Run(int argc, char *argv[]);
 	void ProcessExecute();
 	virtual void Execute();
@@ -595,6 +589,8 @@
 	btnBuild = 0;
 	btnStop = 0;
 	itemFactory = 0;
+	splitPane = 0;
+	heightBar = 0;
 
 	fileSelectorWidth = 580;
 	fileSelectorHeight = 480;
@@ -835,6 +831,13 @@
 		SizeSubWindows();
 		CheckMenus();
 		break;
+	// override base class
+	case IDM_SPLITVERTICAL:
+		splitVertical = !splitVertical;
+		heightBar = 0;
+		LayoutUI();
+		CheckMenus();
+		break;
 
 	default:
 		SciTEBase::MenuCommand(cmdID, menuSource);
@@ -888,30 +891,50 @@
 }
 
 void SciTEGTK::SizeContentWindows() {
-	PRectangle rcClient = GetClientRectangle();
-#if GTK_MAJOR_VERSION < 2
-	int left = 0;
-	int top = 0;
-#else
-	int left = rcClient.left;
-	int top = rcClient.top;
-#endif
-	int w = rcClient.right - rcClient.left;
-	int h = rcClient.bottom - rcClient.top;
-	heightOutput = NormaliseSplit(heightOutput);
-	if (splitVertical) {
-		wEditor.SetPosition(PRectangle(left, top, w - heightOutput - heightBar + left, h + top));
-		wDivider.SetPosition(PRectangle(w - heightOutput - heightBar + left, top, w - heightOutput + left, h + top));
-		wOutput.SetPosition(PRectangle(w - heightOutput + left, top, w + left, h + top));
-	} else {
-		wEditor.SetPosition(PRectangle(left, top, w + left, h - heightOutput - heightBar + top));
-		wDivider.SetPosition(PRectangle(left, h - heightOutput - heightBar + top, w + left, h - heightOutput + top));
-		wOutput.SetPosition(PRectangle(left, h - heightOutput + top, w + left, h + top));
+	if (splitPane) {
+		// we come here when receiving resizing signals
+		int height, heightEditor, bar;
+		if (splitVertical) {
+			height = PWidget(wOutput)->allocation.width;
+			heightEditor =

Re: [scite] Re: 1.74 crashes under FC7 X86_64

2007-08-23 Thread Stanislav Maslovski
Hello,

On Thu, Aug 23, 2007 at 09:37:48AM +0200, Jan Boehme wrote:
> Hi!
> 
> Maxime Carron wrote:
> > I'm a bit new to SciTE, but I don't suffer from any problem with it on
> > F-7.x86_64.
> > SciTE crashes with every files or only with SciTEGlobal.properties?
> 
> SciTE crashes with some files not only with SciTEGlobal.properties. I
> removed my personal properties file and now it works. At least it
> doesn't crash anymore.
> 
> I get pango warnings
> 
> (scite:4552): Pango-WARNING **: Invalid UTF-8 string passed to
> pango_layout_set_text()
> 
> when I open SciTEGlobal.properties and scroll down to:
> 
> # Define values for use in the imported properties files
> chars.alpha=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
> chars.numeric=0123456789
> chars.accented=ŠšŒœŸÿÀàÁáÂâÃãÄäÅåÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖØøÙùÚúÛûÜüÝýÞþßö
> # This is a better set for Russian:
> #chars.accented=ÀàÁáÂâÃãÄäÅ娸ÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖö×÷ØøÙùÚúÛûÜüÝýÞþßÿ
> 
> I have to say that on the system SciTE crashes I see this section in a
> different way. Instead of the chars after 'accented=' I only see a lot
> of '?'.
> 
> If I change the encoding type in the file menu from 8bit to utf8 nothing
> happens excepts that a lot of pango warnings occur.

Try this:

1. convert properties files to utf-8 using iconv (or you can do it only
with your user properties file).

2. put these codepage settings in the Internationalisation section of the 
properties:

code.page=65001
output.code.page=65001

Comment out all other settings in this section.

-- 
Stanislav

___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Re: 1.74 crashes under FC7 X86_64

2007-08-23 Thread Neil Hodgson
Jan Boehme:

> (scite:4552): Pango-WARNING **: Invalid UTF-8 string passed to
> pango_layout_set_text()
>
> when I open SciTEGlobal.properties and scroll down to:
> ...
> chars.accented=ŠšŒœŸÿÀàÁáÂâÃãÄäÅåÆæÇçÈèÉéÊêËëÌìÍíÎîÏïÐðÑñÒòÓóÔôÕõÖØøÙùÚúÛûÜüÝýÞþßö

   This is a set of byte values and should not be interpreted as UTF-8.

   Scintilla should probably do something more sensible with invalid
UTF-8 rather than relying on Pango to fail nicely. However its
difficult to do anything sensible with invalid UTF-8 - I don't want to
prohibit the display of files that contain invalid UTF-8 since you may
be recovering a corrupted file.

Stanislav Maslovski:

# Try this:
#
# 1. convert properties files to utf-8 using iconv (or you can do it only
# with your user properties file).

   Don't do this to SciTEGlobal.properties as it will make
chars.accented useless.

   Neil

___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Re: 1.74 crashes under FC7 X86_64

2007-08-23 Thread Stanislav Maslovski
On Thu, Aug 23, 2007 at 10:43:23PM +1000, Neil Hodgson wrote:
> # Try this:
> #
> # 1. convert properties files to utf-8 using iconv (or you can do it only
> # with your user properties file).
> 
>Don't do this to SciTEGlobal.properties as it will make
> chars.accented useless.

Oops, I did not know. If they are byte values, then what encoding is
assumed for them? Btw, I also use a UTF-8 locale.

-- 
Stanislav
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Re: 1.74 crashes under FC7 X86_64

2007-08-23 Thread Neil Hodgson
Stanislav Maslovski:

> Oops, I did not know. If they are byte values, then what encoding is
> assumed for them?

   None really. Its a set of bytes that have values between 128 and
255 and are often printable characters in various encodings. The first
line is OK for ISO-8859-1 or -15 or Windows European and isn't too bad
for other ISO-8859-*. The "Russian" line is for either CP1251 or
KOI8-R - I can't recall which. For users of 8-bit encodings they
should be modified to fit in with what they feel are "word" characters
in their preferred encoding.

   Neil
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


[scite] addition: remove a couple of unused vars

2007-08-23 Thread Stanislav Maslovski
I forgot to remove a couple of old variables that are not used anymore.
Correction attached.

-- 
Stanislav
diff -urN scite-1.74-orig/scite/gtk/SciTEGTK.cxx scite-1.74/scite/gtk/SciTEGTK.cxx
--- scite-1.74-orig/scite/gtk/SciTEGTK.cxx	2007-08-23 23:24:19.759831904 +0400
+++ scite-1.74/scite/gtk/SciTEGTK.cxx	2007-08-23 23:20:18.0 +0400
@@ -308,8 +308,6 @@
 protected:
 
 	GtkWidget *splitPane;
-	Point ptOld;
-	GdkGC *xor_gc;
 
 	guint sbContextID;
 	Window wToolBarBox;
@@ -566,8 +564,6 @@
 	ReadGlobalPropFile();
 	ReadAbbrevPropFile();
 
-	ptOld = Point(0, 0);
-	xor_gc = 0;
 	saveFormat = sfSource;
 	comboFiles = 0;
 	paramDialogCanceled = true;
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest