![]() |
![]() |
![]() |
Shell Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
enum ShellCursor; struct ShellGlobalClass; void (*ShellLeisureFunction) (gpointer data
); ShellMemoryInfo; enum ShellStageInputMode; gboolean shell_global_begin_modal (ShellGlobal *global
,guint32 timestamp
,MetaModalOptions options
); void shell_global_begin_work (ShellGlobal *global
); void shell_global_cancel_theme_sound (ShellGlobal *global
,guint id
); GAppLaunchContext * shell_global_create_app_launch_context (ShellGlobal *global
); guint32 shell_global_create_pointer_barrier (ShellGlobal *global
,int x1
,int y1
,int x2
,int y2
,int directions
); ClutterActor * shell_global_create_xrootpmap_texture (ShellGlobal *global
); void shell_global_destroy_pointer_barrier (ShellGlobal *global
,guint32 barrier
); void shell_global_end_modal (ShellGlobal *global
,guint32 timestamp
); void shell_global_end_work (ShellGlobal *global
); ShellGlobal * shell_global_get (void
); guint32 shell_global_get_current_time (ShellGlobal *global
); MetaDisplay * shell_global_get_display (ShellGlobal *global
); GdkScreen * shell_global_get_gdk_screen (ShellGlobal *global
); void shell_global_get_memory_info (ShellGlobal *global
,ShellMemoryInfo *meminfo
); void shell_global_get_pointer (ShellGlobal *global
,int *x
,int *y
,ClutterModifierType *mods
); MetaScreen * shell_global_get_screen (ShellGlobal *global
); const char * shell_global_get_session_mode (ShellGlobal *global
); GSettings * shell_global_get_settings (ShellGlobal *global
); ClutterStage * shell_global_get_stage (ShellGlobal *global
); GList * shell_global_get_window_actors (ShellGlobal *global
); void shell_global_init_xdnd (ShellGlobal *global
); void shell_global_notify_error (ShellGlobal *global
,const char *msg
,const char *details
); void shell_global_play_theme_sound (ShellGlobal *global
,guint id
,const char *name
); void shell_global_reexec_self (ShellGlobal *global
); void shell_global_run_at_leisure (ShellGlobal *global
,ShellLeisureFunction func
,gpointer user_data
,GDestroyNotify notify
); void shell_global_set_cursor (ShellGlobal *global
,ShellCursor type
); void shell_global_set_stage_input_mode (ShellGlobal *global
,ShellStageInputMode mode
); void shell_global_set_stage_input_region (ShellGlobal *global
,GSList *rectangles
); void shell_global_sync_pointer (ShellGlobal *global
); void shell_global_unset_cursor (ShellGlobal *global
);
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;
typedef struct { guint glibc_uordblks; guint js_bytes; guint gjs_boxed; guint gjs_gobject; guint gjs_function; guint gjs_closure; /* 32 bit to avoid js conversion problems with 64 bit */ guint last_gc_seconds_ago; } ShellMemoryInfo;
typedef enum { SHELL_STAGE_INPUT_MODE_NONREACTIVE, SHELL_STAGE_INPUT_MODE_NORMAL, SHELL_STAGE_INPUT_MODE_FOCUSED, SHELL_STAGE_INPUT_MODE_FULLSCREEN } ShellStageInputMode;
gboolean shell_global_begin_modal (ShellGlobal *global
,guint32 timestamp
,MetaModalOptions options
);
Grabs the keyboard and mouse to the stage window. The stage will
receive all keyboard and mouse events until shell_global_end_modal()
is called. This is used to implement "modes" for the shell, such as the
overview mode or the "looking glass" debug overlay, that block
application and normal key shortcuts.
|
a ShellGlobal |
Returns : |
TRUE if we succesfully entered the mode. FALSE if we couldn't
enter the mode. Failure may occur because an application has the pointer
or keyboard grabbed, because Mutter is in a mode itself like moving a
window or alt-Tab window selection, or because shell_global_begin_modal()
was previouly called. |
void shell_global_begin_work (ShellGlobal *global
);
Marks that we are currently doing work. This is used to to track
whether we are busy for the purposes of shell_global_run_at_leisure()
.
A count is kept and shell_global_end_work()
must be called exactly
as many times as shell_global_begin_work()
.
|
the ShellGlobal |
void shell_global_cancel_theme_sound (ShellGlobal *global
,guint id
);
Cancels a sound notification.
|
the ShellGlobal |
|
the id previously passed to shell_global_play_theme_sound()
|
GAppLaunchContext * shell_global_create_app_launch_context
(ShellGlobal *global
);
Create a GAppLaunchContext set up with the correct timestamp, and targeted to activate on the current workspace.
|
A ShellGlobal |
Returns : |
A new GAppLaunchContext. [transfer full] |
guint32 shell_global_create_pointer_barrier (ShellGlobal *global
,int x1
,int y1
,int x2
,int y2
,int directions
);
If supported by X creates a pointer barrier.
|
a ShellGlobal |
|
left X coordinate |
|
top Y coordinate |
|
right X coordinate |
|
bottom Y coordinate |
|
The directions we're allowed to pass through |
Returns : |
value you can pass to shell_global_destroy_pointer_barrier()
|
ClutterActor * shell_global_create_xrootpmap_texture
(ShellGlobal *global
);
This returns the _XROOTPMAP_ID pixmap that gdm should have stuffed in the root window. The goal here is to allow a smooth fade between plymouth and the shell greeter. This is also a workaround for gjs not supporting raw xlib types.
|
The ShellGlobal |
Returns : |
A ClutterActor that represents the _XROOTPMAP_ID pixmap property from the root window. [transfer floating] |
void shell_global_destroy_pointer_barrier (ShellGlobal *global
,guint32 barrier
);
Destroys the barrier
created by shell_global_create_pointer_barrier()
.
|
a ShellGlobal |
|
a pointer barrier |
void shell_global_end_modal (ShellGlobal *global
,guint32 timestamp
);
Undoes the effect of shell_global_begin_modal()
.
|
a ShellGlobal |
void shell_global_end_work (ShellGlobal *global
);
Marks the end of work that we started with shell_global_begin_work()
.
If no other work is ongoing and functions have been added with
shell_global_run_at_leisure()
, they will be run at the next
opportunity.
|
the ShellGlobal |
ShellGlobal * shell_global_get (void
);
Gets the singleton global object that represents the desktop.
Returns : |
the singleton global object. [transfer none] |
guint32 shell_global_get_current_time (ShellGlobal *global
);
|
A ShellGlobal |
Returns : |
the current X server time from the current Clutter, Gdk, or X
event. If called from outside an event handler, this may return
Clutter .CURRENT_TIME (aka 0), or it may return a slightly
out-of-date timestamp. |
MetaDisplay * shell_global_get_display (ShellGlobal *global
);
Returns : |
The default MetaDisplay. [transfer none] |
GdkScreen * shell_global_get_gdk_screen (ShellGlobal *global
);
Returns : |
Gdk screen object for the shell. [transfer none] |
void shell_global_get_memory_info (ShellGlobal *global
,ShellMemoryInfo *meminfo
);
Load process-global data about memory usage.
|
Output location for memory information. [out caller-allocates] |
void shell_global_get_pointer (ShellGlobal *global
,int *x
,int *y
,ClutterModifierType *mods
);
Gets the pointer coordinates and current modifier key state.
This is a wrapper around gdk_display_get_pointer()
that strips
out any un-declared modifier flags, to make gjs happy; see
https://bugzilla.gnome.org/show_bug.cgi?id=597292.
|
the ShellGlobal |
|
the X coordinate of the pointer, in global coordinates. [out] |
|
the Y coordinate of the pointer, in global coordinates. [out] |
|
the current set of modifier keys that are pressed down. [out] |
MetaScreen * shell_global_get_screen (ShellGlobal *global
);
Returns : |
The default MetaScreen. [transfer none] |
GSettings * shell_global_get_settings (ShellGlobal *global
);
Get the global GSettings instance.
|
A ShellGlobal |
Returns : |
The GSettings object. [transfer none] |
ClutterStage * shell_global_get_stage (ShellGlobal *global
);
Returns : |
The default ClutterStage. [transfer none] |
GList * shell_global_get_window_actors (ShellGlobal *global
);
Gets the list of MetaWindowActor for the plugin's screen
Returns : |
the list of windows. [element-type Meta.WindowActor][transfer none] |
void shell_global_init_xdnd (ShellGlobal *global
);
Enables tracking of Xdnd events
|
the ShellGlobal |
void shell_global_notify_error (ShellGlobal *global
,const char *msg
,const char *details
);
Show a system error notification. Use this function when a user-initiated action results in a non-fatal problem from causes that may not be under system control. For example, an application crash.
|
a ShellGlobal |
|
Error message |
|
Error details |
void shell_global_play_theme_sound (ShellGlobal *global
,guint id
,const char *name
);
Plays a simple sound picked according to Freedesktop sound theme. Really just a workaround for libcanberra not being introspected.
|
the ShellGlobal |
|
an id, used to cancel later (0 if not needed) |
|
the sound name |
void shell_global_reexec_self (ShellGlobal *global
);
Restart the current process. Only intended for development purposes.
|
A ShellGlobal |
void shell_global_run_at_leisure (ShellGlobal *global
,ShellLeisureFunction func
,gpointer user_data
,GDestroyNotify notify
);
Schedules a function to be called the next time the shell is idle. Idle means here no animations, no redrawing, and no ongoing background work. Since there is currently no way to hook into the Clutter master clock and know when is running, the implementation here is somewhat approximation. Animations done through the shell's Tweener module will be handled properly, but other animations may be detected as terminating early if they can be drawn fast enough so that the event loop goes idle between frames.
The intent of this function is for performance measurement runs where a number of actions should be run serially and each action is timed individually. Using this function for other purposes will interfere with the ability to use it for performance measurement so should be avoided.
|
the ShellGlobal |
|
function to call at leisure |
|
data to pass to func
|
|
function to call to free user_data
|
void shell_global_set_cursor (ShellGlobal *global
,ShellCursor type
);
Set the cursor on the stage window.
|
A ShellGlobal |
|
the type of the cursor |
void shell_global_set_stage_input_mode (ShellGlobal *global
,ShellStageInputMode mode
);
Sets the input mode of the stage; when mode
is
SHELL_STAGE_INPUT_MODE_NONREACTIVE
, then the stage does not absorb
any clicks, but just passes them through to underlying windows.
When it is SHELL_STAGE_INPUT_MODE_NORMAL
, then the stage accepts
clicks in the region defined by
shell_global_set_stage_input_region()
but passes through clicks
outside that region. When it is SHELL_STAGE_INPUT_MODE_FULLSCREEN
,
the stage absorbs all input.
When the input mode is SHELL_STAGE_INPUT_MODE_FOCUSED
, the pointer
is handled as with SHELL_STAGE_INPUT_MODE_NORMAL
, but additionally
the stage window has the keyboard focus. If the stage loses the
focus (eg, because the user clicked into a window) the input mode
will revert to SHELL_STAGE_INPUT_MODE_NORMAL
.
Note that whenever a mutter-internal Gtk widget has a pointer grab,
the shell behaves as though it was in
SHELL_STAGE_INPUT_MODE_NONREACTIVE
, to ensure that the widget gets
any clicks it is expecting.
|
the ShellGlobal |
|
the stage input mode |
void shell_global_set_stage_input_region (ShellGlobal *global
,GSList *rectangles
);
Sets the area of the stage that is responsive to mouse clicks when
the stage mode is SHELL_STAGE_INPUT_MODE_NORMAL
(but does not change the
current stage mode).
|
the ShellGlobal |
|
a list of MetaRectangle describing the input region. [element-type Meta.Rectangle] |
void shell_global_sync_pointer (ShellGlobal *global
);
Ensures that clutter is aware of the current pointer position, causing enter and leave events to be emitted if the pointer moved behind our back (ie, during a pointer grab).
|
the ShellGlobal |