Back to index

unity  6.0.0
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
unity Namespace Reference

Internally the favorite store keeps the full path to the application, but when saving, only the desktop file id is saved if the favorite is in one of the system directories. More...

Namespaces

namespace  colors
namespace  dash
namespace  debug
namespace  emulators
namespace  glib
namespace  hud
namespace  impl
namespace  indicator
namespace  internal
namespace  json
namespace  launcher
namespace  local
namespace  MT
namespace  panel
namespace  performance
namespace  shortcut
namespace  switcher
namespace  tests
namespace  ui
namespace  util
namespace  variant

Classes

class  PlacesGroup
class  CairoBaseWindow
class  DevicesSettings
class  DNDCollectionWindow
 DNDCollectionWindow makes it possible to collect drag and drop (dnd) data as soon as dnd starts and not when the mouse pointer enter the x window. More...
class  DndData
class  FavoriteStore
class  LauncherEntryRemote
 Instances of this class mirrors the remote metadata for a laucnher entry exposed by an application via the com.canonical.Unity.LauncherEntry DBus API. More...
class  LauncherEntryRemoteModel
class  LauncherHoverMachine
class  QuicklistManager
class  QuicklistMenuItem
class  QuicklistMenuItemCheckmark
class  QuicklistMenuItemLabel
class  QuicklistMenuItemRadio
class  QuicklistMenuItemSeparator
class  QuicklistView
class  Tooltip
class  PanelIndicatorEntryView
class  PanelIndicatorsView
class  PanelMenuView
class  PanelTitlebarGrabArea
class  PanelTray
class  PanelView
class  WindowButton
class  WindowButtons
class  GeometryCollection
class  TexGeometryCollection
class  PaintInfoCollector
class  ScreenEffectFramebufferObject
class  UnityScreen
class  UnityWindow
class  UnityPluginVTable
 Your vTable class is some basic info about the plugin that core uses. More...
class  ShowdesktopHandlerWindowInterface
class  ShowdesktopHandler
class  AbstractSeparator
class  Animator
class  BGHash
class  FontSettings
class  IconLoader
class  IconTexture
class  IMTextEntry
class  HSeparator
class  OverlayRendererImpl
class  OverlayRenderer
class  SearchBar
class  SearchBarSpinner
class  TextureCache
class  TimeUtil
class  UBusManager
class  Settings
class  UScreen
class  DesktopUtilities

Typedefs

typedef std::list< std::string > DeviceList
typedef std::list< std::string > FavoriteList
typedef std::vector
< GLTexture::MatrixList > 
MatrixListVector
typedef std::vector< CompRegion > CompRegionVector
typedef std::vector< int > IntVector
typedef nux::ObjectPtr
< nux::BaseTexture > 
BaseTexturePtr

Enumerations

enum  QuicklistMenuItemType {
  MENUITEM_TYPE_UNKNOWN = 0, MENUITEM_TYPE_LABEL, MENUITEM_TYPE_SEPARATOR, MENUITEM_TYPE_CHECK,
  MENUITEM_TYPE_RADIO
}
enum  BlurType { BLUR_NONE, BLUR_STATIC, BLUR_ACTIVE }
enum  SpinnerState { STATE_READY, STATE_SEARCHING, STATE_CLEAR }
enum  FormFactor { DESKTOP = 1, NETBOOK = 2, TV }

Functions

 NUX_IMPLEMENT_OBJECT_TYPE (PlacesGroup)
 NUX_IMPLEMENT_OBJECT_TYPE (CairoBaseWindow)
 NUX_IMPLEMENT_OBJECT_TYPE (DNDCollectionWindow)
 NUX_IMPLEMENT_OBJECT_TYPE (QuicklistMenuItem)
static void OnPropertyChanged (gchar *property, GValue *value, QuicklistMenuItem *self)
static void OnItemActivated (guint timestamp, QuicklistMenuItem *self)
static double _align (double val)
 NUX_IMPLEMENT_OBJECT_TYPE (QuicklistView)
void ql_tint_dot_hl (cairo_t *cr, gint width, gint height, gfloat hl_x, gfloat hl_y, gfloat hl_size, gfloat *rgba_tint, gfloat *rgba_hl, gfloat *rgba_dot)
void ql_setup (cairo_surface_t **surf, cairo_t **cr, gboolean outline, gint width, gint height, gboolean negative)
void ql_compute_full_mask_path (cairo_t *cr, gfloat anchor_width, gfloat anchor_height, gint width, gint height, gint upper_size, gfloat radius, guint pad)
void ql_compute_mask (cairo_t *cr)
void ql_compute_outline (cairo_t *cr, gfloat line_width, gfloat *rgba_line, gfloat size)
void ql_draw (cairo_t *cr, gboolean outline, gfloat line_width, gfloat *rgba, gboolean negative, gboolean stroke)
void ql_finalize (cairo_t **cr, gboolean outline, gfloat line_width, gfloat *rgba, gboolean negative, gboolean stroke)
void ql_compute_full_outline_shadow (cairo_t *cr, cairo_surface_t *surf, gint width, gint height, gfloat anchor_width, gfloat anchor_height, gint upper_size, gfloat corner_radius, guint blur_coeff, gfloat *rgba_shadow, gfloat line_width, gint padding_size, gfloat *rgba_line)
void ql_compute_full_mask (cairo_t *cr, cairo_surface_t *surf, gint width, gint height, gfloat radius, guint shadow_radius, gfloat anchor_width, gfloat anchor_height, gint upper_size, gboolean negative, gboolean outline, gfloat line_width, gint padding_size, gfloat *rgba)
 NUX_IMPLEMENT_OBJECT_TYPE (Tooltip)
void tint_dot_hl (cairo_t *cr, gint width, gint height, gfloat hl_x, gfloat hl_y, gfloat hl_size, gfloat *rgba_tint, gfloat *rgba_hl, gfloat *rgba_dot)
void _setup (cairo_surface_t **surf, cairo_t **cr, gboolean outline, gint width, gint height, gboolean negative)
void _compute_full_mask_path (cairo_t *cr, gfloat anchor_width, gfloat anchor_height, gint width, gint height, gint upper_size, gfloat radius, guint pad)
void compute_mask (cairo_t *cr)
void compute_outline (cairo_t *cr, gfloat line_width, gfloat *rgba_line)
void _draw (cairo_t *cr, gboolean outline, gfloat line_width, gfloat *rgba, gboolean negative, gboolean stroke)
void _finalize (cairo_t **cr, gboolean outline, gfloat line_width, gfloat *rgba, gboolean negative, gboolean stroke)
void compute_full_outline_shadow (cairo_t *cr, cairo_surface_t *surf, gint width, gint height, gfloat anchor_width, gfloat anchor_height, gint upper_size, gfloat corner_radius, guint blur_coeff, gfloat *rgba_shadow, gfloat line_width, gint padding_size, gfloat *rgba_line)
void compute_full_mask (cairo_t *cr, cairo_surface_t *surf, gint width, gint height, gfloat radius, guint shadow_radius, gfloat anchor_width, gfloat anchor_height, gint upper_size, gboolean negative, gboolean outline, gfloat line_width, gint padding_size, gfloat *rgba)
 NUX_IMPLEMENT_OBJECT_TYPE (PanelIndicatorsView)
 NUX_IMPLEMENT_OBJECT_TYPE (PanelView)
bool isNuxWindow (CompWindow *value)
nux::BaseTexture * texture_from_cairo_graphics (nux::CairoGraphics &cg)
BaseTexturePtr texture_ptr_from_cairo_graphics (nux::CairoGraphics &cg)
 NUX_IMPLEMENT_OBJECT_TYPE (IMTextEntry)
 NUX_IMPLEMENT_OBJECT_TYPE (SearchBar)
 NUX_IMPLEMENT_OBJECT_TYPE (SearchBarSpinner)

Variables

const std::string DBUS_BUS_NAME = "com.canonical.Unity"

Detailed Description

Internally the favorite store keeps the full path to the application, but when saving, only the desktop file id is saved if the favorite is in one of the system directories.

If the favorite isn't in one of the system directories, the full path is saved in the settings.


Typedef Documentation

typedef nux::ObjectPtr<nux::BaseTexture> unity::BaseTexturePtr

Definition at line 34 of file CairoTexture.h.

typedef std::vector<CompRegion> unity::CompRegionVector

Definition at line 34 of file unitydialog.h.

typedef std::list<std::string> unity::DeviceList

Definition at line 33 of file DevicesSettings.h.

typedef std::list<std::string> unity::FavoriteList

Definition at line 35 of file FavoriteStore.h.

typedef std::vector<int> unity::IntVector

Definition at line 35 of file unitydialog.h.

typedef std::vector<GLTexture::MatrixList> unity::MatrixListVector

Definition at line 33 of file unitydialog.h.


Enumeration Type Documentation

Enumerator:
BLUR_NONE 
BLUR_STATIC 
BLUR_ACTIVE 

Definition at line 31 of file BackgroundEffectHelper.h.

Enumerator:
DESKTOP 
NETBOOK 
TV 

Definition at line 29 of file UnitySettings.h.

{
  DESKTOP = 1,
  NETBOOK = 2,
  TV
};
Enumerator:
MENUITEM_TYPE_UNKNOWN 
MENUITEM_TYPE_LABEL 
MENUITEM_TYPE_SEPARATOR 
MENUITEM_TYPE_CHECK 
MENUITEM_TYPE_RADIO 

Definition at line 39 of file QuicklistMenuItem.h.

Enumerator:
STATE_READY 
STATE_SEARCHING 
STATE_CLEAR 

Definition at line 34 of file SearchBarSpinner.h.


Function Documentation

static double unity::_align ( double  val) [static]

Definition at line 33 of file QuicklistMenuItemCheckmark.cpp.

{
  double fract = val - (int) val;

  if (fract != 0.5f)
    return (double)((int) val + 0.5f);
  else
    return val;
}

Here is the caller graph for this function:

void unity::_compute_full_mask_path ( cairo_t *  cr,
gfloat  anchor_width,
gfloat  anchor_height,
gint  width,
gint  height,
gint  upper_size,
gfloat  radius,
guint  pad 
)

Definition at line 238 of file Tooltip.cpp.

{

  //     0            1 2
  //     +------------+-+
  //    /               + 3
  //   /                |
  //  + 8               |
  //   \                |
  //    \               + 4
  //     +------------+-+
  //     7            6 5

  gfloat padding = pad;

  cairo_translate(cr, -0.5f, -0.5f);

  // create path
  cairo_move_to(cr, padding + anchor_width, padding); // Point 0
  cairo_line_to(cr, width - padding - radius, padding); // Point 1
  cairo_arc(cr,
            width  - padding - radius,
            padding + radius,
            radius,
            -90.0f * G_PI / 180.0f,
            0.0f * G_PI / 180.0f); // Point 3
  cairo_line_to(cr,
                (gdouble) width - padding,
                (gdouble) height - radius - padding); // Point 4
  cairo_arc(cr,
            (gdouble) width - padding - radius,
            (gdouble) height - padding - radius,
            radius,
            0.0f * G_PI / 180.0f,
            90.0f * G_PI / 180.0f); // Point 6
  cairo_line_to(cr,
                anchor_width + padding,
                (gdouble) height - padding); // Point 7

  cairo_line_to(cr,
                padding,
                (gdouble) height / 2.0f); // Point 8

  cairo_close_path(cr);
}

Here is the caller graph for this function:

void unity::_draw ( cairo_t *  cr,
gboolean  outline,
gfloat  line_width,
gfloat *  rgba,
gboolean  negative,
gboolean  stroke 
)

Definition at line 311 of file Tooltip.cpp.

{
  // prepare drawing
  cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);

  // actually draw the mask
  if (outline)
  {
    cairo_set_line_width(cr, line_width);
    cairo_set_source_rgba(cr, rgba[0], rgba[1], rgba[2], rgba[3]);
  }
  else
  {
    if (negative)
      cairo_set_source_rgba(cr, 1.0f, 1.0f, 1.0f, 1.0f);
    else
      cairo_set_source_rgba(cr, 0.0f, 0.0f, 0.0f, 0.0f);
  }

  // stroke or fill?
  if (stroke)
    cairo_stroke_preserve(cr);
  else
    cairo_fill_preserve(cr);
}

Here is the caller graph for this function:

void unity::_finalize ( cairo_t **  cr,
gboolean  outline,
gfloat  line_width,
gfloat *  rgba,
gboolean  negative,
gboolean  stroke 
)

Definition at line 342 of file Tooltip.cpp.

{
  // prepare drawing
  cairo_set_operator(*cr, CAIRO_OPERATOR_SOURCE);

  // actually draw the mask
  if (outline)
  {
    cairo_set_line_width(*cr, line_width);
    cairo_set_source_rgba(*cr, rgba[0], rgba[1], rgba[2], rgba[3]);
  }
  else
  {
    if (negative)
      cairo_set_source_rgba(*cr, 1.0f, 1.0f, 1.0f, 1.0f);
    else
      cairo_set_source_rgba(*cr, 0.0f, 0.0f, 0.0f, 0.0f);
  }

  // stroke or fill?
  if (stroke)
    cairo_stroke(*cr);
  else
    cairo_fill(*cr);
}

Here is the caller graph for this function:

void unity::_setup ( cairo_surface_t **  surf,
cairo_t **  cr,
gboolean  outline,
gint  width,
gint  height,
gboolean  negative 
)

Definition at line 213 of file Tooltip.cpp.

{
  // clear context
  cairo_scale(*cr, 1.0f, 1.0f);
  if (outline)
  {
    cairo_set_source_rgba(*cr, 0.0f, 0.0f, 0.0f, 0.0f);
    cairo_set_operator(*cr, CAIRO_OPERATOR_CLEAR);
  }
  else
  {
    cairo_set_operator(*cr, CAIRO_OPERATOR_OVER);
    if (negative)
      cairo_set_source_rgba(*cr, 0.0f, 0.0f, 0.0f, 0.0f);
    else
      cairo_set_source_rgba(*cr, 1.0f, 1.0f, 1.0f, 1.0f);
  }
  cairo_paint(*cr);
}

Here is the caller graph for this function:

void unity::compute_full_mask ( cairo_t *  cr,
cairo_surface_t *  surf,
gint  width,
gint  height,
gfloat  radius,
guint  shadow_radius,
gfloat  anchor_width,
gfloat  anchor_height,
gint  upper_size,
gboolean  negative,
gboolean  outline,
gfloat  line_width,
gint  padding_size,
gfloat *  rgba 
)

Definition at line 406 of file Tooltip.cpp.

{
  _setup(&surf, &cr, outline, width, height, negative);
  _compute_full_mask_path(cr,
                          anchor_width,
                          anchor_height,
                          width,
                          height,
                          upper_size,
                          radius,
                          padding_size);
  _finalize(&cr, outline, line_width, rgba, negative, outline);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::compute_full_outline_shadow ( cairo_t *  cr,
cairo_surface_t *  surf,
gint  width,
gint  height,
gfloat  anchor_width,
gfloat  anchor_height,
gint  upper_size,
gfloat  corner_radius,
guint  blur_coeff,
gfloat *  rgba_shadow,
gfloat  line_width,
gint  padding_size,
gfloat *  rgba_line 
)

Definition at line 374 of file Tooltip.cpp.

{
  _setup(&surf, &cr, TRUE, width, height, FALSE);
  _compute_full_mask_path(cr,
                          anchor_width,
                          anchor_height,
                          width,
                          height,
                          upper_size,
                          corner_radius,
                          padding_size);

  _draw(cr, TRUE, line_width, rgba_shadow, FALSE, FALSE);
  nux::CairoGraphics dummy(CAIRO_FORMAT_A1, 1, 1);
  dummy.BlurSurface(blur_coeff, surf);
  compute_mask(cr);
  compute_outline(cr, line_width, rgba_line);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::compute_mask ( cairo_t *  cr)

Definition at line 291 of file Tooltip.cpp.

{
  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
  cairo_fill_preserve(cr);
}

Here is the caller graph for this function:

void unity::compute_outline ( cairo_t *  cr,
gfloat  line_width,
gfloat *  rgba_line 
)

Definition at line 297 of file Tooltip.cpp.

{
  cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
  cairo_set_source_rgba(cr,
                        rgba_line[0],
                        rgba_line[1],
                        rgba_line[2],
                        rgba_line[3]);
  cairo_set_line_width(cr, line_width);
  cairo_stroke(cr);
}

Here is the caller graph for this function:

bool unity::isNuxWindow ( CompWindow *  value)

Definition at line 2256 of file unityshell.cpp.

{
  std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList();
  auto id = value->id();

  // iterate loop by hand rather than use std::find as this is considerably faster
  // we care about performance here becuase of the high frequency in which this function is
  // called (nearly every frame)
  unsigned int size = xwns.size();
  for (unsigned int i = 0; i < size; ++i)
  {
    if (xwns[i] == id)
      return true;
  }
  return false;
}

Here is the caller graph for this function:

unity::NUX_IMPLEMENT_OBJECT_TYPE ( DNDCollectionWindow  )
unity::NUX_IMPLEMENT_OBJECT_TYPE ( SearchBarSpinner  )
unity::NUX_IMPLEMENT_OBJECT_TYPE ( QuicklistMenuItem  )
unity::NUX_IMPLEMENT_OBJECT_TYPE ( CairoBaseWindow  )
unity::NUX_IMPLEMENT_OBJECT_TYPE ( PanelIndicatorsView  )
unity::NUX_IMPLEMENT_OBJECT_TYPE ( PanelView  ) [static]
unity::NUX_IMPLEMENT_OBJECT_TYPE ( QuicklistView  )
static void unity::OnItemActivated ( guint  timestamp,
QuicklistMenuItem *  self 
) [static]

Definition at line 330 of file QuicklistMenuItem.cpp.

{
  //todo:
  //self->ItemActivated ();
}

Here is the caller graph for this function:

static void unity::OnPropertyChanged ( gchar *  property,
GValue *  value,
QuicklistMenuItem *  self 
) [static]

Definition at line 321 of file QuicklistMenuItem.cpp.

{
  //todo
  //self->UpdateTexture ();
}

Here is the caller graph for this function:

void unity::ql_compute_full_mask ( cairo_t *  cr,
cairo_surface_t *  surf,
gint  width,
gint  height,
gfloat  radius,
guint  shadow_radius,
gfloat  anchor_width,
gfloat  anchor_height,
gint  upper_size,
gboolean  negative,
gboolean  outline,
gfloat  line_width,
gint  padding_size,
gfloat *  rgba 
)

Definition at line 1139 of file QuicklistView.cpp.

{
  ql_setup(&surf, &cr, outline, width, height, negative);
  ql_compute_full_mask_path(cr,
                            anchor_width,
                            anchor_height,
                            width,
                            height,
                            upper_size,
                            radius,
                            padding_size);
  ql_finalize(&cr, outline, line_width, rgba, negative, outline);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::ql_compute_full_mask_path ( cairo_t *  cr,
gfloat  anchor_width,
gfloat  anchor_height,
gint  width,
gint  height,
gint  upper_size,
gfloat  radius,
guint  pad 
)

Definition at line 883 of file QuicklistView.cpp.

{
  //     0  1        2  3
  //     +--+--------+--+
  //     |              |
  //     + 14           + 4
  //     |              |
  //     |              |
  //     |              |
  //     + 13           |
  //    /               |
  //   /                |
  //  + 12              |
  //   \                |
  //    \               |
  //  11 +              |
  //     |              |
  //     |              |
  //     |              |
  //  10 +              + 5
  //     |              |
  //     +--+--------+--+ 6
  //     9  8        7


  gfloat padding  = pad;
  int ZEROPOINT5 = 0.0f;

  gfloat HeightToAnchor = 0.0f;
  HeightToAnchor = ((gfloat) height - 2.0f * radius - anchor_height - 2 * padding) / 2.0f;
  if (HeightToAnchor < 0.0f)
  {
    g_warning("Anchor-height and corner-radius a higher than whole texture!");
    return;
  }

  //gint dynamic_size = height - 2*radius - 2*padding - anchor_height;
  //gint upper_dynamic_size = upper_size;
  //gint lower_dynamic_size = dynamic_size - upper_dynamic_size;

  if (upper_size >= 0)
  {
    if (upper_size > height - 2.0f * radius - anchor_height - 2 * padding)
    {
      //g_warning ("[_compute_full_mask_path] incorrect upper_size value");
      HeightToAnchor = 0;
    }
    else
    {
      HeightToAnchor = height - 2.0f * radius - anchor_height - 2 * padding - upper_size;
    }
  }
  else
  {
    HeightToAnchor = (height - 2.0f * radius - anchor_height - 2 * padding) / 2.0f;
  }

  cairo_translate(cr, -0.5f, -0.5f);

  // create path
  cairo_move_to(cr, padding + anchor_width + radius + ZEROPOINT5, padding + ZEROPOINT5);  // Point 1
  cairo_line_to(cr, width - padding - radius, padding + ZEROPOINT5);    // Point 2
  cairo_arc(cr,
            width  - padding - radius + ZEROPOINT5,
            padding + radius + ZEROPOINT5,
            radius,
            -90.0f * G_PI / 180.0f,
            0.0f * G_PI / 180.0f);   // Point 4
  cairo_line_to(cr,
                (gdouble) width - padding + ZEROPOINT5,
                (gdouble) height - radius - padding + ZEROPOINT5); // Point 5
  cairo_arc(cr,
            (gdouble) width - padding - radius + ZEROPOINT5,
            (gdouble) height - padding - radius + ZEROPOINT5,
            radius,
            0.0f * G_PI / 180.0f,
            90.0f * G_PI / 180.0f);  // Point 7
  cairo_line_to(cr,
                anchor_width + padding + radius + ZEROPOINT5,
                (gdouble) height - padding + ZEROPOINT5); // Point 8

  cairo_arc(cr,
            anchor_width + padding + radius + ZEROPOINT5,
            (gdouble) height - padding - radius,
            radius,
            90.0f * G_PI / 180.0f,
            180.0f * G_PI / 180.0f); // Point 10

  cairo_line_to(cr,
                padding + anchor_width + ZEROPOINT5,
                (gdouble) height - padding - radius - HeightToAnchor + ZEROPOINT5);   // Point 11
  cairo_line_to(cr,
                padding + ZEROPOINT5,
                (gdouble) height - padding - radius - HeightToAnchor - anchor_height / 2.0f + ZEROPOINT5); // Point 12
  cairo_line_to(cr,
                padding + anchor_width + ZEROPOINT5,
                (gdouble) height - padding - radius - HeightToAnchor - anchor_height + ZEROPOINT5);  // Point 13

  cairo_line_to(cr, padding + anchor_width + ZEROPOINT5, padding + radius  + ZEROPOINT5);   // Point 14
  cairo_arc(cr,
            padding + anchor_width + radius + ZEROPOINT5,
            padding + radius + ZEROPOINT5,
            radius,
            180.0f * G_PI / 180.0f,
            270.0f * G_PI / 180.0f);

  cairo_close_path(cr);
}

Here is the caller graph for this function:

void unity::ql_compute_full_outline_shadow ( cairo_t *  cr,
cairo_surface_t *  surf,
gint  width,
gint  height,
gfloat  anchor_width,
gfloat  anchor_height,
gint  upper_size,
gfloat  corner_radius,
guint  blur_coeff,
gfloat *  rgba_shadow,
gfloat  line_width,
gint  padding_size,
gfloat *  rgba_line 
)

Definition at line 1107 of file QuicklistView.cpp.

{
  ql_setup(&surf, &cr, TRUE, width, height, FALSE);
  ql_compute_full_mask_path(cr,
                            anchor_width,
                            anchor_height,
                            width,
                            height,
                            upper_size,
                            corner_radius,
                            padding_size);

  ql_draw(cr, TRUE, line_width, rgba_shadow, FALSE, FALSE);
  nux::CairoGraphics dummy(CAIRO_FORMAT_A1, 1, 1);
  dummy.BlurSurface(blur_coeff, surf);
  ql_compute_mask(cr);
  ql_compute_outline(cr, line_width, rgba_line, width);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::ql_compute_mask ( cairo_t *  cr)

Definition at line 999 of file QuicklistView.cpp.

{
  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
  cairo_fill_preserve(cr);
}

Here is the caller graph for this function:

void unity::ql_compute_outline ( cairo_t *  cr,
gfloat  line_width,
gfloat *  rgba_line,
gfloat  size 
)

Definition at line 1005 of file QuicklistView.cpp.

{
  cairo_pattern_t* pattern = NULL;
  float            x       = 0.0f;
  float            y       = 0.0f;
  float            offset  = 2.5f * ANCHOR_WIDTH / size;

  cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);

  pattern = cairo_pattern_create_linear(x, y, size, y);
  cairo_pattern_add_color_stop_rgba(pattern, 0.0f,
                                    rgba_line[0],
                                    rgba_line[1],
                                    rgba_line[2],
                                    rgba_line[3]);
  cairo_pattern_add_color_stop_rgba(pattern, offset,
                                    rgba_line[0],
                                    rgba_line[1],
                                    rgba_line[2],
                                    rgba_line[3]);
  cairo_pattern_add_color_stop_rgba(pattern, 1.1f * offset,
                                    rgba_line[0] * 0.65f,
                                    rgba_line[1] * 0.65f,
                                    rgba_line[2] * 0.65f,
                                    rgba_line[3]);
  cairo_pattern_add_color_stop_rgba(pattern, 1.0f,
                                    rgba_line[0] * 0.65f,
                                    rgba_line[1] * 0.65f,
                                    rgba_line[2] * 0.65f,
                                    rgba_line[3]);
  cairo_set_source(cr, pattern);
  cairo_set_line_width(cr, line_width);
  cairo_stroke(cr);
  cairo_pattern_destroy(pattern);
}

Here is the caller graph for this function:

void unity::ql_draw ( cairo_t *  cr,
gboolean  outline,
gfloat  line_width,
gfloat *  rgba,
gboolean  negative,
gboolean  stroke 
)

Definition at line 1044 of file QuicklistView.cpp.

{
  // prepare drawing
  cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);

  // actually draw the mask
  if (outline)
  {
    cairo_set_line_width(cr, line_width);
    cairo_set_source_rgba(cr, rgba[0], rgba[1], rgba[2], rgba[3]);
  }
  else
  {
    if (negative)
      cairo_set_source_rgba(cr, 1.0f, 1.0f, 1.0f, 1.0f);
    else
      cairo_set_source_rgba(cr, 0.0f, 0.0f, 0.0f, 0.0f);
  }

  // stroke or fill?
  if (stroke)
    cairo_stroke_preserve(cr);
  else
    cairo_fill_preserve(cr);
}

Here is the caller graph for this function:

void unity::ql_finalize ( cairo_t **  cr,
gboolean  outline,
gfloat  line_width,
gfloat *  rgba,
gboolean  negative,
gboolean  stroke 
)

Definition at line 1075 of file QuicklistView.cpp.

{
  // prepare drawing
  cairo_set_operator(*cr, CAIRO_OPERATOR_SOURCE);

  // actually draw the mask
  if (outline)
  {
    cairo_set_line_width(*cr, line_width);
    cairo_set_source_rgba(*cr, rgba[0], rgba[1], rgba[2], rgba[3]);
  }
  else
  {
    if (negative)
      cairo_set_source_rgba(*cr, 1.0f, 1.0f, 1.0f, 1.0f);
    else
      cairo_set_source_rgba(*cr, 0.0f, 0.0f, 0.0f, 0.0f);
  }

  // stroke or fill?
  if (stroke)
    cairo_stroke(*cr);
  else
    cairo_fill(*cr);
}

Here is the caller graph for this function:

void unity::ql_setup ( cairo_surface_t **  surf,
cairo_t **  cr,
gboolean  outline,
gint  width,
gint  height,
gboolean  negative 
)

Definition at line 851 of file QuicklistView.cpp.

{
//     // create context
//     if (outline)
//       *surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
//     else
//       *surf = cairo_image_surface_create (CAIRO_FORMAT_A8, width, height);
//     *cr = cairo_create (*surf);

  // clear context
  cairo_scale(*cr, 1.0f, 1.0f);
  if (outline)
  {
    cairo_set_source_rgba(*cr, 0.0f, 0.0f, 0.0f, 0.0f);
    cairo_set_operator(*cr, CAIRO_OPERATOR_CLEAR);
  }
  else
  {
    cairo_set_operator(*cr, CAIRO_OPERATOR_OVER);
    if (negative)
      cairo_set_source_rgba(*cr, 0.0f, 0.0f, 0.0f, 0.0f);
    else
      cairo_set_source_rgba(*cr, 1.0f, 1.0f, 1.0f, 1.0f);
  }
  cairo_paint(*cr);
}

Here is the caller graph for this function:

void unity::ql_tint_dot_hl ( cairo_t *  cr,
gint  width,
gint  height,
gfloat  hl_x,
gfloat  hl_y,
gfloat  hl_size,
gfloat *  rgba_tint,
gfloat *  rgba_hl,
gfloat *  rgba_dot 
)

Definition at line 767 of file QuicklistView.cpp.

{
  cairo_surface_t* dots_surf    = NULL;
  cairo_t*         dots_cr      = NULL;
  cairo_pattern_t* dots_pattern = NULL;
  cairo_pattern_t* hl_pattern   = NULL;

  // create context for dot-pattern
  dots_surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 4, 4);
  dots_cr = cairo_create(dots_surf);

  // clear normal context
  cairo_scale(cr, 1.0f, 1.0f);
  cairo_set_source_rgba(cr, 0.0f, 0.0f, 0.0f, 0.0f);
  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
  cairo_paint(cr);

  // prepare drawing for normal context
  cairo_set_operator(cr, CAIRO_OPERATOR_OVER);

  // create path in normal context
  cairo_rectangle(cr, 0.0f, 0.0f, (gdouble) width, (gdouble) height);

  // fill path of normal context with tint
  cairo_set_source_rgba(cr,
                        rgba_tint[0],
                        rgba_tint[1],
                        rgba_tint[2],
                        rgba_tint[3]);
  cairo_fill_preserve(cr);

  // create pattern in dot-context
  cairo_set_operator(dots_cr, CAIRO_OPERATOR_CLEAR);
  cairo_paint(dots_cr);
  cairo_scale(dots_cr, 1.0f, 1.0f);
  cairo_set_operator(dots_cr, CAIRO_OPERATOR_OVER);
  cairo_set_source_rgba(dots_cr,
                        rgba_dot[0],
                        rgba_dot[1],
                        rgba_dot[2],
                        rgba_dot[3]);
  cairo_rectangle(dots_cr, 0.0f, 0.0f, 1.0f, 1.0f);
  cairo_fill(dots_cr);
  cairo_rectangle(dots_cr, 2.0f, 2.0f, 1.0f, 1.0f);
  cairo_fill(dots_cr);
  dots_pattern = cairo_pattern_create_for_surface(dots_surf);

  // fill path of normal context with dot-pattern
  cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
  cairo_set_source(cr, dots_pattern);
  cairo_pattern_set_extend(dots_pattern, CAIRO_EXTEND_REPEAT);
  cairo_fill_preserve(cr);
  cairo_pattern_destroy(dots_pattern);
  cairo_surface_destroy(dots_surf);
  cairo_destroy(dots_cr);

  // draw highlight
  cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
  hl_pattern = cairo_pattern_create_radial(hl_x,
                                           hl_y,
                                           0.0f,
                                           hl_x,
                                           hl_y,
                                           hl_size);
  cairo_pattern_add_color_stop_rgba(hl_pattern,
                                    0.0f,
                                    rgba_hl[0],
                                    rgba_hl[1],
                                    rgba_hl[2],
                                    rgba_hl[3]);
  cairo_pattern_add_color_stop_rgba(hl_pattern, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f);
  cairo_set_source(cr, hl_pattern);
  cairo_fill(cr);
  cairo_pattern_destroy(hl_pattern);
}

Here is the caller graph for this function:

nux::BaseTexture* unity::texture_from_cairo_graphics ( nux::CairoGraphics &  cg) [inline]

Definition at line 39 of file CairoTexture.h.

{
  nux::NBitmapData* bitmap = cg.GetBitmap();
  nux::BaseTexture* tex = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture();
  tex->Update(bitmap);
  delete bitmap;
  return tex;
}

Here is the caller graph for this function:

BaseTexturePtr unity::texture_ptr_from_cairo_graphics ( nux::CairoGraphics &  cg) [inline]

Definition at line 52 of file CairoTexture.h.

{
  BaseTexturePtr result(texture_from_cairo_graphics(cg));
  // Since the ObjectPtr takes a reference, and the texture is initially
  // owned, the reference count now is two.
  nuxAssert(result->GetReferenceCount() == 2);
  result->UnReference();
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void unity::tint_dot_hl ( cairo_t *  cr,
gint  width,
gint  height,
gfloat  hl_x,
gfloat  hl_y,
gfloat  hl_size,
gfloat *  rgba_tint,
gfloat *  rgba_hl,
gfloat *  rgba_dot 
)

Definition at line 162 of file Tooltip.cpp.

{
  cairo_pattern_t* hl_pattern = NULL;

  // clear normal context
  cairo_scale(cr, 1.0f, 1.0f);
  cairo_set_source_rgba(cr, 0.0f, 0.0f, 0.0f, 0.0f);
  cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
  cairo_paint(cr);

  // prepare drawing for normal context
  cairo_set_operator(cr, CAIRO_OPERATOR_OVER);

  // create path in normal context
  cairo_rectangle(cr, 0.0f, 0.0f, (gdouble) width, (gdouble) height);

  // fill path of normal context with tint
  cairo_set_source_rgba(cr,
                        rgba_tint[0],
                        rgba_tint[1],
                        rgba_tint[2],
                        rgba_tint[3]);
  cairo_fill_preserve(cr);

  // draw glow
  hl_pattern = cairo_pattern_create_radial(hl_x,
                                           hl_y - hl_size / 1.4f,
                                           0.0f,
                                           hl_x,
                                           hl_y - hl_size / 1.4f,
                                           hl_size);
  cairo_pattern_add_color_stop_rgba(hl_pattern,
                                    0.0f,
                                    rgba_hl[0],
                                    rgba_hl[1],
                                    rgba_hl[2],
                                    rgba_hl[3]);
  cairo_pattern_add_color_stop_rgba(hl_pattern, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f);
  cairo_set_source(cr, hl_pattern);
  cairo_fill(cr);
  cairo_pattern_destroy(hl_pattern);
}

Here is the caller graph for this function:


Variable Documentation

const std::string unity::DBUS_BUS_NAME = "com.canonical.Unity"

Definition at line 37 of file DebugDBusInterface.cpp.