Go to the source code of this file.
Data Structures | |
| struct | MetaArguments |
| The set of possible options that can be set on Metacity's command line. More... | |
Defines | |
| #define | _GNU_SOURCE |
| #define | _SVID_SOURCE |
Functions | |
| static void | prefs_changed_callback (MetaPreference pref, gpointer data) |
| Called on pref changes. | |
| static void | log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) |
| Prints log messages. | |
| static void | version (void) |
| Prints the version notice. | |
| static void | meta_print_compilation_info (void) |
| Prints a list of which configure script options were used to build this copy of Metacity. | |
| static void | meta_print_self_identity (void) |
| Prints the version number, the current timestamp (not the build date), the locale, the character encoding, and a list of configure script options that were used to build this copy of Metacity. | |
| static void | meta_parse_options (int *argc, char ***argv, MetaArguments *meta_args) |
| Parses argc and argv and returns the arguments that Metacity understands in meta_args. | |
| static void | meta_select_display (gchar *display_name) |
| Selects which display Metacity should use. | |
| int | main (int argc, char **argv) |
| This is where the story begins. | |
| void | meta_quit (MetaExitCode code) |
| Stops Metacity. | |
| void | meta_restart (void) |
| Restarts Metacity. | |
Variables | |
| static MetaExitCode | meta_exit_code = META_EXIT_SUCCESS |
| The exit code we'll return to our parent process when we eventually die. | |
| static GMainLoop * | meta_main_loop = NULL |
| Handle on the main loop, so that we have an easy way of shutting Metacity down. | |
| static gboolean | meta_restart_after_quit = FALSE |
| If set, Metacity will spawn an identical copy of itself immediately before quitting. | |
Functions which parse the command-line arguments, create the display, kick everything off and then close down Metacity when it's time to go.
Definition in file main.c.
| static void log_handler | ( | const gchar * | log_domain, | |
| GLogLevelFlags | log_level, | |||
| const gchar * | message, | |||
| gpointer | user_data | |||
| ) | [static] |
Prints log messages.
If Metacity was compiled with backtrace support, also prints a backtrace (see meta_print_backtrace()).
| log_domain | the domain the error occurred in (we ignore this) | |
| log_level | the log level so that we can filter out less important messages | |
| message | the message to log | |
| user_data | arbitrary data (we ignore this) |
Definition at line 100 of file main.c.
References meta_print_backtrace(), and meta_warning().
Referenced by main().
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
This is where the story begins.
It parses commandline options and environment variables, sets up the screen, hands control off to GTK, and cleans up afterwards.
| argc | Number of arguments (as usual) | |
| argv | Array of arguments (as usual) |
Definition at line 329 of file main.c.
References _, MetaArguments::client_id, MetaArguments::disable_sm, MetaArguments::display_name, FALSE, log_handler(), meta_display_close(), meta_display_open(), meta_errors_init(), meta_exit(), meta_exit_code, META_EXIT_ERROR, meta_fatal(), meta_get_display(), meta_main_loop, meta_parse_options(), meta_prefs_add_listener(), meta_prefs_get_theme(), meta_prefs_init(), meta_print_self_identity(), meta_restart_after_quit, meta_select_display(), meta_session_init(), meta_session_shutdown(), meta_set_debugging(), meta_set_replace_current_wm(), meta_set_syncing(), meta_set_verbose(), meta_ui_have_a_theme(), meta_ui_init(), meta_ui_set_current_theme(), meta_warning(), NULL, prefs_changed_callback(), MetaArguments::print_version, MetaArguments::replace_wm, MetaArguments::save_file, MetaArguments::sync, TRUE, and version().
| static void meta_parse_options | ( | int * | argc, | |
| char *** | argv, | |||
| MetaArguments * | meta_args | |||
| ) | [static] |
Parses argc and argv and returns the arguments that Metacity understands in meta_args.
The strange call signature has to be written like it is so that g_option_context_parse() gets a chance to modify argc and argv.
| argc | Pointer to the number of arguments Metacity was given | |
| argv | Pointer to the array of arguments Metacity was given | |
| meta_args | The result of parsing the arguments. |
Definition at line 235 of file main.c.
References MetaArguments::client_id, MetaArguments::disable_sm, MetaArguments::display_name, FALSE, N_, NULL, options, MetaArguments::print_version, MetaArguments::replace_wm, MetaArguments::save_file, and MetaArguments::sync.
Referenced by main().
| static void meta_print_compilation_info | ( | void | ) | [static] |
Prints a list of which configure script options were used to build this copy of Metacity.
This is actually always called on startup, but it's all no-op unless we're in verbose mode (see meta_set_verbose).
Definition at line 131 of file main.c.
References META_DEBUG_XINERAMA.
Referenced by meta_print_self_identity().
| static void meta_print_self_identity | ( | void | ) | [static] |
Prints the version number, the current timestamp (not the build date), the locale, the character encoding, and a list of configure script options that were used to build this copy of Metacity.
This is actually always called on startup, but it's all no-op unless we're in verbose mode (see meta_set_verbose).
Definition at line 184 of file main.c.
References meta_print_compilation_info(), and NULL.
Referenced by main().
| void meta_quit | ( | MetaExitCode | code | ) |
Stops Metacity.
This tells the event loop to stop processing; it is rather dangerous to use this rather than meta_restart() because this will leave the user with no window manager. We generally do this only if, for example, the session manager asks us to; we assume the session manager knows what it's talking about.
| code | The success or failure code to return to the calling process. |
Definition at line 521 of file main.c.
References meta_exit_code, and meta_main_loop.
Referenced by die_callback(), meta_display_close(), and meta_restart().
| void meta_restart | ( | void | ) |
Restarts Metacity.
In practice, this tells the event loop to stop processing, having first set the meta_restart_after_quit flag which tells Metacity to spawn an identical copy of itself before quitting. This happens on receipt of a _METACITY_RESTART_MESSAGE client event.
Definition at line 536 of file main.c.
References META_EXIT_SUCCESS, meta_quit(), meta_restart_after_quit, and TRUE.
Referenced by event_callback().
| static void meta_select_display | ( | gchar * | display_name | ) | [static] |
| static void prefs_changed_callback | ( | MetaPreference | pref, | |
| gpointer | data | |||
| ) | [static] |
Called on pref changes.
(One of several functions of its kind and purpose.)
| pref | Which preference has changed | |
| data | Arbitrary data (which we ignore) |
Definition at line 552 of file main.c.
References FALSE, meta_display_retheme_all(), meta_display_set_cursor_theme(), META_PREF_CURSOR_SIZE, META_PREF_CURSOR_THEME, META_PREF_THEME, meta_prefs_get_cursor_size(), meta_prefs_get_cursor_theme(), meta_prefs_get_theme(), and meta_ui_set_current_theme().
| static void version | ( | void | ) | [static] |
Prints the version notice.
This is shown when Metacity is called with the --version switch.
Definition at line 114 of file main.c.
References _.
Referenced by main(), and meta_theme_load().
MetaExitCode meta_exit_code = META_EXIT_SUCCESS [static] |
The exit code we'll return to our parent process when we eventually die.
Definition at line 72 of file main.c.
Referenced by main(), and meta_quit().
GMainLoop* meta_main_loop = NULL [static] |
Handle on the main loop, so that we have an easy way of shutting Metacity down.
Definition at line 78 of file main.c.
Referenced by main(), and meta_quit().
gboolean meta_restart_after_quit = FALSE [static] |
If set, Metacity will spawn an identical copy of itself immediately before quitting.
Definition at line 84 of file main.c.
Referenced by main(), and meta_restart().
1.5.5