亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? graphics-gdk.html

?? linux下gnome編程
?? HTML
字號:
<HTML><HEAD><TITLE>The GDK Wrapper</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.61"><LINKREL="HOME"TITLE="Writing GNOME Applications"HREF="index.html"><LINKREL="UP"TITLE="Graphics"HREF="graphics.html"><LINKREL="PREVIOUS"TITLE="Graphics"HREF="graphics.html"><LINKREL="NEXT"TITLE="GdkRGB"HREF="graphics-gdkrgb.html"></HEAD><BODYCLASS="SECT1"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Writing GNOME Applications</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="graphics.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 10. Graphics</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="graphics-gdkrgb.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="GRAPHICS-GDK">The GDK Wrapper</A></H1><P>        Most of the X concepts we've covered so far apply very closely        to GDK, which, you may recall, provides a rather thin wrapper        around the Xlib drawing API.  We'll touch lightly on the GDK        wrapper in this section, before moving on to some actual        graphics code in the sections that follow.      </P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN733">Simpler API</A></H2><P>          The GDK wrapper does a lot to make Xlib more          palatable. Possibly the most important thing it does is          provide an abstraction layer around Xlib, which makes it          easier to port GTK+ and GNOME applications to new graphical          systems, like BeOS or Microsoft Windows. If you make sure          that your applications don't access anything lower than GDK,          you'll increase your chances of an easier port. When GDK is          ported to a new system, porting your own application will          often be as simple as a recompile and a handful of minor          tweaks (depending, of course, on what goes on in your          particular application). GDK also remaps the Xlib API into a          form more appropriate for and consistent with GTK+ and          GNOME. Where possible, it simplifies the parameter lists of          each function, making it easier to use.        </P><P>          Let's look at how the Xlib API for creating a new pixmap          compares to the GDK API. The relevant Xlib function is          XCreatePixmap( ):        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">Pixmap XCreatePixmap(Display *display, Drawable d,    unsigned int width, unsigned int height,    unsigned int depth)        </PRE></TD></TR></TABLE><P>          The GDK wrapper function combines the first two parameters          of XCreatePixmap( ) into the single GdkWindow parameter and          changes the function name into the GDK style:          gdk_pixmap_new( ). It also converts the unsigned int          parameters into the more abstracted gint types:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GdkPixmap* gdk_pixmap_new(GdkWindow *window,    gint width, gint height,    gint depth)        </PRE></TD></TR></TABLE><P>          As we'll see in Section 10.3, GDK also adds quite a bit of          new functionality that doesn't exist in Xlib's API. In          addition, it provides wrappers for all of the important X11          concepts, such as drawables (GdkDrawable, GdkPixmap, and          GdkWindow), colors (GdkColor and GdkColormap), visuals          (GdkVisual), and even fonts and cursors (GdkFont and          GdkCursor).        </P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN741">Using Color in GDK</A></H2><P>          Color management can be a convoluted nightmare with raw Xlib          applications.  At that level you have to keep track of which          visual you're in, how the color maps are laid out, whether          or not you can create new colors in the color maps, and many          other tedious, repetitive details. One of the blessings of          GDK is the way in which it abstracts most of these tasks          away from the applications programmer. You need to know          only a few simple functions, and GDK takes care of the rest.        </P><P>          The first thing you need is the color map. You can get the          default system color map with gdk_colormap_get_system( ). If          you need to know which color map a specific widget is using,          you can call gtk_widget_get_colormap( ) on it. GdkRGB and          Imlib (a graphics loading library used by GNOME 1.0) also          offer access to their own tuned color maps, with          gdk_rgb_get_cmap( ) and gdk_imlib_get_colormap( ),          respectively.  And finally, if none of these other          preexisting color maps are good enough, you can create your          own color map with gdk_colormap_new( ), although you will          rarely have to go that far. The color map functions look          like this:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GdkColormap* gdk_colormap_get_system(  );GdkColormap* gtk_widget_get_colormap(GtkWidget *widget);GdkColormap* gdk_rgb_get_cmap(  );GdkColormap *gdk_imlib_get_colormap(  );GdkColormap* gdk_colormap_new (GdkVisual *visual,    gint allocate);        </PRE></TD></TR></TABLE><P>          It is generally a good idea to use the same color map with          all widgets in an application; when you start mixing color          maps, the color palette may flash whenever the focus          switches between widgets with different color maps, espe-          cially in lower color depths like 8-bit.        </P><P>          To obtain a color from a color map in GDK, you must allocate          it with a call to gdk_colormap_alloc_color( ):        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">gboolean gdk_colormap_alloc_color(GdkColormap *colormap,    GdkColor *color, gboolean writable, gboolean best_match);        </PRE></TD></TR></TABLE><P>          The writable parameter tells GDK to add the color to the          color map if it's not already there; writable is ignored in          read-only color maps. The best_match parameter instructs GDK          to find a nearby color if it can't find an exact match, in          which case it modifies the color value you passed in to          match the color it finds. These two parameters are more or          less mutually exclusive: If the color map is writable (such          as with GrayScale or PseudoColor visuals), GDK should          allocate a new color that exactly matches your request          rather than trying to find an approximate match. The most          common usage is to call the function with a writable of          FALSE and a best_match of TRUE.        </P><P>          To specify the color you want, you must populate a GdkColor          structure before passing it to gdk_colormap_alloc_color(          ). The GdkColor structure is very simple:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">struct GdkColor{  gulong pixel;  gushort red;  gushort green;  gushort blue;};        </PRE></TD></TR></TABLE><P>          It's your job to fill in the red, green, and blue fields,          and GDK's job to fill in the pixel field with the color map          index it finds for that color. You can fill in the RGB          values by hand, by choosing 16-bit values for each field,          like this:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GdkColor red =    { 0, 0xFFFF, 0x0000, 0x0000 };GdkColor yellow = { 0, 0xFFFF, 0xFFFF, 0x0000 };GdkColor gray =   { 0, 0x8888, 0x8888, 0x8888 };        </PRE></TD></TR></TABLE><P>          An easier, more intuitive way to initialize a GdkColor          structure is to use the gdk_color_parse( ) function. It          accepts a text string with a color name, like "red," "slate          gray," or "MediumSpringGreen"; you can also pass in an RGB          string-for example, "RGB:FF/FF/00"-to get results similar to          those obtained in the yellow example above. gdk_color_parse(          ) invokes the Xlib function XParseColor( ) to look up an RGB          value from a table of common colors        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">gint gdk_color_parse(const gchar *spec, GdkColor *color);        </PRE></TD></TR></TABLE><P>          The master list of these colors is in the rgb.txt file          distributed with the X Window System, in the directory          /usr/X11R6/lib/X11 or someplace similar.        </P><P>          You then pass the parsed GdkColor to          gdk_colormap_alloc_color( ), and if all goes right, you can          use that new color. You should always check the return          values on both of these functions to make sure that GDK          found a valid color for you. Here's a quick example of how          to retrieve a medium spring green from the system palette:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GdkColor color;GdkColormap *cmap = gdk_colormap_get_system(  );if (gdk_parse_color("MediumSpringGreen", &#38;color) &#38;&#38;    gdk_colormap_alloc_color(cmap, &#38;color, FALSE, TRUE)){  /* Use our MediumSpringGreen for a nice pastoral scene */}else{  /* Go find some other nice green */}        </PRE></TD></TR></TABLE><P>          Because of the GDK abstraction layer, this simple block of          code will work on any visual. You don't have to worry about          what the color depth is, or whether or not the color map is          writable. GDK will handle these details and return a          sensible result or bail out with a FALSE if it can't.        </P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="graphics.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="graphics-gdkrgb.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Graphics</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="graphics.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">GdkRGB</TD></TR></TABLE></DIV></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲另类在线视频| 日韩视频一区二区三区在线播放| www国产成人免费观看视频 深夜成人网| 亚洲在线视频网站| 在线一区二区三区做爰视频网站| 日韩久久久精品| 久久精品国产一区二区三区免费看| 69成人精品免费视频| 午夜久久久久久久久| 欧美一三区三区四区免费在线看| 日韩电影免费一区| 91麻豆精品国产自产在线观看一区| 日韩美女视频一区二区| 92精品国产成人观看免费| 亚洲人亚洲人成电影网站色| 欧美少妇bbb| 狠狠v欧美v日韩v亚洲ⅴ| 国产精品黄色在线观看| 欧美日韩国产首页在线观看| 国产一区在线精品| 亚洲精品免费看| 欧美成人aa大片| 色视频一区二区| 黄一区二区三区| 一区二区三区中文字幕电影| 日韩欧美一级精品久久| 99久久亚洲一区二区三区青草| 午夜激情久久久| 欧美国产成人在线| 欧美日韩精品一区二区天天拍小说 | 亚洲一区在线观看免费观看电影高清 | 欧美日本在线一区| 国产乱人伦偷精品视频免下载| 一区二区三区日韩| 久久久久久久电影| 欧美日韩电影在线| 国产成人欧美日韩在线电影| 天天色天天操综合| 国产精品久久久久婷婷二区次| 日韩一区二区三区视频| 欧美专区日韩专区| 成人a免费在线看| 九九久久精品视频| 亚洲成av人片在线观看无码| 国产亚洲欧洲997久久综合| 欧美日本国产一区| 色香色香欲天天天影视综合网| 国产一区二区免费看| 日本中文一区二区三区| 亚洲尤物在线视频观看| 中文字幕日韩一区二区| 久久久久久电影| 日韩一区二区在线观看视频| 在线免费不卡视频| 99re66热这里只有精品3直播 | 成人黄色在线视频| 国产一区亚洲一区| 精品影院一区二区久久久| 日本午夜一本久久久综合| 亚洲线精品一区二区三区| 国产三级欧美三级日产三级99| 欧美久久一二三四区| 欧美网站大全在线观看| 色哟哟一区二区三区| 99在线精品免费| 国产sm精品调教视频网站| 国内国产精品久久| 激情欧美一区二区三区在线观看| 奇米影视7777精品一区二区| 天堂一区二区在线| 日韩高清欧美激情| 美女爽到高潮91| 免费成人av资源网| 久久激情五月婷婷| 国产一区二区在线观看视频| 久久er精品视频| 国产一区二区在线观看免费| 国产精品99久久不卡二区| 国产高清久久久久| 国产91丝袜在线播放九色| 国产成人自拍在线| 波多野结衣亚洲一区| 97国产精品videossex| 欧美在线观看禁18| 8x8x8国产精品| 欧美成人video| 国产视频一区二区在线| 中文字幕在线不卡| 亚洲图片欧美综合| 日韩高清在线一区| 国产一区999| 91麻豆成人久久精品二区三区| 在线观看视频一区二区欧美日韩| 欧美日韩一区小说| 欧美成人乱码一区二区三区| 久久毛片高清国产| 亚洲视频在线观看三级| 亚洲mv在线观看| 国内精品伊人久久久久av一坑 | 久久丁香综合五月国产三级网站| 国产综合色在线视频区| 成人av在线影院| 欧美自拍丝袜亚洲| 欧美变态凌虐bdsm| 国产精品女主播av| 亚洲成av人影院在线观看网| 久久成人免费网| a在线欧美一区| 在线电影国产精品| 久久久三级国产网站| 亚洲尤物视频在线| 国产一区二区福利| 在线亚洲一区二区| 精品国产乱码久久| 亚洲女人****多毛耸耸8| 免费观看成人av| 91在线观看免费视频| 日韩三级视频中文字幕| 久久久久亚洲蜜桃| 亚洲国产精品久久久久秋霞影院| 韩国精品主播一区二区在线观看| 色偷偷久久一区二区三区| 精品国产一区二区三区不卡| 夜夜操天天操亚洲| 国产99久久久久久免费看农村| 欧美日韩精品一二三区| 亚洲精选免费视频| 久久国产人妖系列| 欧美性感一类影片在线播放| 欧美激情一区二区三区在线| 奇米精品一区二区三区在线观看| jlzzjlzz欧美大全| 久久综合久久综合亚洲| 亚洲国产精品视频| 国产成人av电影在线观看| 欧美精品免费视频| 亚洲乱码中文字幕综合| 国产成人精品aa毛片| 日韩欧美中文字幕精品| 亚洲成人久久影院| 91久久国产最好的精华液| 久久蜜桃av一区精品变态类天堂| 图片区日韩欧美亚洲| 色婷婷综合久久久中文字幕| 国产欧美日韩在线视频| 激情综合一区二区三区| 69久久99精品久久久久婷婷| 亚洲午夜影视影院在线观看| 99国产精品视频免费观看| 国产午夜亚洲精品午夜鲁丝片| 亚洲福利视频一区| 一本色道久久综合亚洲精品按摩| 欧美国产一区在线| 国产九九视频一区二区三区| 日韩欧美aaaaaa| 喷白浆一区二区| 这里只有精品99re| 日韩不卡手机在线v区| 欧美日韩高清在线| 天天爽夜夜爽夜夜爽精品视频| 日本福利一区二区| 亚洲自拍偷拍麻豆| 欧美三级中文字幕| 亚洲成人激情社区| 欧美精品第一页| 首页国产丝袜综合| 日韩一级视频免费观看在线| 蜜桃视频一区二区三区在线观看| 91精品国产91综合久久蜜臀| 日韩av电影免费观看高清完整版在线观看 | 欧美一区二区观看视频| 日本成人超碰在线观看| 日韩久久久精品| 国产一区二区电影| 国产精品每日更新在线播放网址| 国产大陆亚洲精品国产| 欧美国产1区2区| 91色婷婷久久久久合中文| 亚洲一区二三区| 在线不卡一区二区| 成人久久18免费网站麻豆 | 99视频一区二区| 亚洲女与黑人做爰| 欧美日韩国产高清一区二区三区 | 免费精品99久久国产综合精品| 欧美xxx久久| 成人午夜激情影院| 一区二区高清视频在线观看| 欧美色视频在线| 久久国产欧美日韩精品| 欧美国产日本韩| 欧美性受xxxx| 精品一区二区三区视频| 日本一区二区三区四区在线视频| av亚洲精华国产精华精| 亚洲一区电影777| 精品国产乱码久久久久久蜜臀 | 午夜精品久久久久影视| 精品国偷自产国产一区| 99国内精品久久|