1998-07-22 shape extention
故あって久々に X11 の program。
shape なんて使ったことねーぞ...とか思って man したら中身が無かった。
しょうがないので 8mm テープの中の X11R6 の xc を展開して
oclock のソース見て 120 ナノ秒ほどで理解。
5 秒でできる shape window の作り方。
#include <X11/extensions/shape.h> Pixmap shape_mask; GC shape_gc; /* depth 1 の pixmap を作る */ shape_mask = XCreatePixmap( display, window, width, height, 1 ); shape_gc = XCreateGC( display, shape_mask, 0, 0 ); /* clear */ XSetForeground( display, shape_gc, 0 ); XFillRectangle( display, shape_mask, shape_gc, 0, 0, width, height ); XSetForeground( display, shape_gc, 1 ); /* マスク形状(見えるほう) を shape_mask に書く */ /* XFillArc( display, shape_mask, shape_gc, 0, 0, width, height, 0, 360*64 ); */ XShapeCombineMask( display, window, ShapeBounding, 0, 0, shape_mask, ShapeSet );
WindowManager に resize させなくするのってどうやるんだっけ...。
EOF