Mercurial > projects > dwt-mac
comparison dwt/browser/FilePicker.d @ 7:e831403a80a9
Add 'cast' to casts
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 14:30:35 +0200 |
parents | 1a8b3cb347e0 |
children | d8635bb48c7c |
comparison
equal
deleted
inserted
replaced
6:b903c16b6f48 | 7:e831403a80a9 |
---|---|
58 | 58 |
59 filePicker = new XPCOMObject (new int[] {2, 0, 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) { | 59 filePicker = new XPCOMObject (new int[] {2, 0, 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) { |
60 public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);} | 60 public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);} |
61 public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();} | 61 public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();} |
62 public int /*long*/ method2 (int /*long*/[] args) {return Release ();} | 62 public int /*long*/ method2 (int /*long*/[] args) {return Release ();} |
63 public int /*long*/ method3 (int /*long*/[] args) {return Init (args[0], args[1], (short)args[2]);} | 63 public int /*long*/ method3 (int /*long*/[] args) {return Init (args[0], args[1], cast(short)args[2]);} |
64 public int /*long*/ method4 (int /*long*/[] args) {return AppendFilters ((int)/*64*/args[0]);} | 64 public int /*long*/ method4 (int /*long*/[] args) {return AppendFilters (cast(int)/*64*/args[0]);} |
65 public int /*long*/ method5 (int /*long*/[] args) {return AppendFilter (args[0], args[1]);} | 65 public int /*long*/ method5 (int /*long*/[] args) {return AppendFilter (args[0], args[1]);} |
66 public int /*long*/ method6 (int /*long*/[] args) {return GetDefaultString (args[0]);} | 66 public int /*long*/ method6 (int /*long*/[] args) {return GetDefaultString (args[0]);} |
67 public int /*long*/ method7 (int /*long*/[] args) {return SetDefaultString (args[0]);} | 67 public int /*long*/ method7 (int /*long*/[] args) {return SetDefaultString (args[0]);} |
68 public int /*long*/ method8 (int /*long*/[] args) {return GetDefaultExtension (args[0]);} | 68 public int /*long*/ method8 (int /*long*/[] args) {return GetDefaultExtension (args[0]);} |
69 public int /*long*/ method9 (int /*long*/[] args) {return SetDefaultExtension (args[0]);} | 69 public int /*long*/ method9 (int /*long*/[] args) {return SetDefaultExtension (args[0]);} |
70 public int /*long*/ method10 (int /*long*/[] args) {return GetFilterIndex (args[0]);} | 70 public int /*long*/ method10 (int /*long*/[] args) {return GetFilterIndex (args[0]);} |
71 public int /*long*/ method11 (int /*long*/[] args) {return SetFilterIndex ((int)/*64*/args[0]);} | 71 public int /*long*/ method11 (int /*long*/[] args) {return SetFilterIndex (cast(int)/*64*/args[0]);} |
72 public int /*long*/ method12 (int /*long*/[] args) {return GetDisplayDirectory (args[0]);} | 72 public int /*long*/ method12 (int /*long*/[] args) {return GetDisplayDirectory (args[0]);} |
73 public int /*long*/ method13 (int /*long*/[] args) {return SetDisplayDirectory (args[0]);} | 73 public int /*long*/ method13 (int /*long*/[] args) {return SetDisplayDirectory (args[0]);} |
74 public int /*long*/ method14 (int /*long*/[] args) {return GetFile (args[0]);} | 74 public int /*long*/ method14 (int /*long*/[] args) {return GetFile (args[0]);} |
75 public int /*long*/ method15 (int /*long*/[] args) {return GetFileURL (args[0]);} | 75 public int /*long*/ method15 (int /*long*/[] args) {return GetFileURL (args[0]);} |
76 public int /*long*/ method16 (int /*long*/[] args) {return GetFiles (args[0]);} | 76 public int /*long*/ method16 (int /*long*/[] args) {return GetFiles (args[0]);} |
144 | 144 |
145 int Show (int /*long*/ _retval) { | 145 int Show (int /*long*/ _retval) { |
146 if (mode is nsIFilePicker.modeGetFolder) { | 146 if (mode is nsIFilePicker.modeGetFolder) { |
147 /* picking a directory */ | 147 /* picking a directory */ |
148 int result = showDirectoryPicker (); | 148 int result = showDirectoryPicker (); |
149 XPCOM.memmove (_retval, new short[] {(short)result}, 2); /* PRInt16 */ | 149 XPCOM.memmove (_retval, new short[] {cast(short)result}, 2); /* PRInt16 */ |
150 return XPCOM.NS_OK; | 150 return XPCOM.NS_OK; |
151 } | 151 } |
152 | 152 |
153 /* picking a file */ | 153 /* picking a file */ |
154 int style = mode is nsIFilePicker.modeSave ? DWT.SAVE : DWT.OPEN; | 154 int style = mode is nsIFilePicker.modeSave ? DWT.SAVE : DWT.OPEN; |
167 files = dialog.getFileNames (); | 167 files = dialog.getFileNames (); |
168 directory = dialog.getFilterPath (); | 168 directory = dialog.getFilterPath (); |
169 title = defaultFilename = null; | 169 title = defaultFilename = null; |
170 masks = null; | 170 masks = null; |
171 int result = filename is null ? nsIFilePicker.returnCancel : nsIFilePicker.returnOK; | 171 int result = filename is null ? nsIFilePicker.returnCancel : nsIFilePicker.returnOK; |
172 XPCOM.memmove (_retval, new short[] {(short)result}, 2); /* PRInt16 */ | 172 XPCOM.memmove (_retval, new short[] {cast(short)result}, 2); /* PRInt16 */ |
173 return XPCOM.NS_OK; | 173 return XPCOM.NS_OK; |
174 } | 174 } |
175 | 175 |
176 int showDirectoryPicker () { | 176 int showDirectoryPicker () { |
177 Display display = Display.getCurrent (); | 177 Display display = Display.getCurrent (); |