Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add xdp prefixes and move portal implementations to new directory #1438

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <glib.h>
#include <gio/gdesktopappinfo.h>

#include "dynamic-launcher.h"
#include "portals/dynamic-launcher.h"
#include "xdp-utils.h"

static char *
Expand Down
File renamed without changes.
106 changes: 55 additions & 51 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ background_monitor_built_sources = gnome.gdbus_codegen(
if have_geoclue
geoclue_built_sources = gnome.gdbus_codegen(
'geoclue-dbus',
sources: 'org.freedesktop.GeoClue2.Client.xml',
sources: 'portals/org.freedesktop.GeoClue2.Client.xml',
interface_prefix: 'org.freedesktop.GeoClue2',
namespace: 'Geoclue',
autocleanup: 'none',
Expand Down Expand Up @@ -55,62 +55,72 @@ xdp_method_info_sources = files('xdp-method-info.c') + xdp_method_info_built_sou

xdp_utils_includes = include_directories('.')
xdp_utils_sources = files(
'xdp-utils.c',
'xdp-app-info.c',
'xdp-sealed-fd.c',
'xdp-app-info-host.c',
'xdp-app-info-flatpak.c',
'xdp-app-info-snap.c',
'xdp-app-info-test.c',
'xdp-sealed-fd.c',
'xdp-utils.c',
)

if have_libsystemd
xdp_utils_sources += sd_escape_sources
endif

xdg_desktop_portal_sources = files(
'account.c',
'background.c',
'background-monitor.c',
'call.c',
'camera.c',
'clipboard.c',
'documents.c',
'dynamic-launcher.c',
'email.c',
'file-chooser.c',
xdp_portals_sources = files(
'portals/account.c',
'portals/background.c',
'portals/camera.c',
'portals/clipboard.c',
'portals/dynamic-launcher.c',
'portals/email.c',
'portals/file-chooser.c',
'portals/gamemode.c',
'portals/global-shortcuts.c',
'portals/inhibit.c',
'portals/input-capture.c',
'portals/memory-monitor.c',
'portals/network-monitor.c',
'portals/notification.c',
'portals/open-uri.c',
'portals/pipewire.c',
'portals/power-profile-monitor.c',
'portals/print.c',
'portals/proxy-resolver.c',
'portals/realtime.c',
'portals/remote-desktop.c',
'portals/screenshot.c',
'portals/screen-cast.c',
'portals/secret.c',
'portals/settings.c',
'portals/trash.c',
'portals/wallpaper.c',
)

if have_geoclue
xdp_portals_sources += files(
'portals/location.c',
)
endif

xdp_sources = files(
'flatpak-instance.c',
'gamemode.c',
'glib-backports.c',
'global-shortcuts.c',
'inhibit.c',
'input-capture.c',
'launch-context.c',
'memory-monitor.c',
'network-monitor.c',
'notification.c',
'open-uri.c',
'permissions.c',
'pipewire.c',
'portal-impl.c',
'power-profile-monitor.c',
'print.c',
'proxy-resolver.c',
'realtime.c',
'remote-desktop.c',
'request.c',
'restore-token.c',
'screen-cast.c',
'screenshot.c',
'secret.c',
'session.c',
'settings.c',
'trash.c',
'wallpaper.c',
'xdg-desktop-portal.c',
'xdp-app-launch-context.c',
'xdp-background-monitor.c',
'xdp-call.c',
'xdp-documents.c',
'xdp-permissions.c',
'xdp-portal-impl.c',
'xdp-request.c',
'xdp-session.c',
'xdp-session-persistence.c',
)

xdg_desktop_portal_sources += [
xdp_sources += [
xdp_portals_sources,
xdp_utils_sources,
xdp_method_info_sources,
portal_built_sources,
Expand All @@ -120,12 +130,6 @@ xdg_desktop_portal_sources += [
built_resources,
]

if have_geoclue
xdg_desktop_portal_sources += files(
'location.c',
)
endif

common_deps = [
glib_dep,
gio_dep,
Expand All @@ -147,7 +151,7 @@ incs_xdg_desktop_portal = [

xdg_desktop_portal = executable(
'xdg-desktop-portal',
xdg_desktop_portal_sources,
xdp_sources,
dependencies: xdg_desktop_portal_deps,
include_directories: incs_xdg_desktop_portal,
install: true,
Expand Down Expand Up @@ -178,15 +182,15 @@ endif

xdp_validate_icon = executable(
'xdg-desktop-portal-validate-icon',
'validate-icon.c',
'helpers/validate-icon.c',
dependencies: [gdk_pixbuf_dep, gio_unix_dep],
c_args: validate_icon_c_args,
install: true,
install_dir: libexecdir,
)

configure_file(
input: 'xdg-desktop-portal-rewrite-launchers.service.in',
input: 'helpers/xdg-desktop-portal-rewrite-launchers.service.in',
output: '@BASENAME@',
configuration: base_config,
install: true,
Expand All @@ -195,7 +199,7 @@ configure_file(

executable(
'xdg-desktop-portal-rewrite-launchers',
'rewrite-launchers.c',
'helpers/rewrite-launchers.c',
'glib-backports.c',
dependencies: common_deps,
include_directories: common_includes,
Expand Down
58 changes: 0 additions & 58 deletions src/permissions.h

This file was deleted.

18 changes: 9 additions & 9 deletions src/account.c → src/portals/account.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include <gio/gio.h>

#include "account.h"
#include "request.h"
#include "documents.h"
#include "xdp-request.h"
#include "xdp-documents.h"
#include "xdp-dbus.h"
#include "xdp-impl-dbus.h"
#include "xdp-utils.h"
Expand Down Expand Up @@ -67,7 +67,7 @@ send_response_in_thread_func (GTask *task,
gpointer task_data,
GCancellable *cancellable)
{
Request *request = task_data;
XdpRequest *request = task_data;
guint response;
GVariant *results;
GVariantBuilder new_results;
Expand Down Expand Up @@ -99,7 +99,7 @@ send_response_in_thread_func (GTask *task,
if (xdp_app_info_is_host (request->app_info))
ruri = g_strdup (image);
else
ruri = register_document (image, xdp_app_info_get_id (request->app_info), DOCUMENT_FLAG_NONE, &error);
ruri = xdp_register_document (image, xdp_app_info_get_id (request->app_info), XDP_DOCUMENT_FLAG_NONE, &error);

if (ruri == NULL)
g_warning ("Failed to register %s: %s", image, error->message);
Expand All @@ -116,7 +116,7 @@ send_response_in_thread_func (GTask *task,
xdp_dbus_request_emit_response (XDP_DBUS_REQUEST (request),
response,
g_variant_builder_end (&new_results));
request_unexport (request);
xdp_request_unexport (request);
}
}

Expand All @@ -125,7 +125,7 @@ get_user_information_done (GObject *source,
GAsyncResult *result,
gpointer data)
{
g_autoptr(Request) request = data;
g_autoptr(XdpRequest) request = data;
guint response = 2;
g_autoptr(GVariant) results = NULL;
g_autoptr(GError) error = NULL;
Expand Down Expand Up @@ -178,7 +178,7 @@ handle_get_user_information (XdpDbusAccount *object,
const gchar *arg_parent_window,
GVariant *arg_options)
{
Request *request = request_from_invocation (invocation);
XdpRequest *request = xdp_request_from_invocation (invocation);
const char *app_id = xdp_app_info_get_id (request->app_info);
g_autoptr(GError) error = NULL;
g_autoptr(XdpDbusImplRequest) impl_request = NULL;
Expand All @@ -199,8 +199,8 @@ handle_get_user_information (XdpDbusAccount *object,
return G_DBUS_METHOD_INVOCATION_HANDLED;
}

request_set_impl_request (request, impl_request);
request_export (request, g_dbus_method_invocation_get_connection (invocation));
xdp_request_set_impl_request (request, impl_request);
xdp_request_export (request, g_dbus_method_invocation_get_connection (invocation));

g_variant_builder_init (&options, G_VARIANT_TYPE_VARDICT);
xdp_filter_options (arg_options, &options,
Expand Down
File renamed without changes.
Loading
Loading