gplugin/gplugin

Bring back the break after functions
develop
2020-02-15, Richard Laager
d87c806b1f05
Bring back the break after functions

With the AlwaysBreak style, functions with many arguments get continued
onto the next line like this:

gplugin_gtk_store_plugin_unloaded_cb(
GObject *manager,
GPluginPlugin *plugin,
gpointer data) {
gplugin_gtk_store_update_plugin_state(
GPLUGIN_GTK_STORE(data), plugin);
}

It is difficult to see where parameters stop and the body starts.

Gary suggested this formatting, which "helps (at least me) visually see
the blocks while scanning the code":

gplugin_gtk_store_plugin_unloaded_cb(
GObject *manager,
GPluginPlugin *plugin,
gpointer data
) {
gplugin_gtk_store_update_plugin_state(
GPLUGIN_GTK_STORE(data), plugin);
}

Unfortunately, that is not something that clang-format supports. We
can get almost the same output (just moving the closing paren), with
the same visual benefits, by using BraceWrapping: AfterFunction: true,
which produces this:

gplugin_gtk_store_plugin_unloaded_cb(
GObject *manager,
GPluginPlugin *plugin,
gpointer data)
{
gplugin_gtk_store_update_plugin_state(
GPLUGIN_GTK_STORE(data), plugin);
}
<?xml version="1.0" encoding="UTF-8"?>
<glade-catalog name="gplugin-gtk"
version="@GPLUGIN_VERSION@"
library="gplugin-gtk"
domain="gplugin"
depends="gtk+"
book="GPlugin">
<glade-widget-classes>
<!-- the get-type-function's are needed due to gplugin's weirdo namespace.
Without them, Glade is going to look for g_plugin_*_get_type and not
gplugin_*_get_type.
-->
<glade-widget-class
name="GPluginGtkPluginInfo"
generic-name="plugininfo"
title="Plugin Info"
get-type-function="gplugin_gtk_plugin_info_get_type"/>
<glade-widget-class
name="GPluginGtkView"
generic-name="pluginview"
title="Plugin View"
get-type-function="gplugin_gtk_view_get_type"/>
<glade-widget-class
name="GPluginGtkStore"
generic-name="pluginstore"
title="Plugin Store"
get-type-function="gplugin_gtk_store_get_type"
toplevel="True"/>
</glade-widget-classes>
<glade-widget-group name="gplugin-gtk" title="GPlugin Gtk+ Widgets">
<glade-widget-class-ref name="GPluginGtkPluginInfo"/>
<glade-widget-class-ref name="GPluginGtkView"/>
<glade-widget-class-ref name="GPluginGtkStore"/>
</glade-widget-group>
</glade-catalog>