Skip to content

Commit

Permalink
WIP: Support libpeas based plugin system
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafostar committed Nov 3, 2024
1 parent 220913d commit 1c92df8
Show file tree
Hide file tree
Showing 21 changed files with 2,036 additions and 2 deletions.
8 changes: 8 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ libadwaita_dep = dependency('libadwaita-1',
required: false,
)

# Optional
peas_dep = dependency('libpeas-2',
required: false,
)

cc = meson.get_compiler('c')
libm = cc.find_library('m', required: false)

Expand Down Expand Up @@ -147,6 +152,9 @@ summary('vapi', build_vapi ? 'Yes' : 'No', section: 'Build')
summary('doc', build_doc ? 'Yes' : 'No', section: 'Build')

if build_clapper
foreach name : clapper_possible_functionalities
summary(name, clapper_available_functionalities.contains(name) ? 'Yes' : 'No', section: 'Functionalities')
endforeach
foreach name : clapper_possible_features
summary(name, clapper_available_features.contains(name) ? 'Yes' : 'No', section: 'Features')
endforeach
Expand Down
7 changes: 7 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ option('doc',
description: 'Build documentation'
)

# Functionalities
option('enhancers-loader',
type: 'feature',
value: 'enabled',
description: 'Ability to load libpeas based plugins that enhance functionalities'
)

# Features
option('discoverer',
type: 'feature',
Expand Down
42 changes: 42 additions & 0 deletions src/lib/clapper/clapper-enhancers-loader-private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Clapper Playback Library
* Copyright (C) 2024 Rafał Dzięgiel <[email protected]>
*
* 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.1 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, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

#pragma once

#include <glib.h>
#include <glib-object.h>

G_BEGIN_DECLS

G_GNUC_INTERNAL
void clapper_enhancers_loader_initialize (void);

G_GNUC_INTERNAL
gboolean clapper_enhancers_loader_has_enhancers (GType iface_type);

G_GNUC_INTERNAL
gchar ** clapper_enhancers_loader_get_schemes (GType iface_type);

G_GNUC_INTERNAL
gboolean clapper_enhancers_loader_check (GType iface_type, const gchar *scheme, const gchar *host, const gchar **name);

G_GNUC_INTERNAL
GObject * clapper_enhancers_loader_create_enhancer_for_uri (GType iface_type, GUri *uri);

G_END_DECLS
Loading

0 comments on commit 1c92df8

Please sign in to comment.