ruby-libnotify 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS.rdoc +0 -0
- data/CHANGELOG.rdoc +4 -0
- data/COPYING +0 -0
- data/README.rdoc +1 -1
- data/doc/Notify.html +392 -392
- data/doc/Notify/Notification.html +819 -770
- data/doc/created.rid +3 -3
- data/doc/ext/rnotify_c.html +38 -38
- data/doc/index.html +80 -78
- data/doc/lib/RNotify_rb.html +46 -42
- data/doc/rdoc.css +365 -308
- data/examples/action.rb +1 -1
- data/examples/base.rb +1 -1
- data/examples/info.rb +1 -1
- data/examples/markup.rb +1 -1
- data/examples/multi-actions.rb +1 -1
- data/examples/update.rb +1 -1
- data/examples/urgency.rb +1 -1
- data/examples/xy.rb +1 -1
- data/ext/extconf.rb +25 -24
- data/ext/rnotify.c +39 -8
- data/lib/RNotify.rb +2 -2
- data/setup.rb +0 -0
- metadata +58 -62
data/examples/action.rb
CHANGED
data/examples/base.rb
CHANGED
data/examples/info.rb
CHANGED
data/examples/markup.rb
CHANGED
data/examples/multi-actions.rb
CHANGED
data/examples/update.rb
CHANGED
data/examples/urgency.rb
CHANGED
data/examples/xy.rb
CHANGED
data/ext/extconf.rb
CHANGED
@@ -8,23 +8,18 @@ type=1, RELEASE
|
|
8
8
|
require 'rubygems'
|
9
9
|
|
10
10
|
begin
|
11
|
-
require '
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
require 'mkmf-gnome2'
|
12
|
+
require 'gtk2'
|
13
|
+
rescue
|
14
|
+
puts "ERROR: missing packages, please install Ruby/Gtk2 and its dependencies",
|
15
|
+
"[ http://ruby-gnome2.sourceforge.jp/ ]"
|
16
16
|
end
|
17
17
|
|
18
18
|
$preload = nil
|
19
19
|
type = 1
|
20
20
|
|
21
|
-
def find_gtk2_rb
|
22
|
-
(File.exist?("#{Config::CONFIG["sitelibdir"]}/gtk2.rb") ||
|
23
|
-
File.exist?("#{Config::CONFIG["rubylibdir"]}/gtk2.rb"))
|
24
|
-
end
|
25
|
-
|
26
21
|
def check_set_app_name_libnotify
|
27
|
-
if
|
22
|
+
if check_required_version("libnotify", 0, 7, 2) == true
|
28
23
|
$CFLAGS << ' -DHAVE_SET_APP_NAME'
|
29
24
|
puts "with set application name.. yes"
|
30
25
|
else
|
@@ -32,25 +27,31 @@ def check_set_app_name_libnotify
|
|
32
27
|
end
|
33
28
|
end
|
34
29
|
|
30
|
+
def check_set_notification_name_libnotify
|
31
|
+
if check_required_version("libnotify", 0, 7, 3) == true
|
32
|
+
$CFLAGS << ' -DHAVE_SET_APP_PNAME'
|
33
|
+
puts "with set notification name.. yes"
|
34
|
+
else
|
35
|
+
puts "with set notification name.. no"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
35
39
|
def check_required_version(app, maj, min, mic)
|
36
40
|
PKGConfig.check_version?(app, maj, min, mic)
|
37
41
|
end
|
38
42
|
|
39
43
|
if check_required_version("libnotify", 0, 7, 0) == true
|
40
|
-
if
|
41
|
-
if
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
else
|
48
|
-
puts "ERROR: please install libnotify",
|
49
|
-
"[ http://www.galago-project.org/ ]"
|
50
|
-
end
|
44
|
+
if have_library("notify", "notify_init") == true
|
45
|
+
$CFLAGS << ' -DDEBUG' if type == 0
|
46
|
+
$CFLAGS << ' -Wall' << " -I#{Config::CONFIG["sitearchdir"]} " << PKGConfig.cflags("libnotify")
|
47
|
+
$LIBS << ' ' << PKGConfig.libs("libnotify")
|
48
|
+
check_set_app_name_libnotify
|
49
|
+
check_set_notification_name_libnotify
|
50
|
+
create_makefile("rnotify")
|
51
51
|
else
|
52
|
-
|
53
|
-
|
52
|
+
puts "ERROR: please install libnotify",
|
53
|
+
"[ http://ftp.gnome.org/pub/GNOME/sources/libnotify ]",
|
54
|
+
"[ http://www.galago-project.org/ ]"
|
54
55
|
end
|
55
56
|
else
|
56
57
|
puts "libnotify >= 0.7.0 is required in order to use this release."
|
data/ext/rnotify.c
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
// rnotify.c
|
3
3
|
//
|
4
4
|
// Luca Russo <vargolo@gmail.com>
|
5
|
-
// Copyright (LGPL) 2006 -
|
5
|
+
// Copyright (LGPL) 2006 - 2012
|
6
6
|
//
|
7
7
|
|
8
8
|
#include <libnotify/notify.h>
|
@@ -36,7 +36,10 @@ static void
|
|
36
36
|
_notification_action_free(ActionData *data)
|
37
37
|
{
|
38
38
|
if(data != NULL)
|
39
|
+
{
|
39
40
|
g_free(data);
|
41
|
+
data = NULL;
|
42
|
+
}
|
40
43
|
}
|
41
44
|
|
42
45
|
static void
|
@@ -63,7 +66,7 @@ _wrap_alloc_free(VALUE self)
|
|
63
66
|
* Returns TRUE if the library initialized properly, FALSE otherwise
|
64
67
|
*/
|
65
68
|
static VALUE
|
66
|
-
_wrap_notify_init(VALUE self, VALUE app_name)
|
69
|
+
_wrap_notify_init(VALUE UNUSED(self), VALUE app_name)
|
67
70
|
{
|
68
71
|
gboolean init;
|
69
72
|
char *name = NIL_P(app_name) ? NULL : StringValuePtr(app_name);
|
@@ -87,7 +90,7 @@ _wrap_notify_init(VALUE self, VALUE app_name)
|
|
87
90
|
* Deinitialize libnotify, you must to call this before quit the program
|
88
91
|
*/
|
89
92
|
static VALUE
|
90
|
-
_wrap_notify_uninit(VALUE self)
|
93
|
+
_wrap_notify_uninit(VALUE UNUSED(self))
|
91
94
|
{
|
92
95
|
notify_uninit();
|
93
96
|
|
@@ -101,7 +104,7 @@ _wrap_notify_uninit(VALUE self)
|
|
101
104
|
* Returns TRUE if libnotify is inizialized, FALSE otherwise
|
102
105
|
*/
|
103
106
|
static VALUE
|
104
|
-
_wrap_notify_is_initted(VALUE self)
|
107
|
+
_wrap_notify_is_initted(VALUE UNUSED(self))
|
105
108
|
{
|
106
109
|
if(notify_is_initted())
|
107
110
|
return Qtrue;
|
@@ -116,7 +119,7 @@ _wrap_notify_is_initted(VALUE self)
|
|
116
119
|
* Returns the application name passed to Notify.init
|
117
120
|
*/
|
118
121
|
static VALUE
|
119
|
-
_wrap_notify_get_app_name(VALUE self)
|
122
|
+
_wrap_notify_get_app_name(VALUE UNUSED(self))
|
120
123
|
{
|
121
124
|
const gchar *name = notify_get_app_name();
|
122
125
|
|
@@ -134,7 +137,7 @@ _wrap_notify_get_app_name(VALUE self)
|
|
134
137
|
* ** ONLY WHEN COMPILED AGAINST LIBNOTIFY >= 0.7.2 **
|
135
138
|
*/
|
136
139
|
static VALUE
|
137
|
-
_wrap_notify_set_app_name(VALUE self, VALUE app_name)
|
140
|
+
_wrap_notify_set_app_name(VALUE UNUSED(self), VALUE app_name)
|
138
141
|
{
|
139
142
|
char *name = NIL_P(app_name) ? NULL : StringValuePtr(app_name);
|
140
143
|
|
@@ -152,7 +155,7 @@ _wrap_notify_set_app_name(VALUE self, VALUE app_name)
|
|
152
155
|
* Queries the server for its capabilities and returns them in an Array
|
153
156
|
*/
|
154
157
|
static VALUE
|
155
|
-
_wrap_notify_get_server_caps(VALUE self)
|
158
|
+
_wrap_notify_get_server_caps(VALUE UNUSED(self))
|
156
159
|
{
|
157
160
|
GList *caps = NULL;
|
158
161
|
VALUE rb_caps;
|
@@ -190,7 +193,7 @@ _wrap_notify_get_server_caps(VALUE self)
|
|
190
193
|
* p h[:spec_version] #print the specification version supported
|
191
194
|
*/
|
192
195
|
static VALUE
|
193
|
-
_wrap_notify_get_server_info(VALUE self)
|
196
|
+
_wrap_notify_get_server_info(VALUE UNUSED(self))
|
194
197
|
{
|
195
198
|
gchar *serv_name = NULL,
|
196
199
|
*vendor = NULL,
|
@@ -254,6 +257,29 @@ _wrap_notification_init(VALUE self, VALUE summ, VALUE msg, VALUE icon)
|
|
254
257
|
return self;
|
255
258
|
}
|
256
259
|
|
260
|
+
#ifdef HAVE_SET_APP_PNAME
|
261
|
+
/*
|
262
|
+
* call-seq:
|
263
|
+
* name= new_name
|
264
|
+
*
|
265
|
+
* if new_name is a valid string, sets the application name for the notification.
|
266
|
+
* otherwise nothing will be changed
|
267
|
+
*
|
268
|
+
* ** ONLY WHEN COMPILED AGAINST LIBNOTIFY >= 0.7.3 **
|
269
|
+
*/
|
270
|
+
static VALUE
|
271
|
+
_wrap_notification_set_app_pname(VALUE self, VALUE notification_name)
|
272
|
+
{
|
273
|
+
NotifyNotification *n = NOTIFY_NOTIFICATION(RVAL2GOBJ(self));
|
274
|
+
char *name = NIL_P(notification_name) ? NULL : StringValuePtr(notification_name);
|
275
|
+
|
276
|
+
if(name != NULL || *name != '\0')
|
277
|
+
notify_notification_set_app_name(n, name);
|
278
|
+
|
279
|
+
return Qnil;
|
280
|
+
}
|
281
|
+
#endif
|
282
|
+
|
257
283
|
/*
|
258
284
|
* call-seq:
|
259
285
|
* update(summ, msg, icon)
|
@@ -697,11 +723,13 @@ _wrap_notification_get_closed_reason(VALUE self)
|
|
697
723
|
|
698
724
|
/*
|
699
725
|
* libnotify ruby interface
|
726
|
+
* [ http://ftp.gnome.org/pub/GNOME/sources/libnotify ]
|
700
727
|
* [ http://www.galago-project.org ]
|
701
728
|
*/
|
702
729
|
void
|
703
730
|
Init_rnotify()
|
704
731
|
{
|
732
|
+
g_type_init();
|
705
733
|
VALUE mNotify = rb_define_module(MODULE_NAME);
|
706
734
|
VALUE cNotification = G_DEF_CLASS2(NOTIFY_TYPE_NOTIFICATION, CLASS_NAME, mNotify,
|
707
735
|
0, _wrap_alloc_free);
|
@@ -723,6 +751,9 @@ Init_rnotify()
|
|
723
751
|
rb_define_module_function(mNotify, "server_info", _wrap_notify_get_server_info, 0);
|
724
752
|
|
725
753
|
rb_define_method(cNotification, "initialize", _wrap_notification_init, 3);
|
754
|
+
#ifdef HAVE_SET_APP_PNAME
|
755
|
+
rb_define_method(cNotification, "name=", _wrap_notification_set_app_pname, 1);
|
756
|
+
#endif
|
726
757
|
rb_define_method(cNotification, "update", _wrap_notification_update, 3);
|
727
758
|
rb_define_method(cNotification, "show", _wrap_notification_show, 0);
|
728
759
|
rb_define_method(cNotification, "timeout=", _wrap_notification_set_timeout, 1);
|
data/lib/RNotify.rb
CHANGED
data/setup.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,113 +1,109 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-libnotify
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.1
|
4
5
|
prerelease:
|
5
|
-
version: 0.5.0
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Luca Russo
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-11-24 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: pkg-config
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
20
17
|
none: false
|
21
|
-
requirements:
|
22
|
-
- -
|
23
|
-
- !ruby/object:Gem::Version
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
24
21
|
version: 1.0.7
|
25
22
|
type: :runtime
|
26
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.0.7
|
27
30
|
description:
|
28
31
|
email: vargolo@gmail.com
|
29
32
|
executables: []
|
30
|
-
|
31
|
-
extensions:
|
33
|
+
extensions:
|
32
34
|
- ext/extconf.rb
|
33
35
|
extra_rdoc_files: []
|
34
|
-
|
35
|
-
|
36
|
-
- doc/
|
37
|
-
- doc/created.rid
|
38
|
-
- doc/Notify/Notification.html
|
39
|
-
- doc/lib/RNotify_rb.html
|
40
|
-
- doc/index.html
|
41
|
-
- doc/js/thickbox-compressed.js
|
36
|
+
files:
|
37
|
+
- doc/rdoc.css
|
38
|
+
- doc/js/jquery.js
|
42
39
|
- doc/js/darkfish.js
|
43
40
|
- doc/js/quicksearch.js
|
44
|
-
- doc/js/
|
41
|
+
- doc/js/thickbox-compressed.js
|
45
42
|
- doc/Notify.html
|
46
|
-
- doc/
|
47
|
-
- doc/images/find.png
|
48
|
-
- doc/images/plugin.png
|
49
|
-
- doc/images/bug.png
|
43
|
+
- doc/images/page_white_text.png
|
50
44
|
- doc/images/bullet_toggle_plus.png
|
45
|
+
- doc/images/bullet_toggle_minus.png
|
46
|
+
- doc/images/macFFBgHack.png
|
47
|
+
- doc/images/date.png
|
48
|
+
- doc/images/page_green.png
|
49
|
+
- doc/images/find.png
|
51
50
|
- doc/images/loadingAnimation.gif
|
51
|
+
- doc/images/bug.png
|
52
|
+
- doc/images/zoom.png
|
53
|
+
- doc/images/package.png
|
52
54
|
- doc/images/wrench.png
|
53
|
-
- doc/images/
|
54
|
-
- doc/images/page_white_text.png
|
55
|
+
- doc/images/plugin.png
|
55
56
|
- doc/images/tag_green.png
|
56
|
-
- doc/images/
|
57
|
+
- doc/images/brick.png
|
58
|
+
- doc/images/bullet_black.png
|
59
|
+
- doc/images/ruby.png
|
57
60
|
- doc/images/wrench_orange.png
|
58
|
-
- doc/images/macFFBgHack.png
|
59
61
|
- doc/images/brick_link.png
|
60
62
|
- doc/images/page_white_width.png
|
61
|
-
- doc/
|
62
|
-
- doc/
|
63
|
-
- doc/
|
64
|
-
- doc/
|
65
|
-
- doc/
|
66
|
-
- doc/images/page_green.png
|
67
|
-
- examples/multi-actions.rb
|
63
|
+
- doc/lib/RNotify_rb.html
|
64
|
+
- doc/ext/rnotify_c.html
|
65
|
+
- doc/Notify/Notification.html
|
66
|
+
- doc/created.rid
|
67
|
+
- doc/index.html
|
68
68
|
- examples/markup.rb
|
69
|
-
- examples/action.rb
|
70
69
|
- examples/base.rb
|
70
|
+
- examples/action.rb
|
71
|
+
- examples/urgency.rb
|
71
72
|
- examples/update.rb
|
72
|
-
- examples/info.rb
|
73
73
|
- examples/icon.png
|
74
|
+
- examples/multi-actions.rb
|
74
75
|
- examples/xy.rb
|
75
|
-
- examples/
|
76
|
+
- examples/info.rb
|
76
77
|
- lib/RNotify.rb
|
77
|
-
- ext/extconf.rb
|
78
78
|
- ext/rnotify.c
|
79
|
+
- ext/extconf.rb
|
79
80
|
- AUTHORS.rdoc
|
80
81
|
- CHANGELOG.rdoc
|
81
82
|
- COPYING
|
82
83
|
- README.rdoc
|
83
84
|
- setup.rb
|
84
|
-
has_rdoc: true
|
85
85
|
homepage: http://github.com/vargolo/ruby-libnotify
|
86
86
|
licenses: []
|
87
|
-
|
88
87
|
post_install_message:
|
89
88
|
rdoc_options: []
|
90
|
-
|
91
|
-
require_paths:
|
89
|
+
require_paths:
|
92
90
|
- lib
|
93
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
92
|
none: false
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
version:
|
99
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
98
|
none: false
|
101
|
-
requirements:
|
102
|
-
- -
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
version:
|
99
|
+
requirements:
|
100
|
+
- - ! '>='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
105
103
|
requirements: []
|
106
|
-
|
107
104
|
rubyforge_project:
|
108
|
-
rubygems_version: 1.
|
105
|
+
rubygems_version: 1.8.23
|
109
106
|
signing_key:
|
110
107
|
specification_version: 3
|
111
108
|
summary: ruby-libnotify is a ruby binding for libnotify
|
112
109
|
test_files: []
|
113
|
-
|