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

GDK Reference Manual

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

/* This data is in X bitmap format, and can be created with the 'bitmap'
utility. */
define cursor1_width 16
define cursor1_height 16
static unsigned char cursor1_bits[] = {
0x80, 0x01, 0x40, 0x02, 0x20, 0x04, 0x10, 0x08, 0x08, 0x10, 0x04, 0x20,
0x82, 0x41, 0x41, 0x82, 0x41, 0x82, 0x82, 0x41, 0x04, 0x20, 0x08, 0x10,
0x10, 0x08, 0x20, 0x04, 0x40, 0x02, 0x80, 0x01};
static unsigned char cursor1mask_bits[] = {
0x80, 0x01, 0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x18, 0x18, 0x8c, 0x31,
0xc6, 0x63, 0x63, 0xc6, 0x63, 0xc6, 0xc6, 0x63, 0x8c, 0x31, 0x18, 0x18,
0x30, 0x0c, 0x60, 0x06, 0xc0, 0x03, 0x80, 0x01};
GdkCursor *cursor;
GdkPixmap *source, *mask;
GdkColor fg = { 0, 65535, 0, 0 }; /* Red. */
GdkColor bg = { 0, 0, 0, 65535 }; /* Blue. */
source = gdk_bitmap_create_from_data (NULL, cursor1_bits,
cursor1_width, cursor1_height);
mask = gdk_bitmap_create_from_data (NULL, cursor1mask_bits,
cursor1_width, cursor1_height);
cursor = gdk_cursor_new_from_pixmap (source, mask, &fg, &bg, 8, 8);
gdk_pixmap_unref (source);
gdk_pixmap_unref (mask);
gdk_window_set_cursor (widget->window, cursor); 

  source : the pixmap specifying the cursor.

  mask : the pixmap specifying the mask, which must be the same size as source.

  fg : the foreground color, used for the bits in the source which are 1. The color does not have to be allocated first.

  bg : the background color, used for the bits in the source which are 0. The color does not have to be allocated first.

  x : the horizontal offset of the 'hotspot' of the cursor.

  y : the vertical offset of the 'hotspot' of the cursor.

  Returns : a new GdkCursor.


gdk_cursor_destroy ()
voidgdk_cursor_destroy(GdkCursor *cursor); 

  Destroys a cursor, freeing any resources allocated for it.

  cursor : a GdkCursor.

Windows

Name

  Windows --

Synopsis


#include <gdk/gdk.h>
structGdkWindowAttr;
structGdkWindow;
enumGdkWindowType;
enumGdkWindowClass;
enumGdkWindowAttributesType;
enumGdkWindowHints;
structGdkGeometry;
GdkWindow*gdk_window_new(GdkWindow *parent,
GdkWindowAttr *attributes,gint attributes_mask);
voidgdk_window_destroy(GdkWindow *window);
GdkWindow*gdk_window_ref(GdkWindow *window);
voidgdk_window_unref(GdkWindow *window);
GdkWindow*gdk_window_at_pointer (gint *win_x,gint *win_y);
voidgdk_window_show (GdkWindow *window);
voidgdk_window_hide (GdkWindow *window);
gbooleangdk_window_is_visible (GdkWindow *window);
gbooleangdk_window_is_viewable(GdkWindow *window);
voidgdk_window_withdraw (GdkWindow *window);
voidgdk_window_move (GdkWindow *window,gint x,gint y);
voidgdk_window_resize (GdkWindow *window,gint width,gint height);
voidgdk_window_move_resize(GdkWindow *window,
gint x,gint y,gint width,gint height);
voidgdk_window_reparent (GdkWindow *window,
GdkWindow *new_parent,gint x,gint y);
voidgdk_window_clear(GdkWindow *window);
voidgdk_window_clear_area (GdkWindow *window,
gint x,gint y,gint width,gint height);
voidgdk_window_clear_area_e (GdkWindow *window,
gint x,gint y,gint width,gint height);
voidgdk_window_copy_area(GdkWindow *window,
GdkGC *gc,gint x,gint y,GdkWindow *source_window,
gint source_x,gint source_y,gint width,gint height);
voidgdk_window_raise(GdkWindow *window);
voidgdk_window_lower(GdkWindow *window);
voidgdk_window_register_dnd (GdkWindow *window);
voidgdk_window_set_user_data(GdkWindow *window,gpointer user_data);
voidgdk_window_set_override_redirect
(GdkWindow *window,gboolean override_redirect);
voidgdk_window_add_filter (GdkWindow *window,
GdkFilterFunc function,gpointer data);
voidgdk_window_remove_filter(GdkWindow *window,
GdkFilterFunc function,gpointer data);
GdkFilterReturn (*GdkFilterFunc)(GdkXEvent *xevent,
GdkEvent *event,gpointer data);
enumGdkFilterReturn;
typedef GdkXEvent;
voidgdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *shape_mask,gint offset_x,gint offset_y);
voidgdk_window_set_child_shapes (GdkWindow *window);
voidgdk_window_merge_child_shapes (GdkWindow *window);
gbooleangdk_window_set_static_gravities (GdkWindow *window,
gboolean use_static);
voidgdk_window_set_hints(GdkWindow *window,gint x,gint y,
gint min_width,gint min_height,gint max_width,gint max_height,gint flags);
voidgdk_window_set_title(GdkWindow *window,const gchar *title);
voidgdk_window_set_background (GdkWindow *window,GdkColor *color);
voidgdk_window_set_back_pixmap(GdkWindow *window,GdkPixmap *pixmap,
gint parent_relative);
#define GDK_PARENT_RELATIVE
voidgdk_window_set_cursor (GdkWindow *window,GdkCursor *cursor);
voidgdk_window_set_colormap (GdkWindow *window,GdkColormap *colormap);
voidgdk_window_get_user_data(GdkWindow *window,gpointer *data);
voidgdk_window_get_geometry (GdkWindow *window,gint *x,gint *y,
gint *width,gint *height,gint *depth);
voidgdk_window_set_geometry_hints (GdkWindow *window,
GdkGeometry *geometry,GdkWindowHints flags);
voidgdk_window_get_position (GdkWindow *window,gint *x,gint *y);
voidgdk_window_get_root_origin(GdkWindow *window,gint *x,gint *y);
voidgdk_window_get_size (GdkWindow *window,gint *width,gint *height);
GdkVisual*gdk_window_get_visual (GdkWindow *window);
GdkColormap* gdk_window_get_colormap(GdkWindow *window);
GdkWindowType gdk_window_get_type (GdkWindow *window);
gintgdk_window_get_origin (GdkWindow *window,gint *x,gint *y);
gbooleangdk_window_get_deskrelative_origin
(GdkWindow *window,gint *x,gint *y);
GdkWindow*gdk_window_get_pointer(GdkWindow *window,
gint *x,gint *y,GdkModifierType *mask);
enumGdkModifierType;
GdkWindow*gdk_window_get_parent (GdkWindow *window);
GdkWindow*gdk_window_get_toplevel (GdkWindow *window);
GList*gdk_window_get_children (GdkWindow *window);
GdkEventMask gdk_window_get_events(GdkWindow *window);
voidgdk_window_set_events (GdkWindow *window,GdkEventMask event_mask);
voidgdk_window_set_icon (GdkWindow *window,
GdkWindow *icon_window,GdkPixmap *pixmap,GdkBitmap *mask);
voidgdk_window_set_icon_name(GdkWindow *window,gchar *name);
voidgdk_window_set_transient_for(GdkWindow *window,GdkWindow *leader);
voidgdk_window_set_role (GdkWindow *window,const gchar *role);
voidgdk_window_set_group(GdkWindow *window,GdkWindow *leader);
voidgdk_window_set_decorations(GdkWindow *window,GdkWMDecoration decorations);
enumGdkWMDecoration;
voidgdk_window_set_functions(GdkWindow *window,GdkWMFunction functions);
enumGdkWMFunction;
GList*gdk_window_get_toplevels(void);
structGdkDrawable;
voidgdk_drawable_set_data (GdkDrawable *drawable,
const gchar *key,gpointer data,GDestroyNotify destroy_func); 


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



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

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