;; -*- scheme -*-

(include "mate-types.defs")

; object definitions ...
(define-object Program
  (in-module "Mate")
  (parent "GObject")
  (c-name "MateProgram")
  (gtype-id "MATE_TYPE_PROGRAM")
)

;; Enumerations and flags ...

(define-enum HelpError
  (in-module "Mate")
  (c-name "MateHelpError")
  (gtype-id "MATE_TYPE_HELP_ERROR")
  (values
    '("internal" "MATE_HELP_ERROR_INTERNAL")
    '("not-found" "MATE_HELP_ERROR_NOT_FOUND")
  )
)

(define-enum FileDomain
  (in-module "Mate")
  (c-name "MateFileDomain")
  (gtype-id "MATE_TYPE_FILE_DOMAIN")
  (values
    '("unknown" "MATE_FILE_DOMAIN_UNKNOWN")
    '("libdir" "MATE_FILE_DOMAIN_LIBDIR")
    '("datadir" "MATE_FILE_DOMAIN_DATADIR")
    '("sound" "MATE_FILE_DOMAIN_SOUND")
    '("pixmap" "MATE_FILE_DOMAIN_PIXMAP")
    '("config" "MATE_FILE_DOMAIN_CONFIG")
    '("help" "MATE_FILE_DOMAIN_HELP")
    '("app-libdir" "MATE_FILE_DOMAIN_APP_LIBDIR")
    '("app-datadir" "MATE_FILE_DOMAIN_APP_DATADIR")
    '("app-sound" "MATE_FILE_DOMAIN_APP_SOUND")
    '("app-pixmap" "MATE_FILE_DOMAIN_APP_PIXMAP")
    '("app-config" "MATE_FILE_DOMAIN_APP_CONFIG")
    '("app-help" "MATE_FILE_DOMAIN_APP_HELP")
  )
)

(define-enum TriggerType
  (in-module "Mate")
  (c-name "MateTriggerType")
  (gtype-id "MATE_TYPE_TRIGGER_TYPE")
  (values
    '("none" "GTRIG_NONE")
    '("function" "GTRIG_FUNCTION")
    '("command" "GTRIG_COMMAND")
    '("mediaplay" "GTRIG_MEDIAPLAY")
  )
)

(define-enum URLError
  (in-module "Mate")
  (c-name "MateURLError")
  (gtype-id "MATE_TYPE_URL_ERROR")
  (values
    '("parse" "MATE_URL_ERROR_PARSE")
    '("launch" "MATE_URL_ERROR_LAUNCH")
    '("url" "MATE_URL_ERROR_URL")
    '("no-default" "MATE_URL_ERROR_NO_DEFAULT")
    '("not-supported" "MATE_URL_ERROR_NOT_SUPPORTED")
    '("vfs" "MATE_URL_ERROR_VFS")
  )
)


;; From /usr/include/libmate-2.0/libmate/mate-config.h

(define-function config_get_string_with_default_
  (c-name "mate_config_get_string_with_default_")
  (return-type "char*")
  (parameters
    '("const-char*" "path")
    '("gboolean*" "def")
    '("gboolean" "priv")
  )
)

(define-function config_get_translated_string_with_default_
  (c-name "mate_config_get_translated_string_with_default_")
  (return-type "char*")
  (parameters
    '("const-char*" "path")
    '("gboolean*" "def")
    '("gboolean" "priv")
  )
)

(define-function config_get_int_with_default_
  (c-name "mate_config_get_int_with_default_")
  (return-type "gint")
  (parameters
    '("const-char*" "path")
    '("gboolean*" "def")
    '("gboolean" "priv")
  )
)

(define-function config_get_float_with_default_
  (c-name "mate_config_get_float_with_default_")
  (return-type "gdouble")
  (parameters
    '("const-char*" "path")
    '("gboolean*" "def")
    '("gboolean" "priv")
  )
)

(define-function config_get_bool_with_default_
  (c-name "mate_config_get_bool_with_default_")
  (return-type "gboolean")
  (parameters
    '("const-char*" "path")
    '("gboolean*" "def")
    '("gboolean" "priv")
  )
)

(define-function config_get_vector_with_default_
  (c-name "mate_config_get_vector_with_default_")
  (return-type "none")
  (parameters
    '("const-char*" "path")
    '("gint*" "argcp")
    '("char***" "argvp")
    '("gboolean*" "def")
    '("gboolean" "priv")
  )
)

(define-function config_set_string_
  (c-name "mate_config_set_string_")
  (return-type "none")
  (parameters
    '("const-char*" "path")
    '("const-char*" "value")
    '("gboolean" "priv")
  )
)

(define-function config_set_translated_string_
  (c-name "mate_config_set_translated_string_")
  (return-type "none")
  (parameters
    '("const-char*" "path")
    '("const-char*" "value")
    '("gboolean" "priv")
  )
)

(define-function config_set_int_
  (c-name "mate_config_set_int_")
  (return-type "none")
  (parameters
    '("const-char*" "path")
    '("int" "value")
    '("gboolean" "priv")
  )
)

(define-function config_set_float_
  (c-name "mate_config_set_float_")
  (return-type "none")
  (parameters
    '("const-char*" "path")
    '("gdouble" "value")
    '("gboolean" "priv")
  )
)

(define-function config_set_bool_
  (c-name "mate_config_set_bool_")
  (return-type "none")
  (parameters
    '("const-char*" "path")
    '("gboolean" "value")
    '("gboolean" "priv")
  )
)

(define-function config_set_vector_
  (c-name "mate_config_set_vector_")
  (return-type "none")
  (parameters
    '("const-char*" "path")
    '("int" "argc")
    '("const-char*-const[]" "argv")
    '("gboolean" "priv")
  )
)

(define-function config_has_section_
  (c-name "mate_config_has_section_")
  (return-type "gboolean")
  (parameters
    '("const-char*" "path")
    '("gboolean" "priv")
  )
)

(define-function config_init_iterator_
  (c-name "mate_config_init_iterator_")
  (return-type "void*")
  (parameters
    '("const-char*" "path")
    '("gboolean" "priv")
  )
)

(define-function config_init_iterator_sections_
  (c-name "mate_config_init_iterator_sections_")
  (return-type "void*")
  (parameters
    '("const-char*" "path")
    '("gboolean" "priv")
  )
)

(define-function config_iterator_next
  (c-name "mate_config_iterator_next")
  (return-type "void*")
  (parameters
    '("void*" "iterator_handle")
    '("char**" "key")
    '("char**" "value")
  )
)

(define-function config_drop_all
  (c-name "mate_config_drop_all")
  (return-type "none")
)

(define-function config_sync
  (c-name "mate_config_sync")
  (return-type "gboolean")
)

(define-function config_sync_file_
  (c-name "mate_config_sync_file_")
  (return-type "gboolean")
  (parameters
    '("char*" "path")
    '("gboolean" "priv")
  )
)

(define-function config_drop_file_
  (c-name "mate_config_drop_file_")
  (return-type "none")
  (parameters
    '("const-char*" "path")
    '("gboolean" "priv")
  )
)

(define-function config_clean_file_
  (c-name "mate_config_clean_file_")
  (return-type "none")
  (parameters
    '("const-char*" "path")
    '("gboolean" "priv")
  )
)

(define-function config_clean_section_
  (c-name "mate_config_clean_section_")
  (return-type "none")
  (parameters
    '("const-char*" "path")
    '("gboolean" "priv")
  )
)

(define-function config_clean_key_
  (c-name "mate_config_clean_key_")
  (return-type "none")
  (parameters
    '("const-char*" "path")
    '("gboolean" "priv")
  )
)

(define-function config_push_prefix
  (c-name "mate_config_push_prefix")
  (return-type "none")
  (parameters
    '("const-char*" "path")
  )
)

(define-function config_pop_prefix
  (c-name "mate_config_pop_prefix")
  (return-type "none")
)

(define-function config_make_vector
  (c-name "mate_config_make_vector")
  (return-type "none")
  (parameters
    '("const-char*" "string")
    '("int*" "argcp")
    '("char***" "argvp")
  )
)

(define-function config_assemble_vector
  (c-name "mate_config_assemble_vector")
  (return-type "char*")
  (parameters
    '("int" "argc")
    '("const-char*-const-argv" "[]")
  )
)

(define-function config_set_set_handler
  (c-name "mate_config_set_set_handler")
  (return-type "none")
  (parameters
    '("void-(*" "func")
  )
)

(define-function config_set_sync_handler
  (c-name "mate_config_set_sync_handler")
  (return-type "none")
  (parameters
    '("void-(*" "func")
  )
)



;; From /usr/include/libmate-2.0/libmate/mate-exec.h

(define-function execute_async
  (c-name "mate_execute_async")
  (return-type "int")
  (parameters
    '("const-char*" "dir")
    '("int" "argc")
    '("char*-const[]" "argv")
  )
)

(define-function execute_async_fds
  (c-name "mate_execute_async_fds")
  (return-type "int")
  (parameters
    '("const-char*" "dir")
    '("int" "argc")
    '("char*-const[]" "argv")
    '("gboolean" "close_fds")
  )
)

(define-function execute_async_with_env
  (c-name "mate_execute_async_with_env")
  (return-type "int")
  (parameters
    '("const-char*" "dir")
    '("int" "argc")
    '("char*-const[]" "argv")
    '("int" "envc")
    '("char*-const[]" "envv")
  )
)

(define-function execute_async_with_env_fds
  (c-name "mate_execute_async_with_env_fds")
  (return-type "int")
  (parameters
    '("const-char*" "dir")
    '("int" "argc")
    '("char*-const[]" "argv")
    '("int" "envc")
    '("char*-const[]" "envv")
    '("gboolean" "close_fds")
  )
)

(define-function execute_shell
  (c-name "mate_execute_shell")
  (return-type "int")
  (parameters
    '("const-char*" "dir")
    '("const-char*" "commandline")
  )
)

(define-function execute_shell_fds
  (c-name "mate_execute_shell_fds")
  (return-type "int")
  (parameters
    '("const-char*" "dir")
    '("const-char*" "commandline")
    '("gboolean" "close_fds")
  )
)

(define-function prepend_terminal_to_vector
  (c-name "mate_prepend_terminal_to_vector")
  (return-type "none")
  (parameters
    '("int*" "argc")
    '("char***" "argv")
  )
)

(define-function execute_terminal_shell
  (c-name "mate_execute_terminal_shell")
  (return-type "int")
  (parameters
    '("const-char*" "dir")
    '("const-char*" "commandline")
  )
)

(define-function execute_terminal_shell_fds
  (c-name "mate_execute_terminal_shell_fds")
  (return-type "int")
  (parameters
    '("const-char*" "dir")
    '("const-char*" "commandline")
    '("gboolean" "close_fds")
  )
)



;; From /usr/include/libmate-2.0/libmate/mate-mateconf.h

(define-function mateconf_get_mate_libs_settings_relative
  (c-name "mate_mateconf_get_mate_libs_settings_relative")
  (return-type "gchar*")
  (parameters
    '("const-gchar*" "subkey")
  )
)

(define-function mateconf_get_app_settings_relative
  (c-name "mate_mateconf_get_app_settings_relative")
  (return-type "gchar*")
  (parameters
    '("MateProgram*" "program")
    '("const-gchar*" "subkey")
  )
)



;; From /usr/include/libmate-2.0/libmate/mate-help.h

(define-function help_error_quark
  (c-name "mate_help_error_quark")
  (return-type "GQuark")
)

(define-function help_display
  (c-name "mate_help_display")
  (return-type "gboolean")
  (parameters
    '("const-char*" "file_name")
    '("const-char*" "link_id")
    '("GError**" "error")
  )
)

(define-function help_display_with_doc_id
  (c-name "mate_help_display_with_doc_id")
  (return-type "gboolean")
  (parameters
    '("MateProgram*" "program")
    '("const-char*" "doc_id")
    '("const-char*" "file_name")
    '("const-char*" "link_id")
    '("GError**" "error")
  )
)

(define-function help_display_desktop
  (c-name "mate_help_display_desktop")
  (return-type "gboolean")
  (parameters
    '("MateProgram*" "program")
    '("const-char*" "doc_id")
    '("const-char*" "file_name")
    '("const-char*" "link_id")
    '("GError**" "error")
  )
)

(define-function help_display_uri
  (c-name "mate_help_display_uri")
  (return-type "gboolean")
  (parameters
    '("const-char*" "help_uri")
    '("GError**" "error")
  )
)

(define-function help_display_uri_with_env
  (c-name "mate_help_display_uri_with_env")
  (return-type "gboolean")
  (parameters
    '("const-char*" "help_uri")
    '("char**" "envp")
    '("GError**" "error")
  )
)

(define-function help_display_with_doc_id_and_env
  (c-name "mate_help_display_with_doc_id_and_env")
  (return-type "gboolean")
  (parameters
    '("MateProgram*" "program")
    '("const-char*" "doc_id")
    '("const-char*" "file_name")
    '("const-char*" "link_id")
    '("char**" "envp")
    '("GError**" "error")
  )
)

(define-function help_display_desktop_with_env
  (c-name "mate_help_display_desktop_with_env")
  (return-type "gboolean")
  (parameters
    '("MateProgram*" "program")
    '("const-char*" "doc_id")
    '("const-char*" "file_name")
    '("const-char*" "link_id")
    '("char**" "envp")
    '("GError**" "error")
  )
)



;; From /usr/include/libmate-2.0/libmate/mate-i18n.h

(define-function i18n_get_language_list
  (c-name "mate_i18n_get_language_list")
  (return-type "const-GList*")
  (parameters
    '("const-gchar*" "category_name")
  )
)

(define-function i18n_push_c_numeric_locale
  (c-name "mate_i18n_push_c_numeric_locale")
  (return-type "none")
)

(define-function i18n_pop_c_numeric_locale
  (c-name "mate_i18n_pop_c_numeric_locale")
  (return-type "none")
)



;; From /usr/include/libmate-2.0/libmate/mate-init.h

(define-function libmate_module_info_get
  (c-name "libmate_module_info_get")
  (return-type "const-MateModuleInfo*")
)

(define-function matecomponent_module_info_get
  (c-name "mate_matecomponent_module_info_get")
  (return-type "const-MateModuleInfo*")
)

(define-function user_dir_get
  (c-name "mate_user_dir_get")
  (return-type "const-char*")
)

(define-function user_private_dir_get
  (c-name "mate_user_private_dir_get")
  (return-type "const-char*")
)

(define-function user_accels_dir_get
  (c-name "mate_user_accels_dir_get")
  (return-type "const-char*")
)



;; From /usr/include/libmate-2.0/libmate/mate-macros.h



;; From /usr/include/libmate-2.0/libmate/mate-program.h

(define-function program_get_type
  (c-name "mate_program_get_type")
  (return-type "GType")
)

(define-function program_get
  (c-name "mate_program_get")
  (return-type "MateProgram*")
)

(define-method get_human_readable_name
  (of-object "MateProgram")
  (c-name "mate_program_get_human_readable_name")
  (return-type "const-char*")
)

(define-method get_app_id
  (of-object "MateProgram")
  (c-name "mate_program_get_app_id")
  (return-type "const-char*")
)

(define-method get_app_version
  (of-object "MateProgram")
  (c-name "mate_program_get_app_version")
  (return-type "const-char*")
)

(define-method locate_file
  (of-object "MateProgram")
  (c-name "mate_program_locate_file")
  (return-type "gchar*")
  (parameters
    '("MateFileDomain" "domain")
    '("const-gchar*" "file_name")
    '("gboolean" "only_if_exists")
    '("GSList**" "ret_locations")
  )
)

(define-function module_info_get_type
  (c-name "mate_module_info_get_type")
  (return-type "GType")
)

(define-function program_module_register
  (c-name "mate_program_module_register")
  (return-type "none")
  (parameters
    '("const-MateModuleInfo*" "module_info")
  )
)

(define-function program_module_registered
  (c-name "mate_program_module_registered")
  (return-type "gboolean")
  (parameters
    '("const-MateModuleInfo*" "module_info")
  )
)

(define-function program_module_load
  (c-name "mate_program_module_load")
  (return-type "const-MateModuleInfo*")
  (parameters
    '("const-char*" "mod_name")
  )
)

(define-function program_install_property
  (c-name "mate_program_install_property")
  (return-type "guint")
  (parameters
    '("MateProgramClass*" "pclass")
    '("GObjectGetPropertyFunc" "get_fn")
    '("GObjectSetPropertyFunc" "set_fn")
    '("GParamSpec*" "pspec")
  )
)

(define-method preinit
  (of-object "MateProgram")
  (c-name "mate_program_preinit")
  (return-type "poptContext")
  (parameters
    '("const-char*" "app_id")
    '("const-char*" "app_version")
    '("int" "argc")
    '("char**" "argv")
  )
)

(define-method parse_args
  (of-object "MateProgram")
  (c-name "mate_program_parse_args")
  (return-type "none")
)

(define-method postinit
  (of-object "MateProgram")
  (c-name "mate_program_postinit")
  (return-type "none")
)

(define-function program_init
  (c-name "mate_program_init")
  (return-type "MateProgram*")
  (parameters
    '("const-char*" "app_id")
    '("const-char*" "app_version")
    '("const-MateModuleInfo*" "module_info")
    '("int" "argc")
    '("char**" "argv")
    '("const-char*" "first_property_name")
  )
  (varargs #t)
)

(define-function program_initv
  (c-name "mate_program_initv")
  (return-type "MateProgram*")
  (parameters
    '("GType" "type")
    '("const-char*" "app_id")
    '("const-char*" "app_version")
    '("const-MateModuleInfo*" "module_info")
    '("int" "argc")
    '("char**" "argv")
    '("const-char*" "first_property_name")
    '("va_list" "args")
  )
)

(define-function program_init_paramv
  (c-name "mate_program_init_paramv")
  (return-type "MateProgram*")
  (parameters
    '("GType" "type")
    '("const-char*" "app_id")
    '("const-char*" "app_version")
    '("const-MateModuleInfo*" "module_info")
    '("int" "argc")
    '("char**" "argv")
    '("guint" "nparams")
    '("GParameter*" "params")
  )
)



;; From /usr/include/libmate-2.0/libmate/mate-score.h

(define-function score_init
  (c-name "mate_score_init")
  (return-type "gint")
  (parameters
    '("const-gchar*" "gamename")
  )
)

(define-function score_log
  (c-name "mate_score_log")
  (return-type "gint")
  (parameters
    '("gfloat" "score")
    '("const-gchar*" "level")
    '("gboolean" "higher_to_lower_score_order")
  )
)

(define-function score_get_notable
  (c-name "mate_score_get_notable")
  (return-type "gint")
  (parameters
    '("const-gchar*" "gamename")
    '("const-gchar*" "level")
    '("gchar***" "names")
    '("gfloat**" "scores")
    '("time_t**" "scoretimes")
  )
)



;; From /usr/include/libmate-2.0/libmate/mate-sound.h

(define-function sound_connection_get
  (c-name "mate_sound_connection_get")
  (return-type "int")
)

(define-function sound_init
  (c-name "mate_sound_init")
  (return-type "none")
  (parameters
    '("const-char*" "hostname")
  )
)

(define-function sound_shutdown
  (c-name "mate_sound_shutdown")
  (return-type "none")
)

(define-function sound_sample_load
  (c-name "mate_sound_sample_load")
  (return-type "int")
  (parameters
    '("const-char*" "sample_name")
    '("const-char*" "filename")
  )
)

(define-function sound_play
  (c-name "mate_sound_play")
  (return-type "none")
  (parameters
    '("const-char*" "filename")
  )
)



;; From /usr/include/libmate-2.0/libmate/mate-triggers.h

(define-method s_add_trigger
  (of-object "MateTrigger")
  (c-name "mate_triggers_add_trigger")
  (return-type "none")
  (parameters
  )
  (varargs #t)
)

(define-method s_vadd_trigger
  (of-object "MateTrigger")
  (c-name "mate_triggers_vadd_trigger")
  (return-type "none")
  (parameters
    '("char*[]" "supinfo")
  )
)

(define-function triggers_do
  (c-name "mate_triggers_do")
  (return-type "none")
  (parameters
    '("const-char*" "msg")
    '("const-char*" "level")
  )
  (varargs #t)
)

(define-function triggers_vdo
  (c-name "mate_triggers_vdo")
  (return-type "none")
  (parameters
    '("const-char*" "msg")
    '("const-char*" "level")
    '("const-char*[]" "supinfo")
  )
)



;; From /usr/include/libmate-2.0/libmate/mate-url.h

(define-function url_error_quark
  (c-name "mate_url_error_quark")
  (return-type "GQuark")
)

(define-function url_show
  (c-name "mate_url_show")
  (return-type "gboolean")
  (parameters
    '("const-char*" "url")
    '("GError**" "error")
  )
)

(define-function url_show_with_env
  (c-name "mate_url_show_with_env")
  (return-type "gboolean")
  (parameters
    '("const-char*" "url")
    '("char**" "envp")
    '("GError**" "error")
  )
)



;; From /usr/include/libmate-2.0/libmate/mate-util.h

(define-function g_extension_pointer
  (c-name "g_extension_pointer")
  (return-type "const-char*")
  (parameters
    '("const-char*" "path")
  )
)

(define-function util_user_shell
  (c-name "mate_util_user_shell")
  (return-type "char*")
)

(define-function setenv
  (c-name "mate_setenv")
  (return-type "int")
  (parameters
    '("const-char*" "name")
    '("const-char*" "value")
    '("gboolean" "overwrite")
  )
)

(define-function unsetenv
  (c-name "mate_unsetenv")
  (return-type "none")
  (parameters
    '("const-char*" "name")
  )
)

(define-function clearenv
  (c-name "mate_clearenv")
  (return-type "none")
)



;; From /usr/include/libmate-2.0/libmate/libmate.h



;; From /usr/include/libmate-2.0/libmate/libmatetypebuiltins.h

(define-function trigger_type_get_type
  (c-name "mate_trigger_type_get_type")
  (return-type "GType")
)

(define-function file_domain_get_type
  (c-name "mate_file_domain_get_type")
  (return-type "GType")
)

(define-function help_error_get_type
  (c-name "mate_help_error_get_type")
  (return-type "GType")
)

(define-function url_error_get_type
  (c-name "mate_url_error_get_type")
  (return-type "GType")
)


;; This method doesn't exist in libmate
(define-method get_popt_args
  (of-object "MateProgram")
  (c-name "mate_get_popt_args")
  (return-type "none")
)

;; This function doesn't exist in libmate
(define-function popt_parse
  (c-name "mate_popt_parse")
  (parameters
    '("PyObject*" "argv")
    '("PyObject*" "table")
    '("int"       "flags" (default "0"))
  )
  (return-type "none")
)

