示例#1
0
int
main (int argc, char **argv)
{
  const ClutterColor grey = { 0x40, 0x40, 0x40, 0xff };

  ClutterActor *stage, *info_bar;
  ClutterConstraint *constraint;
  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 (CLUTTER_STAGE (stage), &grey);
  clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);

  info_bar = mex_info_bar_get_default ();
  constraint = clutter_bind_constraint_new (stage, CLUTTER_BIND_WIDTH, 0.0);
  clutter_actor_add_constraint (info_bar, constraint);

  clutter_container_add_actor (CLUTTER_CONTAINER (stage), info_bar);

  clutter_actor_set_size (stage, 1024, 768);
  clutter_actor_show (stage);

  clutter_main ();

  return 0;
}
示例#2
0
int
main (int argc, char **argv)
{
  MxWindow *window;
  MxApplication *app;
  ClutterActor *stage, *bar, *button, *hbox;

  app = mx_application_new (&argc, &argv, "Test PathBar", 0);

  window = mx_application_create_window (app);
  stage = (ClutterActor *)mx_window_get_clutter_stage (window);

  bar = mx_path_bar_new ();
  mx_path_bar_set_clear_on_change (MX_PATH_BAR (bar), TRUE);

  hbox = mx_box_layout_new ();

  button = mx_button_new_with_label ("Add crumb");
  g_signal_connect_swapped (button, "clicked",
                            G_CALLBACK (add_cb), bar);
  clutter_container_add_actor (CLUTTER_CONTAINER (hbox), button);

  button = mx_button_new_with_label ("Remove crumb");
  g_signal_connect_swapped (button, "clicked",
                            G_CALLBACK (remove_cb), bar);
  clutter_container_add_actor (CLUTTER_CONTAINER (hbox), button);

  button = mx_button_new_with_label ("Toggle editable");
  g_signal_connect_swapped (button, "clicked",
                            G_CALLBACK (toggle_editable_cb), bar);
  clutter_container_add_actor (CLUTTER_CONTAINER (hbox), button);

  button = mx_button_new_with_label ("Re-label first crumb");
  g_signal_connect_swapped (button, "clicked",
                            G_CALLBACK (relabel_cb), bar);
  clutter_container_add_actor (CLUTTER_CONTAINER (hbox), button);

  /* -a for 'alternative packing'... */
  if (argc > 1 && g_str_equal (argv[1], "-a"))
    {
      ClutterActor *vbox = mx_box_layout_new ();
      mx_box_layout_set_orientation (MX_BOX_LAYOUT (vbox), MX_ORIENTATION_VERTICAL);
      clutter_container_add_actor (CLUTTER_CONTAINER (vbox), bar);
      clutter_container_add_actor (CLUTTER_CONTAINER (vbox), hbox);
      mx_window_set_child (window, vbox);
      mx_path_bar_set_editable (MX_PATH_BAR (bar), TRUE);
    }
  else
    {
      MxToolbar *toolbar = mx_window_get_toolbar (window);
      clutter_container_add_actor (CLUTTER_CONTAINER (toolbar), bar);
      mx_window_set_child (window, hbox);
    }

  clutter_actor_show (stage);

  mx_application_run (app);

  return 0;
}
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;
}
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;
}
示例#5
0
文件: test-window.c 项目: kalfa/mx
int
main (int argc, char **argv)
{
    MxApplication *app;

    app = mx_application_new ("org.clutter-project.Mx.TestWindow", 0);

    g_signal_connect_after (app, "startup", G_CALLBACK (startup_cb), NULL);

    g_application_run (G_APPLICATION (app), argc, argv);

    return 0;
}
示例#6
0
int
main (int argc, char *argv[])
{
  MxApplication *application;

  application = mx_application_new ("org.clutter-project.Mx.TestKineticScrollView", 0);
  g_signal_connect_after (application, "startup", G_CALLBACK (startup_cb), NULL);

  /* run the application */
  g_application_run (G_APPLICATION (application), argc, argv);

  return 0;
}
示例#7
0
文件: test-focus.c 项目: danni/mx
int
main (int argc, char *argv[])
{
  ClutterActor *button, *box, *stage;
  MxApplication *application;
  MxWindow *window;

  application = mx_application_new (&argc, &argv, "Test Mx focus handling",
                                    MX_APPLICATION_SINGLE_INSTANCE);

  window = mx_application_create_window (application);
  stage = (ClutterActor *)mx_window_get_clutter_stage (window);

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

  button = mx_button_new_with_label ("button #1 (activate to remove)");
  g_signal_connect (button, "clicked",
                    G_CALLBACK (button_clicked_cb), NULL);
  mx_box_layout_insert_actor (MX_BOX_LAYOUT (box), button, -1);

  mx_focus_manager_push_focus (mx_focus_manager_get_for_stage (CLUTTER_STAGE (stage)),
                               MX_FOCUSABLE (button));


  button = mx_button_new_with_label ("button #2 (activate to remove)");
  g_signal_connect (button, "clicked",
                    G_CALLBACK (button_clicked_cb), NULL);
  mx_box_layout_insert_actor (MX_BOX_LAYOUT (box), button, -1);

  button = mx_button_new_with_label ("button #3 (activate to remove)");
  g_signal_connect (button, "clicked",
                    G_CALLBACK (button_clicked_cb), NULL);
  mx_box_layout_insert_actor (MX_BOX_LAYOUT (box), button, -1);

  button = mx_button_new_with_label ("button #4 (activate to remove)");
  g_signal_connect (button, "clicked",
                    G_CALLBACK (button_clicked_cb), NULL);
  mx_box_layout_insert_actor (MX_BOX_LAYOUT (box), button, -1);

  clutter_actor_show (stage);

  mx_application_run (application);

  return EXIT_SUCCESS;
}
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;
}
示例#9
0
int
main (int argc, char **argv)
{
  const ClutterColor grey = { 0x40, 0x40, 0x40, 0xff };

  ClutterActor *stage, *tile, *tile2, *image, *image2, *dialog, *tiles;
  MxApplication *app;
  ClutterConstraint *constraint;

  mex_init (&argc, &argv);

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

  stage = clutter_stage_get_default ();
  clutter_stage_set_color (CLUTTER_STAGE (stage), &grey);
  clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);

  image = mx_image_new ();
  mx_image_set_from_file (MX_IMAGE (image), "/home/michael/dev/mex-info-bar/graphic-mapButtons.png", NULL);

  image2 = mx_image_new ();
  mx_image_set_from_file (MX_IMAGE (image2), "/home/michael/dev/mex-info-bar/graphic-network.png", NULL);

  tile = mex_tile_new ();
  mex_tile_set_label (tile, "Remote mapping");
  mex_tile_set_important (tile, TRUE);

  ClutterActor *button;
  button = mx_button_new ();

  mx_bin_set_child (MX_BIN (tile), button);
  mx_bin_set_child (MX_BIN (button), image);

  tile2 = mex_tile_new ();
  mex_tile_set_label (tile2, "Network");
  mex_tile_set_important (tile2, TRUE);

  ClutterActor *button2;
  button2 = mx_button_new ();

  mx_bin_set_child (MX_BIN (tile2), button2);
  mx_bin_set_child (MX_BIN (button2), image2);

  tiles = mx_box_layout_new ();
  mx_box_layout_set_spacing (tiles, 10);
  mx_box_layout_set_orientation (tiles, MX_ORIENTATION_HORIZONTAL);
  mx_box_layout_add_actor (tiles, tile, 0);
  mx_box_layout_add_actor (tiles, tile2, 1);


  g_print (clutter_actor_get_reactive (tile) ? "reactive" : "notreactive");
  dialog = mx_dialog_new ();
  mx_dialog_set_transient_parent (dialog, stage);

  g_signal_connect (button2, "clicked", G_CALLBACK (focus_in_cb), NULL);
  g_signal_connect (button, "clicked", G_CALLBACK (focus_in_cb), NULL);

  clutter_container_add_actor (CLUTTER_CONTAINER (dialog), tiles);

  clutter_actor_show (dialog);

  clutter_actor_set_size (stage, 1024, 768);
  clutter_actor_show (stage);

  clutter_main ();

  return 0;
}