XChangeProperty

Syntax

XChangeProperty(display, w, property, type, format, mode, data, nelements)
      Display *display;
      Window w;
      Atom property, type;
      int format;
      int mode;
      unsigned char *data;
      int nelements;

Arguments

display Specifies the connection to the X server.
Xサーバへの接続を指定。
w Specifies the window whose property you want to change.
プロパティリストを取得するウィンドウを指定。
property Specifies the property name.
プロパティ名を指定。
type Specifies the type of the property. The X server does not interpret the type but simply passes it back to an application that later calls XGetWindowProperty().
プロパティのタイプを指定。 X サーバはこのタイプの解釈は行わないが、 後で XGetWindowProperty() を呼び出したアプリケーションにそのタイプをそのまま返す。
format Specifies whether the data should be viewed as a list of 8-bit, 16-bit, or 32-bit quantities. Possible values are 8, 16, and 32. This information allows the X server to correctly perform byte-swap operations as necessary. If the format is 16-bit or 32-bit, you must explicitly cast your data pointer to an (unsigned char *) in the call to XChangeProperty().
データを 8ビット/16ビット/32ビット いずれの単位のリストとみなすかを指定。 8/16/32 を指定できる。 この情報により X サーバは必要に応じてバイト交換を正しく行うことができる。 フォーマットが 16ビットか32ビットの場合には、 XChangeProperty() の呼び出しの際にはデータへのポインタを (unsigned char *) にキャストしなければならない。
mode Specifies the mode of the operation. You can pass PropModeReplace, PropModePrepend, or PropModeAppend.
操作のモードを指定。 PropModeReplace, PropModePrepend, PropModeAppend のいずれかを指定できる。
data Specifies the property data.
プロパティのデータを指定。
nelements Specifies the number of elements of the specified data format.
指定したデータフォーマットの要素数を指定。

Description

The XChangeProperty() function alters the property for the specified window and causes the X server to generate a PropertyNotify event on that window. XChangeProperty() performs the following:
関数 XChangeProperty() は指定されたウィンドウのプロパティを変更し、 そのウィンドウ上の PropertyNotify イベントを X サーバに生成させる。 XChangeProperty() は以下の動作を行う。 If the specified format is 8, the property data must be a char array. If the specified format is 16, the property data must be a short array. If the specified format is 32, the property data must be a long array.
指定したフォーマットが 8 ならば、 プロパティのデータは char 型の配列でなければならない。 指定したフォーマットが 16 ならば、 プロパティのデータは short 型の配列でなければならない。 指定したフォーマットが 32 ならば、 プロパティのデータは long 型の配列でなければならない。

The lifetime of a property is not tied to the storing client. Properties remain until explicitly deleted, until the window is destroyed, or until the server resets. For a discussion of what happens when the connection to the X server is closed, see section "X Server Connection Close Operations". The maximum size of a property is server dependent and can vary dynamically depending on the amount of memory the server has available. (If there is insufficient space, a BadAlloc error results.)
プロパティの存続期間は、 格納を行ったクライアントとは結びつけられない。 プロパティは明示的に削除されるか、 ウィンドウが破壊されるか、 サーバが再設定するまで残る。 X サーバへの接続が切れた際の挙動については、 セクション "X Server Connection Close Operations" を参照すること。 プロパティの最大サイズはサーバに依存し、 これはサーバが利用可能なメモリ量によって動的に変わることもある。 (十分なメモリが確保できない場合はエラー BadAlloc となる。)

XChangeProperty() can generate BadAlloc , BadAtom , BadMatch , BadValue , and BadWindow errors.
XChangeProperty() はエラー BadAlloc , BadAtom , BadMatch , BadValue , BadWindow を起こすことがある。

Diagnostics

BadAlloc The server failed to allocate the requested source or server memory.
BadAtom A value for an Atom argument does not name a defined Atom.
BadMatch An InputOnly window is used as a Drawable.
BadMatch Some argument or pair of arguments has the correct type and range but fails to match in some other way required by the request.
BadPixmap A value for a Pixmap argument does not name a defined Pixmap.
BadValue Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.
BadWindow A value for a Window argument does not name a defined Window.

See also

XDeleteProperty(), XGetWindowProperty(), XListProperties(), XRotateWindowProperties(), "Obtaining and Changing Window Properties"
Christophe Tronche, ch.tronche@computer.org