mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 19:10:43 -05:00
core: Make MetaStartupSequence/Notification public
This will be preferred over SnStartupNotification, as exposed through MetaDisplay.
This commit is contained in:
parent
4a69a0d7f7
commit
4d92979b43
@ -314,6 +314,7 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
|||||||
meta/prefs.h \
|
meta/prefs.h \
|
||||||
core/startup-notification.c \
|
core/startup-notification.c \
|
||||||
core/startup-notification-private.h \
|
core/startup-notification-private.h \
|
||||||
|
meta/meta-startup-notification.h \
|
||||||
meta/types.h \
|
meta/types.h \
|
||||||
core/restart.c \
|
core/restart.c \
|
||||||
core/stack.c \
|
core/stack.c \
|
||||||
@ -575,6 +576,7 @@ libmutterinclude_headers = \
|
|||||||
meta/meta-shaped-texture.h \
|
meta/meta-shaped-texture.h \
|
||||||
meta/meta-shadow-factory.h \
|
meta/meta-shadow-factory.h \
|
||||||
meta/meta-stage.h \
|
meta/meta-stage.h \
|
||||||
|
meta/meta-startup-notification.h \
|
||||||
meta/meta-window-actor.h \
|
meta/meta-window-actor.h \
|
||||||
meta/meta-window-group.h \
|
meta/meta-window-group.h \
|
||||||
meta/meta-window-shape.h \
|
meta/meta-window-shape.h \
|
||||||
|
@ -3644,3 +3644,9 @@ meta_display_get_workspace_manager (MetaDisplay *display)
|
|||||||
{
|
{
|
||||||
return display->workspace_manager;
|
return display->workspace_manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MetaStartupNotification *
|
||||||
|
meta_display_get_startup_notification (MetaDisplay *display)
|
||||||
|
{
|
||||||
|
return display->startup_notification;
|
||||||
|
}
|
||||||
|
@ -26,11 +26,8 @@
|
|||||||
#define META_STARTUP_NOTIFICATION_PRIVATE_H
|
#define META_STARTUP_NOTIFICATION_PRIVATE_H
|
||||||
|
|
||||||
#include "core/display-private.h"
|
#include "core/display-private.h"
|
||||||
|
#include "meta/meta-startup-notification.h"
|
||||||
|
|
||||||
#define META_TYPE_STARTUP_NOTIFICATION (meta_startup_notification_get_type ())
|
|
||||||
#define META_TYPE_STARTUP_SEQUENCE (meta_startup_sequence_get_type ())
|
|
||||||
|
|
||||||
typedef struct _MetaStartupSequence MetaStartupSequence;
|
|
||||||
typedef struct _MetaStartupSequenceClass MetaStartupSequenceClass;
|
typedef struct _MetaStartupSequenceClass MetaStartupSequenceClass;
|
||||||
|
|
||||||
struct _MetaStartupSequenceClass
|
struct _MetaStartupSequenceClass
|
||||||
@ -63,6 +60,4 @@ MetaStartupSequence *
|
|||||||
meta_startup_notification_lookup_sequence (MetaStartupNotification *sn,
|
meta_startup_notification_lookup_sequence (MetaStartupNotification *sn,
|
||||||
const gchar *id);
|
const gchar *id);
|
||||||
|
|
||||||
GSList * meta_startup_notification_get_sequences (MetaStartupNotification *sn);
|
|
||||||
|
|
||||||
#endif /* META_STARTUP_NOTIFICATION_PRIVATE_H */
|
#endif /* META_STARTUP_NOTIFICATION_PRIVATE_H */
|
||||||
|
@ -90,6 +90,7 @@ typedef struct {
|
|||||||
char *id;
|
char *id;
|
||||||
uint64_t timestamp;
|
uint64_t timestamp;
|
||||||
int workspace;
|
int workspace;
|
||||||
|
uint completed : 1;
|
||||||
} MetaStartupSequencePrivate;
|
} MetaStartupSequencePrivate;
|
||||||
|
|
||||||
G_DEFINE_TYPE (MetaStartupNotification,
|
G_DEFINE_TYPE (MetaStartupNotification,
|
||||||
@ -288,35 +289,113 @@ meta_startup_sequence_class_init (MetaStartupSequenceClass *klass)
|
|||||||
g_object_class_install_properties (object_class, N_SEQ_PROPS, seq_props);
|
g_object_class_install_properties (object_class, N_SEQ_PROPS, seq_props);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const gchar *
|
const char *
|
||||||
meta_startup_sequence_get_id (MetaStartupSequence *seq)
|
meta_startup_sequence_get_id (MetaStartupSequence *seq)
|
||||||
{
|
{
|
||||||
MetaStartupSequencePrivate *priv;
|
MetaStartupSequencePrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (META_IS_STARTUP_SEQUENCE (seq), NULL);
|
||||||
|
|
||||||
priv = meta_startup_sequence_get_instance_private (seq);
|
priv = meta_startup_sequence_get_instance_private (seq);
|
||||||
return priv->id;
|
return priv->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint64
|
uint64_t
|
||||||
meta_startup_sequence_get_timestamp (MetaStartupSequence *seq)
|
meta_startup_sequence_get_timestamp (MetaStartupSequence *seq)
|
||||||
{
|
{
|
||||||
MetaStartupSequencePrivate *priv;
|
MetaStartupSequencePrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (META_IS_STARTUP_SEQUENCE (seq), 0);
|
||||||
|
|
||||||
priv = meta_startup_sequence_get_instance_private (seq);
|
priv = meta_startup_sequence_get_instance_private (seq);
|
||||||
return priv->timestamp;
|
return priv->timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
meta_startup_sequence_complete (MetaStartupSequence *seq)
|
meta_startup_sequence_complete (MetaStartupSequence *seq)
|
||||||
{
|
{
|
||||||
MetaStartupSequenceClass *klass;
|
MetaStartupSequenceClass *klass;
|
||||||
|
MetaStartupSequencePrivate *priv;
|
||||||
|
|
||||||
|
g_return_if_fail (META_IS_STARTUP_SEQUENCE (seq));
|
||||||
|
|
||||||
|
priv = meta_startup_sequence_get_instance_private (seq);
|
||||||
|
if (priv->completed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
priv->completed = TRUE;
|
||||||
klass = META_STARTUP_SEQUENCE_GET_CLASS (seq);
|
klass = META_STARTUP_SEQUENCE_GET_CLASS (seq);
|
||||||
|
|
||||||
if (klass->complete)
|
if (klass->complete)
|
||||||
klass->complete (seq);
|
klass->complete (seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_startup_sequence_get_completed (MetaStartupSequence *seq)
|
||||||
|
{
|
||||||
|
MetaStartupSequencePrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (META_IS_STARTUP_SEQUENCE (seq), FALSE);
|
||||||
|
|
||||||
|
priv = meta_startup_sequence_get_instance_private (seq);
|
||||||
|
return priv->completed;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
meta_startup_sequence_get_name (MetaStartupSequence *seq)
|
||||||
|
{
|
||||||
|
MetaStartupSequencePrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (META_IS_STARTUP_SEQUENCE (seq), NULL);
|
||||||
|
|
||||||
|
priv = meta_startup_sequence_get_instance_private (seq);
|
||||||
|
return priv->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
meta_startup_sequence_get_workspace (MetaStartupSequence *seq)
|
||||||
|
{
|
||||||
|
MetaStartupSequencePrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (META_IS_STARTUP_SEQUENCE (seq), 0);
|
||||||
|
|
||||||
|
priv = meta_startup_sequence_get_instance_private (seq);
|
||||||
|
return priv->workspace;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
meta_startup_sequence_get_icon_name (MetaStartupSequence *seq)
|
||||||
|
{
|
||||||
|
MetaStartupSequencePrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (META_IS_STARTUP_SEQUENCE (seq), NULL);
|
||||||
|
|
||||||
|
priv = meta_startup_sequence_get_instance_private (seq);
|
||||||
|
return priv->icon_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
meta_startup_sequence_get_application_id (MetaStartupSequence *seq)
|
||||||
|
{
|
||||||
|
MetaStartupSequencePrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (META_IS_STARTUP_SEQUENCE (seq), NULL);
|
||||||
|
|
||||||
|
priv = meta_startup_sequence_get_instance_private (seq);
|
||||||
|
return priv->application_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
meta_startup_sequence_get_wmclass (MetaStartupSequence *seq)
|
||||||
|
{
|
||||||
|
MetaStartupSequencePrivate *priv;
|
||||||
|
|
||||||
|
g_return_val_if_fail (META_IS_STARTUP_SEQUENCE (seq), NULL);
|
||||||
|
|
||||||
|
priv = meta_startup_sequence_get_instance_private (seq);
|
||||||
|
return priv->wmclass;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_startup_notification_add_sequence (MetaStartupNotification *sn,
|
meta_startup_notification_add_sequence (MetaStartupNotification *sn,
|
||||||
MetaStartupSequence *seq)
|
MetaStartupSequence *seq)
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <meta/prefs.h>
|
#include <meta/prefs.h>
|
||||||
#include <meta/common.h>
|
#include <meta/common.h>
|
||||||
#include <meta/workspace.h>
|
#include <meta/workspace.h>
|
||||||
|
#include <meta/meta-startup-notification.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MetaTabList:
|
* MetaTabList:
|
||||||
@ -225,5 +226,6 @@ typedef enum
|
|||||||
} MetaDisplayCorner;
|
} MetaDisplayCorner;
|
||||||
|
|
||||||
MetaWorkspaceManager *meta_display_get_workspace_manager (MetaDisplay *display);
|
MetaWorkspaceManager *meta_display_get_workspace_manager (MetaDisplay *display);
|
||||||
|
MetaStartupNotification * meta_display_get_startup_notification (MetaDisplay *display);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,6 +25,7 @@ mutter_public_headers = [
|
|||||||
'meta-shadow-factory.h',
|
'meta-shadow-factory.h',
|
||||||
'meta-shaped-texture.h',
|
'meta-shaped-texture.h',
|
||||||
'meta-stage.h',
|
'meta-stage.h',
|
||||||
|
'meta-startup-notification.h',
|
||||||
'meta-window-actor.h',
|
'meta-window-actor.h',
|
||||||
'meta-window-group.h',
|
'meta-window-group.h',
|
||||||
'meta-window-shape.h',
|
'meta-window-shape.h',
|
||||||
|
45
src/meta/meta-startup-notification.h
Normal file
45
src/meta/meta-startup-notification.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2018 Red Hat, Inc
|
||||||
|
*
|
||||||
|
* 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 2 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 META_STARTUP_NOTIFICATION_H
|
||||||
|
#define META_STARTUP_NOTIFICATION_H
|
||||||
|
|
||||||
|
#define META_TYPE_STARTUP_SEQUENCE (meta_startup_sequence_get_type ())
|
||||||
|
#define META_TYPE_STARTUP_NOTIFICATION (meta_startup_notification_get_type ())
|
||||||
|
|
||||||
|
typedef struct _MetaStartupNotification MetaStartupNotification;
|
||||||
|
typedef struct _MetaStartupSequence MetaStartupSequence;
|
||||||
|
|
||||||
|
GType meta_startup_notification_get_type (void);
|
||||||
|
|
||||||
|
GSList * meta_startup_notification_get_sequences (MetaStartupNotification *sn);
|
||||||
|
|
||||||
|
GType meta_startup_sequence_get_type (void);
|
||||||
|
|
||||||
|
const char * meta_startup_sequence_get_id (MetaStartupSequence *sequence);
|
||||||
|
gboolean meta_startup_sequence_get_completed (MetaStartupSequence *sequence);
|
||||||
|
const char * meta_startup_sequence_get_name (MetaStartupSequence *sequence);
|
||||||
|
int meta_startup_sequence_get_workspace (MetaStartupSequence *sequence);
|
||||||
|
uint64_t meta_startup_sequence_get_timestamp (MetaStartupSequence *sequence);
|
||||||
|
const char * meta_startup_sequence_get_icon_name (MetaStartupSequence *sequence);
|
||||||
|
const char * meta_startup_sequence_get_application_id (MetaStartupSequence *sequence);
|
||||||
|
const char * meta_startup_sequence_get_wmclass (MetaStartupSequence *sequence);
|
||||||
|
|
||||||
|
void meta_startup_sequence_complete (MetaStartupSequence *sequence);
|
||||||
|
|
||||||
|
#endif /* META_STARTUP_NOTIFICATION_H */
|
Loading…
Reference in New Issue
Block a user