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

GDK Reference Manual

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

  font : a GdkFont

  character : the character to measure.

  Returns : the height of the character in pixels.

  GdkWChar

  typedef guint32GdkWChar;

  Specifies a wide character type, used to represent character codes. This is needed since some native languages have character sets which have more than 256 characters (Japanese and Chinese, for example).

  Wide character values between 0 and 127 are always identical in meaning to the ASCII character codes. The wide character value 0 is often used to terminate strings of wide characters in a similar way to normal strings using the char type.

  An alternative to wide characters is multi-byte characters, which extend normal char strings to cope with larger character sets. As the name suggests, multi-byte characters use a different number of bytes to store different character codes. For example codes 0-127 (i.e. the ASCII codes) often use just one byte of memory, while other codes may use 2, 3 or even 4 bytes. Multi-byte characters have the advantage that they can often be used in an application with little change, since strings are still represented as arrays of char values. However multi-byte strings are much easier to manipulate since the character are all of the same size.

  Applications typically use wide characters to represent character codes internally, and multi-byte strings when saving the characters to a file. The gdk_wcstombs() and gdk_mbstowcs() functions can be used to convert from one representation to the other.

  See the 'Extended Characters' section of the GNU C Library Reference Manual for more detailed information on wide and multi-byte characters.


gdk_wcstombs ()
gchar*gdk_wcstombs(const GdkWChar *src); 

  Converts a wide character string to a multi-byte string. (The function name comes from an acronym of 'Wide Character String TO Multi-Byte String').

  src : a wide character string.

  Returns : the multi-byte string corresponding to src, or NULL if the conversion failed. The returned string should be freed with g_free() when no longer needed.


gdk_mbstowcs ()
gintgdk_mbstowcs(GdkWChar *dest,const gchar *src,gint dest_max); 

  Converts a multi-byte string to a wide character string. (The function name comes from an acronym of 'Multi-Byte String TO Wide Character String').

  dest : the space to place the converted wide character string into.

  src : the multi-byte string to convert, which must be null-terminated.

  dest_max : the maximum number of wide characters to place in dest.

  Returns : the number of wide characters written into dest, or -1 if the conversion failed.

  Cursors

Name

  Cursors -- standard and pixmap cursors.

Synopsis


#include <gdk/gdk.h>
structGdkCursor;
enumGdkCursorType;
GdkCursor*gdk_cursor_new(GdkCursorType cursor_type);
GdkCursor*gdk_cursor_new_from_pixmap(GdkPixmap *source,
GdkPixmap *mask,GdkColor *fg,GdkColor *bg,gint x,gint y);
voidgdk_cursor_destroy(GdkCursor *cursor); 

Description

Details

  struct GdkCursor


struct GdkCursor
{
GdkCursorType type;
}; 

  enum GdkCursorType


typedef enum
{
#include <gdk/gdkcursors.h>
GDK_LAST_CURSOR,
GDK_CURSOR_IS_PIXMAP = -1
} GdkCursorType; 

  The standard cursors available.


gdk_cursor_new ()
GdkCursor*gdk_cursor_new(GdkCursorType cursor_type); 

  Creates a new standard cursor.

  cursor_type : the type of the cursor.

  Returns : a new GdkCursor.


gdk_cursor_new_from_pixmap ()
GdkCursor*gdk_cursor_new_from_pixmap(GdkPixmap *source,
GdkPixmap *mask,GdkColor *fg,GdkColor *bg,gint x,gint y); 

  Creates a new cursor from a given pixmap and mask. Both the pixmap and mask must have a depth of 1 (i.e. each pixel has only 2 values - on or off). The standard cursor size is 16 by 16 pixels.

  Example 1. Creating a custom cursor.



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



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

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章