'\" t .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium .\" .\" Permission is hereby granted, free of charge, to any person obtaining .\" a copy of this software and associated documentation files (the .\" "Software"), to deal in the Software without restriction, including .\" without limitation the rights to use, copy, modify, merge, publish, .\" distribute, sublicense, and/or sell copies of the Software, and to .\" permit persons to whom the Software is furnished to do so, subject to .\" the following conditions: .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. .\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR .\" OTHER DEALINGS IN THE SOFTWARE. .\" .\" Except as contained in this notice, the name of the X Consortium shall .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from the X Consortium. .\" .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by .\" Digital Equipment Corporation .\" .\" Portions Copyright \(co 1990, 1991 by .\" Tektronix, Inc. .\" .\" Permission to use, copy, modify and distribute this documentation for .\" any purpose and without fee is hereby granted, provided that the above .\" copyright notice appears in all copies and that both that copyright notice .\" and this permission notice appear in all copies, and that the names of .\" Digital and Tektronix not be used in in advertising or publicity pertaining .\" to this documentation without specific, written prior permission. .\" Digital and Tektronix makes no representations about the suitability .\" of this documentation for any purpose. .\" It is provided ``as is'' without express or implied warranty. .\" .\" Copyright (c) 1998, 2001 The X Japanese Documentation Project. .\" .\" Permission is hereby granted, free of charge, to any person obtaining a .\" copy of this software and associated documentation files (the .\" "Software"), to deal in the Software without restriction, including .\" without limitation the rights to use, copy, modify, merge, publish, dis- .\" tribute, sublicense, and/or sell copies of the Software, and to permit .\" persons to whom the Software is furnished to do so, subject to the fol- .\" lowing conditions: .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- .\" ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT .\" SHALL THE X JAPANESE DOCUMENTATION PROJECT BE LIABLE FOR ANY CLAIM, .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. .\" .\" Except as contained in this notice, the name of The X Japanese .\" Documentation Project shall not be used in advertising or otherwise to .\" promote the sale, use or other dealings in this Software without prior .\" written authorization from The X Japanese Documentation Project. .\" .\" X Window System is a trademark of The Open Group. .\" .\" Translated Tue Oct 6 22:11:28 JST 1998 .\" by FUJIWARA Teruyoshi .\" Corrected by NAKANO Takeo .\" Updated Sat Sep 22 17:46:29 JST 2001 for XFree86 4.1.0 .\" by FUJIWARA Teruyoshi .\" .\" $XFree86: xc/doc/man/X11/XASCmap.man,v 1.4 2001/02/09 03:47:44 tsi Exp $ .\" .ds xT X Toolkit Intrinsics \- C Language Interface .ds xW Athena X Widgets \- C Language X Toolkit Interface .ds xL Xlib \- C Language X Interface .ds xC Inter-Client Communication Conventions Manual .na .de Ds .nf .\\$1D \\$2 \\$1 .ft 1 .\".ps \\n(PS .\".if \\n(VS>=40 .vs \\n(VSu .\".if \\n(VS<=39 .vs \\n(VSp .. .de De .ce 0 .if \\n(BD .DF .nr BD 0 .in \\n(OIu .if \\n(TM .ls 2 .sp \\n(DDu .fi .. .de FD .LP .KS .TA .5i 3i .ta .5i 3i .nf .. .de FN .fi .KE .LP .. .de IN \" send an index entry to the stderr .. .de C{ .KS .nf .D .\" .\" choose appropriate monospace font .\" the imagen conditional, 480, .\" may be changed to L if LB is too .\" heavy for your eyes... .\" .ie "\\*(.T"480" .ft L .el .ie "\\*(.T"300" .ft L .el .ie "\\*(.T"202" .ft PO .el .ie "\\*(.T"aps" .ft CW .el .ft R .ps \\n(PS .ie \\n(VS>40 .vs \\n(VSu .el .vs \\n(VSp .. .de C} .DE .R .. .de Pn .ie t \\$1\fB\^\\$2\^\fR\\$3 .el \\$1\fI\^\\$2\^\fP\\$3 .. .de ZN .ie t \fB\^\\$1\^\fR\\$2 .el \fI\^\\$1\^\fP\\$2 .. .de hN .ie t <\fB\\$1\fR>\\$2 .el <\fI\\$1\fP>\\$2 .. .de NT .ne 7 .ds NO Note .if \\n(.$>$1 .if !'\\$2'C' .ds NO \\$2 .if \\n(.$ .if !'\\$1'C' .ds NO \\$1 .ie n .sp .el .sp 10p .TB .ce \\*(NO .ie n .sp .el .sp 5p .if '\\$1'C' .ce 99 .if '\\$2'C' .ce 99 .in +5n .ll -5n .R .. . \" Note End -- doug kraft 3/85 .de NE .ce 0 .in -5n .ll +5n .ie n .sp .el .sp 10p .. .ny0 '\" t .TH XAllocStandardColormap 3X11 "Release 6.5" "X Version 11" "XLIB FUNCTIONS" .SH 名前 .\"0 XAllocStandardColormap, XSetRGBColormaps, XGetRGBColormaps, XStandardColormap \- allocate, set, or read a standard colormap structure XAllocStandardColormap, XSetRGBColormaps, XGetRGBColormaps, XStandardColormap \- 標準カラーマップ構造体の割り当て・設定・取得 .SH 書式 XStandardColormap *XAllocStandardColormap\^(\|) .LP void XSetRGBColormaps\^(\^\fIdisplay\fP, \fIw\fP, \fIstd_colormap\fP, \fIcount\fP, \fIproperty\fP\^) .br Display *\fIdisplay\fP\^; .br Window \fIw\fP\^; .br XStandardColormap *\fIstd_colormap\fP\^; .br int \fIcount\fP\^; .br Atom \fIproperty\fP\^; .LP Status XGetRGBColormaps\^(\^\fIdisplay\fP, \fIw\fP, \fIstd_colormap_return\fP, \fIcount_return\fP, \fIproperty\fP\^) .br Display *\fIdisplay\fP\^; .br Window \fIw\fP\^; .br XStandardColormap **\fIstd_colormap_return\fP\^; .br int *\fIcount_return\fP\^; .br Atom \fIproperty\fP\^; .SH 引き数 .IP \fIdisplay\fP 1i .\"0 Specifies the connection to the X server. X サーバへの接続を指定する。 .ds Cn colormaps .IP \fIcount\fP 1i .\"0 Specifies the number of \*(Cn. カラーマップの数を指定する。 .ds Cn colormaps .IP \fIcount_return\fP 1i .\"0 Returns the number of \*(Cn. カラーマップの数が返される。 .IP \fIproperty\fP 1i .\"0 Specifies the property name. プロパティの名前を指定する。 .IP \fIstd_colormap\fP 1i .\"0 Specifies the .\"0 .ZN XStandardColormap .\"0 structure to be used. 使われる .ZN XStandardColormap 構造体を指定する。 .IP \fIstd_colormap_return\fP 1i .\"0 Returns the .\"0 .ZN XStandardColormap .\"0 structure. .ZN XStandardColormap 構造体が返される。 .SH 説明 .\"0 The .\"0 .ZN XAllocStandardColormap .\"0 function allocates and returns a pointer to a .\"0 .ZN XStandardColormap .\"0 structure. 関数 .ZN XAllocStandardColormap は .ZN XStandardColormap 構造体を割り当て、この構造体を指すポインタを返す。 .\"0 Note that all fields in the .\"0 .ZN XStandardColormap .\"0 structure are initially set to zero. .ZN XStandardColormap 構造体の全てのフィールドは 0 で初期化される点に注意すること。 .\"0 If insufficient memory is available, .\"0 .ZN XAllocStandardColormap .\"0 returns NULL. 十分なメモリが利用できない場合、 .ZN XAllocStandardColormap は NULL を返す。 .\"0 To free the memory allocated to this structure, .\"0 use .\"0 .ZN XFree . この構造体に割り当てられたメモリを解放するには .ZN XFree を使用すること。 .LP .\"0 The .\"0 .ZN XSetRGBColormaps .\"0 function replaces the RGB colormap definition in the specified property .\"0 on the named window. 関数 .ZN XSetRGBColormaps は指定したウィンドウの指定したプロパティの RGB カラーマップの定義を置 き換える。 .\"0 If the property does not already exist, .\"0 .ZN XSetRGBColormaps .\"0 sets the RGB colormap definition in the specified property .\"0 on the named window. そのプロパティがまだ存在しない場合、 .ZN XSetRGBColormaps は指定したウィンドウの指定したプロパティの RGB カラーマップの定義を 設定する。 .\"0 The property is stored with a type of RGB_COLOR_MAP and a format of 32. プロパティは RGB_COLOR_MAP 型、フォーマット 32 で格納される。 .\"0 Note that it is the caller's responsibility to honor the ICCCM .\"0 restriction that only RGB_DEFAULT_MAP contain more than one definition. RGB_DEFAULT_MAP のみが複数の定義を持つという ICCCM の規定は、関数を呼 び出す側で守る義務があることに注意せよ。 .LP .\"0 The .\"0 .ZN XSetRGBColormaps .\"0 function usually is only used by window or session managers. 関数 .ZN XSetRGBColormaps を使うのは、通常はウィンドウかセッションマネージャだけである。 .\"0 To create a standard colormap, .\"0 follow this procedure: 標準カラーマップは以下の手続きで作成する。 .IP 1. 5 .\"0 Open a new connection to the same server. 現在のサーバへの新しい接続をオープンする。 .IP 2. 5 .\"0 Grab the server. サーバをグラブする。 .IP 3. 5 .\"0 See if the property is on the property list of the root window for the screen. スクリーンのルートウィンドウのプロパティリストにこのプロパティがあるか どうか確認する。 .IP 4. 5 .\"0 If the desired property is not present: 必要なプロパティがなければ次の処理を行う。 .RS .IP \(bu 5 .\"0 Create a colormap (unless you are using the default colormap of the screen). (スクリーンのデフォルトのカラーマップを使わない場合に限り)カラーマップ を生成する。 .IP \(bu 5 .\"0 Determine the color characteristics of the visual. ビジュアルの色の特性を決定する。 .IP \(bu 5 .\"0 Allocate cells in the colormap (or create it with .\"0 .ZN AllocAll ). カラーマップ内のセルを割り当てる(あるいは .ZN AllocAll で作成する)。 .IP \(bu 5 .\"0 Call .\"0 .ZN XStoreColors .\"0 to store appropriate color values in the colormap. .ZN XStoreColors を呼び、カラーマップに適切な色の値を格納する。 .IP \(bu 5 .\"0 Fill in the descriptive members in the .\"0 .ZN XStandardColormap .\"0 structure. .ZN XStandardColormap 構造体のメンバを設定する。 .IP \(bu 5 .\"0 Attach the property to the root window. このプロパティをルートウィンドウに割り付ける。 .IP \(bu 5 .\"0 Use .\"0 .ZN XSetCloseDownMode .\"0 to make the resource permanent. .ZN XSetCloseDownMode を使用して、リソースを永続的なものにする。 .RE .IP 5. 5 .\"0 Ungrab the server. サーバのグラブを解放する。 .LP .\"0 .ZN XSetRGBColormaps .\"0 can generate .\"0 .ZN BadAlloc , .\"0 .ZN BadAtom , .\"0 and .\"0 .ZN BadWindow .\"0 errors. .ZN XSetRGBColormaps はエラー .ZN BadAlloc , .ZN BadAtom , .ZN BadWindow を起こすことがある。 .LP .\"0 The .\"0 .ZN XGetRGBColormaps .\"0 function returns the RGB colormap definitions stored .\"0 in the specified property on the named window. .ZN XGetRGBColormaps は、指定したウィンドウの指定したプロパティ内の RGB カラーマップ定義を 返す。 .\"0 If the property exists, is of type RGB_COLOR_MAP, is of format 32, .\"0 and is long enough to contain a colormap definition, .\"0 .ZN XGetRGBColormaps .\"0 allocates and fills in space for the returned colormaps .\"0 and returns a nonzero status. プロパティが存在し、その型が RGB_COLOR_MAP、フォーマットが 32 であり、かつカラーマップ定義を含むのに十分な長さを持っていれば、 .ZN XGetRGBColormaps は返すカラーマップを割り当ててそのメモリ領域を埋め、0 でない ステータスを返す。 .\"0 If the visualid is not present, .\"0 .ZN XGetRGBColormaps .\"0 assumes the default visual for the screen on which the window is located; ビジュアル ID がない場合、 .ZN XGetRGBColormaps はウィンドウが配置されるスクリーンのデフォルトのビジュアルを仮定する。 .\"0 if the killid is not present, .\"0 .ZN None .\"0 is assumed, which indicates that the resources cannot be released. kill ID が存在しない場合には None が仮定される。 これは、このリソースは解放できないことを示す。 .\"0 Otherwise, .\"0 none of the fields are set, and .\"0 .ZN XGetRGBColormaps .\"0 returns a zero status. これ以外の場合には、いずれのフィールドも設定されず、 .ZN XGetRGBColormaps はステータスとして 0 を返す。 .\"0 Note that it is the caller's responsibility to honor the ICCCM .\"0 restriction that only RGB_DEFAULT_MAP contain more than one definition. RGB_DEFAULT_MAP だけが1つ以上の定義を含む ICCCM の制限を引き受けるのは 関数を呼び出す側の責任であることに注意せよ。 .LP .\"0 .ZN XGetRGBColormaps .\"0 can generate .\"0 .ZN BadAtom .\"0 and .\"0 .ZN BadWindow .\"0 errors. .ZN XGetRGBColormaps はエラー .ZN BadAtom .ZN BadWindow を起こすことがある。 .SH 構造体 .\"0 The .\"0 .ZN XStandardColormap .\"0 structure contains: .ZN XStandardColormap 構造体の内容を以下に示す: .LP .TS lw(.5i) lw(2i) lw(1i). T{ \&#define T} T{ .ZN ReleaseByFreeingColormap T} T{ ( (XID) 1L) T} .TE .IN "XStandardColormap" "" "@DEF@" .Ds 0 .TA .5i 2.5i .ta .5i 2.5i typedef struct { Colormap colormap; unsigned long red_max; unsigned long red_mult; unsigned long green_max; unsigned long green_mult; unsigned long blue_max; unsigned long blue_mult; unsigned long base_pixel; VisualID visualid; XID killid; } XStandardColormap; .De .LP .\"0 The colormap member is the colormap created by the .\"0 .ZN XCreateColormap .\"0 function. colormap メンバは、関数 .ZN XCreateColormap で作られるカラーマップである。 .\"0 The red_max, green_max, and blue_max members give the maximum .\"0 red, green, and blue values, respectively. red_max, green_max, blue_max メンバは RGB の各値の最大値を与える。 .\"0 Each color coefficient ranges from zero to its max, inclusive. それぞれの色係数の範囲は 0 以上、最大値以下である。 .\"0 For example, .\"0 a common colormap allocation is 3/3/2 (3 planes for red, 3 .\"0 planes for green, and 2 planes for blue). 例えば、標準的なカラーマップの配置は 3/3/2である(赤に3プレーン、緑に3 プレーン、青に2プレーン)。 .\"0 This colormap would have red_max = 7, green_max = 7, .\"0 and blue_max = 3. このカラーマップは red_max = 7, green_max = 7, blue_max = 3 となる。 .\"0 An alternate allocation that uses only 216 colors is red_max = 5, .\"0 green_max = 5, and blue_max = 5. 216 色しか使わない別の配置としては、red_max = 5, green_max = 5, blue_max = 5 などが考えられる。 .LP .\"0 The red_mult, green_mult, and blue_mult members give the .\"0 scale factors used to compose a full pixel value. red_mult, green_mult, blue_mult メンバは完全なピクセル値を作るための倍 率を与える。 .\"0 (See the discussion of the base_pixel members for further information.) (詳しい情報については base_pixels メンバの説明を参照すること。) .\"0 For a 3/3/2 allocation, red_mult might be 32, .\"0 green_mult might be 4, and blue_mult might be 1. 3/3/2 の配置の場合には red_mult は 32, green_mult は 4, blue_mult は 1 となる。 .\"0 For a 6-colors-each allocation, red_mult might be 36, .\"0 green_mult might be 6, and blue_mult might be 1. 6/6/6 の配置の場合には、red_mult は 36, green_mult は 6, blue_mult は 1 となる。 .LP .\"0 The base_pixel member gives the base pixel value used to .\"0 compose a full pixel value. base_pixel メンバは、完全なピクセル値を作るために使われるベースピクセ ル値を与える。 .\"0 Usually, the base_pixel is obtained from a call to the .\"0 .ZN XAllocColorPlanes .\"0 function. 通常、この base_pixel は関数 .ZN XAllocColorPlanes を呼び出して得る。 .\"0 Given integer red, green, and blue coefficients in their appropriate .\"0 ranges, one then can compute a corresponding pixel value by .\"0 using the following expression: 正しい範囲の RGB の各係数を与えると、対応するピクセル値は次の式で計算 できる。 .LP .Ds .TA .5i 1.5i .ta .5i 1.5i (r * red_mult + g * green_mult + b * blue_mult + base_pixel) & 0xFFFFFFFF .De .LP .\"0 For .\"0 .ZN GrayScale .\"0 colormaps, .\"0 only the colormap, red_max, red_mult, .\"0 and base_pixel members are defined. .ZN GrayScale カラーマップについては、colormap, red_max, red_mult, base_pixel メンバ だけが定義される。 .\"0 The other members are ignored. 他のメンバは無視される。 .\"0 To compute a .\"0 .ZN GrayScale .\"0 pixel value, use the following expression: .ZN GrayScale のピクセル値の計算には次の式を使用する。 .LP .Ds .TA .5i 1.5i .ta .5i 1.5i (gray * red_mult + base_pixel) & 0xFFFFFFFF .De .LP .\"0 Negative multipliers can be represented by converting the 2's .\"0 complement representation of the multiplier into an unsigned long and .\"0 storing the result in the appropriate _mult field. 負の乗数を表すには、その乗数の 2 の補数表現を unsigned long に変換し、 その結果を適切な _mult フィールドに保存すれば良い。 .\"0 The step of masking by 0xFFFFFFFF effectively converts the resulting .\"0 positive multiplier into a negative one. 0xFFFFFFFF のマスクを掛ける段階で、得られた正の乗数を負の乗数に効 率的に変換することができる。 .\"0 The masking step will take place automatically on many machine architectures, .\"0 depending on the size of the integer type used to do the computation, 多くの計算機アーキテクチャでは、マスキングの処理は計算に使用される 整数のサイズに依存して自動的に行われる。 .LP .\"0 The visualid member gives the ID number of the visual from which the .\"0 colormap was created. visualid メンバは、カラーマップを生成したビジュアルの ID 番号を与える。 .\"0 The killid member gives a resource ID that indicates whether .\"0 the cells held by this standard colormap are to be released .\"0 by freeing the colormap ID or by calling the .\"0 .ZN XKillClient .\"0 function on the indicated resource. killid メンバは、リソースIDを与える。 このリソースIDは、この標準カラーマップが保持しているセルをカラーマップ ID の解放によって解放するのか、指定されたリソースについての .ZN XKillClient の呼び出しによって行うのかを示す。 .\"0 (Note that this method is necessary for allocating out of an existing colormap.) (この方法は、現在は存在しないカラーマップを割り当てる場合に必要である。) .LP .\"0 The properties containing the .\"0 .ZN XStandardColormap .\"0 information have .\"0 the type RGB_COLOR_MAP. .ZN XStandardColormap の情報を含むプロパティの型は RGB_COLOR_MAP である。 .SH 返り値 .TP 1i .ZN BadAlloc .\"0 The server failed to allocate the requested resource or server memory. 要求されたリソースやサーバメモリの割り当てにサーバが失敗した。 .TP 1i .ZN BadAtom .\"0 A value for an Atom argument does not name a defined Atom. Atom 型の引き数の値が、定義されているアトムでない。 .TP 1i .ZN BadWindow .\"0 A value for a Window argument does not name a defined Window. Window 型の引き数の値が、定義されているウィンドウでない。 .SH 関連項目 XAllocColor(3X11), XCreateColormap(3X11), XFree(3X11), XSetCloseDownMode(3X11) .br \fI\*(xL\fP