gplugin/gplugin

Implement enable switch in GTK4 viewer

2021-12-16, Elliott Sales de Andrade
f03eee6f9596
Implement enable switch in GTK4 viewer

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 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GPLUGIN_GTK_VIEWER_WINDOW_H
#define GPLUGIN_GTK_VIEWER_WINDOW_H
#include <gtk/gtk.h>
#include <gplugin-gtk.h>
G_BEGIN_DECLS
#define GPLUGIN_GTK_VIEWER_TYPE_WINDOW (gplugin_gtk_viewer_window_get_type())
G_DECLARE_FINAL_TYPE(
GPluginGtkViewerWindow,
gplugin_gtk_viewer_window,
GPLUGIN_GTK_VIEWER,
WINDOW,
GtkApplicationWindow)
GPluginGtkView *gplugin_gtk_viewer_window_get_view(
GPluginGtkViewerWindow *window);
G_END_DECLS
#endif /* GPLUGIN_GTK_VIEWER_WINDOW_H */