medit/moo/moopython/pygtk/mooterm-pygtk.defs

780 lines
16 KiB
Scheme

;; -*- scheme -*-
;; Hand-edited
; object definitions ...
(define-object Term
(in-module "Moo")
(parent "GtkWidget")
(c-name "MooTerm")
(gtype-id "MOO_TYPE_TERM")
)
(define-object Buffer
(in-module "Moo")
(parent "GObject")
(c-name "MooTermBuffer")
(gtype-id "MOO_TYPE_TERM_BUFFER")
)
(define-object Tag
(in-module "Moo")
(parent "GObject")
(c-name "MooTermTag")
(gtype-id "MOO_TYPE_TERM_TAG")
(fields
'("char*" "name")
'("MooTermTextAttr" "attr")
)
)
(define-object Window
(in-module "Moo")
(parent "MooWindow")
(c-name "MooTermWindow")
(gtype-id "MOO_TYPE_TERM_WINDOW")
)
(define-boxed Iter
(in-module "Moo")
(c-name "MooTermIter")
(gtype-id "MOO_TYPE_TERM_ITER")
(copy-func "moo_term_iter_copy")
(release-func "moo_term_iter_free")
(fields
'("MooTerm*" "term")
'("MooTermLine*" "line")
'("int" "row")
'("int" "col")
'("int" "width")
)
)
(define-boxed Command
(in-module "Moo")
(c-name "MooTermCommand")
(gtype-id "MOO_TYPE_TERM_COMMAND")
(copy-func "moo_term_command_copy")
(release-func "moo_term_command_free")
)
(define-pointer Line
(in-module "Moo")
(c-name "MooTermLine")
(gtype-id "MOO_TYPE_TERM_LINE")
)
(define-boxed TextAttr
(in-module "Moo")
(c-name "MooTermTextAttr")
(gtype-id "MOO_TYPE_TERM_TEXT_ATTR")
(fields
'("MooTermTextAttrMask" "mask")
'("MooTermTextColor" "foreground")
'("MooTermTextColor" "background")
)
)
;; Enumerations and flags ...
(define-enum EraseBinding
(in-module "Moo")
(c-name "MooTermEraseBinding")
(gtype-id "MOO_TYPE_TERM_ERASE_BINDING")
(values
'("auto" "MOO_TERM_ERASE_AUTO")
'("ascii-backspace" "MOO_TERM_ERASE_ASCII_BACKSPACE")
'("ascii-delete" "MOO_TERM_ERASE_ASCII_DELETE")
'("delete-sequence" "MOO_TERM_ERASE_DELETE_SEQUENCE")
)
)
(define-flags TextAttrMask
(in-module "Moo")
(c-name "MooTermTextAttrMask")
(gtype-id "MOO_TYPE_TERM_TEXT_ATTR_MASK")
(values
'("reverse" "MOO_TERM_TEXT_REVERSE")
'("blink" "MOO_TERM_TEXT_BLINK")
'("foreground" "MOO_TERM_TEXT_FOREGROUND")
'("background" "MOO_TERM_TEXT_BACKGROUND")
'("bold" "MOO_TERM_TEXT_BOLD")
'("underline" "MOO_TERM_TEXT_UNDERLINE")
)
)
(define-enum TextColor
(in-module "Moo")
(c-name "MooTermTextColor")
(gtype-id "MOO_TYPE_TERM_TEXT_COLOR")
(values
'("black" "MOO_TERM_BLACK")
'("red" "MOO_TERM_RED")
'("green" "MOO_TERM_GREEN")
'("yellow" "MOO_TERM_YELLOW")
'("blue" "MOO_TERM_BLUE")
'("magenta" "MOO_TERM_MAGENTA")
'("cyan" "MOO_TERM_CYAN")
'("white" "MOO_TERM_WHITE")
)
)
;; From mooterm-prefs.h
(define-function prefs_page_new
(c-name "moo_term_prefs_page_new")
(is-constructor-of "MooTermPrefsPage")
(return-type "GtkWidget*")
)
;; (define-function set_prefs_prefix
;; (c-name "moo_term_set_prefs_prefix")
;; (return-type "none")
;; (parameters
;; '("const-char*" "prefix")
;; )
;; )
;;
;; (define-function get_prefs_prefix
;; (c-name "moo_term_get_prefs_prefix")
;; (return-type "const-char*")
;; )
(define-function make_setting
(c-name "moo_term_setting")
(return-type "const-char*")
(parameters
'("const-char*" "setting_name")
)
)
;; From mooterm-text.h
(define-method copy
(of-object "MooTermIter")
(c-name "moo_term_iter_copy")
(return-type "MooTermIter*")
)
(define-method get_line_count
(of-object "MooTerm")
(c-name "moo_term_get_line_count")
(return-type "guint")
)
(define-method get_line
(of-object "MooTerm")
(c-name "moo_term_get_line")
(return-type "MooTermLine*")
(parameters
'("guint" "line_no")
)
)
(define-method set_line_data
(of-object "MooTerm")
(c-name "moo_term_set_line_data")
(return-type "none")
(parameters
'("MooTermLine*" "line")
'("const-char*" "key")
'("gpointer" "data")
)
)
(define-method set_line_data_full
(of-object "MooTerm")
(c-name "moo_term_set_line_data_full")
(return-type "none")
(parameters
'("MooTermLine*" "line")
'("const-char*" "key")
'("gpointer" "data")
'("GDestroyNotify" "destroy")
)
)
(define-method get_line_data
(of-object "MooTerm")
(c-name "moo_term_get_line_data")
(return-type "gpointer")
(parameters
'("MooTermLine*" "line")
'("const-char*" "key")
)
)
(define-method create_tag
(of-object "MooTerm")
(c-name "moo_term_create_tag")
(return-type "MooTermTag*")
(parameters
'("const-char*" "name" (null-ok) (default "NULL"))
)
)
(define-method get_tag
(of-object "MooTerm")
(c-name "moo_term_get_tag")
(return-type "MooTermTag*")
(parameters
'("const-char*" "name")
)
)
(define-method delete_tag
(of-object "MooTerm")
(c-name "moo_term_delete_tag")
(return-type "none")
(parameters
'("MooTermTag*" "tag")
)
)
(define-method get_tag_table
(of-object "MooTerm")
(c-name "moo_term_get_tag_table")
(return-type "MooTermTagTable*")
)
(define-method get_iter_at_line
(of-object "MooTerm")
(c-name "moo_term_get_iter_at_line")
(return-type "gboolean")
(parameters
'("MooTermIter*" "iter")
'("guint" "line")
)
)
(define-method get_iter_at_line_offset
(of-object "MooTerm")
(c-name "moo_term_get_iter_at_line_offset")
(return-type "gboolean")
(parameters
'("MooTermIter*" "iter")
'("guint" "line")
'("guint" "offset")
)
)
(define-method get_iter_at_cursor
(of-object "MooTerm")
(c-name "moo_term_get_iter_at_cursor")
(return-type "none")
(parameters
'("MooTermIter*" "iter")
)
)
(define-method forward_to_line_end
(of-object "MooTermIter")
(c-name "moo_term_iter_forward_to_line_end")
(return-type "none")
)
(define-method apply_tag
(of-object "MooTerm")
(c-name "moo_term_apply_tag")
(return-type "none")
(parameters
'("MooTermTag*" "tag")
'("MooTermIter*" "start")
'("MooTermIter*" "end")
)
)
(define-method remove_tag
(of-object "MooTerm")
(c-name "moo_term_remove_tag")
(return-type "none")
(parameters
'("MooTermTag*" "tag")
'("MooTermIter*" "start")
'("MooTermIter*" "end")
)
)
(define-method has_tag
(of-object "MooTermIter")
(c-name "moo_term_iter_has_tag")
(return-type "gboolean")
(parameters
'("MooTermTag*" "tag")
)
)
(define-method get_tag_start
(of-object "MooTermIter")
(c-name "moo_term_iter_get_tag_start")
(return-type "gboolean")
(parameters
'("MooTermTag*" "tag")
)
)
(define-method get_tag_end
(of-object "MooTermIter")
(c-name "moo_term_iter_get_tag_end")
(return-type "gboolean")
(parameters
'("MooTermTag*" "tag")
)
)
(define-method window_to_buffer_coords
(of-object "MooTerm")
(c-name "moo_term_window_to_buffer_coords")
(return-type "none")
(parameters
'("int" "window_x")
'("int" "window_y")
'("int*" "buffer_x")
'("int*" "buffer_y")
)
)
(define-method get_iter_at_location
(of-object "MooTerm")
(c-name "moo_term_get_iter_at_location")
(return-type "none")
(parameters
'("MooTermIter*" "iter")
'("int" "x")
'("int" "y")
)
)
(define-method get_iter_at_pos
(of-object "MooTerm")
(c-name "moo_term_get_iter_at_pos")
(return-type "none")
(parameters
'("MooTermIter*" "iter")
'("int" "x")
'("int" "y")
)
)
(define-method get_text
(of-object "MooTermIter")
(c-name "moo_term_get_text")
(return-type "char*")
(parameters
'("MooTermIter*" "end")
)
)
(define-method get_selection_bounds
(of-object "MooTerm")
(c-name "moo_term_get_selection_bounds")
(return-type "gboolean")
(parameters
'("MooTermIter*" "start")
'("MooTermIter*" "end")
)
)
;; From mooterm.h
(define-method get_screen_size
(of-object "MooTerm")
(c-name "moo_term_get_screen_size")
(return-type "none")
(parameters
'("guint*" "columns")
'("guint*" "rows")
)
)
(define-method char_height
(of-object "MooTerm")
(c-name "moo_term_char_height")
(return-type "guint")
)
(define-method char_width
(of-object "MooTerm")
(c-name "moo_term_char_width")
(return-type "guint")
)
(define-method set_adjustment
(of-object "MooTerm")
(c-name "moo_term_set_adjustment")
(return-type "none")
(parameters
'("GtkAdjustment*" "vadj")
)
)
(define-method fork_command
(of-object "MooTerm")
(c-name "moo_term_fork_command")
(return-type "none")
(parameters
'("const-MooTermCommand*" "cmd")
'("const-char*" "working_dir" (null-ok) (default "NULL"))
'("strv" "envp" (null-ok) (default "NULL"))
'("GError**" "error")
)
)
(define-method fork_command_line
(of-object "MooTerm")
(c-name "moo_term_fork_command_line")
(return-type "none")
(parameters
'("const-char*" "cmd_line")
'("const-char*" "working_dir" (null-ok) (default "NULL"))
'("strv" "envp" (null-ok) (default "NULL"))
'("GError**" "error")
)
(docstring "fork_command_line(cmd, [working_dir, env]) -> None. Starts process in the terminal\n"
"\n"
"cmd - command line\n"
"working_dir - working directory for new process\n"
"env - sequence of strings representing environment variables \n"
"for new process, in format 'VARIABLE=value'\n"
"\n"
"Raises gobject.GError on error.")
)
(define-method fork_argv
(of-object "MooTerm")
(c-name "moo_term_fork_argv")
(return-type "none")
(parameters
'("strv" "argv")
'("const-char*" "working_dir" (null-ok) (default "NULL"))
'("strv" "envp" (null-ok) (default "NULL"))
'("GError**" "error")
)
(docstring "fork_argv(cmd, [working_dir, env]) -> None. Starts process in the terminal\n"
"\n"
"argv - sequence of command line arguments\n"
"working_dir - working directory for new process\n"
"env - sequence of strings representing environment variables \n"
"for new process, in format 'VARIABLE=value'\n"
"\n"
"Raises gobject.GError on error.")
)
(define-method child_alive
(of-object "MooTerm")
(c-name "moo_term_child_alive")
(return-type "gboolean")
)
(define-method kill_child
(of-object "MooTerm")
(c-name "moo_term_kill_child")
(return-type "none")
)
(define-function set_helper_directory
(c-name "moo_term_set_helper_directory")
(return-type "none")
(parameters
'("const-char*" "dir")
)
)
(define-method feed
(of-object "MooTerm")
(c-name "moo_term_feed")
(return-type "none")
(parameters
'("const-char*" "data")
'("int" "len")
)
)
(define-method feed_child
(of-object "MooTerm")
(c-name "moo_term_feed_child")
(return-type "none")
(parameters
'("const-char*" "string")
'("int" "len")
)
)
(define-method scroll_to_top
(of-object "MooTerm")
(c-name "moo_term_scroll_to_top")
(return-type "none")
)
(define-method scroll_to_bottom
(of-object "MooTerm")
(c-name "moo_term_scroll_to_bottom")
(return-type "none")
)
(define-method scroll_lines
(of-object "MooTerm")
(c-name "moo_term_scroll_lines")
(return-type "none")
(parameters
'("int" "lines")
)
)
(define-method scroll_pages
(of-object "MooTerm")
(c-name "moo_term_scroll_pages")
(return-type "none")
(parameters
'("int" "pages")
)
)
(define-method copy_clipboard
(of-object "MooTerm")
(c-name "moo_term_copy_clipboard")
(return-type "none")
(parameters
'("GdkAtom" "selection")
)
)
(define-method paste_clipboard
(of-object "MooTerm")
(c-name "moo_term_paste_clipboard")
(return-type "none")
(parameters
'("GdkAtom" "selection")
)
)
(define-method select_all
(of-object "MooTerm")
(c-name "moo_term_select_all")
(return-type "none")
)
(define-method get_selection
(of-object "MooTerm")
(c-name "moo_term_get_selection")
(return-type "char*")
)
(define-method get_content
(of-object "MooTerm")
(c-name "moo_term_get_content")
(return-type "char*")
)
(define-method ctrl_c
(of-object "MooTerm")
(c-name "moo_term_ctrl_c")
(return-type "none")
)
(define-method set_pointer_visible
(of-object "MooTerm")
(c-name "moo_term_set_pointer_visible")
(return-type "none")
(parameters
'("gboolean" "visible")
)
)
(define-method set_font_from_string
(of-object "MooTerm")
(c-name "moo_term_set_font_from_string")
(return-type "none")
(parameters
'("const-char*" "font")
)
)
(define-method set_cursor_blink_time
(of-object "MooTerm")
(c-name "moo_term_set_cursor_blink_time")
(return-type "none")
(parameters
'("guint" "ms")
)
)
(define-method reset
(of-object "MooTerm")
(c-name "moo_term_reset")
(return-type "none")
)
(define-method soft_reset
(of-object "MooTerm")
(c-name "moo_term_soft_reset")
(return-type "none")
)
(define-method start_default_shell
(of-object "MooTerm")
(c-name "moo_term_start_default_shell")
(return-type "gboolean")
(parameters
'("GError**" "error")
)
)
(define-function moo_term_command_new
(c-name "moo_term_command_new")
(is-constructor-of "MooTermCommand")
(return-type "MooTermCommand*")
(parameters
'("const-char*" "cmd_line" (null-ok) (default "NULL"))
'("strv" "argv" (null-ok) (default "NULL"))
)
)
(define-method copy
(of-object "MooTermCommand")
(c-name "moo_term_command_copy")
(return-type "MooTermCommand*")
)
(define-method set_colors
(of-object "MooTerm")
(c-name "moo_term_set_colors")
(return-type "none")
(parameters
'("GdkColor*" "colors")
'("guint" "n_colors")
)
)
;; From mootermbuffer.h
(define-function moo_term_buffer_new
(c-name "moo_term_buffer_new")
(is-constructor-of "MooTermBuffer")
(return-type "MooTermBuffer*")
(parameters
'("guint" "width")
'("guint" "height")
)
)
(define-method print_chars
(of-object "MooTermBuffer")
(c-name "moo_term_buffer_print_chars")
(return-type "none")
(parameters
'("const-char*" "chars")
'("int" "len")
)
)
(define-method print_unichar
(of-object "MooTermBuffer")
(c-name "moo_term_buffer_print_unichar")
(return-type "none")
(parameters
'("gunichar" "c")
)
)
;; From mootermline.h
(define-method len
(of-object "MooTermLine")
(c-name "moo_term_line_len")
(return-type "guint")
)
(define-method get_char
(of-object "MooTermLine")
(c-name "moo_term_line_get_char")
(return-type "gunichar")
(parameters
'("guint" "index_")
)
)
;; From mootermtag.h
(define-method set_attr
(of-object "MooTermTag")
(c-name "moo_term_tag_set_attr")
(return-type "none")
(parameters
'("MooTermTextAttr*" "attr")
)
(docstring "Tag.set_attr(attr) -> None.\n"
"\n"
"attr - TextAttr instance or None\n"
)
)
(define-method set_attributes
(of-object "MooTermTag")
(c-name "moo_term_tag_set_attributes")
(return-type "none")
(parameters
'("MooTermTextAttrMask" "mask" (null-ok) (default "0"))
'("MooTermTextColor" "foreground" (null-ok) (default "0"))
'("MooTermTextColor" "background" (null-ok) (default "0"))
)
(docstring "Tag.set_attributes(mask=0, foreground=0, background=0) -> None. Sets tag attributes\n"
"\n"
"mask - combination of TextAttrMask values\n"
"foreground - text color as TextColor value, has effect only if TEXT_FOREGROUND mask is set\n"
"background - background color as TextColor value, has effect only if TEXT_BACKGROUND mask is set\n"
)
)
(define-function moo_term_text_attr_new
(c-name "moo_term_text_attr_new")
(is-constructor-of "MooTermTextAttr")
(return-type "MooTermTextAttr*")
(parameters
'("MooTermTextAttrMask" "mask" (null-ok) (default "0"))
'("MooTermTextColor" "foreground" (null-ok) (default "0"))
'("MooTermTextColor" "background" (null-ok) (default "0"))
)
(docstring "TextAttr(mask=0, foreground=0, background=0) -> TextAttr.\n"
"\n"
"mask - combination of TextAttrMask values\n"
"foreground - text color as TextColor value, has effect only if TEXT_FOREGROUND mask is set\n"
"background - background color as TextColor value, has effect only if TEXT_BACKGROUND mask is set\n"
)
)
;; From mootermwindow.h
(define-function moo_term_window_new
(c-name "moo_term_window_new")
(is-constructor-of "MooTermWindow")
(return-type "GtkWidget*")
)
(define-method get_term
(of-object "MooTermWindow")
(c-name "moo_term_window_get_term")
(return-type "MooTerm*")
)
(define-method set_term_type
(of-object "MooTermWindow")
(c-name "moo_term_window_set_term_type")
(return-type "none")
(parameters
'("GType" "type")
)
)