Linux中国 Linux中国门户站!
设为主页 设为主页
收藏本站 收藏本站
 
当前位置 :首页 ->Linux技术 ->系统管理 ->正文

GDK Reference Manual

来源:Linux-cn.com 作者:Webmaster 时间:2007-05-05 点击: [收藏] [投稿]

  Details

  struct GdkGC


struct GdkGC
{
gint dummy_var;
}; 

  The GdkGC structure represents a graphics context. It is an opaque structure with no user-visible elements.

  struct GdkGCValues


struct GdkGCValues
{
GdkColorforeground;
GdkColorbackground;
GdkFont *font;
GdkFunctionfunction;
GdkFillfill;
GdkPixmap *tile;
GdkPixmap *stipple;
GdkPixmap *clip_mask;
GdkSubwindowModesubwindow_mode;
gintts_x_origin;
gintts_y_origin;
gintclip_x_origin;
gintclip_y_origin;
gintgraphics_exposures;
gintline_width;
GdkLineStyleline_style;
GdkCapStylecap_style;
GdkJoinStylejoin_style;
}; 

  The GdkGCValues structure holds a set of values used to create or modify a graphics context.

  GdkColor foreground; the foreground color.

  GdkColor background; the background color.

  GdkFont *font; the default font..

  GdkFunction function; the bitwise operation used when drawing.

  GdkFill fill; the fill style.

  GdkPixmap *tile; the tile pixmap.

  GdkPixmap *stipple; the stipple bitmap.

  GdkPixmap *clip_mask; the clip mask bitmap.

  GdkSubwindowMode subwindow_mode; the subwindow mode.

  gint ts_x_origin; the x origin of the tile or stipple.

  gint ts_y_origin; the y origin of the tile or stipple.

  gint clip_x_origin; the x origin of the clip mask.

  gint clip_y_origin; the y origin of the clip mask.

  gint graphics_exposures; whether graphics exposures are enabled.

  gint line_width; the line width

  GdkLineStyle line_style; the way dashed lines are drawn

  GdkCapStyle cap_style; the way the ends of lines are drawn

  GdkJoinStyle join_style; the way joins between lines are drawn

  enum GdkGCValuesMask


typedef enum
{
GDK_GC_FOREGROUND= 1 << 0,
GDK_GC_BACKGROUND= 1 << 1,
GDK_GC_FONT = 1 << 2,
GDK_GC_FUNCTION= 1 << 3,
GDK_GC_FILL = 1 << 4,
GDK_GC_TILE = 1 << 5,
GDK_GC_STIPPLE = 1 << 6,
GDK_GC_CLIP_MASK = 1 << 7,
GDK_GC_SUBWINDOW = 1 << 8,
GDK_GC_TS_X_ORIGIN = 1 << 9,
GDK_GC_TS_Y_ORIGIN = 1 << 10,
GDK_GC_CLIP_X_ORIGIN = 1 << 11,
GDK_GC_CLIP_Y_ORIGIN = 1 << 12,
GDK_GC_EXPOSURES = 1 << 13,
GDK_GC_LINE_WIDTH= 1 << 14,
GDK_GC_LINE_STYLE= 1 << 15,
GDK_GC_CAP_STYLE = 1 << 16,
GDK_GC_JOIN_STYLE= 1 << 17
} GdkGCValuesMask; 

  A set of bit flags used to indicate which fields GdkGCValues structure are set.

  enum GdkFunction


typedef enum
{
GDK_COPY,
GDK_INVERT,
GDK_XOR,
GDK_CLEAR,
GDK_AND,
GDK_AND_REVERSE,
GDK_AND_INVERT,
GDK_NOOP,
GDK_OR,
GDK_EQUIV,
GDK_OR_REVERSE,
GDK_COPY_INVERT,
GDK_OR_INVERT,
GDK_NAND,
GDK_SET
} GdkFunction; 

  Determines how the bit values for the source pixels are combined with the bit values for destination pixels to produce the final result. The sixteen values here correspond to the 16 different possible 2x2 truth tables. Only a couple of these values are usually useful; for colored images, only GDK_COPY, GDK_XOR and GDK_INVERT are generally useful. For bitmaps, GDK_AND and GDK_OR are also useful.


gdk_gc_new ()
GdkGC*gdk_gc_new(GdkWindow *window); 

  Create a new graphics context with default values.

  window : a GdkDrawable. The created GC must always be used with drawables of the same depth as this one.

  Returns : the new graphics context.


gdk_gc_new_with_values ()
GdkGC*gdk_gc_new_with_values(GdkWindow *window,
GdkGCValues *values,GdkGCValuesMask values_mask); 

  Create a new GC with the given initial values.

  window : a GdkDrawable. The created GC must always be used with drawables of the same depth as this one.

  values : a structure containing initial values for the GC.

  values_mask : a bit mask indicating which fields in values are set.

  Returns : the new graphics context.


gdk_gc_ref ()
GdkGC*gdk_gc_ref(GdkGC *gc); 

  Increase the reference count on a graphics context.

 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<



上一篇:GTK v1.2 Tutorial(英文)   下一篇:Java入门(12) 事件与错误处理

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章
Power by linux-cn.com 粤ICP备05006655号