-
Notifications
You must be signed in to change notification settings - Fork 7
/
README.OS-implementation
41 lines (30 loc) · 2.03 KB
/
README.OS-implementation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
If you are reading this file it's good news, it may imply you are interested in coding, but
maybe even into adding support for a new operating system.
The bare minimum to implement can be copied from the file src/task-manager-skel.c, knowing
the existing implementations can serve as good examples. The src/task-manager.h file
contains the declaration of the Task structure and the four functions that must be
implemented.
If you have trouble to add compilation to the build-env (autotools) you can run the
configure script (./autogen.sh or ./configure) with the flag --with-skel and put your
modifications inside the task-manager-skel.c file directly.
When done, send a patch to Bugzilla (bugzilla.xfce.org).
Some tips
---------
You may cache values, declare 'static <TYPE> <VARIABLE>' under the includes for global
access, or inside functions for local access.
You may need a local function to calculate the CPU usage in percent for the system and/or
the processes (usually OSes that report the usage with an incrementing time-like value), for
this have a look at the function get_cpu_percent() from the linux and solaris files.
The refresh rate can be different than one second, make sure the CPU keeps correct by
changing it or the algorithm may simply be wrong.
Implementing the function pid_is_sleeping() is needed to show either the signal Stop or
Continue inside the graphical interface.
The function get_task_list() provides an empty but initialized GArray pointer as argument
that just has to be filled in with the current list of tasks. Note that GArray makes a copy
of the data type that it is passed to, don't allocate or free memory instead declare a Task
structure and pass it as is/as a copy to g_array_append_value().
If there are information you are unable to provide because unexistent on the system, fill in
these values with 0. A good example is the swap, when the total equals to zero it is hidden
from the interface. This can be applied to the CPU (system may be useless) and the memory
information (buffer and/or cache may be left out).
That's it!