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:

Problems

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

{i} Add your comments to this goal proposal here

Status of this goal

{i} Tip: If you choose to work on a module, create the bug report on the GNOME bugzilla, and make it block bug 585391.
This way people will know someone already works on it, and won't duplicate the work you're doing.

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

done

bug-buddy

not needed

cheese

done

dasher

done

dconf

not needed

deskbar-applet

done

ekiga

done

empathy

done

eog

done

epiphany

done

evince

done

evolution-data-server

done

evolution

done

evolution-exchange

done

evolution-mapi

done

evolution-webcal

done

file-roller

done

gcalctool

done

gconf-editor

done

gdm

done

gedit

done

gnome-applets

done

gnome-backgrounds

not needed

gnome-bluetooth

done

gnome-control-center

done

libslab

to do

2 issues left

gnome-desktop

done

gnome-disk-utility

done

gnome-doc-utils

not needed

gnome-games

done

gnome-icon-theme

not needed

gnome-keyring

done

gnome-mag

done

gnome-media

done

gnome-menus

not needed

gnome-netstatus

done

gnome-nettool

done

gnome-packagekit

not needed

gnome-panel

done

gnome-power-manager

done

gnome-python-desktop

not needed

gnome-screensaver

done

gnome-session

done

gnome-settings-daemon

done

gnome-sharp

to do

gnome-speech

not needed

gnome-system-monitor

done

gnome-system-tools

done

gnome-terminal

done

gnome-themes

not needed

gnome-user-docs

not needed

gnome-user-share

not needed

gnome-utils

done

gok

done

gstreamer

not needed

gst-plugins-base

done

gst-plugins-good

not needed

gtk-engines

done

gtksourceview

done

gtkhtml

done

gucharmap

done

gvfs

not needed

hamster-applet

not needed

libgnomekbd

done

libgnome-keyring

not needed

libgtop

not needed

libgweather

not needed

liboobs

not needed

librsvg

done

libsoup

not needed

libwnck

done

metacity

done

mousetweaks

done

nautilus

done

nautilus-sendto

done

orca

not needed

pygtksourceview

not needed

seahorse

done

seahorse-plugins

done

sound-juicer

done

swfdec-gnome

done

tomboy

done

totem

done

totem-pl-parser

not needed

vinagre

done

vino

done

vte

done

yelp

done

zenity

done

Platform

GConf

done

at-spi

done

atk

not needed

glib

not needed

gtk+

not needed

gtk-doc

not needed

pango

not needed

Admin

pessulus

to do

sabayon

to do

Development Tools

accerciser

not needed

anjuta

done

devhelp

done

gdl

done

glade3

done

gnome-devel-docs

not needed

External Dependencies

avahi

done

fixed in version 0.6.26

Berkeley DB (libdb)

not needed

cairo

not needed

cairomm

not needed

clutter

not needed

clutter-gtk

done

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

done

hal

not needed

hicolor-icon-theme

not needed

icon-naming-utils

not needed

intltool

not needed

iso-codes

not needed

libatasmart

not needed

libcanberra

done

fix released in 0.24 tarball

libchamplain

done

libcolorblind

not needed

libcroco

not needed

eggdbus

not needed

tested with eggdbus-0.6

libgda

done

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

done

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

PolicyKit

not needed

polkit-gtk

done

poppler

done

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

patch

system-tools-backends

not needed

telepathy-glib

not needed

telepathy-mission-control

not needed

tracker

done

vala

done

webkit

done

Other

accounts-dialog

done

atomix

done

banshee

not needed

banter

to do

beagle

to do

contact-lookup-applet

done

deja-dup

done

dia

patch

eggcups

to do

emerillon

done

eog-plugins

done

f-spot

to do

ghex

done

giggle

done

gimp

to do

gitg

done

glom

done

gnome-blog

not needed

gnome-color-manager

not needed

gnome-commander

to do

gnome-cups-manager

to do

gnome-main-menu

to do

gnome-mud

to do

gnome-shell

done

goocanvas

fixed

goocanvasmm

to do

GParted

not needed

GNOME Phone Manager

to do

Gnumeric

done

gossip

to do

gtetrinet

to do

gthumb

to do

gtkgltext

done

gtranslator

done

libbtctl

to do

libegg

done

libgoffice

done

modest

done

mutter

done

nautilus-vcs

to do

nemiver

to do

NetworkManager

not needed

nm-applet

done

ontv

not needed

parcellite

done

Planner

to do

rhythmbox

done

simple-scan

done

tinymail

done

xchat-gnome

to do

Initiatives/GnomeGoals/UseGseal (last edited 2013-12-18 13:44:48 by LuisMenina)