summary refs log blame commit diff stats
path: root/doc/pydoc/ranger.ext.openstruct.html
blob: 798c7352a56c1586f35fd5ce68bec37ea7bb0b2c (plain) (tree)




















































                                                                                                                                                                                                                                                 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ranger.ext.openstruct</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="ranger.html"><font color="#ffffff">ranger</font></a>.<a href="ranger.ext.html"><font color="#ffffff">ext</font></a>.openstruct</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/work/ranger/ranger/ext/openstruct.py">/home/hut/work/ranger/ranger/ext/openstruct.py</a></font></td></tr></table>
    <p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="builtins.html#object">builtins.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.ext.openstruct.html#OpenStruct">OpenStruct</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="OpenStruct">class <strong>OpenStruct</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="OpenStruct-__contains__"><strong>__contains__</strong></a>(self, key)</dt></dl>

<dl><dt><a name="OpenStruct-__getitem__"><strong>__getitem__</strong></a>(self, key)</dt></dl>

<dl><dt><a name="OpenStruct-__init__"><strong>__init__</strong></a>(self, _OpenStruct__dictionary<font color="#909090">=None</font>, **_OpenStruct__keywords)</dt></dl>

<dl><dt><a name="OpenStruct-__setitem__"><strong>__setitem__</strong></a>(self, key, value)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table>
</body></html>
> Tdev } }, { ControlMask, XK_2, tappend, { .i = Tirc } }, { ControlMask, XK_3, tappend, { .i = Twww } }, { ControlMask, XK_4, tappend, { .i = Twork } }, }; /********** CUSTOMIZE **********/ void update_keys(void) { static unsigned int len = key ? sizeof(key) / sizeof(key[0]) : 0; unsigned int i; KeyCode code; for(i = 0; i < len; i++) { code = XKeysymToKeycode(dpy, key[i].keysym); XUngrabKey(dpy, code, key[i].mod, root); XGrabKey(dpy, code, key[i].mod, root, True, GrabModeAsync, GrabModeAsync); } } void keypress(XEvent *e) { XKeyEvent *ev = &e->xkey; static unsigned int len = key ? sizeof(key) / sizeof(key[0]) : 0; unsigned int i; KeySym keysym; keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); for(i = 0; i < len; i++) if((keysym == key[i].keysym) && (key[i].mod == ev->state)) { if(key[i].func) key[i].func(&key[i].arg); return; } } #define ButtonMask (ButtonPressMask | ButtonReleaseMask) #define MouseMask (ButtonMask | PointerMotionMask) void mresize(Client *c) { XEvent ev; int ocx, ocy; ocx = c->x; ocy = c->y; if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync, None, cursor[CurResize], CurrentTime) != GrabSuccess) return; XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h); for(;;) { XMaskEvent(dpy, MouseMask | ExposureMask, &ev); switch(ev.type) { default: break; case Expose: handler[Expose](&ev); break; case MotionNotify: XFlush(dpy); c->w = abs(ocx - ev.xmotion.x); c->h = abs(ocy - ev.xmotion.y); c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w; c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h; resize(c, True); break; case ButtonRelease: XUngrabPointer(dpy, CurrentTime); return; } } } void mmove(Client *c) { XEvent ev; int x1, y1, ocx, ocy, di; unsigned int dui; Window dummy; ocx = c->x; ocy = c->y; if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync, None, cursor[CurMove], CurrentTime) != GrabSuccess) return; XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui); for(;;) { XMaskEvent(dpy, MouseMask | ExposureMask, &ev); switch (ev.type) { default: break; case Expose: handler[Expose](&ev); break; case MotionNotify: XFlush(dpy); c->x = ocx + (ev.xmotion.x - x1); c->y = ocy + (ev.xmotion.y - y1); resize(c, False); break; case ButtonRelease: XUngrabPointer(dpy, CurrentTime); return; } } }