uh 2.0.0.pre → 2.0.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/uh/uh.c +3 -0
- data/ext/uh/uh.h +3 -0
- data/ext/uh/window.c +31 -0
- data/lib/uh/display.rb +4 -0
- data/lib/uh/version.rb +1 -1
- data/lib/uh/window.rb +4 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fc046078c7d4c3b9c91826b14cacb8c114820ae
|
4
|
+
data.tar.gz: 7f0f09757ee40f4c5dc5f8f303a6bee3f8fb342e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7d9e2e8aa2a75f4332e2a17851f651ae1759336c0aaa88f216f7290d8d9dd2b2756e13a2e08b271d19b034163eb3044791e60560202fe3b301fa674d83ccd4a
|
7
|
+
data.tar.gz: c61bc88493bdf8d047f5b88a6d47b91ef034eb9fb54b01954aaa706c00b6358062bf91c7abcf1f3c6babb539306bc7a4ae0240f3884d80232fc996633c469c48
|
data/ext/uh/uh.c
CHANGED
@@ -123,8 +123,10 @@ void uh_window() {
|
|
123
123
|
rb_define_method(cWindow, "focus", window_focus, 0);
|
124
124
|
rb_define_method(cWindow, "kill", window_kill, 0);
|
125
125
|
rb_define_method(cWindow, "map", window_map, 0);
|
126
|
+
rb_define_method(cWindow, "mask", window_mask, 0);
|
126
127
|
rb_define_method(cWindow, "mask=", window_mask_set, 1);
|
127
128
|
rb_define_method(cWindow, "name", window_name, 0);
|
129
|
+
rb_define_method(cWindow, "name=", window_name_set, 1);
|
128
130
|
rb_define_method(cWindow, "override_redirect?", window_override_redirect, 0);
|
129
131
|
rb_define_method(cWindow, "raise", window_raise, 0);
|
130
132
|
rb_define_method(cWindow, "unmap", window_unmap, 0);
|
@@ -134,6 +136,7 @@ void uh_window() {
|
|
134
136
|
rb_define_private_method(cWindow, "_configure", window__configure, 4);
|
135
137
|
rb_define_private_method(cWindow, "_configure_event",
|
136
138
|
window__configure_event, 4);
|
139
|
+
rb_define_private_method(cWindow, "_create", window__create, 4);
|
137
140
|
rb_define_private_method(cWindow, "_create_sub", window__create_sub, 4);
|
138
141
|
rb_define_private_method(cWindow, "_moveresize", window__moveresize, 4);
|
139
142
|
}
|
data/ext/uh/uh.h
CHANGED
@@ -85,14 +85,17 @@ VALUE window_icccm_wm_delete(VALUE self);
|
|
85
85
|
VALUE window_icccm_wm_protocols(VALUE self);
|
86
86
|
VALUE window_kill(VALUE self);
|
87
87
|
VALUE window_map(VALUE self);
|
88
|
+
VALUE window_mask(VALUE self);
|
88
89
|
VALUE window_mask_set(VALUE self, VALUE mask);
|
89
90
|
VALUE window_name(VALUE self);
|
91
|
+
VALUE window_name_set(VALUE self, VALUE name);
|
90
92
|
VALUE window_override_redirect(VALUE self);
|
91
93
|
VALUE window_raise(VALUE self);
|
92
94
|
VALUE window_unmap(VALUE self);
|
93
95
|
VALUE window_wclass(VALUE self);
|
94
96
|
VALUE window__configure(VALUE self, VALUE rx, VALUE ry, VALUE rw, VALUE rh);
|
95
97
|
VALUE window__configure_event(VALUE self, VALUE rx, VALUE ry, VALUE rw, VALUE rh);
|
98
|
+
VALUE window__create(VALUE self, VALUE x, VALUE y, VALUE w, VALUE h);
|
96
99
|
VALUE window__create_sub(VALUE self, VALUE x, VALUE y, VALUE w, VALUE h);
|
97
100
|
VALUE window__moveresize(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height);
|
98
101
|
int window_id(VALUE window);
|
data/ext/uh/window.c
CHANGED
@@ -68,6 +68,17 @@ VALUE window_map(VALUE self) {
|
|
68
68
|
return Qnil;
|
69
69
|
}
|
70
70
|
|
71
|
+
VALUE window_mask(VALUE self) {
|
72
|
+
XWindowAttributes wa;
|
73
|
+
SET_WINDOW(self);
|
74
|
+
|
75
|
+
if (!XGetWindowAttributes(DPY, WINDOW, &wa)) {
|
76
|
+
rb_raise(rb_eArgError, "cannot get window attributes for `0x%08lx'", WINDOW);
|
77
|
+
}
|
78
|
+
|
79
|
+
return LONG2FIX(wa.your_event_mask);
|
80
|
+
}
|
81
|
+
|
71
82
|
VALUE window_mask_set(VALUE self, VALUE mask) {
|
72
83
|
XSetWindowAttributes attrs;
|
73
84
|
SET_WINDOW(self);
|
@@ -92,6 +103,14 @@ VALUE window_name(VALUE self) {
|
|
92
103
|
return wname;
|
93
104
|
}
|
94
105
|
|
106
|
+
VALUE window_name_set(VALUE self, VALUE name) {
|
107
|
+
SET_WINDOW(self);
|
108
|
+
|
109
|
+
XStoreName(DPY, WINDOW, RSTRING_PTR(name));
|
110
|
+
|
111
|
+
return Qnil;
|
112
|
+
}
|
113
|
+
|
95
114
|
VALUE window_override_redirect(VALUE self) {
|
96
115
|
XWindowAttributes wa;
|
97
116
|
SET_WINDOW(self);
|
@@ -171,6 +190,18 @@ VALUE window__configure_event(VALUE self, VALUE rx, VALUE ry, VALUE rw, VALUE rh
|
|
171
190
|
return Qnil;
|
172
191
|
}
|
173
192
|
|
193
|
+
VALUE window__create(VALUE self, VALUE x, VALUE y, VALUE w, VALUE h) {
|
194
|
+
Window win;
|
195
|
+
SET_WINDOW(self);
|
196
|
+
|
197
|
+
win = XCreateSimpleWindow(DPY, WINDOW,
|
198
|
+
FIX2INT(x), FIX2INT(y), FIX2INT(w), FIX2INT(h),
|
199
|
+
0, BlackPixel(DPY, SCREEN_DEFAULT), BlackPixel(DPY, SCREEN_DEFAULT)
|
200
|
+
);
|
201
|
+
|
202
|
+
return window_make(DPY, win);
|
203
|
+
}
|
204
|
+
|
174
205
|
VALUE window__create_sub(VALUE self, VALUE x, VALUE y, VALUE w, VALUE h) {
|
175
206
|
XSetWindowAttributes wa;
|
176
207
|
Window sub_win;
|
data/lib/uh/display.rb
CHANGED
data/lib/uh/version.rb
CHANGED
data/lib/uh/window.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibault Jouan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -130,4 +130,3 @@ summary: Xlib simplified toolkit
|
|
130
130
|
test_files:
|
131
131
|
- test/test_helper.rb
|
132
132
|
- test/uh/test_geo.rb
|
133
|
-
has_rdoc:
|