
This patch combines several high level changes which are conceptually independent but in practice rather intertwined. * Add a "state" property to ShellApp which reflects whether it's stopped, starting, or started. This will allow us to later clean up all the callers that are using ".get_windows().length > 0" as a proxy for this property * Replace shell_app_launch with shell_app_activate and shell_app_open_new_window A lot of code was calling .launch, but it's signficantly clearer if we call this ".open_new_window()", and later if we gain the ability to call into an application's menu, we can implement this correctly rather than trying to update all .launch callers. * Because ShellApp now has a "starting" state, rebase panel.js on top of this so that when we get a startup-notification sequence for an app and transition it to starting, it becomes the focus app, and panel.js cleanly just tracks the focus app, rather than bouncing between SN sequences. This removes display of non-app startup sequences, which I consider an acceptable action in light of the committed changes to startup-notification and GTK+. https://bugzilla.gnome.org/show_bug.cgi?id=614755
61 lines
1.8 KiB
C
61 lines
1.8 KiB
C
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
#ifndef __SHELL_APP_H__
|
|
#define __SHELL_APP_H__
|
|
|
|
#include <clutter/clutter.h>
|
|
|
|
#include "window.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
typedef struct _ShellApp ShellApp;
|
|
typedef struct _ShellAppClass ShellAppClass;
|
|
typedef struct _ShellAppPrivate ShellAppPrivate;
|
|
|
|
#define SHELL_TYPE_APP (shell_app_get_type ())
|
|
#define SHELL_APP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_APP, ShellApp))
|
|
#define SHELL_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_APP, ShellAppClass))
|
|
#define SHELL_IS_APP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_APP))
|
|
#define SHELL_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_APP))
|
|
#define SHELL_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_APP, ShellAppClass))
|
|
|
|
struct _ShellAppClass
|
|
{
|
|
GObjectClass parent_class;
|
|
|
|
};
|
|
|
|
typedef enum {
|
|
SHELL_APP_STATE_STOPPED,
|
|
SHELL_APP_STATE_STARTING,
|
|
SHELL_APP_STATE_RUNNING
|
|
} ShellAppState;
|
|
|
|
GType shell_app_get_type (void) G_GNUC_CONST;
|
|
|
|
const char *shell_app_get_id (ShellApp *app);
|
|
|
|
ClutterActor *shell_app_create_icon_texture (ShellApp *app, float size);
|
|
ClutterActor *shell_app_get_faded_icon (ShellApp *app, float size);
|
|
char *shell_app_get_name (ShellApp *app);
|
|
char *shell_app_get_description (ShellApp *app);
|
|
gboolean shell_app_is_transient (ShellApp *app);
|
|
|
|
void shell_app_activate (ShellApp *app);
|
|
|
|
void shell_app_open_new_window (ShellApp *app);
|
|
|
|
ShellAppState shell_app_get_state (ShellApp *app);
|
|
|
|
guint shell_app_get_n_windows (ShellApp *app);
|
|
|
|
GSList *shell_app_get_windows (ShellApp *app);
|
|
|
|
gboolean shell_app_is_on_workspace (ShellApp *app, MetaWorkspace *workspace);
|
|
|
|
int shell_app_compare (ShellApp *app, ShellApp *other);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __SHELL_APP_H__ */
|