commit bf858851881a89d0aae3aa6cc809a5dd8947eafd
parent 4cd434c431e991460838058e0644f92d3a2cc6cc
Author: Matsuda Kenji <info@mtkn.jp>
Date: Wed, 21 Dec 2022 18:27:59 +0900
update
Diffstat:
4 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/data/weblog b/data/weblog
@@ -118,3 +118,6 @@
1671548400 /computer/xlib_playground1.html
1671548400 /computer/xlib_playground1.html
1671548400 /computer/xlib_playground1.html
+1671548400 /computer/xlib_playground1.html
+1671548400 /computer/xlib_playground1.html
+1671548400 /computer/xlib_playground1.html
diff --git a/man/computer/xlib_playground1.html b/man/computer/xlib_playground1.html
@@ -1,5 +1,5 @@
<h1>Xlibで遊んでみる</h1>
-<time>2022-12-16</time>
+<time>2022-12-21</time>
<h2>はじめに</h2>
<p>X11でGUIのプログラミングをしてみようと思い、してみた。\
@@ -53,13 +53,13 @@ setup(void)
XDefaultRootWindow(display),
0, 0,
win_width, win_height,
- 0, 0,
- 0);
+ 0, 0, // border properties
+ 0); // background color: black
XStoreName(display, window, "UNKO");
// Setup a graphical context.
gc = XCreateGC(display, window, 0, NULL);
- XSetForeground(display, gc, 0xFFFFFF);
+ XSetForeground(display, gc, 0x0000FF);
// Kill the application when the window is destroyed.
wm_delete_window = XInternAtom(display,
@@ -84,6 +84,7 @@ clean_up(void)
<p>適当な四角形のものを表示し、その位置を時間の関数として動かしてみる。\
</p>
<pre><code>#include <time.h>
+#include <math.h>
int
main(void)
diff --git a/pub/computer/xlib_playground1.html b/pub/computer/xlib_playground1.html
@@ -22,7 +22,7 @@
<main>
<article>
<h1>Xlibで遊んでみる</h1>
-<time>2022-12-16</time>
+<time>2022-12-21</time>
<h2>はじめに</h2>
<p>X11でGUIのプログラミングをしてみようと思い、してみた。X11用の低レベルのライブラリはXlibとxcbの二つがあるようだ。x.orgのウェブページを見てみると、Xlibは古く、xcbに置きかわりつつあるという。そのため、新しくなにかを作る場合はxcbを使うようにとのことである。ところがこのxcbはドキュメンテーションに乏しく、X11を触るのが初めての人間にはなにをどうすればいいのかほとんど分からなかった。知らない関数や構造体やらがでてきても(殆ど全部知らないものだが)、その関数なり構造体なりの説明がどこにも見当たらない。manページもない。あるのはdoxygenなるものでソースコードのコメントから自動生成したいい加減なものだけで、使いものにならない。</p>
@@ -61,13 +61,13 @@ setup(void)
XDefaultRootWindow(display),
0, 0,
win_width, win_height,
- 0, 0,
- 0);
+ 0, 0, // border properties
+ 0); // background color: black
XStoreName(display, window, "UNKO");
// Setup a graphical context.
gc = XCreateGC(display, window, 0, NULL);
- XSetForeground(display, gc, 0xFFFFFF);
+ XSetForeground(display, gc, 0x0000FF);
// Kill the application when the window is destroyed.
wm_delete_window = XInternAtom(display,
@@ -91,6 +91,7 @@ clean_up(void)
<p>適当な四角形のものを表示し、その位置を時間の関数として動かしてみる。</p>
<pre><code>#include <time.h>
+#include <math.h>
int
main(void)
diff --git a/pub/rss.xml b/pub/rss.xml
@@ -5,8 +5,8 @@
<description>ウェブページの更新履歴</description>
<language>ja-jp</language>
<link>https://www.mtkn.jp</link>
-<lastBuildDate>Wed, 21 Dec 2022 18:13:36 +0900</lastBuildDate>
-<pubDate>Wed, 21 Dec 2022 18:13:36 +0900</pubDate>
+<lastBuildDate>Wed, 21 Dec 2022 18:27:44 +0900</lastBuildDate>
+<pubDate>Wed, 21 Dec 2022 18:27:44 +0900</pubDate>
<docs>https://www.rssboard.org/rss-specification</docs>
<item>
<title>Xlibで遊んでみる</title>
@@ -14,7 +14,7 @@
<guid>https://www.mtkn.jp/computer/xlib_playground1.html</guid>
<pubDate>Wed, 21 Dec 2022 00:00:00 +0900</pubDate>
<description><![CDATA[<h1>Xlibで遊んでみる</h1>
-<time>2022-12-16</time>
+<time>2022-12-21</time>
<h2>はじめに</h2>
<p>X11でGUIのプログラミングをしてみようと思い、してみた。\
@@ -68,13 +68,13 @@ setup(void)
XDefaultRootWindow(display),
0, 0,
win_width, win_height,
- 0, 0,
- 0);
+ 0, 0, // border properties
+ 0); // background color: black
XStoreName(display, window, "UNKO");
// Setup a graphical context.
gc = XCreateGC(display, window, 0, NULL);
- XSetForeground(display, gc, 0xFFFFFF);
+ XSetForeground(display, gc, 0x0000FF);
// Kill the application when the window is destroyed.
wm_delete_window = XInternAtom(display,
@@ -99,6 +99,7 @@ clean_up(void)
<p>適当な四角形のものを表示し、その位置を時間の関数として動かしてみる。\
</p>
<pre><code>#include <time.h>
+#include <math.h>
int
main(void)