Files

46 lines
1.3 KiB
C
Raw Permalink Normal View History

#include <bshell/line-editor/line-editor.h>
#include <bshell/line-editor/plugin.h>
#include <bshell/line-editor/syntax.h>
#include <fx/term/tty.h>
struct bshell_line_ed_syntax_p {
};
static void init(fx_object *obj, void *priv)
{
}
static void fini(fx_object *obj, void *priv)
{
}
static enum bshell_status buffer_changed(
bshell_line_ed_plugin *plugin,
bshell_line_ed *ed)
{
// fprintf(stderr, "buffer changed!\n");
return BSHELL_SUCCESS;
}
FX_TYPE_CLASS_BEGIN(bshell_line_ed_syntax)
FX_TYPE_VTABLE_INTERFACE_BEGIN(fx_object, FX_TYPE_OBJECT)
FX_INTERFACE_ENTRY(to_string) = NULL;
FX_TYPE_VTABLE_INTERFACE_END(fx_object, FX_TYPE_OBJECT)
FX_TYPE_VTABLE_INTERFACE_BEGIN(
bshell_line_ed_plugin,
BSHELL_TYPE_LINE_EDITOR_PLUGIN)
FX_INTERFACE_ENTRY(p_buffer_changed) = buffer_changed;
FX_TYPE_VTABLE_INTERFACE_END(bshell_command, BSHELL_TYPE_COMMAND)
FX_TYPE_CLASS_END(bshell_line_ed_syntax)
FX_TYPE_DEFINITION_BEGIN(bshell_line_ed_syntax)
FX_TYPE_ID(0x4d9dea6c, 0x2ed8, 0x40e0, 0x943d, 0xfd70a7a9f54a);
FX_TYPE_NAME("bshell.runtime.line_editor.plugins.syntax");
FX_TYPE_EXTENDS(BSHELL_TYPE_LINE_EDITOR_PLUGIN);
FX_TYPE_CLASS(bshell_line_ed_syntax_class);
FX_TYPE_INSTANCE_INIT(init);
FX_TYPE_INSTANCE_FINI(fini);
FX_TYPE_INSTANCE_PRIVATE(struct bshell_line_ed_syntax_p);
FX_TYPE_DEFINITION_END(bshell_line_ed_syntax)