1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Artistic Style Developer</title>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<link href="../favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- body text -->
<h1>Artistic Style Developer Information</h1>
<p class="noindent">
Artistic Style has compile options for creating a shared library (DLL) or static library for use with a Graphical
User Interface (GUI). The shared library can be called from a C++, <span style="white-space: nowrap;">Objective-C</span>, C#, or Python program. There
are also compile options for a Java Native Interface (JNI) that allows it to be called from a Java program. Information
on compiling the various configurations of Artistic Style is in the Install Information.</p>
<p class="noindent">
The following Examples show how to call the Artistic Style shared library using the various programming languages.
They are command line programs and do NOT contain a Graphical User Interface for the Artistic Style options.
</p>
<p class="noindent">
Source code, documentation, and test files for all examples can be downloaded below or obtained from the <a href="subversion.html">source code repositories</a>.
These projects also require the source from Artistic Style in addition to the development examples.
</p>
<h3>Examples</h3>
<p>
Source code from the following examples can be copied and pasted into an editor or development environment for
compiling and running. Or the source code can be downloaded from the "Source Code Downloads" section below. The
code highlighting for the example html pages was done with <a href="http://www.andre-simon.de/"
target="_blank" title="open new window">Highlight</a>.
The examples were formatted with Artistic Style using the Horstmann style.</p>
<p>
<a href="https://astyle.sourceforge.net/develop/cpp.html">Calling Artistic Style from a C++ Program</a> contains information on calling Artistic Style
as a shared or static library from a C++ program. It includes a C++ sample program that can be used to test the
Artistic Style libraries.</p>
<p>
<a href="https://astyle.sourceforge.net/develop/objc.html">Calling Artistic Style from an <span style="white-space: nowrap;">Objective-C</span> Program</a> contains information on calling Artistic
Style as a shared or static library from an <span style="white-space: nowrap;">Objective-C</span> program. It includes an <span style="white-space: nowrap;">Objective-C</span> sample program that
can be used to test the Artistic Style shared libraries.</p>
<p style="margin-left: 0.5in;">
<a href="https://astyle.sourceforge.net/develop/gnustep.html"><span style="white-space: nowrap;">Objective-C</span> on Windows and Linux</a> contains information on compiling and running
<span style="white-space: nowrap;">Objective-C</span> programs using GNUstep. It has instructions for compiling the Example program on Windows or
Linux.</p>
<p>
<a href="https://astyle.sourceforge.net/develop/jni.html">Calling Artistic Style as a Java Native Interface</a> contains information on calling Artistic
Style as a shared library from a Java program using the Java Native Interface (JNI). It includes a Java sample
program that can be used to test the shared library. The Java Development Kit (JDK) must be installed to compile
Artistic Style.</p>
<p>
<a href="https://astyle.sourceforge.net/develop/sharp.html">Calling Artistic Style from a C# Program</a> contains information on calling Artistic Style
as a shared library from a C# program. It includes a C# sample program that can be used to test the shared
library.</p>
<p style="margin-left: 0.5in;">
<a href="https://astyle.sourceforge.net/develop/sharp2.html">Calling Artistic Style from a C# Program Using Explicit Linking</a> contains information
on calling Artistic Style as a shared library from a C# program. It uses explicit linking to do a dynamic load
of the shared library. It includes a C# sample program that can be used to test the shared library.</p>
<p style="margin-left: 0.5in;">
With explicit linking the shared library name can be changed at runtime, allowing the C# program to load
either an x86 or x64 bit shared library. This provides the capability to make the program run on "Any
CPU". The shared object can also be loaded from any directory, not just the directories searched by the
system.</p>
<p>
<a href="https://astyle.sourceforge.net/develop/python.html">Calling Artistic Style from a Python Script</a> contains information on calling Artistic
Style as a shared library from a Python script. It includes a sample Python script that can be used to test the
shared library.</p>
<h3>Source Code Downloads (old examples)</h3>
<p>
The downloads contain the above example source files and the test data. The test data is the same for all
downloads.</p>
<h4>
<a href="https://sourceforge.net/projects/astyle/files/OldFiles/examples/example-cpp.zip" target="_blank"
title="open new window">C++ Example</a>
</h4>
<p>
The example for C++ contains the methods to call Artistic Style from a static or shared library using a C++ program.
Compile Artistic Style as a static or shared library using the macro ASTYLE_LIB. Copy the shared library to the
same folder as the C++ Example executable. Compile Example.cpp as an executable and link it to the library. It
will format files in the test‑data directory included in the download.</p>
<h4>
<a href="https://sourceforge.net/projects/astyle/files/OldFiles/examples/example-objc.zip" target="_blank"
title="open new window"><span style="white-space: nowrap;">Objective-C</span> Example</a>
</h4>
<p>
The example for <span style="white-space: nowrap;">Objective-C</span> contains the methods to call Artistic Style from a static or shared library
using an <span style="white-space: nowrap;">Objective-C</span> program. Compile Artistic Style as a static or shared library using the macro ASTYLE_LIB.
Copy the shared library to the same folder as the <span style="white-space: nowrap;">Objective-C</span> Example executable. It will format files in
the test‑data directory included in the download.</p>
<h4>
<a href="https://sourceforge.net/projects/astyle/files/OldFiles/examples/example-java.zip" target="_blank"
title="open new window">Java Example</a>
</h4>
<p>
The example for Java includes an AStyleInterface class that calls the shared library using the Java Native Interface
(JNI). Artistic Style must be compiled as a shared library using the macro ASTYLE_JNI. Copy the shared library
to the same folder as the Java class files (it is loaded from the classpath directory). It will format files in
the test‑data directory included in the download.</p>
<h4>
<a href="https://sourceforge.net/projects/astyle/files/OldFiles/examples/example-sharp.zip" target="_blank"
title="open new window">C# Example</a>
</h4>
<p>
This example for C# includes an AStyleInterface class that calls the shared library using a C# program. Compile
Artistic Style as a shared library using the macro ASTYLE_LIB. Copy the shared library to the same folder as the
C# class files (C# does a Windows type search for the shared library, looking first in the startup program's directory).
It will format files in the test‑data directory included in the download.</p>
<h4 style="margin-left: 0.5in;">
<a href="https://sourceforge.net/projects/astyle/files/OldFiles/examples/example-sharp2.zip" target="_blank"
title="open new window">C# Example Using Explicit Linking</a>
</h4>
<p style="margin-left: 0.5in;">
This example for C# includes an AStyleInterface class that calls the shared library using a C# program.
It uses explicit linking to do a dynamic load of the shared library. Compile Artistic Style as a shared library
using the macro ASTYLE_LIB. Copy the shared library to the same folder as the C# class files. It will format files
in the test‑data directory included in the download.</p>
<h4>
<a href="https://sourceforge.net/projects/astyle/files/OldFiles/examples/example-python.zip" target="_blank"
title="open new window">Python Examples</a>
</h4>
<p>
This download contains three Python scripts. The script ExampleExe.py calls an Artistic Style executable to format
C++ source code. The scripts ExampleByte.py and ExampleUnicode.py call the Artistic Style shared library. The
executable and shared library must be compiled using the macro ASTYLE_LIB. Copy the executable and shared library
to the same folder as the Python scripts. They will format files in the test‑data directory included in
the download.</p>
<p style="margin-left: -0.4in; text-align: center;">
<a href="http://sourceforge.net/projects/astyle">
Artistic Style on SourceForge.net
</a></p>
</body>
</html>
|