![]() |
![]() |
![]() |
Shell Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
char * shell_util_get_label_for_uri (const char *text_uri
); GIcon * shell_util_get_icon_for_uri (const char *text_uri
); void shell_util_set_hidden_from_pick (ClutterActor *actor
,gboolean hidden
); void shell_util_get_transformed_allocation (ClutterActor *actor
,ClutterActorBox *box
); int shell_util_get_week_start (void
); char * shell_util_normalize_and_casefold (const char *str
); char * shell_util_format_date (const char *format
,gint64 time_ms
); void shell_write_soup_message_to_stream (GOutputStream *stream
,SoupMessage *message
,GError **error
); gboolean shell_write_string_to_stream (GOutputStream *stream
,const char *str
,GError **error
); char * shell_get_file_contents_utf8_sync (const char *path
,GError **error
); gboolean shell_parse_search_provider (const char *data
,char **name
,char **url
,GList **langs
,char **icon_data_uri
,GError **error
); void shell_shader_effect_set_double_uniform (ClutterShaderEffect *effect
,const gchar *name
,gdouble value
); gboolean shell_session_is_active_for_systemd (void
); gboolean shell_util_wifexited (int status
,int *exit
);
GIcon * shell_util_get_icon_for_uri (const char *text_uri
);
Look up the icon that should be associated with a given URI. Handles various special GNOME-internal cases like x-nautilus-search, etc.
|
A URI |
Returns : |
A new GIcon. [transfer full] |
void shell_util_set_hidden_from_pick (ClutterActor *actor
,gboolean hidden
);
If hidden
is TRUE
, hide actor
from pick even with a mode of
CLUTTER_PICK_ALL
; if hidden
is FALSE
, unhide actor
.
|
A ClutterActor |
|
Whether actor should be hidden from pick |
void shell_util_get_transformed_allocation (ClutterActor *actor
,ClutterActorBox *box
);
This function is similar to a combination of clutter_actor_get_transformed_position()
,
and clutter_actor_get_transformed_size()
, but unlike
clutter_actor_get_transformed_size()
, it always returns a transform
of the current allocation, while clutter_actor_get_transformed_size()
returns
bad values (the transform of the requested size) if a relayout has been
queued.
This function is more convenient to use than
clutter_actor_get_abs_allocation_vertices()
if no transformation is in effect
and also works around limitations in the GJS binding of arrays.
|
a ClutterActor |
|
location to store returned box in stage coordinates. [out] |
int shell_util_get_week_start (void
);
Gets the first week day for the current locale, expressed as a number in the range 0..6, representing week days from Sunday to Saturday.
Returns : |
A number representing the first week day for the current locale |
char * shell_util_format_date (const char *format
,gint64 time_ms
);
Formats a date for the current locale. This should be used instead of the Spidermonkey Date.toLocaleFormat() extension because Date.toLocaleFormat() is buggy for Unicode format strings: https://bugzilla.mozilla.org/show_bug.cgi?id=508783
|
a strftime-style string format, as parsed by
g_date_time_format()
|
|
milliseconds since 1970-01-01 00:00:00 UTC; the value returned by Date.getTime() |
Returns : |
the formatted date. If the date is outside of the range of a GDateTime (which contains any plausible dates we actually care about), will return an empty string. |
void shell_write_soup_message_to_stream (GOutputStream *stream
,SoupMessage *message
,GError **error
);
Write a string to a GOutputStream as binary data. This is a workaround for the lack of proper binary strings in GJS.
|
a GOutputStream |
|
a SoupMessage |
|
location to store GError |
gboolean shell_write_string_to_stream (GOutputStream *stream
,const char *str
,GError **error
);
Write a string to a GOutputStream as UTF-8. This is a workaround for not having binary buffers in GJS.
|
a GOutputStream |
|
a UTF-8 string to write to stream
|
|
location to store GError |
Returns : |
TRUE if write succeeded |
char * shell_get_file_contents_utf8_sync (const char *path
,GError **error
);
Synchronously load the contents of a file as a NUL terminated string, validating it as UTF-8. Embedded NUL characters count as invalid content.
|
UTF-8 encoded filename path |
|
a GError |
Returns : |
File contents. [transfer full] |
gboolean shell_parse_search_provider (const char *data
,char **name
,char **url
,GList **langs
,char **icon_data_uri
,GError **error
);
|
description of provider |
|
location to store a display name. [out] |
|
location to store template of url. [out] |
|
list of supported languages. [out][transfer full][element-type utf8] |
|
location to store uri. [out] |
|
location to store GError |
Returns : |
TRUE on success |
void shell_shader_effect_set_double_uniform (ClutterShaderEffect *effect
,const gchar *name
,gdouble value
);
Set a double uniform on a ClutterShaderEffect.
The problem here is that JavaScript doesn't have more than one number type, and gjs tries to automatically guess what type we want to set a GValue to. If the number is "1.0" or something, it will use an integer, which will cause errors in GLSL.
|
The ClutterShaderEffect |
|
The name of the uniform |
|
The value to set it to. |
gboolean shell_session_is_active_for_systemd (void
);
Checks whether the session we are running in is currently active, i.e. in the foreground and ready for user input.
Returns : |
TRUE if session is active |
gboolean shell_util_wifexited (int status
,int *exit
);
Implements libc standard WIFEXITED, that cannot be used JS code.
|
the status returned by wait() or waitpid()
|
|
the actual exit status of the process. [out] |
Returns : |
TRUE if the process exited normally, FALSE otherwise |