All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gen.lib.gvc.gvlayout__c Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
/* +=======================================================================
 * |
 * |      PlantUML : a free UML diagram generator
 * |
 * +=======================================================================
 *
 * (C) Copyright 2009-2024, Arnaud Roques
 *
 * Project Info:  https://plantuml.com
 *
 * If you like this project or if you find it useful, you can support us at:
 *
 * https://plantuml.com/patreon (only 1$ per month!)
 * https://plantuml.com/liberapay (only 1€ per month!)
 * https://plantuml.com/paypal
 *
 *
 * PlantUML is free software; you can redistribute it and/or modify it
 * under the terms of the MIT License.
 *
 * See http://opensource.org/licenses/MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
 * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * PlantUML can occasionally display sponsored or advertising messages. Those
 * messages are usually generated on welcome or error images and never on
 * functional diagrams.
 * See https://plantuml.com/professional if you want to remove them
 *
 * Images (whatever their format : PNG, SVG, EPS...) generated by running PlantUML
 * are owned by the author of their corresponding sources code (that is, their
 * textual description in PlantUML language). Those images are not covered by
 * this MIT license.
 *
 * The generated images can then be used without any reference to the MIT license.
 * It is not even necessary to stipulate that they have been generated with PlantUML,
 * although this will be appreciated by the PlantUML team.
 *
 * There is an exception : if the textual description in PlantUML language is also covered
 * by any license, then the generated images are logically covered
 * by the very same license.
 *
 * This is the IGY distribution (Install GraphViz by Yourself).
 * You have to install GraphViz and to setup the GRAPHVIZ_DOT environment variable
 * (see https://plantuml.com/graphviz-dot )
 *
 * Icons provided by OpenIconic :  https://useiconic.com/open
 * Archimate sprites provided by Archi :  http://www.archimatetool.com
 * Stdlib AWS provided by https://github.com/milo-minderbinder/AWS-PlantUML
 * Stdlib Icons provided https://github.com/tupadr3/plantuml-icon-font-sprites
 * ASCIIMathML (c) Peter Jipsen http://www.chapman.edu/~jipsen
 * ASCIIMathML (c) David Lippman http://www.pierce.ctc.edu/dlippman
 * CafeUndZopfli ported by Eugene Klyuchnikov https://github.com/eustas/CafeUndZopfli
 * Brotli (c) by the Brotli Authors https://github.com/google/brotli
 * Themes (c) by Brett Schwarz https://github.com/bschwarz/puml-themes
 * Twemoji (c) by Twitter at https://twemoji.twitter.com/
 *
 */
package gen.lib.gvc;
import static gen.lib.cgraph.obj__c.agroot;
import static gen.lib.cgraph.rec__c.agbindrec;
import static gen.lib.common.emit__c.gv_fixLocale;
import static gen.lib.common.input__c.graph_init;
import static smetana.core.JUtils.LOG2;
import static smetana.core.Macro.GD_cleanup;
import static smetana.core.Macro.GD_drawing;
import static smetana.core.Macro.GD_gvc;
import static smetana.core.Macro.GVRENDER_PLUGIN;
import static smetana.core.Macro.LAYOUT_USES_RANKDIR;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;

import gen.annotation.Original;
import gen.annotation.Reviewed;
import h.EN_layout_type;
import h.ST_Agraph_s;
import h.ST_GVC_s;
import h.ST_gvlayout_engine_s;
import h.ST_gvlayout_features_t;
import h.ST_gvplugin_installed_t;
import smetana.core.CString;
import smetana.core.Globals;
import smetana.core.ZType;
import smetana.core.size_t;

public class gvlayout__c {


private final static ST_gvlayout_features_t dotgen_features = new ST_gvlayout_features_t();
private final static ST_gvlayout_engine_s dotgen_engine = new ST_gvlayout_engine_s();
static {
	dotgen_features.flags = LAYOUT_USES_RANKDIR;
	dotgen_engine.layout = gen.lib.dotgen.dotinit__c.dot_layout;
	dotgen_engine.cleanup = gen.lib.dotgen.dotinit__c.dot_cleanup;
}



@Reviewed(when = "11/11/2020")
@Original(version="2.38.0", path="lib/gvc/gvlayout.c", name="gvlayout_select", key="2g20jitdi8afuoei8p1mcfg9l", definition="int gvlayout_select(GVC_t * gvc, const char *layout)")
public static int gvlayout_select(ST_GVC_s gvc, CString layout) {
ENTERING("2g20jitdi8afuoei8p1mcfg9l","gvlayout_select");
try {
	ST_gvplugin_installed_t gvlayout_dot_layout = new ST_gvplugin_installed_t();
	gvlayout_dot_layout.id = EN_layout_type.LAYOUT_DOT;
	gvlayout_dot_layout.type = new CString("dot");
	gvlayout_dot_layout.quality = 0;
	gvlayout_dot_layout.engine = dotgen_engine;
	gvlayout_dot_layout.features = dotgen_features;

//    gvplugin_available_t *plugin;
	ST_gvplugin_installed_t typeptr = gvlayout_dot_layout;
//    plugin = gvplugin_load(gvc, API_layout, layout);
//    if (plugin) {
//	typeptr = plugin->typeptr;
	gvc.layout.type = typeptr.type;
	gvc.layout.engine = typeptr.engine;
	gvc.layout.id = typeptr.id;
	gvc.layout.features = typeptr.features;
	return GVRENDER_PLUGIN;  /* FIXME - need better return code */
//    }
//    return 999;
} finally {
LEAVING("2g20jitdi8afuoei8p1mcfg9l","gvlayout_select");
}
}




@Reviewed(when = "11/11/2020")
@Original(version="2.38.0", path="lib/gvc/gvlayout.c", name="gvLayoutJobs", key="991b7t7n0x8ifkp49zotjs78x", definition="int gvLayoutJobs(GVC_t * gvc, Agraph_t * g)")
public static int gvLayoutJobs(Globals zz, ST_GVC_s gvc, ST_Agraph_s g) {
ENTERING("991b7t7n0x8ifkp49zotjs78x","gvLayoutJobs");
try {
	ST_gvlayout_engine_s gvle;
    CString p = null;
    int rc;
    agbindrec(zz, g, new CString("Agraphinfo_t"), new size_t(ZType.ST_Agraphinfo_t), true);
    GD_gvc(g, gvc);
    if ((g != agroot(g)))
UNSUPPORTED("ah9ygbaap1fyxr97z734juk0j"); // 	GD_gvc(agroot(g)) = gvc;
/*    if ((p = agget(g, new CString("layout")))!=null) {
UNSUPPORTED("dlm1jil8gt2pv7p8yrit1tuls"); //         gvc->layout.engine = NULL;
UNSUPPORTED("efl8rjna6ij4qjxb0xlyu3hh1"); // 	rc = gvlayout_select(gvc, p);
UNSUPPORTED("7smbmph5nldinro02iqf3qlxv"); // 	if (rc == 999) {
UNSUPPORTED("6ru23qpjrx893ivwviirr1ikc"); // 	    agerr (AGERR, "Layout type: \"%s\" not recognized. Use one of:%s\n",
UNSUPPORTED("f3vrr10ga3mqymh2qxomxn326"); // 	        p, gvplugin_list(gvc, API_layout, p));
UNSUPPORTED("aivfd7ajlfz8o8oi68d4u5s5z"); // 	    return -1;
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // 	}
    }*/
    
    rc = gvlayout_select(gvc, p); //Let's force things
    
    gvle = (ST_gvlayout_engine_s) gvc.layout.engine;
    if ((gvle) == null)
	UNSUPPORTED("return -1;");
    
    
    gv_fixLocale (1);
    graph_init(zz, g, (gvc.layout.features.flags & LAYOUT_USES_RANKDIR)!=0);
    GD_drawing(agroot(g), GD_drawing(g));
    if (gvle!=null && gvle.layout!=null) {
	gvle.layout.exe(zz, g);

	
	
	if (gvle.cleanup!=null)
		if (GD_cleanup(g)==null) 
		LOG2("WARNING WE CHEAT GD_cleanup(g) is NULL"); else
	    GD_cleanup(g, gvle.cleanup);
    }
    gv_fixLocale (0);
    return 0;
} finally {
LEAVING("991b7t7n0x8ifkp49zotjs78x","gvLayoutJobs");
}
}





}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy