This adds a `state-set` signal on the plugin row, which merely re-broadcasts the signal from the switch. This enables the view to watch for the signal and pass along the desired state to the manager.
The plugin row sets the display of the enable switch whenever the plugin state refreshes. I'm not entirely sure if all states are displayed in the way we want.
Testing Done:
Start viewer and see that auto-loaded plugins are actually enabled, and that others can be enabled/disabled.
Reviewed at https://reviews.imfreedom.org/r/1193/
/*
* Copyright (C) 2011-2020 Gary Kramlich <grim@reaperworld.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
#include<glib/gi18n-lib.h>
#include<gplugin/gplugin-core.h>
#include<gplugin/gplugin-loader.h>
#include<gplugin/gplugin-manager.h>
#include<gplugin/gplugin-native-plugin.h>
/**
* GPluginNativePlugin:
*
* An instance of a loaded native plugin. A native plugin is a plugin that was
* compiled to machine native code, typically these are written in C/C++.
*/
/**
* GPluginNativePluginQueryFunc:
* @error: A return address for a #GError.
*
* Specifies the function signature for the query function of a plugin.
*
* Returns: (transfer full): A #GPluginPluginInfo instance on success or %NULL
* with @error set on error.
*
* Since: 0.31.0
*/
/**
* GPluginNativePluginLoadFunc:
* @plugin: The #GPluginPlugin instance.
* @error: A return address for a #GError.
*
* Specifies the function signature for the load function of a plugin.
*
* Returns: %TRUE if @plugin was successfully loaded, or %FALSE with @error
* set on failure.
*
* Since: 0.31.0
*/
/**
* GPluginNativePluginUnloadFunc:
* @plugin: The #GPluginPlugin instance.
* @error: A return address for a #GError.
*
* Specifies the function signature for the unload function of a plugin.
*
* Returns: %TRUE if @plugin was successfully unloaded, or %FALSE with @error
* set on failure.
*
* Since: 0.31.0
*/
/* Apparently clang-format also tries to format code in comments.. But in this
* case it makes it really difficult to understand so we disable it.
*/
/* clang-format off */
/**
* GPLUGIN_NATIVE_PLUGIN_DECLARE:
* @name: The prefix of the user defined function names.
*
* This macro expands to the proper functions that #GPluginNativeLoader looks
* for when querying a plugin. They will call user defined functions named