Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BlenderStyleModule.h « blender_interface « intern « freestyle « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 93b5f694eb68cc0987db39b882dde0df6afe9c48 (plain)
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
#ifndef BLENDERSTYLEMODULE_H
#define BLENDERSTYLEMODULE_H

#include "../stroke/StyleModule.h"
#include "../system/PythonInterpreter.h"

extern "C" {
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_text.h"
}

class BlenderStyleModule : public StyleModule
{
public:	

	BlenderStyleModule(struct Text *text, const string &name,
		Interpreter *inter) : StyleModule(name, inter) {
		_text = text;
	}

	virtual ~BlenderStyleModule() {
		BKE_text_unlink(G.main, _text);
		BKE_libblock_free(&G.main->text, _text);
	}

protected:

	virtual int interpret() {
		PythonInterpreter* py_inter = dynamic_cast<PythonInterpreter*>(_inter);
		assert(py_inter != 0);
		return py_inter->interpretText(_text, getFileName());
	}

private:
	struct Text *_text;
};

#endif // BLENDERSTYLEMODULE_H