glib

Material to learn GObject and Glib [closed]

妖精的绣舞 提交于 2019-12-02 14:01:10
I am comfortable with C. but need to learn GObject and Glib for gstreamer . All i found on net is Gobject reference manual. Its good but looking for tutorial for Gobject/Glib as the main focus is on gstreamer. So pls share any other resources to learn the glib and gobject. 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

Does the glib list in the called function need to be free for deallocating memory

守給你的承諾、 提交于 2019-12-02 12:25:50
I have a simple program that uses glib list where I have a function which returns the list to the calling function .here in the called function i have decleared another list and the list is returned to the calling function. I have freed the list in the main function but is in delimma that whether the list in the called function need to be freed for memory performance. #include <stdio.h> #include <string.h> #include <glib.h> char *col_trim_whitespace(char *str) { char *end; // Trim leading space while(isspace(*str)) str++; if(*str == 0) // All spaces? return str; // Trim trailing space end =

Is OS detection possible with GLib?

試著忘記壹切 提交于 2019-12-02 02:25:17
Is it possible to determine on which platform (GNU/Linux, Win32, OS X) my Vala app is running? Jens Mühlenhoff As Vala is a compiled language (as opposed to intermediate or interpreted) you can determine the platform using your favorite build tool and use conditional compilation . Something like: #if WINDOWS message ("Running on Windows"); #elif OSX message ("Running on OS X"); #elif LINUX message ("Running on GNU/Linux"); #elif POSIX message ("Running on other POSIX system"); #else message ("Running on unknown OS"); #endif The build tool would have to pass -D LINUX , etc to the compiler. I

Troubles compiling in GPS (Ada IDE) with glib.h

我是研究僧i 提交于 2019-12-02 00:57:55
i'm having some troubles when trying to compile Ada code in GPS. GPS says is missing when I include it on a package. I tried installing with apt-get, and it does, but the error is still there. What can I do next? I'm running GPS on a x64 Ubuntu 12.04. Here's the error message I got: gprbuild -d -P/media/LUISMUNYOZ/QUINTO/str/pendulum/pendulum_portatil/pendulum.gpr -XEXTRA=True -XOPENGL=True -XGNOME=True -XBUILD=Production print_barrier_sync.adb contrib.gpr:1:09: warning: no compiler specified for language "Xml", ignoring all its sources x86_64-pc-linux-gnu-gcc -c lw.c In file included from

Eclipse Luna Crashed on XFCE

我与影子孤独终老i 提交于 2019-12-01 21:37:09
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized. Will retry after the state location is initialized. (java:3554): GLib-GObject-WARNING **: cannot register existing type `GdkDisplayManager' (java:3554): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed (java:3554): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed (java:3554): GLib-GObject-WARNING **: invalid (NULL) pointer instance (java:3554): GLib-GObject-CRITICAL **: g_signal_connect_data:

Why does GObject method still get called even if callback arguments don't match those in XML?

两盒软妹~` 提交于 2019-12-01 09:26:47
Suppose I have a method like this <interface name="org.Test.ChildTest"> <!-- set_age(guint32 new_age): sets new age --> <method name="set_age"> <arg type="u" name="new_age" direction="in"/> </method> In my table of methods I have: { (GCallback) child_test_set_age, dbus_glib_marshal_child_test_BOOLEAN__UINT_POINTER, 0 } and the right GObject method signature is: gboolean child_test_set_age (ChildTest *childTest, guint ageIn, GError** error) Why does my method, child_test_set_age() , still get called on DBus even if the callback arguments don't match the one specified in my XML? For example if I

Which gtk method I have to use to get temporary path in Ubuntu?

我怕爱的太早我们不能终老 提交于 2019-11-30 14:22:31
How can I get the temporary directory path in Ubuntu? On most Unix-like systems, you'd be looking for /tmp . If that's not quite the answer you were after, you should specify which bit of Ubuntu you're talking about. Certain applications will allow you to specify where their temporary files are put (such as with the TMP , TEMP or TMPDIR environment variables) but a lot of stuff would break under UNIX if /tmp didn't exist, so it's safe just to use that. If you want to make it configurable, in your code, you'd use something like the function getTmpDir() in the following complete program:

Need help implementing simple socket server using GIOService (GLib, Glib-GIO)

和自甴很熟 提交于 2019-11-30 13:33:38
问题 I'm learning the basics of writing a simple, efficient socket server using GLib. I'm experimenting with GSocketService. So far I can only seem to accept connections but then they are immediately closed. From the docs I can't figure out what step I am missing. I'm hoping someone can shed some light on this for me. When running the following: # telnet localhost 4000 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host. # telnet localhost 4000

glibc, glib and gnulib

我是研究僧i 提交于 2019-11-30 11:21:18
问题 what are differences in the strength and features in gnulib glib and glibc Thanks! 回答1: glibc is a core C runtime library. It provides things like printf(3) and fopen(3) . glib is an object-based event loop and utility library written in C. gnulib is a library that provides an adapter from the POSIX API to the native API. All three are used for completely different tasks. 回答2: glibc , the shortened form of GNU C Library , is the GNU Project's implementation of the C standard library. The API

Need help implementing simple socket server using GIOService (GLib, Glib-GIO)

岁酱吖の 提交于 2019-11-30 07:59:37
I'm learning the basics of writing a simple, efficient socket server using GLib. I'm experimenting with GSocketService. So far I can only seem to accept connections but then they are immediately closed. From the docs I can't figure out what step I am missing. I'm hoping someone can shed some light on this for me. When running the following: # telnet localhost 4000 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host. # telnet localhost 4000 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host.