2004-06-07 Jeroen Zwartepoorte <jeroen@xs4all.nl>
* 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
This commit is contained in:
parent
9698c4d2f9
commit
fe4a530155
11 changed files with 163 additions and 5 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2004-06-07 Jeroen Zwartepoorte <jeroen@xs4all.nl>
|
||||
|
||||
* 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 <tberman@sevenl.net>
|
||||
|
||||
* gtk/Widget.custom: expose some easy bool properties for checking
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
40
pango/LayoutLine.custom
Normal file
40
pango/LayoutLine.custom
Normal file
|
@ -0,0 +1,40 @@
|
|||
// Pango.LayoutLine.custom - Pango LayoutLine class customizations
|
||||
//
|
||||
// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl
|
||||
//
|
||||
// Copyright (c) 2004 Novell, Inc.
|
||||
//
|
||||
// This code is inserted after the automatically generated code.
|
||||
|
||||
[DllImport("pangosharpglue")]
|
||||
static extern IntPtr pangosharp_pango_layout_line_get_layout (IntPtr line);
|
||||
|
||||
public Layout Layout {
|
||||
get {
|
||||
IntPtr raw_ret = pangosharp_pango_layout_line_get_layout (Handle);
|
||||
Pango.Layout ret;
|
||||
if (raw_ret == IntPtr.Zero)
|
||||
ret = null;
|
||||
else
|
||||
ret = (Pango.Layout) GLib.Object.GetObject (raw_ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("pangosharpglue")]
|
||||
static extern int pangosharp_pango_layout_line_get_start_index (IntPtr line);
|
||||
|
||||
public int StartIndex {
|
||||
get {
|
||||
return pangosharp_pango_layout_line_get_start_index (Handle);
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("pangosharpglue")]
|
||||
static extern int pangosharp_pango_layout_line_get_length (IntPtr line);
|
||||
|
||||
public int Length {
|
||||
get {
|
||||
return pangosharp_pango_layout_line_get_length (Handle);
|
||||
}
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
SUBDIRS = . glue
|
||||
|
||||
API = pango-api.xml
|
||||
RAW_API = pango-api.raw
|
||||
METADATA = Pango.metadata
|
||||
|
@ -21,7 +23,8 @@ dist_sources = $(sources)
|
|||
customs = \
|
||||
AttrIterator.custom \
|
||||
GlyphItem.custom \
|
||||
Layout.custom
|
||||
Layout.custom \
|
||||
LayoutLine.custom
|
||||
|
||||
build_customs = $(addprefix $(srcdir)/, $(customs))
|
||||
dist_customs = $(customs)
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
<attr path="/api/namespace/struct[@cname='PangoAttrIterator']/method[@name='GetAttrs']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/struct[@cname='PangoAttrIterator']/method[@name='GetFont']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/struct[@cname='PangoGlyphItem']/method[@name='ApplyAttrs']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/struct[@cname='PangoLayoutLine']" name="opaque">1</attr>
|
||||
<attr path="/api/namespace/struct[@cname='PangoLayoutLine']/method[@name='GetExtents']/*/*[@type='PangoRectangle*']" name="pass_as">ref</attr>
|
||||
<attr path="/api/namespace/struct[@cname='PangoLayoutLine']/method[@name='GetExtents']/*/*[@type='PangoRectangle*']" name="null_ok">1</attr>
|
||||
<attr path="/api/namespace/struct[@cname='PangoLayoutLine']/method[@name='GetPixelExtents']/*/*[@type='PangoRectangle*']" name="pass_as">ref</attr>
|
||||
|
|
7
pango/glue/.cvsignore
Normal file
7
pango/glue/.cvsignore
Normal file
|
@ -0,0 +1,7 @@
|
|||
Makefile
|
||||
Makefile.in
|
||||
*.lo
|
||||
*.o
|
||||
*.la
|
||||
.deps
|
||||
.libs
|
20
pango/glue/Makefile.am
Normal file
20
pango/glue/Makefile.am
Normal file
|
@ -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
|
32
pango/glue/layoutline.c
Normal file
32
pango/glue/layoutline.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
/* layoutline.c : Glue to access fields in PangoLayoutLine struct.
|
||||
*
|
||||
* Author: Jeroen Zwartepoorte <jeroen@xs4all.nl
|
||||
*
|
||||
* <c> 2004 Jeroen Zwartepoorte
|
||||
*/
|
||||
|
||||
#include <pango/pango-layout.h>
|
||||
|
||||
/* 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;
|
||||
}
|
22
pango/glue/makefile.win32
Normal file
22
pango/glue/makefile.win32
Normal file
|
@ -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
|
16
pango/glue/win32dll.c
Normal file
16
pango/glue/win32dll.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <stdio.h>
|
||||
|
||||
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
BOOL APIENTRY DllMainCRTStartup (HINSTANCE hInst, DWORD reason, LPVOID reserved)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
Loading…
Reference in a new issue