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

GDK Reference Manual

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

  Returns TRUE if the GdkRegion is empty.

  region : a GdkRegion.

  Returns : TRUE if region is empty.


gdk_region_equal ()
gbooleangdk_region_equal(GdkRegion *region1,GdkRegion *region2); 

  Returns TRUE if the two regions are the same.

  region1 : a GdkRegion.

  region2 : a GdkRegion.

  Returns : TRUE if region1 and region2 are equal.


gdk_region_point_in ()
gbooleangdk_region_point_in (GdkRegion *region,int x,int y); 

  Returns TRUE if a point is in a region.

  region : a GdkRegion.

  x : the x coordinate of a point.

  y : the y coordinate of a point.

  Returns : TRUE if the point is in region.


gdk_region_rect_in ()
GdkOverlapType gdk_region_rect_in (GdkRegion *region,
GdkRectangle *rect); 

  Tests whether a rectangle is within a region.

  region : a GdkRegion.

  rect : a GdkRectangle.

  Returns : GDK_OVERLAP_RECTANGLE_IN, GDK_OVERLAP_RECTANGLE_OUT, or GDK_OVERLAP_RECTANGLE_PART, depending on whether the rectangle is inside, outside, or partly inside the GdkRegion, respectively.

  enum GdkOverlapType


typedef enum
{
GDK_OVERLAP_RECTANGLE_IN,
GDK_OVERLAP_RECTANGLE_OUT,
GDK_OVERLAP_RECTANGLE_PART
} GdkOverlapType; 

  Specifies the possible values returned by gdk_region_rect_in().

  GDK_OVERLAP_RECTANGLE_IN if the rectangle is inside the GdkRegion.

  GDK_OVERLAP_RECTANGLE_OUT if the rectangle is outside the GdkRegion.

  GDK_OVERLAP_RECTANGLE_PART if the rectangle is partly inside the GdkRegion.


gdk_region_get_clipbox ()
voidgdk_region_get_clipbox(GdkRegion *region,
GdkRectangle *rectangle); 

  Returns the smallest rectangle which includes the entire GdkRegion.

  region : a GdkRegion.

  rectangle : returns the smallest rectangle which includes all of region.

  Graphics Contexts

  Name

  Graphics Contexts -- objects to encapsulate drawing properties.

  Synopsis


#include <gdk/gdk.h>
structGdkGC;
structGdkGCValues;
enumGdkGCValuesMask;
enumGdkFunction;
GdkGC*gdk_gc_new(GdkWindow *window);
GdkGC*gdk_gc_new_with_values(GdkWindow *window,
GdkGCValues *values,GdkGCValuesMask values_mask);
GdkGC*gdk_gc_ref(GdkGC *gc);
voidgdk_gc_unref(GdkGC *gc);
voidgdk_gc_destroy(GdkGC *gc);
voidgdk_gc_get_values (GdkGC *gc,GdkGCValues *values);
voidgdk_gc_set_foreground (GdkGC *gc,GdkColor *color);
voidgdk_gc_set_background (GdkGC *gc,GdkColor *color);
voidgdk_gc_set_font (GdkGC *gc,GdkFont *font);
voidgdk_gc_set_function (GdkGC *gc,GdkFunction function);
voidgdk_gc_set_fill (GdkGC *gc,GdkFill fill);
enumGdkFill;
voidgdk_gc_set_tile (GdkGC *gc,GdkPixmap *tile);
voidgdk_gc_set_stipple(GdkGC *gc,GdkPixmap *stipple);
voidgdk_gc_set_ts_origin(GdkGC *gc,gint x,gint y);
voidgdk_gc_set_clip_origin(GdkGC *gc,gint x,gint y);
voidgdk_gc_set_clip_mask(GdkGC *gc,GdkBitmap *mask);
voidgdk_gc_set_clip_rectangle (GdkGC *gc,GdkRectangle *rectangle);
voidgdk_gc_set_clip_region(GdkGC *gc,GdkRegion *region);
voidgdk_gc_set_subwindow(GdkGC *gc,GdkSubwindowMode mode);
enumGdkSubwindowMode;
voidgdk_gc_set_exposures(GdkGC *gc,gint exposures);
voidgdk_gc_set_line_attributes(GdkGC *gc,gint line_width,
GdkLineStyle line_style,GdkCapStyle cap_style,GdkJoinStyle join_style);
enumGdkLineStyle;
enumGdkCapStyle;
enumGdkJoinStyle;
voidgdk_gc_set_dashes (GdkGC *gc,gint dash_offset,gchar dash_list[],gint n);
voidgdk_gc_copy (GdkGC *dst_gc,GdkGC *src_gc); 

  Description

  All drawing operations in GDK take a graphics context (GC) argument. A graphics context encapsulates information about the way things are drawn, such as the foreground color or line width. By using graphics contexts, the number of arguments to each drawing call is greatly reduced, and communication overhead is minimized, since identical arguments do not need to be passed repeatedly.

  Most values of a graphics context can be set at creation time by using gdk_gc_new_with_values(), or can be set one-by-one using functions such as gdk_gc_set_foreground(). A few of the values in the GC, such as the dash pattern, can only be set by the latter method.

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



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

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