Author: aschnell
Date: Thu Jan 15 12:41:01 2009
New Revision: 54642
URL: http://svn.opensuse.org/viewcvs/yast?rev=54642&view=rev
Log:
- backup
Added:
branches/tmp/aschnell/graph/qt-graph/examples/SimpleCreate.cc
branches/tmp/aschnell/graph/qt-graph/examples/SimpleLoad.cc (contents, props changed)
- copied, changed from r54637, branches/tmp/aschnell/graph/qt-graph/examples/Simple.cc
branches/tmp/aschnell/graph/qt-graph/examples/simple.dot
Removed:
branches/tmp/aschnell/graph/qt-graph/examples/Simple.cc
branches/tmp/aschnell/graph/qt-graph/examples/graph.dot
Added: branches/tmp/aschnell/graph/qt-graph/examples/SimpleCreate.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt-graph/examples/SimpleCreate.cc?rev=54642&view=auto
==============================================================================
--- branches/tmp/aschnell/graph/qt-graph/examples/SimpleCreate.cc (added)
+++ branches/tmp/aschnell/graph/qt-graph/examples/SimpleCreate.cc Thu Jan 15 12:41:01 2009
@@ -0,0 +1,44 @@
+
+// g++ -I/usr/include/YaST2/yui -I/usr/include/graphviz -lyui -lgvc -lgraph -lcdt SimpleCreate.cc -o SimpleCreate
+
+// Trivial example creating a graph using graphviz functions.
+
+
+#include
+
+#include "YUI.h"
+#include "YWidgetFactory.h"
+#include "YOptionalWidgetFactory.h"
+#include "YDialog.h"
+#include "YLayoutBox.h"
+#include "YEvent.h"
+#include "YGraph.h"
+
+
+int
+main(int argc, char** argv)
+{
+ YDialog * dialog = YUI::widgetFactory()->createPopupDialog();
+ YLayoutBox * vbox = YUI::widgetFactory()->createVBox(dialog);
+
+ GVC_t* gvc = gvContext();
+
+ graph_t* graph = agopen("test", AGDIGRAPH);
+
+ node_t* node1 = agnode(graph, "1");
+ node_t* node2 = agnode(graph, "2");
+
+ edge_t* edge1 = agedge(graph, node1, node2);
+ edge_t* edge2 = agedge(graph, node2, node1);
+
+ gvLayout(gvc, graph, "dot");
+
+ YUI::optionalWidgetFactory()->createGraph(vbox, graph);
+
+ gvFreeLayout(gvc, graph);
+ agclose(graph);
+ gvFreeContext(gvc);
+
+ dialog->waitForEvent();
+ dialog->destroy();
+}
Copied: branches/tmp/aschnell/graph/qt-graph/examples/SimpleLoad.cc (from r54637, branches/tmp/aschnell/graph/qt-graph/examples/Simple.cc)
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt-graph/examples/SimpleLoad.cc?p2=branches/tmp/aschnell/graph/qt-graph/examples/SimpleLoad.cc&p1=branches/tmp/aschnell/graph/qt-graph/examples/Simple.cc&r1=54637&r2=54642&rev=54642&view=diff
==============================================================================
--- branches/tmp/aschnell/graph/qt-graph/examples/Simple.cc (original)
+++ branches/tmp/aschnell/graph/qt-graph/examples/SimpleLoad.cc Thu Jan 15 12:41:01 2009
@@ -1,8 +1,8 @@
-// Trivial graph example.
-//
-// Compile with:
-//
-// g++ -I/usr/include/YaST2/yui -lyui Simple.cc -o Simple
+
+// g++ -I/usr/include/YaST2/yui -lyui SimpleLoad.cc -o SimpleLoad
+
+// Trivial example loading a graph from a file.
+
#include "YUI.h"
#include "YWidgetFactory.h"
@@ -10,14 +10,15 @@
#include "YDialog.h"
#include "YLayoutBox.h"
#include "YEvent.h"
+#include "YGraph.h"
int
-main( int argc, char **argv )
+main(int argc, char** argv)
{
- YDialog * dialog = YUI::widgetFactory()->createPopupDialog();
- YLayoutBox * vbox = YUI::widgetFactory()->createVBox( dialog );
+ YDialog * dialog = YUI::widgetFactory()->createPopupDialog();
+ YLayoutBox * vbox = YUI::widgetFactory()->createVBox(dialog);
- YUI::optionalWidgetFactory()->createGraph( vbox, "graph.dot", "dot" );
+ YUI::optionalWidgetFactory()->createGraph(vbox, "simple.dot", "dot");
dialog->waitForEvent();
dialog->destroy();
Added: branches/tmp/aschnell/graph/qt-graph/examples/simple.dot
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt-graph/examples/simple.dot?rev=54642&view=auto
==============================================================================
--- branches/tmp/aschnell/graph/qt-graph/examples/simple.dot (added)
+++ branches/tmp/aschnell/graph/qt-graph/examples/simple.dot Thu Jan 15 12:41:01 2009
@@ -0,0 +1,8 @@
+digraph test
+{
+ 1;
+ 2;
+
+ 1 -> 2;
+ 2 -> 1;
+}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org