Back to index

unity  6.0.0
Classes | Functions
StandaloneUnity.cpp File Reference
#include <gtk/gtk.h>
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/WindowThread.h"
#include "NuxGraphics/GraphicsEngine.h"
#include <NuxCore/Logger.h>
#include "dash/DashController.h"
#include "dash/DashView.h"
#include "launcher/FavoriteStoreGSettings.h"
#include "launcher/Launcher.h"
#include "launcher/LauncherController.h"
#include "panel/PanelController.h"
#include "panel/PanelView.h"
#include "unity-shared/BGHash.h"
#include "unity-shared/BackgroundEffectHelper.h"
#include "unity-shared/DashStyle.h"
#include "unity-shared/FontSettings.h"
#include "unity-shared/PanelStyle.h"
#include "unity-shared/PluginAdapter.h"
#include "unity-shared/UBusMessages.h"
#include "unity-shared/UBusWrapper.h"
#include "unity-shared/UnitySettings.h"

Go to the source code of this file.

Classes

class  UnityStandalone
class  UnityStandaloneTV

Functions

int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 133 of file StandaloneUnity.cpp.

{
  nux::WindowThread* wt = NULL;
  GError *error = NULL;
  GOptionContext *context;

  nux::NuxInitialize(0);
  nux::logging::configure_logging(::getenv("UNITY_LOG_SEVERITY"));
  
  context = g_option_context_new("- Unity standalone");
  g_option_context_add_main_entries(context, entries, GETTEXT_PACKAGE);
  g_option_context_add_group(context, gtk_get_option_group(TRUE));
  g_option_context_parse(context, &argc, &argv, &error);
  if (error != NULL)
  {
    g_print("Option parsiong failed: %s\n", error->message);
    g_error_free(error);
    exit(1);
  }

  gtk_init(&argc, &argv);

  BGHash bghash;
  FontSettings font_settings;

  // The instances for the pseudo-singletons.
  Settings settings;
  settings.is_standalone = true;
  if (force_tv) Settings::Instance().SetFormFactor(FormFactor::TV);
  
  PluginAdapter::Initialize(NULL);
  dash::Style dash_style;
  panel::Style panel_style;

  GeisAdapter geis_adapter;
  internal::FavoriteStoreGSettings favorite_store;
  BackgroundEffectHelper::blur_type = BLUR_NONE;

  if (!force_tv)
  {
    UnityStandalone *standalone_runner = new UnityStandalone();
    wt = nux::CreateNuxWindow("standalone-unity",
                              display_width, display_height,
                              (no_window_decorations) ? nux::WINDOWSTYLE_NOBORDER : nux::WINDOWSTYLE_NORMAL,
                              0, /* no parent */
                              false,
                              &UnityStandalone::InitWindowThread,
                              standalone_runner);
  }
  else
  {
    //TODO - we should be able to pass in a monitor so that we can make the window
    //the size of the monitor and position the window on the monitor correctly.
    UnityStandaloneTV *standalone_runner = new UnityStandaloneTV();
    wt = nux::CreateNuxWindow("standalone-unity-tv",
                              display_width, display_height,
                              (no_window_decorations) ? nux::WINDOWSTYLE_NOBORDER : nux::WINDOWSTYLE_NORMAL,
                              0, /* no parent */
                              false,
                              &UnityStandaloneTV::InitWindowThread,
                              standalone_runner);
  }
  wt->Run(NULL);
  delete wt;
  return 0;
}

Here is the call graph for this function: