/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2006 Free Software Foundation
+ Copyright (C) 2006, 2009 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <libpspp/getl.h>
#include <libpspp/compiler.h>
+#include <libpspp/cast.h>
#include <libpspp/str.h>
#include <stdlib.h>
GtkTextBuffer *buffer;
GtkTextIter i;
GtkTextIter end;
+ const gchar *name;
};
static const char *
name (const struct getl_interface *i)
{
- // const struct syntax_editor_source *ses =
- // (const struct syntax_editor_source *) i;
-
- return "I have no idea"; // window_name ((const struct editor_window *) ses->se);
+ const struct syntax_editor_source *ses = (const struct syntax_editor_source *) i;
+ return ses->name;
}
gchar *text;
GtkTextIter next_line;
- struct syntax_editor_source *ses = (struct syntax_editor_source *) i;
+ struct syntax_editor_source *ses
+ = UP_CAST (i, struct syntax_editor_source, parent);
if ( gtk_text_iter_compare (&ses->i, &ses->end) >= 0)
return false;
struct getl_interface *
create_syntax_editor_source (GtkTextBuffer *buffer,
GtkTextIter start,
- GtkTextIter stop
+ GtkTextIter stop,
+ const gchar *nm
)
{
struct syntax_editor_source *ses = xzalloc (sizeof *ses);
ses->buffer = buffer;
ses->i = start;
ses->end = stop;
+ ses->name = nm;
ses->parent.interactive = always_false;
ses->parent.location = location;
- return (struct getl_interface *) ses;
+ return &ses->parent;
}