[anjuta-extras/gtk3] scintilla: Fix scintilla update procedure



commit 75d8b2838a27ead17a0c1e6555452213dfe17903
Author: Sébastien Granjoux <seb sfo free fr>
Date:   Sun May 22 22:07:37 2011 +0200

    scintilla: Fix scintilla update procedure

 plugins/scintilla/scintilla/Makefile.am            |    2 +-
 plugins/scintilla/scintilla/PlatGTK.cxx            |    1 +
 plugins/scintilla/scintilla/include/Scintilla.h    |    6 ++
 .../scintilla/scintilla/include/ScintillaWidget.h  |    2 +-
 .../scintilla/patches/scintilla-64-bit.diff        |    8 +-
 .../scintilla/patches/scintilla-pango-always.diff  |   33 +++-----
 .../patches/scintilla-remove-deprecated.diff       |   86 +------------------
 7 files changed, 30 insertions(+), 108 deletions(-)
---
diff --git a/plugins/scintilla/scintilla/Makefile.am b/plugins/scintilla/scintilla/Makefile.am
index dec5b51..ea3c067 100644
--- a/plugins/scintilla/scintilla/Makefile.am
+++ b/plugins/scintilla/scintilla/Makefile.am
@@ -125,7 +125,7 @@ update-scintilla:
 	echo "Patching files ..."
 	cd $(srcdir); \
 	for patchfile in patches/*.diff; do \
-		patch -p1 < $$patchfile; \
+		patch -p0 < $$patchfile; \
 	done
 	echo "Updating properties file..."
 	cd $(srcdir); \
diff --git a/plugins/scintilla/scintilla/PlatGTK.cxx b/plugins/scintilla/scintilla/PlatGTK.cxx
index ee74c65..f589d5e 100644
--- a/plugins/scintilla/scintilla/PlatGTK.cxx
+++ b/plugins/scintilla/scintilla/PlatGTK.cxx
@@ -694,6 +694,7 @@ FontID FontCached::CreateNewFont(const char *fontName, int characterSet,
 	}
 	return new FontHandle(newid);
 #else
+	// Try to use pango font even if it's not specified
 	PangoFontDescription *pfd = pango_font_description_new();
 	if (pfd) {
 		pango_font_description_set_family(pfd, fontName+1);
diff --git a/plugins/scintilla/scintilla/include/Scintilla.h b/plugins/scintilla/scintilla/include/Scintilla.h
index f1c4fa9..0700736 100644
--- a/plugins/scintilla/scintilla/include/Scintilla.h
+++ b/plugins/scintilla/scintilla/include/Scintilla.h
@@ -32,6 +32,11 @@ int Scintilla_LinkLexers();
 #if defined(_WIN32)
 #include <basetsd.h>
 #endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+typedef uintptr_t uptr_t;
+typedef intptr_t sptr_t;
+#else
 #ifdef MAXULONG_PTR
 typedef ULONG_PTR uptr_t;
 typedef LONG_PTR sptr_t;
@@ -39,6 +44,7 @@ typedef LONG_PTR sptr_t;
 typedef unsigned long uptr_t;
 typedef long sptr_t;
 #endif
+#endif
 
 typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam);
 
diff --git a/plugins/scintilla/scintilla/include/ScintillaWidget.h b/plugins/scintilla/scintilla/include/ScintillaWidget.h
index d1df6cf..f8cd212 100644
--- a/plugins/scintilla/scintilla/include/ScintillaWidget.h
+++ b/plugins/scintilla/scintilla/include/ScintillaWidget.h
@@ -16,7 +16,7 @@ extern "C" {
 #endif
 
 #define SCINTILLA(obj)          G_TYPE_CHECK_INSTANCE_CAST (obj, scintilla_get_type (), ScintillaObject)
-#define SCINTILLA_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
+#define SCINTILLA_CLASS(klass)  G_TYPE_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
 #define IS_SCINTILLA(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, scintilla_get_type ())
 
 typedef struct _ScintillaObject ScintillaObject;
diff --git a/plugins/scintilla/scintilla/patches/scintilla-64-bit.diff b/plugins/scintilla/scintilla/patches/scintilla-64-bit.diff
index 33ff77b..76debdc 100644
--- a/plugins/scintilla/scintilla/patches/scintilla-64-bit.diff
+++ b/plugins/scintilla/scintilla/patches/scintilla-64-bit.diff
@@ -1,6 +1,6 @@
---- scintilla/scintilla/include/Scintilla.h	2009-11-02 05:51:51.000000000 +0100
-+++ scintilla/include/Scintilla.h	2010-01-31 19:42:12.000000000 +0100
-@@ -36,6 +36,11 @@
+--- scintilla/include/Scintilla.h	2011-05-21 22:36:30.346130001 +0200
++++ include/Scintilla.h	2011-05-22 19:33:32.031959002 +0200
+@@ -32,6 +32,11 @@
  #if defined(_WIN32)
  #include <basetsd.h>
  #endif
@@ -12,7 +12,7 @@
  #ifdef MAXULONG_PTR
  typedef ULONG_PTR uptr_t;
  typedef LONG_PTR sptr_t;
-@@ -43,6 +48,7 @@
+@@ -39,6 +44,7 @@
  typedef unsigned long uptr_t;
  typedef long sptr_t;
  #endif
diff --git a/plugins/scintilla/scintilla/patches/scintilla-pango-always.diff b/plugins/scintilla/scintilla/patches/scintilla-pango-always.diff
index 93cf192..6079ba7 100644
--- a/plugins/scintilla/scintilla/patches/scintilla-pango-always.diff
+++ b/plugins/scintilla/scintilla/patches/scintilla-pango-always.diff
@@ -1,28 +1,19 @@
---- scintilla/scintilla/gtk/PlatGTK.cxx	2010-01-23 22:56:07.000000000 +0100
-+++ scintilla/PlatGTK.cxx	2010-01-31 19:42:12.000000000 +0100
-@@ -513,16 +513,16 @@
- 	charset[0] = '\0';
- 
- #ifdef USE_PANGO
--	if (fontName[0] == '!') {
--		PangoFontDescription *pfd = pango_font_description_new();
--		if (pfd) {
--			pango_font_description_set_family(pfd, fontName+1);
--			pango_font_description_set_size(pfd, size * PANGO_SCALE);
--			pango_font_description_set_weight(pfd, bold ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL);
--			pango_font_description_set_style(pfd, italic ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL);
--			return new FontHandle(pfd, characterSet);
--		}
-+	//if (fontName[0] == '!') {
+--- scintilla/gtk/PlatGTK.cxx	2011-05-21 22:36:30.332130001 +0200
++++ PlatGTK.cxx	2011-05-22 19:40:17.540959001 +0200
+@@ -694,6 +694,16 @@
+ 	}
+ 	return new FontHandle(newid);
+ #else
++	// Try to use pango font even if it's not specified
 +	PangoFontDescription *pfd = pango_font_description_new();
 +	if (pfd) {
-+		pango_font_description_set_family(pfd, fontName);
++		pango_font_description_set_family(pfd, fontName+1);
 +		pango_font_description_set_size(pfd, size * PANGO_SCALE);
 +		pango_font_description_set_weight(pfd, bold ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL);
 +		pango_font_description_set_style(pfd, italic ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL);
 +		return new FontHandle(pfd, characterSet);
- 	}
-+	//}
++	}
++
+ 	return new FontHandle();
  #endif
- 
- 	GdkFont *newid = 0;
+ }
diff --git a/plugins/scintilla/scintilla/patches/scintilla-remove-deprecated.diff b/plugins/scintilla/scintilla/patches/scintilla-remove-deprecated.diff
index 8b9c276..7a76719 100644
--- a/plugins/scintilla/scintilla/patches/scintilla-remove-deprecated.diff
+++ b/plugins/scintilla/scintilla/patches/scintilla-remove-deprecated.diff
@@ -1,90 +1,14 @@
---- scintilla/scintilla/include/ScintillaWidget.h	2009-01-08 10:14:54.000000000 +0100
-+++ scintilla/include/ScintillaWidget.h	2010-01-31 19:42:12.000000000 +0100
-@@ -15,9 +15,9 @@
- extern "C" {
+diff -u3 scintilla/include/ScintillaWidget.h include/ScintillaWidget.h
+--- scintilla/include/ScintillaWidget.h	2011-05-21 22:36:30.352130001 +0200
++++ include/ScintillaWidget.h	2011-05-22 19:45:53.725959000 +0200
+@@ -16,8 +16,8 @@
  #endif
  
--#define SCINTILLA(obj)          GTK_CHECK_CAST (obj, scintilla_get_type (), ScintillaObject)
+ #define SCINTILLA(obj)          G_TYPE_CHECK_INSTANCE_CAST (obj, scintilla_get_type (), ScintillaObject)
 -#define SCINTILLA_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
 -#define IS_SCINTILLA(obj)       GTK_CHECK_TYPE (obj, scintilla_get_type ())
-+#define SCINTILLA(obj)          G_TYPE_CHECK_INSTANCE_CAST (obj, scintilla_get_type (), ScintillaObject)
 +#define SCINTILLA_CLASS(klass)  G_TYPE_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
 +#define IS_SCINTILLA(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, scintilla_get_type ())
  
  typedef struct _ScintillaObject ScintillaObject;
  typedef struct _ScintillaClass  ScintillaClass;
---- scintilla/scintilla/gtk/PlatGTK.cxx	2010-01-23 22:56:07.000000000 +0100
-+++ scintilla/PlatGTK.cxx	2010-01-31 19:42:12.000000000 +0100
-@@ -1803,7 +1803,7 @@
- #else
- 
- 	gtk_widget_set_uposition(wid, rc.left, rc.top);
--	gtk_widget_set_usize(wid, rc.right - rc.left, rc.bottom - rc.top);
-+	gtk_widget_set_size_request(wid, rc.right - rc.left, rc.bottom - rc.top);
- #endif
- }
- 
-@@ -1845,7 +1845,7 @@
- 	alloc.height = rc.bottom - rc.top;
- 	gtk_widget_size_allocate(wid, &alloc);
- #endif
--	gtk_widget_set_usize(PWidget(wid), sizex, sizey);
-+	gtk_widget_set_size_request(PWidget(wid), sizex, sizey);
- }
- 
- PRectangle Window::GetClientPosition() {
-@@ -1965,7 +1965,7 @@
- 		gdk_bitmap_unref(list_image->bitmap);
- #else
- 	if (list_image->pixbuf)
--		gdk_pixbuf_unref (list_image->pixbuf);
-+		g_object_unref (list_image->pixbuf);
- #endif
- 	g_free(list_image);
- }
-@@ -2237,14 +2237,14 @@
- 		          + 2 * (ythickness
- 		                 + GTK_CONTAINER(PWidget(list))->border_width + 1));
- #endif
--		gtk_widget_set_usize(GTK_WIDGET(PWidget(list)), -1, height);
-+		gtk_widget_set_size_request(GTK_WIDGET(PWidget(list)), -1, height);
- 
- 		// Get the size of the scroller because we set usize on the window
- 		gtk_widget_size_request(GTK_WIDGET(scroller), &req);
- 		rc.right = req.width;
- 		rc.bottom = req.height;
- 
--		gtk_widget_set_usize(GTK_WIDGET(list), -1, -1);
-+		gtk_widget_set_size_request(GTK_WIDGET(list), -1, -1);
- 		int width = maxItemCharacters;
- 		if (width < 12)
- 			width = 12;
-@@ -2312,7 +2312,7 @@
- 	}
- #else
- 	if (list_image->pixbuf)
--		gdk_pixbuf_unref(list_image->pixbuf);
-+		g_object_unref(list_image->pixbuf);
- 	list_image->pixbuf =
- 		gdk_pixbuf_new_from_xpm_data((const gchar**)xpm_lineform);
- #endif
-@@ -2547,7 +2547,7 @@
- 		list_image->bitmap = 0;
- #else
- 		if (list_image->pixbuf)
--			gdk_pixbuf_unref(list_image->pixbuf);
-+			g_object_unref(list_image->pixbuf);
- 		list_image->pixbuf = NULL;
- #endif
- 		list_image->xpm_data = xpm_data;
---- scintilla/scintilla/gtk/ScintillaGTK.cxx	2009-08-28 04:08:48.000000000 +0200
-+++ scintilla/ScintillaGTK.cxx	2010-01-31 19:42:12.000000000 +0100
-@@ -1061,7 +1061,7 @@
- 	if (timer.ticking != on) {
- 		timer.ticking = on;
- 		if (timer.ticking) {
--			timer.tickerID = reinterpret_cast<TickerID>(gtk_timeout_add(timer.tickSize, (GtkFunction)TimeOut, this));
-+			timer.tickerID = reinterpret_cast<TickerID>(g_timeout_add(timer.tickSize, (GSourceFunc)TimeOut, this));
- 		} else {
- 			gtk_timeout_remove(GPOINTER_TO_UINT(timer.tickerID));
- 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]