Ruby  2.4.2p198(2017-09-14revision59899)
Data Structures | Typedefs | Functions | Variables
win32ole_event.c File Reference
#include "win32ole.h"
Include dependency graph for win32ole_event.c:

Go to the source code of this file.

Data Structures

struct  IEventSink
 
struct  IEventSinkVtbl
 
struct  tagIEVENTSINKOBJ
 
struct  oleeventdata
 

Typedefs

typedef struct IEventSinkPEVENTSINK
 
typedef struct IEventSinkVtbl IEventSinkVtbl
 
typedef struct tagIEVENTSINKOBJ IEVENTSINKOBJ
 
typedef struct tagIEVENTSINKOBJPIEVENTSINKOBJ
 

Functions

RUBY_EXTERN void rb_write_error_str (VALUE mesg)
 
STDMETHODIMP EVENTSINK_QueryInterface (PEVENTSINK, REFIID, LPVOID *)
 
 STDMETHODIMP_ (STDMETHODIMP_() EVENTSINK_Release(PEVENTSINK) ULONG)
 
void EVENTSINK_Destructor (PIEVENTSINKOBJ)
 
static void ole_val2ptr_variant (VALUE val, VARIANT *var)
 
static void hash2ptr_dispparams (VALUE hash, ITypeInfo *pTypeInfo, DISPID dispid, DISPPARAMS *pdispparams)
 
static VALUE hash2result (VALUE hash)
 
static void ary2ptr_dispparams (VALUE ary, DISPPARAMS *pdispparams)
 
static VALUE exec_callback (VALUE arg)
 
static VALUE rescue_callback (VALUE arg)
 
static HRESULT find_iid (VALUE ole, char *pitf, IID *piid, ITypeInfo **ppTypeInfo)
 
static HRESULT find_coclass (ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, ITypeInfo **pTypeInfo2, TYPEATTR **pTypeAttr2)
 
static HRESULT find_default_source_from_typeinfo (ITypeInfo *pTypeInfo, TYPEATTR *pTypeAttr, ITypeInfo **ppTypeInfo)
 
static HRESULT find_default_source (VALUE ole, IID *piid, ITypeInfo **ppTypeInfo)
 
static long ole_search_event_at (VALUE ary, VALUE ev)
 
static VALUE ole_search_event (VALUE ary, VALUE ev, BOOL *is_default)
 
static VALUE ole_search_handler_method (VALUE handler, VALUE ev, BOOL *is_default_handler)
 
static void ole_delete_event (VALUE ary, VALUE ev)
 
static void oleevent_free (void *ptr)
 
static size_t oleevent_size (const void *ptr)
 
static VALUE fev_s_allocate (VALUE klass)
 
static VALUE ev_advise (int argc, VALUE *argv, VALUE self)
 
static VALUE fev_initialize (int argc, VALUE *argv, VALUE self)
 
static void ole_msg_loop (void)
 
static VALUE fev_s_msg_loop (VALUE klass)
 
static void add_event_call_back (VALUE obj, VALUE event, VALUE data)
 
static VALUE ev_on_event (int argc, VALUE *argv, VALUE self, VALUE is_ary_arg)
 
static VALUE fev_on_event (int argc, VALUE *argv, VALUE self)
 
static VALUE fev_on_event_with_outargs (int argc, VALUE *argv, VALUE self)
 
static VALUE fev_off_event (int argc, VALUE *argv, VALUE self)
 
static VALUE fev_unadvise (VALUE self)
 
static VALUE fev_set_handler (VALUE self, VALUE val)
 
static VALUE fev_get_handler (VALUE self)
 
static VALUE evs_push (VALUE ev)
 
static VALUE evs_delete (long i)
 
static VALUE evs_entry (long i)
 
static long evs_length (void)
 
STDMETHODIMP EVENTSINK_Invoke (PEVENTSINK pEventSink, DISPID dispid, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdispparams, VARIANT *pvarResult, EXCEPINFO *pexcepinfo, UINT *puArgErr)
 
 EVENTSINK_AddRef (PEVENTSINK pEV)
 
 STDMETHODIMP_ (ULONG)
 
STDMETHODIMP EVENTSINK_GetTypeInfoCount (PEVENTSINK pEV, UINT *pct)
 
STDMETHODIMP EVENTSINK_GetTypeInfo (PEVENTSINK pEV, UINT info, LCID lcid, ITypeInfo **pInfo)
 
STDMETHODIMP EVENTSINK_GetIDsOfNames (PEVENTSINK pEventSink, REFIID riid, OLECHAR **szNames, UINT cNames, LCID lcid, DISPID *pDispID)
 
PIEVENTSINKOBJ EVENTSINK_Constructor (void)
 
void Init_win32ole_event (void)
 

Variables

static VALUE ary_ole_event
 
static ID id_events
 
VALUE cWIN32OLE_EVENT
 
static const rb_data_type_t oleevent_datatype
 

Typedef Documentation

◆ IEVENTSINKOBJ

◆ IEventSinkVtbl

Definition at line 15 of file win32ole_event.c.

◆ PEVENTSINK

typedef struct IEventSink * PEVENTSINK

◆ PIEVENTSINKOBJ

typedef struct tagIEVENTSINKOBJ * PIEVENTSINKOBJ

Function Documentation

◆ add_event_call_back()

static void add_event_call_back ( VALUE  obj,
VALUE  event,
VALUE  data 
)
static

◆ ary2ptr_dispparams()

static void ary2ptr_dispparams ( VALUE  ary,
DISPPARAMS *  pdispparams 
)
static

Definition at line 441 of file win32ole_event.c.

References ole_val2ptr_variant(), RARRAY_LEN, and rb_ary_entry().

Referenced by EVENTSINK_Invoke().

◆ ev_advise()

static VALUE ev_advise ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ ev_on_event()

static VALUE ev_on_event ( int  argc,
VALUE argv,
VALUE  self,
VALUE  is_ary_arg 
)
static

◆ EVENTSINK_AddRef()

EVENTSINK_AddRef ( PEVENTSINK  pEV)

Definition at line 256 of file win32ole_event.c.

References tagIEVENTSINKOBJ::m_cRef.

◆ EVENTSINK_Constructor()

PIEVENTSINKOBJ EVENTSINK_Constructor ( void  )

◆ EVENTSINK_Destructor()

void EVENTSINK_Destructor ( PIEVENTSINKOBJ  pEVObj)

Definition at line 323 of file win32ole_event.c.

References free(), NULL, OLE_RELEASE, and tagIEVENTSINKOBJ::pTypeInfo.

Referenced by STDMETHODIMP_().

◆ EVENTSINK_GetIDsOfNames()

STDMETHODIMP EVENTSINK_GetIDsOfNames ( PEVENTSINK  pEventSink,
REFIID  riid,
OLECHAR **  szNames,
UINT  cNames,
LCID  lcid,
DISPID *  pDispID 
)

Definition at line 292 of file win32ole_event.c.

References tagIEVENTSINKOBJ::pTypeInfo.

◆ EVENTSINK_GetTypeInfo()

STDMETHODIMP EVENTSINK_GetTypeInfo ( PEVENTSINK  pEV,
UINT  info,
LCID  lcid,
ITypeInfo **  pInfo 
)

Definition at line 282 of file win32ole_event.c.

References NULL.

◆ EVENTSINK_GetTypeInfoCount()

STDMETHODIMP EVENTSINK_GetTypeInfoCount ( PEVENTSINK  pEV,
UINT *  pct 
)

Definition at line 274 of file win32ole_event.c.

◆ EVENTSINK_Invoke()

STDMETHODIMP EVENTSINK_Invoke ( PEVENTSINK  pEventSink,
DISPID  dispid,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdispparams,
VARIANT *  pvarResult,
EXCEPINFO *  pexcepinfo,
UINT *  puArgErr 
)

◆ EVENTSINK_QueryInterface()

STDMETHODIMP EVENTSINK_QueryInterface ( PEVENTSINK  pEV,
REFIID  iid,
LPVOID *  ppv 
)

Definition at line 237 of file win32ole_event.c.

References NULL, STDMETHODIMP_(), and ULONG().

◆ evs_delete()

static VALUE evs_delete ( long  i)
static

Definition at line 1188 of file win32ole_event.c.

References ary_ole_event, Qnil, and rb_ary_store().

Referenced by fev_unadvise().

◆ evs_entry()

static VALUE evs_entry ( long  i)
static

Definition at line 1195 of file win32ole_event.c.

References ary_ole_event, and rb_ary_entry().

Referenced by EVENTSINK_Invoke().

◆ evs_length()

static long evs_length ( void  )
static

Definition at line 1201 of file win32ole_event.c.

References ary_ole_event, and RARRAY_LEN.

Referenced by ev_advise().

◆ evs_push()

static VALUE evs_push ( VALUE  ev)
static

Definition at line 1182 of file win32ole_event.c.

References ary_ole_event, and rb_ary_push().

Referenced by fev_initialize().

◆ exec_callback()

static VALUE exec_callback ( VALUE  arg)
static

Definition at line 454 of file win32ole_event.c.

References rb_apply().

Referenced by EVENTSINK_Invoke().

◆ fev_get_handler()

static VALUE fev_get_handler ( VALUE  self)
static

Definition at line 1259 of file win32ole_event.c.

References rb_intern, and rb_ivar_get().

Referenced by Init_win32ole_event().

◆ fev_initialize()

static VALUE fev_initialize ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ fev_off_event()

static VALUE fev_off_event ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ fev_on_event()

static VALUE fev_on_event ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 1087 of file win32ole_event.c.

References ev_on_event(), and Qfalse.

Referenced by Init_win32ole_event().

◆ fev_on_event_with_outargs()

static VALUE fev_on_event_with_outargs ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 1107 of file win32ole_event.c.

References ev_on_event(), and Qtrue.

Referenced by Init_win32ole_event().

◆ fev_s_allocate()

static VALUE fev_s_allocate ( VALUE  klass)
static

◆ fev_s_msg_loop()

static VALUE fev_s_msg_loop ( VALUE  klass)
static

Definition at line 1016 of file win32ole_event.c.

References ole_msg_loop(), and Qnil.

Referenced by Init_win32ole_event().

◆ fev_set_handler()

static VALUE fev_set_handler ( VALUE  self,
VALUE  val 
)
static

Definition at line 1246 of file win32ole_event.c.

References rb_intern, and rb_ivar_set().

Referenced by fev_initialize(), and Init_win32ole_event().

◆ fev_unadvise()

static VALUE fev_unadvise ( VALUE  self)
static

◆ find_coclass()

static HRESULT find_coclass ( ITypeInfo *  pTypeInfo,
TYPEATTR *  pTypeAttr,
ITypeInfo **  pTypeInfo2,
TYPEATTR **  pTypeAttr2 
)
static

Definition at line 593 of file win32ole_event.c.

References count, FALSE, HRESULT(), NULL, OLE_GET_TYPEATTR, OLE_RELEASE, OLE_RELEASE_TYPEATTR, and TRUE.

Referenced by find_default_source().

◆ find_default_source()

static HRESULT find_default_source ( VALUE  ole,
IID *  piid,
ITypeInfo **  ppTypeInfo 
)
static

◆ find_default_source_from_typeinfo()

static HRESULT find_default_source_from_typeinfo ( ITypeInfo *  pTypeInfo,
TYPEATTR *  pTypeAttr,
ITypeInfo **  ppTypeInfo 
)
static

Definition at line 668 of file win32ole_event.c.

References HRESULT().

Referenced by find_default_source().

◆ find_iid()

static HRESULT find_iid ( VALUE  ole,
char *  pitf,
IID *  piid,
ITypeInfo **  ppTypeInfo 
)
static

◆ hash2ptr_dispparams()

static void hash2ptr_dispparams ( VALUE  hash,
ITypeInfo *  pTypeInfo,
DISPID  dispid,
DISPPARAMS *  pdispparams 
)
static

◆ hash2result()

static VALUE hash2result ( VALUE  hash)
static

Definition at line 431 of file win32ole_event.c.

References Qnil, rb_hash_aref(), rb_str_intern(), and rb_str_new2.

Referenced by EVENTSINK_Invoke().

◆ Init_win32ole_event()

void Init_win32ole_event ( void  )

◆ ole_delete_event()

static void ole_delete_event ( VALUE  ary,
VALUE  ev 
)
static

Definition at line 857 of file win32ole_event.c.

References ole_search_event_at(), and rb_ary_delete_at().

Referenced by add_event_call_back(), and fev_off_event().

◆ ole_msg_loop()

static void ole_msg_loop ( void  )
static

Definition at line 1000 of file win32ole_event.c.

References msg, MSG, and NULL.

Referenced by fev_s_msg_loop(), and fev_unadvise().

◆ ole_search_event()

static VALUE ole_search_event ( VALUE  ary,
VALUE  ev,
BOOL *  is_default 
)
static

Definition at line 814 of file win32ole_event.c.

References FALSE, len, NIL_P, Qnil, RARRAY_LEN, rb_ary_entry(), rb_str_cmp(), and TRUE.

Referenced by EVENTSINK_Invoke().

◆ ole_search_event_at()

static long ole_search_event_at ( VALUE  ary,
VALUE  ev 
)
static

Definition at line 789 of file win32ole_event.c.

References len, NIL_P, RARRAY_LEN, rb_ary_entry(), rb_str_cmp(), RB_TYPE_P, and T_STRING.

Referenced by ole_delete_event().

◆ ole_search_handler_method()

static VALUE ole_search_handler_method ( VALUE  handler,
VALUE  ev,
BOOL *  is_default_handler 
)
static

Definition at line 839 of file win32ole_event.c.

References FALSE, PRIsVALUE, Qnil, rb_intern, rb_respond_to(), rb_sprintf(), rb_to_id(), and TRUE.

Referenced by EVENTSINK_Invoke().

◆ ole_val2ptr_variant()

static void ole_val2ptr_variant ( VALUE  val,
VARIANT *  var 
)
static

◆ oleevent_free()

static void oleevent_free ( void *  ptr)
static

◆ oleevent_size()

static size_t oleevent_size ( const void *  ptr)
static

Definition at line 881 of file win32ole_event.c.

◆ rb_write_error_str()

RUBY_EXTERN void rb_write_error_str ( VALUE  mesg)

◆ rescue_callback()

static VALUE rescue_callback ( VALUE  arg)
static

◆ STDMETHODIMP_() [1/2]

STDMETHODIMP_ ( STDMETHODIMP_() EVENTSINK_Release(PEVENTSINK ULONG)

Definition at line 73 of file win32ole_event.c.

Referenced by EVENTSINK_QueryInterface().

◆ STDMETHODIMP_() [2/2]

STDMETHODIMP_ ( ULONG  )

Definition at line 263 of file win32ole_event.c.

References EVENTSINK_Destructor(), and tagIEVENTSINKOBJ::m_cRef.

Variable Documentation

◆ ary_ole_event

VALUE ary_ole_event
static

Definition at line 67 of file win32ole_event.c.

Referenced by evs_delete(), evs_entry(), evs_length(), evs_push(), and Init_win32ole_event().

◆ cWIN32OLE_EVENT

VALUE cWIN32OLE_EVENT

Definition at line 70 of file win32ole_event.c.

Referenced by EVENTSINK_Invoke(), and Init_win32ole_event().

◆ id_events

ID id_events
static

◆ oleevent_datatype

const rb_data_type_t oleevent_datatype
static
Initial value:
= {
"win32ole_event",
}
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1145
static size_t oleevent_size(const void *ptr)
static void oleevent_free(void *ptr)
#define NULL
Definition: _sdbm.c:102

Definition at line 126 of file win32ole_event.c.