gtk2 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. data/ChangeLog +52 -0
  2. data/ext/gtk2/extconf.rb +18 -9
  3. data/ext/gtk2/rbgdk.h +3 -0
  4. data/ext/gtk2/rbgdkdragcontext.c +4 -4
  5. data/ext/gtk2/rbgdkevent.c +18 -5
  6. data/ext/gtk2/rbgdkpixmap.c +43 -48
  7. data/ext/gtk2/rbgdkproperty.c +6 -5
  8. data/ext/gtk2/rbgdkscreen.c +18 -74
  9. data/ext/gtk2/rbgdkselection.c +2 -2
  10. data/ext/gtk2/rbgdkwindow.c +11 -18
  11. data/ext/gtk2/rbgdkwindowattr.c +1 -1
  12. data/ext/gtk2/rbgtkaccelgroup.c +1 -1
  13. data/ext/gtk2/rbgtkaction.c +8 -26
  14. data/ext/gtk2/rbgtkactiongroup.c +6 -6
  15. data/ext/gtk2/rbgtkadjustment.c +20 -74
  16. data/ext/gtk2/rbgtkbindingset.c +1 -1
  17. data/ext/gtk2/rbgtkbuilder.c +2 -1
  18. data/ext/gtk2/rbgtkbutton.c +1 -9
  19. data/ext/gtk2/rbgtkcalendar.c +1 -1
  20. data/ext/gtk2/rbgtkcellrendererspinner.c +0 -3
  21. data/ext/gtk2/rbgtkcellrenderertext.c +1 -2
  22. data/ext/gtk2/rbgtkcellview.c +6 -11
  23. data/ext/gtk2/rbgtkcolorselectiondialog.c +2 -28
  24. data/ext/gtk2/rbgtkcombo.c +2 -2
  25. data/ext/gtk2/rbgtkcombobox.c +9 -29
  26. data/ext/gtk2/rbgtkcontainer.c +1 -1
  27. data/ext/gtk2/rbgtkcurve.c +4 -2
  28. data/ext/gtk2/rbgtkdialog.c +2 -3
  29. data/ext/gtk2/rbgtkdrag.c +3 -3
  30. data/ext/gtk2/rbgtkentry.c +2 -2
  31. data/ext/gtk2/rbgtkentrycompletion.c +1 -4
  32. data/ext/gtk2/rbgtkfilechooser.c +32 -29
  33. data/ext/gtk2/rbgtkfilechooserdialog.c +8 -6
  34. data/ext/gtk2/rbgtkfilefilter.c +8 -4
  35. data/ext/gtk2/rbgtkframe.c +3 -4
  36. data/ext/gtk2/rbgtkhandlebox.c +0 -7
  37. data/ext/gtk2/rbgtkicontheme.c +4 -13
  38. data/ext/gtk2/rbgtkiconview.c +4 -15
  39. data/ext/gtk2/rbgtkimcontext.c +1 -1
  40. data/ext/gtk2/rbgtkinvisible.c +5 -21
  41. data/ext/gtk2/rbgtkitemfactory.c +3 -3
  42. data/ext/gtk2/rbgtklabel.c +0 -2
  43. data/ext/gtk2/rbgtklinkbutton.c +0 -2
  44. data/ext/gtk2/rbgtkmain.c +7 -10
  45. data/ext/gtk2/rbgtkmenu.c +22 -74
  46. data/ext/gtk2/rbgtkmenuitem.c +16 -55
  47. data/ext/gtk2/rbgtkmenushell.c +3 -11
  48. data/ext/gtk2/rbgtkmessagedialog.c +11 -20
  49. data/ext/gtk2/rbgtknotebook.c +0 -1
  50. data/ext/gtk2/rbgtkoptionmenu.c +1 -2
  51. data/ext/gtk2/rbgtkprintjob.c +1 -2
  52. data/ext/gtk2/rbgtkprintoperation.c +0 -2
  53. data/ext/gtk2/rbgtkradioaction.c +2 -7
  54. data/ext/gtk2/rbgtkradiobutton.c +1 -1
  55. data/ext/gtk2/rbgtkradiomenuitem.c +4 -6
  56. data/ext/gtk2/rbgtkradiotoolbutton.c +2 -4
  57. data/ext/gtk2/rbgtkrange.c +1 -2
  58. data/ext/gtk2/rbgtkrc.c +8 -9
  59. data/ext/gtk2/rbgtkrcstyle.c +2 -2
  60. data/ext/gtk2/rbgtkrecentaction.c +0 -1
  61. data/ext/gtk2/rbgtkrecentchooser.c +3 -3
  62. data/ext/gtk2/rbgtkrecentdata.c +2 -9
  63. data/ext/gtk2/rbgtkrecentfilter.c +2 -1
  64. data/ext/gtk2/rbgtkrecentfilterinfo.c +5 -16
  65. data/ext/gtk2/rbgtkrecentinfo.c +2 -2
  66. data/ext/gtk2/rbgtkrecentmanager.c +1 -2
  67. data/ext/gtk2/rbgtkruler.c +6 -16
  68. data/ext/gtk2/rbgtkscalebutton.c +16 -48
  69. data/ext/gtk2/rbgtkscrolledwindow.c +1 -1
  70. data/ext/gtk2/rbgtkselectiondata.c +10 -34
  71. data/ext/gtk2/rbgtksettings.c +1 -1
  72. data/ext/gtk2/rbgtkspinner.c +0 -3
  73. data/ext/gtk2/rbgtkstatusbar.c +5 -16
  74. data/ext/gtk2/rbgtkstatusicon.c +2 -9
  75. data/ext/gtk2/rbgtkstock.c +4 -4
  76. data/ext/gtk2/rbgtktable.c +8 -13
  77. data/ext/gtk2/rbgtktextattributes.c +0 -2
  78. data/ext/gtk2/rbgtktextbuffer.c +17 -16
  79. data/ext/gtk2/rbgtktextmark.c +7 -14
  80. data/ext/gtk2/rbgtktexttag.c +1 -2
  81. data/ext/gtk2/rbgtktextview.c +3 -4
  82. data/ext/gtk2/rbgtktoggleaction.c +5 -16
  83. data/ext/gtk2/rbgtktogglebutton.c +1 -2
  84. data/ext/gtk2/rbgtktoggletoolbutton.c +5 -16
  85. data/ext/gtk2/rbgtktoolbar.c +8 -31
  86. data/ext/gtk2/rbgtktoolitem.c +3 -1
  87. data/ext/gtk2/rbgtktreerowreference.c +4 -4
  88. data/ext/gtk2/rbgtktreesortable.c +0 -3
  89. data/ext/gtk2/rbgtktreestore.c +10 -7
  90. data/ext/gtk2/rbgtktreeview.c +5 -8
  91. data/ext/gtk2/rbgtktreeviewcolumn.c +13 -34
  92. data/ext/gtk2/rbgtkuimanager.c +2 -3
  93. data/ext/gtk2/rbgtkwidget.c +24 -44
  94. data/ext/gtk2/rbgtkwindow.c +32 -92
  95. data/lib/gtk2/base.rb +1 -1
  96. metadata +13 -13
@@ -21,7 +21,7 @@ gwin_initialize(int argc, VALUE *argv, VALUE self)
21
21
  {
22
22
  VALUE arg;
23
23
  GtkWindowType tp = GTK_WINDOW_TOPLEVEL;
24
- gchar* title = NULL;
24
+ const gchar *title = NULL;
25
25
  GtkWidget* window = NULL;
26
26
 
27
27
  if (rb_scan_args(argc, argv, "01", &arg) == 1) {
@@ -34,7 +34,7 @@ gwin_initialize(int argc, VALUE *argv, VALUE self)
34
34
  }
35
35
  window = gtk_window_new(tp);
36
36
 
37
- if (title)
37
+ if (title != NULL)
38
38
  gtk_window_set_title(GTK_WINDOW(window), title);
39
39
 
40
40
  RBGTK_INITIALIZE(self, window);
@@ -114,32 +114,15 @@ gwin_set_geometry_hints(VALUE self, VALUE geometry_widget, VALUE geometry, VALUE
114
114
  return self;
115
115
  }
116
116
 
117
- static VALUE
118
- gwin_set_gravity(VALUE self, VALUE gravity)
119
- {
120
- gtk_window_set_gravity(_SELF(self), RVAL2GENUM(gravity, GDK_TYPE_GRAVITY));
121
- return self;
122
- }
123
-
124
- static VALUE
125
- gwin_get_gravity(VALUE self)
126
- {
127
- return GENUM2RVAL(gtk_window_get_gravity(_SELF(self)), GDK_TYPE_GRAVITY);
128
- }
129
-
130
- static VALUE
131
- gwin_set_transient_for(VALUE self, VALUE parent)
132
- {
133
- gtk_window_set_transient_for(_SELF(self), _SELF(parent));
134
- return self;
135
- }
136
-
137
- static VALUE
138
- gwin_set_destroy_with_parent(VALUE self, VALUE setting)
139
- {
140
- gtk_window_set_destroy_with_parent(_SELF(self), RVAL2CBOOL(setting));
141
- return self;
142
- }
117
+ /* Defined as Properties:
118
+ void gtk_window_set_gravity (GtkWindow *window,
119
+ GdkGravity gravity);
120
+ GdkGravity gtk_window_get_gravity (GtkWindow *window);
121
+ void gtk_window_set_transient_for (GtkWindow *window,
122
+ GtkWindow *parent);
123
+ void gtk_window_set_destroy_with_parent (GtkWindow *window,
124
+ gboolean setting);
125
+ */
143
126
 
144
127
  /* Define as Properties.
145
128
  void gtk_window_set_screen (GtkWindow *window,
@@ -313,12 +296,10 @@ gwin_begin_move_drag(VALUE self, VALUE button, VALUE root_x, VALUE root_y, VALUE
313
296
  return self;
314
297
  }
315
298
 
316
- static VALUE
317
- gwin_set_decorated(VALUE self, VALUE setting)
318
- {
319
- gtk_window_set_decorated(_SELF(self), RVAL2CBOOL(setting));
320
- return self;
321
- }
299
+ /* Defined as Properties:
300
+ void gtk_window_set_decorated (GtkWindow *window,
301
+ gboolean setting);
302
+ */
322
303
 
323
304
  static VALUE
324
305
  gwin_set_frame_dimensions(VALUE self, VALUE left, VALUE top, VALUE right, VALUE bottom)
@@ -344,20 +325,11 @@ gwin_set_mnemonic_modifier(VALUE self, VALUE modifier)
344
325
  return self;
345
326
  }
346
327
 
347
- static VALUE
348
- gwin_set_role(VALUE self, VALUE role)
349
- {
350
- gtk_window_set_role(_SELF(self), RVAL2CSTR(role));
351
- return self;
352
- }
353
-
354
- static VALUE
355
- gwin_set_type_hint(VALUE self, VALUE hint)
356
- {
357
- gtk_window_set_type_hint(_SELF(self), RVAL2GENUM(hint, GDK_TYPE_WINDOW_TYPE_HINT));
358
- return self;
359
- }
360
328
  /* Defined as Properties
329
+ void gtk_window_set_decorated (GtkWindow *window,
330
+ gboolean setting);
331
+ void gtk_window_set_type_hint (GtkWindow *window,
332
+ GdkWindowTypeHint hint);
361
333
  void gtk_window_set_skip_taskbar_hint
362
334
  (GtkWindow *window,
363
335
  gboolean setting);
@@ -381,15 +353,10 @@ gboolean gtk_window_get_deletable (GtkWindow *window);
381
353
 
382
354
  void gtk_window_set_deletable (GtkWindow *window,
383
355
  gboolean setting);
356
+ gboolean gtk_window_get_decorated (GtkWindow *window);
384
357
  */
385
358
 
386
359
 
387
- static VALUE
388
- gwin_get_decorated(VALUE self)
389
- {
390
- return CBOOL2RVAL(gtk_window_get_decorated(_SELF(self)));
391
- }
392
-
393
360
  static VALUE
394
361
  gwin_s_get_default_icon_list(VALUE self)
395
362
  {
@@ -404,11 +371,9 @@ gwin_get_default_size(VALUE self)
404
371
  return rb_ary_new3(2, INT2NUM(width), INT2NUM(height));
405
372
  }
406
373
 
407
- static VALUE
408
- gwin_get_destroy_with_parent(VALUE self)
409
- {
410
- return gtk_window_get_destroy_with_parent(_SELF(self)) ? Qtrue : Qfalse;
411
- }
374
+ /* Defined as Properties:
375
+ gboolean gtk_window_get_destroy_with_parent (GtkWindow *window);
376
+ */
412
377
 
413
378
  static VALUE
414
379
  gwin_get_frame_dimensions(VALUE self)
@@ -448,12 +413,11 @@ gwin_get_position(VALUE self)
448
413
  return rb_ary_new3(2, INT2NUM(root_x), INT2NUM(root_y));
449
414
  }
450
415
 
451
- static VALUE
452
- gwin_get_role(VALUE self)
453
- {
454
- const gchar* role = gtk_window_get_role(_SELF(self));
455
- return role ? CSTR2RVAL(role) : Qnil;
456
- }
416
+ /* Defined as Properties:
417
+ const gchar * gtk_window_get_role (GtkWindow *window);
418
+ GtkWindow * gtk_window_get_transient_for (GtkWindow *window);
419
+ GdkWindowTypeHint gtk_window_get_type_hint (GtkWindow *window);
420
+ */
457
421
 
458
422
  static VALUE
459
423
  gwin_get_size(VALUE self)
@@ -463,19 +427,6 @@ gwin_get_size(VALUE self)
463
427
  return rb_ary_new3(2, INT2NUM(width), INT2NUM(height));
464
428
  }
465
429
 
466
- static VALUE
467
- gwin_get_transient_for(VALUE self)
468
- {
469
- GtkWindow* window = gtk_window_get_transient_for(_SELF(self));
470
- return window ? GOBJ2RVAL(window) : Qnil;
471
- }
472
-
473
- static VALUE
474
- gwin_get_type_hint(VALUE self)
475
- {
476
- return GENUM2RVAL(gtk_window_get_type_hint(_SELF(self)), GDK_TYPE_WINDOW_TYPE_HINT);
477
- }
478
-
479
430
  #if GTK_CHECK_VERSION(2,10,0)
480
431
  static VALUE
481
432
  gwin_get_group(VALUE self)
@@ -588,6 +539,7 @@ gwin_set_icon_list(VALUE self, VALUE list)
588
539
  g_list_free(glist);
589
540
  return list;
590
541
  }
542
+
591
543
  #if GTK_CHECK_VERSION(2,2,0)
592
544
  static VALUE
593
545
  gwin_s_set_auto_startup_notification(VALUE self, VALUE setting)
@@ -650,14 +602,10 @@ Init_gtk_window()
650
602
  /* active_(focus|default) are deprecated. Use activate_* instead. */
651
603
  rb_define_method(gWindow, "active_focus", gwin_active_focus, 0);
652
604
  rb_define_method(gWindow, "active_default", gwin_active_default, 0);
653
- rb_define_method(gWindow, "activate_focus", gwin_activate_focus, 0);
654
- rb_define_method(gWindow, "activate_default", gwin_activate_default, 0);
605
+ G_REPLACE_ACTION(gWindow, "activate_focus", gwin_activate_focus, 0);
606
+ G_REPLACE_ACTION(gWindow, "activate_default", gwin_activate_default, 0);
655
607
  rb_define_method(gWindow, "set_default_size", gwin_set_default_size, 2);
656
608
  rb_define_method(gWindow, "set_geometry_hints", gwin_set_geometry_hints, 3);
657
- rb_define_method(gWindow, "set_gravity", gwin_set_gravity, 1);
658
- rb_define_method(gWindow, "gravity", gwin_get_gravity, 0);
659
- rb_define_method(gWindow, "set_transient_for", gwin_set_transient_for, 1);
660
- rb_define_method(gWindow, "set_destroy_with_parent", gwin_set_destroy_with_parent, 1);
661
609
  rb_define_singleton_method(gWindow, "toplevels", gwin_s_list_toplevels, 0);
662
610
  rb_define_method(gWindow, "add_mnemonic", gwin_add_mnemonic, 2);
663
611
  rb_define_method(gWindow, "remove_mnemonic", gwin_remove_mnemonic, 2);
@@ -686,25 +634,17 @@ Init_gtk_window()
686
634
  #endif
687
635
  rb_define_method(gWindow, "begin_resize_drag", gwin_begin_resize_drag, 5);
688
636
  rb_define_method(gWindow, "begin_move_drag", gwin_begin_move_drag, 4);
689
- rb_define_method(gWindow, "set_decorated", gwin_set_decorated, 1);
690
637
  rb_define_method(gWindow, "set_frame_dimensions", gwin_set_frame_dimensions, 4);
691
638
  rb_define_method(gWindow, "set_mnemonic_modifier", gwin_set_mnemonic_modifier, 1);
692
- rb_define_method(gWindow, "set_role", gwin_set_role, 1);
693
- rb_define_method(gWindow, "set_type_hint", gwin_set_type_hint, 1);
694
- rb_define_method(gWindow, "decorated?", gwin_get_decorated, 0);
695
639
  rb_define_method(gWindow, "default_size", gwin_get_default_size, 0);
696
640
  rb_define_singleton_method(gWindow, "default_icon_list", gwin_s_get_default_icon_list, 0);
697
- rb_define_method(gWindow, "destroy_with_parent?", gwin_get_destroy_with_parent, 0);
698
641
  rb_define_method(gWindow, "frame_dimensions", gwin_get_frame_dimensions, 0);
699
642
  rb_define_method(gWindow, "set_has_frame", gwin_set_has_frame, 1);
700
643
  rb_define_method(gWindow, "has_frame?", gwin_get_has_frame, 0);
701
644
  rb_define_method(gWindow, "icon_list", gwin_get_icon_list, 0);
702
645
  rb_define_method(gWindow, "mnemonic_modifier", gwin_get_mnemonic_modifier, 0);
703
646
  rb_define_method(gWindow, "position", gwin_get_position, 0);
704
- rb_define_method(gWindow, "role", gwin_get_role, 0);
705
647
  rb_define_method(gWindow, "size", gwin_get_size, 0);
706
- rb_define_method(gWindow, "transient_for", gwin_get_transient_for, 0);
707
- rb_define_method(gWindow, "type_hint", gwin_get_type_hint, 0);
708
648
  #if GTK_CHECK_VERSION(2,10,0)
709
649
  rb_define_method(gWindow, "group", gwin_get_group, 0);
710
650
  #endif
@@ -719,7 +659,7 @@ Init_gtk_window()
719
659
  #if GTK_CHECK_VERSION(2,6,0)
720
660
  rb_define_singleton_method(gWindow, "set_default_icon_name", gwin_s_set_default_icon_name, 1);
721
661
  #endif
722
- rb_define_method(gWindow, "set_icon", gwin_set_icon, 1);
662
+ G_REPLACE_SET_PROPERTY(gWindow, "icon", gwin_set_icon, 1);
723
663
  rb_define_method(gWindow, "set_icon_list", gwin_set_icon_list, 1);
724
664
  #if GTK_CHECK_VERSION(2,2,0)
725
665
  rb_define_singleton_method(gWindow, "set_auto_startup_notification",
@@ -19,7 +19,7 @@ vendor_dir = base_dir + "vendor" + "local"
19
19
  vendor_bin_dir = vendor_dir + "bin"
20
20
  GLib.prepend_environment_path(vendor_bin_dir)
21
21
  begin
22
- major, minor, micro, = RUBY_VERSION.split(/\./)
22
+ major, minor, _ = RUBY_VERSION.split(/\./)
23
23
  require "#{major}.#{minor}/gtk2.so"
24
24
  rescue LoadError
25
25
  require "gtk2.so"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtk2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - The Ruby-GNOME2 Proejct Team
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-13 00:00:00 Z
18
+ date: 2011-09-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: atk
@@ -25,12 +25,12 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- hash: 23
28
+ hash: 21
29
29
  segments:
30
30
  - 1
31
31
  - 0
32
- - 0
33
- version: 1.0.0
32
+ - 1
33
+ version: 1.0.1
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  - !ruby/object:Gem::Dependency
@@ -41,12 +41,12 @@ dependencies:
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- hash: 23
44
+ hash: 21
45
45
  segments:
46
46
  - 1
47
47
  - 0
48
- - 0
49
- version: 1.0.0
48
+ - 1
49
+ version: 1.0.1
50
50
  type: :runtime
51
51
  version_requirements: *id002
52
52
  - !ruby/object:Gem::Dependency
@@ -57,12 +57,12 @@ dependencies:
57
57
  requirements:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- hash: 23
60
+ hash: 21
61
61
  segments:
62
62
  - 1
63
63
  - 0
64
- - 0
65
- version: 1.0.0
64
+ - 1
65
+ version: 1.0.1
66
66
  type: :runtime
67
67
  version_requirements: *id003
68
68
  description: Ruby/GTK2 is a Ruby binding of GTK+-2.x.