int
main (int argc, char **argv)
{
  const ClutterColor dark_gray = { 0x40, 0x40, 0x40, 0xff };

  ClutterActor *box, *stage;
  MxApplication *app;
  MxWindow *window;

  mex_init (&argc, &argv);
  app = mx_application_new (&argc, &argv, "test-mex-expander-box", 0);
  clutter_init (&argc, &argv);

  mex_style_load_default ();

  window = mx_application_create_window (app);
  stage = (ClutterActor *)mx_window_get_clutter_stage (window);
  clutter_stage_set_color (CLUTTER_STAGE (stage), &dark_gray);

  box = mx_box_layout_new ();
  mx_box_layout_set_orientation (MX_BOX_LAYOUT (box), MX_ORIENTATION_VERTICAL);

  add_pictures (box);

  clutter_container_add_actor (CLUTTER_CONTAINER (stage), box);

  mx_window_set_has_toolbar (window, FALSE);
  clutter_actor_set_size (stage, 640, 480);
  clutter_actor_show (stage);

  clutter_main ();

  return 0;
}
Example #2
0
static void
toolbar_cb (MxToggle   *toggle,
            GParamSpec *pspec,
            MxWindow   *window)
{
    mx_window_set_has_toolbar (window, mx_toggle_get_active (toggle));
}
int
main (int argc, char **argv)
{
  const ClutterColor grey = { 0x40, 0x40, 0x40, 0xff };

  ClutterActor *stage, *info_panel, *align;
  MxApplication *app;
  MxWindow *window;
  MexFeed *feed;
  MexProgram *program;

  mex_init (&argc, &argv);

  app = mx_application_new (&argc, &argv, "mex-info-panel-test", 0);
  mex_style_load_default ();

  window = mx_application_create_window (app);
  stage = (ClutterActor *) mx_window_get_clutter_stage (window);
  clutter_stage_set_color ((ClutterStage *) stage, &grey);

  align = g_object_new (MX_TYPE_FRAME, "x-align", MX_ALIGN_MIDDLE,
                        "y-align", MX_ALIGN_END, NULL);

  mx_window_set_child (window, align);

  info_panel = mex_info_panel_new (MEX_INFO_PANEL_MODE_FULL);
  mx_bin_set_child (MX_BIN (align), info_panel);

  mx_window_set_has_toolbar (window, FALSE);
  clutter_actor_set_size (stage, 1024, 768);

  feed = mex_feed_new ("source", "title");
  program =  mex_program_new (feed);

  mex_content_set_metadata (MEX_CONTENT (program),
                            MEX_CONTENT_METADATA_MIMETYPE,
                            "video/mp4");

  mex_content_set_metadata (MEX_CONTENT (program),
                            MEX_CONTENT_METADATA_TITLE,
                            "The cats on the moon");
  mex_content_set_metadata (MEX_CONTENT (program),
                            MEX_CONTENT_METADATA_SYNOPSIS,
                            "An original title where cats are sent to the moon to catch all the mice which are naturally attracted there due to the large consistency of cheese, this results in a space race between NASA and CATSA, leading to war on the moon over territory claimed by cats");
  mex_content_set_metadata (MEX_CONTENT (program),
                            MEX_CONTENT_METADATA_STILL,
                            "http://farm5.static.flickr.com/4013/4305303148_5cbc986a44_m.jpg");

  mex_content_view_set_content (MEX_CONTENT_VIEW (info_panel),
                                MEX_CONTENT (program));


  clutter_actor_show (stage);

  clutter_main ();

  return 0;
}
Example #4
0
static void
startup_cb (MxApplication *application)
{
  MxWindow *window;
  ClutterActor *scroll, *child;
  gint i;

  window = mx_application_create_window (application, "Test Widgets");

  /* Create scroll view */
  scroll = mx_kinetic_scroll_view_new ();
  mx_kinetic_scroll_view_set_use_grab (MX_KINETIC_SCROLL_VIEW (scroll), TRUE);
  mx_kinetic_scroll_view_set_mouse_button (MX_KINETIC_SCROLL_VIEW (scroll), 3);
  clutter_actor_set_clip_to_allocation (scroll, TRUE);

  child = mx_box_layout_new_with_orientation (MX_ORIENTATION_VERTICAL);

  for (i = 0; i < 10000; i++) {
    ClutterActor *layout, *label, *icon;
    gchar *s = g_strdup_printf ("Row %d", i);

    layout = mx_box_layout_new_with_orientation (MX_ORIENTATION_HORIZONTAL);
    label = mx_label_new_with_text (s);
    clutter_actor_add_child (layout, label);
    g_free (s);

    icon = mx_icon_new ();
    mx_icon_set_icon_name (MX_ICON (icon), "object-rotate-left");
    mx_icon_set_icon_size (MX_ICON (icon), 32);
    clutter_actor_add_child (layout, icon);

    clutter_actor_add_child (child, layout);
  }

  clutter_actor_add_child (scroll, child);

  mx_window_set_child (window, scroll);

  /* show the window */
  mx_window_set_has_toolbar (window, FALSE);
  mx_window_show (window);
}
int
main (int argc, char **argv)
{
    const ClutterColor grey = { 0x40, 0x40, 0x40, 0xff };

    ClutterActor *stage, *controls, *align;
    MxApplication *app;
    MxWindow *window;

    mex_init (&argc, &argv);

    app = mx_application_new (&argc, &argv, "mex-media-controls-test", 0);
    mex_style_load_default ();

    window = mx_application_create_window (app);
    stage = (ClutterActor *) mx_window_get_clutter_stage (window);
    clutter_stage_set_color ((ClutterStage *) stage, &grey);

    align = g_object_new (MX_TYPE_FRAME, "x-align", MX_ALIGN_MIDDLE,
                          "y-align", MX_ALIGN_END, NULL);

    mx_window_set_child (window, align);


    controls = mex_media_controls_new ();
    mx_bin_set_child (MX_BIN (align), controls);

    g_signal_connect_swapped (controls, "stopped", G_CALLBACK (printf),
                              "Stopped signal received\n");

    mx_window_set_has_toolbar (window, FALSE);
    clutter_actor_set_size (stage, 1024, 768);
    clutter_actor_show (stage);

    clutter_main ();

    return 0;
}