~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/extension/script/InkscapeScript.h

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __INKSCAPE_SCRIPT_H__
 
2
#define __INKSCAPE_SCRIPT_H__
 
3
 
 
4
/**
 
5
 * Inkscape Scripting container
 
6
 *
 
7
 * Authors:
 
8
 *   Bob Jamison <rjamison@titan.com>
 
9
 *
 
10
 * Copyright (C) 2004-2008 Bob Jamison
 
11
 *
 
12
 * Released under GNU GPL, read the file 'COPYING' for more information
 
13
 */
 
14
 
 
15
#include "config.h"
 
16
 
 
17
#include <glibmm.h>
 
18
 
 
19
namespace Inkscape
 
20
{
 
21
namespace Extension
 
22
{
 
23
namespace Script
 
24
{
 
25
 
 
26
 
 
27
 
 
28
/**
 
29
 * This class is used to run scripts, either from a file or buffer
 
30
 */
 
31
class InkscapeScript
 
32
{
 
33
public:
 
34
 
 
35
    /**
 
36
     * Which type of language?
 
37
     */
 
38
    typedef enum
 
39
        {
 
40
        JAVASCRIPT,
 
41
        PYTHON,
 
42
        RUBY
 
43
        } ScriptLanguage;
 
44
 
 
45
    /**
 
46
     * Creates a generic script interpreter.
 
47
     */
 
48
    InkscapeScript();
 
49
 
 
50
    /**
 
51
     *  Destructor
 
52
     */
 
53
    virtual ~InkscapeScript();
 
54
 
 
55
    /**
 
56
     * Interprets the script in the 'script' buffer,
 
57
     * storing the stdout output in 'output', and any
 
58
     * error messages in 'error.'  Language is one of the
 
59
     * enumerated types in ScriptLanguage above.
 
60
     */
 
61
    bool interpretScript(const Glib::ustring &script,
 
62
                         Glib::ustring &output,
 
63
                         Glib::ustring &error,
 
64
                         ScriptLanguage language);
 
65
 
 
66
    /**
 
67
     * Interprets the script in the named file,
 
68
     * storing the stdout output in 'output', and any
 
69
     * error messages in 'error.'  Language is one of the
 
70
     * enumerated types in ScriptLanguage above.
 
71
     */
 
72
    bool interpretFile(const Glib::ustring &fname,
 
73
                      Glib::ustring &output,
 
74
                      Glib::ustring &error,
 
75
                      ScriptLanguage language);
 
76
 
 
77
 
 
78
 
 
79
}; //class InkscapeScript
 
80
 
 
81
 
 
82
 
 
83
 
 
84
}  // namespace Script
 
85
}  // namespace Extension
 
86
}  // namespace Inkscape
 
87
 
 
88
 
 
89
 
 
90
#endif  /* __INKSCAPE_SCRIPT_H__ */
 
91
 
 
92
/*
 
93
  Local Variables:
 
94
  mode:c++
 
95
  c-file-style:"stroustrup"
 
96
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
97
  indent-tabs-mode:nil
 
98
  fill-column:99
 
99
  End:
 
100
*/
 
101
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :