gtk-webkit-ruby 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -3,19 +3,26 @@ Gtk Webkit Ruby
3
3
 
4
4
  Requires
5
5
  --------
6
- * rubber-generate >= 0.0.12
7
- * ruby-gnome2 (including development files)
8
- * webkit (including development files)
6
+ * rubber-generate >= 0.0.17
7
+ * rake-compiler, rake to build
8
+ * ruby-gnome2 (including development files)
9
+ * webkit (including development files)
10
+
11
+ Changes
12
+ -------
13
+ * 0.0.4 - 16 Nov 2012
14
+ * Use rubygems to find Ruby-GNOME2 installation (fixes #2, missing rbglib.h header file)
15
+ * Wrap stored JS ref pointer with Data_Wrap_Struct (fixes GC bug)
9
16
 
10
17
  Description
11
18
  -----------
12
-
13
19
  Gtk Webkit bindings for ruby. Partial coverage sufficient to embed a webview in a ruby-gnome2 application.
14
20
 
15
- Also initial/experimental support for allowing ruby code to be called by javascript & executing javascript from ruby.
21
+ Also experimental support for allowing ruby code to be called by javascript & executing javascript from ruby.
16
22
 
17
23
  e.g
18
24
 
25
+ ````ruby
19
26
  require 'gtk2'
20
27
  require 'webkit'
21
28
  require 'digest/md5'
@@ -30,4 +37,13 @@ e.g
30
37
  puts v.main_frame.exec_js("ruby_eval('RUBY_DESCRIPTION')")
31
38
  puts v.main_frame.exec_js("md5('foo')")
32
39
  puts Digest::MD5.hexdigest('foo')
40
+ ````
41
+
42
+ License
43
+ -------
44
+ Copyright (c) 2011-2012 Geoff Youngs
45
+
46
+ This program is free software.
47
+ You can distribute/modify this program under the terms of
48
+ the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
33
49
 
data/Rakefile CHANGED
@@ -5,6 +5,9 @@ BASE_DIR = Dir.pwd
5
5
  require 'rubygems/package_task'
6
6
  require 'rake/testtask'
7
7
 
8
+ $: << './lib'
9
+
10
+ require 'webkit/version'
8
11
  exts = []
9
12
 
10
13
  namespace :prepare do
@@ -22,13 +25,13 @@ spec = Gem::Specification.new do |s|
22
25
  s.name = "gtk-webkit-ruby"
23
26
  s.author = "Geoff Youngs"
24
27
  s.email = "git@intersect-uk.co.uk"
25
- s.version = "0.0.4"
28
+ s.version = WebKit::BINDINGS_VERSION
26
29
  s.homepage = "http://github.com/geoffyoungs/gtk-webkit-ruby"
27
30
  s.summary = "Webkit bindings using rubber-generate"
28
31
  s.add_dependency("rubber-generate", ">= 0.0.17")
29
32
  s.platform = Gem::Platform::RUBY
30
33
  s.extensions = FileList["ext/*/extconf.rb"]
31
- s.files = FileList['ext/*/*.{c,h,cr,rd}'] + ['Rakefile', 'README.md']
34
+ s.files = FileList['ext/*/*.{c,h,cr,rd}'] + ['Rakefile', 'README.md'] + FileList['lib/**/*.rb']
32
35
  s.description = <<-EOF
33
36
  Gtk Webkit bindings for ruby. Partial coverage sufficient to embed a webview in a Ruby-GNOME2 application.
34
37
 
@@ -16,15 +16,19 @@ if use_gems or Object.const_defined?('Gem')
16
16
  end
17
17
  end
18
18
  end
19
+ # Look for headers in {gem_root}/ext/{package}
20
+ if use_gems
19
21
  %w[
20
- glib2 gdk_pixbuf2 atk gtk2].each do |package|
21
- require package
22
- $CFLAGS += " -I"+Gem.loaded_specs[package].full_gem_path+"/ext/"+package
22
+ glib2 gdk_pixbuf2 atk gtk2 ].each do |package|
23
+ require package
24
+ $CFLAGS += " -I"+Gem.loaded_specs[package].full_gem_path+"/ext/"+package
25
+ end
23
26
  end
24
27
  if RbConfig::CONFIG.has_key?('rubyhdrdir')
25
28
  $CFLAGS += " -I" + RbConfig::CONFIG['rubyhdrdir']+'/ruby'
26
29
  end
27
30
 
31
+ $CFLAGS += " -I."
28
32
  have_func("rb_errinfo")
29
33
  PKGConfig.have_package("gtk+-2.0") or exit(-1)
30
34
  PKGConfig.have_package("webkit-1.0") or exit(-1)
@@ -113,6 +113,8 @@ convert_javascript_to_ruby(JSContextRef ctx, JSValueRef val)
113
113
  case kJSTypeObject:
114
114
  output = convert_javascript_string_to_ruby(ctx, val);
115
115
  break;
116
+ default:
117
+ break;
116
118
  }
117
119
 
118
120
  return output;
@@ -1,10 +1,15 @@
1
1
  #include <alloca.h>
2
2
  #include "javascript-type-convert.h"
3
3
 
4
+ #ifndef STRINGIZE
4
5
  #define STRINGIZE(s) #s
6
+ #endif
5
7
 
6
8
  #define JS_fn(f) _JS_fn(ctx, STRINGIZE(f), f)
7
-
9
+ #ifdef __GNUC__
10
+ #pragma GCC diagnostic ignored "-Wunused-parameter"
11
+ #pragma GCC diagnostic ignored "-Wunused-variable"
12
+ #endif
8
13
 
9
14
  typedef struct {
10
15
  JSClassDefinition definition;
@@ -95,7 +100,7 @@ static void jsrb_class_init(JSContextRef ctx, JSObjectRef object)
95
100
 
96
101
  static void jsrb_class_final(JSObjectRef object) {
97
102
  // Clean up?
98
- VALUE robject = JSObjectGetPrivate(object);
103
+ VALUE robject = (VALUE)JSObjectGetPrivate(object);
99
104
  if (RTEST(robject)) {
100
105
  ruby_js_class_def *def = (ruby_js_class_def*)DATA_PTR(rb_iv_get(robject, "_js_ref"));
101
106
  rb_iv_set(robject, "_js_ref", Qnil);
@@ -113,7 +118,7 @@ static void jsrb_class_final(JSObjectRef object) {
113
118
 
114
119
  static bool jsrb_has_prop(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName)
115
120
  {
116
- VALUE robject = JSObjectGetPrivate(object);
121
+ VALUE robject = (VALUE)JSObjectGetPrivate(object);
117
122
 
118
123
  if (RTEST(robject)) {
119
124
  ID prop = convert_javascript_to_intern(propertyName);
@@ -168,8 +173,8 @@ static void jsrb_get_prop_names(JSContextRef ctx, JSObjectRef object, JSProperty
168
173
  static JSValueRef jsrb_call_fn(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
169
174
  {
170
175
  //
171
- VALUE robject = JSObjectGetPrivate(function);
172
- VALUE self = JSObjectGetPrivate(thisObject);
176
+ VALUE robject = (VALUE)JSObjectGetPrivate(function);
177
+ VALUE self = (VALUE)JSObjectGetPrivate(thisObject);
173
178
  if (RTEST(robject)) {
174
179
  VALUE rbo = rb_funcall2(robject, rb_intern("call"), 0, NULL);
175
180
  JSValueRef retval = convert_ruby_to_javascript(ctx, rbo);
@@ -194,7 +199,7 @@ static JSObjectRef wrapRubyObject(JSContextRef ctx, VALUE value)
194
199
  def = jsrb_newClass(value);
195
200
  def->ctx = ctx;
196
201
  rb_iv_set(value, "_js_ref", Data_Wrap_Struct(cJsPtr, NULL, NULL, def));
197
- object = JSObjectMake(ctx, def->class_ref, value);
202
+ object = JSObjectMake(ctx, def->class_ref, (void*)value);
198
203
  return object;
199
204
  }
200
205
 
@@ -231,16 +236,25 @@ static void jsrb_class_construct_ffi(ffi_cif* cif,
231
236
 
232
237
  static JSObjectRef jsrb_call_create(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
233
238
  {
234
- int no_args = 0;
235
- VALUE *arg_list = NULL;
239
+ int no_args = 0, i;
240
+ volatile VALUE *arg_list = NULL;
236
241
  JSObjectRef object;
237
242
  VALUE value = Qnil;
238
243
 
239
244
  VALUE robject = JSObjectGetPrivate(constructor);
240
245
 
241
246
  if (RTEST(robject)) {
247
+ arg_list = ALLOC_N(VALUE, argumentCount);
248
+
249
+ for(i = 0; i < argumentCount; i++) {
250
+ no_args += 1;
251
+ arg_list[i] = convert_javascript_to_ruby(ctx, arguments[i]);
252
+ }
253
+
242
254
  value = rb_class_new_instance(no_args, arg_list, robject);
243
255
  RUBYFUNC_ADD(value);
256
+
257
+ xfree(arg_list);
244
258
 
245
259
  return wrapRubyObject(ctx, value);
246
260
  }
@@ -396,7 +410,7 @@ javascript_add_ruby_eval(JSGlobalContextRef ctx)
396
410
  {
397
411
  JSObjectRef global = JSContextGetGlobalObject(ctx);
398
412
 
399
- js_obj_set_value(ctx, global, "ruby_eval", JS_fn(js_call_ruby_eval));
413
+ js_obj_set_value(ctx, global, (char*)"ruby_eval", JS_fn(js_call_ruby_eval));
400
414
 
401
415
  return NULL;
402
416
  }
@@ -431,7 +445,7 @@ javascript_exec(JSGlobalContextRef ctx, char *script)
431
445
  len = JSStringGetUTF8CString(str, buf, max);
432
446
 
433
447
  JSStringRelease(str);
434
- rb_raise(cJavascriptError, buf);
448
+ rb_raise(cJavascriptError, "%s", buf);
435
449
  //free(buf); // Will this ever be called?
436
450
  }
437
451
 
@@ -179,6 +179,7 @@ static void __gcpool_RubyFunc_del(VALUE val);
179
179
  /* Inline C code */
180
180
 
181
181
  #include <intern.h>
182
+ #include <ruby.h>
182
183
  #include "javascript.h"
183
184
 
184
185
  static inline VALUE strOrNil(const char *str) {
@@ -197,7 +198,7 @@ WebKit_CLASS_set_web_database_path(VALUE self, VALUE __v_path)
197
198
  char * path; char * __orig_path;
198
199
  __orig_path = path = ( NIL_P(__v_path) ? NULL : StringValuePtr(__v_path) );
199
200
 
200
- #line 45 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
201
+ #line 46 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
201
202
  webkit_set_web_database_directory_path(path);
202
203
 
203
204
  return self;
@@ -207,7 +208,7 @@ static VALUE
207
208
  WebKit_CLASS_remove_all_web_databases(VALUE self)
208
209
  {
209
210
 
210
- #line 48 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
211
+ #line 49 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
211
212
  webkit_remove_all_web_databases();
212
213
 
213
214
  return Qnil;
@@ -219,7 +220,7 @@ WebKit_CLASS_set_default_web_database_quota(VALUE self, VALUE __v_quota)
219
220
  guint64 quota; guint64 __orig_quota;
220
221
  __orig_quota = quota = rb_num2ull(__v_quota);
221
222
 
222
- #line 51 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
223
+ #line 52 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
223
224
  webkit_set_default_web_database_quota(quota);
224
225
 
225
226
  return self;
@@ -229,7 +230,7 @@ static VALUE
229
230
  WebSettings_initialize(VALUE self)
230
231
  {
231
232
 
232
- #line 57 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
233
+ #line 58 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
233
234
  G_INITIALIZE(self, webkit_web_settings_new());
234
235
 
235
236
  return Qnil;
@@ -240,7 +241,7 @@ WebPolicyDecision_download(VALUE self)
240
241
  {
241
242
  WebKitWebPolicyDecision *_self = ((WebKitWebPolicyDecision*)RVAL2GOBJ(self));
242
243
 
243
- #line 64 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
244
+ #line 65 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
244
245
  webkit_web_policy_decision_download(_self);
245
246
 
246
247
  return Qnil;
@@ -251,7 +252,7 @@ WebPolicyDecision_use(VALUE self)
251
252
  {
252
253
  WebKitWebPolicyDecision *_self = ((WebKitWebPolicyDecision*)RVAL2GOBJ(self));
253
254
 
254
- #line 67 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
255
+ #line 68 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
255
256
  webkit_web_policy_decision_use(_self);
256
257
 
257
258
  return Qnil;
@@ -262,7 +263,7 @@ WebPolicyDecision_ignore(VALUE self)
262
263
  {
263
264
  WebKitWebPolicyDecision *_self = ((WebKitWebPolicyDecision*)RVAL2GOBJ(self));
264
265
 
265
- #line 70 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
266
+ #line 71 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
266
267
  webkit_web_policy_decision_ignore(_self);
267
268
 
268
269
  return Qnil;
@@ -276,7 +277,7 @@ WebFrame_exec_js(VALUE self, VALUE __v_js)
276
277
  WebKitWebFrame *_self = ((WebKitWebFrame*)RVAL2GOBJ(self));
277
278
  __orig_js = js = ( NIL_P(__v_js) ? NULL : StringValuePtr(__v_js) );
278
279
 
279
- #line 77 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
280
+ #line 78 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
280
281
  do { __p_retval = javascript_exec(webkit_web_frame_get_global_context(_self), js); goto out; } while(0);
281
282
  out:
282
283
  return __p_retval;
@@ -291,7 +292,7 @@ WebFrame_add_ruby_class(VALUE self, VALUE __v_name, VALUE klass)
291
292
  if (! ((TYPE(klass) == T_CLASS) || (TYPE(klass) == T_MODULE)) )
292
293
  rb_raise(rb_eArgError, "klass argument must be one of Class, Module");
293
294
 
294
- #line 80 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
295
+ #line 81 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
295
296
  javascript_add_class(webkit_web_frame_get_global_context(_self), name, klass);
296
297
 
297
298
  return Qnil;
@@ -302,7 +303,7 @@ WebFrame_add_ruby_eval(VALUE self)
302
303
  {
303
304
  WebKitWebFrame *_self = ((WebKitWebFrame*)RVAL2GOBJ(self));
304
305
 
305
- #line 83 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
306
+ #line 84 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
306
307
  javascript_add_ruby_eval(webkit_web_frame_get_global_context(_self));
307
308
 
308
309
  return Qnil;
@@ -316,7 +317,7 @@ WebFrame_add_js_api(VALUE self, VALUE __v_name)
316
317
  __orig_name = name = ( NIL_P(__v_name) ? NULL : StringValuePtr(__v_name) );
317
318
  VALUE block = rb_block_proc();
318
319
 
319
- #line 86 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
320
+ #line 87 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
320
321
  javascript_add_ruby_fn(webkit_web_frame_get_global_context(_self), name, block);
321
322
 
322
323
  return Qnil;
@@ -335,7 +336,7 @@ WebFrame_load_string(VALUE self, VALUE __v_content, VALUE __v_mime_type, VALUE _
335
336
  __orig_encoding = encoding = ( NIL_P(__v_encoding) ? NULL : StringValuePtr(__v_encoding) );
336
337
  __orig_base_uri = base_uri = ( NIL_P(__v_base_uri) ? NULL : StringValuePtr(__v_base_uri) );
337
338
 
338
- #line 89 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
339
+ #line 90 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
339
340
  webkit_web_frame_load_string(_self, content, mime_type, encoding, base_uri);
340
341
 
341
342
  return Qnil;
@@ -345,7 +346,7 @@ static VALUE
345
346
  WebView_initialize(VALUE self)
346
347
  {
347
348
 
348
- #line 96 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
349
+ #line 97 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
349
350
  RBGTK_INITIALIZE(self, webkit_web_view_new());
350
351
 
351
352
  return Qnil;
@@ -358,7 +359,7 @@ WebView_open(VALUE self, VALUE __v_uri)
358
359
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
359
360
  __orig_uri = uri = ( NIL_P(__v_uri) ? NULL : StringValuePtr(__v_uri) );
360
361
 
361
- #line 99 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
362
+ #line 100 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
362
363
  webkit_web_view_open(_self, uri);
363
364
 
364
365
  return Qnil;
@@ -371,7 +372,7 @@ WebView_execute_script(VALUE self, VALUE __v_script)
371
372
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
372
373
  __orig_script = script = ( NIL_P(__v_script) ? NULL : StringValuePtr(__v_script) );
373
374
 
374
- #line 102 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
375
+ #line 103 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
375
376
  webkit_web_view_execute_script(_self, script);
376
377
 
377
378
  return Qnil;
@@ -384,7 +385,7 @@ WebView_set_settings(VALUE self, VALUE __v_settings)
384
385
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
385
386
  __orig_settings = settings = RVAL2GOBJ(__v_settings);
386
387
 
387
- #line 105 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
388
+ #line 106 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
388
389
  webkit_web_view_set_settings(_self, settings);
389
390
 
390
391
  return self;
@@ -403,7 +404,7 @@ WebView_load_string(VALUE self, VALUE __v_content, VALUE __v_mime_type, VALUE __
403
404
  __orig_encoding = encoding = ( NIL_P(__v_encoding) ? NULL : StringValuePtr(__v_encoding) );
404
405
  __orig_base_uri = base_uri = ( NIL_P(__v_base_uri) ? NULL : StringValuePtr(__v_base_uri) );
405
406
 
406
- #line 108 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
407
+ #line 109 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
407
408
  webkit_web_view_load_string(_self, content, mime_type, encoding, base_uri);
408
409
 
409
410
  return Qnil;
@@ -416,7 +417,7 @@ WebView_load_uri(VALUE self, VALUE __v_uri)
416
417
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
417
418
  __orig_uri = uri = ( NIL_P(__v_uri) ? NULL : StringValuePtr(__v_uri) );
418
419
 
419
- #line 111 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
420
+ #line 112 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
420
421
  webkit_web_view_load_uri(_self, uri);
421
422
 
422
423
  return Qnil;
@@ -428,7 +429,7 @@ WebView_main_frame(VALUE self)
428
429
  VALUE __p_retval = Qnil;
429
430
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
430
431
 
431
- #line 114 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
432
+ #line 115 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
432
433
  do { __p_retval = GOBJ2RVAL(webkit_web_view_get_main_frame(_self)); goto out; } while(0);
433
434
  out:
434
435
  return __p_retval;
@@ -440,7 +441,7 @@ WebView_focused_frame(VALUE self)
440
441
  VALUE __p_retval = Qnil;
441
442
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
442
443
 
443
- #line 117 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
444
+ #line 118 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
444
445
  do { __p_retval = GOBJ2RVAL(webkit_web_view_get_focused_frame(_self)); goto out; } while(0);
445
446
  out:
446
447
  return __p_retval;
@@ -452,7 +453,7 @@ WebView_progress(VALUE self)
452
453
  VALUE __p_retval = Qnil;
453
454
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
454
455
 
455
- #line 120 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
456
+ #line 121 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
456
457
  do { __p_retval = rb_float_new(webkit_web_view_get_progress(_self)); goto out; } while(0);
457
458
  out:
458
459
  return __p_retval;
@@ -464,7 +465,7 @@ WebView_title(VALUE self)
464
465
  VALUE __p_retval = Qnil;
465
466
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
466
467
 
467
- #line 123 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
468
+ #line 124 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
468
469
  do { __p_retval = rb_str_new2(webkit_web_view_get_title(_self)); goto out; } while(0);
469
470
  out:
470
471
  return __p_retval;
@@ -476,7 +477,7 @@ WebView_uri(VALUE self)
476
477
  VALUE __p_retval = Qnil;
477
478
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
478
479
 
479
- #line 126 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
480
+ #line 127 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
480
481
  do { __p_retval = rb_str_new2(webkit_web_view_get_uri(_self)); goto out; } while(0);
481
482
  out:
482
483
  return __p_retval;
@@ -487,7 +488,7 @@ WebView_reload(VALUE self)
487
488
  {
488
489
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
489
490
 
490
- #line 129 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
491
+ #line 130 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
491
492
  webkit_web_view_reload(_self);
492
493
 
493
494
  return Qnil;
@@ -498,7 +499,7 @@ WebView_reload_bypass_cache(VALUE self)
498
499
  {
499
500
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
500
501
 
501
- #line 132 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
502
+ #line 133 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
502
503
  webkit_web_view_reload_bypass_cache(_self);
503
504
 
504
505
  return Qnil;
@@ -511,7 +512,7 @@ WebView_set_custom_encoding(VALUE self, VALUE __v_encoding)
511
512
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
512
513
  __orig_encoding = encoding = ( NIL_P(__v_encoding) ? NULL : StringValuePtr(__v_encoding) );
513
514
 
514
- #line 135 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
515
+ #line 136 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
515
516
  webkit_web_view_set_custom_encoding(_self, encoding);
516
517
 
517
518
  return self;
@@ -522,7 +523,7 @@ WebView_stop_loading(VALUE self)
522
523
  {
523
524
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
524
525
 
525
- #line 138 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
526
+ #line 139 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
526
527
  webkit_web_view_stop_loading(_self);
527
528
 
528
529
  return Qnil;
@@ -534,7 +535,7 @@ WebView_has_selection_query(VALUE self)
534
535
  VALUE __p_retval = Qnil;
535
536
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
536
537
 
537
- #line 141 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
538
+ #line 142 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
538
539
  do { __p_retval = ((webkit_web_view_has_selection(_self)) ? Qtrue : Qfalse); goto out; } while(0);
539
540
  out:
540
541
  return __p_retval;
@@ -546,7 +547,7 @@ WebView_inspector(VALUE self)
546
547
  VALUE __p_retval = Qnil;
547
548
  WebKitWebView *_self = ((WebKitWebView*)RVAL2GOBJ(self));
548
549
 
549
- #line 144 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
550
+ #line 145 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
550
551
  do { __p_retval = GOBJ2RVAL(webkit_web_view_get_inspector(_self)); goto out; } while(0);
551
552
  out:
552
553
  return __p_retval;
@@ -561,7 +562,7 @@ WebInspector_inspect_coordinates(VALUE self, VALUE __v_x, VALUE __v_y)
561
562
  __orig_x = x = NUM2DBL(__v_x);
562
563
  __orig_y = y = NUM2DBL(__v_y);
563
564
 
564
- #line 151 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
565
+ #line 152 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
565
566
  webkit_web_inspector_inspect_coordinates(_self, x, y);
566
567
 
567
568
  return Qnil;
@@ -573,7 +574,7 @@ WebInspector_uri(VALUE self)
573
574
  VALUE __p_retval = Qnil;
574
575
  WebKitWebInspector *_self = ((WebKitWebInspector*)RVAL2GOBJ(self));
575
576
 
576
- #line 154 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
577
+ #line 155 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
577
578
  do { __p_retval = strOrNil(webkit_web_inspector_get_inspected_uri(_self)); goto out; } while(0);
578
579
  out:
579
580
  return __p_retval;
@@ -584,7 +585,7 @@ WebInspector_show(VALUE self)
584
585
  {
585
586
  WebKitWebInspector *_self = ((WebKitWebInspector*)RVAL2GOBJ(self));
586
587
 
587
- #line 157 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
588
+ #line 158 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
588
589
  webkit_web_inspector_show(_self);
589
590
 
590
591
  return Qnil;
@@ -595,7 +596,7 @@ WebInspector_close(VALUE self)
595
596
  {
596
597
  WebKitWebInspector *_self = ((WebKitWebInspector*)RVAL2GOBJ(self));
597
598
 
598
- #line 160 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
599
+ #line 161 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
599
600
  webkit_web_inspector_close(_self);
600
601
 
601
602
  return Qnil;
@@ -607,7 +608,7 @@ WebInspector_view(VALUE self)
607
608
  VALUE __p_retval = Qnil;
608
609
  WebKitWebInspector *_self = ((WebKitWebInspector*)RVAL2GOBJ(self));
609
610
 
610
- #line 163 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
611
+ #line 164 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
611
612
  do { __p_retval = GOBJ2RVAL(webkit_web_inspector_get_web_view(_self)); goto out; } while(0);
612
613
  out:
613
614
  return __p_retval;
@@ -619,7 +620,7 @@ WebResource_encoding(VALUE self)
619
620
  VALUE __p_retval = Qnil;
620
621
  WebKitWebResource *_self = ((WebKitWebResource*)RVAL2GOBJ(self));
621
622
 
622
- #line 170 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
623
+ #line 171 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
623
624
  do { __p_retval = strOrNil(webkit_web_resource_get_encoding(_self)); goto out; } while(0);
624
625
  out:
625
626
  return __p_retval;
@@ -631,7 +632,7 @@ WebResource_frame_name(VALUE self)
631
632
  VALUE __p_retval = Qnil;
632
633
  WebKitWebResource *_self = ((WebKitWebResource*)RVAL2GOBJ(self));
633
634
 
634
- #line 173 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
635
+ #line 174 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
635
636
  do { __p_retval = strOrNil(webkit_web_resource_get_frame_name(_self)); goto out; } while(0);
636
637
  out:
637
638
  return __p_retval;
@@ -643,7 +644,7 @@ WebResource_mime_type(VALUE self)
643
644
  VALUE __p_retval = Qnil;
644
645
  WebKitWebResource *_self = ((WebKitWebResource*)RVAL2GOBJ(self));
645
646
 
646
- #line 176 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
647
+ #line 177 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
647
648
  do { __p_retval = strOrNil(webkit_web_resource_get_mime_type(_self)); goto out; } while(0);
648
649
  out:
649
650
  return __p_retval;
@@ -655,7 +656,7 @@ WebResource_uri(VALUE self)
655
656
  VALUE __p_retval = Qnil;
656
657
  WebKitWebResource *_self = ((WebKitWebResource*)RVAL2GOBJ(self));
657
658
 
658
- #line 179 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
659
+ #line 180 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
659
660
  do { __p_retval = strOrNil(webkit_web_resource_get_mime_type(_self)); goto out; } while(0);
660
661
  out:
661
662
  return __p_retval;
@@ -667,7 +668,7 @@ WebResource_data(VALUE self)
667
668
  VALUE __p_retval = Qnil;
668
669
  WebKitWebResource *_self = ((WebKitWebResource*)RVAL2GOBJ(self));
669
670
 
670
- #line 182 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
671
+ #line 183 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
671
672
 
672
673
  do {
673
674
  GString * data =
@@ -687,7 +688,7 @@ WebResource_data_equals(VALUE self, VALUE data)
687
688
  WebKitWebResource *_self = ((WebKitWebResource*)RVAL2GOBJ(self));
688
689
  Check_Type(data, T_STRING);
689
690
 
690
- #line 186 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
691
+ #line 187 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
691
692
 
692
693
  do {
693
694
  GString * odata =
@@ -710,7 +711,7 @@ WebNetworkRequest_uri(VALUE self)
710
711
  VALUE __p_retval = Qnil;
711
712
  WebKitNetworkRequest *_self = ((WebKitNetworkRequest*)RVAL2GOBJ(self));
712
713
 
713
- #line 198 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
714
+ #line 199 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
714
715
  do { __p_retval = rb_str_new2(webkit_network_request_get_uri(_self)); goto out; } while(0);
715
716
  out:
716
717
  return __p_retval;
@@ -723,7 +724,7 @@ WebNetworkRequest_uri_equals(VALUE self, VALUE __v_uri)
723
724
  WebKitNetworkRequest *_self = ((WebKitNetworkRequest*)RVAL2GOBJ(self));
724
725
  __orig_uri = uri = ( NIL_P(__v_uri) ? NULL : StringValuePtr(__v_uri) );
725
726
 
726
- #line 201 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
727
+ #line 202 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
727
728
  webkit_network_request_set_uri(_self, uri);
728
729
 
729
730
  return __v_uri;
@@ -735,7 +736,7 @@ WebNetworkRequest_message(VALUE self)
735
736
  VALUE __p_retval = Qnil;
736
737
  WebKitNetworkRequest *_self = ((WebKitNetworkRequest*)RVAL2GOBJ(self));
737
738
 
738
- #line 204 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
739
+ #line 205 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
739
740
  do { __p_retval = GOBJ2RVAL(SOUP_MESSAGE(webkit_network_request_get_message(_self))); goto out; } while(0);
740
741
  out:
741
742
  return __p_retval;
@@ -747,7 +748,7 @@ WebNetworkResponse_uri(VALUE self)
747
748
  VALUE __p_retval = Qnil;
748
749
  WebKitNetworkResponse *_self = ((WebKitNetworkResponse*)RVAL2GOBJ(self));
749
750
 
750
- #line 211 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
751
+ #line 212 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
751
752
  do { __p_retval = rb_str_new2(webkit_network_response_get_uri(_self)); goto out; } while(0);
752
753
  out:
753
754
  return __p_retval;
@@ -760,7 +761,7 @@ WebNetworkResponse_uri_equals(VALUE self, VALUE __v_uri)
760
761
  WebKitNetworkResponse *_self = ((WebKitNetworkResponse*)RVAL2GOBJ(self));
761
762
  __orig_uri = uri = ( NIL_P(__v_uri) ? NULL : StringValuePtr(__v_uri) );
762
763
 
763
- #line 214 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
764
+ #line 215 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
764
765
  webkit_network_response_set_uri(_self, uri);
765
766
 
766
767
  return __v_uri;
@@ -772,7 +773,7 @@ WebNetworkResponse_message(VALUE self)
772
773
  VALUE __p_retval = Qnil;
773
774
  WebKitNetworkResponse *_self = ((WebKitNetworkResponse*)RVAL2GOBJ(self));
774
775
 
775
- #line 217 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
776
+ #line 218 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
776
777
  do { __p_retval = GOBJ2RVAL(SOUP_MESSAGE(webkit_network_response_get_message(_self))); goto out; } while(0);
777
778
  out:
778
779
  return __p_retval;
@@ -784,7 +785,7 @@ Download_initialize(VALUE self, VALUE __v_request)
784
785
  WebKitNetworkRequest * request; WebKitNetworkRequest * __orig_request;
785
786
  __orig_request = request = RVAL2GOBJ(__v_request);
786
787
 
787
- #line 224 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
788
+ #line 225 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
788
789
  RBGTK_INITIALIZE(self, webkit_download_new(request));
789
790
 
790
791
  return Qnil;
@@ -795,7 +796,7 @@ Download_start(VALUE self)
795
796
  {
796
797
  WebKitDownload *_self = ((WebKitDownload*)RVAL2GOBJ(self));
797
798
 
798
- #line 227 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
799
+ #line 228 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
799
800
  webkit_download_start(_self);
800
801
 
801
802
  return Qnil;
@@ -806,7 +807,7 @@ Download_cancel(VALUE self)
806
807
  {
807
808
  WebKitDownload *_self = ((WebKitDownload*)RVAL2GOBJ(self));
808
809
 
809
- #line 230 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
810
+ #line 231 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
810
811
  webkit_download_cancel(_self);
811
812
 
812
813
  return Qnil;
@@ -818,7 +819,7 @@ Download_progress(VALUE self)
818
819
  VALUE __p_retval = Qnil;
819
820
  WebKitDownload *_self = ((WebKitDownload*)RVAL2GOBJ(self));
820
821
 
821
- #line 233 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
822
+ #line 234 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
822
823
  do { __p_retval = rb_float_new(webkit_download_get_progress(_self)); goto out; } while(0);
823
824
  out:
824
825
  return __p_retval;
@@ -830,7 +831,7 @@ Download_current_size(VALUE self)
830
831
  VALUE __p_retval = Qnil;
831
832
  WebKitDownload *_self = ((WebKitDownload*)RVAL2GOBJ(self));
832
833
 
833
- #line 236 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
834
+ #line 237 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
834
835
  do { __p_retval = rb_ull2inum(webkit_download_get_current_size(_self)); goto out; } while(0);
835
836
  out:
836
837
  return __p_retval;
@@ -842,7 +843,7 @@ Download_total_size(VALUE self)
842
843
  VALUE __p_retval = Qnil;
843
844
  WebKitDownload *_self = ((WebKitDownload*)RVAL2GOBJ(self));
844
845
 
845
- #line 239 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
846
+ #line 240 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
846
847
  do { __p_retval = rb_ull2inum(webkit_download_get_total_size(_self)); goto out; } while(0);
847
848
  out:
848
849
  return __p_retval;
@@ -854,7 +855,7 @@ Download_uri(VALUE self)
854
855
  VALUE __p_retval = Qnil;
855
856
  WebKitDownload *_self = ((WebKitDownload*)RVAL2GOBJ(self));
856
857
 
857
- #line 242 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
858
+ #line 243 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
858
859
  do { __p_retval = rb_str_new2(webkit_download_get_uri(_self)); goto out; } while(0);
859
860
  out:
860
861
  return __p_retval;
@@ -866,7 +867,7 @@ Download_suggested_filename(VALUE self)
866
867
  VALUE __p_retval = Qnil;
867
868
  WebKitDownload *_self = ((WebKitDownload*)RVAL2GOBJ(self));
868
869
 
869
- #line 245 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
870
+ #line 246 "/home/geoff/Projects/gtk-webkit-ruby/ext/webkit/webkit.cr"
870
871
  do { __p_retval = rb_str_new2(webkit_download_get_suggested_filename(_self)); goto out; } while(0);
871
872
  out:
872
873
  return __p_retval;
@@ -13,6 +13,7 @@
13
13
 
14
14
  %{
15
15
  #include <intern.h>
16
+ #include <ruby.h>
16
17
  #include "javascript.h"
17
18
 
18
19
  static inline VALUE strOrNil(const char *str) {
@@ -0,0 +1,3 @@
1
+ require 'webkit.so'
2
+ require 'webkit/version'
3
+
@@ -0,0 +1,3 @@
1
+ module WebKit
2
+ BINDINGS_VERSION = "0.0.5"
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk-webkit-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-16 00:00:00.000000000 Z
12
+ date: 2013-01-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubber-generate
@@ -59,13 +59,15 @@ extensions:
59
59
  - ext/webkit/extconf.rb
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - ext/webkit/webkit.c
63
- - ext/webkit/javascript.h
64
62
  - ext/webkit/javascript-type-convert.h
63
+ - ext/webkit/javascript.h
64
+ - ext/webkit/webkit.c
65
65
  - ext/webkit/webkit.cr
66
66
  - ext/webkit/webkit.rd
67
67
  - Rakefile
68
68
  - README.md
69
+ - lib/webkit.rb
70
+ - lib/webkit/version.rb
69
71
  - ext/webkit/extconf.rb
70
72
  homepage: http://github.com/geoffyoungs/gtk-webkit-ruby
71
73
  licenses: []