ext/win32ole/win32ole_method.c in win32ole-1.8.10 vs ext/win32ole/win32ole_method.c in win32ole-1.9.0

- old
+ new

@@ -214,13 +214,13 @@ VALUE obj = olemethod_from_typeinfo(method, pTypeInfo, name); return obj; } /* - * Document-class: WIN32OLE_METHOD + * Document-class: WIN32OLE::Method * - * <code>WIN32OLE_METHOD</code> objects represent OLE method information. + * +WIN32OLE::Method+ objects represent OLE method information. */ static VALUE olemethod_set_member(VALUE self, ITypeInfo *pTypeInfo, ITypeInfo *pOwnerTypeInfo, int index, VALUE name) { @@ -249,20 +249,20 @@ return obj; } /* * call-seq: - * WIN32OLE_METHOD.new(ole_type, method) -> WIN32OLE_METHOD object + * WIN32OLE::Method.new(ole_type, method) -> WIN32OLE::Method object * - * Returns a new WIN32OLE_METHOD object which represents the information + * Returns a new WIN32OLE::Method object which represents the information * about OLE method. - * The first argument <i>ole_type</i> specifies WIN32OLE_TYPE object. + * The first argument <i>ole_type</i> specifies WIN32OLE::Type object. * The second argument <i>method</i> specifies OLE method name defined OLE class - * which represents WIN32OLE_TYPE object. + * which represents WIN32OLE::Type object. * - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') - * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbook') + * method = WIN32OLE::Method.new(tobj, 'SaveAs') */ static VALUE folemethod_initialize(VALUE self, VALUE oletype, VALUE method) { VALUE obj = Qnil; @@ -275,23 +275,23 @@ rb_raise(eWIN32OLERuntimeError, "not found %s", StringValuePtr(method)); } } else { - rb_raise(rb_eTypeError, "1st argument should be WIN32OLE_TYPE object"); + rb_raise(rb_eTypeError, "1st argument should be WIN32OLE::Type object"); } return obj; } /* * call-seq: - * WIN32OLE_METHOD#name + * name * * Returns the name of the method. * - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') - * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbook') + * method = WIN32OLE::Method.new(tobj, 'SaveAs') * puts method.name # => SaveAs * */ static VALUE folemethod_name(VALUE self) @@ -315,15 +315,15 @@ return type; } /* * call-seq: - * WIN32OLE_METHOD#return_type + * return_type * * Returns string of return value type of method. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') - * method = WIN32OLE_METHOD.new(tobj, 'Add') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbooks') + * method = WIN32OLE::Method.new(tobj, 'Add') * puts method.return_type # => Workbook * */ static VALUE folemethod_return_type(VALUE self) @@ -349,15 +349,15 @@ return vvt; } /* * call-seq: - * WIN32OLE_METHOD#return_vtype + * return_vtype * * Returns number of return value type of method. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') - * method = WIN32OLE_METHOD.new(tobj, 'Add') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbooks') + * method = WIN32OLE::Method.new(tobj, 'Add') * puts method.return_vtype # => 26 * */ static VALUE folemethod_return_vtype(VALUE self) @@ -383,16 +383,16 @@ return type; } /* * call-seq: - * WIN32OLE_METHOD#return_type_detail + * return_type_detail * * Returns detail information of return value type of method. * The information is array. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') - * method = WIN32OLE_METHOD.new(tobj, 'Add') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbooks') + * method = WIN32OLE::Method.new(tobj, 'Add') * p method.return_type_detail # => ["PTR", "USERDEFINED", "Workbook"] */ static VALUE folemethod_return_type_detail(VALUE self) { @@ -435,15 +435,15 @@ return type; } /* * call-seq: - * WIN32OLE_METHOD#invkind + * invkind * * Returns the method invoke kind. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') - * method = WIN32OLE_METHOD.new(tobj, 'Add') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbooks') + * method = WIN32OLE::Method.new(tobj, 'Add') * puts method.invkind # => 1 * */ static VALUE folemethod_invkind(VALUE self) @@ -453,17 +453,17 @@ return ole_method_invkind(pmethod->pTypeInfo, pmethod->index); } /* * call-seq: - * WIN32OLE_METHOD#invoke_kind + * invoke_kind * * Returns the method kind string. The string is "UNKNOWN" or "PROPERTY" * or "PROPERTY" or "PROPERTYGET" or "PROPERTYPUT" or "PROPERTYPPUTREF" * or "FUNC". - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') - * method = WIN32OLE_METHOD.new(tobj, 'Add') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbooks') + * method = WIN32OLE::Method.new(tobj, 'Add') * puts method.invoke_kind # => "FUNC" */ static VALUE folemethod_invoke_kind(VALUE self) { @@ -492,15 +492,15 @@ return visible; } /* * call-seq: - * WIN32OLE_METHOD#visible? + * visible? * * Returns true if the method is public. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') - * method = WIN32OLE_METHOD.new(tobj, 'Add') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbooks') + * method = WIN32OLE::Method.new(tobj, 'Add') * puts method.visible? # => true */ static VALUE folemethod_visible(VALUE self) { @@ -573,15 +573,15 @@ return event; } /* * call-seq: - * WIN32OLE_METHOD#event? + * event? * * Returns true if the method is event. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') - * method = WIN32OLE_METHOD.new(tobj, 'SheetActivate') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbook') + * method = WIN32OLE::Method.new(tobj, 'SheetActivate') * puts method.event? # => true * */ static VALUE folemethod_event(VALUE self) @@ -595,15 +595,15 @@ rb_ivar_get(self, rb_intern("name"))); } /* * call-seq: - * WIN32OLE_METHOD#event_interface + * event_interface * * Returns event interface name if the method is event. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') - * method = WIN32OLE_METHOD.new(tobj, 'SheetActivate') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbook') + * method = WIN32OLE::Method.new(tobj, 'SheetActivate') * puts method.event_interface # => WorkbookEvents */ static VALUE folemethod_event_interface(VALUE self) { @@ -653,16 +653,16 @@ return WC2VSTR(bhelpstring); } /* * call-seq: - * WIN32OLE_METHOD#helpstring + * helpstring * * Returns help string of OLE method. If the help string is not found, * then the method returns nil. - * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser') - * method = WIN32OLE_METHOD.new(tobj, 'Navigate') + * tobj = WIN32OLE::Type.new('Microsoft Internet Controls', 'IWebBrowser') + * method = WIN32OLE::Method.new(tobj, 'Navigate') * puts method.helpstring # => Navigates to a URL or file. * */ static VALUE folemethod_helpstring(VALUE self) @@ -684,16 +684,16 @@ return WC2VSTR(bhelpfile); } /* * call-seq: - * WIN32OLE_METHOD#helpfile + * helpfile * * Returns help file. If help file is not found, then * the method returns nil. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') - * method = WIN32OLE_METHOD.new(tobj, 'Add') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbooks') + * method = WIN32OLE::Method.new(tobj, 'Add') * puts method.helpfile # => C:\...\VBAXL9.CHM */ static VALUE folemethod_helpfile(VALUE self) { @@ -715,15 +715,15 @@ return RB_INT2FIX(helpcontext); } /* * call-seq: - * WIN32OLE_METHOD#helpcontext + * helpcontext * * Returns help context. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') - * method = WIN32OLE_METHOD.new(tobj, 'Add') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbooks') + * method = WIN32OLE::Method.new(tobj, 'Add') * puts method.helpcontext # => 65717 */ static VALUE folemethod_helpcontext(VALUE self) { @@ -746,15 +746,15 @@ return dispid; } /* * call-seq: - * WIN32OLE_METHOD#dispid + * dispid * * Returns dispatch ID. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') - * method = WIN32OLE_METHOD.new(tobj, 'Add') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbooks') + * method = WIN32OLE::Method.new(tobj, 'Add') * puts method.dispid # => 181 */ static VALUE folemethod_dispid(VALUE self) { @@ -777,15 +777,15 @@ return offset_vtbl; } /* * call-seq: - * WIN32OLE_METHOD#offset_vtbl + * offset_vtbl * * Returns the offset ov VTBL. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks') - * method = WIN32OLE_METHOD.new(tobj, 'Add') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbooks') + * method = WIN32OLE::Method.new(tobj, 'Add') * puts method.offset_vtbl # => 40 */ static VALUE folemethod_offset_vtbl(VALUE self) { @@ -808,15 +808,15 @@ return size_params; } /* * call-seq: - * WIN32OLE_METHOD#size_params + * size_params * * Returns the size of arguments of the method. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') - * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbook') + * method = WIN32OLE::Method.new(tobj, 'SaveAs') * puts method.size_params # => 11 * */ static VALUE folemethod_size_params(VALUE self) @@ -840,15 +840,15 @@ return size_opt_params; } /* * call-seq: - * WIN32OLE_METHOD#size_opt_params + * size_opt_params * * Returns the size of optional parameters. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') - * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbook') + * method = WIN32OLE::Method.new(tobj, 'SaveAs') * puts method.size_opt_params # => 4 */ static VALUE folemethod_size_opt_params(VALUE self) { @@ -890,15 +890,15 @@ return params; } /* * call-seq: - * WIN32OLE_METHOD#params + * params * - * returns array of WIN32OLE_PARAM object corresponding with method parameters. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') - * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') + * returns array of WIN32OLE::Param object corresponding with method parameters. + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbook') + * method = WIN32OLE::Method.new(tobj, 'SaveAs') * p method.params # => [Filename, FileFormat, Password, WriteResPassword, * ReadOnlyRecommended, CreateBackup, AccessMode, * ConflictResolution, AddToMru, TextCodepage, * TextVisualLayout] */ @@ -910,25 +910,26 @@ return ole_method_params(pmethod->pTypeInfo, pmethod->index); } /* * call-seq: - * WIN32OLE_METHOD#inspect -> String + * inspect -> String * * Returns the method name with class name. * */ static VALUE folemethod_inspect(VALUE self) { - return default_inspect(self, "WIN32OLE_METHOD"); + return default_inspect(self, "WIN32OLE::Method"); } VALUE cWIN32OLE_METHOD; void Init_win32ole_method(void) { cWIN32OLE_METHOD = rb_define_class_under(cWIN32OLE, "Method", rb_cObject); + /* Alias of WIN32OLE::Method, for the backward compatibility */ rb_define_const(rb_cObject, "WIN32OLE_METHOD", cWIN32OLE_METHOD); rb_define_alloc_func(cWIN32OLE_METHOD, folemethod_s_allocate); rb_define_method(cWIN32OLE_METHOD, "initialize", folemethod_initialize, 2); rb_define_method(cWIN32OLE_METHOD, "name", folemethod_name, 0); rb_define_method(cWIN32OLE_METHOD, "return_type", folemethod_return_type, 0);