1
0
mirror of https://github.com/brl/mutter.git synced 2025-06-17 02:39:29 +00:00
Files
clutter
build
clutter
tests
accessibility
conform
interactive
meson
.gitignore
Makefile.am
meson.build
redhand.png
test-actors.c
test-animation.c
test-animator.c
test-bind-constraint.c
test-binding-pool.c
test-cairo-clock.c
test-cairo-flowers.c
test-cogl-multitexture.c
test-cogl-offscreen.c
test-cogl-point-sprites.c
test-cogl-shader-glsl.c
test-cogl-tex-convert.c
test-cogl-tex-foreign.c
test-cogl-tex-polygon.c
test-cogl-tex-tile.c
test-cogl-vertex-buffer.c
test-content.c
test-depth.c
test-devices.c
test-easing.c
test-events.c
test-fbo.c
test-grab.c
test-image.c
test-keyframe-transition.c
test-layout.c
test-main.c
test-multistage.c
test-paint-wrapper.c
test-path-constraint.c
test-pixmap.c
test-rotate-zoom.c
test-scale.c
test-script-signals.json
test-script.c
test-script.json
test-scrolling.c
test-shader-effects.c
test-stage-read-pixels.c
test-stage-sizing.c
test-state-animator.c
test-state-script.c
test-state.c
test-swipe-action.c
test-table-layout.c
test-text-field.c
test-text.c
test-texture-async.c
test-texture-material.c
test-texture-quality.c
test-texture-slicing.c
test-touch-events.c
wrapper.sh.in
micro-bench
performance
Makefile.am
README
clutter-1.0.suppressions
meson.build
.gitignore
Makefile.am
configure.ac
meson.build
cogl
data
doc
po
src
tools
.gitignore
COPYING
Makefile.am
NEWS
README.md
autogen.sh
config.h.meson
configure.ac
meson.build
meson_options.txt
mutter.doap
mutter/clutter/tests/interactive/test-state-script.c
2016-04-12 20:04:26 +02:00

54 lines
1.4 KiB
C

#include <stdlib.h>
#include <gmodule.h>
#include <clutter/clutter.h>
#define TEST_STATE_SCRIPT_FILE "test-script-signals.json"
gboolean
on_button_press (ClutterActor *actor,
ClutterEvent *event,
gpointer dummy G_GNUC_UNUSED)
{
g_print ("Button pressed!\n");
return FALSE;
}
G_MODULE_EXPORT int
test_state_script_main (int argc, char *argv[])
{
ClutterActor *stage, *button;
ClutterScript *script;
GError *error = NULL;
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
return EXIT_FAILURE;
script = clutter_script_new ();
clutter_script_load_from_file (script, TEST_STATE_SCRIPT_FILE, &error);
if (error != NULL)
g_error ("Unable to load '%s': %s\n",
TEST_STATE_SCRIPT_FILE,
error->message);
stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "State Script");
clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
clutter_actor_show (stage);
button = CLUTTER_ACTOR (clutter_script_get_object (script, "button"));
clutter_container_add_actor (CLUTTER_CONTAINER (stage), button);
clutter_actor_add_constraint (button, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
clutter_script_connect_signals (script, NULL);
clutter_main ();
g_object_unref (script);
return EXIT_SUCCESS;
}