Please recommend a good D-Bus tutorial (Linux C GTK+) [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Yes, I have done a search yet found only partly working stuff. It seems to be a real maze. E.g.:
Why do they even use g_main_loop_run()? Is it really necessary when the GTK+ program has already entered the main loop by gtk_main()?
How should the path, the interface name and the signal name look like when invoking such functions like dbus_bus_request_name(), dbus_message_new_signal(), dbus_bus_add_match(), dbus_message_is_signal() ...?
How afterwards should the names be correctly set in the /etc/dbus-1/system.conf file to even allow the program to use the the D-Bus interface? Surprisingly all tutorials I found simply forget to mention at all you need to edit it.
How the messages could be caught asynchronously? Should it be done somehow like in a separate thread?
Please recommend any good GTK+ D-Bus example which could help to learn how to use it.

gtk_main is calling g_main_loop_run(), you should look into file gtk/gtkmain.c to find out.
Googling for dbug_bus_request_name gives several examples, notably dbus-example.c
And you should read a good gtk tutorial to have an idea of what signals and slots mean in the context of Gtk.
Googling for d-bus tutorial gives this dbus tutorial
At last, a good idea is to find and study the source code of the relevant free software. GtkApplication examples are calling dbus code.

Related

drawing circle, line, arc etc. using c [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed last year.
Improve this question
So our teacher taught us to draw circles lines using c in turboc++, and my issue is, this compiler sucks, so I wanted to use some normal compiler or code editor, and I googled it, but those programs on websites which I found, use graphics.h for drawing circle, but my compiler is showing an error named no such file or directory. The same issue is seen when I use an online compiler.
So plz someone guide me where can I find some good material related to basic computer graphics whose c code does not need turboc++. It can be a book or website or videos on youtube.
Thanks in advance.
There is no standard graphics library in C. It's all third party. So you will never be able to write graphics code that's completely portable.
If you're using Linux, it's possible to use libgraph to enable the use of graphics.h. I found a question on askubuntu that covers this: How do I use graphics.h in Ubuntu?
If you're using Windows, it seems to be possible to use WinBGIm to use graphics.h. Geeks for geeks has instructions for how to use it with CodeBlocks https://www.geeksforgeeks.org/include-graphics-h-codeblocks/
I do not know how good these two options are, but they might be worth trying out. That will at least remove the Turbo dependency.

Is there a proper documentation for linux kernel functions? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
When I come across a new kernel function, like those in "linux/list.h" and "sys/kmem.h", my only sources of help are books like "Linux Device Drivers" or the "Linux Cross reference" page. But the book only cover the most commonly used functions, sometimes the obsolete version, and the cross reference page only gives the function implementation without talking about what the parameters are. If I were lucky, I could find people asking about the function online, but that is not always the case. Is there a good documentation for kernel functions like a man page for most user space functions?
There is. Of course "proper" is a matter of opinion.
The Linux Kernel's documentation web pages seems proper to me.
OTOH, I suspect many people would argue that source code itself is the only real proper documentation.

How to write a text mode gui in Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
When I write scripts/programs, often I would like to pop up a simple text 'gui' to prompt for input:
How would I do this? For example from Shell, Ruby, Golang or C. I don't even know what this is called and Google isn't reponding to "text thingy from scripts".
(The example is from the Debian installer).
Actually, that is not dialog, but the newt library (there are a few differences in appearance). It is used by anaconda on Red Hat systems. The whiptail program uses the library, however it has no real relationship to anaconda.
Anaconda is mostly in Python; it uses the newt shared library (written in C) from a Python binding.
For learning it... documentation is largely non-existent. You have the source code.
Further reading:
screenshots for dialog
newt.git
anaconda.git
Any examples/documentation for python-newt (discussion of newt vs documentation)
Spicing up the Console for Fun and Profit, Part 2
In the past this was known as "Dialog," though as Thomas points out (as the maintainer of Dialog!!) this is no longer the case. This is most likely the Newt library. While you could certainly write something lower level using ncurses, Newt is available in Linux pretty much universally. Dialog can also be installed under Linux. You can read some basic documentation for it here.
Choosing to use this over a curses based approach allows you to focus on what it is you're actually looking to do rather than doing all of the work to build a UI. If, however, you are really looking to build UI elements, ncurses would be the way to go.

Should I be using GTK threads/Good tutorials on GTK threading? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
This is my scenario so far:
I am trying to build a GUI using GTK in C. In the middle of the GUI will be a screen displaying video input. The video input window is a XLIB window which I am (currently unsuccessfully trying to) wrap in a GTK widget. Around it however will be buttons etc.. to interact with the video or do things according to the video output.
I am wondering if this would be the correct time to use threads as I want my GTK GUI to be running while the video input/processing is being displayed. If so any good guides, if not what would you recommend?
From #bash.d's comments I should be using threading, does anyone know any good links or where in the man pages I should be looking as I seem to be getting more confused and coming across deprecated functions.
I would discourage you from using threads if your only reason for doing so is to keep your UI responsive. Instead, you should call
while (gtk_events_pending())
gtk_main_iteration();
at certain points during your video processing.
I think thread is the right way to go. Here is a good tutorial multi-threaded gtk+ application

FUSE - detailed documentation [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
trying to get my own filesystem working using fuse (filesystem in user space, linux) im really curious on where to get detailed up to date documentation of the operations used?
most time i search for other file system implementations and see what they do, but some operations seem to be not widely used like poll/ioctl or bmap.
and the documentation of the fuse api doesnt help much, cause e.g. the parameters and return values of the operations are not documented thus i have to guess how to use em
so the question is where do i get better information about how such exotic operations are supposed to be implemented?
thx
Yes, you are right, many places you can read that comment saying there is little documentation on FUSE. Perhaps that's because there is so little to document. Or perhaps the implementation is only meant for those who understand the tradeoff of userspace filesystem well enough. So perhaps you can refer to the following documentation, tutorials, slides or even sample codes for more information:
FUSE Design Document (original documentation from Sun?):
http://www.youblisher.com/p/31627-fuse/
http://wr.informatik.uni-hamburg.de/_media/research/labs/2008/2008-03-michael_kuhn-container_library_and_fuse_container_file_system-report.pdf
http://www.oug.org/files/presentations/losug-fuse.pdf
http://sar.informatik.hu-berlin.de/teaching/2013-w/2013w_osp2/lab/Lab-4-FUSE/lab-FUSE_.pdf
http://www.cs.hmc.edu/~geoff/classes/hmc.cs135.201001/homework/fuse/fuse_doc.html (tutorials)
http://www.cs.cmu.edu/~./fp/courses/15213-s07/lectures/15-filesys/index.html
http://www.cs.nmsu.edu/~pfeiffer/fuse-tutorial/
Sample code:
http://fuse.sourceforge.net/helloworld.html
And perhaps this is more research-oriented:
http://www.msrsas.org/docs/sastech_journals/archives/May2011/2.pdf
https://code.google.com/p/s3fs/wiki/FuseOverAmazon
But generally there is a lot of problems/issues (which may be solved through some complex algorithm) with implementing filesystem in userspace, which is why Linus has commented it as "toy":
https://ceph.com/dev-notes/linus-vs-fuse/
15Apr2015 update:
I just found this (and many other slides - just look at the right hand side of this webpage):
http://www.slideshare.net/adorepump/fuse-developing-fillesystems-in-userspace

Resources