Back to index

lightdm  1.3.2
plymouth.c
Go to the documentation of this file.
00001 #include <stdlib.h>
00002 #include <string.h>
00003 #include <glib.h>
00004 #include <glib-object.h>
00005 
00006 #include "status.h"
00007 
00008 static GKeyFile *config;
00009 
00010 static void
00011 request_cb (const gchar *message)
00012 {
00013 }
00014 
00015 int
00016 main (int argc, char **argv)
00017 {
00018     g_type_init ();
00019 
00020     status_connect (request_cb);
00021 
00022     config = g_key_file_new ();
00023     g_key_file_load_from_file (config, g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "script", NULL), G_KEY_FILE_NONE, NULL);
00024 
00025     if (!g_key_file_get_boolean (config, "test-plymouth-config", "enabled", NULL))
00026         return EXIT_FAILURE;
00027 
00028     if (argc == 2 && strcmp (argv[1], "--ping") == 0)
00029     {
00030         if (g_key_file_get_boolean (config, "test-plymouth-config", "active", NULL))
00031         {
00032             status_notify ("PLYMOUTH PING ACTIVE=TRUE");
00033             return EXIT_SUCCESS;
00034         }
00035         else
00036         {
00037             status_notify ("PLYMOUTH PING ACTIVE=FALSE");
00038             return EXIT_FAILURE;
00039         }
00040     }
00041     if (argc == 2 && strcmp (argv[1], "--has-active-vt") == 0)
00042     {
00043         if (g_key_file_get_boolean (config, "test-plymouth-config", "has-active-vt", NULL))
00044         {          
00045             status_notify ("PLYMOUTH HAS-ACTIVE-VT=TRUE");
00046             return EXIT_SUCCESS;
00047         }
00048         else
00049         {
00050             status_notify ("PLYMOUTH HAS-ACTIVE-VT=FALSE");
00051             return EXIT_FAILURE;
00052         }
00053     }
00054     if (argc == 2 && strcmp (argv[1], "deactivate") == 0)
00055         status_notify ("PLYMOUTH DEACTIVATE");
00056     if (argc == 2 && strcmp (argv[1], "quit") == 0)
00057         status_notify ("PLYMOUTH QUIT RETAIN-SPLASH=FALSE");
00058     if (argc == 3 && strcmp (argv[1], "quit") == 0 && strcmp (argv[2], "--retain-splash") == 0)
00059         status_notify ("PLYMOUTH QUIT RETAIN-SPLASH=TRUE");
00060 
00061     return EXIT_SUCCESS;
00062 }