diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-12-31 16:49:09 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2024-01-28 15:25:34 +0000 |
commit | baef72da3601b541cb04aca310fee63eec18964f (patch) | |
tree | 9bca2fdea52e36675cfefcac79a705fe1d0d754f /ext/win32ole | |
parent | 1bc48684cdaf72375a2b094ae963b7d6d125140f (diff) |
[ruby/win32ole] [DOC] Update class names using the scoped names
https://github.com/ruby/win32ole/commit/2c5d193da7
Diffstat (limited to 'ext/win32ole')
-rw-r--r-- | ext/win32ole/win32ole.c | 92 | ||||
-rw-r--r-- | ext/win32ole/win32ole_event.c | 51 | ||||
-rw-r--r-- | ext/win32ole/win32ole_method.c | 123 | ||||
-rw-r--r-- | ext/win32ole/win32ole_param.c | 85 | ||||
-rw-r--r-- | ext/win32ole/win32ole_record.c | 47 | ||||
-rw-r--r-- | ext/win32ole/win32ole_type.c | 130 | ||||
-rw-r--r-- | ext/win32ole/win32ole_typelib.c | 69 | ||||
-rw-r--r-- | ext/win32ole/win32ole_variable.c | 35 | ||||
-rw-r--r-- | ext/win32ole/win32ole_variant.c | 63 |
9 files changed, 353 insertions, 342 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index a060165a1c..d642aab232 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -1962,7 +1962,7 @@ ole_bind_obj(VALUE moniker, int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE.connect( ole ) --> aWIN32OLE + * connect( ole ) --> aWIN32OLE * * Returns running OLE Automation object or WIN32OLE object from moniker. * 1st argument should be OLE program id or class id or moniker. @@ -2019,7 +2019,7 @@ fole_s_connect(int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE.const_load( ole, mod = WIN32OLE) + * const_load( ole, mod = WIN32OLE) * * Defines the constants of OLE Automation server as mod's constants. * The first argument is WIN32OLE object or type library name. @@ -2124,7 +2124,7 @@ reference_count(struct oledata * pole) /* * call-seq: - * WIN32OLE.ole_reference_count(aWIN32OLE) --> number + * ole_reference_count(aWIN32OLE) --> number * * Returns reference counter of Dispatch interface of WIN32OLE object. * You should not use this method because this method @@ -2140,7 +2140,7 @@ fole_s_reference_count(VALUE self, VALUE obj) /* * call-seq: - * WIN32OLE.ole_free(aWIN32OLE) --> number + * ole_free(aWIN32OLE) --> number * * Invokes Release method of Dispatch interface of WIN32OLE object. * You should not use this method because this method @@ -2184,10 +2184,10 @@ ole_show_help(VALUE helpfile, VALUE helpcontext) /* * call-seq: - * WIN32OLE.ole_show_help(obj [,helpcontext]) + * ole_show_help(obj [,helpcontext]) * - * Displays helpfile. The 1st argument specifies WIN32OLE_TYPE - * object or WIN32OLE_METHOD object or helpfile. + * Displays helpfile. The 1st argument specifies WIN32OLE::Type + * object or WIN32OLE::Method object or helpfile. * * excel = WIN32OLE.new('Excel.Application') * typeobj = excel.ole_type @@ -2227,7 +2227,7 @@ fole_s_show_help(int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE.codepage + * codepage * * Returns current codepage. * WIN32OLE.codepage # => WIN32OLE::CP_ACP @@ -2258,7 +2258,7 @@ code_page_installed(UINT cp) /* * call-seq: - * WIN32OLE.codepage = CP + * codepage = CP * * Sets current codepage. * The WIN32OLE.codepage is initialized according to @@ -2282,7 +2282,7 @@ fole_s_set_code_page(VALUE self, VALUE vcp) /* * call-seq: - * WIN32OLE.locale -> locale id. + * locale -> locale id. * * Returns current locale id (lcid). The default locale is * WIN32OLE::LOCALE_SYSTEM_DEFAULT. @@ -2316,12 +2316,12 @@ lcid_installed(LCID lcid) /* * call-seq: - * WIN32OLE.locale = lcid + * locale = lcid * * Sets current locale id (lcid). * * WIN32OLE.locale = 1033 # set locale English(U.S) - * obj = WIN32OLE_VARIANT.new("$100,000", WIN32OLE::VARIANT::VT_CY) + * obj = WIN32OLE::Variant.new("$100,000", WIN32OLE::VARIANT::VT_CY) * */ static VALUE @@ -2345,7 +2345,7 @@ fole_s_set_locale(VALUE self, VALUE vlcid) /* * call-seq: - * WIN32OLE.create_guid + * create_guid * * Creates GUID. * WIN32OLE.create_guid # => {1CB530F1-F6B1-404D-BCE6-1959BF91F4A8} @@ -2393,9 +2393,9 @@ fole_s_ole_uninitialize(VALUE self) /* * Document-class: WIN32OLE * - * <code>WIN32OLE</code> objects represent OLE Automation object in Ruby. + * +WIN32OLE+ objects represent OLE Automation object in Ruby. * - * By using WIN32OLE, you can access OLE server like VBScript. + * By using +WIN32OLE+, you can access OLE server like VBScript. * * Here is sample script. * @@ -2419,18 +2419,18 @@ fole_s_ole_uninitialize(VALUE self) * excel.ActiveWorkbook.Close(0); * excel.Quit(); * - * Unfortunately, Win32OLE doesn't support the argument passed by + * Unfortunately, +WIN32OLE+ doesn't support the argument passed by * reference directly. - * Instead, Win32OLE provides WIN32OLE::ARGV or WIN32OLE_VARIANT object. + * Instead, +WIN32OLE+ provides WIN32OLE::ARGV or WIN32OLE::Variant object. * If you want to get the result value of argument passed by reference, - * you can use WIN32OLE::ARGV or WIN32OLE_VARIANT. + * you can use WIN32OLE::ARGV or WIN32OLE::Variant. * * oleobj.method(arg1, arg2, refargv3) * puts WIN32OLE::ARGV[2] # the value of refargv3 after called oleobj.method * * or * - * refargv3 = WIN32OLE_VARIANT.new(XXX, + * refargv3 = WIN32OLE::Variant.new(XXX, * WIN32OLE::VARIANT::VT_BYREF|WIN32OLE::VARIANT::VT_XXX) * oleobj.method(arg1, arg2, refargv3) * p refargv3.value # the value of refargv3 after called oleobj.method. @@ -2439,7 +2439,7 @@ fole_s_ole_uninitialize(VALUE self) /* * call-seq: - * WIN32OLE.new(server, [host]) -> WIN32OLE object + * new(server, [host]) -> WIN32OLE object * WIN32OLE.new(server, license: 'key') -> WIN32OLE object * * Returns a new WIN32OLE object(OLE Automation object). @@ -2826,7 +2826,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket) /* * call-seq: - * WIN32OLE#invoke(method, [arg1,...]) => return value of method. + * invoke(method, [arg1,...]) => return value of method. * * Runs OLE method. * The first argument specifies the method name of OLE Automation object. @@ -3038,7 +3038,7 @@ ole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types, USHORT dispkind) /* * call-seq: - * WIN32OLE#_invoke(dispid, args, types) + * _invoke(dispid, args, types) * * Runs the early binding method. * The 1st argument specifies dispatch ID, @@ -3056,7 +3056,7 @@ fole_invoke2(VALUE self, VALUE dispid, VALUE args, VALUE types) /* * call-seq: - * WIN32OLE#_getproperty(dispid, args, types) + * _getproperty(dispid, args, types) * * Runs the early binding method to get property. * The 1st argument specifies dispatch ID, @@ -3074,7 +3074,7 @@ fole_getproperty2(VALUE self, VALUE dispid, VALUE args, VALUE types) /* * call-seq: - * WIN32OLE#_setproperty(dispid, args, types) + * _setproperty(dispid, args, types) * * Runs the early binding method to set property. * The 1st argument specifies dispatch ID, @@ -3120,7 +3120,7 @@ fole_setproperty_with_bracket(int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE.setproperty('property', [arg1, arg2,...] val) + * setproperty('property', [arg1, arg2,...] val) * * Sets property of OLE object. * When you want to set property with argument, you can use this method. @@ -3226,7 +3226,7 @@ ole_propertyput(VALUE self, VALUE property, VALUE value) /* * call-seq: - * WIN32OLE#ole_free + * ole_free * * invokes Release method of Dispatch interface of WIN32OLE object. * Usually, you do not need to call this method because Release method @@ -3269,7 +3269,7 @@ ole_ienum_free(VALUE pEnumV) /* * call-seq: - * WIN32OLE#each {|i|...} + * each {|i|...} * * Iterates over each item of OLE collection which has IEnumVARIANT interface. * @@ -3340,7 +3340,7 @@ fole_each(VALUE self) /* * call-seq: - * WIN32OLE#method_missing(id [,arg1, arg2, ...]) + * method_missing(id [,arg1, arg2, ...]) * * Calls WIN32OLE#invoke method. */ @@ -3438,9 +3438,9 @@ ole_methods(VALUE self, int mask) /* * call-seq: - * WIN32OLE#ole_methods + * ole_methods * - * Returns the array of WIN32OLE_METHOD object. + * Returns the array of WIN32OLE::Method object. * The element is OLE method of WIN32OLE object. * * excel = WIN32OLE.new('Excel.Application') @@ -3455,9 +3455,9 @@ fole_methods(VALUE self) /* * call-seq: - * WIN32OLE#ole_get_methods + * ole_get_methods * - * Returns the array of WIN32OLE_METHOD object . + * Returns the array of WIN32OLE::Method object . * The element of the array is property (gettable) of WIN32OLE object. * * excel = WIN32OLE.new('Excel.Application') @@ -3471,9 +3471,9 @@ fole_get_methods(VALUE self) /* * call-seq: - * WIN32OLE#ole_put_methods + * ole_put_methods * - * Returns the array of WIN32OLE_METHOD object . + * Returns the array of WIN32OLE::Method object . * The element of the array is property (settable) of WIN32OLE object. * * excel = WIN32OLE.new('Excel.Application') @@ -3487,9 +3487,9 @@ fole_put_methods(VALUE self) /* * call-seq: - * WIN32OLE#ole_func_methods + * ole_func_methods * - * Returns the array of WIN32OLE_METHOD object . + * Returns the array of WIN32OLE::Method object . * The element of the array is property (settable) of WIN32OLE object. * * excel = WIN32OLE.new('Excel.Application') @@ -3504,9 +3504,9 @@ fole_func_methods(VALUE self) /* * call-seq: - * WIN32OLE#ole_type + * ole_type * - * Returns WIN32OLE_TYPE object. + * Returns WIN32OLE::Type object. * * excel = WIN32OLE.new('Excel.Application') * tobj = excel.ole_type @@ -3536,9 +3536,9 @@ fole_type(VALUE self) /* * call-seq: - * WIN32OLE#ole_typelib -> The WIN32OLE_TYPELIB object + * ole_typelib -> The WIN32OLE_TYPELIB object * - * Returns the WIN32OLE_TYPELIB object. The object represents the + * Returns the WIN32OLE::TypeLib object. The object represents the * type library which contains the WIN32OLE object. * * excel = WIN32OLE.new('Excel.Application') @@ -3570,7 +3570,7 @@ fole_typelib(VALUE self) /* * call-seq: - * WIN32OLE#ole_query_interface(iid) -> WIN32OLE object + * ole_query_interface(iid) -> WIN32OLE object * * Returns WIN32OLE object for a specific dispatch or dual * interface specified by iid. @@ -3616,7 +3616,7 @@ fole_query_interface(VALUE self, VALUE str_iid) /* * call-seq: - * WIN32OLE#ole_respond_to?(method) -> true or false + * ole_respond_to?(method) -> true or false * * Returns true when OLE object has OLE method, otherwise returns false. * @@ -3825,9 +3825,9 @@ ole_typedesc2val(ITypeInfo *pTypeInfo, TYPEDESC *pTypeDesc, VALUE typedetails) /* * call-seq: - * WIN32OLE#ole_method_help(method) + * ole_method_help(method) * - * Returns WIN32OLE_METHOD object corresponding with method + * Returns WIN32OLE::Method object corresponding with method * specified by 1st argument. * * excel = WIN32OLE.new('Excel.Application') @@ -3859,7 +3859,7 @@ fole_method_help(VALUE self, VALUE cmdname) /* * call-seq: - * WIN32OLE#ole_activex_initialize() -> Qnil + * ole_activex_initialize() -> Qnil * * Initialize WIN32OLE object(ActiveX Control) by calling * IPersistMemory::InitNew. @@ -4073,7 +4073,7 @@ Init_win32ole(void) * p c # => 0 * p WIN32OLE::ARGV # => [10, 20, 30] * - * You can use WIN32OLE_VARIANT object to retrieve the value of reference + * You can use WIN32OLE::Variant object to retrieve the value of reference * arguments instead of referring WIN32OLE::ARGV. * */ diff --git a/ext/win32ole/win32ole_event.c b/ext/win32ole/win32ole_event.c index 45ebf13433..ff6835e3e4 100644 --- a/ext/win32ole/win32ole_event.c +++ b/ext/win32ole/win32ole_event.c @@ -1,9 +1,9 @@ #include "win32ole.h" /* - * Document-class: WIN32OLE_EVENT + * Document-class: WIN32OLE::Event * - * <code>WIN32OLE_EVENT</code> objects controls OLE event. + * +WIN32OLE::Event+ objects controls OLE event. */ RUBY_EXTERN void rb_write_error_str(VALUE mesg); @@ -974,13 +974,13 @@ ev_advise(int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE_EVENT.new(ole, event) #=> WIN32OLE_EVENT object. + * new(ole, event) #=> WIN32OLE::Event object. * * Returns OLE event object. * The first argument specifies WIN32OLE object. * The second argument specifies OLE event name. * ie = WIN32OLE.new('InternetExplorer.Application') - * ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents') + * ev = WIN32OLE::Event.new(ie, 'DWebBrowserEvents') */ static VALUE fev_initialize(int argc, VALUE *argv, VALUE self) @@ -1004,7 +1004,7 @@ ole_msg_loop(void) /* * call-seq: - * WIN32OLE_EVENT.message_loop + * message_loop * * Translates and dispatches Windows message. */ @@ -1052,7 +1052,7 @@ ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg) /* * call-seq: - * WIN32OLE_EVENT#on_event([event]){...} + * on_event([event]){...} * * Defines the callback event. * If argument is omitted, this method defines the callback of all events. @@ -1061,12 +1061,12 @@ ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg) * use `return' or :return. * * ie = WIN32OLE.new('InternetExplorer.Application') - * ev = WIN32OLE_EVENT.new(ie) + * ev = WIN32OLE::Event.new(ie) * ev.on_event("NavigateComplete") {|url| puts url} * ev.on_event() {|ev, *args| puts "#{ev} fired"} * * ev.on_event("BeforeNavigate2") {|*args| - * ... + * # ... * # set true to BeforeNavigate reference argument `Cancel'. * # Cancel is 7-th argument of BeforeNavigate, * # so you can use 6 as key of hash instead of 'Cancel'. @@ -1075,7 +1075,7 @@ ev_on_event(int argc, VALUE *argv, VALUE self, VALUE is_ary_arg) * {:Cancel => true} # or {'Cancel' => true} or {6 => true} * } * - * ev.on_event(...) {|*args| + * ev.on_event(event_name) {|*args| * {:return => 1, :xxx => yyy} * } */ @@ -1087,14 +1087,14 @@ fev_on_event(int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE_EVENT#on_event_with_outargs([event]){...} + * on_event_with_outargs([event]){...} * * Defines the callback of event. * If you want modify argument in callback, - * you could use this method instead of WIN32OLE_EVENT#on_event. + * you could use this method instead of WIN32OLE::Event#on_event. * * ie = WIN32OLE.new('InternetExplorer.Application') - * ev = WIN32OLE_EVENT.new(ie) + * ev = WIN32OLE::Event.new(ie) * ev.on_event_with_outargs('BeforeNavigate2') {|*args| * args.last[6] = true * } @@ -1107,18 +1107,18 @@ fev_on_event_with_outargs(int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE_EVENT#off_event([event]) + * off_event([event]) * * removes the callback of event. * * ie = WIN32OLE.new('InternetExplorer.Application') - * ev = WIN32OLE_EVENT.new(ie) + * ev = WIN32OLE::Event.new(ie) * ev.on_event('BeforeNavigate2') {|*args| * args.last[6] = true * } - * ... + * # ... * ev.off_event('BeforeNavigate2') - * ... + * # ... */ static VALUE fev_off_event(int argc, VALUE *argv, VALUE self) @@ -1145,16 +1145,16 @@ fev_off_event(int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE_EVENT#unadvise -> nil + * unadvise -> nil * - * disconnects OLE server. If this method called, then the WIN32OLE_EVENT object + * disconnects OLE server. If this method called, then the WIN32OLE::Event object * does not receive the OLE server event any more. * This method is trial implementation. * * ie = WIN32OLE.new('InternetExplorer.Application') - * ev = WIN32OLE_EVENT.new(ie) - * ev.on_event() {...} - * ... + * ev = WIN32OLE::Event.new(ie) + * ev.on_event() { something } + * # ... * ev.unadvise * */ @@ -1201,7 +1201,7 @@ evs_length(void) /* * call-seq: - * WIN32OLE_EVENT#handler= + * handler= * * sets event handler object. If handler object has onXXX * method according to XXX event, then onXXX method is called @@ -1212,7 +1212,7 @@ evs_length(void) * called and 1-st argument is event name. * * If handler object has onXXX method and there is block - * defined by WIN32OLE_EVENT#on_event('XXX'){}, + * defined by <code>on_event('XXX'){}</code>, * then block is executed but handler object method is not called * when XXX event occurs. * @@ -1230,7 +1230,7 @@ evs_length(void) * * handler = Handler.new * ie = WIN32OLE.new('InternetExplorer.Application') - * ev = WIN32OLE_EVENT.new(ie) + * ev = WIN32OLE::Event.new(ie) * ev.on_event("StatusTextChange") {|*args| * puts "this block executed." * puts "handler.onStatusTextChange method is not called." @@ -1246,7 +1246,7 @@ fev_set_handler(VALUE self, VALUE val) /* * call-seq: - * WIN32OLE_EVENT#handler + * handler * * returns handler object. * @@ -1265,6 +1265,7 @@ Init_win32ole_event(void) rb_gc_register_mark_object(ary_ole_event); id_events = rb_intern("events"); cWIN32OLE_EVENT = rb_define_class_under(cWIN32OLE, "Event", rb_cObject); + /* Alias of WIN32OLE::Event, for the backward compatibility */ rb_define_const(rb_cObject, "WIN32OLE_EVENT", cWIN32OLE_EVENT); rb_define_singleton_method(cWIN32OLE_EVENT, "message_loop", fev_s_msg_loop, 0); rb_define_alloc_func(cWIN32OLE_EVENT, fev_s_allocate); diff --git a/ext/win32ole/win32ole_method.c b/ext/win32ole/win32ole_method.c index 646fdaf60c..4b47ca8eed 100644 --- a/ext/win32ole/win32ole_method.c +++ b/ext/win32ole/win32ole_method.c @@ -216,9 +216,9 @@ create_win32ole_method(ITypeInfo *pTypeInfo, VALUE name) } /* - * 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 @@ -251,16 +251,16 @@ folemethod_s_allocate(VALUE klass) /* * 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) @@ -284,12 +284,12 @@ folemethod_initialize(VALUE self, VALUE oletype, VALUE method) /* * 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 * */ @@ -317,11 +317,11 @@ ole_method_return_type(ITypeInfo *pTypeInfo, UINT method_index) /* * 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 * */ @@ -351,11 +351,11 @@ ole_method_return_vtype(ITypeInfo *pTypeInfo, UINT method_index) /* * 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 * */ @@ -385,12 +385,12 @@ ole_method_return_type_detail(ITypeInfo *pTypeInfo, UINT method_index) /* * 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 @@ -437,11 +437,11 @@ ole_method_invoke_kind(ITypeInfo *pTypeInfo, UINT method_index) /* * 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 * */ @@ -455,13 +455,13 @@ folemethod_invkind(VALUE self) /* * 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 @@ -494,11 +494,11 @@ ole_method_visible(ITypeInfo *pTypeInfo, UINT method_index) /* * 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 @@ -575,11 +575,11 @@ ole_method_event(ITypeInfo *pTypeInfo, UINT method_index, VALUE method_name) /* * 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 * */ @@ -597,11 +597,11 @@ folemethod_event(VALUE self) /* * 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 @@ -655,12 +655,12 @@ ole_method_helpstring(ITypeInfo *pTypeInfo, UINT method_index) /* * 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. * */ @@ -686,12 +686,12 @@ ole_method_helpfile(ITypeInfo *pTypeInfo, UINT method_index) /* * 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 @@ -717,11 +717,11 @@ ole_method_helpcontext(ITypeInfo *pTypeInfo, UINT method_index) /* * 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 @@ -748,11 +748,11 @@ ole_method_dispid(ITypeInfo *pTypeInfo, UINT method_index) /* * 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 @@ -779,11 +779,11 @@ ole_method_offset_vtbl(ITypeInfo *pTypeInfo, UINT method_index) /* * 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 @@ -810,11 +810,11 @@ ole_method_size_params(ITypeInfo *pTypeInfo, UINT method_index) /* * 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 * */ @@ -842,11 +842,11 @@ ole_method_size_opt_params(ITypeInfo *pTypeInfo, UINT method_index) /* * 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 @@ -892,11 +892,11 @@ ole_method_params(ITypeInfo *pTypeInfo, UINT method_index) /* * 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, @@ -912,7 +912,7 @@ folemethod_params(VALUE self) /* * call-seq: - * WIN32OLE_METHOD#inspect -> String + * inspect -> String * * Returns the method name with class name. * @@ -928,6 +928,7 @@ 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); diff --git a/ext/win32ole/win32ole_param.c b/ext/win32ole/win32ole_param.c index c6f324968b..ba29d02821 100644 --- a/ext/win32ole/win32ole_param.c +++ b/ext/win32ole/win32ole_param.c @@ -64,9 +64,9 @@ create_win32ole_param(ITypeInfo *pTypeInfo, UINT method_index, UINT index, VALUE } /* - * Document-class: WIN32OLE_PARAM + * Document-class: WIN32OLE::Param * - * <code>WIN32OLE_PARAM</code> objects represent param information of + * +WIN32OLE::Param+ objects represent param information of * the OLE method. */ static VALUE @@ -131,15 +131,15 @@ oleparam_ole_param(VALUE self, VALUE olemethod, int n) /* * call-seq: - * WIN32OLE_PARAM.new(method, n) -> WIN32OLE_PARAM object + * new(method, n) -> WIN32OLE::Param object * - * Returns WIN32OLE_PARAM object which represents OLE parameter information. - * 1st argument should be WIN32OLE_METHOD object. + * Returns WIN32OLE::Param object which represents OLE parameter information. + * 1st argument should be WIN32OLE::Method object. * 2nd argument `n' is n-th parameter of the method specified by 1st argument. * - * tobj = WIN32OLE_TYPE.new('Microsoft Scripting Runtime', 'IFileSystem') - * method = WIN32OLE_METHOD.new(tobj, 'CreateTextFile') - * param = WIN32OLE_PARAM.new(method, 2) # => #<WIN32OLE_PARAM:Overwrite=true> + * tobj = WIN32OLE::Type.new('Microsoft Scripting Runtime', 'IFileSystem') + * method = WIN32OLE::Method.new(tobj, 'CreateTextFile') + * param = WIN32OLE::Param.new(method, 2) # => #<WIN32OLE_PARAM:Overwrite=true> * */ static VALUE @@ -155,11 +155,11 @@ foleparam_initialize(VALUE self, VALUE olemethod, VALUE n) /* * call-seq: - * WIN32OLE_PARAM#name + * name * * Returns name. - * 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') * param1 = method.params[0] * puts param1.name # => Filename */ @@ -186,11 +186,11 @@ ole_param_ole_type(ITypeInfo *pTypeInfo, UINT method_index, UINT index) /* * call-seq: - * WIN32OLE_PARAM#ole_type + * ole_type * - * Returns OLE type of WIN32OLE_PARAM object(parameter of OLE method). - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') - * method = WIN32OLE_METHOD.new(tobj, 'SaveAs') + * Returns OLE type of WIN32OLE::Param object(parameter of OLE method). + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Workbook') + * method = WIN32OLE::Method.new(tobj, 'SaveAs') * param1 = method.params[0] * puts param1.ole_type # => VARIANT */ @@ -220,11 +220,11 @@ ole_param_ole_type_detail(ITypeInfo *pTypeInfo, UINT method_index, UINT index) /* * call-seq: - * WIN32OLE_PARAM#ole_type_detail + * ole_type_detail * * Returns detail information of type of argument. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'IWorksheetFunction') - * method = WIN32OLE_METHOD.new(tobj, 'SumIf') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'IWorksheetFunction') + * method = WIN32OLE::Method.new(tobj, 'SumIf') * param1 = method.params[0] * p param1.ole_type_detail # => ["PTR", "USERDEFINED", "Range"] */ @@ -254,11 +254,11 @@ ole_param_flag_mask(ITypeInfo *pTypeInfo, UINT method_index, UINT index, USHORT /* * call-seq: - * WIN32OLE_PARAM#input? + * input? * * Returns true if the parameter is input. - * 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') * param1 = method.params[0] * puts param1.input? # => true */ @@ -273,22 +273,22 @@ foleparam_input(VALUE self) /* * call-seq: - * WIN32OLE#output? + * output? * * Returns true if argument is output. - * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'DWebBrowserEvents') - * method = WIN32OLE_METHOD.new(tobj, 'NewWindow') + * tobj = WIN32OLE::Type.new('Microsoft Internet Controls', 'DWebBrowserEvents') + * method = WIN32OLE::Method.new(tobj, 'NewWindow') * method.params.each do |param| * puts "#{param.name} #{param.output?}" * end * - * The result of above script is following: - * URL false - * Flags false - * TargetFrameName false - * PostData false - * Headers false - * Processed true + * The result of above script is following: + * URL false + * Flags false + * TargetFrameName false + * PostData false + * Headers false + * Processed true */ static VALUE foleparam_output(VALUE self) @@ -301,11 +301,11 @@ foleparam_output(VALUE self) /* * call-seq: - * WIN32OLE_PARAM#optional? + * optional? * * Returns true if argument is optional. - * 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') * param1 = method.params[0] * puts "#{param1.name} #{param1.optional?}" # => Filename true */ @@ -320,12 +320,12 @@ foleparam_optional(VALUE self) /* * call-seq: - * WIN32OLE_PARAM#retval? + * retval? * * Returns true if argument is return value. - * tobj = WIN32OLE_TYPE.new('DirectX 7 for Visual Basic Type Library', - * 'DirectPlayLobbyConnection') - * method = WIN32OLE_METHOD.new(tobj, 'GetPlayerShortName') + * tobj = WIN32OLE::Type.new('DirectX 7 for Visual Basic Type Library', + * 'DirectPlayLobbyConnection') + * method = WIN32OLE::Method.new(tobj, 'GetPlayerShortName') * param = method.params[0] * puts "#{param.name} #{param.retval?}" # => name true */ @@ -363,12 +363,12 @@ ole_param_default(ITypeInfo *pTypeInfo, UINT method_index, UINT index) /* * call-seq: - * WIN32OLE_PARAM#default + * default * * Returns default value. If the default value does not exist, * this method returns nil. - * 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') * method.params.each do |param| * if param.default * puts "#{param.name} (= #{param.default})" @@ -401,7 +401,7 @@ foleparam_default(VALUE self) /* * call-seq: - * WIN32OLE_PARAM#inspect -> String + * inspect -> String * * Returns the parameter name with class name. If the parameter has default value, * then returns name=value string with class name. @@ -423,6 +423,7 @@ void Init_win32ole_param(void) { cWIN32OLE_PARAM = rb_define_class_under(cWIN32OLE, "Param", rb_cObject); + /* Alias of WIN32OLE::Param, for the backward compatibility */ rb_define_const(rb_cObject, "WIN32OLE_PARAM", cWIN32OLE_PARAM); rb_define_alloc_func(cWIN32OLE_PARAM, foleparam_s_allocate); rb_define_method(cWIN32OLE_PARAM, "initialize", foleparam_initialize, 2); diff --git a/ext/win32ole/win32ole_record.c b/ext/win32ole/win32ole_record.c index 9e18653db9..772c343716 100644 --- a/ext/win32ole/win32ole_record.c +++ b/ext/win32ole/win32ole_record.c @@ -177,10 +177,10 @@ create_win32ole_record(IRecordInfo *pri, void *prec) } /* - * Document-class: WIN32OLE_RECORD + * Document-class: WIN32OLE::Record * - * <code>WIN32OLE_RECORD</code> objects represents VT_RECORD OLE variant. - * Win32OLE returns WIN32OLE_RECORD object if the result value of invoking + * +WIN32OLE::Record+ objects represents VT_RECORD OLE variant. + * Win32OLE returns WIN32OLE::Record object if the result value of invoking * OLE methods. * * If COM server in VB.NET ComServer project is the following: @@ -206,7 +206,7 @@ create_win32ole_record(IRecordInfo *pri, void *prec) * require 'win32ole' * obj = WIN32OLE.new('ComServer.ComClass') * book = obj.getBook - * book.class # => WIN32OLE_RECORD + * book.class # => WIN32OLE::Record * book.title # => "The Ruby Book" * book.cost # => 20 * @@ -253,11 +253,11 @@ folerecord_s_allocate(VALUE klass) { /* * call-seq: - * WIN32OLE_RECORD.new(typename, obj) -> WIN32OLE_RECORD object + * new(typename, obj) -> WIN32OLE::Record object * - * Returns WIN32OLE_RECORD object. The first argument is struct name (String + * Returns WIN32OLE::Record object. The first argument is struct name (String * or Symbol). - * The second parameter obj should be WIN32OLE object or WIN32OLE_TYPELIB object. + * The second parameter obj should be WIN32OLE object or WIN32OLE::TypeLib object. * If COM server in VB.NET ComServer project is the following: * * Imports System.Runtime.InteropServices @@ -269,13 +269,13 @@ folerecord_s_allocate(VALUE klass) { * End Structure * End Class * - * then, you can create WIN32OLE_RECORD object is as following: + * then, you can create WIN32OLE::Record object is as following: * * require 'win32ole' * obj = WIN32OLE.new('ComServer.ComClass') - * book1 = WIN32OLE_RECORD.new('Book', obj) # => WIN32OLE_RECORD object + * book1 = WIN32OLE::Record.new('Book', obj) # => WIN32OLE::Record object * tlib = obj.ole_typelib - * book2 = WIN32OLE_RECORD.new('Book', tlib) # => WIN32OLE_RECORD object + * book2 = WIN32OLE::Record.new('Book', tlib) # => WIN32OLE::Record object * */ static VALUE @@ -323,7 +323,7 @@ folerecord_initialize(VALUE self, VALUE typename, VALUE oleobj) { /* * call-seq: - * WIN32OLE_RECORD#to_h #=> Ruby Hash object. + * WIN32OLE::Record#to_h #=> Ruby Hash object. * * Returns Ruby Hash object which represents VT_RECORD variable. * The keys of Hash object are member names of VT_RECORD OLE variable and @@ -346,7 +346,7 @@ folerecord_initialize(VALUE self, VALUE typename, VALUE oleobj) { * End Function * End Class * - * then, the result of WIN32OLE_RECORD#to_h is the following: + * then, the result of WIN32OLE::Record#to_h is the following: * * require 'win32ole' * obj = WIN32OLE.new('ComServer.ComClass') @@ -362,7 +362,7 @@ folerecord_to_h(VALUE self) /* * call-seq: - * WIN32OLE_RECORD#typename #=> String object + * typename #=> String object * * Returns the type name of VT_RECORD OLE variable. * @@ -383,7 +383,7 @@ folerecord_to_h(VALUE self) * End Function * End Class * - * then, the result of WIN32OLE_RECORD#typename is the following: + * then, the result of WIN32OLE::Record#typename is the following: * * require 'win32ole' * obj = WIN32OLE.new('ComServer.ComClass') @@ -423,7 +423,7 @@ olerecord_ivar_set(VALUE self, VALUE name, VALUE val) /* * call-seq: - * WIN32OLE_RECORD#method_missing(name) + * method_missing(name) * * Returns value specified by the member name of VT_RECORD OLE variable. * Or sets value specified by the member name of VT_RECORD OLE variable. @@ -443,7 +443,7 @@ olerecord_ivar_set(VALUE self, VALUE name, VALUE val) * Then getting/setting value from Ruby is as the following: * * obj = WIN32OLE.new('ComServer.ComClass') - * book = WIN32OLE_RECORD.new('Book', obj) + * book = WIN32OLE::Record.new('Book', obj) * book.title # => nil ( book.method_missing(:title) is invoked. ) * book.title = "Ruby" # ( book.method_missing(:title=, "Ruby") is invoked. ) */ @@ -473,7 +473,7 @@ folerecord_method_missing(int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE_RECORD#ole_instance_variable_get(name) + * ole_instance_variable_get(name) * * Returns value specified by the member name of VT_RECORD OLE object. * If the member name is not correct, KeyError exception is raised. @@ -494,7 +494,7 @@ folerecord_method_missing(int argc, VALUE *argv, VALUE self) * then accessing object_id of ComObject from Ruby is as the following: * * srver = WIN32OLE.new('ComServer.ComClass') - * obj = WIN32OLE_RECORD.new('ComObject', server) + * obj = WIN32OLE::Record.new('ComObject', server) * # obj.object_id returns Ruby Object#object_id * obj.ole_instance_variable_get(:object_id) # => nil * @@ -515,7 +515,7 @@ folerecord_ole_instance_variable_get(VALUE self, VALUE name) /* * call-seq: - * WIN32OLE_RECORD#ole_instance_variable_set(name, val) + * ole_instance_variable_set(name, val) * * Sets value specified by the member name of VT_RECORD OLE object. * If the member name is not correct, KeyError exception is raised. @@ -534,7 +534,7 @@ folerecord_ole_instance_variable_get(VALUE self, VALUE name) * then setting value of the `title' member is as following: * * srver = WIN32OLE.new('ComServer.ComClass') - * obj = WIN32OLE_RECORD.new('Book', server) + * obj = WIN32OLE::Record.new('Book', server) * obj.ole_instance_variable_set(:title, "The Ruby Book") * */ @@ -554,7 +554,7 @@ folerecord_ole_instance_variable_set(VALUE self, VALUE name, VALUE val) /* * call-seq: - * WIN32OLE_RECORD#inspect -> String + * inspect -> String * * Returns the OLE struct name and member name and the value of member * @@ -570,8 +570,8 @@ folerecord_ole_instance_variable_set(VALUE self, VALUE name, VALUE val) * then * * srver = WIN32OLE.new('ComServer.ComClass') - * obj = WIN32OLE_RECORD.new('Book', server) - * obj.inspect # => <WIN32OLE_RECORD(ComClass) {"title" => nil, "cost" => nil}> + * obj = WIN32OLE::Record.new('Book', server) + * obj.inspect # => <WIN32OLE::Record(ComClass) {"title" => nil, "cost" => nil}> * */ static VALUE @@ -595,6 +595,7 @@ void Init_win32ole_record(void) { cWIN32OLE_RECORD = rb_define_class_under(cWIN32OLE, "Record", rb_cObject); + /* Alias of WIN32OLE::Record, for the backward compatibility */ rb_define_const(rb_cObject, "WIN32OLE_RECORD", cWIN32OLE_RECORD); rb_define_alloc_func(cWIN32OLE_RECORD, folerecord_s_allocate); rb_define_method(cWIN32OLE_RECORD, "initialize", folerecord_initialize, 2); diff --git a/ext/win32ole/win32ole_type.c b/ext/win32ole/win32ole_type.c index 1b96aea858..715b7a8297 100644 --- a/ext/win32ole/win32ole_type.c +++ b/ext/win32ole/win32ole_type.c @@ -54,9 +54,9 @@ static const rb_data_type_t oletype_datatype = { }; /* - * Document-class: WIN32OLE_TYPE + * Document-class: WIN32OLE::Type * - * <code>WIN32OLE_TYPE</code> objects represent OLE type library information. + * +WIN32OLE::Type+ objects represent OLE type library information. */ static void @@ -106,10 +106,12 @@ ole_type_from_itypeinfo(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE.ole_classes(typelib) + * ole_classes(typelib) * - * Returns array of WIN32OLE_TYPE objects defined by the <i>typelib</i> type library. - * This method will be OBSOLETE. Use WIN32OLE_TYPELIB.new(typelib).ole_classes instead. + * Returns array of WIN32OLE::Type objects defined by the <i>typelib</i> type library. + * + * This method will be OBSOLETE. + * Use <code>WIN32OLE::TypeLib.new(typelib).ole_classes</code> instead. */ static VALUE foletype_s_ole_classes(VALUE self, VALUE typelib) @@ -118,8 +120,8 @@ foletype_s_ole_classes(VALUE self, VALUE typelib) /* rb_warn("%s is obsolete; use %s instead.", - "WIN32OLE_TYPE.ole_classes", - "WIN32OLE_TYPELIB.new(typelib).ole_types"); + "WIN32OLE::Type.ole_classes", + "WIN32OLE::TypeLib.new(typelib).ole_types"); */ obj = rb_funcall(cWIN32OLE_TYPELIB, rb_intern("new"), 1, typelib); return rb_funcall(obj, rb_intern("ole_types"), 0); @@ -127,10 +129,12 @@ foletype_s_ole_classes(VALUE self, VALUE typelib) /* * call-seq: - * WIN32OLE_TYPE.typelibs + * typelibs * * Returns array of type libraries. - * This method will be OBSOLETE. Use WIN32OLE_TYPELIB.typelibs.collect{|t| t.name} instead. + * + * This method will be OBSOLETE. + * Use <code>WIN32OLE::TypeLib.typelibs.collect{|t| t.name}</code> instead. * */ static VALUE @@ -138,15 +142,15 @@ foletype_s_typelibs(VALUE self) { /* rb_warn("%s is obsolete. use %s instead.", - "WIN32OLE_TYPE.typelibs", - "WIN32OLE_TYPELIB.typelibs.collect{t|t.name}"); + "WIN32OLE::Type.typelibs", + "WIN32OLE::TypeLib.typelibs.collect{t|t.name}"); */ return rb_eval_string("WIN32OLE_TYPELIB.typelibs.collect{|t|t.name}"); } /* * call-seq: - * WIN32OLE_TYPE.progids + * progids * * Returns array of ProgID. */ @@ -214,7 +218,6 @@ create_win32ole_type(ITypeInfo *pTypeInfo, VALUE name) static VALUE oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass) { - long count; int i; HRESULT hr; @@ -245,14 +248,14 @@ oleclass_from_typelib(VALUE self, ITypeLib *pTypeLib, VALUE oleclass) /* * call-seq: - * WIN32OLE_TYPE.new(typelib, ole_class) -> WIN32OLE_TYPE object + * new(typelib, ole_class) -> WIN32OLE::Type object * - * Returns a new WIN32OLE_TYPE object. + * Returns a new WIN32OLE::Type object. * The first argument <i>typelib</i> specifies OLE type library name. * The second argument specifies OLE class name. * - * WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') - * # => WIN32OLE_TYPE object of Application class of Excel. + * WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application') + * # => WIN32OLE::Type object of Application class of Excel. */ static VALUE foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass) @@ -284,10 +287,10 @@ foletype_initialize(VALUE self, VALUE typelib, VALUE oleclass) /* * call-seq: - * WIN32OLE_TYPE#name #=> OLE type name + * name #=> OLE type name * * Returns OLE type name. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application') * puts tobj.name # => Application */ static VALUE @@ -344,10 +347,10 @@ ole_ole_type(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#ole_type #=> OLE type string. + * ole_type #=> OLE type string. * * returns type of OLE class. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application') * puts tobj.ole_type # => Class */ static VALUE @@ -378,10 +381,10 @@ ole_type_guid(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#guid #=> GUID + * guid #=> GUID * * Returns GUID. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application') * puts tobj.guid # => {00024500-0000-0000-C000-000000000046} */ static VALUE @@ -412,10 +415,10 @@ ole_type_progid(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#progid #=> ProgID + * progid #=> ProgID * * Returns ProgID if it exists. If not found, then returns nil. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application') * puts tobj.progid # => Excel.Application.9 */ static VALUE @@ -446,10 +449,10 @@ ole_type_visible(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#visible? #=> true or false + * visible? #=> true or false * * Returns true if the OLE class is public. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Application') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Application') * puts tobj.visible # => true */ static VALUE @@ -475,10 +478,10 @@ ole_type_major_version(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#major_version + * major_version * * Returns major version. - * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents') + * tobj = WIN32OLE::Type.new('Microsoft Word 10.0 Object Library', 'Documents') * puts tobj.major_version # => 8 */ static VALUE @@ -504,10 +507,10 @@ ole_type_minor_version(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#minor_version #=> OLE minor version + * minor_version #=> OLE minor version * * Returns minor version. - * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents') + * tobj = WIN32OLE::Type.new('Microsoft Word 10.0 Object Library', 'Documents') * puts tobj.minor_version # => 2 */ static VALUE @@ -533,10 +536,10 @@ ole_type_typekind(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#typekind #=> number of type. + * typekind #=> number of type. * * Returns number which represents type. - * tobj = WIN32OLE_TYPE.new('Microsoft Word 10.0 Object Library', 'Documents') + * tobj = WIN32OLE::Type.new('Microsoft Word 10.0 Object Library', 'Documents') * puts tobj.typekind # => 4 * */ @@ -561,10 +564,10 @@ ole_type_helpstring(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#helpstring #=> help string. + * helpstring #=> help string. * * Returns help string. - * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser') + * tobj = WIN32OLE::Type.new('Microsoft Internet Controls', 'IWebBrowser') * puts tobj.helpstring # => Web Browser interface */ static VALUE @@ -594,10 +597,10 @@ ole_type_src_type(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#src_type #=> OLE source class + * src_type #=> OLE source class * * Returns source class when the OLE class is 'Alias'. - * tobj = WIN32OLE_TYPE.new('Microsoft Office 9.0 Object Library', 'MsoRGBType') + * tobj = WIN32OLE::Type.new('Microsoft Office 9.0 Object Library', 'MsoRGBType') * puts tobj.src_type # => I4 * */ @@ -622,10 +625,10 @@ ole_type_helpfile(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#helpfile + * helpfile * * Returns helpfile path. If helpfile is not found, then returns nil. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Worksheet') * puts tobj.helpfile # => C:\...\VBAXL9.CHM * */ @@ -650,10 +653,10 @@ ole_type_helpcontext(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#helpcontext + * helpcontext * * Returns helpcontext. If helpcontext is not found, then returns nil. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Worksheet') * puts tobj.helpfile # => 131185 */ static VALUE @@ -701,11 +704,11 @@ ole_variables(ITypeInfo *pTypeInfo) /* * call-seq: - * WIN32OLE_TYPE#variables + * variables * - * Returns array of WIN32OLE_VARIABLE objects which represent variables + * Returns array of WIN32OLE::Variable objects which represent variables * defined in OLE class. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') * vars = tobj.variables * vars.each do |v| * puts "#{v.name} = #{v.value}" @@ -728,11 +731,11 @@ foletype_variables(VALUE self) /* * call-seq: - * WIN32OLE_TYPE#ole_methods # the array of WIN32OLE_METHOD objects. + * ole_methods # the array of WIN32OLE::Method objects. * - * Returns array of WIN32OLE_METHOD objects which represent OLE method defined in + * Returns array of WIN32OLE::Method objects which represent OLE method defined in * OLE type library. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Worksheet') * methods = tobj.ole_methods.collect{|m| * m.name * } @@ -747,11 +750,11 @@ foletype_methods(VALUE self) /* * call-seq: - * WIN32OLE_TYPE#ole_typelib + * ole_typelib * - * Returns the WIN32OLE_TYPELIB object which is including the WIN32OLE_TYPE + * Returns the WIN32OLE::TypeLib object which is including the WIN32OLE::Type * object. If it is not found, then returns nil. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Worksheet') * puts tobj.ole_typelib # => 'Microsoft Excel 9.0 Object Library' */ static VALUE @@ -804,11 +807,11 @@ ole_type_impl_ole_types(ITypeInfo *pTypeInfo, int implflags) /* * call-seq: - * WIN32OLE_TYPE#implemented_ole_types + * implemented_ole_types * - * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE + * Returns the array of WIN32OLE::Type object which is implemented by the WIN32OLE::Type * object. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'Worksheet') * p tobj.implemented_ole_types # => [_Worksheet, DocEvents] */ static VALUE @@ -820,11 +823,11 @@ foletype_impl_ole_types(VALUE self) /* * call-seq: - * WIN32OLE_TYPE#source_ole_types + * source_ole_types * - * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE + * Returns the array of WIN32OLE::Type object which is implemented by the WIN32OLE::Type * object and having IMPLTYPEFLAG_FSOURCE. - * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer") + * tobj = WIN32OLE::Type.new('Microsoft Internet Controls', "InternetExplorer") * p tobj.source_ole_types * # => [#<WIN32OLE_TYPE:DWebBrowserEvents2>, #<WIN32OLE_TYPE:DWebBrowserEvents>] */ @@ -837,11 +840,11 @@ foletype_source_ole_types(VALUE self) /* * call-seq: - * WIN32OLE_TYPE#default_event_sources + * default_event_sources * - * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE + * Returns the array of WIN32OLE::Type object which is implemented by the WIN32OLE::Type * object and having IMPLTYPEFLAG_FSOURCE and IMPLTYPEFLAG_FDEFAULT. - * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer") + * tobj = WIN32OLE::Type.new('Microsoft Internet Controls', "InternetExplorer") * p tobj.default_event_sources # => [#<WIN32OLE_TYPE:DWebBrowserEvents2>] */ static VALUE @@ -853,11 +856,11 @@ foletype_default_event_sources(VALUE self) /* * call-seq: - * WIN32OLE_TYPE#default_ole_types + * default_ole_types * - * Returns the array of WIN32OLE_TYPE object which is implemented by the WIN32OLE_TYPE + * Returns the array of WIN32OLE::Type object which is implemented by the WIN32OLE::Type * object and having IMPLTYPEFLAG_FDEFAULT. - * tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', "InternetExplorer") + * tobj = WIN32OLE::Type.new('Microsoft Internet Controls', "InternetExplorer") * p tobj.default_ole_types * # => [#<WIN32OLE_TYPE:IWebBrowser2>, #<WIN32OLE_TYPE:DWebBrowserEvents2>] */ @@ -870,7 +873,7 @@ foletype_default_ole_types(VALUE self) /* * call-seq: - * WIN32OLE_TYPE#inspect -> String + * inspect -> String * * Returns the type name with class name. * @@ -888,6 +891,7 @@ VALUE cWIN32OLE_TYPE; void Init_win32ole_type(void) { cWIN32OLE_TYPE = rb_define_class_under(cWIN32OLE, "Type", rb_cObject); + /* Alias of WIN32OLE::Type, for the backward compatibility */ rb_define_const(rb_cObject, "WIN32OLE_TYPE", cWIN32OLE_TYPE); rb_define_singleton_method(cWIN32OLE_TYPE, "ole_classes", foletype_s_ole_classes, 1); rb_define_singleton_method(cWIN32OLE_TYPE, "typelibs", foletype_s_typelibs, 0); diff --git a/ext/win32ole/win32ole_typelib.c b/ext/win32ole/win32ole_typelib.c index 84dca9e0e1..ad7e769a98 100644 --- a/ext/win32ole/win32ole_typelib.c +++ b/ext/win32ole/win32ole_typelib.c @@ -127,19 +127,19 @@ ole_typelib_from_itypeinfo(ITypeInfo *pTypeInfo) } /* - * Document-class: WIN32OLE_TYPELIB + * Document-class: WIN32OLE::TypeLib * - * <code>WIN32OLE_TYPELIB</code> objects represent OLE tyblib information. + * +WIN32OLE::TypeLib+ objects represent OLE tyblib information. */ /* * call-seq: * - * WIN32OLE_TYPELIB.typelibs + * typelibs * - * Returns the array of WIN32OLE_TYPELIB object. + * Returns the array of WIN32OLE::TypeLib object. * - * tlibs = WIN32OLE_TYPELIB.typelibs + * tlibs = WIN32OLE::TypeLib.typelibs * */ static VALUE @@ -364,9 +364,9 @@ oletypelib_search_registry2(VALUE self, VALUE args) /* * call-seq: - * WIN32OLE_TYPELIB.new(typelib [, version1, version2]) -> WIN32OLE_TYPELIB object + * new(typelib [, version1, version2]) -> WIN32OLE::TypeLib object * - * Returns a new WIN32OLE_TYPELIB object. + * Returns a new WIN32OLE::TypeLib object. * * The first argument <i>typelib</i> specifies OLE type library name or GUID or * OLE library file. @@ -376,11 +376,11 @@ oletypelib_search_registry2(VALUE self, VALUE args) * If the first argument is type library name, then the second and third argument * are ignored. * - * tlib1 = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') - * tlib2 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}') - * tlib3 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}', 1.3) - * tlib4 = WIN32OLE_TYPELIB.new('{00020813-0000-0000-C000-000000000046}', 1, 3) - * tlib5 = WIN32OLE_TYPELIB.new("C:\\WINNT\\SYSTEM32\\SHELL32.DLL") + * tlib1 = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') + * tlib2 = WIN32OLE::TypeLib.new('{00020813-0000-0000-C000-000000000046}') + * tlib3 = WIN32OLE::TypeLib.new('{00020813-0000-0000-C000-000000000046}', 1.3) + * tlib4 = WIN32OLE::TypeLib.new('{00020813-0000-0000-C000-000000000046}', 1, 3) + * tlib5 = WIN32OLE::TypeLib.new("C:\\WINNT\\SYSTEM32\\SHELL32.DLL") * puts tlib1.name # -> 'Microsoft Excel 9.0 Object Library' * puts tlib2.name # -> 'Microsoft Excel 9.0 Object Library' * puts tlib3.name # -> 'Microsoft Excel 9.0 Object Library' @@ -428,11 +428,11 @@ foletypelib_initialize(VALUE self, VALUE args) /* * call-seq: - * WIN32OLE_TYPELIB#guid -> The guid string. + * guid -> The guid string. * * Returns guid string which specifies type library. * - * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') + * tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') * guid = tlib.guid # -> '{00020813-0000-0000-C000-000000000046}' */ static VALUE @@ -456,11 +456,11 @@ foletypelib_guid(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#name -> The type library name + * name -> The type library name * * Returns the type library name. * - * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') + * tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') * name = tlib.name # -> 'Microsoft Excel 9.0 Object Library' */ static VALUE @@ -500,11 +500,11 @@ make_version_str(VALUE major, VALUE minor) /* * call-seq: - * WIN32OLE_TYPELIB#version -> The type library version String object. + * version -> The type library version String object. * * Returns the type library version. * - * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') + * tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') * puts tlib.version #-> "1.3" */ static VALUE @@ -523,11 +523,11 @@ foletypelib_version(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#major_version -> The type library major version. + * major_version -> The type library major version. * * Returns the type library major version. * - * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') + * tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') * puts tlib.major_version # -> 1 */ static VALUE @@ -546,11 +546,11 @@ foletypelib_major_version(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#minor_version -> The type library minor version. + * minor_version -> The type library minor version. * * Returns the type library minor version. * - * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') + * tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') * puts tlib.minor_version # -> 3 */ static VALUE @@ -568,11 +568,11 @@ foletypelib_minor_version(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#path -> The type library file path. + * path -> The type library file path. * * Returns the type library file path. * - * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') + * tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') * puts tlib.path #-> 'C:\...\EXCEL9.OLB' */ static VALUE @@ -604,15 +604,15 @@ foletypelib_path(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#visible? + * visible? * * Returns true if the type library information is not hidden. * If wLibFlags of TLIBATTR is 0 or LIBFLAG_FRESTRICTED or LIBFLAG_FHIDDEN, * the method returns false, otherwise, returns true. * If the method fails to access the TLIBATTR information, then - * WIN32OLERuntimeError is raised. + * WIN32OLE::RuntimeError is raised. * - * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') + * tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') * tlib.visible? # => true */ static VALUE @@ -636,12 +636,12 @@ foletypelib_visible(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#library_name + * library_name * * Returns library name. - * If the method fails to access library name, WIN32OLERuntimeError is raised. + * If the method fails to access library name, WIN32OLE::RuntimeError is raised. * - * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') + * tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') * tlib.library_name # => Excel */ static VALUE @@ -790,11 +790,11 @@ typelib_file(VALUE ole) /* * call-seq: - * WIN32OLE_TYPELIB#ole_types -> The array of WIN32OLE_TYPE object included the type library. + * ole_types -> The array of WIN32OLE::Type object included the type library. * * Returns the type library file path. * - * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') + * tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') * classes = tlib.ole_types.collect{|k| k.name} # -> ['AddIn', 'AddIns' ...] */ static VALUE @@ -809,11 +809,11 @@ foletypelib_ole_types(VALUE self) /* * call-seq: - * WIN32OLE_TYPELIB#inspect -> String + * inspect -> String * * Returns the type library name with class name. * - * tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library') + * tlib = WIN32OLE::TypeLib.new('Microsoft Excel 9.0 Object Library') * tlib.inspect # => "<#WIN32OLE_TYPELIB:Microsoft Excel 9.0 Object Library>" */ static VALUE @@ -828,6 +828,7 @@ void Init_win32ole_typelib(void) { cWIN32OLE_TYPELIB = rb_define_class_under(cWIN32OLE, "TypeLib", rb_cObject); + /* Alias of WIN32OLE::TypeLib, for the backward compatibility */ rb_define_const(rb_cObject, "WIN32OLE_TYPELIB", cWIN32OLE_TYPELIB); rb_define_singleton_method(cWIN32OLE_TYPELIB, "typelibs", foletypelib_s_typelibs, 0); rb_define_alloc_func(cWIN32OLE_TYPELIB, foletypelib_s_allocate); diff --git a/ext/win32ole/win32ole_variable.c b/ext/win32ole/win32ole_variable.c index e7f58c891e..e2500388c1 100644 --- a/ext/win32ole/win32ole_variable.c +++ b/ext/win32ole/win32ole_variable.c @@ -43,9 +43,9 @@ olevariable_size(const void *ptr) } /* - * Document-class: WIN32OLE_VARIABLE + * Document-class: WIN32OLE::Variable * - * <code>WIN32OLE_VARIABLE</code> objects represent OLE variable information. + * +WIN32OLE::Variable+ objects represent OLE variable information. */ VALUE @@ -63,11 +63,11 @@ create_win32ole_variable(ITypeInfo *pTypeInfo, UINT index, VALUE name) /* * call-seq: - * WIN32OLE_VARIABLE#name + * name * * Returns the name of variable. * - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') * variables = tobj.variables * variables.each do |variable| * puts "#{variable.name}" @@ -103,11 +103,11 @@ ole_variable_ole_type(ITypeInfo *pTypeInfo, UINT var_index) /* * call-seq: - * WIN32OLE_VARIABLE#ole_type + * ole_type * * Returns OLE type string. * - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') * variables = tobj.variables * variables.each do |variable| * puts "#{variable.ole_type} #{variable.name}" @@ -145,11 +145,11 @@ ole_variable_ole_type_detail(ITypeInfo *pTypeInfo, UINT var_index) /* * call-seq: - * WIN32OLE_VARIABLE#ole_type_detail + * ole_type_detail * * Returns detail information of type. The information is array of type. * - * tobj = WIN32OLE_TYPE.new('DirectX 7 for Visual Basic Type Library', 'D3DCLIPSTATUS') + * tobj = WIN32OLE::Type.new('DirectX 7 for Visual Basic Type Library', 'D3DCLIPSTATUS') * variable = tobj.variables.find {|variable| variable.name == 'lFlags'} * tdetail = variable.ole_type_detail * p tdetail # => ["USERDEFINED", "CONST_D3DCLIPSTATUSFLAGS"] @@ -180,12 +180,12 @@ ole_variable_value(ITypeInfo *pTypeInfo, UINT var_index) /* * call-seq: - * WIN32OLE_VARIABLE#value + * value * * Returns value if value is exists. If the value does not exist, * this method returns nil. * - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') * variables = tobj.variables * variables.each do |variable| * puts "#{variable.name} #{variable.value}" @@ -227,11 +227,11 @@ ole_variable_visible(ITypeInfo *pTypeInfo, UINT var_index) /* * call-seq: - * WIN32OLE_VARIABLE#visible? + * visible? * * Returns true if the variable is public. * - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') * variables = tobj.variables * variables.each do |variable| * puts "#{variable.name} #{variable.visible?}" @@ -284,11 +284,11 @@ ole_variable_kind(ITypeInfo *pTypeInfo, UINT var_index) /* * call-seq: - * WIN32OLE_VARIABLE#variable_kind + * variable_kind * * Returns variable kind string. * - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') * variables = tobj.variables * variables.each do |variable| * puts "#{variable.name} #{variable.variable_kind}" @@ -325,10 +325,10 @@ ole_variable_varkind(ITypeInfo *pTypeInfo, UINT var_index) /* * call-seq: - * WIN32OLE_VARIABLE#varkind + * varkind * * Returns the number which represents variable kind. - * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') + * tobj = WIN32OLE::Type.new('Microsoft Excel 9.0 Object Library', 'XlSheetType') * variables = tobj.variables * variables.each do |variable| * puts "#{variable.name} #{variable.varkind}" @@ -351,7 +351,7 @@ folevariable_varkind(VALUE self) /* * call-seq: - * WIN32OLE_VARIABLE#inspect -> String + * inspect -> String * * Returns the OLE variable name and the value with class name. * @@ -370,6 +370,7 @@ VALUE cWIN32OLE_VARIABLE; void Init_win32ole_variable(void) { cWIN32OLE_VARIABLE = rb_define_class_under(cWIN32OLE, "Variable", rb_cObject); + /* Alias of WIN32OLE::Variable, for the backward compatibility */ rb_define_const(rb_cObject, "WIN32OLE_VARIABLE", cWIN32OLE_VARIABLE); rb_undef_alloc_func(cWIN32OLE_VARIABLE); rb_define_method(cWIN32OLE_VARIABLE, "name", folevariable_name, 0); diff --git a/ext/win32ole/win32ole_variant.c b/ext/win32ole/win32ole_variant.c index f1d83ed2e1..fd1cc393a0 100644 --- a/ext/win32ole/win32ole_variant.c +++ b/ext/win32ole/win32ole_variant.c @@ -267,7 +267,7 @@ folevariant_s_allocate(VALUE klass) /* * call-seq: - * WIN32OLE_VARIANT.array(ary, vt) + * array(ary, vt) * * Returns Ruby object wrapping OLE variant whose variant type is VT_ARRAY. * The first argument should be Array object which specifies dimensions @@ -277,7 +277,7 @@ folevariant_s_allocate(VALUE klass) * The following create 2 dimensions OLE array. The first dimensions size * is 3, and the second is 4. * - * ole_ary = WIN32OLE_VARIANT.array([3,4], VT_I4) + * ole_ary = WIN32OLE::Variant.array([3,4], VT_I4) * ruby_ary = ole_ary.value # => [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] * */ @@ -364,37 +364,37 @@ check_type_val2variant(VALUE val) } /* - * Document-class: WIN32OLE_VARIANT + * Document-class: WIN32OLE::Variant * - * <code>WIN32OLE_VARIANT</code> objects represents OLE variant. + * +WIN32OLE::Variant+ objects represents OLE variant. * * Win32OLE converts Ruby object into OLE variant automatically when * invoking OLE methods. If OLE method requires the argument which is * different from the variant by automatic conversion of Win32OLE, you - * can convert the specified variant type by using WIN32OLE_VARIANT class. + * can convert the specified variant type by using WIN32OLE::Variant class. * - * param = WIN32OLE_VARIANT.new(10, WIN32OLE::VARIANT::VT_R4) + * param = WIN32OLE::Variant.new(10, WIN32OLE::VARIANT::VT_R4) * oleobj.method(param) * - * WIN32OLE_VARIANT does not support VT_RECORD variant. Use WIN32OLE_RECORD - * class instead of WIN32OLE_VARIANT if the VT_RECORD variant is needed. + * WIN32OLE::Variant does not support VT_RECORD variant. Use WIN32OLE::Record + * class instead of WIN32OLE::Variant if the VT_RECORD variant is needed. */ /* * call-seq: - * WIN32OLE_VARIANT.new(val, vartype) #=> WIN32OLE_VARIANT object. + * new(val, vartype) #=> WIN32OLE::Variant object. * * Returns Ruby object wrapping OLE variant. * The first argument specifies Ruby object to convert OLE variant variable. * The second argument specifies VARIANT type. - * In some situation, you need the WIN32OLE_VARIANT object to pass OLE method + * In some situation, you need the WIN32OLE::Variant object to pass OLE method * * shell = WIN32OLE.new("Shell.Application") * folder = shell.NameSpace("C:\\Windows") * item = folder.ParseName("tmp.txt") * # You can't use Ruby String object to call FolderItem.InvokeVerb. - * # Instead, you have to use WIN32OLE_VARIANT object to call the method. - * shortcut = WIN32OLE_VARIANT.new("Create Shortcut(\&S)") + * # Instead, you have to use WIN32OLE::Variant object to call the method. + * shortcut = WIN32OLE::Variant.new("Create Shortcut(\&S)") * item.invokeVerb(shortcut) * */ @@ -482,22 +482,22 @@ unlock_safe_array(SAFEARRAY *psa) /* * call-seq: - * WIN32OLE_VARIANT[i,j,...] #=> element of OLE array. + * variant[i,j,...] #=> element of OLE array. * - * Returns the element of WIN32OLE_VARIANT object(OLE array). + * Returns the element of WIN32OLE::Variant object(OLE array). * This method is available only when the variant type of - * WIN32OLE_VARIANT object is VT_ARRAY. + * WIN32OLE::Variant object is VT_ARRAY. * * REMARK: * The all indices should be 0 or natural number and * lower than or equal to max indices. * (This point is different with Ruby Array indices.) * - * obj = WIN32OLE_VARIANT.new([[1,2,3],[4,5,6]]) + * obj = WIN32OLE::Variant.new([[1,2,3],[4,5,6]]) * p obj[0,0] # => 1 * p obj[1,0] # => 4 - * p obj[2,0] # => WIN32OLERuntimeError - * p obj[0, -1] # => WIN32OLERuntimeError + * p obj[2,0] # => WIN32OLE::RuntimeError + * p obj[0, -1] # => WIN32OLE::RuntimeError * */ static VALUE @@ -537,23 +537,23 @@ folevariant_ary_aref(int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE_VARIANT[i,j,...] = val #=> set the element of OLE array + * variant[i,j,...] = val #=> set the element of OLE array * - * Set the element of WIN32OLE_VARIANT object(OLE array) to val. + * Set the element of WIN32OLE::Variant object(OLE array) to val. * This method is available only when the variant type of - * WIN32OLE_VARIANT object is VT_ARRAY. + * WIN32OLE::Variant object is VT_ARRAY. * * REMARK: * The all indices should be 0 or natural number and * lower than or equal to max indices. * (This point is different with Ruby Array indices.) * - * obj = WIN32OLE_VARIANT.new([[1,2,3],[4,5,6]]) + * obj = WIN32OLE::Variant.new([[1,2,3],[4,5,6]]) * obj[0,0] = 7 * obj[1,0] = 8 * p obj.value # => [[7,2,3], [8,5,6]] - * obj[2,0] = 9 # => WIN32OLERuntimeError - * obj[0, -1] = 9 # => WIN32OLERuntimeError + * obj[2,0] = 9 # => WIN32OLE::RuntimeError + * obj[0, -1] = 9 # => WIN32OLE::RuntimeError * */ static VALUE @@ -598,10 +598,10 @@ folevariant_ary_aset(int argc, VALUE *argv, VALUE self) /* * call-seq: - * WIN32OLE_VARIANT.value #=> Ruby object. + * value #=> Ruby object. * * Returns Ruby object value from OLE variant. - * obj = WIN32OLE_VARIANT.new(1, WIN32OLE::VARIANT::VT_BSTR) + * obj = WIN32OLE::Variant.new(1, WIN32OLE::VARIANT::VT_BSTR) * obj.value # => "1" (not Integer object, but String object "1") * */ @@ -637,10 +637,10 @@ folevariant_value(VALUE self) /* * call-seq: - * WIN32OLE_VARIANT.vartype #=> OLE variant type. + * vartype #=> OLE variant type. * * Returns OLE variant type. - * obj = WIN32OLE_VARIANT.new("string") + * obj = WIN32OLE::Variant.new("string") * obj.vartype # => WIN32OLE::VARIANT::VT_BSTR * */ @@ -654,7 +654,7 @@ folevariant_vartype(VALUE self) /* * call-seq: - * WIN32OLE_VARIANT.value = val #=> set WIN32OLE_VARIANT value to val. + * variant.value = val #=> set WIN32OLE::Variant value to val. * * Sets variant value to val. If the val type does not match variant value * type(vartype), then val is changed to match variant value type(vartype) @@ -662,7 +662,7 @@ folevariant_vartype(VALUE self) * This method is not available when vartype is VT_ARRAY(except VT_UI1|VT_ARRAY). * If the vartype is VT_UI1|VT_ARRAY, the val should be String object. * - * obj = WIN32OLE_VARIANT.new(1) # obj.vartype is WIN32OLE::VARIANT::VT_I4 + * obj = WIN32OLE::Variant.new(1) # obj.vartype is WIN32OLE::VARIANT::VT_I4 * obj.value = 3.2 # 3.2 is changed to 3 when setting value. * p obj.value # => 3 */ @@ -696,6 +696,7 @@ Init_win32ole_variant(void) { #undef rb_intern cWIN32OLE_VARIANT = rb_define_class_under(cWIN32OLE, "Variant", rb_cObject); + /* Alias of WIN32OLE::Variant, for the backward compatibility */ rb_define_const(rb_cObject, "WIN32OLE_VARIANT", cWIN32OLE_VARIANT); rb_define_alloc_func(cWIN32OLE_VARIANT, folevariant_s_allocate); rb_define_singleton_method(cWIN32OLE_VARIANT, "array", folevariant_s_array, 2); @@ -729,7 +730,7 @@ Init_win32ole_variant(void) * This constants is used for not specified parameter. * * fso = WIN32OLE.new("Scripting.FileSystemObject") - * fso.openTextFile(filename, WIN32OLE_VARIANT::NoParam, false) + * fso.openTextFile(filename, WIN32OLE::Variant::NoParam, false) */ rb_define_const(cWIN32OLE_VARIANT, "NoParam", rb_funcall(cWIN32OLE_VARIANT, rb_intern("new"), 2, INT2NUM(DISP_E_PARAMNOTFOUND), RB_INT2FIX(VT_ERROR))); |