| 1 | #cxx . . $ `<file>/demo/mv-demo-paths.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 GooCanvasItemModelcxx . . $ GooCanvasItemModel# *path1cxx . . $ path1.; |
| 8 | |
| 9 | static GooCanvasItemModelcxx . . $ GooCanvasItemModel#* |
| 10 | create_canvas_modelcxx . . $ create_canvas_model(242d43ef3a615fde). (void) |
| 11 | { |
| 12 | GooCanvasItemModelcxx . . $ GooCanvasItemModel# *root, *path G_GNUC_UNUSEDcxx . . $ `<external>/12741050725406041920/gmacros.h:647:9`!; |
| 13 | |
| 14 | root = goo_canvas_group_model_newcxx . . $ goo_canvas_group_model_new(7f896cf3adb67825). (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`!); |
| 15 | |
| 16 | /* Test the simple commands like moveto and lineto: MmZzLlHhVv. */ |
| 17 | path1cxx . . $ path1. = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, "M 20 20 L 40 40", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 18 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, "M30 20 l20, 20", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 19 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, "M 60 20 H 80", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 20 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, "M60 40 h20", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 21 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, "M 100,20 V 40", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 22 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, "M 120 20 v 20", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 23 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, "M 140 20 h20 v20 h-20 z", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 24 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 25 | "M 180 20 h20 v20 h-20 z m 5,5 h10 v10 h-10 z", |
| 26 | "fill-color", "red", |
| 27 | "fill-rule", CAIRO_FILL_RULE_EVEN_ODDcxx . . $ CAIRO_FILL_RULE_EVEN_ODD., |
| 28 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 29 | |
| 30 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, "M 220 20 L 260 20 L 240 40 z", |
| 31 | "fill-color", "red", |
| 32 | "stroke-color", "blue", |
| 33 | "line-width", 3.0, |
| 34 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 35 | |
| 36 | /* Test the bezier curve commands: CcSsQqTt. */ |
| 37 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 38 | "M20,100 C20,50 100,50 100,100 S180,150 180,100", |
| 39 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 40 | |
| 41 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 42 | "M220,100 c0,-50 80,-50 80,0 s80,50 80,0", |
| 43 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 44 | |
| 45 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 46 | "M20,200 Q60,130 100,200 T180,200", |
| 47 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 48 | |
| 49 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 50 | "M220,200 q40,-70 80,0 t80,0", |
| 51 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 52 | |
| 53 | /* Test the elliptical arc commands: Aa. */ |
| 54 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 55 | "M200,500 h-150 a150,150 0 1,0 150,-150 z", |
| 56 | "fill-color", "red", |
| 57 | "stroke-color", "blue", |
| 58 | "line-width", 5.0, |
| 59 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 60 | |
| 61 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 62 | "M175,475 v-150 a150,150 0 0,0 -150,150 z", |
| 63 | "fill-color", "yellow", |
| 64 | "stroke-color", "blue", |
| 65 | "line-width", 5.0, |
| 66 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 67 | |
| 68 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 69 | "M400,600 l 50,-25 " |
| 70 | "a25,25 -30 0,1 50,-25 l 50,-25 " |
| 71 | "a25,50 -30 0,1 50,-25 l 50,-25 " |
| 72 | "a25,75 -30 0,1 50,-25 l 50,-25 " |
| 73 | "a25,100 -30 0,1 50,-25 l 50,-25", |
| 74 | "stroke-color", "red", |
| 75 | "line-width", 5.0, |
| 76 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 77 | |
| 78 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 79 | "M 525,75 a100,50 0 0,0 100,50", |
| 80 | "stroke-color", "red", |
| 81 | "line-width", 5.0, |
| 82 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 83 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 84 | "M 725,75 a100,50 0 0,1 100,50", |
| 85 | "stroke-color", "red", |
| 86 | "line-width", 5.0, |
| 87 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 88 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 89 | "M 525,200 a100,50 0 1,0 100,50", |
| 90 | "stroke-color", "red", |
| 91 | "line-width", 5.0, |
| 92 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 93 | path = goo_canvas_path_model_newcxx . . $ goo_canvas_path_model_new(f08182b36a6ce210). (root, |
| 94 | "M 725,200 a100,50 0 1,1 100,50", |
| 95 | "stroke-color", "red", |
| 96 | "line-width", 5.0, |
| 97 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 98 | |
| 99 | return root; |
| 100 | } |
| 101 | |
| 102 | |
| 103 | static void |
| 104 | move_path_clickedcxx . . $ move_path_clicked(b62913d0731e48df). (GtkWidgetcxx . . $ GtkWidget# *button, GooCanvascxx . . $ GooCanvas# *canvas) |
| 105 | { |
| 106 | static gintcxx . . $ gint# count = 0; |
| 107 | |
| 108 | gcharcxx . . $ gchar# *data; |
| 109 | |
| 110 | if (count == 0) |
| 111 | data = "M130,70 L317,70"; |
| 112 | else if (count == 1) |
| 113 | data = "M130,170 L317,170"; |
| 114 | else |
| 115 | data = "M130,270 L317,270"; |
| 116 | |
| 117 | g_object_setcxx . . $ g_object_set(1ac911bdc4e9a14d). (path1cxx . . $ path1., |
| 118 | "data", data, |
| 119 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 120 | |
| 121 | count = (count + 1) % 3; |
| 122 | } |
| 123 | |
| 124 | |
| 125 | GtkWidgetcxx . . $ GtkWidget# * |
| 126 | create_paths_pagecxx . . $ create_paths_page(2369ce5e9f2c7dfd). (void) |
| 127 | { |
| 128 | GtkWidgetcxx . . $ GtkWidget# *vbox, *hbox, *w, *scrolled_win, *canvas; |
| 129 | GooCanvasItemModelcxx . . $ GooCanvasItemModel# *root; |
| 130 | |
| 131 | vbox = gtk_box_newcxx . . $ gtk_box_new(b19e0ce02196028e). (GTK_ORIENTATION_VERTICALcxx . . $ GTK_ORIENTATION_VERTICAL., 4); |
| 132 | gtk_container_set_border_widthcxx . . $ gtk_container_set_border_width(4f2d4e7d5639aede). (GTK_CONTAINERcxx . . $ `<external>/462093496598485868/gtkcontainer.h:38:9`! (vbox), 4); |
| 133 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (vbox); |
| 134 | |
| 135 | hbox = gtk_box_newcxx . . $ gtk_box_new(b19e0ce02196028e). (GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL., 4); |
| 136 | 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); |
| 137 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (hbox); |
| 138 | |
| 139 | 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`!); |
| 140 | gtk_scrolled_window_set_shadow_typecxx . . $ gtk_scrolled_window_set_shadow_type(a179c75bb506ed7a). (GTK_SCROLLED_WINDOWcxx . . $ `<external>/15242555379300173687/gtkscrolledwindow.h:38:9`! (scrolled_win), |
| 141 | GTK_SHADOW_INcxx . . $ GTK_SHADOW_IN.); |
| 142 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (scrolled_win); |
| 143 | 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); |
| 144 | |
| 145 | canvas = goo_canvas_newcxx . . $ goo_canvas_new(2369ce5e9f2c7dfd). (); |
| 146 | gtk_widget_set_size_requestcxx . . $ gtk_widget_set_size_request(f5b8e75990cfac4b). (canvas, 600, 450); |
| 147 | goo_canvas_set_boundscxx . . $ goo_canvas_set_bounds(c765acac0aeef5c4). (GOO_CANVAScxx . . $ `src/goocanvas.h:27:9`! (canvas), 0, 0, 1000, 1000); |
| 148 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (canvas); |
| 149 | gtk_container_addcxx . . $ gtk_container_add(a71b61ec882009c2). (GTK_CONTAINERcxx . . $ `<external>/462093496598485868/gtkcontainer.h:38:9`! (scrolled_win), canvas); |
| 150 | |
| 151 | root = create_canvas_modelcxx . . $ create_canvas_model(242d43ef3a615fde). (); |
| 152 | goo_canvas_set_root_item_modelcxx . . $ goo_canvas_set_root_item_model(c091109a778736a6). (GOO_CANVAScxx . . $ `src/goocanvas.h:27:9`! (canvas), root); |
| 153 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (root); |
| 154 | |
| 155 | w = gtk_button_new_with_labelcxx . . $ gtk_button_new_with_label(6d90f3ec8782e10d). ("Move Path"); |
| 156 | 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); |
| 157 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (w); |
| 158 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (w, "clicked", |
| 159 | G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (move_path_clicked), canvas); |
| 160 | |
| 161 | return vbox; |
| 162 | } |