Back to index

unity  6.0.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
unity::Settings::Impl Class Reference
Collaboration diagram for unity::Settings::Impl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ~Impl ()
FormFactor GetFormFactor () const
void SetFormFactor (FormFactor factor)

Static Public Member Functions

 Impl (Settings *owner)

Private Member Functions

void Refresh ()

Static Private Member Functions

static void Changed (GSettings *settings, gchar *key, Impl *self)

Private Attributes

Settingsowner_
GSettings * settings_
FormFactor form_factor_

Detailed Description

Definition at line 38 of file UnitySettings.cpp.


Constructor & Destructor Documentation

unity::Settings::Impl::Impl ( Settings owner) [static]

Definition at line 58 of file UnitySettings.cpp.

  : owner_(owner)
  , settings_(nullptr)
  , form_factor_(FormFactor::DESKTOP)
{
  settings_ = g_settings_new("com.canonical.Unity");
  g_signal_connect(settings_, "changed",
                   (GCallback)(Impl::Changed), this);
  Refresh();
}

Here is the call graph for this function:

Definition at line 69 of file UnitySettings.cpp.

{
  g_object_unref(settings_);
}

Member Function Documentation

void unity::Settings::Impl::Changed ( GSettings *  settings,
gchar *  key,
Impl self 
) [static, private]

Definition at line 94 of file UnitySettings.cpp.

{
  self->Refresh();
}

Here is the caller graph for this function:

Definition at line 99 of file UnitySettings.cpp.

{
  return form_factor_;
}

Here is the caller graph for this function:

void unity::Settings::Impl::Refresh ( ) [private]

Definition at line 74 of file UnitySettings.cpp.

{
  int raw_from_factor = g_settings_get_enum(settings_, FORM_FACTOR);

  if (raw_from_factor == 0) //Automatic
  {
    UScreen *uscreen = UScreen::GetDefault();
    int primary_monitor = uscreen->GetMonitorWithMouse();
    auto geo = uscreen->GetMonitorGeometry(primary_monitor);

    form_factor_ = geo.height > 799 ? FormFactor::DESKTOP : FormFactor::NETBOOK;
  }
  else
  {
    form_factor_ = static_cast<FormFactor>(raw_from_factor);
  }

  owner_->changed.emit();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 104 of file UnitySettings.cpp.

{
  form_factor_ = factor;
  g_settings_set_enum(settings_, FORM_FACTOR, static_cast<int>(factor));
  owner_->changed.emit();
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 54 of file UnitySettings.cpp.

Definition at line 52 of file UnitySettings.cpp.

GSettings* unity::Settings::Impl::settings_ [private]

Definition at line 53 of file UnitySettings.cpp.


The documentation for this class was generated from the following file: