コード例 #1
0
ファイル: st-widget.c プロジェクト: MarkieMark/gnome-shell
static void
st_widget_unmap (ClutterActor *actor)
{
  StWidgetPrivate *priv = ST_WIDGET (actor)->priv;

  CLUTTER_ACTOR_CLASS (st_widget_parent_class)->unmap (actor);

  if (priv->border_image)
    clutter_actor_unmap (priv->border_image);

  if (priv->background_image)
    clutter_actor_unmap (priv->background_image);

  if (priv->tooltip)
    clutter_actor_unmap ((ClutterActor *) priv->tooltip);
}
コード例 #2
0
ファイル: gmc-button.c プロジェクト: gcorvala/Media-Center
static void
gmc_button_map (ClutterActor *self)
{
  GmcButtonPrivate *priv;

  priv = GMC_BUTTON_GET_PRIVATE (self);

  CLUTTER_ACTOR_CLASS (gmc_button_parent_class)->map (self);

  if (priv->icon) {
    clutter_actor_map (priv->icon);
  }
  if (priv->label) {
    clutter_actor_map (priv->label);
  }
}
コード例 #3
0
static void
clutter_x11_texture_pixmap_realize (ClutterActor *actor)
{
  ClutterX11TexturePixmap        *texture = CLUTTER_X11_TEXTURE_PIXMAP (actor);
  ClutterX11TexturePixmapPrivate *priv = texture->priv;

  CLUTTER_ACTOR_CLASS (clutter_x11_texture_pixmap_parent_class)->
      realize (actor);

  CLUTTER_ACTOR_SET_FLAGS (actor, CLUTTER_ACTOR_REALIZED);

  clutter_x11_texture_pixmap_update_area_real (texture,
					       0, 0,
					       priv->pixmap_width,
					       priv->pixmap_height);
}
コード例 #4
0
ファイル: mx-table.c プロジェクト: ManMower/mx
static void
mx_table_allocate (ClutterActor          *self,
                   const ClutterActorBox *box,
                   ClutterAllocationFlags flags)
{
  MxTablePrivate *priv = MX_TABLE (self)->priv;

  CLUTTER_ACTOR_CLASS (mx_table_parent_class)->allocate (self, box, flags);

  if (priv->n_cols < 1 || priv->n_rows < 1)
    {
      return;
    };

  mx_table_preferred_allocate (self, box, flags);
}
コード例 #5
0
ファイル: st-scroll-view.c プロジェクト: NikoKrause/Cinnamon
static void
st_scroll_view_pick (ClutterActor       *actor,
                     const ClutterColor *color)
{
  StScrollViewPrivate *priv = ST_SCROLL_VIEW (actor)->priv;

  /* Chain up so we get a bounding box pained (if we are reactive) */
  CLUTTER_ACTOR_CLASS (st_scroll_view_parent_class)->pick (actor, color);

  if (priv->child)
    clutter_actor_paint (priv->child);
  if (priv->hscrollbar_visible)
    clutter_actor_paint (priv->hscroll);
  if (priv->vscrollbar_visible)
    clutter_actor_paint (priv->vscroll);
}
コード例 #6
0
ファイル: mex-column.c プロジェクト: ocrete/media-explorer
static void
mex_column_class_init (MexColumnClass *klass)
{
  GParamSpec *pspec;

  GObjectClass *o_class = G_OBJECT_CLASS (klass);
  ClutterActorClass *a_class = CLUTTER_ACTOR_CLASS (klass);

  o_class->dispose = mex_column_dispose;
  o_class->finalize = mex_column_finalize;
  o_class->set_property = mex_column_set_property;
  o_class->get_property = mex_column_get_property;

  a_class->get_preferred_width  = mex_column_get_preferred_width;
  a_class->get_preferred_height = mex_column_get_preferred_height;
  a_class->allocate             = mex_column_allocate;
  a_class->apply_transform      = mex_column_apply_transform;
  a_class->paint                = mex_column_paint;
  a_class->pick                 = mex_column_pick;
  a_class->map                  = mex_column_map;
  a_class->unmap                = mex_column_unmap;
  a_class->get_paint_volume     = mex_column_get_paint_volume;

  g_type_class_add_private (klass, sizeof (MexColumnPrivate));

  pspec = g_param_spec_boolean ("collapse-on-focus",
                                "Collapse On Focus",
                                "Collapse items before the focused item.",
                                TRUE,
                                G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (o_class, PROP_COLLAPSE_ON_FOCUS, pspec);

  pspec = g_param_spec_boolean ("opened",
                                "Opened",
                                "Whether the column has at least one open item.",
                                TRUE,
                                G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (o_class, PROP_OPENED, pspec);

  /* MxScrollable properties */
  g_object_class_override_property (o_class,
                                    PROP_HADJUST,
                                    "horizontal-adjustment");
  g_object_class_override_property (o_class,
                                    PROP_VADJUST,
                                    "vertical-adjustment");
}
コード例 #7
0
ファイル: mx-combo-box.c プロジェクト: ManMower/mx
static void
mx_combo_box_class_init (MxComboBoxClass *klass)
{
  GParamSpec *pspec;
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
  ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);

  g_type_class_add_private (klass, sizeof (MxComboBoxPrivate));

  object_class->get_property = mx_combo_box_get_property;
  object_class->set_property = mx_combo_box_set_property;
  object_class->finalize = mx_combo_box_finalize;

  actor_class->paint = mx_combo_box_paint;

  actor_class->get_preferred_width = mx_combo_box_get_preferred_width;
  actor_class->get_preferred_height = mx_combo_box_get_preferred_height;
  actor_class->allocate = mx_combo_box_allocate;

  actor_class->button_press_event = mx_combo_box_button_press_event;
  actor_class->touch_event = mx_combo_box_touch_event;
  actor_class->key_press_event = mx_combo_box_key_press_event;

  pspec = g_param_spec_string ("active-text",
                               "Active Text",
                               "Text currently displayed in the combo box"
                               " button",
                               "",
                               MX_PARAM_READWRITE);
  g_object_class_install_property (object_class, PROP_ACTIVE_TEXT, pspec);

  pspec = g_param_spec_string ("active-icon-name",
                               "Active Icon-name",
                               "Name of the icon currently displayed in the "
                               "combo-box",
                               NULL,
                               MX_PARAM_READWRITE);
  g_object_class_install_property (object_class, PROP_ACTIVE_ICON_NAME, pspec);

  pspec = g_param_spec_int ("index",
                            "Index",
                            "Index of the selected item, or -1 if no item is"
                            " selected.",
                            -1, G_MAXINT, -1,
                            MX_PARAM_READWRITE);
  g_object_class_install_property (object_class, PROP_INDEX, pspec);
}
コード例 #8
0
ファイル: mex-shell.c プロジェクト: dudochkin-victor/mex
static void
mex_shell_class_init (MexShellClass *klass)
{
  GParamSpec *pspec;

  GObjectClass *object_class = G_OBJECT_CLASS (klass);
  ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);

  g_type_class_add_private (klass, sizeof (MexShellPrivate));

  object_class->get_property = mex_shell_get_property;
  object_class->set_property = mex_shell_set_property;
  object_class->dispose = mex_shell_dispose;
  object_class->finalize = mex_shell_finalize;

  actor_class->destroy = mex_shell_destroy;
  actor_class->get_preferred_width = mex_shell_get_preferred_width;
  actor_class->get_preferred_height = mex_shell_get_preferred_height;
  actor_class->allocate = mex_shell_allocate;
  actor_class->paint = mex_shell_paint;
  actor_class->pick = mex_shell_pick;

  pspec = g_param_spec_object ("presented",
                               "Presented",
                               "The last presented actor",
                               CLUTTER_TYPE_ACTOR,
                               G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_PRESENTED, pspec);

  signals[SIGNAL_TRANSITION_STARTED] =
    g_signal_new ("transition-started",
                  G_TYPE_FROM_CLASS (klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (MexShellClass, transition_started),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);

  signals[SIGNAL_TRANSITION_COMPLETED] =
    g_signal_new ("transition-completed",
                  G_TYPE_FROM_CLASS (klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (MexShellClass, transition_completed),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
}
コード例 #9
0
/* Class initialization
 * Override functions in parent classes and define properties
 * and signals
 */
static void xfdashboard_stage_interface_class_init(XfdashboardStageInterfaceClass *klass)
{
	XfdashboardActorClass			*actorClass=XFDASHBOARD_ACTOR_CLASS(klass);
	ClutterActorClass				*clutterActorClass=CLUTTER_ACTOR_CLASS(klass);
	GObjectClass					*gobjectClass=G_OBJECT_CLASS(klass);

	/* Override functions */
	clutterActorClass->parent_set=xfdashboard_stage_interface_parent_set;
	clutterActorClass->get_preferred_width=_xfdashboard_stage_interface_get_preferred_width;
	clutterActorClass->get_preferred_height=_xfdashboard_stage_interface_get_preferred_height;

	gobjectClass->dispose=_xfdashboard_stage_interface_dispose;
	gobjectClass->set_property=_xfdashboard_stage_interface_set_property;
	gobjectClass->get_property=_xfdashboard_stage_interface_get_property;

	/* Set up private structure */
	g_type_class_add_private(klass, sizeof(XfdashboardStageInterfacePrivate));

	/* Define properties */
	XfdashboardStageInterfaceProperties[PROP_MONITOR]=
		g_param_spec_object("monitor",
							_("Monitor"),
							_("The monitor where this stage interface is connected to"),
							XFDASHBOARD_TYPE_WINDOW_TRACKER_MONITOR,
							G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);

	XfdashboardStageInterfaceProperties[PROP_BACKGROUND_IMAGE_TYPE]=
		g_param_spec_enum("background-image-type",
							_("Background image type"),
							_("Background image type"),
							XFDASHBOARD_TYPE_STAGE_BACKGROUND_IMAGE_TYPE,
							XFDASHBOARD_STAGE_BACKGROUND_IMAGE_TYPE_NONE,
							G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);

	XfdashboardStageInterfaceProperties[PROP_BACKGROUND_COLOR]=
		clutter_param_spec_color("background-color",
									_("Background color"),
									_("Color of stage's background"),
									NULL,
									G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);

	g_object_class_install_properties(gobjectClass, PROP_LAST, XfdashboardStageInterfaceProperties);

	/* Define stylable properties */
	xfdashboard_actor_install_stylable_property(actorClass, XfdashboardStageInterfaceProperties[PROP_BACKGROUND_IMAGE_TYPE]);
	xfdashboard_actor_install_stylable_property(actorClass, XfdashboardStageInterfaceProperties[PROP_BACKGROUND_COLOR]);
}
コード例 #10
0
ファイル: mex-column.c プロジェクト: olethanh/media-explorer
static void
mex_column_paint (ClutterActor *actor)
{
  GList *c;
  gdouble value;
  MxPadding padding;
  ClutterActorBox box;

  MexColumn *self = MEX_COLUMN (actor);
  MexColumnPrivate *priv = self->priv;

  CLUTTER_ACTOR_CLASS (mex_column_parent_class)->paint (actor);

  mx_widget_get_padding (MX_WIDGET (actor), &padding);
  clutter_actor_get_allocation_box (actor, &box);
  if (priv->adjustment)
    value = mx_adjustment_get_value (priv->adjustment);
  else
    value = 0;

  cogl_clip_push_rectangle (padding.left,
                            clutter_actor_get_height (priv->header) +
                              padding.top + value,
                            box.x2 - box.x1 - padding.right,
                            box.y2 - box.y1 - padding.bottom + value);

  if (priv->n_items < 1 && priv->placeholder_actor)
    clutter_actor_paint (priv->placeholder_actor);
  else
    {
      for (c = priv->children; c; c = c->next)
        {
          /* skip the current focus and paint it last*/
          if (priv->current_focus != c->data)
            clutter_actor_paint (c->data);
        }

      /* paint the current focused actor last to ensure any shadow is drawn
       * on top of other items */
      if (priv->current_focus)
        clutter_actor_paint (priv->current_focus);
    }

  cogl_clip_pop ();

  clutter_actor_paint (priv->header);
}
コード例 #11
0
ファイル: mx-toggle.c プロジェクト: ManMower/mx
static void
mx_toggle_allocate (ClutterActor          *actor,
                    const ClutterActorBox *box,
                    ClutterAllocationFlags flags)
{
  MxTogglePrivate *priv = MX_TOGGLE (actor)->priv;
  ClutterActorBox handle_box, child_box;
  CoglHandle background;
  gfloat handle_w;
  gfloat toggle_pos;

  CLUTTER_ACTOR_CLASS (mx_toggle_parent_class)->allocate (actor, box, flags);

  mx_widget_get_available_area (MX_WIDGET (actor), box, &child_box);

  /* background-image don't get stretched, so adjust the child box so that the
   * handle appears in the correct place.
   */
  background = mx_widget_get_background_texture (MX_WIDGET (actor));
  if (background)
    {
      gfloat width;
      MxPadding padding;

      mx_widget_get_padding (MX_WIDGET (actor), &padding);
      width = cogl_texture_get_width (background);
      width -= padding.left + padding.right;

      child_box.x1 += (child_box.x2 - child_box.x1) / 2.f;
      child_box.x1 -= width / 2.f;
      child_box.x2 = child_box.x1 + width;
    }

  clutter_actor_get_preferred_width (priv->handle, -1, NULL, &handle_w);
  toggle_pos = child_box.x2 - handle_w - child_box.x1;
  priv->slide_length = toggle_pos;

  toggle_pos = toggle_pos * priv->position;

  handle_box.x1 = (gint) (child_box.x1 + toggle_pos);
  handle_box.y1 = child_box.y1;
  handle_box.x2 = handle_box.x1 + handle_w;
  handle_box.y2 = child_box.y2;

  clutter_actor_allocate (priv->handle, &handle_box, flags);
}
コード例 #12
0
ファイル: gmc-button.c プロジェクト: gcorvala/Media-Center
static void
gmc_button_pick (ClutterActor       *self,
                 const ClutterColor *pick_color)
{
  GmcButtonPrivate *priv;

  priv = GMC_BUTTON_GET_PRIVATE (self);

  CLUTTER_ACTOR_CLASS (gmc_button_parent_class)->pick (self, pick_color);

  if (priv->icon) {
    clutter_actor_paint (priv->icon);
  }
  if (priv->label) {
    clutter_actor_paint (priv->label);
  }
}
コード例 #13
0
ファイル: mx-table.c プロジェクト: ManMower/mx
static void
mx_table_pick (ClutterActor       *self,
               const ClutterColor *color)
{
  ClutterActorIter iter;
  ClutterActor *child;

  /* Chain up so we get a bounding box painted (if we are reactive) */
  CLUTTER_ACTOR_CLASS (mx_table_parent_class)->pick (self, color);

  clutter_actor_iter_init (&iter, self);
  while (clutter_actor_iter_next (&iter, &child))
    {
      if (CLUTTER_ACTOR_IS_VISIBLE (child))
        clutter_actor_paint (child);
    }
}
コード例 #14
0
ファイル: clutter-group.c プロジェクト: collinss/muffin
static void
clutter_group_class_init (ClutterGroupClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);

  actor_class->get_preferred_width = clutter_group_real_get_preferred_width;
  actor_class->get_preferred_height = clutter_group_real_get_preferred_height;
  actor_class->allocate = clutter_group_real_allocate;
  actor_class->paint = clutter_group_real_paint;
  actor_class->pick = clutter_group_real_pick;
  actor_class->show_all = clutter_group_real_show_all;
  actor_class->hide_all = clutter_group_real_hide_all;
  actor_class->get_paint_volume = clutter_group_real_get_paint_volume;

  gobject_class->dispose = clutter_group_dispose;
}
コード例 #15
0
ファイル: tweet-overlay.c プロジェクト: ak2consulting/tweet
static void
tweet_overlay_pick (ClutterActor       *actor,
                    const ClutterColor *pick_color)
{
  TweetOverlayPrivate *priv = TWEET_OVERLAY (actor)->priv;
  GList *l;

  CLUTTER_ACTOR_CLASS (tweet_overlay_parent_class)->pick (actor, pick_color);

  for (l = priv->children; l != NULL; l = l->next)
    {
      ClutterActor *child = l->data;

      if (CLUTTER_ACTOR_IS_VISIBLE (child))
        clutter_actor_paint (child);
    }
}
コード例 #16
0
ファイル: mex-menu.c プロジェクト: ocrete/media-explorer
static void
mex_menu_map (ClutterActor *actor)
{
  MxFocusManager *manager;
  MexMenu *self = MEX_MENU (actor);

  CLUTTER_ACTOR_CLASS (mex_menu_parent_class)->map (actor);

  manager = mx_focus_manager_get_for_stage ((ClutterStage *)
                                            clutter_actor_get_stage (actor));
  if (manager)
    {
      g_signal_connect (manager, "notify::focused",
                        G_CALLBACK (mex_menu_notify_focused_cb), self);
      mex_menu_notify_focused_cb (manager, NULL, self);
    }
}
コード例 #17
0
ファイル: st-widget.c プロジェクト: MarkieMark/gnome-shell
static void
st_widget_parent_set (ClutterActor *widget,
                      ClutterActor *old_parent)
{
  ClutterActorClass *parent_class;
  ClutterActor *new_parent;

  parent_class = CLUTTER_ACTOR_CLASS (st_widget_parent_class);
  if (parent_class->parent_set)
    parent_class->parent_set (widget, old_parent);

  new_parent = clutter_actor_get_parent (widget);

  /* don't send the style changed signal if we no longer have a parent actor */
  if (new_parent)
    st_widget_style_changed (ST_WIDGET (widget));
}
コード例 #18
0
static void
mex_clock_bin_allocate (ClutterActor           *actor,
                        const ClutterActorBox  *box,
                        ClutterAllocationFlags  flags)
{
  ClutterActorBox childbox;
  MexClockBinPrivate *priv = MEX_CLOCK_BIN (actor)->priv;

  CLUTTER_ACTOR_CLASS (mex_clock_bin_parent_class)->
    allocate (actor, box, flags);

  if (priv->child)
    {
      mx_widget_get_available_area (MX_WIDGET (actor), box, &childbox);
      clutter_actor_allocate (priv->child, &childbox, flags);
    }
}
コード例 #19
0
static void
mex_clock_bin_map (ClutterActor *actor)
{
  ClutterActor *stage;
  MxFocusManager *manager;

  MexClockBinPrivate *priv = MEX_CLOCK_BIN (actor)->priv;

  CLUTTER_ACTOR_CLASS (mex_clock_bin_parent_class)->map (actor);

  clutter_actor_map (priv->clock_hbox);

  stage = clutter_actor_get_stage (actor);
  manager = mx_focus_manager_get_for_stage (CLUTTER_STAGE (stage));
  g_signal_connect (manager, "notify::focused",
                    G_CALLBACK (mex_clock_bin_notify_focused_cb), actor);
}
コード例 #20
0
ファイル: st-entry.c プロジェクト: 3n4rch3/Cinnamon
static void
st_entry_paint (ClutterActor *actor)
{
  StEntryPrivate *priv = ST_ENTRY_PRIV (actor);
  ClutterActorClass *parent_class;

  parent_class = CLUTTER_ACTOR_CLASS (st_entry_parent_class);
  parent_class->paint (actor);

  clutter_actor_paint (priv->entry);

  if (priv->primary_icon)
    clutter_actor_paint (priv->primary_icon);

  if (priv->secondary_icon)
    clutter_actor_paint (priv->secondary_icon);
}
コード例 #21
0
ファイル: st-icon.c プロジェクト: meetparikh7/gnome-shell
static void
st_icon_class_init (StIconClass *klass)
{
  GParamSpec *pspec;

  GObjectClass *object_class = G_OBJECT_CLASS (klass);
  ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
  StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);

  g_type_class_add_private (klass, sizeof (StIconPrivate));

  object_class->get_property = st_icon_get_property;
  object_class->set_property = st_icon_set_property;
  object_class->dispose = st_icon_dispose;

  actor_class->paint = st_icon_paint;

  widget_class->style_changed = st_icon_style_changed;

  pspec = g_param_spec_object ("gicon",
                               "GIcon",
                               "The GIcon shown by this icon actor",
                               G_TYPE_ICON,
                               ST_PARAM_READWRITE);
  g_object_class_install_property (object_class, PROP_GICON, pspec);

  pspec = g_param_spec_string ("icon-name",
                               "Icon name",
                               "An icon name",
                               NULL, ST_PARAM_READWRITE);
  g_object_class_install_property (object_class, PROP_ICON_NAME, pspec);

  pspec = g_param_spec_int ("icon-size",
                            "Icon size",
                            "The size if the icon, if positive. Otherwise the size will be derived from the current style",
                            -1, G_MAXINT, -1,
                            ST_PARAM_READWRITE);
  g_object_class_install_property (object_class, PROP_ICON_SIZE, pspec);

  pspec = g_param_spec_string ("fallback-icon-name",
                               "Fallback icon name",
                               "A fallback icon name",
                               NULL, ST_PARAM_READWRITE);
  g_object_class_install_property (object_class, PROP_FALLBACK_ICON_NAME, pspec);
}
コード例 #22
0
static void
mex_column_view_class_init (MexColumnViewClass *klass)
{
  GParamSpec *pspec;
  GObjectClass *o_class = G_OBJECT_CLASS (klass);
  ClutterActorClass *a_class = CLUTTER_ACTOR_CLASS (klass);

  o_class->get_property = mex_column_view_get_property;
  o_class->set_property = mex_column_view_set_property;
  o_class->dispose      = mex_column_view_dispose;
  o_class->finalize     = mex_column_view_finalize;

  a_class->get_preferred_width  = mex_column_view_get_preferred_width;
  a_class->get_preferred_height = mex_column_view_get_preferred_height;
  a_class->allocate             = mex_column_view_allocate;
  a_class->paint                = mex_column_view_paint;
  a_class->pick                 = mex_column_view_pick;
  a_class->button_release_event = mex_column_button_release_event;

  g_type_class_add_private (klass, sizeof (MexColumnViewPrivate));

  pspec = g_param_spec_string ("label",
                               "Label",
                               "Text used as the title for this column.",
                               "",
                               G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
                               G_PARAM_CONSTRUCT);
  g_object_class_install_property (o_class, PROP_LABEL, pspec);

  pspec = g_param_spec_object ("placeholder-actor",
                               "Placeholder Actor",
                               "Actor used when this column is empty.",
                               CLUTTER_TYPE_ACTOR,
                               G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (o_class, PROP_PLACEHOLDER_ACTOR, pspec);

  signals[ACTIVATED] = g_signal_new ("activated",
                                     G_TYPE_FROM_CLASS (klass),
                                     G_SIGNAL_RUN_LAST,
                                     G_STRUCT_OFFSET (MexColumnClass,
                                                      activated),
                                     NULL, NULL,
                                     g_cclosure_marshal_VOID__VOID,
                                     G_TYPE_NONE, 0);
}
コード例 #23
0
ファイル: test-binding-pool.c プロジェクト: rib/clutter
static void
key_group_class_init (KeyGroupClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
  ClutterBindingPool *binding_pool;

  gobject_class->finalize = key_group_finalize;

  actor_class->paint = key_group_paint;
  actor_class->key_press_event = key_group_key_press;

  group_signals[ACTIVATE] =
    g_signal_new (g_intern_static_string ("activate"),
                  G_OBJECT_CLASS_TYPE (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (KeyGroupClass, activate),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__OBJECT,
                  G_TYPE_NONE, 1,
                  CLUTTER_TYPE_ACTOR);

  binding_pool = clutter_binding_pool_get_for_class (klass);

  clutter_binding_pool_install_action (binding_pool, "move-right",
                                       CLUTTER_KEY_Right, 0,
                                       G_CALLBACK (key_group_action_move_right),
                                       NULL, NULL);
  clutter_binding_pool_install_action (binding_pool, "move-left",
                                       CLUTTER_KEY_Left, 0,
                                       G_CALLBACK (key_group_action_move_left),
                                       NULL, NULL);
  clutter_binding_pool_install_action (binding_pool, "activate",
                                       CLUTTER_KEY_Return, 0,
                                       G_CALLBACK (key_group_action_activate),
                                       NULL, NULL);
  clutter_binding_pool_install_action (binding_pool, "activate",
                                       CLUTTER_KEY_KP_Enter, 0,
                                       G_CALLBACK (key_group_action_activate),
                                       NULL, NULL);
  clutter_binding_pool_install_action (binding_pool, "activate",
                                       CLUTTER_KEY_ISO_Enter, 0,
                                       G_CALLBACK (key_group_action_activate),
                                       NULL, NULL);
}
コード例 #24
0
ファイル: pp-super-aa.c プロジェクト: GNOME/pinpoint
static void
pp_super_aa_class_init (PPSuperAAClass *klass)
{
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
  ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
  MxOffscreenClass *offscreen_class = MX_OFFSCREEN_CLASS (klass);

  g_type_class_add_private (klass, sizeof (PPSuperAAPrivate));

  object_class->get_property = pp_super_aa_get_property;
  object_class->set_property = pp_super_aa_set_property;
  object_class->dispose = pp_super_aa_dispose;
  object_class->finalize = pp_super_aa_finalize;

  actor_class->paint = pp_super_aa_paint;

  offscreen_class->paint_child = pp_super_aa_paint_child;
}
コード例 #25
0
static void
mex_clock_bin_unmap (ClutterActor *actor)
{
  ClutterActor *stage;
  MxFocusManager *manager;

  MexClockBinPrivate *priv = MEX_CLOCK_BIN (actor)->priv;

  stage = clutter_actor_get_stage (actor);
  manager = mx_focus_manager_get_for_stage (CLUTTER_STAGE (stage));
  g_signal_handlers_disconnect_by_func (manager,
                                        mex_clock_bin_notify_focused_cb,
                                        actor);

  clutter_actor_unmap (priv->clock_hbox);

  CLUTTER_ACTOR_CLASS (mex_clock_bin_parent_class)->unmap (actor);
}
コード例 #26
0
static void
allocate (ClutterActor *self,
    const ClutterActorBox *box,
    ClutterAllocationFlags flags)
{
  ClutterActorBox child_box;

  ChamplainTilePrivate *priv = GET_PRIVATE (self);

  CLUTTER_ACTOR_CLASS (champlain_tile_parent_class)->allocate (self, box, flags);

  child_box.x1 = 0;
  child_box.x2 = box->x2 - box->x1;
  child_box.y1 = 0;
  child_box.y2 = box->y2 - box->y1;

  clutter_actor_allocate (CLUTTER_ACTOR (priv->content_group), &child_box, flags);
}
コード例 #27
0
ファイル: st-container.c プロジェクト: hosttor/Cinnamon
static void
st_container_class_init (StContainerClass *klass)
{
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
  ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
  StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
  StContainerClass *container_class = ST_CONTAINER_CLASS (klass);

  g_type_class_add_private (klass, sizeof (StContainerPrivate));

  object_class->dispose = st_container_dispose;

  actor_class->get_paint_volume = st_container_get_paint_volume;

  widget_class->navigate_focus = st_container_navigate_focus;

  container_class->get_focus_chain = st_container_real_get_focus_chain;
}
コード例 #28
0
ファイル: st-button.c プロジェクト: 2gud4u/Cinnamon
static gboolean
st_button_key_press (ClutterActor    *actor,
                     ClutterKeyEvent *event)
{
  StButton *button = ST_BUTTON (actor);

  if (button->priv->button_mask & ST_BUTTON_ONE)
    {
      if (event->keyval == CLUTTER_KEY_space ||
          event->keyval == CLUTTER_KEY_Return)
        {
          st_button_press (button, ST_BUTTON_ONE);
          return TRUE;
        }
    }

  return CLUTTER_ACTOR_CLASS (st_button_parent_class)->key_press_event (actor, event);
}
コード例 #29
0
static gboolean
mex_column_button_release_event (ClutterActor       *actor,
                                 ClutterButtonEvent *event)
{
  gboolean returnval;
  MexColumnViewPrivate *priv = MEX_COLUMN_VIEW (actor)->priv;

  returnval = CLUTTER_ACTOR_CLASS (mex_column_view_parent_class)->
    button_release_event (actor, event);

  if (!returnval && !priv->has_focus)
    {
      mex_push_focus (MX_FOCUSABLE (actor));
      return TRUE;
    }

  return returnval;
}
コード例 #30
0
static void
mex_column_view_paint (ClutterActor *actor)
{
  MexColumnView *self = MEX_COLUMN_VIEW (actor);
  MexColumnViewPrivate *priv = self->priv;

  CLUTTER_ACTOR_CLASS (mex_column_view_parent_class)->paint (actor);

  if (mex_column_is_empty (MEX_COLUMN (priv->column)))
    {
      if (priv->placeholder_actor)
        clutter_actor_paint (priv->placeholder_actor);
    }
  else
    clutter_actor_paint (priv->scroll);

  clutter_actor_paint (priv->header);
}