86
85
void drawscriptspace(ScrArea *sa, void *spacedata)
88
87
SpaceScript *sc = curarea->spacedata.first;
88
Script *script = NULL;
90
90
glClearColor(0.6, 0.6, 0.6, 1.0);
91
91
glClear(GL_COLOR_BUFFER_BIT);
92
92
myortho2(-0.5, curarea->winrct.xmax-curarea->winrct.xmin-0.5, -0.5, curarea->winrct.ymax-curarea->winrct.ymin-0.5);
95
if (G.main->script.first)
96
sc->script = G.main->script.first;
101
BPY_spacescript_do_pywin_draw(sc);
95
script = G.main->script.first;
99
if (script->py_draw || script->py_event || script->py_button) {
103
else script = script->id.next;
107
if (!sc->script) return;
111
if (script->py_draw) {
112
BPY_spacescript_do_pywin_draw(sc);
114
/* quick hack for 2.37a for scripts that call the progress bar inside a
115
* file selector callback, to show previous space after finishing, w/o
116
* needing an event */
117
else if (!script->flags && !script->py_event && !script->py_button)
118
addqueue(curarea->win, MOUSEX, 0);
104
121
void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt)
106
123
unsigned short event = evt->event;
107
124
short val = evt->val;
125
char ascii = evt->ascii;
108
126
SpaceScript *sc = curarea->spacedata.first;
109
127
Script *script = sc->script;
112
BPY_spacescript_do_pywin_event(sc, event, val);
130
if (script->py_event || script->py_button)
131
BPY_spacescript_do_pywin_event(sc, event, val, ascii);
133
/* for file/image sel scripts: if user leaves file/image selection space,
134
* this frees the script (since it can't be accessed anymore): */
135
else if (script->flags == SCRIPT_FILESEL) {
137
script->lastspace = SPACE_SCRIPT;
114
140
if (!script->flags) {/* finished with this script, let's free it */
115
141
if (script->lastspace != SPACE_SCRIPT)