midori/HACKING
Christian Dywan e1f62329f1 Initial refactoring work, regressions expected
The 'browser' struct is superseded by MidoriBrowser, which actually
represents a window that holds pages, i.e. tabs. The tabs are currently
of the type MidoriWebView, which is a slightly enhanced WebView. Also
MidoriWebSettings is introduced to hold additional settings that Midori
needs.

The other two new classes are MidoriTrash, representing closed tabs and
windows and MidoriPanel, representing the side panel.

The refactoring allows for several features to be much more easily
implemented, such as full support for multiple windows and instant
saving of modified files, such as bookmarks or the session. Regressions
are expected and not everything is done yet.
2008-03-10 22:26:09 +01:00

91 lines
1.5 KiB
Text

It is 4 spaces, no tabs, preferrably at 80 columns per line.
The preferred coding style is explained by example.
Source file example:
/*
Copyright
LICENSE TEXT
*/
#include "foo.h"
#include "bar.h"
#include <glib.h>
void foobar(FooEnum bar, const gchar* foo)
{
if(!foo)
return;
#ifdef BAR_STRICT
if (bar == FOO_N)
{
g_print ("illegal value for 'bar'.\n");
return;
}
#endif
// this is an example
gint n;
switch (bar)
{
case FOO_FOO:
n = bar + 1;
break;
case FOO_BAR:
n = bar + 10;
break;
default:
n = 1;
}
guint i;
for (i = 0; i < n; i++)
{
g_print ("%s\n", foo);
}
}
Header file example:
/*
Copyright
LICENSE TEXT
*/
#ifndef __FOO_H__
#define __FOO_H__ 1
#ifdef HAVE_BAR_H
#define BAR_STRICT
#endif
// -- Types
typedef enum
{
FOO_FOO,
FOO_BAR,
FOO_N
} FooEnum;
typedef struct
{
FooEnum foo_bar;
} FooStruct;
// -- Declarations
void
foo_bar (FooEnum bar,
const gchar* foo);
const gchar*
foo_foo (FooStruct foo_struct,
guint number,
gboolean flag);
#endif /* !__FOO_H__ */