image_paradise 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of image_paradise might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/LICENSE.md +38 -0
- data/README.md +928 -0
- data/USAGE.md +10 -0
- data/bin/black_white +10 -0
- data/bin/confree_generator +7 -0
- data/bin/create_new_image +7 -0
- data/bin/display_text_from_this_image +7 -0
- data/bin/draw_as_specified_from_the_yaml_file +7 -0
- data/bin/embed_the_filename_into_this_image +7 -0
- data/bin/image_paradise +7 -0
- data/bin/image_paradise_shell +7 -0
- data/bin/image_to_ascii +54 -0
- data/bin/image_to_pdf +7 -0
- data/bin/imageparadise_img2pdf +12 -0
- data/bin/img_text +14 -0
- data/bin/interlace +7 -0
- data/bin/jpg_to_pdf +12 -0
- data/bin/magic_card_border +8 -0
- data/bin/make_this_image_transparent +7 -0
- data/bin/morph_these_images +7 -0
- data/bin/optimize_this_image +7 -0
- data/bin/quality +7 -0
- data/bin/resize_by_percent +10 -0
- data/bin/rotate_left +7 -0
- data/bin/rotate_right +7 -0
- data/bin/round_the_corner +7 -0
- data/bin/ruby_montage +7 -0
- data/bin/transparent +15 -0
- data/doc/README.gen +871 -0
- data/doc/todo/TODO_FOR_THE_GTK_GUI.md +9 -0
- data/doc/todo/TODO_FOR_THE_IMAGE_PARADISE_PROJECT.md +22 -0
- data/doc/todo/TODO_WORK_THROUGH_THESE_LINKS.md +3 -0
- data/doc/todo/todo_for_the_libui_gui.md +4 -0
- data/image_paradise.gemspec +46 -0
- data/images/IMAGE_PARADISE_LOGO.png +0 -0
- data/lib/image_paradise/base/base.rb +293 -0
- data/lib/image_paradise/cfdg/1dca_pattern.cfdg +48 -0
- data/lib/image_paradise/cfdg/3d_coloured_cube.cfdg +95 -0
- data/lib/image_paradise/cfdg/a_3D_spiral.cfdg +40 -0
- data/lib/image_paradise/cfdg/a_chaotic_city.cfdg +156 -0
- data/lib/image_paradise/cfdg/a_coloured_red.cfdg +21 -0
- data/lib/image_paradise/cfdg/a_daisy_flower.cfdg +66 -0
- data/lib/image_paradise/cfdg/a_decorated_window.cfdg +74 -0
- data/lib/image_paradise/cfdg/a_human_profile.cfdg +303 -0
- data/lib/image_paradise/cfdg/a_lost_heart.cfdg +28 -0
- data/lib/image_paradise/cfdg/a_plant_root.cfdg +26 -0
- data/lib/image_paradise/cfdg/a_rather_realistic_forest.cfdg +29 -0
- data/lib/image_paradise/cfdg/a_shoreline_next_to_a_forest.cfdg +127 -0
- data/lib/image_paradise/cfdg/a_simple_mini_brain.cfdg +17 -0
- data/lib/image_paradise/cfdg/a_simple_star.cfdg +22 -0
- data/lib/image_paradise/cfdg/adorned_tree.cfdg +58 -0
- data/lib/image_paradise/cfdg/adsorption.cfdg +19 -0
- data/lib/image_paradise/cfdg/alfabet_free.cfdg +346 -0
- data/lib/image_paradise/cfdg/alfreebet.cfdg +229 -0
- data/lib/image_paradise/cfdg/algal_flora.cfdg +25 -0
- data/lib/image_paradise/cfdg/alien_eyeball.cfdg +15 -0
- data/lib/image_paradise/cfdg/alien_flower.cfdg +35 -0
- data/lib/image_paradise/cfdg/alphabet_circles.cfdg +38 -0
- data/lib/image_paradise/cfdg/alveolo.cfdg +38 -0
- data/lib/image_paradise/cfdg/an_icosahedron.cfdg +134 -0
- data/lib/image_paradise/cfdg/an_oils_surface.cfdg +48 -0
- data/lib/image_paradise/cfdg/ancient_map.cfdg +30 -0
- data/lib/image_paradise/cfdg/ancient_scripts_tile.cfdg +96 -0
- data/lib/image_paradise/cfdg/angelfish.cfdg +58 -0
- data/lib/image_paradise/cfdg/angry_yarn.cfdg +82 -0
- data/lib/image_paradise/cfdg/apple_tree_small.cfdg +46 -0
- data/lib/image_paradise/cfdg/aqua_star.cfdg +27 -0
- data/lib/image_paradise/cfdg/army_explosion.cfdg +25 -0
- data/lib/image_paradise/cfdg/arrows_in_quadcity.cfdg +143 -0
- data/lib/image_paradise/cfdg/artificial_intelligence.cfdg +41 -0
- data/lib/image_paradise/cfdg/askew.cfdg +27 -0
- data/lib/image_paradise/cfdg/audio_diagram_waves.cfdg +54 -0
- data/lib/image_paradise/cfdg/autumn_fractal.cfdg +39 -0
- data/lib/image_paradise/cfdg/baignoire.cfdg +33 -0
- data/lib/image_paradise/cfdg/barcode.cfdg +781 -0
- data/lib/image_paradise/cfdg/basic_polygon_shapes.cfdg +311 -0
- data/lib/image_paradise/cfdg/basic_spreaders.cfdg +52 -0
- data/lib/image_paradise/cfdg/basic_square.cfdg +8 -0
- data/lib/image_paradise/cfdg/bats_hiding_in_foliage.cfdg +19 -0
- data/lib/image_paradise/cfdg/bees.cfdg +61 -0
- data/lib/image_paradise/cfdg/bent_squares.cfdg +46 -0
- data/lib/image_paradise/cfdg/benzo_dreaming.cfdg +54 -0
- data/lib/image_paradise/cfdg/beta_bet.cfdg +645 -0
- data/lib/image_paradise/cfdg/big_bang_theory.cfdg +31 -0
- data/lib/image_paradise/cfdg/big_pacman.cfdg +70 -0
- data/lib/image_paradise/cfdg/bigger_tree.cfdg +64 -0
- data/lib/image_paradise/cfdg/binary_connection.cfdg +34 -0
- data/lib/image_paradise/cfdg/birch_line.cfdg +57 -0
- data/lib/image_paradise/cfdg/blacksmith_masterpiece.cfdg +3 -0
- data/lib/image_paradise/cfdg/blocked_rectangles.cfdg +23 -0
- data/lib/image_paradise/cfdg/blood_tubes.cfdg +45 -0
- data/lib/image_paradise/cfdg/bloom.cfdg +23 -0
- data/lib/image_paradise/cfdg/blown_glass_spheres.cfdg +30 -0
- data/lib/image_paradise/cfdg/blue_daisies_in_detail.cfdg +101 -0
- data/lib/image_paradise/cfdg/blue_galaxy.cfdg +20 -0
- data/lib/image_paradise/cfdg/blue_moon.cfdg +36 -0
- data/lib/image_paradise/cfdg/boa_feathers.cfdg +53 -0
- data/lib/image_paradise/cfdg/bomb.cfdg +75 -0
- data/lib/image_paradise/cfdg/boxy_continent.cfdg +111 -0
- data/lib/image_paradise/cfdg/bright_coloured_neurons.cfdg +53 -0
- data/lib/image_paradise/cfdg/brightness_flower.cfdg +31 -0
- data/lib/image_paradise/cfdg/btp_71_beautiful_coloured_lines.cfdg +85 -0
- data/lib/image_paradise/cfdg/btp_73.cfdg +76 -0
- data/lib/image_paradise/cfdg/bubblesun.cfdg +46 -0
- data/lib/image_paradise/cfdg/burning_bush.cfdg +31 -0
- data/lib/image_paradise/cfdg/butterflies_in_the_moonlight.cfdg +55 -0
- data/lib/image_paradise/cfdg/cardiod_arc.cfdg +44 -0
- data/lib/image_paradise/cfdg/cardioid.cfdg +41 -0
- data/lib/image_paradise/cfdg/caros_wallpaper.cfdg +46 -0
- data/lib/image_paradise/cfdg/cartoony_face_arrays.cfdg +137 -0
- data/lib/image_paradise/cfdg/centerfold.cfdg +12 -0
- data/lib/image_paradise/cfdg/chain_link_fence.cfdg +31 -0
- data/lib/image_paradise/cfdg/chanukah.cfdg +109 -0
- data/lib/image_paradise/cfdg/chaos_red_sun.cfdg +42 -0
- data/lib/image_paradise/cfdg/chaotic_farn.cfdg +76 -0
- data/lib/image_paradise/cfdg/chaotic_fractal_shell.cfdg +41 -0
- data/lib/image_paradise/cfdg/charleston.cfdg +182 -0
- data/lib/image_paradise/cfdg/ciliasun.cfdg +109 -0
- data/lib/image_paradise/cfdg/cipal.cfdg +65 -0
- data/lib/image_paradise/cfdg/circuits.cfdg +176 -0
- data/lib/image_paradise/cfdg/city_map.cfdg +66 -0
- data/lib/image_paradise/cfdg/clifford_torus.cfdg +135 -0
- data/lib/image_paradise/cfdg/colonize_flat_colour_pattern.cfdg +14 -0
- data/lib/image_paradise/cfdg/colour_blind_squid.cfdg +30 -0
- data/lib/image_paradise/cfdg/colour_hole.cfdg +56 -0
- data/lib/image_paradise/cfdg/colour_wheel.cfdg +40 -0
- data/lib/image_paradise/cfdg/coloured_eyes.cfdg +40 -0
- data/lib/image_paradise/cfdg/coloured_forest.cfdg +133 -0
- data/lib/image_paradise/cfdg/coloured_tree.cfdg +50 -0
- data/lib/image_paradise/cfdg/colourful_lives.cfdg +123 -0
- data/lib/image_paradise/cfdg/colourful_neuronal_network.cfdg +32 -0
- data/lib/image_paradise/cfdg/complex_city_plans.cfdg +75 -0
- data/lib/image_paradise/cfdg/complex_kritworks.cfdg +75 -0
- data/lib/image_paradise/cfdg/complex_snowflake.cfdg +61 -0
- data/lib/image_paradise/cfdg/conspiracy_theory.cfdg +104 -0
- data/lib/image_paradise/cfdg/constellation_grid.cfdg +29 -0
- data/lib/image_paradise/cfdg/cool_caterpillar.cfdg +44 -0
- data/lib/image_paradise/cfdg/coolcubes.cfdg +70 -0
- data/lib/image_paradise/cfdg/crawler_battle.cfdg +93 -0
- data/lib/image_paradise/cfdg/crazy_octo.cfdg +48 -0
- data/lib/image_paradise/cfdg/cthulhu.cfdg +166 -0
- data/lib/image_paradise/cfdg/cubies.cfdg +43 -0
- data/lib/image_paradise/cfdg/cubist_sunset.cfdg +55 -0
- data/lib/image_paradise/cfdg/curled_tree.cfdg +37 -0
- data/lib/image_paradise/cfdg/curls.cfdg +45 -0
- data/lib/image_paradise/cfdg/curve_stiched.cfdg +59 -0
- data/lib/image_paradise/cfdg/curved_tubes.cfdg +20 -0
- data/lib/image_paradise/cfdg/cylinder_city.cfdg +27 -0
- data/lib/image_paradise/cfdg/cymbal.cfdg +38 -0
- data/lib/image_paradise/cfdg/d_mustard.cfdg +52 -0
- data/lib/image_paradise/cfdg/dance_party.cfdg +81 -0
- data/lib/image_paradise/cfdg/dance_party_and_background.cfdg +86 -0
- data/lib/image_paradise/cfdg/decreasing_aperture.cfdg +16 -0
- data/lib/image_paradise/cfdg/delicat_twist.cfdg +13 -0
- data/lib/image_paradise/cfdg/demo_text.cfdg +22 -0
- data/lib/image_paradise/cfdg/dennis_ritchie.cfdg +294 -0
- data/lib/image_paradise/cfdg/diablo.cfdg +47 -0
- data/lib/image_paradise/cfdg/different_flowers.cfdg +60 -0
- data/lib/image_paradise/cfdg/different_snowflakes_shapes.cfdg +149 -0
- data/lib/image_paradise/cfdg/dimensions.cfdg +33 -0
- data/lib/image_paradise/cfdg/domino_pieces.cfdg +166 -0
- data/lib/image_paradise/cfdg/dong.cfdg +41 -0
- data/lib/image_paradise/cfdg/drip_shape.cfdg +24 -0
- data/lib/image_paradise/cfdg/earthday2007b.cfdg +49 -0
- data/lib/image_paradise/cfdg/edera_circles.cfdg +55 -0
- data/lib/image_paradise/cfdg/eight_queens_problem.cfdg +85 -0
- data/lib/image_paradise/cfdg/electro_shock.cfdg +88 -0
- data/lib/image_paradise/cfdg/enter_the_force_field.cfdg +56 -0
- data/lib/image_paradise/cfdg/escargot_fleur.cfdg +98 -0
- data/lib/image_paradise/cfdg/european_city.cfdg +63 -0
- data/lib/image_paradise/cfdg/evil_eye.cfdg +74 -0
- data/lib/image_paradise/cfdg/evolving_coloured_spots.cfdg +47 -0
- data/lib/image_paradise/cfdg/excellines_nr2.cfdg +171 -0
- data/lib/image_paradise/cfdg/exoplanet_settlement.cfdg +117 -0
- data/lib/image_paradise/cfdg/explosion.cfdg +45 -0
- data/lib/image_paradise/cfdg/explosion_of_a_megabyte.cfdg +73 -0
- data/lib/image_paradise/cfdg/eye_of_katora.cfdg +20 -0
- data/lib/image_paradise/cfdg/family_tree.cfdg +169 -0
- data/lib/image_paradise/cfdg/feathers.cfdg +17 -0
- data/lib/image_paradise/cfdg/ferma_drawings.cfdg +23 -0
- data/lib/image_paradise/cfdg/fevrier.cfdg +66 -0
- data/lib/image_paradise/cfdg/fibmod.cfdg +25 -0
- data/lib/image_paradise/cfdg/field_of_boxes.cfdg +21 -0
- data/lib/image_paradise/cfdg/finetre.cfdg +34 -0
- data/lib/image_paradise/cfdg/fireblorks.cfdg +37 -0
- data/lib/image_paradise/cfdg/first_branch.cfdg +18 -0
- data/lib/image_paradise/cfdg/fish_with_coloured_bubbles.cfdg +77 -0
- data/lib/image_paradise/cfdg/fishing_lure.cfdg +30 -0
- data/lib/image_paradise/cfdg/flake.cfdg +20 -0
- data/lib/image_paradise/cfdg/flaming_spiro.cfdg +10 -0
- data/lib/image_paradise/cfdg/fleshflower.cfdg +25 -0
- data/lib/image_paradise/cfdg/flourescent_fish_btp.cfdg +48 -0
- data/lib/image_paradise/cfdg/flow_control_shape.cfdg +45 -0
- data/lib/image_paradise/cfdg/flower_galaxy.cfdg +57 -0
- data/lib/image_paradise/cfdg/flower_house.cfdg +115 -0
- data/lib/image_paradise/cfdg/flower_stories.cfdg +136 -0
- data/lib/image_paradise/cfdg/fluctuating_heart.cfdg +87 -0
- data/lib/image_paradise/cfdg/fly_agaric.cfdg +22 -0
- data/lib/image_paradise/cfdg/forest_and_ocean.cfdg +65 -0
- data/lib/image_paradise/cfdg/fractal_fern.cfdg +15 -0
- data/lib/image_paradise/cfdg/fractal_shell.cfdg +36 -0
- data/lib/image_paradise/cfdg/frost_bite.cfdg +23 -0
- data/lib/image_paradise/cfdg/fun_with_paper.cfdg +17 -0
- data/lib/image_paradise/cfdg/func_plot.cfdg +59 -0
- data/lib/image_paradise/cfdg/funky_squiggle.cfdg +40 -0
- data/lib/image_paradise/cfdg/fuzzy_sun.cfdg +47 -0
- data/lib/image_paradise/cfdg/galaxy.cfdg +59 -0
- data/lib/image_paradise/cfdg/gallery.cfdg +28 -0
- data/lib/image_paradise/cfdg/game1_turn6.cfdg +35 -0
- data/lib/image_paradise/cfdg/garland.cfdg +42 -0
- data/lib/image_paradise/cfdg/general_polygons.cfdg +20 -0
- data/lib/image_paradise/cfdg/generational_birds.cfdg +118 -0
- data/lib/image_paradise/cfdg/ghostly_spine.cfdg +24 -0
- data/lib/image_paradise/cfdg/gift_wrapping.cfdg +46 -0
- data/lib/image_paradise/cfdg/glass_cubes.cfdg +33 -0
- data/lib/image_paradise/cfdg/gleaming_bush.cfdg +33 -0
- data/lib/image_paradise/cfdg/glowing_bush.cfdg +33 -0
- data/lib/image_paradise/cfdg/go_grid.cfdg +32 -0
- data/lib/image_paradise/cfdg/gold_tiles.cfdg +21 -0
- data/lib/image_paradise/cfdg/golden_rectangle.cfdg +19 -0
- data/lib/image_paradise/cfdg/golden_sierpinski.cfdg +49 -0
- data/lib/image_paradise/cfdg/golgi_stain.cfdg +74 -0
- data/lib/image_paradise/cfdg/gothic_bath_tiles.cfdg +14 -0
- data/lib/image_paradise/cfdg/grass_land.cfdg +112 -0
- data/lib/image_paradise/cfdg/gray_matter.cfdg +110 -0
- data/lib/image_paradise/cfdg/great_forest.cfdg +91 -0
- data/lib/image_paradise/cfdg/growth.cfdg +46 -0
- data/lib/image_paradise/cfdg/gumtree.cfdg +28 -0
- data/lib/image_paradise/cfdg/haggards_bull.cfdg +92 -0
- data/lib/image_paradise/cfdg/haight_ashbury.cfdg +882 -0
- data/lib/image_paradise/cfdg/hair_pattern.cfdg +59 -0
- data/lib/image_paradise/cfdg/hairy.cfdg +43 -0
- data/lib/image_paradise/cfdg/hairy_branch.cfdg +48 -0
- data/lib/image_paradise/cfdg/hands_and_feet.cfdg +49 -0
- data/lib/image_paradise/cfdg/happy_new_year.cfdg +3435 -0
- data/lib/image_paradise/cfdg/hatagu_lila_spiral.cfdg +27 -0
- data/lib/image_paradise/cfdg/hexaeder_triangle.cfdg +43 -0
- data/lib/image_paradise/cfdg/hexclouds_textures.cfdg +75 -0
- data/lib/image_paradise/cfdg/hextiles.cfdg +73 -0
- data/lib/image_paradise/cfdg/hexy_continent.cfdg +83 -0
- data/lib/image_paradise/cfdg/human_ballet.cfdg +215 -0
- data/lib/image_paradise/cfdg/human_eyes.cfdg +102 -0
- data/lib/image_paradise/cfdg/hydra_tail.cfdg +57 -0
- data/lib/image_paradise/cfdg/i_like_it_dirty.cfdg +88 -0
- data/lib/image_paradise/cfdg/i_pix.cfdg +679 -0
- data/lib/image_paradise/cfdg/imaginary_star.cfdg +55 -0
- data/lib/image_paradise/cfdg/imaginery_forest.cfdg +61 -0
- data/lib/image_paradise/cfdg/impossible_stairs.cfdg +211 -0
- data/lib/image_paradise/cfdg/in_the_morning.cfdg +83 -0
- data/lib/image_paradise/cfdg/inertial_confinement.cfdg +150 -0
- data/lib/image_paradise/cfdg/infected_shell.cfdg +56 -0
- data/lib/image_paradise/cfdg/insect_fight.cfdg +316 -0
- data/lib/image_paradise/cfdg/insectivore.cfdg +80 -0
- data/lib/image_paradise/cfdg/interference.cfdg +43 -0
- data/lib/image_paradise/cfdg/interference_fields.cfdg +25 -0
- data/lib/image_paradise/cfdg/into_the_deep.cfdg +96 -0
- data/lib/image_paradise/cfdg/inverted_decorations.cfdg +85 -0
- data/lib/image_paradise/cfdg/irregular_galaxies.cfdg +29 -0
- data/lib/image_paradise/cfdg/iso_blocks.cfdg +35 -0
- data/lib/image_paradise/cfdg/jewelry_old_style.cfdg +31 -0
- data/lib/image_paradise/cfdg/just_some_flowers.cfdg +127 -0
- data/lib/image_paradise/cfdg/kaboom.cfdg +40 -0
- data/lib/image_paradise/cfdg/kaleidoskop.cfdg +27 -0
- data/lib/image_paradise/cfdg/kama_sutra.cfdg +182 -0
- data/lib/image_paradise/cfdg/kitakoa_akiyoshi_illusions_roller.cfdg +40 -0
- data/lib/image_paradise/cfdg/koch_snowflake.cfdg +11 -0
- data/lib/image_paradise/cfdg/kochlea.cfdg +43 -0
- data/lib/image_paradise/cfdg/kreepykrawler.cfdg +48 -0
- data/lib/image_paradise/cfdg/kw_expanded_explosion.cfdg +46 -0
- data/lib/image_paradise/cfdg/lapsang_abstrait.cfdg +51 -0
- data/lib/image_paradise/cfdg/laser.cfdg +51 -0
- data/lib/image_paradise/cfdg/last_pluto_dream.cfdg +95 -0
- data/lib/image_paradise/cfdg/lazy_dust.cfdg +42 -0
- data/lib/image_paradise/cfdg/lesson_one_two_three_four.cfdg +217 -0
- data/lib/image_paradise/cfdg/lila_lili.cfdg +60 -0
- data/lib/image_paradise/cfdg/lindenmayergrassef2_pretty_flowers.cfdg +94 -0
- data/lib/image_paradise/cfdg/lines_from_excel.cfdg +136 -0
- data/lib/image_paradise/cfdg/looking_out.cfdg +51 -0
- data/lib/image_paradise/cfdg/looking_up_in_the_sky.cfdg +43 -0
- data/lib/image_paradise/cfdg/lotus_logo.cfdg +49 -0
- data/lib/image_paradise/cfdg/lowercased_alphabet.cfdg +565 -0
- data/lib/image_paradise/cfdg/luma_smiley.cfdg +563 -0
- data/lib/image_paradise/cfdg/maggi_stars.cfdg +11 -0
- data/lib/image_paradise/cfdg/mandelbrot_3.cfdg +111 -0
- data/lib/image_paradise/cfdg/martini.cfdg +147 -0
- data/lib/image_paradise/cfdg/material_studies.cfdg +172 -0
- data/lib/image_paradise/cfdg/math_eye.cfdg +30 -0
- data/lib/image_paradise/cfdg/matrix_freestyle.cfdg +127 -0
- data/lib/image_paradise/cfdg/maze.cfdg +211 -0
- data/lib/image_paradise/cfdg/meaculpo.cfdg +46 -0
- data/lib/image_paradise/cfdg/medieval_madness.cfdg +140 -0
- data/lib/image_paradise/cfdg/menage_a_trois.cfdg +77 -0
- data/lib/image_paradise/cfdg/micky_mouse.cfdg +75 -0
- data/lib/image_paradise/cfdg/mistletoe_forest.cfdg +62 -0
- data/lib/image_paradise/cfdg/mixed_simple_bubbles.cfdg +20 -0
- data/lib/image_paradise/cfdg/mod4g_starhole.cfdg +27 -0
- data/lib/image_paradise/cfdg/moebius.cfdg +57 -0
- data/lib/image_paradise/cfdg/molecules.cfdg +30 -0
- data/lib/image_paradise/cfdg/momos_blossom.cfdg +70 -0
- data/lib/image_paradise/cfdg/mona_lisa.cfdg +7937 -0
- data/lib/image_paradise/cfdg/more_arrows_in_quadcity.cfdg +49 -0
- data/lib/image_paradise/cfdg/more_cats.cfdg +1002 -0
- data/lib/image_paradise/cfdg/mosaic_for_2D_games.cfdg +69 -0
- data/lib/image_paradise/cfdg/mr_bezier.cfdg +195 -0
- data/lib/image_paradise/cfdg/mtree.cfdg +33 -0
- data/lib/image_paradise/cfdg/multiple_triangles.cfdg +13 -0
- data/lib/image_paradise/cfdg/mycel.cfdg +88 -0
- data/lib/image_paradise/cfdg/mytohexagone.cfdg +56 -0
- data/lib/image_paradise/cfdg/nature_is_not_like_that.cfdg +48 -0
- data/lib/image_paradise/cfdg/negative_flowers.cfdg +85 -0
- data/lib/image_paradise/cfdg/neo_town.cfdg +41 -0
- data/lib/image_paradise/cfdg/nesting_pattern.cfdg +34 -0
- data/lib/image_paradise/cfdg/neuronal_network.cfdg +94 -0
- data/lib/image_paradise/cfdg/neuronal_root.cfdg +46 -0
- data/lib/image_paradise/cfdg/night.cfdg +82 -0
- data/lib/image_paradise/cfdg/nightwalker.cfdg +23 -0
- data/lib/image_paradise/cfdg/no_xcape.cfdg +41 -0
- data/lib/image_paradise/cfdg/noise.cfdg +12 -0
- data/lib/image_paradise/cfdg/octopodi.cfdg +51 -0
- data/lib/image_paradise/cfdg/octopussy.cfdg +49 -0
- data/lib/image_paradise/cfdg/oldschool_cartoon_figure.cfdg +181 -0
- data/lib/image_paradise/cfdg/open_shapes.cfdg +240 -0
- data/lib/image_paradise/cfdg/orange_blossom.cfdg +57 -0
- data/lib/image_paradise/cfdg/orange_guts.cfdg +43 -0
- data/lib/image_paradise/cfdg/orange_monster.cfdg +42 -0
- data/lib/image_paradise/cfdg/organic.cfdg +30 -0
- data/lib/image_paradise/cfdg/ouo_happy_smiley.cfdg +45 -0
- data/lib/image_paradise/cfdg/output.png +0 -0
- data/lib/image_paradise/cfdg/pacman.cfdg +18 -0
- data/lib/image_paradise/cfdg/palmen.cfdg +162 -0
- data/lib/image_paradise/cfdg/pandoras_box.cfdg +53 -0
- data/lib/image_paradise/cfdg/papillon_butterfly.cfdg +28 -0
- data/lib/image_paradise/cfdg/patchwork.cfdg +32 -0
- data/lib/image_paradise/cfdg/pattern_grass.cfdg +110 -0
- data/lib/image_paradise/cfdg/peau_de_grenouille.cfdg +16 -0
- data/lib/image_paradise/cfdg/penrose_tiling.cfdg +102 -0
- data/lib/image_paradise/cfdg/pentagon.cfdg +68 -0
- data/lib/image_paradise/cfdg/pentagons.cfdg +25 -0
- data/lib/image_paradise/cfdg/perspective_tsunami.cfdg +20 -0
- data/lib/image_paradise/cfdg/phi_cloud.cfdg +23 -0
- data/lib/image_paradise/cfdg/picnic_birds_eye_view.cfdg +132 -0
- data/lib/image_paradise/cfdg/ping_pong.cfdg +29 -0
- data/lib/image_paradise/cfdg/pink_blossom.cfdg +58 -0
- data/lib/image_paradise/cfdg/piupole.cfdg +77 -0
- data/lib/image_paradise/cfdg/plotting.cfdg +61 -0
- data/lib/image_paradise/cfdg/point_onto_root.cfdg +64 -0
- data/lib/image_paradise/cfdg/primitive_reptile_pattern.cfdg +96 -0
- data/lib/image_paradise/cfdg/psycho_knot.cfdg +20 -0
- data/lib/image_paradise/cfdg/pyramide.cfdg +67 -0
- data/lib/image_paradise/cfdg/pythagoras_puzzle.cfdg +17 -0
- data/lib/image_paradise/cfdg/pythagorean_tree.cfdg +70 -0
- data/lib/image_paradise/cfdg/qimica.cfdg +64 -0
- data/lib/image_paradise/cfdg/quad_green_satellite.cfdg +53 -0
- data/lib/image_paradise/cfdg/quadcity.cfdg +24 -0
- data/lib/image_paradise/cfdg/quiet_wood_town.cfdg +195 -0
- data/lib/image_paradise/cfdg/r180.cfdg +26 -0
- data/lib/image_paradise/cfdg/r45.cfdg +26 -0
- data/lib/image_paradise/cfdg/r_square.cfdg +36 -0
- data/lib/image_paradise/cfdg/rads.cfdg +33 -0
- data/lib/image_paradise/cfdg/rainbow_black_hole.cfdg +9 -0
- data/lib/image_paradise/cfdg/rainbow_sun.cfdg +9 -0
- data/lib/image_paradise/cfdg/random_handwriting.cfdg +50 -0
- data/lib/image_paradise/cfdg/random_tile_shapes_jens_revisited.cfdg +146 -0
- data/lib/image_paradise/cfdg/rays_attack.cfdg +29 -0
- data/lib/image_paradise/cfdg/razpad.cfdg +20 -0
- data/lib/image_paradise/cfdg/rectangular_distortion.cfdg +169 -0
- data/lib/image_paradise/cfdg/recurse_path.cfdg +38 -0
- data/lib/image_paradise/cfdg/red_flurry.cfdg +64 -0
- data/lib/image_paradise/cfdg/red_horse_tail.cfdg +36 -0
- data/lib/image_paradise/cfdg/red_yellow_mosaic.cfdg +26 -0
- data/lib/image_paradise/cfdg/rendering_tests.cfdg +183 -0
- data/lib/image_paradise/cfdg/repeat_floor_tile_pattern.cfdg +153 -0
- data/lib/image_paradise/cfdg/repeat_tile.cfdg +160 -0
- data/lib/image_paradise/cfdg/retro_disc.cfdg +736 -0
- data/lib/image_paradise/cfdg/ring_growth_variation.cfdg +41 -0
- data/lib/image_paradise/cfdg/robot_nightlife.cfdg +25 -0
- data/lib/image_paradise/cfdg/rolled_firespiral.cfdg +34 -0
- data/lib/image_paradise/cfdg/rose.cfdg +44 -0
- data/lib/image_paradise/cfdg/round_tree.cfdg +121 -0
- data/lib/image_paradise/cfdg/rubiks_cube.cfdg +120 -0
- data/lib/image_paradise/cfdg/ruins.cfdg +19 -0
- data/lib/image_paradise/cfdg/sails_and_the_sea.cfdg +27 -0
- data/lib/image_paradise/cfdg/salt_crystals.cfdg +26 -0
- data/lib/image_paradise/cfdg/saturn.cfdg +105 -0
- data/lib/image_paradise/cfdg/scary_pot.cfdg +49 -0
- data/lib/image_paradise/cfdg/schematic_worm.cfdg +35 -0
- data/lib/image_paradise/cfdg/school_script.cfdg +359 -0
- data/lib/image_paradise/cfdg/seahorse.cfdg +78 -0
- data/lib/image_paradise/cfdg/seasons.cfdg +115 -0
- data/lib/image_paradise/cfdg/segmental_veins.cfdg +66 -0
- data/lib/image_paradise/cfdg/select_mayhem.cfdg +28 -0
- data/lib/image_paradise/cfdg/seven_folded_symmetry.cfdg +7 -0
- data/lib/image_paradise/cfdg/several_cats.cfdg +996 -0
- data/lib/image_paradise/cfdg/shadow_box.cfdg +49 -0
- data/lib/image_paradise/cfdg/shadowrun_google_maps.cfdg +66 -0
- data/lib/image_paradise/cfdg/shadowrun_nightline.cfdg +18 -0
- data/lib/image_paradise/cfdg/shards.cfdg +70 -0
- data/lib/image_paradise/cfdg/sheet_music.cfdg +213 -0
- data/lib/image_paradise/cfdg/shy_guy.cfdg +886 -0
- data/lib/image_paradise/cfdg/sierpinski1.cfdg +41 -0
- data/lib/image_paradise/cfdg/sierpinski2.cfdg +34 -0
- data/lib/image_paradise/cfdg/sierpinski_like_red_swirl.cfdg +46 -0
- data/lib/image_paradise/cfdg/sierpinsktri.cfdg +9 -0
- data/lib/image_paradise/cfdg/silk_flowers.cfdg +68 -0
- data/lib/image_paradise/cfdg/silk_scarf.cfdg +18 -0
- data/lib/image_paradise/cfdg/simple_cilia.cfdg +88 -0
- data/lib/image_paradise/cfdg/simple_circle_and_square.cfdg +7 -0
- data/lib/image_paradise/cfdg/simple_coloured_square.cfdg +38 -0
- data/lib/image_paradise/cfdg/simple_ferns.cfdg +40 -0
- data/lib/image_paradise/cfdg/simple_fish.cfdg +77 -0
- data/lib/image_paradise/cfdg/simple_orchid.cfdg +23 -0
- data/lib/image_paradise/cfdg/simple_rounded_colour_wheel.cfdg +10 -0
- data/lib/image_paradise/cfdg/simple_sheet_music.cfdg +27 -0
- data/lib/image_paradise/cfdg/sincos_pattern_2.cfdg +42 -0
- data/lib/image_paradise/cfdg/singing_birdy.cfdg +112 -0
- data/lib/image_paradise/cfdg/skyscraper.cfdg +85 -0
- data/lib/image_paradise/cfdg/small_golden_rectangle.cfdg +12 -0
- data/lib/image_paradise/cfdg/smells_like_layered.cfdg +43 -0
- data/lib/image_paradise/cfdg/snowflake.cfdg +26 -0
- data/lib/image_paradise/cfdg/snowstorm.cfdg +26 -0
- data/lib/image_paradise/cfdg/soar_on_wings.cfdg +8 -0
- data/lib/image_paradise/cfdg/soft_core.cfdg +26 -0
- data/lib/image_paradise/cfdg/soft_touch.cfdg +20 -0
- data/lib/image_paradise/cfdg/some_sort_of_tree.cfdg +57 -0
- data/lib/image_paradise/cfdg/spade_ball.cfdg +39 -0
- data/lib/image_paradise/cfdg/sparks.cfdg +39 -0
- data/lib/image_paradise/cfdg/sperm.cfdg +63 -0
- data/lib/image_paradise/cfdg/sphinx.cfdg +17 -0
- data/lib/image_paradise/cfdg/spiral_clusters.cfdg +29 -0
- data/lib/image_paradise/cfdg/spiral_cross.cfdg +27 -0
- data/lib/image_paradise/cfdg/spiral_star.cfdg +19 -0
- data/lib/image_paradise/cfdg/spiral_sun.cfdg +39 -0
- data/lib/image_paradise/cfdg/spirit.cfdg +47 -0
- data/lib/image_paradise/cfdg/splatter_tree.cfdg +61 -0
- data/lib/image_paradise/cfdg/spliced.cfdg +27 -0
- data/lib/image_paradise/cfdg/spring_parade.cfdg +105 -0
- data/lib/image_paradise/cfdg/sprinkle_explosion.cfdg +23 -0
- data/lib/image_paradise/cfdg/square_limit_one.cfdg +15 -0
- data/lib/image_paradise/cfdg/square_rose.cfdg +75 -0
- data/lib/image_paradise/cfdg/square_spiral4.cfdg +41 -0
- data/lib/image_paradise/cfdg/square_star.cfdg +39 -0
- data/lib/image_paradise/cfdg/squiggle.cfdg +54 -0
- data/lib/image_paradise/cfdg/stacked_blob.cfdg +27 -0
- data/lib/image_paradise/cfdg/star_explosion.cfdg +38 -0
- data/lib/image_paradise/cfdg/star_flower.cfdg +72 -0
- data/lib/image_paradise/cfdg/star_mosaic_2007.cfdg +51 -0
- data/lib/image_paradise/cfdg/starry_pines.cfdg +79 -0
- data/lib/image_paradise/cfdg/stars_tentacles.cfdg +28 -0
- data/lib/image_paradise/cfdg/starshape.cfdg +57 -0
- data/lib/image_paradise/cfdg/strange_antlers.cfdg +49 -0
- data/lib/image_paradise/cfdg/strange_carpet.cfdg +13 -0
- data/lib/image_paradise/cfdg/sunset_city.cfdg +112 -0
- data/lib/image_paradise/cfdg/sweep.cfdg +946 -0
- data/lib/image_paradise/cfdg/swimmers_sperms.cfdg +54 -0
- data/lib/image_paradise/cfdg/sword.cfdg +24 -0
- data/lib/image_paradise/cfdg/tangle.cfdg +25 -0
- data/lib/image_paradise/cfdg/tapestry.cfdg +40 -0
- data/lib/image_paradise/cfdg/tasty_loops.cfdg +97 -0
- data/lib/image_paradise/cfdg/tendril.cfdg +6 -0
- data/lib/image_paradise/cfdg/tentacle_tree.cfdg +57 -0
- data/lib/image_paradise/cfdg/terraforming.cfdg +87 -0
- data/lib/image_paradise/cfdg/test.cfdg +7 -0
- data/lib/image_paradise/cfdg/tetris.cfdg +123 -0
- data/lib/image_paradise/cfdg/textured_giraffes.cfdg +122 -0
- data/lib/image_paradise/cfdg/the_eye.cfdg +16 -0
- data/lib/image_paradise/cfdg/the_go_game.cfdg +81 -0
- data/lib/image_paradise/cfdg/the_secret.cfdg +52 -0
- data/lib/image_paradise/cfdg/the_third_eye.cfdg +42 -0
- data/lib/image_paradise/cfdg/thingy.cfdg +13 -0
- data/lib/image_paradise/cfdg/thorns.cfdg +26 -0
- data/lib/image_paradise/cfdg/too_many_notes.cfdg +155 -0
- data/lib/image_paradise/cfdg/top_down_plant_root.cfdg +43 -0
- data/lib/image_paradise/cfdg/top_view_tree.cfdg +79 -0
- data/lib/image_paradise/cfdg/transparent_heart.cfdg +31 -0
- data/lib/image_paradise/cfdg/tree.cfdg +68 -0
- data/lib/image_paradise/cfdg/tree_number_5.cfdg +28 -0
- data/lib/image_paradise/cfdg/tree_retro.cfdg +46 -0
- data/lib/image_paradise/cfdg/tree_spiral.cfdg +52 -0
- data/lib/image_paradise/cfdg/treematic.cfdg +42 -0
- data/lib/image_paradise/cfdg/tri_arc.cfdg +16 -0
- data/lib/image_paradise/cfdg/tri_squares.cfdg +7 -0
- data/lib/image_paradise/cfdg/tube_map.cfdg +112 -0
- data/lib/image_paradise/cfdg/turing_morphogenesis.cfdg +788 -0
- data/lib/image_paradise/cfdg/twisted_hex_grid.cfdg +26 -0
- data/lib/image_paradise/cfdg/twisty_triangel.cfdg +79 -0
- data/lib/image_paradise/cfdg/twizeeded.cfdg +19 -0
- data/lib/image_paradise/cfdg/uncontrolled_fungus.cfdg +36 -0
- data/lib/image_paradise/cfdg/underground.cfdg +72 -0
- data/lib/image_paradise/cfdg/underwater.cfdg +75 -0
- data/lib/image_paradise/cfdg/unicorn_boi.cfdg +20 -0
- data/lib/image_paradise/cfdg/unification_sign.cfdg +52 -0
- data/lib/image_paradise/cfdg/urban_connections.cfdg +44 -0
- data/lib/image_paradise/cfdg/us_flag.cfdg +109 -0
- data/lib/image_paradise/cfdg/v_null.cfdg +89 -0
- data/lib/image_paradise/cfdg/very_simple_flower.cfdg +45 -0
- data/lib/image_paradise/cfdg/very_simple_hexagon.cfdg +16 -0
- data/lib/image_paradise/cfdg/very_simple_octagon.cfg +13 -0
- data/lib/image_paradise/cfdg/vigorous_vine.cfdg +45 -0
- data/lib/image_paradise/cfdg/ville_topview.cfdg +70 -0
- data/lib/image_paradise/cfdg/vine.cfdg +176 -0
- data/lib/image_paradise/cfdg/vinyl.cfdg +12 -0
- data/lib/image_paradise/cfdg/violet_ribbons.cfdg +45 -0
- data/lib/image_paradise/cfdg/voronoi_2.cfdg +61 -0
- data/lib/image_paradise/cfdg/wald.cfdg +46 -0
- data/lib/image_paradise/cfdg/water_ink.cfdg +71 -0
- data/lib/image_paradise/cfdg/water_monster.cfdg +33 -0
- data/lib/image_paradise/cfdg/web.cfdg +53 -0
- data/lib/image_paradise/cfdg/weighting_demo.cfdg +16 -0
- data/lib/image_paradise/cfdg/weird_spots.cfdg +15 -0
- data/lib/image_paradise/cfdg/welcome.cfdg +109 -0
- data/lib/image_paradise/cfdg/where_do_you_want_to_go_today.cfdg +632 -0
- data/lib/image_paradise/cfdg/where_is_the_head.cfdg +28 -0
- data/lib/image_paradise/cfdg/where_to_go.cfdg +62 -0
- data/lib/image_paradise/cfdg/willow.cfdg +39 -0
- data/lib/image_paradise/cfdg/witch_poison.cfdg +58 -0
- data/lib/image_paradise/cfdg/wooden_floor.cfdg +95 -0
- data/lib/image_paradise/cfdg/writhing.cfdg +15 -0
- data/lib/image_paradise/cfdg/wrooom_cars.cfdg +124 -0
- data/lib/image_paradise/cfdg/xmas_code.cfdg +101 -0
- data/lib/image_paradise/cfdg/xmas_tree.cfdg +70 -0
- data/lib/image_paradise/cfdg/yellow_cactus.cfdg +52 -0
- data/lib/image_paradise/cfdg/yet_another_explosion.cfdg +46 -0
- data/lib/image_paradise/cfdg/yin_yang_taijitu_pattern.cfdg +44 -0
- data/lib/image_paradise/cfdg/yog.cfdg +27 -0
- data/lib/image_paradise/cfdg/yurbanis_m.cfdg +27 -0
- data/lib/image_paradise/cfdg/zen_tree.cfdg +79 -0
- data/lib/image_paradise/cfdg/ziggy_flowers.cfdg +44 -0
- data/lib/image_paradise/cfdg/zodiac.cfdg +43 -0
- data/lib/image_paradise/chunky_png/chunky_png.rb +54 -0
- data/lib/image_paradise/colours/colours.rb +46 -0
- data/lib/image_paradise/confree_generator/confree_generator.rb +791 -0
- data/lib/image_paradise/confree_generator/constants.rb +93 -0
- data/lib/image_paradise/constants/constants.rb +50 -0
- data/lib/image_paradise/constants/image_file_types.rb +26 -0
- data/lib/image_paradise/crop/crop.rb +429 -0
- data/lib/image_paradise/gm_support.rb +34 -0
- data/lib/image_paradise/graphs/accumulator_bar.rb +29 -0
- data/lib/image_paradise/graphs/area.rb +64 -0
- data/lib/image_paradise/graphs/bar.rb +117 -0
- data/lib/image_paradise/graphs/bar_conversion.rb +53 -0
- data/lib/image_paradise/graphs/base.rb +1392 -0
- data/lib/image_paradise/graphs/bezier.rb +45 -0
- data/lib/image_paradise/graphs/bullet.rb +115 -0
- data/lib/image_paradise/graphs/deprecated.rb +42 -0
- data/lib/image_paradise/graphs/dot.rb +129 -0
- data/lib/image_paradise/graphs/line.rb +328 -0
- data/lib/image_paradise/graphs/mini/bar.rb +42 -0
- data/lib/image_paradise/graphs/mini/legend.rb +109 -0
- data/lib/image_paradise/graphs/mini/pie.rb +42 -0
- data/lib/image_paradise/graphs/mini/side_bar.rb +41 -0
- data/lib/image_paradise/graphs/net.rb +133 -0
- data/lib/image_paradise/graphs/photo_bar.rb +106 -0
- data/lib/image_paradise/graphs/pie.rb +139 -0
- data/lib/image_paradise/graphs/scatter.rb +264 -0
- data/lib/image_paradise/graphs/scene.rb +216 -0
- data/lib/image_paradise/graphs/side_bar.rb +144 -0
- data/lib/image_paradise/graphs/side_stacked_bar.rb +116 -0
- data/lib/image_paradise/graphs/spider.rb +163 -0
- data/lib/image_paradise/graphs/stacked_area.rb +73 -0
- data/lib/image_paradise/graphs/stacked_bar.rb +68 -0
- data/lib/image_paradise/graphs/stacked_mixin.rb +30 -0
- data/lib/image_paradise/graphs/themes.rb +117 -0
- data/lib/image_paradise/graphs.rb +36 -0
- data/lib/image_paradise/graphviz/README.md +2 -0
- data/lib/image_paradise/graphviz/generate_graphviz_image.rb +276 -0
- data/lib/image_paradise/gui/gtk3/cfdg_widget/cfdg_widget.rb +1452 -0
- data/lib/image_paradise/gui/gtk3/cfdg_widget/connect_skeleton.rb +46 -0
- data/lib/image_paradise/gui/gtk3/image_editor/connect_skeleton.rb +126 -0
- data/lib/image_paradise/gui/gtk3/image_editor/image_editor.rb +2003 -0
- data/lib/image_paradise/identify.rb +184 -0
- data/lib/image_paradise/image_paradise.rb +153 -0
- data/lib/image_paradise/image_to_ascii/image_to_ascii.rb +187 -0
- data/lib/image_paradise/image_to_pdf/image_to_pdf.rb +99 -0
- data/lib/image_paradise/label/README.md +2 -0
- data/lib/image_paradise/label/simple_label.rb +206 -0
- data/lib/image_paradise/logo/IMGUR_LOGO.png +0 -0
- data/lib/image_paradise/project/project.rb +30 -0
- data/lib/image_paradise/requires/common_base_requires.rb +17 -0
- data/lib/image_paradise/requires/require_colours.rb +9 -0
- data/lib/image_paradise/requires/require_gtk_components.rb +8 -0
- data/lib/image_paradise/requires/require_image_to_ascii.rb +7 -0
- data/lib/image_paradise/requires/require_the_image_paradise_project.rb +42 -0
- data/lib/image_paradise/requires/require_toplevel_methods.rb +21 -0
- data/lib/image_paradise/rotate/README.md +2 -0
- data/lib/image_paradise/rotate/rotate.rb +124 -0
- data/lib/image_paradise/shell/interactive.rb +156 -0
- data/lib/image_paradise/svg/README.md +5 -0
- data/lib/image_paradise/svg/circle.rb +106 -0
- data/lib/image_paradise/svg/feature.rb +48 -0
- data/lib/image_paradise/svg/rectangle.rb +154 -0
- data/lib/image_paradise/svg/svg.rb +102 -0
- data/lib/image_paradise/toplevel_methods/add_black_border_to_this_image.rb +94 -0
- data/lib/image_paradise/toplevel_methods/create_animated_gif.rb +49 -0
- data/lib/image_paradise/toplevel_methods/crop.rb +29 -0
- data/lib/image_paradise/toplevel_methods/e.rb +16 -0
- data/lib/image_paradise/toplevel_methods/esystem.rb +19 -0
- data/lib/image_paradise/toplevel_methods/extract_text_from_this_image.rb +56 -0
- data/lib/image_paradise/toplevel_methods/file_related_code.rb +48 -0
- data/lib/image_paradise/toplevel_methods/flip_image_left_right.rb +59 -0
- data/lib/image_paradise/toplevel_methods/font_related_methods.rb +62 -0
- data/lib/image_paradise/toplevel_methods/greyscale_this_image.rb +76 -0
- data/lib/image_paradise/toplevel_methods/gui.rb +19 -0
- data/lib/image_paradise/toplevel_methods/help.rb +30 -0
- data/lib/image_paradise/toplevel_methods/interlace.rb +33 -0
- data/lib/image_paradise/toplevel_methods/is_an_image_file.rb +18 -0
- data/lib/image_paradise/toplevel_methods/make_this_image_transparent.rb +40 -0
- data/lib/image_paradise/toplevel_methods/menu.rb +110 -0
- data/lib/image_paradise/toplevel_methods/merge_these_images.rb +49 -0
- data/lib/image_paradise/toplevel_methods/mirror_image.rb +28 -0
- data/lib/image_paradise/toplevel_methods/misc.rb +1407 -0
- data/lib/image_paradise/toplevel_methods/negate.rb +36 -0
- data/lib/image_paradise/toplevel_methods/png_to_svg.rb +38 -0
- data/lib/image_paradise/toplevel_methods/quality.rb +34 -0
- data/lib/image_paradise/toplevel_methods/resized.rb +43 -0
- data/lib/image_paradise/toplevel_methods/roebe.rb +323 -0
- data/lib/image_paradise/toplevel_methods/thumbnail.rb +54 -0
- data/lib/image_paradise/toplevel_methods/to_png.rb +106 -0
- data/lib/image_paradise/toplevel_methods/wallpaper.rb +51 -0
- data/lib/image_paradise/toplevel_methods/write_this_text.rb +89 -0
- data/lib/image_paradise/utility_scripts/black_white.rb +92 -0
- data/lib/image_paradise/utility_scripts/create_new_image.rb +110 -0
- data/lib/image_paradise/utility_scripts/image_border.rb +226 -0
- data/lib/image_paradise/utility_scripts/image_gallery/image_gallery.rb +283 -0
- data/lib/image_paradise/utility_scripts/image_manipulations.rb +316 -0
- data/lib/image_paradise/utility_scripts/magic_card_border.rb +215 -0
- data/lib/image_paradise/utility_scripts/optimizer.rb +452 -0
- data/lib/image_paradise/utility_scripts/random_text_to_image.rb +364 -0
- data/lib/image_paradise/utility_scripts/text_on_image.rb +311 -0
- data/lib/image_paradise/utility_scripts/to_gif.rb +93 -0
- data/lib/image_paradise/utility_scripts/to_jpg.rb +82 -0
- data/lib/image_paradise/version/version.rb +19 -0
- data/lib/image_paradise/www/cfdg.cgi +25 -0
- data/lib/image_paradise/www/imagemagick/imagemagick.cgi +266 -0
- data/lib/image_paradise/yaml/README.md +2 -0
- data/lib/image_paradise/yaml/arc.yml +0 -0
- data/lib/image_paradise/yaml/circle.yml +6 -0
- data/lib/image_paradise/yaml/rectangle.yml +6 -0
- data/lib/image_paradise.rb +5 -0
- data/test/16x16_red_square_image_for_testing.png +0 -0
- data/test/misc/README.md +3 -0
- data/test/misc/testing_filling_up_with_circles.rb +65 -0
- data/test/testing_confree_generator.rb +8 -0
- data/test/testing_crop.rb +19 -0
- data/test/testing_image_magick_commands.rb +39 -0
- data/test/testing_image_paradise.rb +49 -0
- data/test/testing_the_svg_component.html +261 -0
- data/test/testing_the_svg_component.rb +106 -0
- metadata +760 -0
|
@@ -0,0 +1,1452 @@
|
|
|
1
|
+
#!/usr/bin/ruby -w
|
|
2
|
+
# Encoding: UTF-8
|
|
3
|
+
# frozen_string_literal: true
|
|
4
|
+
# =========================================================================== #
|
|
5
|
+
# === ImageParadise::GUI::Gtk::CfdgWidget
|
|
6
|
+
# =========================================================================== #
|
|
7
|
+
# require 'image_paradise/gui/gtk3/gtk3_standalone/gtk3_standalone.rb'
|
|
8
|
+
# ImageParadise::GUI::Gtk::CfdgWidget.run
|
|
9
|
+
# =========================================================================== #
|
|
10
|
+
require 'gtk_paradise/require_gtk3'
|
|
11
|
+
|
|
12
|
+
module ImageParadise
|
|
13
|
+
|
|
14
|
+
module GUI
|
|
15
|
+
|
|
16
|
+
module Gtk
|
|
17
|
+
|
|
18
|
+
class CfdgWidget < ::Gtk::Box # === ImageParadise::GUI::Gtk::CfdgWidget
|
|
19
|
+
|
|
20
|
+
require 'gtk_paradise/requires/require_the_base_module.rb'
|
|
21
|
+
include ::Gtk::BaseModule
|
|
22
|
+
|
|
23
|
+
require 'gtk_paradise/widgets/gtk3/numbered_lines/numbered_lines.rb'
|
|
24
|
+
|
|
25
|
+
require 'image_paradise/project/project.rb'
|
|
26
|
+
require 'image_paradise/toplevel_methods/file_related_code.rb'
|
|
27
|
+
require 'image_paradise/confree_generator/confree_generator.rb'
|
|
28
|
+
require 'image_paradise/gui/gtk3/cfdg_widget/connect_skeleton.rb'
|
|
29
|
+
|
|
30
|
+
# ========================================================================= #
|
|
31
|
+
# === TITLE
|
|
32
|
+
# ========================================================================= #
|
|
33
|
+
TITLE = 'CFDG Widget'
|
|
34
|
+
|
|
35
|
+
# ========================================================================= #
|
|
36
|
+
# === WIDTH
|
|
37
|
+
# ========================================================================= #
|
|
38
|
+
WIDTH = '95% or minimum 680px'
|
|
39
|
+
|
|
40
|
+
# ========================================================================= #
|
|
41
|
+
# === HEIGHT
|
|
42
|
+
# ========================================================================= #
|
|
43
|
+
HEIGHT = '65% or minimum 300px'
|
|
44
|
+
|
|
45
|
+
# ========================================================================= #
|
|
46
|
+
# === USE_THIS_FONT
|
|
47
|
+
# ========================================================================= #
|
|
48
|
+
USE_THIS_FONT = :hack_16
|
|
49
|
+
|
|
50
|
+
# ========================================================================= #
|
|
51
|
+
# === LARGE_FONT
|
|
52
|
+
# ========================================================================= #
|
|
53
|
+
LARGE_FONT = :hack_28
|
|
54
|
+
|
|
55
|
+
# ========================================================================= #
|
|
56
|
+
# === SMALLER_FONT
|
|
57
|
+
# ========================================================================= #
|
|
58
|
+
SMALLER_FONT = :hack_14
|
|
59
|
+
|
|
60
|
+
# ========================================================================= #
|
|
61
|
+
# === IMG_DIRECTORY
|
|
62
|
+
#
|
|
63
|
+
# This constant only works for my home setup.
|
|
64
|
+
# ========================================================================= #
|
|
65
|
+
IMG_DIRECTORY = '/home/x/data/images/'
|
|
66
|
+
|
|
67
|
+
# ========================================================================= #
|
|
68
|
+
# === YOUR_FAVOURITE_EDITOR
|
|
69
|
+
#
|
|
70
|
+
# Easier constant "alias" to the editor in use.
|
|
71
|
+
# ========================================================================= #
|
|
72
|
+
YOUR_FAVOURITE_EDITOR = ::ImageParadise::ConfreeGenerator::YOUR_FAVOURITE_EDITOR
|
|
73
|
+
|
|
74
|
+
# ========================================================================= #
|
|
75
|
+
# === TOOLTIP_EDITOR
|
|
76
|
+
# ========================================================================= #
|
|
77
|
+
TOOLTIP_EDITOR = "Open the current <b>.cfdg</b> file in "\
|
|
78
|
+
"#{YOUR_FAVOURITE_EDITOR}."
|
|
79
|
+
|
|
80
|
+
# ========================================================================= #
|
|
81
|
+
# === initialize
|
|
82
|
+
# ========================================================================= #
|
|
83
|
+
def initialize(
|
|
84
|
+
commandline_arguments = ARGV,
|
|
85
|
+
run_already = true
|
|
86
|
+
)
|
|
87
|
+
super(:vertical)
|
|
88
|
+
reset
|
|
89
|
+
set_commandline_arguments(
|
|
90
|
+
commandline_arguments
|
|
91
|
+
)
|
|
92
|
+
run if run_already
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# ========================================================================= #
|
|
96
|
+
# === reset (reset tag)
|
|
97
|
+
# ========================================================================= #
|
|
98
|
+
def reset
|
|
99
|
+
reset_the_internal_variables
|
|
100
|
+
infer_the_namespace
|
|
101
|
+
# ======================================================================= #
|
|
102
|
+
# === @configuration
|
|
103
|
+
# ======================================================================= #
|
|
104
|
+
@configuration = [true, __dir__, namespace?]
|
|
105
|
+
# ======================================================================= #
|
|
106
|
+
# === Set the title, width, height and the font in use.
|
|
107
|
+
# ======================================================================= #
|
|
108
|
+
title_width_height_font(TITLE, WIDTH, HEIGHT, USE_THIS_FONT)
|
|
109
|
+
handle_CSS_rules
|
|
110
|
+
infer_the_size_automatically
|
|
111
|
+
reset_the_internal_state
|
|
112
|
+
# ======================================================================= #
|
|
113
|
+
# === @numbered_lines
|
|
114
|
+
# ======================================================================= #
|
|
115
|
+
@numbered_lines = return_numbered_lines_widget
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# ========================================================================= #
|
|
119
|
+
# === reset_the_internal_state
|
|
120
|
+
# ========================================================================= #
|
|
121
|
+
def reset_the_internal_state
|
|
122
|
+
# ======================================================================= #
|
|
123
|
+
# === @show_this_cfdg_file
|
|
124
|
+
# ======================================================================= #
|
|
125
|
+
@show_this_cfdg_file = path_to_the_cfdg_directory+'water_ink.cfdg'
|
|
126
|
+
# ======================================================================= #
|
|
127
|
+
# === @possible_resolutions
|
|
128
|
+
#
|
|
129
|
+
# The first entry should be the default variant. It presently defaults
|
|
130
|
+
# to the max-width and max-height.
|
|
131
|
+
# ======================================================================= #
|
|
132
|
+
@possible_resolutions = [
|
|
133
|
+
"#{width?}x#{height?}",
|
|
134
|
+
'600x300',
|
|
135
|
+
'600x400',
|
|
136
|
+
'640x480',
|
|
137
|
+
'640x640',
|
|
138
|
+
'800x300',
|
|
139
|
+
'800x800',
|
|
140
|
+
'900x400',
|
|
141
|
+
'1000x1000',
|
|
142
|
+
'1024x800',
|
|
143
|
+
'1200x860',
|
|
144
|
+
'1280x1024',
|
|
145
|
+
'1600x1600',
|
|
146
|
+
'1920x1080',
|
|
147
|
+
'2400x2400'
|
|
148
|
+
]
|
|
149
|
+
# ======================================================================= #
|
|
150
|
+
# === @output_file_location
|
|
151
|
+
# ======================================================================= #
|
|
152
|
+
@output_file_location = nil
|
|
153
|
+
# ======================================================================= #
|
|
154
|
+
# === @event_box_for_firefox
|
|
155
|
+
#
|
|
156
|
+
# The following event-box is only used on my home setup for now.
|
|
157
|
+
# ======================================================================= #
|
|
158
|
+
@event_box_for_firefox = nil
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# ========================================================================= #
|
|
162
|
+
# === create_combo_box
|
|
163
|
+
# ========================================================================= #
|
|
164
|
+
def create_combo_box
|
|
165
|
+
# ======================================================================= #
|
|
166
|
+
# === @combo_box
|
|
167
|
+
# ======================================================================= #
|
|
168
|
+
@combo_box = combo_box_text
|
|
169
|
+
#@combo_box.bblack1
|
|
170
|
+
@possible_resolutions.each { |entry|
|
|
171
|
+
@combo_box.append_text(entry)
|
|
172
|
+
}
|
|
173
|
+
@combo_box.active = 0
|
|
174
|
+
# @combo_box.set_halign(:center)
|
|
175
|
+
# @combo_box.set_hexpand(true)
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# ========================================================================= #
|
|
179
|
+
# === padding?
|
|
180
|
+
# ========================================================================= #
|
|
181
|
+
def padding?
|
|
182
|
+
0
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# ========================================================================= #
|
|
186
|
+
# === border_size?
|
|
187
|
+
# ========================================================================= #
|
|
188
|
+
def border_size?
|
|
189
|
+
2
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# ========================================================================= #
|
|
193
|
+
# === do_generate_all_cfdg_images
|
|
194
|
+
#
|
|
195
|
+
# This is the batch-generation part.
|
|
196
|
+
# ========================================================================= #
|
|
197
|
+
def do_generate_all_cfdg_images
|
|
198
|
+
::ImageParadise::ConfreeGenerator.batch_generate_all_images
|
|
199
|
+
end; alias create_batch_gallery do_generate_all_cfdg_images # === create_batch_gallery
|
|
200
|
+
|
|
201
|
+
# ========================================================================= #
|
|
202
|
+
# === create_image1
|
|
203
|
+
# ========================================================================= #
|
|
204
|
+
def create_image1
|
|
205
|
+
# ======================================================================= #
|
|
206
|
+
# === @image1
|
|
207
|
+
# ======================================================================= #
|
|
208
|
+
@image1 = image
|
|
209
|
+
@image1.bblack1
|
|
210
|
+
@image1.mar8px
|
|
211
|
+
@image1.hint =
|
|
212
|
+
'This area will show the main (rendered) '\
|
|
213
|
+
'image at hand.'
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# ========================================================================= #
|
|
217
|
+
# === create_skeleton (create tag, skeleton tag)
|
|
218
|
+
# ========================================================================= #
|
|
219
|
+
def create_skeleton
|
|
220
|
+
create_image1
|
|
221
|
+
create_combo_box
|
|
222
|
+
create_the_entries # Must come before we create the top-bar.
|
|
223
|
+
create_the_check_buttons # Must come before we create the top-bar.
|
|
224
|
+
create_the_buttons
|
|
225
|
+
create_the_checkboxes
|
|
226
|
+
create_the_labels
|
|
227
|
+
create_the_text_buffer
|
|
228
|
+
create_the_event_box_for_the_bluefish_editor
|
|
229
|
+
create_the_context_menu
|
|
230
|
+
create_the_text_view
|
|
231
|
+
create_the_event_box_for_the_browser
|
|
232
|
+
create_the_top_bar # Have this here last.
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# ========================================================================= #
|
|
236
|
+
# === create_the_widget_showing_the_rendered_image
|
|
237
|
+
# ========================================================================= #
|
|
238
|
+
def create_the_widget_showing_the_rendered_image
|
|
239
|
+
# ======================================================================= #
|
|
240
|
+
# Put that image, aka @image1, into the second scrolled window.
|
|
241
|
+
# ======================================================================= #
|
|
242
|
+
vbox = create_vbox
|
|
243
|
+
small_hbox = padded_hbox
|
|
244
|
+
small_hbox.minimal(return_the_spinner_on_top, 5)
|
|
245
|
+
tiny_hbox = create_hbox
|
|
246
|
+
tiny_hbox.maximal(@button_render_again)
|
|
247
|
+
tiny_hbox.minimal(@checkbox_automatically_render_this_cfdg)
|
|
248
|
+
small_hbox.maximal(tiny_hbox)
|
|
249
|
+
vbox.minimal(small_hbox)
|
|
250
|
+
vbox.maximal(@image1)
|
|
251
|
+
@scrolled_window2 = scrolled_window(vbox) { :always }
|
|
252
|
+
@scrolled_window2.width_height(300, 300)
|
|
253
|
+
@scrolled_window2.pad5px
|
|
254
|
+
return @scrolled_window2
|
|
255
|
+
end; alias return_widget2 create_the_widget_showing_the_rendered_image # === return_widget2
|
|
256
|
+
|
|
257
|
+
# ========================================================================= #
|
|
258
|
+
# === return_widget1
|
|
259
|
+
# ========================================================================= #
|
|
260
|
+
def return_widget1
|
|
261
|
+
hbox_containing_the_numbered_lines_and_text_view = hbox
|
|
262
|
+
# ======================================================================= #
|
|
263
|
+
# Add the widget containing the numbered lines and the text view.
|
|
264
|
+
# Then add the widget showing the rendered image.
|
|
265
|
+
# ======================================================================= #
|
|
266
|
+
hbox_containing_the_numbered_lines_and_text_view.maximal(return_the_widget_containing_the_numbered_lines_and_the_text_view, 1)
|
|
267
|
+
return hbox_containing_the_numbered_lines_and_text_view
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# ========================================================================= #
|
|
271
|
+
# === return_the_widget_containing_the_numbered_lines_and_the_text_view
|
|
272
|
+
# ========================================================================= #
|
|
273
|
+
def return_the_widget_containing_the_numbered_lines_and_the_text_view
|
|
274
|
+
outer_vbox = vbox
|
|
275
|
+
mini_hbox_containing_the_numbered_lines_and_the_text_view = gtk_hbox
|
|
276
|
+
_ = @numbered_lines
|
|
277
|
+
_.set_use_this_font(USE_THIS_FONT) # Sync the font in use here.
|
|
278
|
+
mini_hbox_containing_the_numbered_lines_and_the_text_view.minimal(_)
|
|
279
|
+
mini_hbox_containing_the_numbered_lines_and_the_text_view.maximal(@text_view)
|
|
280
|
+
# ======================================================================= #
|
|
281
|
+
# === @scrolled_window1
|
|
282
|
+
# ======================================================================= #
|
|
283
|
+
@scrolled_window1 = gtk_scrolled_window(
|
|
284
|
+
mini_hbox_containing_the_numbered_lines_and_the_text_view
|
|
285
|
+
) { :always }
|
|
286
|
+
@scrolled_window1.width_height(400, 800)
|
|
287
|
+
@scrolled_window1.bblack1
|
|
288
|
+
@scrolled_window1.pad2px
|
|
289
|
+
outer_vbox.minimal(@label_file_name_top, 1)
|
|
290
|
+
outer_vbox.maximal(@scrolled_window1)
|
|
291
|
+
return outer_vbox
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# ========================================================================= #
|
|
295
|
+
# === create_the_text_view
|
|
296
|
+
# ========================================================================= #
|
|
297
|
+
def create_the_text_view
|
|
298
|
+
# ======================================================================= #
|
|
299
|
+
# === @text_view
|
|
300
|
+
# ======================================================================= #
|
|
301
|
+
@text_view = text_view(@text_buffer)
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# ========================================================================= #
|
|
305
|
+
# === create_the_context_menu
|
|
306
|
+
# ========================================================================= #
|
|
307
|
+
def create_the_context_menu
|
|
308
|
+
# ======================================================================= #
|
|
309
|
+
# === @context_menu
|
|
310
|
+
# ======================================================================= #
|
|
311
|
+
@context_menu = create_context_menu(self) {{
|
|
312
|
+
actions: {
|
|
313
|
+
'• Render again': :do_render_again,
|
|
314
|
+
'• Render a random cfdg file': :do_use_a_new_random_cfdg_file
|
|
315
|
+
}
|
|
316
|
+
}}
|
|
317
|
+
@context_menu.use_this_font = main_font?
|
|
318
|
+
@context_menu.css_class('bblack3_and_padding')
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
# ========================================================================= #
|
|
322
|
+
# === create_the_text_buffer
|
|
323
|
+
# ========================================================================= #
|
|
324
|
+
def create_the_text_buffer
|
|
325
|
+
@text_buffer = text_buffer
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# ========================================================================= #
|
|
329
|
+
# === create_the_event_box_for_the_bluefish_editor
|
|
330
|
+
# ========================================================================= #
|
|
331
|
+
def create_the_event_box_for_the_bluefish_editor
|
|
332
|
+
image_bluefish = gtk_image # Will be "filled" lateron.
|
|
333
|
+
target_file = IMG_DIRECTORY+'/PC/EDITORS/BLUEFISH/BLUEFISH.png'
|
|
334
|
+
if File.exist? target_file
|
|
335
|
+
image_bluefish.set_from_file(target_file)
|
|
336
|
+
else
|
|
337
|
+
# ===================================================================== #
|
|
338
|
+
# In this case we will use a custom image from the stock-items. This
|
|
339
|
+
# will be the default for other users.
|
|
340
|
+
# ===================================================================== #
|
|
341
|
+
# image_bluefish.set(image_document_open, 25,25)
|
|
342
|
+
image_bluefish.set_pixbuf(
|
|
343
|
+
icon_theme_default(:document_open, 25), 25, 25
|
|
344
|
+
)
|
|
345
|
+
end
|
|
346
|
+
# ======================================================================= #
|
|
347
|
+
# === @event_box_for_the_bluefish_editor
|
|
348
|
+
# ======================================================================= #
|
|
349
|
+
@event_box_for_the_bluefish_editor = event_box
|
|
350
|
+
@event_box_for_the_bluefish_editor.add(image_bluefish)
|
|
351
|
+
@event_box_for_the_bluefish_editor.bblack2
|
|
352
|
+
@event_box_for_the_bluefish_editor.hint = TOOLTIP_EDITOR
|
|
353
|
+
@event_box_for_the_bluefish_editor.on_clicked {
|
|
354
|
+
open_file_in_editor
|
|
355
|
+
}
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
# ========================================================================= #
|
|
359
|
+
# === do_use_a_new_random_cfdg_file
|
|
360
|
+
# ========================================================================= #
|
|
361
|
+
def do_use_a_new_random_cfdg_file
|
|
362
|
+
random_file = return_random_cfdg_file
|
|
363
|
+
use_this_cfdg_file(random_file)
|
|
364
|
+
if @checkbox_automatically_render_this_cfdg.is_checked?
|
|
365
|
+
do_render_the_cfdg_file
|
|
366
|
+
end
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
# ========================================================================= #
|
|
370
|
+
# === do_style_all_the_buttons_uniformly
|
|
371
|
+
# ========================================================================= #
|
|
372
|
+
def do_style_all_the_buttons_uniformly
|
|
373
|
+
return_all_buttons.each {|this_button|
|
|
374
|
+
this_button.bblack1
|
|
375
|
+
}
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# ========================================================================= #
|
|
379
|
+
# === current_buffer?
|
|
380
|
+
# ========================================================================= #
|
|
381
|
+
def current_buffer?
|
|
382
|
+
@text_buffer.text?
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
# ========================================================================= #
|
|
386
|
+
# === do_open_the_current_image_in_the_browser
|
|
387
|
+
# ========================================================================= #
|
|
388
|
+
def do_open_the_current_image_in_the_browser(
|
|
389
|
+
_ = @output_file_location
|
|
390
|
+
)
|
|
391
|
+
require 'open'
|
|
392
|
+
if _ and !_.empty?
|
|
393
|
+
e "Opening the image at #{_} next."
|
|
394
|
+
Open.in_browser(_)
|
|
395
|
+
else
|
|
396
|
+
e 'You first have to create a new image file. Click '\
|
|
397
|
+
'the run-button to generate a new image.'
|
|
398
|
+
end
|
|
399
|
+
end; alias open_firefox_tab do_open_the_current_image_in_the_browser # === open_firefox_tab
|
|
400
|
+
|
|
401
|
+
# ========================================================================= #
|
|
402
|
+
# === clear_buffer
|
|
403
|
+
#
|
|
404
|
+
# This method clears the buffer.
|
|
405
|
+
# ========================================================================= #
|
|
406
|
+
def clear_buffer
|
|
407
|
+
@text_buffer.text = ''
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
# ========================================================================= #
|
|
411
|
+
# === favicon?
|
|
412
|
+
# ========================================================================= #
|
|
413
|
+
def favicon?
|
|
414
|
+
'/home/x/data/images/ART/NEURONAL_HAND.png'
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
# ========================================================================= #
|
|
418
|
+
# === open_file_in_editor
|
|
419
|
+
#
|
|
420
|
+
# This method opens the cfdg file in your designated editor.
|
|
421
|
+
# ========================================================================= #
|
|
422
|
+
def open_file_in_editor(
|
|
423
|
+
this_file = @show_this_cfdg_file
|
|
424
|
+
)
|
|
425
|
+
_ = "#{YOUR_FAVOURITE_EDITOR} #{this_file}"
|
|
426
|
+
esystem _
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
# ========================================================================= #
|
|
430
|
+
# === set_source_buffer
|
|
431
|
+
#
|
|
432
|
+
# This simply sets the content for the @text_buffer variable.
|
|
433
|
+
# ========================================================================= #
|
|
434
|
+
def set_source_buffer(i = '')
|
|
435
|
+
@text_buffer.text = i
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
# ========================================================================= #
|
|
439
|
+
# === do_scramble_the_cfdg_content
|
|
440
|
+
#
|
|
441
|
+
# This will randomly "scramble" the cfdg content, then run the
|
|
442
|
+
# cfdg binary.
|
|
443
|
+
# ========================================================================= #
|
|
444
|
+
def do_scramble_the_cfdg_content
|
|
445
|
+
_ = @text_buffer.text?.dup
|
|
446
|
+
_.gsub!(/260/,'268')
|
|
447
|
+
_.gsub!(/100/,'105')
|
|
448
|
+
_.gsub!(/110/,'115')
|
|
449
|
+
_.gsub!(/#{rand(300)}/,"#{rand(300)}")
|
|
450
|
+
_.gsub!(/#{rand(300)}/,"#{rand(300)}")
|
|
451
|
+
_.gsub!(/#{rand(300)}/,"#{rand(300)}")
|
|
452
|
+
_.gsub!(/#{rand(300)}/,"#{rand(300)}")
|
|
453
|
+
_.gsub!(/#{rand(300)}/,"#{rand(300)}")
|
|
454
|
+
_.gsub!(/#{rand(300)}/,"#{rand(300)}")
|
|
455
|
+
_.gsub!(/#{rand(300)}/,"#{rand(300)}")
|
|
456
|
+
_.gsub!(/#{rand(300)}/,"#{rand(300)}")
|
|
457
|
+
_.gsub!(/90/,(95+rand(60)).to_s)
|
|
458
|
+
_.gsub!(/80/,(85+rand(50)).to_s)
|
|
459
|
+
_.gsub!(/70/,(70+rand(40)).to_s)
|
|
460
|
+
_.gsub!(/240/,(220+rand(40)).to_s)
|
|
461
|
+
_.gsub!(
|
|
462
|
+
/0.15/,
|
|
463
|
+
(0.10 + ( rand(100) /100.0 ) ).to_s
|
|
464
|
+
)
|
|
465
|
+
set_source_buffer(_)
|
|
466
|
+
do_run
|
|
467
|
+
end
|
|
468
|
+
|
|
469
|
+
# ========================================================================= #
|
|
470
|
+
# === create_the_labels
|
|
471
|
+
# ========================================================================= #
|
|
472
|
+
def create_the_labels
|
|
473
|
+
create_the_label_file_name_on_top
|
|
474
|
+
end
|
|
475
|
+
|
|
476
|
+
# ========================================================================= #
|
|
477
|
+
# === create_the_checkboxes
|
|
478
|
+
# ========================================================================= #
|
|
479
|
+
def create_the_checkboxes
|
|
480
|
+
# ======================================================================= #
|
|
481
|
+
# === @checkbox_automatically_render_this_cfdg
|
|
482
|
+
# ======================================================================= #
|
|
483
|
+
@checkbox_automatically_render_this_cfdg = checkbox { :is_checked }
|
|
484
|
+
@checkbox_automatically_render_this_cfdg.hint =
|
|
485
|
+
'If this checkbox is active then the image will be '\
|
|
486
|
+
'automatically rendered when a new .cfdg file is '\
|
|
487
|
+
'opened in the main buffer.'
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
# ========================================================================= #
|
|
491
|
+
# === set_width_and_height
|
|
492
|
+
# ========================================================================= #
|
|
493
|
+
def set_width_and_height(
|
|
494
|
+
i = '640x480'
|
|
495
|
+
)
|
|
496
|
+
if i.include?('x')
|
|
497
|
+
splitted = i.split('x')
|
|
498
|
+
width = splitted.first
|
|
499
|
+
height = splitted.last
|
|
500
|
+
@entry_width.set_text(width.to_s)
|
|
501
|
+
@entry_height.set_text(height.to_s)
|
|
502
|
+
end
|
|
503
|
+
end
|
|
504
|
+
|
|
505
|
+
# ========================================================================= #
|
|
506
|
+
# === create_the_entries (entries tag, entry tag)
|
|
507
|
+
# ========================================================================= #
|
|
508
|
+
def create_the_entries
|
|
509
|
+
# ======================================================================= #
|
|
510
|
+
# @entry_width is on the top.
|
|
511
|
+
# ======================================================================= #
|
|
512
|
+
@entry_width = entry
|
|
513
|
+
@entry_width.set_max_length(8)
|
|
514
|
+
@entry_width.center
|
|
515
|
+
# @entry_width.on_click_select_everything
|
|
516
|
+
@entry_width.lightgreen_background
|
|
517
|
+
@entry_width.bblack2
|
|
518
|
+
@entry_width.set_text(
|
|
519
|
+
::ImageParadise::ConfreeGenerator::DEFAULT_WIDTH.to_s
|
|
520
|
+
)
|
|
521
|
+
@entry_width.on_changed { |widget, event|
|
|
522
|
+
@entry_height.text = @entry_width.text if @button_check_coupled.active?
|
|
523
|
+
}
|
|
524
|
+
# ======================================================================= #
|
|
525
|
+
# === @entry_height
|
|
526
|
+
#
|
|
527
|
+
# The height entry comes next.
|
|
528
|
+
# ======================================================================= #
|
|
529
|
+
@entry_height = entry
|
|
530
|
+
@entry_height.set_max_length(8)
|
|
531
|
+
@entry_height.center
|
|
532
|
+
# @entry_height.on_click_select_everything
|
|
533
|
+
@entry_height.lightgreen_background
|
|
534
|
+
@entry_height.bblack2
|
|
535
|
+
@entry_height.set_text(
|
|
536
|
+
::ImageParadise::ConfreeGenerator::DEFAULT_HEIGHT.to_s
|
|
537
|
+
)
|
|
538
|
+
@entry_height.on_changed { |w,event|
|
|
539
|
+
if @button_check_coupled.active?
|
|
540
|
+
@entry_width.text = @entry_height.text
|
|
541
|
+
end
|
|
542
|
+
}
|
|
543
|
+
end
|
|
544
|
+
|
|
545
|
+
# ========================================================================= #
|
|
546
|
+
# === create_the_check_buttons
|
|
547
|
+
# ========================================================================= #
|
|
548
|
+
def create_the_check_buttons
|
|
549
|
+
# ======================================================================= #
|
|
550
|
+
# === @button_check_coupled
|
|
551
|
+
# ======================================================================= #
|
|
552
|
+
@button_check_coupled = check_button('Coupled')
|
|
553
|
+
@button_check_coupled.set_active(false)
|
|
554
|
+
@button_check_coupled.hint =
|
|
555
|
+
'Enabling this check-button will ensure that the width and height '\
|
|
556
|
+
'setting will remain the same (in sync). So if the width will be '\
|
|
557
|
+
'set to 500px then this means the height will also be set '\
|
|
558
|
+
'to 500px.'
|
|
559
|
+
end
|
|
560
|
+
|
|
561
|
+
# ========================================================================= #
|
|
562
|
+
# === run (run tag)
|
|
563
|
+
# ========================================================================= #
|
|
564
|
+
def run
|
|
565
|
+
super()
|
|
566
|
+
allow_the_combo_box_to_change_the__width_and_height_settings_on_changed_event
|
|
567
|
+
menu
|
|
568
|
+
# do_style_all_the_buttons_uniformly # This is no longer in use.
|
|
569
|
+
end
|
|
570
|
+
|
|
571
|
+
# ========================================================================= #
|
|
572
|
+
# === return_open_in_browser_widget
|
|
573
|
+
# ========================================================================= #
|
|
574
|
+
def return_open_in_browser_widget
|
|
575
|
+
# ======================================================================= #
|
|
576
|
+
# Next add the open-in-the-browser button
|
|
577
|
+
# ======================================================================= #
|
|
578
|
+
hbox = create_hbox
|
|
579
|
+
hbox.maximal(@button_open_in_the_browser, 1)
|
|
580
|
+
hbox.minimal(@event_box_for_firefox, 1) if @event_box_for_firefox
|
|
581
|
+
return hbox
|
|
582
|
+
end
|
|
583
|
+
|
|
584
|
+
# ========================================================================= #
|
|
585
|
+
# === program_exists?
|
|
586
|
+
#
|
|
587
|
+
# Find out whether a program exists or not.
|
|
588
|
+
# ========================================================================= #
|
|
589
|
+
def program_exists?(this_program)
|
|
590
|
+
does_program_exist = false # default is false
|
|
591
|
+
array_available_paths = [ ENV['SYSBIN'].to_s, '/usr/bin/']
|
|
592
|
+
array_available_paths.each { |path|
|
|
593
|
+
_ = path+'/'+this_program
|
|
594
|
+
does_program_exist = true if File.exist? _
|
|
595
|
+
}
|
|
596
|
+
return does_program_exist
|
|
597
|
+
end
|
|
598
|
+
|
|
599
|
+
# ========================================================================= #
|
|
600
|
+
# === use_this_cfdg_file
|
|
601
|
+
# ========================================================================= #
|
|
602
|
+
def use_this_cfdg_file(i = nil)
|
|
603
|
+
case i
|
|
604
|
+
when nil, 'default'
|
|
605
|
+
i = return_random_cfdg
|
|
606
|
+
end
|
|
607
|
+
if i and File.exist?(i)
|
|
608
|
+
# ===================================================================== #
|
|
609
|
+
# Update the @show_this_cfdg_file variable.
|
|
610
|
+
# ===================================================================== #
|
|
611
|
+
@show_this_cfdg_file = i
|
|
612
|
+
opn; e "A .cfdg file was found at: #{sfile(i)}."
|
|
613
|
+
@label_file_name_top.set_text(File.basename(i))
|
|
614
|
+
@label_file_name_top.is_selectable
|
|
615
|
+
dataset = File.read(i)
|
|
616
|
+
n_lines = dataset.split("\n").size
|
|
617
|
+
if n_lines < @numbered_lines.n_entries?
|
|
618
|
+
# =================================================================== #
|
|
619
|
+
# Chop it down in this case. This has a bug right now; I may have
|
|
620
|
+
# to improve on this at a later time.
|
|
621
|
+
# =================================================================== #
|
|
622
|
+
new_amount_of_lines = @numbered_lines.n_entries? - n_lines
|
|
623
|
+
@numbered_lines.hide_the_last_n_lines(
|
|
624
|
+
new_amount_of_lines
|
|
625
|
+
)
|
|
626
|
+
@numbered_lines.set_use_n_lines(n_lines)
|
|
627
|
+
end
|
|
628
|
+
@text_buffer.set_text(dataset) # Sync the content onto the main buffer as well.
|
|
629
|
+
end
|
|
630
|
+
end; alias set_file_location use_this_cfdg_file # === set_file_location
|
|
631
|
+
|
|
632
|
+
# ========================================================================= #
|
|
633
|
+
# === create_the_label_file_name_on_top
|
|
634
|
+
# ========================================================================= #
|
|
635
|
+
def create_the_label_file_name_on_top(
|
|
636
|
+
i = @show_this_cfdg_file
|
|
637
|
+
)
|
|
638
|
+
@label_file_name_top = label
|
|
639
|
+
@label_file_name_top.css_class('royalblue')
|
|
640
|
+
@label_file_name_top.set_font(:hack_20)
|
|
641
|
+
@label_file_name_top.make_bold
|
|
642
|
+
@label_file_name_top.left_align
|
|
643
|
+
@label_file_name_top.hint = 'This text will show the current '\
|
|
644
|
+
'active .cfdg file assigned. The text-view widget below '\
|
|
645
|
+
'this text holds the content of the .cfdg file.'
|
|
646
|
+
@label_file_name_top.set_text(
|
|
647
|
+
File.basename(i).to_s
|
|
648
|
+
)
|
|
649
|
+
end
|
|
650
|
+
|
|
651
|
+
# ========================================================================= #
|
|
652
|
+
# === return_all_cfdg_files
|
|
653
|
+
#
|
|
654
|
+
# This method will try to get all .cfdg files, except for
|
|
655
|
+
# all entries we stored in our Array at the top.
|
|
656
|
+
# ========================================================================= #
|
|
657
|
+
def return_all_cfdg_files(
|
|
658
|
+
i = path_to_the_cfdg_directory
|
|
659
|
+
)
|
|
660
|
+
Dir["#{i}*.cfdg"].sort
|
|
661
|
+
end
|
|
662
|
+
|
|
663
|
+
# ========================================================================= #
|
|
664
|
+
# === main_buffer?
|
|
665
|
+
# ========================================================================= #
|
|
666
|
+
def main_buffer?
|
|
667
|
+
@text_buffer
|
|
668
|
+
end; alias text_buffer? main_buffer? # === text_buffer?
|
|
669
|
+
|
|
670
|
+
# ========================================================================= #
|
|
671
|
+
# === menu (menu tag)
|
|
672
|
+
# ========================================================================= #
|
|
673
|
+
def menu(
|
|
674
|
+
i = commandline_arguments?
|
|
675
|
+
)
|
|
676
|
+
if i.is_a? Array
|
|
677
|
+
i.each {|entry| menu(entry) }
|
|
678
|
+
else
|
|
679
|
+
if i and File.exist?(i)
|
|
680
|
+
# =================================================================== #
|
|
681
|
+
# Load existing .cfdg files directly
|
|
682
|
+
# =================================================================== #
|
|
683
|
+
if i.end_with? '.cfdg'
|
|
684
|
+
use_this_cfdg_file(i)
|
|
685
|
+
end
|
|
686
|
+
end
|
|
687
|
+
end
|
|
688
|
+
end
|
|
689
|
+
|
|
690
|
+
# ========================================================================= #
|
|
691
|
+
# === return_widget4
|
|
692
|
+
# ========================================================================= #
|
|
693
|
+
def return_widget4
|
|
694
|
+
mini_vbox_with_several_buttons = default_grid
|
|
695
|
+
mini_vbox_with_several_buttons.left(
|
|
696
|
+
@button_batch_generate_all_cfdg_images
|
|
697
|
+
)
|
|
698
|
+
mini_vbox_with_several_buttons.middle(
|
|
699
|
+
@button_scramble
|
|
700
|
+
)
|
|
701
|
+
mini_vbox_with_several_buttons.right(
|
|
702
|
+
@event_box_for_the_bluefish_editor # This should come last.
|
|
703
|
+
)
|
|
704
|
+
# mini_vbox_with_several_buttons.new_row # .right() already does this.
|
|
705
|
+
mini_vbox_with_several_buttons.left(
|
|
706
|
+
@button_clear
|
|
707
|
+
)
|
|
708
|
+
mini_vbox_with_several_buttons.middle(
|
|
709
|
+
@button_run_cfdg
|
|
710
|
+
)
|
|
711
|
+
|
|
712
|
+
vbox_containing_the_insert_buttons_widget = create_vbox
|
|
713
|
+
vbox_containing_the_insert_buttons_widget.minimal(mini_vbox_with_several_buttons)
|
|
714
|
+
vbox_containing_the_insert_buttons_widget.minimal(gtk_hseparator, 1)
|
|
715
|
+
vbox_containing_the_insert_buttons_widget.minimal(return_the_insert_buttons_widget)
|
|
716
|
+
return vbox_containing_the_insert_buttons_widget
|
|
717
|
+
end
|
|
718
|
+
|
|
719
|
+
# ========================================================================= #
|
|
720
|
+
# === return_the_insert_buttons_widget
|
|
721
|
+
# ========================================================================= #
|
|
722
|
+
def return_the_insert_buttons_widget
|
|
723
|
+
# ======================================================================= #
|
|
724
|
+
# Next add a frame
|
|
725
|
+
# ======================================================================= #
|
|
726
|
+
frame = create_frame
|
|
727
|
+
# ======================================================================= #
|
|
728
|
+
# This frame is for the various insert-buttons. These insert-buttons
|
|
729
|
+
# will insert (or modify) lines at the current iter of the text-buffer.
|
|
730
|
+
# ======================================================================= #
|
|
731
|
+
frame.label = ' Insert Buttons '
|
|
732
|
+
frame.label_widget.make_bold
|
|
733
|
+
frame.set_border_width(2)
|
|
734
|
+
frame.pad5px
|
|
735
|
+
frame.hint = 'These small buttons allow you to insert '\
|
|
736
|
+
'commands into the text-buffer.'
|
|
737
|
+
|
|
738
|
+
small_hbox1 = gtk_hbox
|
|
739
|
+
# ======================================================================= #
|
|
740
|
+
# === :comment
|
|
741
|
+
#
|
|
742
|
+
# This method will insert a comment in the current iter.
|
|
743
|
+
# ======================================================================= #
|
|
744
|
+
button1 = button('A comment')
|
|
745
|
+
button1.use_this_font = SMALLER_FONT
|
|
746
|
+
button1.on_clicked {
|
|
747
|
+
main_buffer?.insert_at_cursor(
|
|
748
|
+
'# ============================================= #'+N
|
|
749
|
+
)
|
|
750
|
+
main_buffer?.insert_at_cursor('# '+N)
|
|
751
|
+
main_buffer?.insert_at_cursor(
|
|
752
|
+
'# ============================================= #'+N
|
|
753
|
+
)
|
|
754
|
+
}
|
|
755
|
+
small_hbox1.minimal(button1, 0)
|
|
756
|
+
|
|
757
|
+
# ======================================================================= #
|
|
758
|
+
# === :rect
|
|
759
|
+
# ======================================================================= #
|
|
760
|
+
button2 = button('A rectangle')
|
|
761
|
+
button2.use_this_font = SMALLER_FONT
|
|
762
|
+
button2.on_clicked {
|
|
763
|
+
main_buffer?.insert_at_cursor("RECT {}\n")
|
|
764
|
+
}
|
|
765
|
+
small_hbox1.minimal(button2, 0)
|
|
766
|
+
|
|
767
|
+
# ======================================================================= #
|
|
768
|
+
# === :triangle
|
|
769
|
+
# ======================================================================= #
|
|
770
|
+
button3 = button('A triangle')
|
|
771
|
+
button3.use_this_font = SMALLER_FONT
|
|
772
|
+
button3.on_clicked {
|
|
773
|
+
main_buffer?.insert_at_cursor("TRIANGLE {}\n")
|
|
774
|
+
}
|
|
775
|
+
small_hbox1.minimal(button3, 0)
|
|
776
|
+
|
|
777
|
+
small_hbox2 = gtk_hbox
|
|
778
|
+
# ======================================================================= #
|
|
779
|
+
# === :line
|
|
780
|
+
# ======================================================================= #
|
|
781
|
+
button4 = button('A line')
|
|
782
|
+
button4.use_this_font = SMALLER_FONT
|
|
783
|
+
button4.on_clicked {
|
|
784
|
+
main_buffer?.insert_at_cursor("LINE {}\n")
|
|
785
|
+
}
|
|
786
|
+
small_hbox2.minimal(button4, 0)
|
|
787
|
+
|
|
788
|
+
# ======================================================================= #
|
|
789
|
+
# === :circle
|
|
790
|
+
# ======================================================================= #
|
|
791
|
+
button5 = button('A circle')
|
|
792
|
+
button5.use_this_font = SMALLER_FONT
|
|
793
|
+
button5.on_clicked {
|
|
794
|
+
main_buffer?.insert_at_cursor("CIRCLE {}\n")
|
|
795
|
+
}
|
|
796
|
+
small_hbox2.minimal(button5, 0)
|
|
797
|
+
|
|
798
|
+
# ======================================================================= #
|
|
799
|
+
# === :hue
|
|
800
|
+
# ======================================================================= #
|
|
801
|
+
button6 = button('Hue setting')
|
|
802
|
+
button6.use_this_font = SMALLER_FONT
|
|
803
|
+
button6.on_clicked {
|
|
804
|
+
main_buffer?.insert_at_cursor(" hue 10 ")
|
|
805
|
+
}
|
|
806
|
+
small_hbox2.minimal(button6, 0)
|
|
807
|
+
|
|
808
|
+
small_hbox3 = gtk_hbox
|
|
809
|
+
|
|
810
|
+
# ======================================================================= #
|
|
811
|
+
# === :sat
|
|
812
|
+
# ======================================================================= #
|
|
813
|
+
button7 = button('Saturation setting')
|
|
814
|
+
button7.use_this_font = SMALLER_FONT
|
|
815
|
+
button7.on_clicked {
|
|
816
|
+
main_buffer?.insert_at_cursor(' sat 0.995 ')
|
|
817
|
+
}
|
|
818
|
+
small_hbox3.minimal(button7, 0)
|
|
819
|
+
|
|
820
|
+
# ======================================================================= #
|
|
821
|
+
# === :bold
|
|
822
|
+
# ======================================================================= #
|
|
823
|
+
button8 = button('Bold')
|
|
824
|
+
button8.use_this_font = SMALLER_FONT
|
|
825
|
+
button8.on_clicked {
|
|
826
|
+
main_buffer?.insert_at_cursor(' b 0.995 ')
|
|
827
|
+
}
|
|
828
|
+
small_hbox3.minimal(button8, 0)
|
|
829
|
+
|
|
830
|
+
# ======================================================================= #
|
|
831
|
+
# === :square
|
|
832
|
+
# ======================================================================= #
|
|
833
|
+
button9 = button('square')
|
|
834
|
+
button9.use_this_font = SMALLER_FONT
|
|
835
|
+
button9.on_clicked {
|
|
836
|
+
main_buffer?.insert_at_cursor('SQUARE {}')
|
|
837
|
+
}
|
|
838
|
+
small_hbox3.minimal(button9, 0)
|
|
839
|
+
|
|
840
|
+
small_hbox4 = gtk_hbox
|
|
841
|
+
# ======================================================================= #
|
|
842
|
+
# === :background
|
|
843
|
+
# ======================================================================= #
|
|
844
|
+
button10 = button('background')
|
|
845
|
+
button10.use_this_font = SMALLER_FONT
|
|
846
|
+
button10.on_clicked {
|
|
847
|
+
main_buffer?.insert_at_cursor('background { b -0.95 sat 1 hue 180 }')
|
|
848
|
+
}
|
|
849
|
+
small_hbox4.minimal(button10, 0)
|
|
850
|
+
|
|
851
|
+
# ======================================================================= #
|
|
852
|
+
# === :newline
|
|
853
|
+
# ======================================================================= #
|
|
854
|
+
button11 = button('newline')
|
|
855
|
+
button11.use_this_font = SMALLER_FONT
|
|
856
|
+
button11.on_clicked {
|
|
857
|
+
main_buffer?.insert_at_cursor("\n")
|
|
858
|
+
}
|
|
859
|
+
small_hbox4.minimal(button11, 0)
|
|
860
|
+
|
|
861
|
+
# ======================================================================= #
|
|
862
|
+
# Colourize these buttons next:
|
|
863
|
+
# ======================================================================= #
|
|
864
|
+
[ button1, button2, button3,
|
|
865
|
+
button4, button5, button6,
|
|
866
|
+
button7, button8, button9,
|
|
867
|
+
button10, button11
|
|
868
|
+
].each {|this_button|
|
|
869
|
+
this_button.clear_background
|
|
870
|
+
this_button.modify_background(:normal, :lightsteelblue)
|
|
871
|
+
this_button.modify_background(:active, :brown)
|
|
872
|
+
this_button.modify_background(:prelight, :bisque)
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
frame_padded_vbox = padded_vbox
|
|
876
|
+
frame_padded_vbox.minimal(small_hbox1, 4)
|
|
877
|
+
frame_padded_vbox.minimal(small_hbox2, 4)
|
|
878
|
+
frame_padded_vbox.minimal(small_hbox3, 4)
|
|
879
|
+
frame_padded_vbox.minimal(small_hbox4, 4)
|
|
880
|
+
frame.add(frame_padded_vbox)
|
|
881
|
+
mini_vbox = create_vbox
|
|
882
|
+
mini_vbox.minimal(frame, 1) # First add the frame.
|
|
883
|
+
mini_vbox.minimal(return_widget_containing_buttons_to_randomize_the_text_buffer, 5)
|
|
884
|
+
return mini_vbox
|
|
885
|
+
end
|
|
886
|
+
|
|
887
|
+
# ========================================================================= #
|
|
888
|
+
# === return_widget_containing_buttons_to_randomize_the_text_buffer
|
|
889
|
+
# ========================================================================= #
|
|
890
|
+
def return_widget_containing_buttons_to_randomize_the_text_buffer
|
|
891
|
+
_ = gtk_vbox
|
|
892
|
+
button1 = button('Randomize <b>hue</b>')
|
|
893
|
+
button1.clear_background
|
|
894
|
+
button1.on_hover(:lightgreen)
|
|
895
|
+
button1.on_clicked {
|
|
896
|
+
do_randomize_all_hue_entries
|
|
897
|
+
}
|
|
898
|
+
button1.do_markify
|
|
899
|
+
button1.hint = 'Click this button to randomly change all <b>hue</b> '\
|
|
900
|
+
'entries in the text-buffer.'
|
|
901
|
+
small_hbox1 = hbox
|
|
902
|
+
small_hbox1.minimal(button1, 0)
|
|
903
|
+
_.minimal(small_hbox1)
|
|
904
|
+
return _
|
|
905
|
+
end
|
|
906
|
+
|
|
907
|
+
# ========================================================================= #
|
|
908
|
+
# === update_the_main_image_with_this_path
|
|
909
|
+
# ========================================================================= #
|
|
910
|
+
def update_the_main_image_with_this_path(i)
|
|
911
|
+
@image1.set_file(i)
|
|
912
|
+
end
|
|
913
|
+
|
|
914
|
+
# ========================================================================= #
|
|
915
|
+
# === create_the_event_box_for_the_browser
|
|
916
|
+
# ========================================================================= #
|
|
917
|
+
def create_the_event_box_for_the_browser
|
|
918
|
+
_ = IMG_DIRECTORY+'firefox/FIREFOX_FAVICON.png'
|
|
919
|
+
if File.exist? _
|
|
920
|
+
@event_box_for_firefox = event_box
|
|
921
|
+
firefox_image = gtk_image_from_file(_)
|
|
922
|
+
firefox_image.hint = 'Opens a tab in the browser.'
|
|
923
|
+
@event_box_for_firefox.add(firefox_image) # Add the firefox image here.
|
|
924
|
+
@event_box_for_firefox.on_button_press_event {
|
|
925
|
+
do_open_the_current_image_in_the_browser
|
|
926
|
+
}
|
|
927
|
+
end
|
|
928
|
+
end
|
|
929
|
+
|
|
930
|
+
# ========================================================================= #
|
|
931
|
+
# === large_font?
|
|
932
|
+
# ========================================================================= #
|
|
933
|
+
def large_font?
|
|
934
|
+
LARGE_FONT
|
|
935
|
+
end
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
# ========================================================================= #
|
|
939
|
+
# === main_font?
|
|
940
|
+
# ========================================================================= #
|
|
941
|
+
def main_font?
|
|
942
|
+
USE_THIS_FONT
|
|
943
|
+
end
|
|
944
|
+
|
|
945
|
+
# ========================================================================= #
|
|
946
|
+
# === context_menu?
|
|
947
|
+
# ========================================================================= #
|
|
948
|
+
def context_menu?
|
|
949
|
+
@context_menu
|
|
950
|
+
end
|
|
951
|
+
|
|
952
|
+
# ========================================================================= #
|
|
953
|
+
# === do_randomize_all_hue_entries
|
|
954
|
+
# ========================================================================= #
|
|
955
|
+
def do_randomize_all_hue_entries
|
|
956
|
+
old_content = text_buffer?.text?.dup
|
|
957
|
+
if old_content.include? 'hue '
|
|
958
|
+
regex = /(hue \d{1,3})/ # See: https://rubular.com/r/nLkepmPs8U8WRe
|
|
959
|
+
scanned_results = old_content.scan(regex)
|
|
960
|
+
# The results may look like this:
|
|
961
|
+
#
|
|
962
|
+
# [["hue 270"], ["hue 75"]]
|
|
963
|
+
#
|
|
964
|
+
scanned_results.flatten.each {|this_hue_related_entry| # "hue 270"
|
|
965
|
+
number = this_hue_related_entry.split(' ').last.to_i
|
|
966
|
+
case rand(2)
|
|
967
|
+
when 0 # For minus.
|
|
968
|
+
number = number - rand(number)
|
|
969
|
+
number = 1 if number < 0
|
|
970
|
+
when 1 # For upper.
|
|
971
|
+
number = number + rand(250)
|
|
972
|
+
number = 255 if number > 255
|
|
973
|
+
end
|
|
974
|
+
old_content.gsub!(/#{this_hue_related_entry}/, 'hue '+number.to_s)
|
|
975
|
+
}
|
|
976
|
+
@text_buffer.set_text(old_content)
|
|
977
|
+
render_anew # This may be commented out at some later point in time.
|
|
978
|
+
end
|
|
979
|
+
end
|
|
980
|
+
|
|
981
|
+
# ========================================================================= #
|
|
982
|
+
# === do_create_a_new_file_chooser_dialog_and_then_set_the_main_entry_to
|
|
983
|
+
# ========================================================================= #
|
|
984
|
+
def do_create_a_new_file_chooser_dialog_and_then_set_the_main_entry_to(
|
|
985
|
+
i = main_file?.to_s
|
|
986
|
+
)
|
|
987
|
+
create_a_new_file_chooser_dialog(self) {{
|
|
988
|
+
filter: '.cfdg',
|
|
989
|
+
additional_folders: ::ImageParadise.project_base_directory?+'cfdg/',
|
|
990
|
+
start_dir: ::ImageParadise.project_base_directory?+'cfdg/'
|
|
991
|
+
}}
|
|
992
|
+
_ = ::Gtk.main_file?
|
|
993
|
+
if _ and File.exist?(_)
|
|
994
|
+
use_this_cfdg_file(_)
|
|
995
|
+
end
|
|
996
|
+
end
|
|
997
|
+
|
|
998
|
+
# ========================================================================= #
|
|
999
|
+
# === allow_the_combo_box_to_change_the__width_and_height_settings_on_changed_event
|
|
1000
|
+
# ========================================================================= #
|
|
1001
|
+
def allow_the_combo_box_to_change_the__width_and_height_settings_on_changed_event
|
|
1002
|
+
@combo_box.on_changed {
|
|
1003
|
+
_ = @combo_box.text?
|
|
1004
|
+
set_width_and_height(_)
|
|
1005
|
+
}
|
|
1006
|
+
end
|
|
1007
|
+
|
|
1008
|
+
# ========================================================================= #
|
|
1009
|
+
# === do_use_the_current_buffer_for_creating_a_new_image_file
|
|
1010
|
+
# ========================================================================= #
|
|
1011
|
+
def do_use_the_current_buffer_for_creating_a_new_image_file(
|
|
1012
|
+
i = nil
|
|
1013
|
+
)
|
|
1014
|
+
_ = current_buffer?
|
|
1015
|
+
# ======================================================================= #
|
|
1016
|
+
# We will create a new file and use that.
|
|
1017
|
+
# ======================================================================= #
|
|
1018
|
+
@home_dir = ENV['HOME'].to_s+'/image_paradise/'
|
|
1019
|
+
::ImageParadise.mkdir(@home_dir) unless File.directory?(@home_dir)
|
|
1020
|
+
@into = @home_dir+'default_cfdg_file.cfdg'
|
|
1021
|
+
::ImageParadise.write_what_into(_, @into)
|
|
1022
|
+
# ======================================================================= #
|
|
1023
|
+
# We need to use a consistent output-file here, as an image.
|
|
1024
|
+
# ======================================================================= #
|
|
1025
|
+
@output_file_location = @home_dir+'output.png'
|
|
1026
|
+
Thread.new {
|
|
1027
|
+
case i
|
|
1028
|
+
when :make_use_of_the_spinner_as_well
|
|
1029
|
+
the_spinner_is_now_active
|
|
1030
|
+
end
|
|
1031
|
+
result = ::ImageParadise.confreegenerator(@into) {{
|
|
1032
|
+
output_location: @output_file_location,
|
|
1033
|
+
open_in_browser_tab: false,
|
|
1034
|
+
width: @entry_width.text?,
|
|
1035
|
+
height: @entry_height.text?
|
|
1036
|
+
}}
|
|
1037
|
+
if result.was_an_error_encountered?
|
|
1038
|
+
notify_the_user_that_the_text_view_contains_an_error
|
|
1039
|
+
end
|
|
1040
|
+
update_the_main_image_with_this_path(@output_file_location)
|
|
1041
|
+
case i
|
|
1042
|
+
# === :make_use_of_the_spinner_as_well
|
|
1043
|
+
when :make_use_of_the_spinner_as_well
|
|
1044
|
+
the_spinner_is_now_inactive
|
|
1045
|
+
end
|
|
1046
|
+
}
|
|
1047
|
+
end; alias do_run do_use_the_current_buffer_for_creating_a_new_image_file # === do_run
|
|
1048
|
+
alias do_create_the_image do_use_the_current_buffer_for_creating_a_new_image_file # === do_create_the_image
|
|
1049
|
+
alias do_render_the_cfdg_file do_use_the_current_buffer_for_creating_a_new_image_file # === do_render_the_cfdg_file
|
|
1050
|
+
alias render_the_cfdg_file_again do_use_the_current_buffer_for_creating_a_new_image_file # === render_the_cfdg_file_again
|
|
1051
|
+
|
|
1052
|
+
# ========================================================================= #
|
|
1053
|
+
# === notify_the_user_that_the_text_view_contains_an_error
|
|
1054
|
+
# ========================================================================= #
|
|
1055
|
+
def notify_the_user_that_the_text_view_contains_an_error
|
|
1056
|
+
popup_over_this_widget(
|
|
1057
|
+
text_view?,
|
|
1058
|
+
'The buffer (text content) contains some error. Have a '\
|
|
1059
|
+
'look at it and correct the error, if possible.'
|
|
1060
|
+
).popup
|
|
1061
|
+
end
|
|
1062
|
+
|
|
1063
|
+
# ========================================================================= #
|
|
1064
|
+
# === text_view?
|
|
1065
|
+
# ========================================================================= #
|
|
1066
|
+
def text_view?
|
|
1067
|
+
@text_view
|
|
1068
|
+
end; alias main_textview? text_view? # === main_textview?
|
|
1069
|
+
|
|
1070
|
+
# ========================================================================= #
|
|
1071
|
+
# === the_spinner_is_now_active
|
|
1072
|
+
# ========================================================================= #
|
|
1073
|
+
def the_spinner_is_now_active
|
|
1074
|
+
@spinner_on_top.is_active
|
|
1075
|
+
# ======================================================================= #
|
|
1076
|
+
# Whenever the spinner is spinning, such as defined in the line above,
|
|
1077
|
+
# the render-again button becomes inactive (aka insensitive).
|
|
1078
|
+
# ======================================================================= #
|
|
1079
|
+
@button_render_again.is_inactive
|
|
1080
|
+
end
|
|
1081
|
+
|
|
1082
|
+
# ========================================================================= #
|
|
1083
|
+
# === the_spinner_is_now_inactive
|
|
1084
|
+
# ========================================================================= #
|
|
1085
|
+
def the_spinner_is_now_inactive
|
|
1086
|
+
@spinner_on_top.is_inactive
|
|
1087
|
+
@button_render_again.is_active
|
|
1088
|
+
end
|
|
1089
|
+
|
|
1090
|
+
# ========================================================================= #
|
|
1091
|
+
# === return_the_spinner_on_top
|
|
1092
|
+
# ========================================================================= #
|
|
1093
|
+
def return_the_spinner_on_top
|
|
1094
|
+
# ======================================================================= #
|
|
1095
|
+
# === @spinner_on_top
|
|
1096
|
+
# ======================================================================= #
|
|
1097
|
+
@spinner_on_top = gtk_spinner
|
|
1098
|
+
return @spinner_on_top
|
|
1099
|
+
end
|
|
1100
|
+
|
|
1101
|
+
# ========================================================================= #
|
|
1102
|
+
# === return_open_file_widget
|
|
1103
|
+
# ========================================================================= #
|
|
1104
|
+
def return_open_file_widget
|
|
1105
|
+
# ======================================================================= #
|
|
1106
|
+
# === Add the "Open File" button
|
|
1107
|
+
# ======================================================================= #
|
|
1108
|
+
hbox = create_hbox
|
|
1109
|
+
event_box1 = event_box(document_open)
|
|
1110
|
+
event_box1.on_clicked {
|
|
1111
|
+
do_create_a_new_file_chooser_dialog_and_then_set_the_main_entry_to(main_file?)
|
|
1112
|
+
}
|
|
1113
|
+
hbox.minimal(event_box1, 1)
|
|
1114
|
+
# ======================================================================= #
|
|
1115
|
+
# Create the file-chooser dialog.
|
|
1116
|
+
# ======================================================================= #
|
|
1117
|
+
button_file_chooser = return_file_chooser_button
|
|
1118
|
+
button_file_chooser.on_clicked {
|
|
1119
|
+
do_create_a_new_file_chooser_dialog_and_then_set_the_main_entry_to(main_file?)
|
|
1120
|
+
}
|
|
1121
|
+
hbox.maximal(button_file_chooser, 1)
|
|
1122
|
+
return hbox
|
|
1123
|
+
end
|
|
1124
|
+
|
|
1125
|
+
# ========================================================================= #
|
|
1126
|
+
# === create_the_top_bar (top tag)
|
|
1127
|
+
# ========================================================================= #
|
|
1128
|
+
def create_the_top_bar
|
|
1129
|
+
# ======================================================================= #
|
|
1130
|
+
# === @top_bar
|
|
1131
|
+
# ======================================================================= #
|
|
1132
|
+
@top_bar = return_default_top_bar { :with_close_button }
|
|
1133
|
+
@top_bar.spacing = 2
|
|
1134
|
+
# @top_bar.title = title?
|
|
1135
|
+
label_description = text(title?)
|
|
1136
|
+
label_description.use_this_font = large_font?
|
|
1137
|
+
label_description.make_bold
|
|
1138
|
+
@top_bar.set_custom_title(label_description)
|
|
1139
|
+
@top_bar.add_left(return_open_file_widget)
|
|
1140
|
+
event_box_open_a_random_cfdg_file = event_box(document_open)
|
|
1141
|
+
event_box_open_a_random_cfdg_file.on_clicked {
|
|
1142
|
+
open_a_random_cfdg_file
|
|
1143
|
+
}
|
|
1144
|
+
@top_bar.add_left(event_box_open_a_random_cfdg_file)
|
|
1145
|
+
@top_bar.add_left(@button_open_a_random_cfdg_file)
|
|
1146
|
+
@top_bar.add_left(return_open_in_browser_widget)
|
|
1147
|
+
@top_bar.add_left(
|
|
1148
|
+
return_widget_for_the_imgur_functionality
|
|
1149
|
+
)
|
|
1150
|
+
# ======================================================================= #
|
|
1151
|
+
# == The quit-button (exit tag, quit tag)
|
|
1152
|
+
# ======================================================================= #
|
|
1153
|
+
a_quit_button = simple_quit_button
|
|
1154
|
+
a_quit_button.clear_background
|
|
1155
|
+
a_quit_button.on_hover(:lightpink)
|
|
1156
|
+
a_quit_button.bblack1
|
|
1157
|
+
@top_bar.add_right(a_quit_button)
|
|
1158
|
+
@top_bar.add_right(@button_check_coupled)
|
|
1159
|
+
# ======================================================================= #
|
|
1160
|
+
# === Add the "Height:" text next:
|
|
1161
|
+
# ======================================================================= #
|
|
1162
|
+
label_height = text('Height:')
|
|
1163
|
+
label_height.width_height(100, 40)
|
|
1164
|
+
@top_bar.add_right(
|
|
1165
|
+
hbox(label_height, @entry_height)
|
|
1166
|
+
)
|
|
1167
|
+
# ======================================================================= #
|
|
1168
|
+
# === Add the "Width:" text next:
|
|
1169
|
+
# ======================================================================= #
|
|
1170
|
+
label_width = text('Width:')
|
|
1171
|
+
label_width.width_height(100, 40)
|
|
1172
|
+
@top_bar.add_right(
|
|
1173
|
+
hbox(label_width, @entry_width)
|
|
1174
|
+
)
|
|
1175
|
+
@top_bar.add_right(@combo_box)
|
|
1176
|
+
end
|
|
1177
|
+
|
|
1178
|
+
# ========================================================================= #
|
|
1179
|
+
# === open_a_random_cfdg_file
|
|
1180
|
+
#
|
|
1181
|
+
# Open a random cfdg file here. This method will then invoke the
|
|
1182
|
+
# method open_this_file().
|
|
1183
|
+
# ========================================================================= #
|
|
1184
|
+
def open_a_random_cfdg_file(
|
|
1185
|
+
random_file = return_random_cfdg_file
|
|
1186
|
+
)
|
|
1187
|
+
use_this_cfdg_file(random_file)
|
|
1188
|
+
e "Loading this `#{sfile(random_file)}` random file now."
|
|
1189
|
+
open_file_in_editor(random_file)
|
|
1190
|
+
if @checkbox_automatically_render_this_cfdg.is_checked?
|
|
1191
|
+
do_render_the_cfdg_file
|
|
1192
|
+
end
|
|
1193
|
+
end
|
|
1194
|
+
|
|
1195
|
+
# ========================================================================= #
|
|
1196
|
+
# === return_random_cfdg_file
|
|
1197
|
+
# ========================================================================= #
|
|
1198
|
+
def return_random_cfdg_file(
|
|
1199
|
+
i = path_to_the_cfdg_directory
|
|
1200
|
+
)
|
|
1201
|
+
Dir["#{i}*.cfdg"].sort.sample
|
|
1202
|
+
end
|
|
1203
|
+
|
|
1204
|
+
# ========================================================================= #
|
|
1205
|
+
# === path_to_the_cfdg_directory
|
|
1206
|
+
# ========================================================================= #
|
|
1207
|
+
def path_to_the_cfdg_directory
|
|
1208
|
+
"#{::ImageParadise.project_base_directory?}cfdg/"
|
|
1209
|
+
end
|
|
1210
|
+
|
|
1211
|
+
# ========================================================================= #
|
|
1212
|
+
# === create_the_buttons (buttons tag)
|
|
1213
|
+
# ========================================================================= #
|
|
1214
|
+
def create_the_buttons
|
|
1215
|
+
# ======================================================================= #
|
|
1216
|
+
# === @button_open_a_random_cfdg_file
|
|
1217
|
+
# ======================================================================= #
|
|
1218
|
+
@button_open_a_random_cfdg_file = button('_Open a random file')
|
|
1219
|
+
@button_open_a_random_cfdg_file.on_clicked {
|
|
1220
|
+
open_a_random_cfdg_file
|
|
1221
|
+
}
|
|
1222
|
+
@button_open_a_random_cfdg_file.hint =
|
|
1223
|
+
"Click this button to open a random .cfdg file. These have "\
|
|
1224
|
+
"to exist locally, in order for this functionality to work.\n\n"\
|
|
1225
|
+
"The local directory should be at: \n\n"\
|
|
1226
|
+
" <span weight=\"bold\" color=\"darkgreen\" size=\"x-large\">#{path_to_the_cfdg_directory}</span>\n\n"
|
|
1227
|
+
# ======================================================================= #
|
|
1228
|
+
# === @button_open_in_the_browser
|
|
1229
|
+
# ======================================================================= #
|
|
1230
|
+
@button_open_in_the_browser = button('Open in the browser')
|
|
1231
|
+
@button_open_in_the_browser.hint =
|
|
1232
|
+
"Click on this button if you want to open the image in "\
|
|
1233
|
+
"a browser-tab.\nNote that this refers to the rendered image "\
|
|
1234
|
+
"that would show up in the center-widget, so you may have to "\
|
|
1235
|
+
"render a new image first."
|
|
1236
|
+
@button_open_in_the_browser.set_font(SMALLER_FONT)
|
|
1237
|
+
@button_open_in_the_browser.on_clicked {
|
|
1238
|
+
do_open_the_current_image_in_the_browser
|
|
1239
|
+
}
|
|
1240
|
+
# ======================================================================= #
|
|
1241
|
+
# === @button_scramble
|
|
1242
|
+
# ======================================================================= #
|
|
1243
|
+
@button_scramble = button('_Scramble')
|
|
1244
|
+
@button_scramble.on_clicked { do_scramble_the_cfdg_content }
|
|
1245
|
+
@button_scramble.clear_background
|
|
1246
|
+
@button_scramble.on_hover(:lightgoldenrodyellow)
|
|
1247
|
+
@button_scramble.bblack2
|
|
1248
|
+
# ======================================================================= #
|
|
1249
|
+
# === @button_batch_generate_all_cfdg_images
|
|
1250
|
+
# ======================================================================= #
|
|
1251
|
+
@button_batch_generate_all_cfdg_images = button(
|
|
1252
|
+
'Generate all cfdg-images'
|
|
1253
|
+
)
|
|
1254
|
+
@button_batch_generate_all_cfdg_images.clear_background
|
|
1255
|
+
@button_batch_generate_all_cfdg_images.on_hover(:lightgoldenrodyellow)
|
|
1256
|
+
@button_batch_generate_all_cfdg_images.hint =
|
|
1257
|
+
'This button can be used to <b>generate all images</b>. '\
|
|
1258
|
+
'This will take a while, though.'
|
|
1259
|
+
@button_batch_generate_all_cfdg_images.on_clicked {
|
|
1260
|
+
do_generate_all_cfdg_images
|
|
1261
|
+
}
|
|
1262
|
+
@button_batch_generate_all_cfdg_images.clear_background
|
|
1263
|
+
@button_batch_generate_all_cfdg_images.bblack2
|
|
1264
|
+
# ======================================================================= #
|
|
1265
|
+
# == The clear-button
|
|
1266
|
+
# ======================================================================= #
|
|
1267
|
+
@button_clear = button('_Clear')
|
|
1268
|
+
@button_clear.clear_background
|
|
1269
|
+
@button_clear.on_hover(:lightgoldenrodyellow)
|
|
1270
|
+
@button_clear.bblack2
|
|
1271
|
+
@button_clear.on_clicked { clear_buffer }
|
|
1272
|
+
@button_clear.hint = 'Click this button to clear the content of '\
|
|
1273
|
+
'the text-view area on the left hand side. This is the area '\
|
|
1274
|
+
'where the content of a .cfdg file usually appears.'
|
|
1275
|
+
@button_clear.set_image(
|
|
1276
|
+
::Gtk::Image.new(
|
|
1277
|
+
stock: ::Gtk::Stock::OK,
|
|
1278
|
+
size: ::Gtk::IconSize::SMALL_TOOLBAR
|
|
1279
|
+
)
|
|
1280
|
+
)
|
|
1281
|
+
# ======================================================================= #
|
|
1282
|
+
# === @button_run_cfdg
|
|
1283
|
+
# ======================================================================= #
|
|
1284
|
+
@button_run_cfdg = button('_Run cfdg')
|
|
1285
|
+
@button_run_cfdg.hint = 'Click on this button '\
|
|
1286
|
+
'to generate a new image from the .cfdg dataset '\
|
|
1287
|
+
'shown to the left side. Keep in mind that this may '\
|
|
1288
|
+
'take up to a few seconds, depending on how complex '\
|
|
1289
|
+
'the context-free rules are. Once the image was '\
|
|
1290
|
+
'generated, it will be shown to the left side '\
|
|
1291
|
+
'as well.'
|
|
1292
|
+
@button_run_cfdg.clear_background
|
|
1293
|
+
@button_run_cfdg.on_hover(:lightgoldenrodyellow)
|
|
1294
|
+
@button_run_cfdg.bblack2
|
|
1295
|
+
@button_run_cfdg.on_clicked {
|
|
1296
|
+
do_use_the_current_buffer_for_creating_a_new_image_file
|
|
1297
|
+
}
|
|
1298
|
+
# ======================================================================= #
|
|
1299
|
+
# === @button_render_again
|
|
1300
|
+
# ======================================================================= #
|
|
1301
|
+
@button_render_again = button('_Render again')
|
|
1302
|
+
@button_render_again.clear_background
|
|
1303
|
+
@button_render_again.on_hover(:lightblue)
|
|
1304
|
+
@button_render_again.hint = 'Click this button to render the .cfdg '\
|
|
1305
|
+
'file (on the left) again. The new image will then be displayed '\
|
|
1306
|
+
'in the image-box below this button.'
|
|
1307
|
+
@button_render_again.rounded_border(
|
|
1308
|
+
'6px', :default, '4px solid darkgreen'
|
|
1309
|
+
)
|
|
1310
|
+
@button_render_again.on_clicked {
|
|
1311
|
+
do_render_again
|
|
1312
|
+
}
|
|
1313
|
+
end
|
|
1314
|
+
|
|
1315
|
+
# ========================================================================= #
|
|
1316
|
+
# === handle_CSS_rules (CSS tag)
|
|
1317
|
+
# ========================================================================= #
|
|
1318
|
+
def handle_CSS_rules
|
|
1319
|
+
use_gtk_paradise_project_css_file
|
|
1320
|
+
end
|
|
1321
|
+
|
|
1322
|
+
# ========================================================================= #
|
|
1323
|
+
# === return_scrolled_window_widget_containing_each_cfdg_file_as_a_button
|
|
1324
|
+
#
|
|
1325
|
+
# This method will create the widget that contains all .cfdg files
|
|
1326
|
+
# as a button.
|
|
1327
|
+
# ========================================================================= #
|
|
1328
|
+
def return_scrolled_window_widget_containing_each_cfdg_file_as_a_button
|
|
1329
|
+
vbox = create_vbox
|
|
1330
|
+
vbox.set_font(:hack_9)
|
|
1331
|
+
vbox.width_height(48, 44)
|
|
1332
|
+
sorted_array = return_all_cfdg_files
|
|
1333
|
+
sorted_array.each_with_index {|this_cfdg_file, index| index += 1
|
|
1334
|
+
_ = File.basename(this_cfdg_file).delete_suffix('.cfdg') # We want to use a shorter name.
|
|
1335
|
+
_ = _[0 .. 20]+' [...]' if _.size > 20
|
|
1336
|
+
# ===================================================================== #
|
|
1337
|
+
# Next, the button will use that name specified above, without
|
|
1338
|
+
# the .cfdg suffix.
|
|
1339
|
+
# ===================================================================== #
|
|
1340
|
+
button = button(_)
|
|
1341
|
+
button.make_bold
|
|
1342
|
+
button.left_align
|
|
1343
|
+
button.width_height(48, 22)
|
|
1344
|
+
button.bblack1
|
|
1345
|
+
button.clear_background
|
|
1346
|
+
button.on_hover(:aliceblue)
|
|
1347
|
+
button.on_clicked {
|
|
1348
|
+
use_this_cfdg_file(this_cfdg_file)
|
|
1349
|
+
do_create_the_image
|
|
1350
|
+
}
|
|
1351
|
+
# ===================================================================== #
|
|
1352
|
+
# Show tooltip markup next:
|
|
1353
|
+
# ===================================================================== #
|
|
1354
|
+
button.hint =
|
|
1355
|
+
'<span size="xx-large">This button (file position '\
|
|
1356
|
+
'<span weight="bold" color="lightblue">'+index.to_s+
|
|
1357
|
+
'</span>) will create the image described by <b>'+
|
|
1358
|
+
this_cfdg_file+'</b>.</span>'
|
|
1359
|
+
vbox.minimal(button, 1)
|
|
1360
|
+
}
|
|
1361
|
+
scrolled_window = gtk_scrolled_window(vbox) { :only_top_down_bar }
|
|
1362
|
+
scrolled_window.width_height(78, 48)
|
|
1363
|
+
frame = gtk_frame(scrolled_window)
|
|
1364
|
+
frame.set_title('Available .cfdg files ')
|
|
1365
|
+
frame.set_border_width(2)
|
|
1366
|
+
return frame
|
|
1367
|
+
end; alias return_widget3 return_scrolled_window_widget_containing_each_cfdg_file_as_a_button # === return_widget3
|
|
1368
|
+
|
|
1369
|
+
begin
|
|
1370
|
+
require 'roebe/classes/upload_to_imgur.rb'
|
|
1371
|
+
rescue LoadError; end
|
|
1372
|
+
# ========================================================================= #
|
|
1373
|
+
# === return_widget_for_the_imgur_functionality
|
|
1374
|
+
# ========================================================================= #
|
|
1375
|
+
def return_widget_for_the_imgur_functionality
|
|
1376
|
+
hbox1 = create_hbox
|
|
1377
|
+
imgur_logo = image(
|
|
1378
|
+
ImageParadise.project_base_directory?+'logo/IMGUR_LOGO.png'
|
|
1379
|
+
)
|
|
1380
|
+
another_event_box = event_box(imgur_logo)
|
|
1381
|
+
another_event_box.on_clicked {
|
|
1382
|
+
if Object.const_defined?(:Roebe) and
|
|
1383
|
+
Roebe.const_defined?(:UploadToImgur)
|
|
1384
|
+
uploaded_image = Roebe::UploadToImgur.new(output_file?)
|
|
1385
|
+
notify_the_user_about_this_uploaded_image(uploaded_image.remote_url?)
|
|
1386
|
+
end
|
|
1387
|
+
}
|
|
1388
|
+
hbox1.minimal(another_event_box, 5)
|
|
1389
|
+
return hbox1
|
|
1390
|
+
end
|
|
1391
|
+
|
|
1392
|
+
# ========================================================================= #
|
|
1393
|
+
# === output_file_location?
|
|
1394
|
+
# ========================================================================= #
|
|
1395
|
+
def output_file_location?
|
|
1396
|
+
@output_file_location
|
|
1397
|
+
end; alias output_file? output_file_location? # === output_file?
|
|
1398
|
+
|
|
1399
|
+
# ========================================================================= #
|
|
1400
|
+
# === notify_the_user_about_this_uploaded_image
|
|
1401
|
+
# ========================================================================= #
|
|
1402
|
+
def notify_the_user_about_this_uploaded_image(
|
|
1403
|
+
remote_URL
|
|
1404
|
+
)
|
|
1405
|
+
pop_up_widget(
|
|
1406
|
+
over_this_widget: main_textview?,
|
|
1407
|
+
text: "The image has been uploaded to:\n\n"+
|
|
1408
|
+
" #{remote_URL}\n\n"
|
|
1409
|
+
) { :make_selectable }
|
|
1410
|
+
try_to_set_the_xorg_buffer(remote_URL)
|
|
1411
|
+
end
|
|
1412
|
+
|
|
1413
|
+
# ========================================================================= #
|
|
1414
|
+
# === do_render_again
|
|
1415
|
+
#
|
|
1416
|
+
# The alias update_image() has originally been added at 16.01.2008,
|
|
1417
|
+
# in the old code base.
|
|
1418
|
+
# ========================================================================= #
|
|
1419
|
+
def do_render_again
|
|
1420
|
+
render_the_cfdg_file_again(:make_use_of_the_spinner_as_well)
|
|
1421
|
+
end; alias render_anew do_render_again # === render_anew
|
|
1422
|
+
alias update_image do_render_again # === update_image
|
|
1423
|
+
|
|
1424
|
+
# ========================================================================= #
|
|
1425
|
+
# === ImageParadise::GUI::Gtk::CfdgWidget.run
|
|
1426
|
+
# ========================================================================= #
|
|
1427
|
+
def self.run(
|
|
1428
|
+
i = ARGV
|
|
1429
|
+
)
|
|
1430
|
+
require 'gtk_paradise/app/app.rb'
|
|
1431
|
+
_ = ::ImageParadise::GUI::Gtk::CfdgWidget.new(i)
|
|
1432
|
+
r = ::Gtk.run
|
|
1433
|
+
r << _
|
|
1434
|
+
r.enable_context_menu
|
|
1435
|
+
r.on_button_press_event { |widget, event|
|
|
1436
|
+
if ::Gtk.right_mouse_click?(event) # right mouse click event.
|
|
1437
|
+
_.context_menu?.popup_based_on_this_event(event)
|
|
1438
|
+
end
|
|
1439
|
+
}
|
|
1440
|
+
r.automatic_size_then_automatic_title
|
|
1441
|
+
r.enable_quick_exit
|
|
1442
|
+
r.do_maximize
|
|
1443
|
+
# r.middle_of_the_screen_then_run # Or this variant.
|
|
1444
|
+
r.automatic_size_and_automatic_title
|
|
1445
|
+
r.top_left_then_run
|
|
1446
|
+
end
|
|
1447
|
+
|
|
1448
|
+
end; end; end; end
|
|
1449
|
+
|
|
1450
|
+
if __FILE__ == $PROGRAM_NAME
|
|
1451
|
+
ImageParadise::GUI::Gtk::CfdgWidget.run
|
|
1452
|
+
end
|