XChangeWindowAttributes

Syntax

XChangeWindowAttributes(display, w, valuemask, attributes)
      Display *display;
      Window w;
      unsigned long valuemask;
      XSetWindowAttributes *attributes;

Arguments

display Specifies the connection to the X server.
Xサーバへの接続を指定。
w Specifies the window.
ウィンドウを指定。
valuemask Specifies which window attributes are defined in the attributes argument. This mask is the bitwise inclusive OR of the valid attribute mask bits. If valuemask is zero, the attributes are ignored and are not referenced. The values and restrictions are the same as for XCreateWindow().
引き数 attribute のどのウィンドウ属性が定義されているかを指定。 このマスクは正しいマスクビット値のビットごとの論理和を取ったものである。 valuemask がゼロならば、 属性は無視され参照されない。 その値と制限は XCreateWindow() に関するものと同じである。
attributes Specifies the structure from which the values (as specified by the value mask) are to be taken. The value mask should have the appropriate bits set to indicate which attributes have been set in the structure (see "Window Attributes").
(value mask として指定されている) 値が得られることになっている構造体を指定。 value mask は構造体にセットされているどの値を取り出すかを示す、 適切なビットを持っていなければならない。 ("Window Attributes"参照)

Description

Depending on the valuemask, the XChangeWindowAttributes() function uses the window attributes in the XSetWindowAttributes structure to change the specified window attributes. Changing the background does not cause the window contents to be changed. To repaint the window and its background, use XClearWindow(). Setting the border or changing the background such that the border tile origin changes causes the border to be repainted. Changing the background of a root window to None or ParentRelative restores the default background pixmap. Changing the border of a root window to CopyFromParent restores the default border pixmap. Changing the win-gravity does not affect the current position of the window. Changing the backing-store of an obscured window to WhenMapped or Always, or changing the backing-planes, backing-pixel, or save-under of a mapped window may have no immediate effect. Changing the colormap of a window (that is, defining a new map, not changing the contents of the existing map) generates a ColormapNotify event. Changing the colormap of a visible window may have no immediate effect on the screen because the map may not be installed (see XInstallColormap()). Changing the cursor of a root window to None restores the default cursor. Whenever possible, you are encouraged to share colormaps.
引数 valuemask に従って、 関数 XChangeWindowAttributes()XSetWindowAttributes 構造体のウィンドウ属性を使って、 指定したウィンドウの属性を変更する。 背景色を変更してもウィンドウの表示内容は変更されない。 ウィンドウとその背景を再描画するには XClearWindow() を使用する。 境界のタイリングの原点が変わるような 境界の設定や背景色の設定をすると境界は再描画される。 ルートウィンドウの背景を NoneParentRelative に設定すると、 背景はデフォルトの背景ピックスマップに戻る。 ルートウィンドウの境界を CopyFromParent に変更すると、 境界はデフォルトの境界ピックスマップに戻る。 win-gravity の変更はウィンドウの現在位置には影響を与えない。 他のウィンドウに隠されているウィンドウの backing-storeWhenMappedAlways への変更や、 マップされているウィンドウの backing-planesbacking-pixelsave-under の変更の影響はすぐには現れない。 ウィンドウのカラーマップの変更 (つまり新しいカラーマップの定義であり、 既に存在するカラーマップの内容の変更ではない) は ColormapNotify イベントを起こす。 可視のウィンドウのカラーマップの変更の効果はすぐには現れない。 これはカラーマップがインストールされていないからである。 (XInstallColormap()参照) ルートウィンドウのカーソルを None に設定した場合、 カーソルはデフォルトのものに戻る。 クライアントは可能な限りカラーマップを共有することが望ましい。

Multiple clients can select input on the same window. Their event masks are maintained separately. When an event is generated, it is reported to all interested clients. However, only one client at a time can select for SubstructureRedirectMask ResizeRedirectMask and ButtonPressMask If a client attempts to select any of these event masks and some other client has already selected one, a BadAccess error results. There is only one do-not-propagate-mask for a window, not one per client.
複数のクライアントが同じウィンドウで入力を選択することができる。 この場合、イベントマスクは別個に管理される。 イベントが生成されたとき、 そのイベントに関係する全てのクライアントに送られる。 しかし、 SubstructureRedirectMask, ResizeRedirectMask, ButtonPressMask は同時に1つのクライアントしか選択できない。 あるクライアントがこれらのイベントマスクを選択しようとしたときに 他のクライアントがすでにこれを選択していた場合は、 エラー BadAccess となる。 1つのウィンドウに対して、 伝播させないイベント (do-not-propagate-mask) を指定するマスクが1つだけ存在する。 これはクライアントごとに1つではない。

XChangeWindowAttributes() can generate BadAccess, BadColor, BadCursor, BadMatch, BadPixmap, BadValue, and BadWindow errors.
XChangeWindowAttributes() はエラー BadAccess, BadColor, BadCursor, BadMatch, BadPixmap, BadValue, BadWindow を起こすことがある。

Diagnostics

BadAccess A client attempted to free a color map entry that it did not already allocate.
BadAccess A client attempted to store into a read-only color map entry.
BadColor A value for a Colormap argument does not name a defined Colormap.
BadCursor A value for a Cursor argument does not name a defined Cursor.
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

XConfigureWindow(), XCreateWindow(), XDestroyWindow(), XInstallColormap(), XMapWindow(), XRaiseWindow(), XSetWindowBackground(), XSetWindowBackgroundPixmap(), XSetWindowBorder(), XSetWindowBorderPixmap(), XSetWindowColormap(), XUnmapWindow(), "Changing Window Attributes"
Christophe Tronche, ch.tronche@computer.org