Skip to content

Commit c07a1c8

Browse files
committed
Add .NET namespaces
1 parent 265c7e0 commit c07a1c8

File tree

2 files changed

+82
-82
lines changed

2 files changed

+82
-82
lines changed

mapscript/csharp/csmodule.i

+37-37
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ inner exceptions. Otherwise the exception message will be concatenated*/
126126
*****************************************************************************/
127127

128128
%pragma(csharp) imclasscode=%{
129-
public class StringArrayMarshal : IDisposable {
130-
public readonly IntPtr[] _ar;
129+
public class StringArrayMarshal : System.IDisposable {
130+
public readonly System.IntPtr[] _ar;
131131
public StringArrayMarshal(string[] ar) {
132-
_ar = new IntPtr[ar.Length];
132+
_ar = new System.IntPtr[ar.Length];
133133
for (int cx = 0; cx < _ar.Length; cx++) {
134134
_ar[cx] = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(ar[cx]);
135135
}
@@ -143,7 +143,7 @@ inner exceptions. Otherwise the exception message will be concatenated*/
143143
}
144144
%}
145145

146-
%typemap(imtype, out="IntPtr") char** "IntPtr[]"
146+
%typemap(imtype, out="System.IntPtr") char** "System.IntPtr[]"
147147
%typemap(cstype) char** %{string[]%}
148148
%typemap(in) char** %{ $1 = ($1_ltype)$input; %}
149149
%typemap(out) char** %{ $result = $1; %}
@@ -161,25 +161,25 @@ inner exceptions. Otherwise the exception message will be concatenated*/
161161
/* specializations */
162162
%typemap(csvarout, excode=SWIGEXCODE2) char** formatoptions %{
163163
get {
164-
IntPtr cPtr = $imcall;
165-
IntPtr objPtr;
164+
System.IntPtr cPtr = $imcall;
165+
System.IntPtr objPtr;
166166
string[] ret = new string[this.numformatoptions];
167167
for(int cx = 0; cx < this.numformatoptions; cx++) {
168-
objPtr = System.Runtime.InteropServices.Marshal.ReadIntPtr(cPtr, cx * System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr)));
169-
ret[cx]= (objPtr == IntPtr.Zero) ? null : System.Runtime.InteropServices.Marshal.PtrToStringAnsi(objPtr);
168+
objPtr = System.Runtime.InteropServices.Marshal.ReadIntPtr(cPtr, cx * System.Runtime.InteropServices.Marshal.SizeOf(typeof(System.IntPtr)));
169+
ret[cx]= (objPtr == System.IntPtr.Zero) ? null : System.Runtime.InteropServices.Marshal.PtrToStringAnsi(objPtr);
170170
}
171171
$excode
172172
return ret;
173173
}
174174
%}
175175
%typemap(csvarout, excode=SWIGEXCODE2) char** values %{
176176
get {
177-
IntPtr cPtr = $imcall;
178-
IntPtr objPtr;
177+
System.IntPtr cPtr = $imcall;
178+
System.IntPtr objPtr;
179179
string[] ret = new string[this.numvalues];
180180
for(int cx = 0; cx < this.numvalues; cx++) {
181-
objPtr = System.Runtime.InteropServices.Marshal.ReadIntPtr(cPtr, cx * System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr)));
182-
ret[cx]= (objPtr == IntPtr.Zero) ? null : System.Runtime.InteropServices.Marshal.PtrToStringAnsi(objPtr);
181+
objPtr = System.Runtime.InteropServices.Marshal.ReadIntPtr(cPtr, cx * System.Runtime.InteropServices.Marshal.SizeOf(typeof(System.IntPtr)));
182+
ret[cx]= (objPtr == System.IntPtr.Zero) ? null : System.Runtime.InteropServices.Marshal.PtrToStringAnsi(objPtr);
183183
}
184184
$excode
185185
return ret;
@@ -191,29 +191,29 @@ inner exceptions. Otherwise the exception message will be concatenated*/
191191
*****************************************************************************/
192192

193193
%typemap(ctype) outputFormatObj** "void*"
194-
%typemap(imtype) outputFormatObj** "IntPtr"
194+
%typemap(imtype) outputFormatObj** "System.IntPtr"
195195
%typemap(cstype) outputFormatObj** "outputFormatObj[]"
196196
%typemap(out) outputFormatObj** %{ $result = $1; %}
197197
%typemap(csout, excode=SWIGEXCODE) outputFormatObj** {
198-
IntPtr cPtr = $imcall;
199-
IntPtr objPtr;
198+
System.IntPtr cPtr = $imcall;
199+
System.IntPtr objPtr;
200200
outputFormatObj[] ret = new outputFormatObj[this.numoutputformats];
201201
for(int cx = 0; cx < this.numoutputformats; cx++) {
202-
objPtr = System.Runtime.InteropServices.Marshal.ReadIntPtr(cPtr, cx * System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr)));
203-
ret[cx] = (objPtr == IntPtr.Zero) ? null : new outputFormatObj(objPtr, false, ThisOwn_false());
202+
objPtr = System.Runtime.InteropServices.Marshal.ReadIntPtr(cPtr, cx * System.Runtime.InteropServices.Marshal.SizeOf(typeof(System.IntPtr)));
203+
ret[cx] = (objPtr == System.IntPtr.Zero) ? null : new outputFormatObj(objPtr, false, ThisOwn_false());
204204
}
205205
$excode
206206
return ret;
207207
}
208208

209209
%typemap(csvarout, excode=SWIGEXCODE2) outputFormatObj** %{
210210
get {
211-
IntPtr cPtr = $imcall;
212-
IntPtr objPtr;
211+
System.IntPtr cPtr = $imcall;
212+
System.IntPtr objPtr;
213213
outputFormatObj[] ret = new outputFormatObj[this.numoutputformats];
214214
for(int cx = 0; cx < this.numoutputformats; cx++) {
215-
objPtr = System.Runtime.InteropServices.Marshal.ReadIntPtr(cPtr, cx * System.Runtime.InteropServices.Marshal.SizeOf(typeof(IntPtr)));
216-
ret[cx] = (objPtr == IntPtr.Zero) ? null : new outputFormatObj(objPtr, false, ThisOwn_false());
215+
objPtr = System.Runtime.InteropServices.Marshal.ReadIntPtr(cPtr, cx * System.Runtime.InteropServices.Marshal.SizeOf(typeof(System.IntPtr)));
216+
ret[cx] = (objPtr == System.IntPtr.Zero) ? null : new outputFormatObj(objPtr, false, ThisOwn_false());
217217
}
218218
$excode
219219
return ret;
@@ -225,7 +225,7 @@ inner exceptions. Otherwise the exception message will be concatenated*/
225225
*****************************************************************************/
226226

227227
%pragma(csharp) imclasscode=%{
228-
public delegate void SWIGByteArrayDelegate(IntPtr data, int size);
228+
public delegate void SWIGByteArrayDelegate(System.IntPtr data, int size);
229229
%}
230230

231231
%insert(runtime) %{
@@ -241,8 +241,8 @@ static SWIG_CSharpByteArrayHelperCallback SWIG_csharp_bytearray_callback = NULL;
241241
%typemap(in) SWIG_CSharpByteArrayHelperCallback %{ $1 = ($1_ltype)$input; %}
242242
%typemap(csin) SWIG_CSharpByteArrayHelperCallback "$csinput"
243243

244-
%typemap(imtype) (unsigned char* pixels) "IntPtr"
245-
%typemap(cstype) (unsigned char* pixels) "IntPtr"
244+
%typemap(imtype) (unsigned char* pixels) "System.IntPtr"
245+
%typemap(cstype) (unsigned char* pixels) "System.IntPtr"
246246
%typemap(in) (unsigned char* pixels) %{ $1 = ($1_ltype)$input; %}
247247
%typemap(csin) (unsigned char* pixels) "$csinput"
248248

@@ -289,7 +289,7 @@ static SWIG_CSharpByteArrayHelperCallback SWIG_csharp_bytearray_callback = NULL;
289289
%ignore imageObj::write;
290290
%typemap(cscode) imageObj, struct imageObj %{
291291
private byte[] gdbuffer;
292-
private void CreateByteArray(IntPtr data, int size)
292+
private void CreateByteArray(System.IntPtr data, int size)
293293
{
294294
gdbuffer = new byte[size];
295295
Marshal.Copy(data, gdbuffer, 0, size);
@@ -313,7 +313,7 @@ static SWIG_CSharpByteArrayHelperCallback SWIG_csharp_bytearray_callback = NULL;
313313
%csmethodmodifiers processLegendTemplate "private";
314314
%csmethodmodifiers processQueryTemplate "private";
315315

316-
%typemap(csinterfaces) mapObj "IDisposable, System.Runtime.Serialization.ISerializable";
316+
%typemap(csinterfaces) mapObj "System.IDisposable, System.Runtime.Serialization.ISerializable";
317317
%typemap(csattributes) mapObj "[Serializable]"
318318
%typemap(cscode) mapObj, struct mapObj %{
319319
public string processTemplate(int bGenerateImages, string[] names, string[] values)
@@ -375,13 +375,13 @@ static SWIG_CSharpByteArrayHelperCallback SWIG_csharp_bytearray_callback = NULL;
375375
%pragma(csharp) imclasscode=%{
376376
protected class SWIGByteArrayHelper
377377
{
378-
public delegate void SWIGByteArrayDelegate(IntPtr data, int size);
378+
public delegate void SWIGByteArrayDelegate(System.IntPtr data, int size);
379379
static SWIGByteArrayDelegate bytearrayDelegate = new SWIGByteArrayDelegate(CreateByteArray);
380380

381-
[DllImport("$dllimport", EntryPoint="SWIGRegisterByteArrayCallback_$module")]
381+
[System.Runtime.InteropServices.DllImport("$dllimport", System.Runtime.InteropServices.EntryPoint="SWIGRegisterByteArrayCallback_$module")]
382382
public static extern void SWIGRegisterByteArrayCallback_mapscript(SWIGByteArrayDelegate bytearrayDelegate);
383383

384-
static void CreateByteArray(IntPtr data, int size)
384+
static void CreateByteArray(System.IntPtr data, int size)
385385
{
386386
arraybuffer = new byte[size];
387387
Marshal.Copy(data, arraybuffer, 0, size);
@@ -418,13 +418,13 @@ DllExport void SWIGSTDCALL SWIGRegisterByteArrayCallback_$module(SWIG_CSharpByte
418418
%}
419419

420420
/* Typemaps for pattern array */
421-
%typemap(imtype) (double pattern[ANY]) "IntPtr"
421+
%typemap(imtype) (double pattern[ANY]) "System.IntPtr"
422422
%typemap(cstype) (double pattern[ANY]) "double[]"
423423
%typemap(in) (double pattern[ANY]) %{ $1 = ($1_ltype)$input; %}
424424
%typemap(csin) (double pattern[ANY]) "$csinput"
425425
%typemap(csvarout, excode=SWIGEXCODE2) (double pattern[ANY]) %{
426426
get {
427-
IntPtr cPtr = $imcall;
427+
System.IntPtr cPtr = $imcall;
428428
double[] ret = new double[patternlength];
429429
if (patternlength > 0) {
430430
System.Runtime.InteropServices.Marshal.Copy(cPtr, ret, 0, patternlength);
@@ -433,7 +433,7 @@ DllExport void SWIGSTDCALL SWIGRegisterByteArrayCallback_$module(SWIG_CSharpByte
433433
return ret;
434434
}
435435
set {
436-
IntPtr cPtr = $imcall;
436+
System.IntPtr cPtr = $imcall;
437437
if (value.Length > 0) {
438438
System.Runtime.InteropServices.Marshal.Copy(value, 0, cPtr, value.Length);
439439
}
@@ -444,14 +444,14 @@ DllExport void SWIGSTDCALL SWIGRegisterByteArrayCallback_$module(SWIG_CSharpByte
444444
%typemap(csvarin, excode="") (double pattern[ANY]) %{$excode%}
445445

446446
/* Typemaps for int array */
447-
%typemap(imtype, out="IntPtr") int *panIndexes "int[]"
447+
%typemap(imtype, out="System.IntPtr") int *panIndexes "int[]"
448448
%typemap(cstype) int *panIndexes %{int[]%}
449449
%typemap(in) int *panIndexes %{ $1 = ($1_ltype)$input; %}
450450
%typemap(csin) (int *panIndexes) "$csinput"
451451

452452
/* Typemaps for device handle */
453-
%typemap(imtype) (void* device) %{IntPtr%}
454-
%typemap(cstype) (void* device) %{IntPtr%}
453+
%typemap(imtype) (void* device) %{ System.IntPtr%}
454+
%typemap(cstype) (void* device) %{ System.IntPtr%}
455455
%typemap(in) (void* device) %{ $1 = ($1_ltype)$input; %}
456456
%typemap(csin) (void* device) "$csinput"
457457

@@ -474,7 +474,7 @@ DllExport void SWIGSTDCALL SWIGRegisterByteArrayCallback_$module(SWIG_CSharpByte
474474
%}
475475

476476
%typemap(csout, excode=SWIGEXCODE) classObj* getClass, layerObj* getLayer, layerObj *getLayerByName, styleObj* getStyle {
477-
IntPtr cPtr = $imcall;
478-
$csclassname ret = (cPtr == IntPtr.Zero) ? null : new $csclassname(cPtr, $owner, ThisOwn_false());$excode
477+
System.IntPtr cPtr = $imcall;
478+
$csclassname ret = (cPtr == System.IntPtr.Zero) ? null : new $csclassname(cPtr, $owner, ThisOwn_false());$excode
479479
return ret;
480480
}

0 commit comments

Comments
 (0)