Changeset 1b00550 in ganv


Ignore:
Timestamp:
Oct 26, 2015, 10:36:03 AM (2 years ago)
Author:
David Robillard <d@…>
Branches:
master
Children:
e7731e9
Parents:
128bdd8
Message:

Add support for edges that do not constrain the layout

git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5792 a436a847-0d15-0410-975c-d299462d15a1

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • NEWS

    r128bdd8 r1b00550  
    55  * Preserve selection for quickly making several connections.
    66  * Dampen sprung layout energy over time to prevent oscillation.
     7  * Add support for edges that do not constrain the layout.
    78  * Distinguish edge color from port color slighly.
    89  * Highlight connected edges on port hover.
     
    1920  * Upgrade to waf 1.8.14
    2021
    21  -- David Robillard <d@drobilla.net>  Sun, 04 Oct 2015 21:23:59 -0400
     22 -- David Robillard <d@drobilla.net>  Mon, 26 Oct 2015 13:30:01 -0400
    2223
    2324ganv (1.4.2) stable;
  • ganv/Edge.hpp

    r128bdd8 r1b00550  
    6868    }
    6969
     70    RW_PROPERTY(gboolean, constraining)
    7071    RW_PROPERTY(gboolean, curved)
    7172    RW_PROPERTY(gboolean, selected)
  • ganv/edge.h

    r128bdd8 r1b00550  
    6666ganv_edge_set_curved(GanvEdge* edge, gboolean curved);
    6767
     68gboolean
     69ganv_edge_get_constraining(const GanvEdge* edge);
     70
     71void
     72ganv_edge_set_constraining(GanvEdge* edge, gboolean constraining);
     73
    6874void
    6975ganv_edge_set_selected(GanvEdge* edge, gboolean selected);
  • src/Canvas.cpp

    r128bdd8 r1b00550  
    746746                agsafeset(e, (char*)"headport", (char*)ss.str().c_str(), (char*)"");
    747747            }
     748            if (!ganv_edge_get_constraining(edge)) {
     749                agsafeset(e, (char*)"constraint", "false", (char*)"");
     750            }
    748751        } else {
    749752            std::cerr << "Unable to find graphviz node" << std::endl;
     
    862865    FOREACH_EDGE(_edges, i) {
    863866        const GanvEdge* const edge = *i;
    864         GanvNode*             tail = ganv_edge_get_tail(edge);
    865         GanvNode*             head = ganv_edge_get_head(edge);
     867        if (!ganv_edge_get_constraining(edge)) {
     868            continue;
     869        }
     870
     871        GanvNode* tail = ganv_edge_get_tail(edge);
     872        GanvNode* head = ganv_edge_get_head(edge);
    866873        if (GANV_IS_PORT(tail)) {
    867874            tail = GANV_NODE(ganv_port_get_module(GANV_PORT(tail)));
  • src/edge.c

    r128bdd8 r1b00550  
    4848    PROP_DASH_OFFSET,
    4949    PROP_COLOR,
     50    PROP_CONSTRAINING,
    5051    PROP_CURVED,
    5152    PROP_ARROWHEAD,
     
    7374    impl->coords.width         = 2.0;
    7475    impl->coords.handle_radius = 4.0;
     76    impl->coords.constraining  = TRUE;
    7577    impl->coords.curved        = FALSE;
    7678    impl->coords.arrowhead     = FALSE;
     
    121123        SET_CASE(DASH_OFFSET, double, impl->dash_offset);
    122124        SET_CASE(COLOR, uint, impl->color);
     125        SET_CASE(CONSTRAINING, boolean, impl->coords.constraining);
    123126        SET_CASE(CURVED, boolean, impl->coords.curved);
    124127        SET_CASE(ARROWHEAD, boolean, impl->coords.arrowhead);
     
    152155        GET_CASE(DASH_OFFSET, double, impl->dash_offset);
    153156        GET_CASE(COLOR, uint, impl->color);
     157        GET_CASE(CONSTRAINING, boolean, impl->coords.constraining);
    154158        GET_CASE(CURVED, boolean, impl->coords.curved);
    155159        GET_CASE(ARROWHEAD, boolean, impl->coords.arrowhead);
     
    565569
    566570    g_object_class_install_property(
     571        gobject_class, PROP_CONSTRAINING, g_param_spec_boolean(
     572            "constraining",
     573            _("Constraining"),
     574            _("Whether edge should constrain the layout."),
     575            1,
     576            G_PARAM_READWRITE));
     577
     578    g_object_class_install_property(
    567579        gobject_class, PROP_CURVED, g_param_spec_boolean(
    568580            "curved",
     
    654666
    655667gboolean
     668ganv_edge_get_constraining(const GanvEdge* edge)
     669{
     670    return edge->impl->coords.constraining;
     671}
     672
     673void
     674ganv_edge_set_constraining(GanvEdge* edge, gboolean constraining)
     675{
     676    edge->impl->coords.constraining = constraining;
     677    ganv_edge_request_redraw(GANV_ITEM(edge), &edge->impl->coords);
     678}
     679
     680gboolean
    656681ganv_edge_get_curved(const GanvEdge* edge)
    657682{
  • src/ganv-private.h

    r128bdd8 r1b00550  
    6969    double   handle_x, handle_y, handle_radius;
    7070    double   width;
     71    gboolean constraining;
    7172    gboolean curved;
    7273    gboolean arrowhead;
  • wscript

    r128bdd8 r1b00550  
    99# minor increment <=> compatible changes (additions)
    1010# micro increment <=> no interface changes
    11 GANV_VERSION       = '1.5.3'
     11GANV_VERSION       = '1.5.4'
    1212GANV_MAJOR_VERSION = '1'
    1313
Note: See TracChangeset for help on using the changeset viewer.