• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MX_WIDGET函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MX_WIDGET函数的典型用法代码示例。如果您正苦于以下问题:C++ MX_WIDGET函数的具体用法?C++ MX_WIDGET怎么用?C++ MX_WIDGET使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MX_WIDGET函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: mx_progress_bar_allocate_fill

static void
mx_progress_bar_allocate_fill (MxProgressBar         *self,
                               const ClutterActorBox *box,
                               ClutterAllocationFlags flags)
{
  ClutterActorBox box_data;
  MxProgressBarPrivate *priv = self->priv;

  if (!box)
    {
      clutter_actor_get_allocation_box (CLUTTER_ACTOR (self), &box_data);
      box = &box_data;
    }

  if (priv->progress)
    {
      ClutterActorBox child_box;
      MxPadding padding;

      mx_widget_get_padding (MX_WIDGET (self), &padding);

      child_box.x1 = padding.left;
      child_box.y1 = padding.top;
      child_box.y2 = (box->y2 - box->y1) - padding.bottom;
      child_box.x2 = ((box->x2 - box->x1 - padding.left - padding.right) *
                      priv->progress) + padding.left;

      clutter_actor_allocate (priv->fill, &child_box, flags);
    }
}
开发者ID:GunioRobot,项目名称:mx,代码行数:30,代码来源:mx-progress-bar.c


示例2: mx_progress_bar_get_preferred_width

static void
mx_progress_bar_get_preferred_width (ClutterActor *actor,
                                     gfloat        for_height,
                                     gfloat       *min_width_p,
                                     gfloat       *nat_width_p)
{
  MxPadding padding;
  MxProgressBarPrivate *priv = MX_PROGRESS_BAR (actor)->priv;
  gfloat height;

  clutter_actor_get_preferred_width (priv->fill,
                                     for_height,
                                     min_width_p,
                                     nat_width_p);

  clutter_actor_get_preferred_height (priv->fill,
                                      -1,
                                      &height,
                                      NULL);

  mx_widget_get_padding (MX_WIDGET (actor), &padding);

  if (min_width_p)
    *min_width_p += padding.left + padding.right;

  /* Add an arbitrary amount to the width for preferred width, so that the
   * indicator is visible and can display some values */
  if (nat_width_p)
    *nat_width_p += padding.left + padding.right + height * 4;
}
开发者ID:GunioRobot,项目名称:mx,代码行数:30,代码来源:mx-progress-bar.c


示例3: mx_label_get_preferred_width

static void
mx_label_get_preferred_width (ClutterActor *actor,
                              gfloat        for_height,
                              gfloat       *min_width_p,
                              gfloat       *natural_width_p)
{
  MxLabelPrivate *priv = MX_LABEL (actor)->priv;
  MxPadding padding = { 0, };

  mx_widget_get_padding (MX_WIDGET (actor), &padding);

  for_height -= padding.top + padding.bottom;

  clutter_actor_get_preferred_width (priv->label, for_height,
                                     min_width_p,
                                     natural_width_p);

  /* If we're fading out, make sure our minimum width is zero */
  if (priv->fade_out && min_width_p)
    *min_width_p = 0;

  if (min_width_p)
    *min_width_p += padding.left + padding.right;

  if (natural_width_p)
    *natural_width_p += padding.left + padding.right;
}
开发者ID:bhgv,项目名称:mx--clutter-based-GUI-framework--orange-pi-2-h3,代码行数:27,代码来源:mx-label.c


示例4: mex_volume_control_init

static void
mex_volume_control_init (MexVolumeControl *self)
{
  MexVolumeControlPrivate *priv = self->priv = VOLUME_CONTROL_PRIVATE (self);
  gchar *new_style_class;
  MexPlayer *player;
  MexMusicPlayer *music;

  player = mex_player_get_default ();
  priv->media = mex_player_get_clutter_media (player);

  music = mex_music_player_get_default ();
  priv->music = mex_music_player_get_clutter_media (music);

  priv->volume = mx_button_new ();
  mx_widget_set_disabled (MX_WIDGET (priv->volume), TRUE);

  priv->vol_value = clutter_media_get_audio_volume (priv->media);

  /* The media sound can also be changed from another process changint the
   * stream audio with pulse audio, adjust the volume on those changes */
  g_signal_connect (priv->media, "notify::audio-volume",
                    G_CALLBACK (on_audio_volume_changed), self);
  g_signal_connect (priv->music, "notify::audio-volume",
                    G_CALLBACK (on_audio_volume_changed), self);

  new_style_class = g_strdup_printf ("volume-%.0f", priv->vol_value * 10);

  mx_stylable_set_style_class (MX_STYLABLE (priv->volume), new_style_class);
  g_free (new_style_class);

  clutter_actor_add_child (CLUTTER_ACTOR (self), priv->volume);
}
开发者ID:frankopt,项目名称:media-explorer,代码行数:33,代码来源:mex-volume-control.c


示例5: mnb_launcher_button_key_release_event

static gboolean
mnb_launcher_button_key_release_event (ClutterActor       *actor,
                                       ClutterKeyEvent    *event)
{
  if (event->keyval == CLUTTER_KEY_Return ||
      event->keyval == CLUTTER_KEY_KP_Enter ||
      event->keyval == CLUTTER_KEY_ISO_Enter)
    {
      MnbLauncherButton *self = MNB_LAUNCHER_BUTTON (actor);

      if (!self->priv->is_pressed)
        return FALSE;

      clutter_ungrab_keyboard ();
      self->priv->is_pressed = FALSE;
      g_signal_emit (self, _signals[ACTIVATED], 0);

      mx_stylable_set_style_pseudo_class (MX_STYLABLE (self), NULL);
      mx_widget_hide_tooltip (MX_WIDGET (self));

      return TRUE;
    }

  return FALSE;
}
开发者ID:Cordia,项目名称:dawati-shell,代码行数:25,代码来源:mnb-launcher-button.c


示例6: mpl_panel_background_allocate

static void
mpl_panel_background_allocate (ClutterActor          *actor,
                               const ClutterActorBox *box,
                               ClutterAllocationFlags flags)
{
  MplPanelBackgroundPrivate *priv = MPL_PANEL_BACKGROUND (actor)->priv;
#if 0
  ClutterActor              *border;

  border = mx_widget_get_border_image (MX_WIDGET (actor));

  /*
   * We need to use different background asset based on the size allocated to us
   * -- basically, the panel cannot be smaller than the size of the borders of
   * its border image (see MB#702), so if it is smaller than the current asset
   * allows, we change the asset to simpler one.
   *
   * The code here assumes that we either have no name, or are called
   * 'too-small', but since this is a private widget of libmeego-panel, we can
   * enforce this assumption.
   */
  if (border)
    {
      const gchar *name = clutter_actor_get_name (actor);
      gboolean     too_small = FALSE;

      /*
       * Get the dimensions of the base texture (we are guaranteed to be called
       * first with name == NULL, so this works).
       */
      if (!priv->base_geom_known && !name)
        {
          mx_texture_frame_get_border_values (/*MX_TEXTURE_FRAME*/ (border),
                                              &priv->base_t,
                                              &priv->base_r,
                                              &priv->base_b,
                                              &priv->base_l);

          priv->base_geom_known = TRUE;
        }

      if (priv->base_l + priv->base_r > box->x2 - box->x1 ||
          priv->base_t + priv->base_b > box->y2 - box->y1)
        {
          too_small = TRUE;
        }

      if (!name && too_small)
        {
          clutter_actor_set_name (actor, "too-small");
        }
      else if (name && !too_small)
        {
          clutter_actor_set_name (actor, NULL);
        }
    }
#endif //DV
  CLUTTER_ACTOR_CLASS (
             mpl_panel_background_parent_class)->allocate (actor, box, flags);
}
开发者ID:dudochkin-victor,项目名称:mutter-netbook,代码行数:60,代码来源:mpl-panel-background.c


示例7: mnb_fancy_bin_allocate

static void
mnb_fancy_bin_allocate (ClutterActor          *actor,
                        const ClutterActorBox *box,
                        ClutterAllocationFlags flags)
{
  MxPadding padding;
  ClutterActorBox child_box;

  MnbFancyBinPrivate *priv = MNB_FANCY_BIN (actor)->priv;

  mx_widget_get_padding (MX_WIDGET (actor), &padding);

  if (priv->real_child)
    clutter_actor_allocate_preferred_size (priv->real_child, flags);

  child_box.x1 = padding.left;
  child_box.x2 = box->x2 - box->x1 - padding.right;
  child_box.y1 = padding.top;
  child_box.y2 = box->y2 - box->y1 - padding.bottom;

  if (priv->child)
    clutter_actor_allocate (priv->child, &child_box, flags);

  if (priv->clone)
    clutter_actor_allocate (priv->clone, &child_box, flags);

  CLUTTER_ACTOR_CLASS (mnb_fancy_bin_parent_class)->
    allocate (actor, box, flags);
}
开发者ID:dudochkin-victor,项目名称:mutter-netbook,代码行数:29,代码来源:mnb-fancy-bin.c


示例8: mnb_fancy_bin_get_preferred_height

static void
mnb_fancy_bin_get_preferred_height (ClutterActor *actor,
                                    gfloat        for_width,
                                    gfloat       *min_height_p,
                                    gfloat       *nat_height_p)
{
  MxPadding padding;
  MnbFancyBinPrivate *priv = MNB_FANCY_BIN (actor)->priv;

  if (min_height_p)
    *min_height_p = 0;
  if (nat_height_p)
    *nat_height_p = 0;

  if (priv->real_child)
    clutter_actor_get_preferred_height (priv->real_child,
                                        for_width,
                                        min_height_p,
                                        nat_height_p);

  mx_widget_get_padding (MX_WIDGET (actor), &padding);

  if (min_height_p)
    *min_height_p += padding.top + padding.bottom;
  if (nat_height_p)
    *nat_height_p += padding.top + padding.bottom;
}
开发者ID:dudochkin-victor,项目名称:mutter-netbook,代码行数:27,代码来源:mnb-fancy-bin.c


示例9: mx_toggle_get_preferred_height

static void
mx_toggle_get_preferred_height (ClutterActor *actor,
                                gfloat        for_width,
                                gfloat       *min_height_p,
                                gfloat       *pref_height_p)
{
  ClutterActor *background;
  gfloat pref_h;

  background = mx_widget_get_background_image (MX_WIDGET (actor));

  if (!background)
    {
      if (min_height_p)
        *min_height_p = 0;
      if (pref_height_p)
        *pref_height_p = 0;

      return;
    }

  clutter_actor_get_preferred_height (background, -1, NULL, &pref_h);

  if (min_height_p)
    *min_height_p = pref_h;

  if (pref_height_p)
    *pref_height_p = pref_h;
}
开发者ID:jlec,项目名称:mx,代码行数:29,代码来源:mx-toggle.c


示例10: on_trough_bg_button_press_event

static gboolean
on_trough_bg_button_press_event (ClutterActor       *actor,
                                 ClutterButtonEvent *event,
                                 MxSlider           *self)
{
  MxSliderPrivate *priv = self->priv;
  ClutterActor *stage;

  if (event->button != 1)
    return FALSE;

  if (mx_widget_get_disabled (MX_WIDGET (actor)))
    return FALSE;


  move_handle (self, event->x, event->y);

  stage = clutter_actor_get_stage (priv->handle);

  /* Turn off picking for motion events */
  clutter_stage_set_motion_events_enabled (CLUTTER_STAGE (stage), FALSE);

  priv->capture_handler =
    g_signal_connect_after (stage,
                            "captured-event",
                            G_CALLBACK (on_handle_capture_event),
                            self);

  return TRUE;
}
开发者ID:3v1n0,项目名称:mx,代码行数:30,代码来源:mx-slider.c


示例11: mx_notebook_allocate

static void
mx_notebook_allocate (ClutterActor          *actor,
                      const ClutterActorBox *box,
                      ClutterAllocationFlags flags)
{
  MxNotebookPrivate *priv = MX_NOTEBOOK (actor)->priv;
  GList *l;
  MxPadding padding;
  ClutterActorBox childbox;

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

  mx_widget_get_padding (MX_WIDGET (actor), &padding);

  childbox.x1 = 0 + padding.left;
  childbox.x2 = box->x2 - box->x1 - padding.right;

  childbox.y1 = 0 + padding.top;
  childbox.y2 = box->y2 - box->y1 - padding.bottom;

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

      child = CLUTTER_ACTOR (l->data);

      if (CLUTTER_ACTOR_IS_VISIBLE (l->data))
        clutter_actor_allocate (child, &childbox, flags);
    }
}
开发者ID:3v1n0,项目名称:mx,代码行数:30,代码来源:mx-notebook.c


示例12: mex_column_pick

static void
mex_column_pick (ClutterActor *actor, const ClutterColor *color)
{
  GList *c;
  gdouble value;
  MxPadding padding;
  ClutterActorBox box;

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

  CLUTTER_ACTOR_CLASS (mex_column_parent_class)->pick (actor, color);

  /* Don't pick children when we don't have focus */
  if (!priv->has_focus)
    return;

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

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

  for (c = priv->children; c; c = c->next)
    clutter_actor_paint (c->data);

  cogl_clip_pop ();
}
开发者ID:ocrete,项目名称:media-explorer,代码行数:34,代码来源:mex-column.c


示例13: mex_epg_grid_get_preferred_width

static void
mex_epg_grid_get_preferred_width (ClutterActor *actor,
                                  gfloat        for_height,
                                  gfloat       *min_width_p,
                                  gfloat       *nat_width_p)
{
  MexEpgGrid *grid = MEX_EPG_GRID (actor);
  MexEpgGridPrivate *priv = grid->priv;
  MxPadding padding;
  GTimeSpan diff;

  mx_widget_get_padding (MX_WIDGET (actor), &padding);

  if (priv->first_date == NULL || priv->last_date == NULL)
    diff = 0;
  else
    diff = g_date_time_difference (priv->last_date, priv->first_date);

  if (min_width_p)
    *min_width_p = 0;

  if (nat_width_p)
    *nat_width_p = time_span_to_pixels (grid, diff) + padding.left +
                   padding.right;
}
开发者ID:dudochkin-victor,项目名称:mex,代码行数:25,代码来源:mex-epg-grid.c


示例14: mex_column_paint

static void
mex_column_paint (ClutterActor *actor)
{
  GList *c;
  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);

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

  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 ();
}
开发者ID:ocrete,项目名称:media-explorer,代码行数:35,代码来源:mex-column.c


示例15: mx_frame_get_preferred_height

static void
mx_frame_get_preferred_height (ClutterActor *actor,
                               gfloat        for_width,
                               gfloat       *min_height,
                               gfloat       *pref_height)
{
    MxFramePrivate *priv = ((MxFrame *) actor)->priv;
    MxPadding padding;

    mx_widget_get_padding (MX_WIDGET (actor), &padding);

    if (min_height)
        *min_height = 0;

    if (pref_height)
        *pref_height = 0;

    if (priv->child)
    {
        clutter_actor_get_preferred_height (priv->child,
                                            for_width - padding.left - padding.right,
                                            min_height, pref_height);
    }

    if (min_height)
        *min_height += padding.top + padding.bottom;

    if (pref_height)
        *pref_height += padding.top + padding.bottom;
}
开发者ID:jonnylamb,项目名称:mx,代码行数:30,代码来源:mx-frame.c


示例16: mx_bin_allocate_child

/**
 * mx_bin_allocate_child:
 * @bin: An #MxBin
 * @box: The allocation box of the parent actor.
 * @flags: #ClutterAllocationFlags, usually provided by the.
 * clutter_actor_allocate function.
 *
 * Allocates the child of an #MxBin using the width and height from @box.
 * This function should usually only be called by subclasses of #MxBin.
 *
 * This function can be used to allocate the child of an #MxBin if no special
 * allocation requirements are needed. It is similar to
 * #mx_allocate_align_fill, except that it reads the alignment, padding and
 * fill values from the #MxBin, and will call #clutter_actor_allocate on the
 * child.
 *
 */
void
mx_bin_allocate_child (MxBin                  *bin,
                       const ClutterActorBox  *box,
                       ClutterAllocationFlags  flags)
{
  MxBinPrivate *priv;

  g_return_if_fail (MX_IS_BIN (bin));

  priv = bin->priv;

  if (priv->child)
    {
      MxPadding padding;
      ClutterActorBox allocation = { 0, };

      mx_widget_get_padding (MX_WIDGET (bin), &padding);

      allocation.x1 = padding.left;
      allocation.x2 = box->x2 - box->x1 - padding.right;
      allocation.y1 = padding.top;
      allocation.y2 = box->y2 - box->y1 - padding.bottom;

      mx_allocate_align_fill (priv->child,
                              &allocation,
                              priv->x_align,
                              priv->y_align,
                              priv->x_fill,
                              priv->y_fill);

      clutter_actor_allocate (priv->child, &allocation, flags);
    }
}
开发者ID:GunioRobot,项目名称:mx,代码行数:50,代码来源:mx-bin.c


示例17: mx_combo_box_update_menu

static void
mx_combo_box_update_menu (MxComboBox *box)
{
  MxComboBoxPrivate *priv = box->priv;
  GSList *l;
  gint index;
  MxMenu *menu;

  menu = mx_widget_get_menu (MX_WIDGET (box));
  if (!menu)
    return;

  mx_menu_remove_all (menu);

  for (index = 0, l = priv->actions; l; l = g_slist_next (l), index++)
    {
      MxAction *action;

      action = (MxAction *)l->data;
      g_object_set_data ((GObject*) action, "index", GINT_TO_POINTER (index));

      mx_menu_add_action (menu, action);
    }

  /* queue a relayout so the combobox size can match the new menu */
  clutter_actor_queue_relayout ((ClutterActor*) box);
}
开发者ID:ebassi,项目名称:mx,代码行数:27,代码来源:mx-combo-box.c


示例18: mx_combo_box_init

static void
mx_combo_box_init (MxComboBox *self)
{
  MxComboBoxPrivate *priv;
  ClutterActor *menu;

  priv = self->priv = COMBO_BOX_PRIVATE (self);

  priv->spacing = 8;

  priv->label = clutter_text_new ();
  clutter_actor_add_child ((ClutterActor*) self, priv->label);

  menu = mx_menu_new ();
  mx_widget_set_menu (MX_WIDGET (self), MX_MENU (menu));

  g_signal_connect (menu, "action-activated",
                    G_CALLBACK (mx_combo_box_action_activated_cb),
                    self);

  g_signal_connect (self, "style-changed",
                    G_CALLBACK (mx_combo_box_style_changed), NULL);

  clutter_actor_set_reactive (CLUTTER_ACTOR (self), TRUE);


  g_signal_connect (self, "notify::disabled",
                    G_CALLBACK (mx_combo_box_disable_notify_cb), NULL);
}
开发者ID:ManMower,项目名称:mx,代码行数:29,代码来源:mx-combo-box.c


示例19: mx_toggle_handle_button_release_event

static gboolean
mx_toggle_handle_button_release_event (ClutterActor       *actor,
                                       ClutterButtonEvent *event,
                                       MxToggle           *toggle)
{
  ClutterActorBox box;

  if (mx_widget_get_disabled (MX_WIDGET (toggle)))
    return FALSE;

  if (toggle->priv->last_move == 0)
    mx_toggle_set_active (toggle, !toggle->priv->active);
  else
    mx_toggle_set_active (toggle, (toggle->priv->last_move > 0.0));

  toggle->priv->drag_offset = -1;

  toggle->priv->last_move = 0;

  clutter_ungrab_pointer ();

  /* ensure the hover state is removed if the pointer left the handle
   * during the grab */
  clutter_actor_get_allocation_box (actor, &box);
  if (!clutter_actor_box_contains (&box, event->x, event->y))
    mx_stylable_style_pseudo_class_remove (MX_STYLABLE (actor), "hover");

  return TRUE;
}
开发者ID:ManMower,项目名称:mx,代码行数:29,代码来源:mx-toggle.c


示例20: mx_toggle_get_preferred_height

static void
mx_toggle_get_preferred_height (ClutterActor *actor,
                                gfloat        for_width,
                                gfloat       *min_height_p,
                                gfloat       *pref_height_p)
{
  CoglHandle background;
  gfloat pref_h;

  background = mx_widget_get_background_texture (MX_WIDGET (actor));

  if (!background)
    {
      if (min_height_p)
        *min_height_p = 0;
      if (pref_height_p)
        *pref_height_p = 0;

      return;
    }

  pref_h = cogl_texture_get_height (background);

  if (min_height_p)
    *min_height_p = pref_h;

  if (pref_height_p)
    *pref_height_p = pref_h;
}
开发者ID:ManMower,项目名称:mx,代码行数:29,代码来源:mx-toggle.c



注:本文中的MX_WIDGET函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MYASSERT函数代码示例发布时间:2022-05-30
下一篇:
C++ MX_STYLABLE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap