Class: LibX11::Display

Inherits:
Data
  • Object
show all
Defined in:
ext/libx11_ruby/display.c

Instance Method Summary collapse

Instance Method Details

#black_pixel(screen_obj) ⇒ Object

Xlib BlackPixel



104
105
106
107
108
# File 'ext/libx11_ruby/display.c', line 104

static VALUE
rb_display_black_pixel(VALUE self, VALUE screen_obj)
{
  return ULONG2NUM(BlackPixel(get_display_struct(self), FIX2INT(screen_obj)));
}

#connection_numberObject

#define ConnectionNumber(dpy) (((_XPrivDisplay)dpy)->fd)



77
78
79
80
81
# File 'ext/libx11_ruby/display.c', line 77

static VALUE
rb_display_connection_number(VALUE self)
{
  return INT2NUM(ConnectionNumber(get_display_struct(self)));
}

#default_root_windowObject

Xlib DefaultRootWindow



95
96
97
98
99
# File 'ext/libx11_ruby/display.c', line 95

static VALUE
rb_display_default_root_window(VALUE self)
{
  return ULONG2NUM(DefaultRootWindow(get_display_struct(self)));
}

#default_screenObject

Xlib DefaultScreen



68
69
70
71
72
# File 'ext/libx11_ruby/display.c', line 68

static VALUE
rb_display_default_screen(VALUE self)
{
  return INT2NUM(DefaultScreen(get_display_struct(self)));
}

#white_pixel(screen_obj) ⇒ Object

Xlib WhitePixel



113
114
115
116
117
# File 'ext/libx11_ruby/display.c', line 113

static VALUE
rb_display_white_pixel(VALUE self, VALUE screen_obj)
{
  return ULONG2NUM(WhitePixel(get_display_struct(self), FIX2INT(screen_obj)));
}

#xdisplay_stringObject

Xlib XDisplayString



86
87
88
89
90
# File 'ext/libx11_ruby/display.c', line 86

static VALUE
rb_display_xdisplay_string(VALUE self)
{
  return rb_str_new_cstr(XDisplayString(get_display_struct(self)));
}

#xgrab_key(keycode, modifiers, grab_window, owner_events, pointer_mode, keyboard_mode) ⇒ Object

Xlib XGrabKey



149
150
151
152
153
154
155
156
# File 'ext/libx11_ruby/display.c', line 149

static VALUE
rb_display_xgrab_key(VALUE self, VALUE keycode, VALUE modifiers, VALUE grab_window,
    VALUE owner_events, VALUE pointer_mode, VALUE keyboard_mode)
{
  int ret = XGrabKey(get_display_struct(self), NUM2INT(keycode), NUM2UINT(modifiers), NUM2ULONG(grab_window),
      RTEST(owner_events), NUM2INT(pointer_mode), NUM2INT(keyboard_mode));
  return INT2NUM(ret);
}

#xkeysym_to_keycode(keysym) ⇒ Object

Xlib XKeysymToKeycode



171
172
173
174
175
176
# File 'ext/libx11_ruby/display.c', line 171

static VALUE
rb_display_xkeysym_to_keycode(VALUE self, VALUE keysym)
{
  unsigned char keycode = XKeysymToKeycode(get_display_struct(self), NUM2ULONG(keysym));
  return INT2FIX((int)keycode);
}

#xmap_window(window) ⇒ Object

Xlib XMapWindow



131
132
133
134
135
# File 'ext/libx11_ruby/display.c', line 131

static VALUE
rb_display_xmap_window(VALUE self, VALUE window)
{
  return INT2NUM(XMapWindow(get_display_struct(self), NUM2ULONG(window)));
}

#xselect_input(window, event_mask) ⇒ Object

Xlib XSelectInput



122
123
124
125
126
# File 'ext/libx11_ruby/display.c', line 122

static VALUE
rb_display_xselect_input(VALUE self, VALUE window, VALUE event_mask)
{
  return INT2NUM(XSelectInput(get_display_struct(self), NUM2ULONG(window), NUM2LONG(event_mask)));
}

#xsync(discard) ⇒ Object

Xlib XSync



140
141
142
143
144
# File 'ext/libx11_ruby/display.c', line 140

static VALUE
rb_display_xsync(VALUE self, VALUE discard)
{
  return INT2NUM(XSync(get_display_struct(self), RTEST(discard)));
}

#xungrab_key(keycode, modifiers, grab_window) ⇒ Object

Xlib XUngrabKey



161
162
163
164
165
166
# File 'ext/libx11_ruby/display.c', line 161

static VALUE
rb_display_xungrab_key(VALUE self, VALUE keycode, VALUE modifiers, VALUE grab_window)
{
  int ret = XUngrabKey(get_display_struct(self), NUM2INT(keycode), NUM2UINT(modifiers), NUM2ULONG(grab_window));
  return INT2NUM(ret);
}