From fe4a530155452c7bb0352fd5aabc33038b49411c Mon Sep 17 00:00:00 2001 From: Jeroen Zwartepoorte Date: Mon, 7 Jun 2004 18:59:16 +0000 Subject: [PATCH] 2004-06-07 Jeroen Zwartepoorte * configure.in: Add pango pkg-config check. * pango/Layout.custom: Updated custom code to new opaque LayoutLine. * pango/LayoutLine.custom: Properties for LayoutLine struct fields. * pango/Makefile.am: * pango/Pango.metadata: Make LayoutLine opaque [Fixes #59666]. * pango/glue/.cvsignore: * pango/glue/Makefile.am: * pango/glue/layoutline.c: glue for the LayoutLine struct fields. * pango/glue/makefile.win32: * pango/glue/win32dll.c: svn path=/trunk/gtk-sharp/; revision=28982 --- ChangeLog | 13 +++++++++++++ configure.in | 5 +++++ pango/Layout.custom | 7 +++---- pango/LayoutLine.custom | 40 +++++++++++++++++++++++++++++++++++++++ pango/Makefile.am | 5 ++++- pango/Pango.metadata | 1 + pango/glue/.cvsignore | 7 +++++++ pango/glue/Makefile.am | 20 ++++++++++++++++++++ pango/glue/layoutline.c | 32 +++++++++++++++++++++++++++++++ pango/glue/makefile.win32 | 22 +++++++++++++++++++++ pango/glue/win32dll.c | 16 ++++++++++++++++ 11 files changed, 163 insertions(+), 5 deletions(-) create mode 100644 pango/LayoutLine.custom create mode 100644 pango/glue/.cvsignore create mode 100644 pango/glue/Makefile.am create mode 100644 pango/glue/layoutline.c create mode 100644 pango/glue/makefile.win32 create mode 100644 pango/glue/win32dll.c diff --git a/ChangeLog b/ChangeLog index f6cdee693..a2b9d9179 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2004-06-07 Jeroen Zwartepoorte + + * configure.in: Add pango pkg-config check. + * pango/Layout.custom: Updated custom code to new opaque LayoutLine. + * pango/LayoutLine.custom: Properties for LayoutLine struct fields. + * pango/Makefile.am: + * pango/Pango.metadata: Make LayoutLine opaque [Fixes #59666]. + * pango/glue/.cvsignore: + * pango/glue/Makefile.am: + * pango/glue/layoutline.c: glue for the LayoutLine struct fields. + * pango/glue/makefile.win32: + * pango/glue/win32dll.c: + 2004-06-07 Todd Berman * gtk/Widget.custom: expose some easy bool properties for checking diff --git a/configure.in b/configure.in index 5c0a06ade..045e32f4c 100644 --- a/configure.in +++ b/configure.in @@ -119,6 +119,10 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) +PKG_CHECK_MODULES(PANGO, pango) +AC_SUBST(PANGO_CFLAGS) +AC_SUBST(PANGO_LIBS) + PKG_CHECK_MODULES(GTK, gtk+-2.0) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) @@ -201,6 +205,7 @@ glib/glue/Makefile pango/Makefile pango/AssemblyInfo.cs pango/pango-sharp.dll.config +pango/glue/Makefile atk/Makefile atk/AssemblyInfo.cs atk/atk-sharp.dll.config diff --git a/pango/Layout.custom b/pango/Layout.custom index ba57c367e..3c64bbf0f 100644 --- a/pango/Layout.custom +++ b/pango/Layout.custom @@ -15,11 +15,10 @@ public LayoutLine[] Lines { IntPtr list_ptr = pango_layout_get_lines(Handle); if (list_ptr == IntPtr.Zero) return new LayoutLine [0]; - GLib.SList list = new GLib.SList(list_ptr, typeof (Pango.LayoutLine)); + GLib.SList list = new GLib.SList(list_ptr, typeof (IntPtr)); LayoutLine[] result = new LayoutLine [list.Count]; - int i = 0; - foreach (LayoutLine line in list) - result [i++] = line; + for (int i = 0; i < list.Count; i++) + result[i] = new LayoutLine ((IntPtr)list[i]); return result; } } diff --git a/pango/LayoutLine.custom b/pango/LayoutLine.custom new file mode 100644 index 000000000..8367b4ce0 --- /dev/null +++ b/pango/LayoutLine.custom @@ -0,0 +1,40 @@ +// Pango.LayoutLine.custom - Pango LayoutLine class customizations +// +// Authors: Jeroen Zwartepoorte 1 1 1 + 1 ref 1 ref diff --git a/pango/glue/.cvsignore b/pango/glue/.cvsignore new file mode 100644 index 000000000..2b155c3bd --- /dev/null +++ b/pango/glue/.cvsignore @@ -0,0 +1,7 @@ +Makefile +Makefile.in +*.lo +*.o +*.la +.deps +.libs diff --git a/pango/glue/Makefile.am b/pango/glue/Makefile.am new file mode 100644 index 000000000..9aca97feb --- /dev/null +++ b/pango/glue/Makefile.am @@ -0,0 +1,20 @@ +lib_LTLIBRARIES = libpangosharpglue.la + +libpangosharpglue_la_SOURCES = \ + layoutline.c + +# Adding a new glue file? +# Please remember to update makefile.win32 + +libpangosharpglue_la_LDFLAGS = -module -avoid-version + +libpangosharpglue_la_LIBADD = $(PANGO_LIBS) + +INCLUDES = $(PANGO_CFLAGS) -I$(top_srcdir) + +libpangosharpglue.dll: $(libpangosharpglue_la_OBJECTS) libpangosharpglue.rc libpangosharpglue.def + ./build-dll libpangosharpglue $(VERSION) + +CLEANFILES = lib*.a lib*.dll + +EXTRA_DIST = makefile.win32 win32dll.c diff --git a/pango/glue/layoutline.c b/pango/glue/layoutline.c new file mode 100644 index 000000000..a80287be2 --- /dev/null +++ b/pango/glue/layoutline.c @@ -0,0 +1,32 @@ +/* layoutline.c : Glue to access fields in PangoLayoutLine struct. + * + * Author: Jeroen Zwartepoorte 2004 Jeroen Zwartepoorte + */ + +#include + +/* Forward declarations */ +PangoLayout *pangosharp_pango_layout_line_get_layout (PangoLayoutLine *line); +gint pangosharp_pango_layout_line_get_start_index (PangoLayoutLine *line); +gint pangosharp_pango_layout_line_get_length (PangoLayoutLine *line); +/* */ + +PangoLayout * +pangosharp_pango_layout_line_get_layout (PangoLayoutLine *line) +{ + return line->layout; +} + +gint +pangosharp_pango_layout_line_get_start_index (PangoLayoutLine *line) +{ + return line->start_index; +} + +gint +pangosharp_pango_layout_line_get_length (PangoLayoutLine *line) +{ + return line->length; +} diff --git a/pango/glue/makefile.win32 b/pango/glue/makefile.win32 new file mode 100644 index 000000000..6455d6dc8 --- /dev/null +++ b/pango/glue/makefile.win32 @@ -0,0 +1,22 @@ +PANGO_CFLAGS=`pkg-config --cflags gtk+-win32-2.0 libglade-2.0` +PANGO_LIBS=`pkg-config --libs gtk+-win32-2.0 libglade-2.0` +CC=gcc -mno-cygwin -mms-bitfields +DLLWRAP=dllwrap -mno-cygwin -mms-bitfields --target i386-mingw32 --export-all-symbols + +GLUE_OBJS = \ + layoutline.o \ + win32dll.o + +all: pangosharpglue.dll + + +%.o: %.c + $(CC) -c $(CFLAGS) $(PANGO_CFLAGS) -o $@ $^ + + +gtksharpglue.dll: $(GLUE_OBJS) + $(DLLWRAP) --output-lib=libpangosharpglue.a --dllname=pangosharpglue.dll --driver-name=gcc --output-def=pangosharpglue.def $(GLUE_OBJS) $(PANGO_LIBS) + + +clean: + rm -f pangosharpglue.dll *.o libpangosharpglue.a diff --git a/pango/glue/win32dll.c b/pango/glue/win32dll.c new file mode 100644 index 000000000..a57c07683 --- /dev/null +++ b/pango/glue/win32dll.c @@ -0,0 +1,16 @@ +#define WIN32_LEAN_AND_MEAN +#include +#undef WIN32_LEAN_AND_MEAN +#include + +BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +{ + return TRUE; +} + +/* +BOOL APIENTRY DllMainCRTStartup (HINSTANCE hInst, DWORD reason, LPVOID reserved) +{ + return TRUE; +} +*/