GNOME Goal: Use accessor functions instead direct access
Summary
GTK+ currently exposes a huge amount of internal implementation details which blocks cleaning up of internal code, something that is much needed. This is not only for code beautification, in fact, the reason is that it’s a necessity in order to maintain the toolkit.
The objective is substitute all direct access to the object fields for accessor functions.
After we have done this we will have an API consisting only of functions which means that any compatibility glue code we need to write can be done without the risk of variables being accessed directly and circumvent the compatibility layer. This is in the fundamentals of OOP practices.
This is an important Goal to GTK+ 3 transition.
Guidelines
Compile the module with the help of GSEAL macro:
make CFLAGS+="-DGSEAL_ENABLE"
This will make the compiler catch all uses of direct access to the object fields so that you can go through them one by one and replace them with a call to an accessor function instead.
The changes will in a majority of the cases be:
Bar *bar = foo_get_bar (foo);
instead of:
Bar *bar = foo->bar;
Notes:
Some info has been collected from http://micke.hallendal.net/blog/gtk-30-enabling-incrementalism/ and http://mail.gnome.org/archives/gtk-devel-list/2009-April/msg00071.html
Problems
See pending sealings / accessors here: GTK+/3.0/PendingSealings
Tracker bug for pending sealings: 588339
Tracker bug for missing accessor functions: 597610
It'd be great to use GSEAL_NO_ERRORS macro to get warnings instead errors when compile the modules, but currently doesn't work (see this thread):
make CFLAGS+="-DGSEAL_ENABLE -DGSEAL_NO_ERRORS"
Comments before approval
Add your comments to this goal proposal here |
Status of this goal
Tip: If you choose to work on a module, create the bug report on the GNOME bugzilla, and make it block bug 585391. |
State |
Markup |
todo |
<: #ff8080> todo |
patch |
<: #ffcc50> [[GnomeBug:xxxxx|patch]] |
no GTK+ api |
<: #8080ff> no GTK+ api |
done |
<: #80ff80> [[GnomeBug:xxxxx|done]] |
not needed |
<: #80ff80> not needed |
Above are the states and corresponding markup to update the modules state table below.
Tarball |
Status |
|
Desktop |
||
alacarte |
not needed |
|
brasero |
||
bug-buddy |
not needed |
|
dasher |
||
dconf |
not needed |
|
evolution-data-server |
||
evolution-exchange |
||
evolution-mapi |
||
evolution-webcal |
||
file-roller |
||
gconf-editor |
||
gnome-applets |
||
gnome-backgrounds |
not needed |
|
gnome-control-center |
||
libslab |
2 issues left |
|
gnome-desktop |
||
gnome-disk-utility |
||
not needed |
||
gnome-icon-theme |
not needed |
|
gnome-keyring |
||
gnome-mag |
||
gnome-menus |
not needed |
|
gnome-netstatus |
||
gnome-nettool |
||
gnome-packagekit |
not needed |
|
gnome-power-manager |
||
gnome-python-desktop |
not needed |
|
gnome-session |
||
gnome-settings-daemon |
||
gnome-sharp |
to do |
|
not needed |
||
gnome-system-monitor |
||
gnome-terminal |
||
not needed |
||
gnome-user-docs |
not needed |
|
gnome-user-share |
not needed |
|
not needed |
||
gst-plugins-base |
||
gst-plugins-good |
not needed |
|
gtk-engines |
||
gtkhtml |
||
gvfs |
not needed |
|
hamster-applet |
not needed |
|
libgnomekbd |
||
libgnome-keyring |
not needed |
|
libgtop |
not needed |
|
not needed |
||
liboobs |
not needed |
|
librsvg |
||
not needed |
||
libwnck |
||
metacity |
||
mousetweaks |
||
nautilus-sendto |
||
orca |
not needed |
|
pygtksourceview |
not needed |
|
seahorse-plugins |
||
swfdec-gnome |
||
tomboy |
||
totem-pl-parser |
not needed |
|
vinagre |
||
vino |
||
vte |
||
Platform |
||
GConf |
||
at-spi |
||
atk |
not needed |
|
glib |
not needed |
|
not needed |
||
gtk-doc |
not needed |
|
pango |
not needed |
|
Admin |
||
to do |
||
sabayon |
to do |
|
Development Tools |
||
accerciser |
not needed |
|
anjuta |
||
devhelp |
||
gdl |
||
glade3 |
||
gnome-devel-docs |
not needed |
|
External Dependencies |
||
avahi |
fixed in version 0.6.26 |
|
Berkeley DB (libdb) |
not needed |
|
cairo |
not needed |
|
cairomm |
not needed |
|
clutter |
not needed |
|
clutter-gtk |
fixed in git master (not: 0.10 branch) |
|
conduit |
not needed |
|
dbus |
not needed |
|
dbus-glib |
not needed |
|
dbus-python |
not needed |
|
desktop-file-utils |
not needed |
|
DeviceKit-disks |
not needed |
|
DeviceKit-power |
not needed |
|
enchant |
not needed |
|
expat |
not needed |
|
farsight2 |
not needed |
|
fontconfig |
not needed |
|
gamin |
not needed |
|
gnutls |
not needed |
|
gpgme |
not needed |
|
gtk-vnc |
||
hal |
not needed |
|
hicolor-icon-theme |
not needed |
|
icon-naming-utils |
not needed |
|
intltool |
not needed |
|
iso-codes |
not needed |
|
libatasmart |
not needed |
|
libcanberra |
fix released in 0.24 tarball |
|
libcolorblind |
not needed |
|
libcroco |
not needed |
|
eggdbus |
not needed |
tested with eggdbus-0.6 |
libgda |
fix released in 4.1.5 tarball |
|
libgdata |
not needed |
|
libggz, ggz-client-libs |
not needed |
|
libgpg-error |
not needed |
|
libgcrypt |
not needed |
|
libgsf |
not needed |
|
libical |
not needed |
|
libmapi |
not needed |
|
libmusicbrainz |
not needed |
|
libnotify |
fixed in git master (and future 0.4.6 tarball) |
|
liboil |
not needed |
|
libproxy |
not needed |
|
libtasn1 |
not needed |
|
libunique |
not needed |
|
libxklavier |
not needed |
|
libxml2 |
not needed |
|
libxslt |
not needed |
|
Mono.Addins |
not needed |
|
mozilla (firefox) |
to do |
|
ndesk-dbus |
not needed |
|
ndesk-dbus-glib |
not needed |
|
opal |
not needed |
(tested with opal 3.8.0 tarball) |
pkg-config |
not needed |
|
not needed |
||
polkit-gtk |
||
poppler |
fixed in git master (and either future 0.14.x or 0.12.5 tarball) |
|
pulseaudio |
not needed |
|
ptlib |
not needed |
(tested with ptlib 2.8.0 tarball) |
pycairo |
not needed |
|
Python |
to do |
|
raptor |
not needed |
tested with 1.4.21 |
rarian |
not needed |
|
shared-mime-info |
not needed |
|
sqlite |
not needed |
|
startup-notification |
not needed |
|
swfdec |
||
system-tools-backends |
not needed |
|
telepathy-glib |
not needed |
|
telepathy-mission-control |
not needed |
|
tracker |
||
vala |
||
webkit |
||
Other |
||
accounts-dialog |
||
atomix |
||
banshee |
not needed |
|
to do |
||
to do |
||
contact-lookup-applet |
||
deja-dup |
||
eggcups |
to do |
|
emerillon |
||
eog-plugins |
||
f-spot |
to do |
|
ghex |
||
giggle |
||
gimp |
to do |
|
gitg |
||
glom |
||
gnome-blog |
not needed |
|
gnome-color-manager |
not needed |
|
gnome-commander |
||
gnome-cups-manager |
to do |
|
gnome-main-menu |
to do |
|
to do |
||
gnome-shell |
||
goocanvas |
||
goocanvasmm |
to do |
|
GParted |
not needed |
|
GNOME Phone Manager |
to do |
|
done |
||
to do |
||
gtetrinet |
to do |
|
gthumb |
||
gtkgltext |
||
libbtctl |
to do |
|
libegg |
||
libgoffice |
||
modest |
||
mutter |
||
nautilus-vcs |
to do |
|
nemiver |
to do |
|
not needed |
||
nm-applet |
||
not needed |
||
parcellite |
||
simple-scan |
||
tinymail |
||
to do |