この一覧は、画像解析プログラムを Motif 版から Gtk+ 版に変換し た時に作成したものです。よろしかったら参考にしてみてください。
void XSetFillStyle (Display *display, GC gc, int fill_style);
fill_style -> FillSolod (1) FillTiled (2) FillOpaqueStippled (3) FillStippled (4)
void gdk_gc_set_fill (GdkGC *gc, GdkFill fill);
fill -> GDK_SOLID (1) GDK_TILED (2) GDK_STIPPLED (3) GDK_OPAQUE_STIPPLED (4)
(1)多角形の内部を全て一つの色で塗りつぶす方法。
(2)ピックスマップの単位パターン(タイル)で多角形の内部を埋める方法。
(3)不透明スティプルスタイルで多角形の内部を埋める方法。(マスク 0 の時 の色は、グラフィックス属性 background の値が用いられる)
(4)不透明スティプルスタイルで多角形の内部を埋める方法。(マスク 0 の時の色は、グラフィックス属性 foreground の値が用いられる)
void XSetTile (Display *display, GC gc, Pixmap tile);
void gdk_gc_set_tile (GdkGC *gc, GdkPixmap tile);
void XFillArc (Display *display, Window window, GC gc, int x, int y, int width, int height, int angle1, int angle2);
x, y : 座標 width : 幅 height : 高さ angle1 : 開始角(度数×64) angle2 : 内角(度数×64)
void gdk_draw_arc (GtkDrawable *drawable, GdkGC *gc, gint filled, gint x, gint y, gint width, gint height, gint angle1, gint angle2);
filled -> TRUE (XFillArc()) -> FALSE (XDrawArc())
x, y : 座標 width : 幅 height : 高さ angle1 : 開始角(度数×64) angle2 : 内角(度数×64)
void XFillRectangle (Display *display, Pixmap pixmap, GC gc, int x, int y, int width, int height);
x, y : 座標 width : 幅 height : 高さ
void gdk_draw_rectangle (GtkDrawable *drawable, GdkGC *gc, gint filled, gint x, gint y, gint width, gint height);
filled -> TRUE (XFillRectangle())
-> FALSE (XDrawRectangle())
x, y : 座標 width : 幅 height : 高さ
void XDrawPoint (Display *display, Drawable drw, GC gc, int x, int y);
x, y : 座標
void gdk_draw_point (GdkDrawable *drawable, GdkGC *gc, gint x, gint y);
x, y : 座標
void XDrawLine (Display *display, Drawable draw, GC gc, int x1, int y1, int x2, int y2);
x1, y1 : 始点座標 x2, y2 : 終点座標
void gdk_draw_line (GdkDrawable *drawzble, GdkGC *gc, gint x1, gint y1, gint x2, gint y2);
x1, y1 : 始点座標 x2, y2 : 終点座標
GC XCreateGC (Display *display, Drawable drw, unsigned long mask, XGCValues *values);
GdkGC* gdk_gc_new (GdkWindow *window);
void XFreeGC (Display *display, GC gc);
void gdk_gc_unref (GdkGC *gc);
void XSetForeground (Display *display, GC gc, unsigned long color);
color : 指定したい色のピクセル値
void gdk_rgb_gc_set_foreground (GdkGC *gc, unsigned long color);
color : 指定したい色のピクセル値
XImage* XCreateImage (Display *display, Visual *visual, int depth, ZPixmap, int x, int y, int width, int height);
depth : プレーン数 x, y : 座標 width : 幅 height : 高さ
GdkImage* gdk_image_new (GdkImageType type, GdkVisual *visual, gint width, gint height);
width : 幅 height : 高さ
type = GDK_IMAGE_NORMAL visual = gdk_visual_get_system();
void XDestroyImage (XImage *image);
void gdk_image_destroy (GdkImage *image);
XImage* XGetImage (Display *display, Window window, int x, int y, int width, int height, AllPlanes, ZPixmap);
x, y : 座標 width : 幅 height : 高さ
GdkImage* gdk_image_get (GdkWindow *window, gint x, gint y, gint width, gint height);
x, y : 座標 width : 幅 height : 高さ
Pixmap XCreatePixmap (Display *display, Drawable drw, int width, int height, int depth);
width : 幅 height : 高さ depth : プレーン数
GdkPixmap* gdk_pixmap_new (GdkWindow *window, gint width, gint height, gint depth);
width : 幅 height : 高さ depth : プレーン数
DefaultDepth (Display *display, int level);
GdkVisual* gdk_rgb_get_visual (void);
GdkVisual *visual; gint depth; depth = visual->depth;
void XFreePixmap (Display *display, Pixmap pixmap);
void gdk_pixmap_unref (GdkPixmap *pixmap);
Cursor XCreateFontCursor (Display *display, Coursor cursor_type)
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
cursor_type : XC_watch ==> GDK_WATCH XC_crosshair ==> GDK_CROSSHAIR
cursor_type は (gdkcursors.h) に一覧が載っている。
void XDefineCursor (Display *display, Window window, Cursor cursor);
void gdk_window_set_cursor (GdkWindow *window, GdkCursor *cursor);
void XCopyArea (Display *display, Drawable src, Drawable dest, GC gc, int source_x, int source_y, int width, int height, int dest_x, int dest_y);
src : コピー元の drawable dest : コピー先の drawable source_x, source_y : コピー元の座標 width : 幅 height : 高さ dest_x, dest_y : コピー先の座標
void gdk_window_copy_area (GdkWindow *window, GdkGC *gc, gint x, gint y, GdkWindow *source_window, gint source_x, gint source_y, gint width, gint height);
window : コピー先の window x, y : コピー先の座標 source_window : コピー元の window source_x, source_y : コピー元の座標 width : 幅 height : 高さ
void XPutImage (Display *display, Pixmap pixmap, GC gc, Image *image, int xsrc, int ysrc, int xdest, int ydest, int width, int height);
pixmap : 出力先の pixmap image : 出力元の image xsrc, ysrc : 出力元の座標 xdest, ydest : 出力先の座標 width : 幅 height : 高さ
void gdk_draw_image (GdkDrawable *drawable, GdkGC *gc, GdkImage *image, gint xsrc, gint ysrc, gint xdest, gint ydest, gint width, gint height);
drawable : 出力先の drawable image : 出力元の image xsrc, ysrc : 出力元の座標 xdest, ydest : 出力先の座標 width : 幅 height : 高さ
void XDrawString (Display *display, Drawable draw, GC gc, int x, int y, char *string, int length);
x, y : 出力されるテキストの位置 string : 出力したいテキスト length : 出力したいテキストの文字列
void gdk_draw_string (GdkDrawable *drawzble, GdkFont *font, GdkGC *gc, gint x, gint y, const gchar *string);
x, y : 出力されるテキストの位置 string : 出力したいテキスト length : 出力したいテキストの文字列
○ font 設定例
GdkFont *font;
font = gdk_fontset_load ("-misc-fixed-medium-r-normal-*-12-*-*-*-*-*-*-*");