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

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

?? gdk.html

?? linux下gnome編程
?? HTML
字號:
<HTML><HEAD><TITLE>GDK</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.61"><LINKREL="HOME"TITLE="Writing GNOME Applications"HREF="index.html"><LINKREL="UP"TITLE="The GTK+/GNOME System"HREF="gtk-gnome-intro.html"><LINKREL="PREVIOUS"TITLE="The GTK+/GNOME System"HREF="gtk-gnome-intro.html"><LINKREL="NEXT"TITLE="GTK+"HREF="gtk.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="gtk-gnome-intro.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 2. The GTK+/GNOME System</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="gtk.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="GDK">GDK</A></H1><P>        The next discrete API layer is the GTK+ Drawing Kit (GDK), a        portable abstraction of the X Window System. GDK makes use of        GLib's containers and portability wrappers to act as the        foundation upon which GTK+ rests.      </P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN134">The GTK+ Connection</A></H2><P>          The GNOME GUI is built on the GIMP Toolkit (GTK+). The GIMP          (GNU Image Manipulation Program) is an open-source graphics          manipulation application along the lines of Adobe          Photoshop. GTK+ was created as a widget library for          GIMP. Many other people started using it for their own          projects, and over time it grew in popularity to become one          of the most beloved widget kits around.        </P><P>          GTK+ is divided into two major components: GDK and the          widget set.  GDK provides the basic services and resources          that the widgets rely on, such as event propagation,          graphics rendering, window creation, mouse cursors, keyboard          shortcuts, and drag-and-drop. GDK is a wrapper around the X          Window System and is (in theory) the sole access point          between GTK+ and the X server. GDK is the sandbox that GTK+          plays in. This abstraction makes it possible to port GTK+          to another windowing system: If you can port GDK, then GTK+          will follow with very little effort. This is a proven          theory. A version of GTK+ has already been ported to          Microsoft Windows!        </P><P>          Figure 2.4 lays all of this out, plus gnome-libs and its          core dependencies, in a hierarchical chart.        </P><DIVCLASS="FIGURE"><ANAME="AEN139"></A><P><B>Figure 2-4. The GNOME Dependency Tree</B></P><DIVCLASS="MEDIAOBJECT"><P><IMGSRC="figures/2f4.png"></IMG></P></DIV></DIV></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN144">The Thin Wrapper</A></H2><P>          If you're already familiar with X11 programming, you will          notice that many of the abstractions in GDK look very          similar to their X counterparts. Each server-side resource          in X typically has a similarly named structure in GDK. For          example, the Pixmap structure in Xlib has a matching          GdkPixmap structure with the same properties, plus a few          extra GDK-specific fields.        </P><P>          The function names are also very similar in most cases. For          example, the gdk_window_set_background( ) function is a          wrapper around the Xlib function XSetWindowBackground(          ). Often GDK does little more than provide defaults for          rarely used parameters in Xlib functions. GDK mimics the          Xlib function names where it can, and it tries to lend          consistency and ease of use in places where the Xlib          function names don't match the concepts behind GDK, such as          the gdk_window_set_title( ) function, which is a wrapper          around the Xlib function XmbSetWMProperties( ).        </P><P>          GDK also provides wrappers around other facets of the X          Window System, such as keyboard and mouse interaction,          drag-and-drop, and the many graphics functions of          Xlib. Other aspects of GDK aren't so thin, such as the          double-buffered drawing API GdkRGB and the event          system. We'll explore GDK graphics in Chapter 10 and the          event system in the next section.        </P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN149">GDK Events</A></H2><P>          The GDK event system is, as we've learned, a wrapper around          the X protocol's event queue. When something happens to a          window on the X server (each of which is encapsulated on the          client side by the GdkWindow structure), the X server sends          an appropriate X event to the client. This event travels          along a socket connection from the X server to the client,          across the Internet, across the network, or just "across"          your workstation if everything is running locally.        </P><P>          As part of its initialization routine, GDK installs a hook          into GLib's main loop that will monitor the X socket for new          X events. When something shows up-perhaps the user has just          resized your GNOME application's main window or typed          something on the keyboard-the main loop triggers GDK's          event-processing callback function. This callback pulls the          queued events off the socket one by one and translates them          into GdkEvent structures. GDK stores the GdkEvent instances          inside a queue of its own, in memory, ready to be pulled out          and processed at the widget level by GTK+. Some of these          events will end up triggering GTK+ signals (see Section          2.3.5).        </P><P>          Figure 2.5 illustrates this process. The gdk_event_get( )          function pulls X events from the (possibly remote) X server          into its own queue of GdkEvent elements. As the main loop          cycles along, the gtk_main_do_event( ) function pulls single          events off the queue and sends them to the appropriate          handler(s), implied in Figure 2.5 by the theoretical          widget_event_handler( ) function.  All of this is          transparent to you, the developer, except for the handler          function at the end of the line.        </P><DIVCLASS="FIGURE"><ANAME="AEN154"></A><P><B>Figure 2-5. GDK Event Flow</B></P><DIVCLASS="MEDIAOBJECT"><P><IMGSRC="figures/2f5.png"></IMG></P></DIV></DIV><P>          GDK's event system is polymorphic to some extent, just like          X's native event system. A generic event is expressed as a          GdkEventAny structure; all events can be cast to this data          type. A GdkEvent is actually a union of every possible type          of GDK events, including GdkEventKey, GdkEventButton,          GdkEventMotion, GdkEventExpose, and GdkEventFocus. When you          set up each event callback in your application, you have the          choice to express the event as a generic GdkEvent if the          handler function expects more than one type of event, or as          a specific event type for a specialized event handler. For          example, if you wanted to write a handler for only          keyboard events, you could specify a GdkEventKey parameter          directly in the function prototype for that handler.        </P><P>          The GDK event system is a fairly elegant abstraction between          the raw Xlib interface and the platform-independent GTK+          layer. We'll learn more about events later, as the issue          comes up, but it certainly wouldn't hurt for you to do some          investigation on your own. In particular, you should explore          glib/gmain.c (the code that drives the main loop),          gtk+/gdk/gdkevents.c (managing the GDK event queue and          translating X events into GdkEvent instances), and          gtk+/gtk/gtkmain.c (processing and dispatching the GDK event          queue into GTK+ proper) in the GLib and GTK+ source code.        </P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN161">Drawing Primitives</A></H2><P>          To move some of the drawing logic from the client to the          remote X server, the X Window System defines various          server-side resources, as we discussed briefly in Section          1.3.5. Xlib supplies numerous functions to manipulate these          remote resources. As it must with all other useful parts of          the Xlib API, GDK wraps these functions, thus completely          insulating you from Xlib. For the most part, these GDK          wrappers are fairly thin; most of the original X concepts          are carried through intact to GDK.        </P><P>          Some of these resources are basic geometric objects, called          drawing primitives. GDK supports five point-based drawing          primitives: points, lines, rectangles, polygons, and          arcs. Each of these primitives consists of one or more          coordinate points. To render them, you send the critical          points-for example, the four corners of the rectangle-and          the X server connects the dots, so to speak. This saves you          the trouble and bandwidth of calculating and sending every          pixel in a line. In addition, certain video cards may have          access to optimized hardware line-drawing routines, which          would be unusable if you had to send each pixel separately.        </P><P>          Unlike a window resource, these five drawing primitives are          not persistent objects. You don't create them on the server          and move them around. They are more like special drawing          commands that the X server is guaranteed to know, more like          lines on a chalkboard that you can erase and redraw, and          less like pieces of paper on your desk that you can slide          around and manipulate.        </P><P>          GDK also has two other types of (non-point-based) drawing          primitives: text and pixmaps. The text primitives allow you          to specify a text string, a font, and a coordinate location          at which to render the text. The pixmap primitives let you          copy all or parts of a graphical image from one drawing          surface to another. This makes double buffering much          easier: You render your drawings to an off-screen pixmap and          then copy the finished product to the screen.        </P><P>          To supplement the drawing primitives, the X Window System          introduces the concept of a graphics context resource on the          X server. The graphics context is sort of a catchall          container for keeping track of various common drawing          properties, such as foreground and background colors, fonts,          stipple patterns for area fills, line-drawing attributes,          clipping masks, and more.  Rather than sending all this          information each time you draw a line or render text, you          can specify the drawing parameters in the graphics context,          and the X server will use those values by default.        </P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN168">Reference Counting</A></H2><P>          Another thing GDK adds over the raw Xlib functions is          reference counting.  Rather than explicitly creating and          destroying graphical objects and having to worry about          cleaning up shared instances of those objects, you can use          GDK's reference-counting mechanism. Each time a part of the          application needs to use a particular graphical object or          resource, you can reference it. Later, when that section of          code is done with the object, you unreference it. GDK          promises that unreferencing an object with multiple          reference counts will not destroy it until the reference          count reaches zero (although in some cases, such as window          resources, these objects may be destroyed explicitly,          forcibly, thus overriding the reference count). In          essence, when you reference an object, you ensure that it          will stay around for as long as you need it to, and that no          one else will destroy it from under you. The last owner to          let go of the object will trigger its destruction.        </P><P>          A good example of the need for reference counting is          GdkPixmap, GDK's wrapper around the X pixmap. A GdkPixmap          can hold only one graphical image, but that image may be          used in multiple places in the application, especially in          the case of a graphical icon. The icon may turn up in the          application's dialog boxes, its About box, and even its main          window. Rather than allocating separate memory for each          instance, you can allocate a single GdkPixmap and reference          it from each window that's using it.        </P><P>          The main application would create it with gdk_pixmap_new( )          (which implicitly references it). When a second window          comes up that also uses the pixmap, it calls          gdk_pixmap_ref( ), increasing the reference count to 2. When          the second window closes, it calls gdk_pixmap_unref( ),          dropping the reference count back to 1. Later, when the          application closes down, it unreferences the GdkPixmap          again, dropping the reference count to 0, at which point the          GdkPixmap implicitly destroys itself. If the application had          destroyed its main window while the second window was still          open, the second window would have been left with the only          active reference, and the GdkPixmap would not have destroyed          itself until that window had closed too.        </P><P>          GDK also uses reference counting for windows, graphics          contexts, color maps, visuals, and even fonts. Anything that          refers to a remote graphical resource that needs to be          cleaned up is managed with references in GDK. Reference          counting is a simple, powerful tool for resource sharing,          and its use is not limited to GDK. GTK+, GNOME, and the          gdk-pixbuf image-loading library also make extensive use of          it.        </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="gtk-gnome-intro.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="gtk.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">The GTK+/GNOME System</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="gtk-gnome-intro.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">GTK+</TD></TR></TABLE></DIV></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
正在播放亚洲一区| 免费观看91视频大全| 粉嫩aⅴ一区二区三区四区| 精品国产一区二区三区久久影院| 日韩精品福利网| 日韩三级中文字幕| 久久丁香综合五月国产三级网站| 精品国产百合女同互慰| 精品亚洲成a人| 国产欧美一区在线| 97久久超碰精品国产| 一区二区在线电影| 欧美高清激情brazzers| 精品一区二区三区蜜桃| 国产欧美精品国产国产专区| 91在线免费播放| 污片在线观看一区二区| 亚洲精品一区在线观看| 99久久精品免费精品国产| 亚洲一区影音先锋| 精品国产麻豆免费人成网站| 国产九色sp调教91| 亚洲品质自拍视频| 制服丝袜成人动漫| 国产激情一区二区三区| 一区二区三区在线视频观看| 91精品国产全国免费观看| 国产白丝网站精品污在线入口| 亚洲视频一二三区| 久久视频一区二区| 色狠狠综合天天综合综合| 日本一区中文字幕| 一区视频在线播放| 欧美成人猛片aaaaaaa| av在线一区二区| 蜜桃av一区二区三区电影| 国产精品高潮呻吟久久| 欧美久久一区二区| 成人国产精品免费观看视频| 亚洲成人三级小说| 中文字幕一区日韩精品欧美| 91精品国产综合久久精品性色 | 亚洲欧美日韩在线| 精品久久久久久综合日本欧美| 色综合中文字幕| 国产精一区二区三区| 亚洲777理论| 国产精品欧美综合在线| 日韩一区国产二区欧美三区| 国产精品18久久久久| 亚洲国产aⅴ天堂久久| 中文字幕一区二区三区色视频| 日韩欧美国产电影| 欧美色爱综合网| 精品精品国产高清a毛片牛牛| 精品无人区卡一卡二卡三乱码免费卡 | 97精品超碰一区二区三区| 免费成人在线视频观看| 一区二区三区四区乱视频| 国产日本亚洲高清| 精品第一国产综合精品aⅴ| 色狠狠色噜噜噜综合网| av资源站一区| 成人免费看的视频| 国内成+人亚洲+欧美+综合在线 | 亚洲成人免费影院| 亚洲一二三区不卡| 亚洲色图19p| 国产欧美视频一区二区三区| 精品国产青草久久久久福利| 欧美一区二区三区视频免费| 欧美精品日韩一本| 欧美少妇一区二区| 欧美色倩网站大全免费| 91精品福利视频| 一本到不卡精品视频在线观看| 成人一区在线观看| 成人短视频下载| 91在线视频网址| 91玉足脚交白嫩脚丫在线播放| 99在线精品观看| 91亚洲精品久久久蜜桃| 91污在线观看| 色综合久久66| 91久久精品一区二区| 欧洲一区在线电影| 欧美日韩中字一区| 91精品婷婷国产综合久久 | 成人深夜视频在线观看| 国产成人啪午夜精品网站男同| 国产一区免费电影| 国产九九视频一区二区三区| 久久成人麻豆午夜电影| 国产精品一区在线| 国产高清亚洲一区| 99久久er热在这里只有精品15| 日本久久一区二区三区| 欧美日韩一区中文字幕| 欧美成人综合网站| 国产日产欧美一区二区三区 | 亚洲婷婷在线视频| 一区二区理论电影在线观看| 亚洲a一区二区| 精品夜夜嗨av一区二区三区| 成人免费视频视频| 91久久精品一区二区三| 日韩欧美亚洲另类制服综合在线| 欧美xfplay| 亚洲人123区| 麻豆成人在线观看| av动漫一区二区| 欧美在线一区二区三区| 日韩三级视频中文字幕| 亚洲国产精品黑人久久久| 亚洲啪啪综合av一区二区三区| 日韩中文字幕1| 国产成人在线看| 欧美色视频一区| 国产日韩精品久久久| 一区二区三区电影在线播| 免费高清视频精品| 91免费观看视频| 日韩美一区二区三区| 国产精品久久久久久久裸模| 午夜久久久影院| 成人免费不卡视频| 欧美日韩一级二级三级| 国产亚洲成av人在线观看导航| 亚洲激情中文1区| 国产精品一线二线三线精华| 91精品福利在线| 欧美激情在线一区二区| 蜜臀av一级做a爰片久久| av不卡免费电影| 久久久久久久久一| 午夜精品一区二区三区免费视频| 成人免费看片app下载| 中文字幕在线观看一区二区| 奇米一区二区三区| 一本久道中文字幕精品亚洲嫩| 久久综合色之久久综合| 天天射综合影视| 色综合久久综合| 国产亚洲成aⅴ人片在线观看| 日韩av电影天堂| 色婷婷综合激情| 国产欧美一区二区精品性色| 午夜精品福利一区二区三区av| fc2成人免费人成在线观看播放| 欧美变态tickling挠脚心| 亚洲第一福利一区| 日本高清不卡在线观看| 国产精品国产自产拍在线| 国产成人一区二区精品非洲| 日韩精品专区在线影院重磅| 亚洲午夜羞羞片| 日本电影亚洲天堂一区| 中文字幕日韩一区二区| aaa欧美色吧激情视频| 国产校园另类小说区| 国内精品伊人久久久久av一坑 | av网站免费线看精品| 久久影音资源网| 国产一本一道久久香蕉| 久久综合五月天婷婷伊人| 韩日av一区二区| 精品国产髙清在线看国产毛片| 精品制服美女久久| 欧美不卡在线视频| 精品一区二区免费在线观看| 日韩免费福利电影在线观看| 美国毛片一区二区| 精品久久一二三区| 欧美主播一区二区三区| 亚洲精品国产第一综合99久久 | 亚洲精品videosex极品| 91久久精品日日躁夜夜躁欧美| 一区二区三区免费| 欧美日韩小视频| 久久国产尿小便嘘嘘| 久久免费精品国产久精品久久久久| 国产在线一区二区综合免费视频| 2023国产一二三区日本精品2022| 国产一区二区三区精品欧美日韩一区二区三区| 日韩欧美一区二区免费| 国内精品久久久久影院一蜜桃| 国产日韩欧美一区二区三区乱码 | 国产三级精品三级| 成人av在线一区二区| 有码一区二区三区| 在线91免费看| 国产精品一区二区三区网站| 亚洲国产成人在线| 色综合久久久网| 日本中文字幕不卡| 欧美韩日一区二区三区四区| aaa亚洲精品一二三区| 亚洲国产成人porn| 欧美va亚洲va| 99精品视频在线播放观看|