1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 #ifndef __SHELL_APP_H__
3 #define __SHELL_APP_H__
4 
5 #include <clutter/clutter.h>
6 #include <gio/gio.h>
7 #include <gio/gdesktopappinfo.h>
8 #include <meta/window.h>
9 
10 G_BEGIN_DECLS
11 
12 #define SHELL_TYPE_APP (shell_app_get_type ())
13 G_DECLARE_FINAL_TYPE (ShellApp, shell_app, SHELL, APP, GObject)
14 
15 typedef enum {
16   SHELL_APP_STATE_STOPPED,
17   SHELL_APP_STATE_STARTING,
18   SHELL_APP_STATE_RUNNING
19 } ShellAppState;
20 
21 typedef enum {
22   SHELL_APP_LAUNCH_GPU_APP_PREF = 0,
23   SHELL_APP_LAUNCH_GPU_DISCRETE,
24   SHELL_APP_LAUNCH_GPU_DEFAULT
25 } ShellAppLaunchGpu;
26 
27 const char *shell_app_get_id (ShellApp *app);
28 
29 GDesktopAppInfo *shell_app_get_app_info (ShellApp *app);
30 
31 ClutterActor *shell_app_create_icon_texture (ShellApp *app, int size);
32 GIcon *shell_app_get_icon (ShellApp *app);
33 const char *shell_app_get_name (ShellApp *app);
34 const char *shell_app_get_description (ShellApp *app);
35 gboolean shell_app_is_window_backed (ShellApp *app);
36 
37 void shell_app_activate_window (ShellApp *app, MetaWindow *window, guint32 timestamp);
38 
39 void shell_app_activate (ShellApp      *app);
40 
41 void shell_app_activate_full (ShellApp      *app,
42                               int            workspace,
43                               guint32        timestamp);
44 
45 void shell_app_open_new_window (ShellApp *app,
46                                 int       workspace);
47 gboolean shell_app_can_open_new_window (ShellApp *app);
48 
49 ShellAppState shell_app_get_state (ShellApp *app);
50 
51 gboolean shell_app_request_quit (ShellApp *app);
52 
53 guint shell_app_get_n_windows (ShellApp *app);
54 
55 GSList *shell_app_get_windows (ShellApp *app);
56 
57 GSList *shell_app_get_pids (ShellApp *app);
58 
59 gboolean shell_app_is_on_workspace (ShellApp *app, MetaWorkspace *workspace);
60 
61 gboolean shell_app_launch (ShellApp           *app,
62                            guint               timestamp,
63                            int                 workspace,
64                            ShellAppLaunchGpu   gpu_pref,
65                            GError            **error);
66 
67 void shell_app_launch_action (ShellApp        *app,
68                               const char      *action_name,
69                               guint            timestamp,
70                               int              workspace);
71 
72 int shell_app_compare_by_name (ShellApp *app, ShellApp *other);
73 
74 int shell_app_compare (ShellApp *app, ShellApp *other);
75 
76 void shell_app_update_window_actions (ShellApp *app, MetaWindow *window);
77 void shell_app_update_app_actions    (ShellApp *app, MetaWindow *window);
78 
79 gboolean shell_app_get_busy          (ShellApp *app);
80 
81 G_END_DECLS
82 
83 #endif /* __SHELL_APP_H__ */
84