XGetWindowProperty

Syntax

int XGetWindowProperty(display, w, property, long_offset, long_length, delete, req_type, 
                        actual_type_return, actual_format_return, nitems_return, bytes_after_return, 
                        prop_return)
      Display *display;
      Window w;
      Atom property;
      long long_offset, long_length;
      Bool delete;
      Atom req_type; 
      Atom *actual_type_return;
      int *actual_format_return;
      unsigned long *nitems_return;
      unsigned long *bytes_after_return;
      unsigned char **prop_return;

Arguments

display Specifies the connection to the X server.
Xサーバへの接続を指定。
w Specifies the window whose property you want to obtain.
獲得したいプロパティを持つウィンドウを指定。
property Specifies the property name.
プロパティ名を指定。
long_offset Specifies the offset in the specified property (in 32-bit quantities) where the data is to be retrieved.
指定したプロパティ内の検索されるデータの位置を示すオフセットを指定。
(32ビット単位)
long_length Specifies the length in 32-bit multiples of the data to be retrieved.
検索するデータを 32ビット 単位の長さを指定。
delete Specifies a Boolean value that determines whether the property is deleted.
プロパティを削除するかどうか決定する真偽値を指定。
req_type Specifies the atom identifier associated with the property type or AnyPropertyType.
プロパティのタイプに対応するアトム識別子か AnyPropertyType を指定。
actual_type_return Returns the atom identifier that defines the actual type of the property.
プロパティの実際のタイプを定義するアトム識別子が返される。
actual_format_return Returns the actual format of the property.
プロパティの実際のフォーマットが返される。
nitems_return Returns the actual number of 8-bit, 16-bit, or 32-bit items stored in the prop_return data.
prop_return に格納された 8ビット、16ビット、32ビットのアイテムの実際の数が返される。
bytes_after_return Returns the number of bytes remaining to be read in the property if a partial read was performed.
プロパティの一部だけ読み込んだ場合、 残りのバイト数が返される。
prop_return Returns the data in the specified format.
指定したフォーマットのデータが返される。

Description

The XGetWindowProperty() function returns the actual type of the property; the actual format of the property; the number of 8-bit, 16-bit, or 32-bit items transferred; the number of bytes remaining to be read in the property; and a pointer to the data actually returned. XGetWindowProperty() sets the return arguments as follows:
関数 XGetWindowProperty() はプロパティの実際のタイプ、 プロパティの実際のフォーマット、 転送される 8ビット/16ビット/32ビットのアイテム数、 プロパティに残っている読み込むべきバイト数、 データへのポインタを返す。 XGetWindowProperty() は値を返す引き数に対して以下のように値をセットする。 If the returned format is 8, the returned data is represented as a char array. If the returned format is 16, the returned data is represented as a short array and should be cast to that type to obtain the elements. If the returned format is 32, the returned data is represented as a long array and should be cast to that type to obtain the elements.
返されたフォーマットが 8 ならば、 返されたデータは char の配列として表現されている。 返されたフォーマットが 16 ならば、 返されたデータは short の配列として表現されており、 要素を得るにはその型にキャストしなければならない。 返されたフォーマットが 32 ならば、 返されたデータは long の配列として表現されており、 要素を得るにはその型にキャストしなければならない。

XGetWindowProperty() always allocates one extra byte in prop_return (even if the property is zero length) and sets it to zero so that simple properties consisting of characters do not have to be copied into yet another string before use.
XGetWindowProperty() は常に prop_return に追加の 1 バイトをアロケートし (たとえプロパティの長さがゼロでも)、 そこにゼロをセットする。 文字からなる簡単なプロパティを、 使用前に別の文字列にコピーする必要がないようにするためである。

If delete is True and bytes_after_return is zero, XGetWindowProperty() deletes the property from the window and generates a PropertyNotify event on the window.
delete が True で bytes_after_return がゼロならば、 XGetWindowProperty() はプロパティをウィンドウから削除し、 そのウィンドウ上に PropertyNotify イベントを生成する。

The function returns Success if it executes successfully. To free the resulting data, use XFree().
この関数は正常に実行された場合、 Success を返す。 得られたデータを解放するには XFree() を使用すること。

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

Diagnostics

BadAtom A value for an Atom argument does not name a defined Atom.
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

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