#include <X11/extensions/multibuf.h> Bool XmbufQueryExtension( Display *dpy, Display *dpy, int *event_base_return, int *error_base_return); Status XmbufGetVersion( Display *dpy, int *major_version_return, int *minor_version_return); int XmbufCreateBuffers( Display *dpy, Window window, int count, int update_action, int update_hint, Multibuffer *buffers_update); void XmbufDestroyBuffers( Display *dpy, Window window); void XmbufDisplayBuffers( Display *dpy, int count, Multibuffer *buffers, int min_delay, int max_delay); Status XmbufGetWindowAttributes( Display *dpy, Window window, XmbufWindowAttributes *attributes); void XmbufChangeWindowAttributes( Display *dpy, Window window, unsigned long valuemask, XmbufSetWindowAttributes *attributes); Status XmbufGetBufferAttributes( Display *dpy, Multibuffer buffer, XmbufBufferAttributes *attributes); void XmbufChangeBufferAttributes( Display *dpy, Multibuffer buffer, unsigned long valuemask, XmbufSetBufferAttributes *attributes); Status XmbufGetScreenInfo( Display *dpy, Drawable drawable, int *nmono_return, XmbufBufferInfo **mono_info_return, int *nstereo_return, XmbufBufferInfo **stereo_info_return); Window XmbufCreateStereoWindow( Display *dpy, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int class, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes, Multibuffer *left_return, Multibuffer *right_return);
イベント: typedef struct { int type; unsigned long serial; int send_event; Display *display; Multibuffer buffer; int state; } XmbufClobberNotifyEvent; typedef struct { int type; unsigned long serial; int send_event; Display *display; Multibuffer buffer; } XmbufUpdateNotifyEvent; 取得可能なウィンドウ別の属性: typedef struct { int displayed_index; int update_action; int update_hint; int window_mode; int nbuffers; Multibuffer *buffers; } XmbufWindowAttributes; 設定可能なウィンドウ別の属性: typedef struct { int update_hint; } XmbufSetWindowAttributes; 取得可能なバッファ別の属性: typedef struct { Window window; unsigned long event_mask; int buffer_index; int side; } XmbufBufferAttributes; 設定可能なバッファ別の属性: typedef struct { unsigned long event_mask; } XmbufSetBufferAttributes; スクリーン別のバッファ情報(これらのリストがある): typedef struct { VisualID visualid; int max_buffers; int depth; } XmbufBufferInfo;
XmbufQueryExtension は、指定されたディスプレイでマルチバッファリング/ステレオ拡張が利用可 能な場合に True を返す。この拡張が存在する場合、最初のイベントコードの値(実際の値を得 るためには、これをイベント型定数 MultibufferClobberNotify と MultibufferUpdateNotify に追加しなければならない) が event_base_return に格納され、最初のエラーコードのの値(実際の値を得 るためには、これをエラー型定数 MultibufferBadBuffer に追加しなければならない)が error_base_return に格納される。
XmbufGetVersion は拡張のメジャーバージョン番号とマイナーバージョン番号を取得する。 この関数はエラーが発生した場合に 0 を返し、エラーが発生しなかった場合 には 0 でない値を返す。
XmbufCreateBuffers は、「カウント」バッファが指定した update_action と update_hint を使っ て生成されることと、これが指定したウィンドウと対応づけられることを要求 する。生成されたバッファの数が返され(エラーが起こった場合は 0)、 buffer_update はその多くのマルチバッファ識別子で埋められる。
XmbufDestroyBuffers は指定したウィンドウに対応するバッファを破棄する。
XmbufDisplayBuffers は、min_delay ミリ秒が過ぎた後の max_delay 以内に、指定したバッファを 適切なウィンドウに表示する。 同じウィンドウには2つのバッファを対応づけることはできず、そうでない場 合には、エラー Matc が生成される。
XmbufGetWindowAttributes は、指定したディスプレイに対応づけられている全てのバッファに適用される マルチバッファリング属性を取得する。 返されたバッファのリストは XFree で解放することができる。 成功した場合には 0 でない値が返され、エラーが起こった場合には 0 が返 される。
XmbufChangeWindowAttributes は、与えられたウィンドウに対応づけられている全てのバッファに適用される マルチバッファリング属性を設定する。これは現在のところ、update_hint に 限定されている。
XmbufGetBufferAttributes は指定したバッファに対する属性を取得する。 成功した場合には 0 でない値が返され、エラーが起きた場合には 0 が返さ れる。
XmbufChangeBufferAttributes は指定したバッファに対する属性を設定する。 これが現在のところ、event_mask に限定されている。
XmbufGetScreenInfo は、指定したドロウアブルのスクリーンにおけるモノラルとステレオのウィン ドウの生成方法を制御するパラメータを取得する。ビジュアルと深さの組の数 が nmono_return と nstereo_return に返される。nmono_return が 0 より 大きければ、mono_info_return には 利用できる様々なビジュアルと深さを記述している XmbufBufferInfo 構造体の配列のアドレスがセットされている。同様に、stereo_info_return は nstereo_return に従ってセットされる。mono_info_return と stereo_info_return に返されるメモリは、 XFree を使って解放することができる。 エラーが起きなかった場合は、0 でない値が返される。
XmbufCreateStereoWindow は、 XCreateWindow がモノラルのウィンドウを生成するのと同じようにステレオウィンドウを生成 する。左と右のバッファに対する ID はそれぞれ、left_return と right_return に返される。拡張がそのディスプレイで利用できない場合、戻っ てくる拡張エラーハンドラがインストールされているならば None が返される。
update_action フィールド(XmbufWindowAttributes 構造体):
MultibufferUpdateActionUndefined MultibufferUpdateActionBackground MultibufferUpdateActionUntouched MultibufferUpdateActionCopied
update_hint フィールド(XmbufWindowAttributes構造体、 XmbufSetWindowAttributes 構造体):
MultibufferUpdateHintFrequent MultibufferUpdateHintIntermittent MultibufferUpdateHintStatic引き数 valuemask:
MultibufferWindowUpdateHint MultibufferBufferEventMask
モノラル対ステレオ、左対右:
MultibufferModeMono MultibufferModeStereo MultibufferSideMono MultibufferSideLeft MultibufferSideRight
state フィールド(XmbufClobberNotifyEvent 構造体):
MultibufferUnclobbered MultibufferPartiallyClobbered MultibufferFullyClobbered
イベント関係:
MultibufferClobberNotifyMask MultibufferUpdateNotifyMask MultibufferClobberNotify MultibufferUpdateNotify MultibufferNumberEvents MultibufferBadBuffer MultibufferNumberErrors