Shell: sort, align, clean up shell-global.h and shell-util.h

https://bugzilla.gnome.org/show_bug.cgi?id=648755
This commit is contained in:
Dan Winship 2011-03-24 10:54:46 -04:00
parent 61577e176e
commit 8e4a5f1ac5
2 changed files with 104 additions and 94 deletions

View File

@ -25,32 +25,26 @@ struct _ShellGlobalClass
GObjectClass parent_class; GObjectClass parent_class;
}; };
GType shell_global_get_type (void) G_GNUC_CONST; GType shell_global_get_type (void) G_GNUC_CONST;
ShellGlobal *shell_global_get (void); ShellGlobal *shell_global_get (void);
typedef enum { MetaScreen *shell_global_get_screen (ShellGlobal *global);
SHELL_CURSOR_DND_IN_DRAG, GdkScreen *shell_global_get_gdk_screen (ShellGlobal *global);
SHELL_CURSOR_DND_UNSUPPORTED_TARGET, GList *shell_global_get_window_actors (ShellGlobal *global);
SHELL_CURSOR_DND_MOVE, GSList *shell_global_get_monitors (ShellGlobal *global);
SHELL_CURSOR_DND_COPY, MetaRectangle *shell_global_get_primary_monitor (ShellGlobal *global);
SHELL_CURSOR_POINTING_HAND int shell_global_get_primary_monitor_index (ShellGlobal *global);
} ShellCursor; MetaRectangle *shell_global_get_focus_monitor (ShellGlobal *global);
GSettings *shell_global_get_settings (ShellGlobal *global);
guint32 shell_global_get_current_time (ShellGlobal *global);
void shell_global_set_cursor (ShellGlobal *global,
ShellCursor type);
void shell_global_unset_cursor (ShellGlobal *global); /* Input/event handling */
gboolean shell_global_begin_modal (ShellGlobal *global,
MetaScreen *shell_global_get_screen (ShellGlobal *global); guint32 timestamp);
void shell_global_end_modal (ShellGlobal *global,
GdkScreen *shell_global_get_gdk_screen (ShellGlobal *global); guint32 timestamp);
gboolean shell_global_add_extension_importer (ShellGlobal *global,
const char *target_object_script,
const char *target_property,
const char *directory,
GError **error);
typedef enum { typedef enum {
SHELL_STAGE_INPUT_MODE_NONREACTIVE, SHELL_STAGE_INPUT_MODE_NONREACTIVE,
@ -59,76 +53,88 @@ typedef enum {
SHELL_STAGE_INPUT_MODE_FULLSCREEN SHELL_STAGE_INPUT_MODE_FULLSCREEN
} ShellStageInputMode; } ShellStageInputMode;
void shell_global_set_stage_input_mode (ShellGlobal *global, void shell_global_set_stage_input_mode (ShellGlobal *global,
ShellStageInputMode mode); ShellStageInputMode mode);
void shell_global_set_stage_input_region (ShellGlobal *global, void shell_global_set_stage_input_region (ShellGlobal *global,
GSList *rectangles); GSList *rectangles);
GList *shell_global_get_window_actors (ShellGlobal *global); /* X utilities */
typedef enum {
SHELL_CURSOR_DND_IN_DRAG,
SHELL_CURSOR_DND_UNSUPPORTED_TARGET,
SHELL_CURSOR_DND_MOVE,
SHELL_CURSOR_DND_COPY,
SHELL_CURSOR_POINTING_HAND
} ShellCursor;
gboolean shell_global_begin_modal (ShellGlobal *global, void shell_global_set_cursor (ShellGlobal *global,
guint32 timestamp); ShellCursor type);
void shell_global_end_modal (ShellGlobal *global, void shell_global_unset_cursor (ShellGlobal *global);
guint32 timestamp);
void shell_global_reexec_self (ShellGlobal *global); guint32 shell_global_create_pointer_barrier (ShellGlobal *global,
int x1,
int y1,
int x2,
int y2,
int directions);
void shell_global_destroy_pointer_barrier (ShellGlobal *global,
guint32 barrier);
void shell_global_gc (ShellGlobal *global); void shell_global_get_pointer (ShellGlobal *global,
int *x,
int *y,
ClutterModifierType *mods);
void shell_global_maybe_gc (ShellGlobal *global);
GSList *shell_global_get_monitors (ShellGlobal *global); /* JavaScript utilities */
MetaRectangle *shell_global_get_primary_monitor (ShellGlobal *global); void shell_global_gc (ShellGlobal *global);
int shell_global_get_primary_monitor_index (ShellGlobal *global); void shell_global_maybe_gc (ShellGlobal *global);
MetaRectangle *shell_global_get_focus_monitor (ShellGlobal *global);
guint32 shell_global_create_pointer_barrier (ShellGlobal *global,
int x1, int y1, int x2, int y2,
int directions);
void shell_global_destroy_pointer_barrier (ShellGlobal *global,
guint32 barrier);
void shell_global_get_pointer (ShellGlobal *global,
int *x,
int *y,
ClutterModifierType *mods);
void shell_global_sync_pointer (ShellGlobal *global);
GSettings *shell_global_get_settings (ShellGlobal *global);
guint32 shell_global_get_current_time (ShellGlobal *global);
GAppLaunchContext *shell_global_create_app_launch_context (ShellGlobal *global);
gboolean shell_global_set_property_mutable (ShellGlobal *global, gboolean shell_global_set_property_mutable (ShellGlobal *global,
const char *object, const char *object,
const char *property, const char *property,
gboolean mutable); gboolean mutable);
void shell_global_begin_work (ShellGlobal *global);
void shell_global_end_work (ShellGlobal *global); /* Run-at-leisure API */
void shell_global_begin_work (ShellGlobal *global);
void shell_global_end_work (ShellGlobal *global);
typedef void (*ShellLeisureFunction) (gpointer data); typedef void (*ShellLeisureFunction) (gpointer data);
void shell_global_run_at_leisure (ShellGlobal *global, void shell_global_run_at_leisure (ShellGlobal *global,
ShellLeisureFunction func, ShellLeisureFunction func,
gpointer user_data, gpointer user_data,
GDestroyNotify notify); GDestroyNotify notify);
void shell_global_play_theme_sound (ShellGlobal *global,
guint id,
const char *name);
void shell_global_cancel_theme_sound (ShellGlobal *global,
guint id);
void shell_global_notify_error (ShellGlobal *global, /* Misc utilities / Shell API */
const char *msg, gboolean shell_global_add_extension_importer (ShellGlobal *global,
const char *details); const char *target_object_script,
const char *target_property,
const char *directory,
GError **error);
void shell_global_init_xdnd (ShellGlobal *global); void shell_global_sync_pointer (ShellGlobal *global);
void shell_global_launch_calendar_server (ShellGlobal *global); GAppLaunchContext *
shell_global_create_app_launch_context (ShellGlobal *global);
void shell_global_play_theme_sound (ShellGlobal *global,
guint id,
const char *name);
void shell_global_cancel_theme_sound (ShellGlobal *global,
guint id);
void shell_global_notify_error (ShellGlobal *global,
const char *msg,
const char *details);
void shell_global_init_xdnd (ShellGlobal *global);
void shell_global_reexec_self (ShellGlobal *global);
void shell_global_launch_calendar_server (ShellGlobal *global);
G_END_DECLS G_END_DECLS

View File

@ -8,34 +8,38 @@
G_BEGIN_DECLS G_BEGIN_DECLS
char *shell_util_get_label_for_uri (const char *text_uri); char *shell_util_get_label_for_uri (const char *text_uri);
GIcon *shell_util_get_icon_for_uri (const char *text_uri); GIcon *shell_util_get_icon_for_uri (const char *text_uri);
GIcon *shell_util_icon_from_string (const char *string, GError **error); GIcon *shell_util_icon_from_string (const char *string,
void shell_util_set_hidden_from_pick (ClutterActor *actor, gboolean hidden); GError **error);
void shell_util_get_transformed_allocation (ClutterActor *actor, void shell_util_set_hidden_from_pick (ClutterActor *actor,
ClutterActorBox *box); gboolean hidden);
char *shell_util_format_date (const char *format, void shell_util_get_transformed_allocation (ClutterActor *actor,
gint64 time_ms); ClutterActorBox *box);
ClutterModifierType shell_get_event_state (ClutterEvent *event); char *shell_util_format_date (const char *format,
gint64 time_ms);
gboolean shell_write_string_to_stream (GOutputStream *stream, ClutterModifierType
const char *str, shell_get_event_state (ClutterEvent *event);
GError **error);
char *shell_get_file_contents_utf8_sync (const char *path, gboolean shell_write_string_to_stream (GOutputStream *stream,
GError **error); const char *str,
GError **error);
void shell_breakpoint (void); char *shell_get_file_contents_utf8_sync (const char *path,
GError **error);
gboolean shell_parse_search_provider (const char *data, void shell_breakpoint (void);
char **name,
char **url, gboolean shell_parse_search_provider (const char *data,
GList **langs, char **name,
char **icon_data_uri, char **url,
GError **error); GList **langs,
char **icon_data_uri,
GError **error);
G_END_DECLS G_END_DECLS