search for: rb_funcall

Displaying 20 results from an estimated 41 matches for "rb_funcall".

2007 Apr 13
0
[961] branches/wxruby2/wxwidgets_282/swig: Move wxDateTime typemap into shared file, map to core Time class instead
...:31 UTC (rev 961) </span><span class="lines">@@ -0,0 +1,39 @@ </span><ins>+// Typemaps for converting between wxDateTime and Ruby''s Date and Time classes + +%{ +#include <wx/datetime.h> +%} + +%typemap(in) const wxDateTime& { + int y = NUM2INT(rb_funcall($input, rb_intern("year"), 0)); + int rMonth = NUM2INT(rb_funcall($input, rb_intern("month"), 0)); + int rDay = NUM2INT(rb_funcall($input, rb_intern("mday"), 0)); + int rHour = NUM2INT(rb_funcall($input, rb_intern("hour"), 0)); + int rMinute = NUM...
2011 Aug 25
4
[PATCH 0/3] ruby: Fix event handler failure
...ssage to Chris since he might have a better idea. https://bugzilla.redhat.com/show_bug.cgi?id=733297 In this bug, it appears that the event log callback goes out of scope and is garbage collected. (This is despite the fact we registered it as a global root). When we invoke the callback later, rb_funcall raises this exception: wrong argument type Proc (expected Data) I checked the type of the callback, and indeed it changes from T_DATA (normal) to T_NONE (raises this exception). My workaround simply checks that the type != T_NONE before calling. Rich.
2006 Dec 07
0
Fwd: win32-service problems with patch
...ce_Ctrl longer than necessary and the - // critical section will block it. - VALUE val = rb_hash_aref(EventHookHash, INT2NUM(waiting_control_code)); - if(val!=Qnil) { - VALUE thread = rb_thread_create(Service_Event_Dispatch, (void*) val); - rb_funcall(thread_group, cAdd, 1, thread); + if (waiting_control_code != SERVICE_CONTROL_STOP) { + // if there is a code, create a ruby thread to deal with it + // this might be over engineering the solution, but I don''t + // want to block Servi...
2007 Jun 25
0
[1072] trunk/wxruby2/swig/shared/datetime.i: Add typemap for DateTime::WeekDay; plug mem leak with wxDateTime arg
...;wx/datetime.h> </span><span class="cx"> %} </span><span class="cx"> </span><del>-%typemap(in) const wxDateTime& { </del><ins>+%typemap(in) wxDateTime& { </ins><span class="cx"> int y = NUM2INT(rb_funcall($input, rb_intern("year"), 0)); </span><span class="cx"> int rMonth = NUM2INT(rb_funcall($input, rb_intern("month"), 0)); </span><span class="cx"> int rDay = NUM2INT(rb_funcall($input, rb_intern("mday"), 0)); </spa...
2005 Nov 26
1
Another patch of win32-service for nice startup.
...= CreateThread(NULL,0,ThreadProc,0,0,&ThreadId); + if(hThread == INVALID_HANDLE_VALUE){ + strcpy(error,ErrorDescription(GetLastError())); + ErrorStopService(); + rb_raise(cDaemonError,error); + } + + if(rb_respond_to(self,rb_intern("service_init"))){ + rb_funcall(self,rb_intern("service_init"),0); } + SetEvent(hStartEvent); + // Call service_main method if(rb_respond_to(self,rb_intern("service_main"))){ rb_funcall(self,rb_intern("service_main"),0); ========================================================...
2006 Oct 10
4
Need help for coding an extension to ferret
...ect, to make the json string myself from that, but i don''t know how to load my documents from this class... it''s really weirdo to me actually :\ hope somebody can help ! Here is my code, situated in r_search.c : static VALUE frt_td_to_json(VALUE self) { int i; VALUE rhits = rb_funcall(self, id_hits, 0); VALUE rhit; const int len = RARRAY(rhits)->len; long pos; for (i = 0; i < len; i++) { rhit = RARRAY(rhits)->ptr[i]; pos = FIX2INT(rb_funcall(rhit, id_doc, 0)); // // HERE I WOUlD LIKE TO LOAD THE DOCUMENTS, ID IS THE GOOD DOC_ID.. // I WOULD LIKE TO GET THI...
2005 Oct 06
9
Grid.GetTextExtent
...ternalLeading, wxFont const *font) const { ... if (swig_get_up()) { wxWindow::GetTextExtent(string,x,y,descent,externalLeading,font); return; } obj0 = rb_str_new2((const char *)(&string)->mb_str()); obj1 = SWIG_NewPointerObj(x, SWIGTYPE_p_int, 0); result = rb_funcall(swig_get_self(), rb_intern("get_text_extent"), 2,obj0,obj1); Wow. That''s just so wrong. It only converts two parameters and the one it chooses to convert shouldn''t be passed in any case. Any suggestions on this one? Roy
2008 Feb 06
0
[ wxruby-Bugs-17827 ] Crash when closing Dialog in bigdemo.rb
...#16 0x000dad6a in rb_eval_string_wrap () #17 0x000d80da in rb_eval_string_wrap () #18 0x000de178 in rb_thread_trap_eval () #19 0x000de7e6 in rb_thread_trap_eval () #20 0x000da18c in rb_eval_string_wrap () #21 0x000dad6a in rb_eval_string_wrap () #22 0x000db7ed in rb_respond_to () #23 0x000db8d6 in rb_funcall () #24 0x010ab236 in wxRbCallback::EventThunker () at string.h:690 #25 0x0139fbc3 in wxAppConsole::HandleEvent (this=0x3ad2d0, handler=0x833200, func={__pfn = 0x10ab18c <wxRbCallback::EventThunker(wxEvent&)>, __delta = 0}, event=@0xbfffdf24) at ../src/common/appbase.cpp:320 #26 0x0143ba6e...
2008 Jan 08
28
1.9.3 release, rakefile
Hi I''d like to put out a 1.9.3 release perhaps later this week/weekend. If you have a chance to test the build and samples esp with latest rubygems, please do. There are still some bugs on the list, and samples to do, but this should address all the build/install probs that have come up. And it would be good to get some testing and feedback on some of the new classes. A note on the
2004 Feb 05
1
Service event hooks question
In order to be able to call event hooks as I mentioned previously it looks like I''ll have to do something like this in Service_Ctrl(): // For example if(dwCtrlCode == SERVICE_CONTROL_STOP){ rb_funcall(self,rb_intern("send"),rb_intern("on_stop")); } There are a few problems. First, I''m not sure I''m calling that properly. Second, I don''t know how to get "self" into the method - I making cDaemon global and passing that but it didn''...
2004 Nov 07
2
Problems with DeviceIoControl()
...esReturned; int fn; USHORT inBuf = COMPRESSION_FORMAT_DEFAULT; if((rbBool != Qtrue) && (rbBool != Qfalse)){ rb_raise(rb_eTypeError,"Argument must be true or false"); } if(rbBool == Qfalse){ inBuf = COMPRESSION_FORMAT_NONE; } fn = NUM2INT(rb_funcall(self,rb_intern("fileno"),0,0)); h = (HANDLE)_get_osfhandle(fn); // Get HANDLE based on fileno if(h == INVALID_HANDLE_VALUE){ rb_raise(cFileError,ErrorDescription(GetLastError())); } rv = DeviceIoControl( h, FSCTL_SET_COMPRESSION, (LPVOID)inBuf,...
2006 Aug 24
5
TreeCtrl background?
On my windows build, I just noticed that the background of my TextCtrl''s is grey by default, and when I try to set the default style I get the error: TestTextCtrl.rb:15:in `set_default_style'': undefined method `'' for #<Wxruby2::TextCtrl:0x360a0c4> (NoMethodError) from TestTextCtrl.rb:15:in `initialize'' from TestTextCtrl.rb:24:in
2006 Nov 12
0
[ wxruby-Bugs-6632 ] Linux crash on NoteBook in bigdemo.rb
...rgv=0xbf81c6e0, body=0xb7e0e388, flags=0) at eval.c:5810 #32 0x0805e521 in rb_call (klass=3084969020, recv=3063296600, mid=5217, argc=1, argv=0xbf81c6e0, scope=1) at eval.c:6048 #33 0x0805ea27 in vafuncall (recv=3063296600, mid=5217, n=1, ar=0xbf81c754) at eval.c:6125 #34 0x0805eb60 in rb_funcall (recv=3063296600, mid=5217, n=1) at eval.c:6142 #35 0xb76edcd8 in wxRbCallback::EventThunker (this=0x8215fa8, event=@0xbf81cfa0) at src/EvtHandler.cpp:2108 #36 0xb7b5b9be in wxEvtHandler::ProcessEventIfMatches () from lib/wxruby2.so #37 0xb7b5ba52 in wxEvtHandler::SearchDynamicEventTable () fr...
2006 Jun 18
1
Win32-Service and threading
...splayed the Current TID -- and we are switching system threads in the ruby interpreter. Looking at service.c, I see you are using RegisterServiceCtrlHandler, there is no guarantee that it will be called from the main thread (matter of fact it generally won''t). In Service_Ctrl, you make an rb_funcall using the call back hash, which then calls back into the interpreter while the main thread is still running under mainloop. My side effect was some scrambled ruby file handles and some pipe closed on stopping errors. I would be happy to give back and fix this issue, but wanted your input on how to...
2005 Sep 10
8
Tagged wxruby2 v0.0.29, plus added more directors
Since things seemed to be somewhat stable (that is, wxruby2 compiles and runs on all three platforms), I tagged what has been there for a couple days as v0_0_29. Nothing magic about it, but it had been a while since I had tagged. Then I worked on adding directors to the classes that don''t have them, in the hopes of avoiding more segfault crashes during garbage collection. I was able
2004 Nov 06
3
Calling CreateFile on an instance of File - possible?
...9;'ve been trying something like this: static VALUE file_set_compressed(VALUE self, VALUE rbBool){ DWORD dwAttr; VALUE rbPath; HANDLE h; if((rbBool != Qtrue) && (rbBool != Qfalse)){ rb_raise(rb_eTypeError,"Argument must be true or false"); } rbPath = rb_funcall(self,rb_intern("path"),0,0); dwAttr = GetFileAttributes(StringValuePtr(rbPath)); h = CreateFile( (LPCTSTR)StringValuePtr(rbPath), FILE_ALL_ACCESS, FILE_SHARE_READ, NULL, OPEN_EXISTING, dwAttr, NULL ); if(h == INVALID_HANDLE_VALUE){...
2007 Jun 28
0
[1092] trunk/wxruby2/swig/classes/App.i: Pass correctly typed Events into filter_event, if defined (bug 10797);
...nbsp&nbsp&nbsp&nbsp// else wrap the event and pass into that method +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspVALUE event_type_id = INT2NUM(event.GetEventType()); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspVALUE event_klass = rb_funcall(cWxEvtHandler.klass, +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&n...
2006 Mar 14
6
cFerret nearing completion
Hey folks, Some good news. I''ve finished cFerret and it''s ruby bindings to the point where I can run all of the unit tests. I still have to work out how I''m going to package and release it but it shouldn''t be long now. If you can''t wait you might like to try it from the subversion repository. It''ll probably only work on linux at the moment and
2009 Nov 12
1
[ win32utils-Bugs-27425 ] win32-open3 doesn't build with 1.9.1
...t;ruby/io.h" instead of "rubyio.h" win32/open3.c(88) : error C2039: ''ptr'' : is not a member of ''RArray'' c:\ruby19\include\ruby-1.9.1\ruby/ruby.h(607) : see declaration of ''RArray'' win32/open3.c(88) : error C2198: ''rb_funcall'' : too few arguments for call win32/open3.c(89) : error C2039: ''ptr'' : is not a member of ''RArray'' c:\ruby19\include\ruby-1.9.1\ruby/ruby.h(607) : see declaration of ''RArray'' win32/open3.c(89) : error C2198: ''rb_funcall...
2005 Aug 21
15
New inheritance
A good number of the samples I have tested are outright or subtly broken on Windows now. I''m trying to determine what the cause is. Mostly it seems related to the initialize function not being created when it should be. Case in point: ClientDC.i The caret example won''t work at all because initialize isn''t declared any longer. If you comment out the import