Handle gsf_input_seek and gsf_output_seek by hand.
svn path=/trunk/gsf-sharp/; revision=34954
This commit is contained in:
Родитель
bbf882e7a7
Коммит
5bd01bfa1b
|
@ -4,10 +4,12 @@
|
|||
<attr path="/api/namespace/object[@cname='GsfInput']/method[@name='Remaining']" name="name">GetRemaining</attr>
|
||||
<attr path="/api/namespace/object[@cname='GsfInput']/method[@name='Eof']" name="name">GetEof</attr>
|
||||
<attr path="/api/namespace/object[@cname='GsfInput']/method[@name='Name']" name="name">GetName</attr>
|
||||
<attr path="/api/namespace/object[@cname='GsfInput']/method[@name='Read']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GsfInput']/method[@name='Seek']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GsfOutput']/method[@name='Size']" name="name">GetSize</attr>
|
||||
<attr path="/api/namespace/object[@cname='GsfOutput']/method[@name='IsClosed']" name="name">GetIsClosed</attr>
|
||||
<attr path="/api/namespace/object[@cname='GsfOutput']/method[@name='Name']" name="name">GetName</attr>
|
||||
<attr path="/api/namespace/object[@cname='GsfOutput']/method[@name='Read']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GsfOutput']/method[@name='Seek']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GsfDocMetaData']" name="hidden">1</attr>
|
||||
<attr path="/api/namespace/object[@cname='GsfOutfileMSOle']/method[@name='SetClassId']/*/*[@name='clsid']" name="array">1</attr>
|
||||
</metadata>
|
||||
|
|
|
@ -11,3 +11,26 @@
|
|||
System.Runtime.InteropServices.Marshal.Copy (raw_ret, ret, 0, num_bytes);
|
||||
return ret;
|
||||
}
|
||||
|
||||
[DllImport("libgsf-1-1.dll")]
|
||||
static extern bool gsf_input_seek(IntPtr raw, long offset, int whence);
|
||||
|
||||
public bool Seek(long offset, System.IO.SeekOrigin origin) {
|
||||
int whence;
|
||||
switch (origin) {
|
||||
case System.IO.SeekOrigin.Begin:
|
||||
whence = 1;
|
||||
break;
|
||||
case System.IO.SeekOrigin.Current:
|
||||
whence = 0;
|
||||
break;
|
||||
case System.IO.SeekOrigin.End:
|
||||
whence = 2;
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
bool raw_ret = gsf_input_seek(Handle, offset, whence);
|
||||
bool ret = raw_ret;
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
[DllImport("libgsf-1-1.dll")]
|
||||
static extern bool gsf_output_seek(IntPtr raw, long offset, int whence);
|
||||
|
||||
public bool Seek(long offset, System.IO.SeekOrigin origin) {
|
||||
int whence;
|
||||
switch (origin) {
|
||||
case System.IO.SeekOrigin.Begin:
|
||||
whence = 1;
|
||||
break;
|
||||
case System.IO.SeekOrigin.Current:
|
||||
whence = 0;
|
||||
break;
|
||||
case System.IO.SeekOrigin.End:
|
||||
whence = 2;
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
bool raw_ret = gsf_output_seek(Handle, offset, whence);
|
||||
bool ret = raw_ret;
|
||||
return ret;
|
||||
}
|
|
@ -20,7 +20,7 @@ gsf-api.xml:
|
|||
chmod u+w gsf-api.xml
|
||||
$(GAPI_FIXUP) --api=gsf-api.xml --metadata=$(srcdir)/Gsf.metadata
|
||||
|
||||
generated-stamp: $(APIS) $(sources) Gsf.metadata Global.custom Input.custom
|
||||
generated-stamp: $(APIS) $(sources) Gsf.metadata Global.custom Input.custom Output.custom
|
||||
$(GAPI_CODEGEN) --generate $(APIS) \
|
||||
--outdir=generated --customdir=. --assembly-name=gsf-sharp && touch generated-stamp
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче