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

GDK Reference Manual

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

  The functions in this section are used to add, remove and change properties on windows, to convert atoms to and from strings and to manipulate some types of data commonly stored in X window properties.

Details

  GdkAtom

  typedef gulongGdkAtom;

  A numeric type representing a string as an index into a table of strings on the X server.


GDK_NONE
#define GDK_NONE 0L 
gdk_text_property_to_text_list ()
gintgdk_text_property_to_text_list(GdkAtom encoding,
gint format,guchar *text,gint length,gchar ***list); 

  Convert a text string from the encoding as it is stored in a property into an array of strings in the encoding of the current local. (The elements of the array represent the null-separated elements of the original text string.)

  encoding : an atom representing the encoding. The most common values for this are STRING, or COMPOUND_TEXT. This is value used as the type for the property.

  format : the format of the property.

  text : the text data.

  length : the length of the property, in item.s

  list : location to store a terminated array of strings in the encoding of the current locale. This array should be freed using gdk_free_text_list().

  Returns : the number of strings stored in list, or 0, if the conversion failed.


gdk_free_text_list ()
voidgdk_free_text_list(gchar **list); 

  Free the array of strings created by gdk_text_property_to_text_list().

  list : the value stored in the list parameter by a call to gdk_text_property_to_text_list().


gdk_string_to_compound_text ()
gintgdk_string_to_compound_text (gchar *str,
GdkAtom *encoding,gint *format,guchar **ctext,gint *length); 

  Convert a string from the encoding of the current locale into a form suitable for storing in a window property.

  str : a null-terminated string.

  encoding : location to store the encoding atom (to be used as the type for the property).

  format : location to store the format for the property.

  ctext : location to store newly allocated data for the property.

  length : location to store the length of ctext in items.

  Returns : 0 upon sucess, non-zero upon failure.


gdk_free_compound_text ()
voidgdk_free_compound_text(guchar *ctext); 

  Free the data returned from gdk_string_to_compound_text().

  ctext : The pointer stored in ctext from a call to gdk_string_to_compound_text().


gdk_atom_intern ()
GdkAtom gdk_atom_intern (const gchar *atom_name,gint only_if_exists); 

  Find or create an atom corresponding to a given string.

  atom_name : a string.

  only_if_exists : if TRUE, do not create a new atom, but just return the atom if it already exists.

  Returns : the atom corresponding to atom_name, or, if only_if_exists is false, and an atom does not already exists for the string, GDK_NONE.


gdk_atom_name ()
gchar*gdk_atom_name (GdkAtom atom); 

  Determine the string corresponding to an atom.

  atom : a GdkAtom.

  Returns : a newly allocated string containing the string corresponding to atom. When you are done with the return value, you should free it using g_free().


gdk_property_get ()
gintgdk_property_get(GdkWindow *window,GdkAtom property,GdkAtom type,
gulong offset,gulong length,gint pdelete,GdkAtom *actual_property_type,
gint *actual_format,gint *actual_length,guchar **data); 

  Retrieves a portion of the contents of a property. If the property does not exist, then the function returns FALSE, and GDK_NONE will be stored in actual_property_type. Note: the XGetWindowProperty() function that gdk_property_get() uses has a very confusing and complicated set of semantics. Unfortunately, gdk_property_get() makes the situation worse instead of better (the semantics should be considered undefined), and also prints warnings to stderr in cases where it should return a useful error to the program. You are advised to use XGetWindowProperty() directly until a replacement function for gdk_property_get() is provided.

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



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

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