| 1 | #cxx . . $ `<file>/demo/demo-animation.c`/include <config.h>cxx . . $ `<file>/config.h`/ |
| 2 | #include <string.h> |
| 3 | #include <gtk/gtk.h> |
| 4 | #include <goocanvas.h>cxx . . $ `<file>/src/goocanvas.h`/ |
| 5 | |
| 6 | |
| 7 | static GooCanvasItemcxx . . $ GooCanvasItem# *ellipse1cxx . . $ ellipse1., *ellipse2cxx . . $ ellipse2., *rect1cxx . . $ rect1., *rect2cxx . . $ rect2., *rect3cxx . . $ rect3., *rect4cxx . . $ rect4.; |
| 8 | |
| 9 | |
| 10 | static void |
| 11 | start_animation_clickedcxx . . $ start_animation_clicked(c2a8b32df5332c4b). (GtkWidgetcxx . . $ GtkWidget# *button, gpointercxx . . $ gpointer# data) |
| 12 | { |
| 13 | /* Absolute. */ |
| 14 | goo_canvas_item_set_simple_transformcxx . . $ goo_canvas_item_set_simple_transform(e9bc8aaddade4bfe). (ellipse1cxx . . $ ellipse1., 100, 100, 1, 0); |
| 15 | goo_canvas_item_animatecxx . . $ goo_canvas_item_animate(788d2e3c9e561faa). (ellipse1cxx . . $ ellipse1., 500, 100, 2, 720, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, 2000, 40, |
| 16 | GOO_CANVAS_ANIMATE_BOUNCEcxx . . $ GOO_CANVAS_ANIMATE_BOUNCE.); |
| 17 | |
| 18 | goo_canvas_item_set_simple_transformcxx . . $ goo_canvas_item_set_simple_transform(e9bc8aaddade4bfe). (rect1cxx . . $ rect1., 100, 200, 1, 0); |
| 19 | goo_canvas_item_animatecxx . . $ goo_canvas_item_animate(788d2e3c9e561faa). (rect1cxx . . $ rect1., 100, 200, 1, 350, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, 40 * 36, 40, |
| 20 | GOO_CANVAS_ANIMATE_RESTARTcxx . . $ GOO_CANVAS_ANIMATE_RESTART.); |
| 21 | |
| 22 | goo_canvas_item_set_simple_transformcxx . . $ goo_canvas_item_set_simple_transform(e9bc8aaddade4bfe). (rect3cxx . . $ rect3., 200, 200, 1, 0); |
| 23 | goo_canvas_item_animatecxx . . $ goo_canvas_item_animate(788d2e3c9e561faa). (rect3cxx . . $ rect3., 200, 200, 3, 0, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, 400, 40, |
| 24 | GOO_CANVAS_ANIMATE_BOUNCEcxx . . $ GOO_CANVAS_ANIMATE_BOUNCE.); |
| 25 | |
| 26 | /* Relative. */ |
| 27 | goo_canvas_item_set_simple_transformcxx . . $ goo_canvas_item_set_simple_transform(e9bc8aaddade4bfe). (ellipse2cxx . . $ ellipse2., 100, 400, 1, 0); |
| 28 | goo_canvas_item_animatecxx . . $ goo_canvas_item_animate(788d2e3c9e561faa). (ellipse2cxx . . $ ellipse2., 400, 0, 2, 720, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, 2000, 40, |
| 29 | GOO_CANVAS_ANIMATE_BOUNCEcxx . . $ GOO_CANVAS_ANIMATE_BOUNCE.); |
| 30 | |
| 31 | goo_canvas_item_set_simple_transformcxx . . $ goo_canvas_item_set_simple_transform(e9bc8aaddade4bfe). (rect2cxx . . $ rect2., 100, 500, 1, 0); |
| 32 | goo_canvas_item_animatecxx . . $ goo_canvas_item_animate(788d2e3c9e561faa). (rect2cxx . . $ rect2., 0, 0, 1, 350, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, 40 * 36, 40, |
| 33 | GOO_CANVAS_ANIMATE_RESTARTcxx . . $ GOO_CANVAS_ANIMATE_RESTART.); |
| 34 | |
| 35 | goo_canvas_item_set_simple_transformcxx . . $ goo_canvas_item_set_simple_transform(e9bc8aaddade4bfe). (rect4cxx . . $ rect4., 200, 500, 1, 0); |
| 36 | goo_canvas_item_animatecxx . . $ goo_canvas_item_animate(788d2e3c9e561faa). (rect4cxx . . $ rect4., 0, 0, 3, 0, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, 400, 40, |
| 37 | GOO_CANVAS_ANIMATE_BOUNCEcxx . . $ GOO_CANVAS_ANIMATE_BOUNCE.); |
| 38 | } |
| 39 | |
| 40 | |
| 41 | static void |
| 42 | stop_animation_clickedcxx . . $ stop_animation_clicked(c2a8b32df5332c4b). (GtkWidgetcxx . . $ GtkWidget# *button, gpointercxx . . $ gpointer# data) |
| 43 | { |
| 44 | goo_canvas_item_stop_animationcxx . . $ goo_canvas_item_stop_animation(fb89872e380c590a). (ellipse1cxx . . $ ellipse1.); |
| 45 | goo_canvas_item_stop_animationcxx . . $ goo_canvas_item_stop_animation(fb89872e380c590a). (ellipse2cxx . . $ ellipse2.); |
| 46 | goo_canvas_item_stop_animationcxx . . $ goo_canvas_item_stop_animation(fb89872e380c590a). (rect1cxx . . $ rect1.); |
| 47 | goo_canvas_item_stop_animationcxx . . $ goo_canvas_item_stop_animation(fb89872e380c590a). (rect2cxx . . $ rect2.); |
| 48 | goo_canvas_item_stop_animationcxx . . $ goo_canvas_item_stop_animation(fb89872e380c590a). (rect3cxx . . $ rect3.); |
| 49 | goo_canvas_item_stop_animationcxx . . $ goo_canvas_item_stop_animation(fb89872e380c590a). (rect4cxx . . $ rect4.); |
| 50 | } |
| 51 | |
| 52 | |
| 53 | static void |
| 54 | on_animation_finishedcxx . . $ on_animation_finished(e25433943250c53e). (GooCanvasItemcxx . . $ GooCanvasItem# *item, |
| 55 | gbooleancxx . . $ gboolean# stopped, |
| 56 | gpointercxx . . $ gpointer# data) |
| 57 | { |
| 58 | g_printcxx . . $ g_print(326aeb464d16410c). ("Animation finished stopped: %i\n", stopped); |
| 59 | |
| 60 | #if 0 |
| 61 | /* Test starting another animation. */ |
| 62 | goo_canvas_item_animate (ellipse1, 500, 200, 2, 720, TRUE, 2000, 40, |
| 63 | GOO_CANVAS_ANIMATE_BOUNCE); |
| 64 | #endif |
| 65 | } |
| 66 | |
| 67 | |
| 68 | static void |
| 69 | setup_canvascxx . . $ setup_canvas(d7cf858254b37903). (GtkWidgetcxx . . $ GtkWidget# *canvas) |
| 70 | { |
| 71 | GooCanvasItemcxx . . $ GooCanvasItem# *root; |
| 72 | |
| 73 | root = goo_canvas_get_root_itemcxx . . $ goo_canvas_get_root_item(ce13d83f0f3922dc). (GOO_CANVAScxx . . $ `src/goocanvas.h:27:9`! (canvas)); |
| 74 | |
| 75 | /* Absolute. */ |
| 76 | ellipse1cxx . . $ ellipse1. = goo_canvas_ellipse_newcxx . . $ goo_canvas_ellipse_new(81fa6bcda469491f). (root, 0, 0, 25, 15, |
| 77 | "fill-color", "blue", |
| 78 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 79 | goo_canvas_item_translatecxx . . $ goo_canvas_item_translate(e265ce1cccd7ae25). (ellipse1cxx . . $ ellipse1., 100, 100); |
| 80 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (ellipse1, "animation_finished", |
| 81 | G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (on_animation_finished), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 82 | |
| 83 | rect1cxx . . $ rect1. = goo_canvas_rect_newcxx . . $ goo_canvas_rect_new(81fa6bcda469491f). (root, -10, -10, 20, 20, |
| 84 | "fill-color", "blue", |
| 85 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 86 | goo_canvas_item_translatecxx . . $ goo_canvas_item_translate(e265ce1cccd7ae25). (rect1cxx . . $ rect1., 100, 200); |
| 87 | |
| 88 | rect3cxx . . $ rect3. = goo_canvas_rect_newcxx . . $ goo_canvas_rect_new(81fa6bcda469491f). (root, -10, -10, 20, 20, |
| 89 | "fill-color", "blue", |
| 90 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 91 | goo_canvas_item_translatecxx . . $ goo_canvas_item_translate(e265ce1cccd7ae25). (rect3cxx . . $ rect3., 200, 200); |
| 92 | |
| 93 | /* Relative. */ |
| 94 | ellipse2cxx . . $ ellipse2. = goo_canvas_ellipse_newcxx . . $ goo_canvas_ellipse_new(81fa6bcda469491f). (root, 0, 0, 25, 15, |
| 95 | "fill-color", "red", |
| 96 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 97 | goo_canvas_item_translatecxx . . $ goo_canvas_item_translate(e265ce1cccd7ae25). (ellipse2cxx . . $ ellipse2., 100, 400); |
| 98 | |
| 99 | rect2cxx . . $ rect2. = goo_canvas_rect_newcxx . . $ goo_canvas_rect_new(81fa6bcda469491f). (root, -10, -10, 20, 20, |
| 100 | "fill-color", "red", |
| 101 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 102 | goo_canvas_item_translatecxx . . $ goo_canvas_item_translate(e265ce1cccd7ae25). (rect2cxx . . $ rect2., 100, 500); |
| 103 | |
| 104 | rect4cxx . . $ rect4. = goo_canvas_rect_newcxx . . $ goo_canvas_rect_new(81fa6bcda469491f). (root, -10, -10, 20, 20, |
| 105 | "fill-color", "red", |
| 106 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 107 | goo_canvas_item_translatecxx . . $ goo_canvas_item_translate(e265ce1cccd7ae25). (rect4cxx . . $ rect4., 200, 500); |
| 108 | } |
| 109 | |
| 110 | |
| 111 | GtkWidgetcxx . . $ GtkWidget# * |
| 112 | create_animation_pagecxx . . $ create_animation_page(2369ce5e9f2c7dfd). (void) |
| 113 | { |
| 114 | GtkWidgetcxx . . $ GtkWidget# *vbox, *hbox, *w, *scrolled_win, *canvas; |
| 115 | |
| 116 | vbox = gtk_box_newcxx . . $ gtk_box_new(b19e0ce02196028e). (GTK_ORIENTATION_VERTICALcxx . . $ GTK_ORIENTATION_VERTICAL., 4); |
| 117 | gtk_container_set_border_widthcxx . . $ gtk_container_set_border_width(4f2d4e7d5639aede). (GTK_CONTAINERcxx . . $ `<external>/462093496598485868/gtkcontainer.h:38:9`! (vbox), 4); |
| 118 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (vbox); |
| 119 | |
| 120 | hbox = gtk_box_newcxx . . $ gtk_box_new(b19e0ce02196028e). (GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL., 4); |
| 121 | gtk_box_pack_startcxx . . $ gtk_box_pack_start(e6ae6b264cb15f6b). (GTK_BOXcxx . . $ `<external>/14176280485027674556/gtkbox.h:40:9`! (vbox), hbox, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, 0); |
| 122 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (hbox); |
| 123 | |
| 124 | w = gtk_button_new_with_labelcxx . . $ gtk_button_new_with_label(6d90f3ec8782e10d).("Start Animation"); |
| 125 | gtk_box_pack_startcxx . . $ gtk_box_pack_start(e6ae6b264cb15f6b). (GTK_BOXcxx . . $ `<external>/14176280485027674556/gtkbox.h:40:9`! (hbox), w, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, 0); |
| 126 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (w); |
| 127 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (w, "clicked", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (start_animation_clicked), |
| 128 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 129 | |
| 130 | w = gtk_button_new_with_labelcxx . . $ gtk_button_new_with_label(6d90f3ec8782e10d).("Stop Animation"); |
| 131 | gtk_box_pack_startcxx . . $ gtk_box_pack_start(e6ae6b264cb15f6b). (GTK_BOXcxx . . $ `<external>/14176280485027674556/gtkbox.h:40:9`! (hbox), w, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, 0); |
| 132 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (w); |
| 133 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (w, "clicked", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (stop_animation_clicked), |
| 134 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 135 | |
| 136 | |
| 137 | scrolled_win = gtk_scrolled_window_newcxx . . $ gtk_scrolled_window_new(e400dcb18f76639). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 138 | gtk_scrolled_window_set_shadow_typecxx . . $ gtk_scrolled_window_set_shadow_type(a179c75bb506ed7a). (GTK_SCROLLED_WINDOWcxx . . $ `<external>/15242555379300173687/gtkscrolledwindow.h:38:9`! (scrolled_win), |
| 139 | GTK_SHADOW_INcxx . . $ GTK_SHADOW_IN.); |
| 140 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (scrolled_win); |
| 141 | gtk_box_pack_startcxx . . $ gtk_box_pack_start(e6ae6b264cb15f6b). (GTK_BOXcxx . . $ `<external>/14176280485027674556/gtkbox.h:40:9`! (vbox), scrolled_win, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, 0); |
| 142 | |
| 143 | canvas = goo_canvas_newcxx . . $ goo_canvas_new(2369ce5e9f2c7dfd). (); |
| 144 | gtk_widget_set_size_requestcxx . . $ gtk_widget_set_size_request(f5b8e75990cfac4b). (canvas, 600, 450); |
| 145 | goo_canvas_set_boundscxx . . $ goo_canvas_set_bounds(c765acac0aeef5c4). (GOO_CANVAScxx . . $ `src/goocanvas.h:27:9`! (canvas), 0, 0, 1000, 1000); |
| 146 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (canvas); |
| 147 | gtk_container_addcxx . . $ gtk_container_add(a71b61ec882009c2). (GTK_CONTAINERcxx . . $ `<external>/462093496598485868/gtkcontainer.h:38:9`! (scrolled_win), canvas); |
| 148 | |
| 149 | setup_canvascxx . . $ setup_canvas(d7cf858254b37903). (canvas); |
| 150 | |
| 151 | return vbox; |
| 152 | } |