Gtk+ 教程和资源集合
本贴以http://www.gtkforums.com/about988.html为蓝本整理并翻译。欢迎来到GTK+ 教程和资源
这个页面收集了关于GTK+编程的一些资料(包括文档、教程和实例),并非所有的内容都是讲述GTK+的,但是,在这里的资料都是与GTK+相关的。
注意:所有这些资料/教程都是使用c语言。
C Programming 2nd Edition
如果你需要学习C语言,这是一本经典的C语言教程。
http://madison-project.wikidot.com/local--files/tutorials/The_C_Programming_Language.pdf
另外一个好的C语言教程网站
http://www.exforsys.com/tutorials/c-language/c-programming-an-overview.html
更多好的C语言教程
http://irc.essex.ac.uk/www.iota-six.co.uk/c/
学习GTK+你所需要的全部C语言知识
http://www.freesoftwaremagazine.com/articles/all_the_c_you_need_for_gtk_development
http://www.freesoftwaremagazine.com/node/2543/pdf
randu.org的简单C语言教程
http://randu.org/tutorials/c/index.php
C Reference Card (ANSI) "备注:需要一个更简单的版本来代替"
http://users.ece.utexas.edu/~adnan/c-refcard.pdf
一个关于C语言指针和数珠的教程
http://pweb.netcom.com/~tjensen/ptr/pointers.htm
http://pweb.netcom.com/~tjensen/ptr/pointers.pdf
一个关于指针和内存的教程
http://cslibrary.stanford.edu/102/PointersAndMemory.pdf
如果你需要一个关于如何使用不同的C语言特性和函数的细节而直接的指针例子
http://www.java2s.com/Tutorial/C/CatalogC.htm
http://www.java2s.com/Code/C/CatalogC.htm
ISO/IEC 9989
http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf
Glibc 教程
使用POSIX Threads进行多线程编程
http://users.actcom.co.il/~choo/lupg/tutorials/multi-thread/multi-thread.html
Embedded Scripting
如何使用swig创建 C/Lua 模块
http://madison-project.wikidot.com/local--files/tutorials/C_Lua_Swig.pdf
Lua Swig 教程
http://www.swig.org/Doc1.3/Lua.html
如何使用Lua+C.
http://www.gtkforums.com/viewtopic.php?t=1995
如何使用Python+C
http://www.gtkforums.com/viewtopic.php?p=9055#9055
如何通过C语言使用 Spidermonkey 嵌入式 javascript引擎
https://developer.mozilla.org/en/JavaScript_C_Engine_Embedder%27s_Guide
Gtk+ 程序设计教程 "界面工具"
GTK+ 2.x 初学者教程
这个教程为初学者描述了大部分的常用控件
http://zetcode.com/tutorials/gtktutorial/
如何为控件设置颜色
http://ometer.com/gtk-colors.html
Gnome2 开发者向导 "Gtk+ 2.0"
http://home.cs.tum.edu/~siegel/files/tog2dg.pdf
Gtk+ 2.0 教程
http://library.gnome.org/devel/gtk-tutorial/stable/
Gtk+ 2.0 Tree View 教程
http://scentric.net/tutorial/treeview-tutorial.html
http://scentric.net/tutorial/treeview-tutorial.pdf
treeview 教程源码: http://scentric.net/tutorial/treeview-tutorial.tar.gz
Gtk+ 2.0 Text View 教程
http://www.bravegnu.org/gtktext/
http://www.bravegnu.org/gtktext/gtktext-0.4.pdf
Gtk+ 2.0 GtkComboBox 控件教程
Part1 http://tadeboro.blogspot.com/2009/04/gtkcombobox-widget-part-1.html
Part 2 http://tadeboro.blogspot.com/2009/04/as-promised-im-back-with-second-part-of.html
Part 3 http://tadeboro.blogspot.com/2009/04/gtkcombobox-widget-part-3.html
GtkDialog 教程
Part 1: http://tadeboro.blogspot.com/2009/04/gtkdialog-tutorial-part-1.html
Part 2: http://tadeboro.blogspot.com/2009/04/gtkdialog-tutorial-part-2.html
动态调整GtkLabel大小
http://tadeboro.blogspot.com/2009/05/wrapping-adn-resizing-gtklabel.html
使用弹出式窗口
http://tadeboro.blogspot.com/2009/05/using-pop-up-windows.html
一句话描述GTK+内存管理
http://www.gtkforums.com/viewtopic.php?t=2412
Gtk 菜单教程
http://samuelpauls.com/posts/126
Glade & Gtk+ 教程 "Gtk+ 界面设计器"
GTK+ 和 Glade3 界面程序设计教程
http://www.micahcarrick.com/12-24-2007/gtk-glade-tutorial-part-1.html
使用Glade-3创建GtkTreeView
Part 1: http://tadeboro.blogspot.com/2009/04/creatin-gtktreeview-with-glade-3.html
Part 2: http://tadeboro.blogspot.com/2009/04/creating-gtktreeview-with-glade-3-part.html
使用预编译xml文件到共享对象实现对libglade的加速
http://syslog.movial.fi/uploads/compiled-libglade.pdf
Glib 教程 "Gtk+ 实用库"
使用GLib的GKeyFile解释器
http://www.gtkbook.com/tutorial.php?page=keyfile
使用GLib写测试单元
http://blogs.gnome.org/timj/2008/06/24/23062008-writing-unit-tests-with-glib/
缺失的GObject教程示例
http://arbingersys.blogspot.com/2009/07/missing-gobject-tutorial-sample.html
GObject 教程
http://madison-project.wikidot.com/local--files/tutorials/gobject-0.10.0-html.tar.gz
Hildon 教程 "Hildon是一个基于GTK的手机设备的用户界面工具"
Hildon 教程
http://maemo.org/api_refs/5.0/beta/tutorial/html/
Pango 教程 "Gtk+ 文本格式化和翻译库"
The Pango connection:
Part1: http://www.ibm.com/developerworks/library/l-u-pango1/
Part 2: http://www.ibm.com/developerworks/library/l-u-pango2/
Cairo 教程"2D 矢量图形库"
Cairo 图形教程.
这个教程适合初级和中级用户
http://zetcode.com/tutorials/cairographicstutorial/
Cairo 概念
http://cairographics.org/tutorial/
使用Cairo 和GTK+ 2.0 编写一个控件
Part1: http://www.gnomejournal.org/article/34/writing-a-widget-using-cairo-and-gtk28
Part2: http://www.gnomejournal.org/article/36/writing-a-widget-using-cairo-and-gtk28-part-2
Clutter "2D/3D 多媒体工具包" - "Gtk+, Cairo, Gstreamer, Libvlc, Webkit, MD2, Mozembed plugins available."
Clutter 0.8程序设计
http://www.openismus.com/documents/clutter_tutorial/0.8/docs/tutorial/html/
http://www.openismus.com/documents/clutter_tutorial/0.8/docs/tutorial/pdf/programming-with-clutter.pdf
Clutter 0.9程序设计
http://www.openismus.com/documents/clutter_tutorial/0.9/docs/tutorial/html/index.html
Clutter 1.0程序设计
http://www.openismus.com/documents/clutter_tutorial/1.0/docs/tutorial/html/index.html
Clutter 插件
Gtk+, Cairo, Gstreamer 插件
http://www.clutter-project.org/sources/
Webkit 插件
git clone git://git.o-hand.com/webkit
VLC 插件
http://github.com/rno/clutter-vlc/tree/master
MD2 插件
http://github.com/bpeel/clutter-md2/tree/master
Mozembed 插件
http://git.clutter-project.org/cgit.cgi?url=clutter-mozembed/tree/tests
Gstreamer 教程 "音视频多媒体工具包"
GStreamer 是一个用C语言写的基于GObject的多媒体框架
程序开发手册:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/index.html
http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/manual/manual.pdf
插件编写指导 :
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/index.html
http://gstreamer.freedesktop.org/data/doc/gstreamer/stable/pwg/pwg.pdf
GStreamer 快速入门教程
Part1: http://bluwiki.com/go/GStreamer
Part2:http://bluwiki.com/go/GStreamer/C_Hello_World
GStreamer 插件开发视频
http://lca2007.linux.org.au/talk/272.html
http://mirror.linux.org.au/pub/linux.conf.au/2007/video/talks/272.ogg
Opengl 教程 "3D图形库"
OpenGL 程序设计指南 "红书"
http://madison-project.wikidot.com/local--files/tutorials/OpenGL_Programming_Guide.pdf
OpenGL 参考手册 "蓝书"
http://madison-project.wikidot.com/local--files/tutorials/OpenGl_Reference_Manual.pdf
GtkGLExt 是一个为GTK+ 2.0的扩展
http://www.k-3d.org/gtkglext/Main_Page <-- 下载大量的C/GTK+的示例代码。
osgGtk 是一个基于C/GTK+控件的支持OpenSceneGraph (OSG)的程序。
这个库同样包含多个示例程序,像osgviewerGtk和osgviewerGtkmm.
http://osggtk.wiki.sourceforge.net/main<--下载C/GTK+示例代码。.
Lexical Analyzer 和 Parser Generator
Lex & Yacc / Flex & Bison 初级教程
http://ds9a.nl/lex-yacc/cvs/output/lexyacc.html#toc1
一些Lex and Yacc的参考手册
http://pltplp.net/lex-yacc/
Flex 手册 "Lex"
http://flex.sourceforge.net/manual/
Bison 手册"Yacc"
http://www.gnu.org/software/bison/manual/html_mono/bison.html
http://www.gnu.org/software/bison/manual/pdf/bison.pdf
标记语言 注意: 在提供的链接中你会找到API参考手册和使用示例
。
LibYAML 是一个用C语言写的YAML 1.1 解释器和执行器.
http://pyyaml.org/wiki/LibYAML
MJSON M's JSON 解释器是一个小型的JSON解释器
http://mjson.sourceforge.net/index.html
LibAxl (or just Axl) 是一个用C语言编写的支持XML1.0标准规格的库
http://www.aspl.es/axl/
Libxml2是一个C语言的为gnome项目使用的XML解释器和开发工具包
http://www.xmlsoft.org/
Libcroco 是一个常规的CSS解释器,它提供了一个css2解释器(SAC和CSSOM API),和一个CSS2选择引擎
https://launchpad.net/libcroco
Portable Document Format (PDF)
Poppler "Poppler 是一个使用cairo来进行解析PDF文件的库"
http://poppler.freedesktop.org/
http://www.gtkforums.com/viewtopic.php?p=9086#9086
libharu "libHaru 是一个自由的,跨平台的,开源的通用PDF库."
http://libharu.org/wiki/Main_Page
http://libharu.org/wiki/Documentation
[注意] Cairo 同样可以制作PDF文件,但是libharu可以更好的工作,同时拥有更多的特性。
Programming & Hardware
Linux内核模块程序指导
http://tldp.org/LDP/lkmpg/2.6/html/index.html
蓝牙程序设计 "描述简单蓝牙概念"
http://people.csail.mit.edu/rudolph/Teaching/Articles/PartOfBTBook.pdf
一个蓝牙程序设计的介绍
http://people.csail.mit.edu/albert/bluez-intro/
LibParted Handbook "注意: LibParted 是一个创建,删除,更改大小和复制PC硬盘分区的库"
http://zester.googlecode.com/files/libparted_handbook.pdf
HAL Tutorial "硬件抽象层"
http://www.share-linux.com/hal1.php
http://www.share-linux.com/hal2.php
http://madison-project.wikidot.com/local--files/tutorials/Hal_Tutorial.pdf
LIRC 程序设计指南 "LIRC 是一个允许你解密红外信号并进行远程控制的包"
http://www.lirc.org/html/technical.html#applications
Libusb 程序设计教程 "libusb 是一个不要使用内核模块驱动的基于用户模式的USB数据传输库"
http://www.linuxforums.org/forum/linux-tutorials-howtos-reference-material/10865-developing-usb-device-drivers-userspace-using-libusb.html
Libburnia API手册和代码示例 "libburnia 是一个读写光盘的库。"
http://api.libburnia-project.org/libburn/
http://api.libburnia-project.org/libisofs/index.html
http://api.libburnia-project.org/libisoburn/
Libmtp "libmtp 是一个LGPL协议的实现媒体传输协议(MTP)的库,一个图片传输协议(PTP)的超集。 "
http://libmtp.sourceforge.net/index.php <--下载API手册和代码
Libgpod "libgpod 是一个访问iPod的动态库,它支持播放列表,智能播放列表,播放计数,跳过计数等等。"
http://www.gtkpod.org/libgpod/docs/ <--下载文档和示例代码
Libgphoto2 "libgphoto2 是一个访问数码相机的核心库。"
http://www.gphoto.org/proj/libgphoto2/ <-- 下载API手册和示例代码
V4L2 "Video4Linux2 or V4L2 是一个Linux下视频采集程序接口,支持USB Webcams,TV tuners和其它设备。 Video4Linux2 与Linux 内核密切的联系在一起。"
http://v4l2spec.bytesex.org/spec-single/v4l2.html#AEN163
DBus 教程 "消息总线系统"
http://www.share-linux.com/dbus1.php
http://www.share-linux.com/dbus2.php
http://madison-project.wikidot.com/local--files/tutorials/Dbus_Tutorial.pdf
数据库编程
MySQL 数据库 C语言 API 程序设计教程
http://zetcode.com/tutorials/mysqlcapitutorial/
PostgreSQL
-------------
PostgreSQL 数据库 libpq C API 教程
http://www.postgresql.org/docs/8.4/static/libpq.html
Accessing PostgreSQL From Code (Beginners C)
http://tutorials.freeskills.com/professional-linux-programming-part-1-accessing-postgresql-from-code.htm
Berkley DB C API
-----------------
开始学习数据存储:
http://www.oracle.com/technology/documentation/berkeley-db/db/gsg/C/BerkeleyDB-Core-C-GSG.pdf
http://www.oracle.com/technology/documentation/berkeley-db/db/gsg/C/index.html
开始学习事务过程:
http://www.oracle.com/technology/documentation/berkeley-db/db/gsg_txn/C/BerkeleyDB-Core-C-Txn.pdf
Getting Started with Transaction Processing
开始学习复制:
http://www.oracle.com/technology/documentation/berkeley-db/db/gsg_db_rep/C/Replication-C-GSG.pdf
http://www.oracle.com/technology/documentation/berkeley-db/db/gsg_db_rep/C/index.html
参考指南:
http://www.oracle.com/technology/documentation/berkeley-db/db/ref/toc.html
Programmatic API:
http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/frame.html
Hamster DB
--------------
http://hamsterdb.com/index
http://hamsterdb.com/public/dl/tutorial.pdf
http://hamsterdb.com/documentation/samples
Sqlite 嵌入式数据库.
http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html
压缩库
SCZ
http://scz-compress.sourceforge.net/
http://scz-compress.sourceforge.net/api.html
QuickLZ
http://www.quicklz.com/manual.html
http://www.quicklz.com/download.html
Zlib
http://www.zlib.net/zlib_docs.html
http://www.zlib.net/zlib_how.html
Libarchive "用于读写tar,cpio,zip,bzip,gzip,ISO和其它压缩格式的C语言库或者命令提示工具"
http://code.google.com/p/libarchive/
网络库
Libcurl "libcurl是一个自由,简单实用的客户端URL传输库, 它支持 FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS和文件. libcurl 支持 SSL 证书, HTTP POST, HTTP PUT, FTP 上传, HTTP 表单方式上传, 代理服务器, cookies, 用户名和密码验证 (简单, 数字, NTLM, Negotiate, Kerberos4), 断点续传, http隧道技术! "
http://curl.haxx.se/libcurl/c/libcurl-tutorial.html
http://curl.haxx.se/libcurl/c/
http://curl.haxx.se/libcurl/c/example.html
Libpcap "libpcap 是一个系统级的为用户提供网络抓包接口的库。"
http://yuba.stanford.edu/~casado/pcap/section1.html
Libnids "Libnids is an implementation of an E-component of Network Intrusion Detection System. It emulates the IP stack of Linux 2.0.x. Libnids offers IP defragmentation, TCP stream assembly and TCP port scan detection."
http://libnids.sourceforge.net/
http://libnids.sourceforge.net/printall.c
Libsoup "libsoup is an HTTP client/server library for GNOME. It uses GObjects and the glib main loop, to integrate well with GNOME applications."
http://library.gnome.org/devel/libsoup/stable/
libEtPan"libEtPan is a mail purpose library. It will be used for low-level mail handling : network protocols (IMAP/NNTP/POP3/SMTP over TCP/IP and SSL/TCP/IP, already implemented), local storage (mbox/MH/maildir), message / MIME parser."
http://www.etpan.org/libetpan/
http://dinh.viet.hoa.free.fr/wiki/index.php?title=LibEtPan
GeoClue "GeoClue is a software framework which can be used to enable geospatial awareness in applications. GeoClue utilizes the D-Bus inter-process communication mechanism to provide location information. Through this it aims to simplify development of location aware applications and promote code reuse within the free software and open source communities by defining a logical boundary between the applications and underlying location providers. GeoClue is licensed under the GNU Lesser General Public License and is currently available for Linux."
GeoClue provides access to multiple position providers:
* GPS: Position information from a Global Positioning System receiver
* Plazes: Position information from the Plazes Wi-Fi location service
* Hostip: Position information based on IP address
* Manual: User-provided position information
http://en.wikipedia.org/wiki/GeoClue
http://www.freedesktop.org/wiki/Software/GeoClue
http://folks.o-hand.com/jku/geoclue-docs/
源代码编译工具
自动化编译程序——编写Makefile文件
http://users.actcom.co.il/~choo/lupg/tutorials/writing-makefiles/writing-makefiles.html
GNU Autoconf, Automake, And Libtool "金书"
http://sources.redhat.com/autobook/autobook/autobook_toc.html#SEC_Contents
法律资源
开源协议
软件自由和知识产权法
http://www.rosenlaw.com/oslbook.htm
自由软件法律中心:
http://www.softwarefreedom.org/
公共专利项目:
http://www.patent-commons.org/
示例代码
GtkGLExt:
http://oracle.bridgewayconsulting.com.au/~davyd/misc/gtkglext-example.c
Creating and writing to an OpenGL window "GtkGLExt":
http://www.gtkforums.com/viewtopic.php?t=3568
Glib Utility Functions:
http://www.gtkforums.com/viewtopic.php?t=2809
Glib GChecksumType Examples
http://www.gtkforums.com/viewtopic.php?p=9125#9125
WebkitGtk & GtkBuilder:
http://www.gtkforums.com/viewtopic.php?t=3057
GtkIconView:
http://www.gtkforums.com/viewtopic.php?t=3103
GtkSourceView Syntax Highlighting Text Widget:
http://www.gtkforums.com/viewtopic.php?t=3105
Clutter and Clutter-box2d:
http://www.gtkforums.com/viewtopic.php?t=3128
GtkComboBox sample code:
http://www.gtkforums.com/viewtopic.php?t=3375
GTK+, Cairo & Poppler PDF Viewer example:
http://www.gtkforums.com/viewtopic.php?p=9086#9086
Terminal emulator widget VTE example
http://www.gtkforums.com/viewtopic.php?p=9087#9087
Gtk windows with alpha channels and Cairo
http://mikehearn.wordpress.com/2006/03/26/gtk-windows-with-alpha-channels/
http://plan99.net/~mike/files/alphademo.c
A shaped input example with Gtk+, Cairo and XShape 1.1
http://macslow.thepimp.net/?p=26
http://macslow.thepimp.net/projects/input_shape_test.c
Gtk System Tray Example
http://yettocome.blogspot.com/2007/08/gtk-system-tray-icon-example.html
Gtk System Tray with Animated Icon Example
http://www.gtkforums.com/viewtopic.php?t=3423
参考手册
下面是一个当前版本GTK+和她所需要的支持库的列表,你可以用这些库来构建自己的GTK+程序,记住,GTK+依赖GLib,这是唯一的依赖关系。
注意:这是一些需要被加入的其它的API参考手册。
ATK: http://library.gnome.org/devel/atk/stable/
GDK: http://library.gnome.org/devel/gdk/stable/
GdkPixbuf: http://library.gnome.org/devel/gdk-pixbuf/stable/
GLib: http://library.gnome.org/devel/glib/stable/
GObject: http://library.gnome.org/devel/gobject/stable/
GTK+: http://library.gnome.org/devel/gtk/stable/
Pango: http://library.gnome.org/devel/pango/stable/
Cairo: http://www.cairographics.org/manual/
Gstreamer: http://gstreamer.freedesktop.org/documentation/
Libglade: http://library.gnome.org/devel/libglade/unstable/
GtkGLExt:http://gtkglext.sourceforge.net/reference/gtkglext/
Clutter 0.8: http://clutter-project.org/docs/clutter/0.8/
Clutter 0.9: http://clutter-project.org/docs/clutter/0.9/
Webkit: http://oe.linuxtogo.org/~zecke/webkit-gtk-api/index.html
如果发现有什么问题,请与我联系,谢谢!
太猛了,资料很全,想学很好办的呀。 伤不起的E文啊 临时被老师要求用GTK+写cache工作方法,没法,来求助,真是万分感谢楼主了,雪种送炭啊 资源很全,不过好多都是英文的……鸭梨不小…… 没有中文的api,很难继续学呀! 强人啊! 只能头都 不抬的学习 努力 study英文太烂了 英文,好怕啊,我的英文才过4级,看不懂这些专业资料