2005-11-03 Joe Shaw <joeshaw@novell.com>

* gsf/DocProp.custom: Change the value parameter to be ref rather
        than out, since the glib is expecting it to be zeroed out.  Patch
        from Daniel Drake.

svn path=/trunk/gsf-sharp/; revision=52511
This commit is contained in:
Joe Shaw 2005-11-03 15:34:41 +00:00
Родитель f4260f783d
Коммит fa2f6a1473
5 изменённых файлов: 144 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,9 @@
2005-11-03 Joe Shaw <joeshaw@novell.com>
* gsf/DocProp.custom: Change the value parameter to be ref rather
than out, since the glib is expecting it to be zeroed out. Patch
from Daniel Drake.
2005-10-28 Joe Shaw <joeshaw@novell.com>
* configure.in: Version 0.5

14
glue/Makefile.am Normal file
Просмотреть файл

@ -0,0 +1,14 @@
AM_CFLAGS = -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations
INCLUDES = $(GSF_CFLAGS)
lib_LTLIBRARIES = libgsfglue.la
GSF_GLUE_SOURCES = \
gsf-doc-prop-glue.c \
gsf-doc-prop-glue.h
libgsfglue_la_SOURCES = $(GSF_GLUE_SOURCES)
libgsfglue_la_LDFLAGS = -module -avoid-version -no-undefined
libgsfglue_la_LIBADD = $(GSF_LIBS)

66
glue/gsf-doc-prop-glue.c Normal file
Просмотреть файл

@ -0,0 +1,66 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* gsf-msole-utils.c:
*
* Authors: Veerapuram Varadhan <vvaradhan@novell.com>
*
* Copyright (C) 2005 Novell Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2.1 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*/
#include <gsf/gsf-doc-meta-data.h>
#include "gsf-doc-prop-glue.h"
void
gsf_doc_prop_glue_get_val (GsfDocProp const *prop, GType *type, GValue *value)
{
GValue const *prop_val;
if (prop == NULL)
return;
prop_val = gsf_doc_prop_get_val (prop);
if (prop_val != NULL && G_IS_VALUE (prop_val)) {
*type = G_VALUE_TYPE (prop_val);
g_value_init (value, *type);
g_value_copy (prop_val, value);
/*
printf ("Type == %d, G_TYPE_STRING=%d, G_VALUE_TYPE (prop_val)=%d\n",
*type, G_TYPE_STRING, G_VALUE_TYPE (prop_val));
*/
}
}
void
gsf_doc_prop_glue_set_val (GsfDocProp *prop, GValue *value)
{
GValue prop_val;
if (prop == NULL)
return;
if (value == NULL || !G_IS_VALUE (value))
return;
g_value_init (&prop_val, G_VALUE_TYPE (value));
g_value_copy (value, &prop_val);
gsf_doc_prop_set_val (prop, &prop_val);
}

33
glue/gsf-doc-prop-glue.h Normal file
Просмотреть файл

@ -0,0 +1,33 @@
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* gsf-msole-utils.c:
*
* Authors: Veerapuram Varadhan <vvaradhan@novell.com>
*
* Copyright (C) 2005 Novell Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2.1 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*/
#ifndef GSF_DOC_PROP_GLUE_H_
#define GSF_DOC_PROP_GLUE_H_
#include <gsf/gsf-doc-meta-data.h>
void gsf_doc_prop_glue_get_val (GsfDocProp const *prop, GType *type, GValue *value);
void gsf_doc_prop_glue_set_val (GsfDocProp *prop, GValue *value);
#endif

25
gsf/DocProp.custom Normal file
Просмотреть файл

@ -0,0 +1,25 @@
[DllImport("libgsfglue")]
static extern void gsf_doc_prop_glue_get_val(IntPtr raw, out GLib.GType type, ref GLib.Value gvalue);
[DllImport("libgsfglue")]
static extern void gsf_doc_prop_glue_set_val(IntPtr raw, ref GLib.Value val);
public object Val {
get {
GLib.GType type;
GLib.Value gvalue = GLib.Value.Empty;
gsf_doc_prop_glue_get_val(Handle, out type, ref gvalue);
if (type != GLib.GType.None)
return gvalue.Val;
else
return null;
}
set {
GLib.Value gvalue = new GLib.Value (value);
gsf_doc_prop_glue_set_val(Handle, ref gvalue);
}
}