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

GDK Reference Manual

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

  Returns : the X error code, or 0 if no error occurred.

  Points, Rectangles and Regions

  Name

  Points, Rectangles and Regions -- simple graphical data types.

  Synopsis


#include <gdk/gdk.h>
structGdkPoint;
structGdkRectangle;
gintgdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,GdkRectangle *dest);
voidgdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,GdkRectangle *dest);
structGdkRegion;
GdkRegion*gdk_region_new(void);
GdkRegion*gdk_region_polygon(GdkPoint *points,
gint npoints,GdkFillRule fill_rule);
enumGdkFillRule;
voidgdk_region_destroy(GdkRegion *region);
GdkRegion*gdk_regions_intersect (GdkRegion *source1,GdkRegion *source2);
GdkRegion*gdk_regions_union (GdkRegion *source1,GdkRegion *source2);
GdkRegion*gdk_regions_subtract(GdkRegion *source1,GdkRegion *source2);
GdkRegion*gdk_regions_xor (GdkRegion *source1,GdkRegion *source2);
GdkRegion*gdk_region_union_with_rect(GdkRegion *region,GdkRectangle *rect);
voidgdk_region_offset (GdkRegion *region,gint dx,gint dy);
voidgdk_region_shrink (GdkRegion *region,gint dx,gint dy);
gbooleangdk_region_empty(GdkRegion *region);
gbooleangdk_region_equal(GdkRegion *region1,GdkRegion *region2);
gbooleangdk_region_point_in (GdkRegion *region,int x,int y);
GdkOverlapType gdk_region_rect_in (GdkRegion *region,GdkRectangle *rect);
enumGdkOverlapType;
voidgdk_region_get_clipbox(GdkRegion *region,GdkRectangle *rectangle); 

  Description

  GDK provides the GdkPoint, GdkRectangle and GdkRegion data types for representing pixels and sets of pixels on the screen.

  GdkPoint is a simple structure containing an x and y coordinate of a point.

  GdkRectangle is a structure holding the position and size of a rectangle. The intersection of two rectangles can be computed with gdk_rectangle_intersect(). To find the union of two rectangles use gdk_rectangle_union().

  GdkRegion is an opaque data type holding a set of arbitrary pixels, and is usually used for clipping graphical operations (see gdk_gc_set_clip_region()).

  Details

  struct GdkPoint


struct GdkPoint
{
gint16 x;
gint16 y;
}; 

  Defines the x and y coordinates of a point. Note that both are defined as gint16 values, so the coordinates are limited to between -32,768 and 32,767.

  gint16 x the x coordinate of the point.

  gint16 y the y coordinate of the point.

  struct GdkRectangle


struct GdkRectangle
{
gint16 x;
gint16 y;
guint16 width;
guint16 height;
}; 

  Defines the position and size of a rectangle.

  gint16 x the x coordinate of the left edge of the rectangle.

  gint16 y the y coordinate of the top of the rectangle.

  guint16 width the width of the rectangle.

  guint16 height the height of the rectangle.


gdk_rectangle_intersect ()
gintgdk_rectangle_intersect (GdkRectangle *src1,
GdkRectangle *src2,GdkRectangle *dest); 

  Calculates the intersection of two rectangles.

  src1 : a GdkRectangle.

  src2 : a GdkRectangle.

  dest : the intersection of src1 and src2.

  Returns : TRUE if the rectangles intersect.


gdk_rectangle_union ()
voidgdk_rectangle_union (GdkRectangle *src1,
GdkRectangle *src2,GdkRectangle *dest); 

  Calculates the union of two rectangles. The union of rectangles src1 and src2 is the smallest rectangle which includes both src1 and src2 within it.

  src1 : a GdkRectangle.

  src2 : a GdkRectangle.

  dest : the union of src1 and src2.

  struct GdkRegion


struct GdkRegion
{
gpointer user_data;
}; 

  A GdkRegion represents a set of pixels on the screen. The only user-visible field of the structure is the user_data member, which can be used to attach arbitrary data to the GdkRegion.

  gpointer user_data arbitrary data attached to the GdkRegion.


gdk_region_new ()
GdkRegion*gdk_region_new(void); 

  Creates a new empty GdkRegion.

  Returns : a new empty GdkRegion.

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



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

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