学习 GObject 和 Glib 的材料

发布于 2024-07-13 05:00:27 字数 1542 浏览 7 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

遮了一弯 2024-07-20 05:00:27

从 Glib 开始,它非常简单,并且在这里有很好的描述: Glib 参考手册

GObject 主要是很多样板代码来实现面向对象。 GObject 参考手册中的“maman bar”示例

尝试一下 对我来说,GStreamer 花了最多的时间来理解。 该文档很好,但有很多东西需要阅读(GStreamer 文档)。 阅读基础知识后,尝试使用 gst-launch 从 cmdline 启动管道。 然后阅读有关应用程序开发的完整手册并做一些示例。 在尝试构建自己的插件之前,请检查一些简单的插件并尝试了解不同的部分,一个简单的起点是 身份插件

祝你好运!

/乔尔·拉尔森

Start with Glib, its quite easy and well described here: Glib Reference Manual

GObject is mostly a lot of boilerplate code to achieve object orientation. Try out the "maman bar" examples found in the GObject Reference Manual

For me, GStreamer took the most time to understand. The documentation is good but there is alot to read (GStreamer docs). After reading about the basics, try starting a pipeline from the cmdline using gst-launch. Then read the full manual about application development and do some examples. Before trying to build your own plugin, check out some simple plugin and try understand the different parts, a simple place to start is the identity plugin

Good luck!

/Joel Larsson

弥枳 2024-07-20 05:00:27

您可能对这些示例程序感兴趣,这些示例程序是我在阅读 Gnome 开发人员中的章节后上传到 github 的指导并浏览了 gobject 手册。

You may be interested in these sample programs I uploaded to github after I read the chapter in the Gnome Developers Guide and went through the gobject manual.

南城旧梦 2024-07-20 05:00:27

还有“官方 Gnome 2 开发人员指南”。 参见第 59 段。 关于提到的书...
检查 gtk 的源代码确实是个好主意。 过去几周我一直在研究它,发现这本书非常有帮助。 相当乏味的是让构造函数正确,并且初始化的顺序“相当”令人费解。
您还应该检查 GObject 文档中的第 4 章。 它并没有涵盖所有内容,但与本书结合起来就很不错了。 我建议从一个非常简单的派生玻璃形式 GObject 开始......,以便更好地理解基本原则

一个总是有两个
结构。 一种类结构,其中存储所有函数指针和代表一个对象的实例结构。 这是最重要的东西。

另一点比较难理解的是内存管理的引用计数。 如果您以前接触过 Objective-C 和/或 libapr 和/或
COM。

问候
弗里德里希

There is also "the offical Gnome 2 Developer's guide". See 59 ff. on the mentioned book...
And it's really a good idea to check the sources of gtk. I've spend the last few weeks on getting into it, and found this book to be very helpful. What's quite tedious is to get the constuctors right and the order of initialization is "quite" mind-bending.
What you should check is chapter 4 in the GObject documentation also. It does not cover everything but together with the book it' quite ok. I suggest starting with a very simple derived glass form GObject....., to better understand on base principle

One always has two
structures. A Class Structure in which you store all the function pointers and an instance structure which represents one Object. This is the most important thing to get.

Another point which is a bit harder to understand it the reference counting for memory management. It helps if you had contact before with Objective-C and/or libapr and/or
COM.

Regards
Friedrich

染年凉城似染瑾 2024-07-20 05:00:27

是我找到的最好的 GTK+ 书,它有一章是关于 GLib 的,但是参考手册是最好的学习地方以及您将找到的最新“书”。

This is best GTK+ book I found, it has a chapter on GLib, but reference manual is the best place to learn and the most up to date "book" you will find.

带刺的爱情 2024-07-20 05:00:27

使用 GLib 集合管理 C 数据 是 glib 集合的介绍(链接、哈希表、数组、树、队列、关系)。 其中包含很多示例。 适合初学者。

Manage C data using the GLib collections is a introduction of glib collection(links, hash tables, arrays, trees, queues, relations). Lots of examples are included. Good for beginners.

年华零落成诗 2024-07-20 05:00:27

也许太简单了,但是有 GNOME 平台演示,您可以习惯它GNOME 及其库的惯用法。

Maybe too much easy but there are the GNOME platform demos which you can get used to the idiomatics of GNOME and its libraries.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文