
Components.utils.import("resource://gre/modules/ctypes.jsm");
function UnityWebapps() {
    try {
        this.lib = ctypes.open("libunity-webapps.so.0");
    } catch (e) {
        try {
            this.lib = ctypes.open("/usr/local/lib/libunity-webapps.so.0");
        } catch (e) {
            this.lib = ctypes.open("/usr/lib/libunity-webapps.so.0");
        }
    }

    try {
        this._lib = ctypes.open("libunity-webapps-repository.so.0");
    } catch (e) {
        try {
            this._lib = ctypes.open("/usr/local/lib/libunity-webapps-repository.so.0");
        } catch (e) {
            this._lib = ctypes.open("/usr/lib/libunity-webapps-repository.so.0");
        }
    }
    this.ContextAcceptDataChangedType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.char.ptr,ctypes.voidptr_t,]);
    this.desktop_infos_generate_desktop_for_url_launch =
    this._lib.declare("unity_webapps_desktop_infos_generate_desktop_for_url_launch",
                     ctypes.default_abi,
                     ctypes.void_t, ctypes.char.ptr, ctypes.char.ptr, ctypes.char.ptr, ctypes.char.ptr);
    this.unity_webapps_desktop_infos_build_desktop_basename =
        this._lib.declare("unity_webapps_desktop_infos_build_desktop_basename", ctypes.default_abi, ctypes.char.ptr, ctypes.char.ptr, ctypes.char.ptr);

    this.unity_webapps_application_repository_add_desktop_to_launcher =
        this._lib.declare("unity_webapps_application_repository_add_desktop_to_launcher", ctypes.default_abi, ctypes.void_t, ctypes.char.ptr);
    
  this.ContextActionCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.voidptr_t,]);
  this.ContextCloseCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.voidptr_t,]);
  this.ContextLocationNotifyCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.int32_t,ctypes.char.ptr,ctypes.voidptr_t,]);
  this.ContextNotifyCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.int32_t,ctypes.voidptr_t,]);
  this.ContextPreviewCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.char.ptr,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.voidptr_t,]);
  this.ContextPreviewReadyCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.int32_t,ctypes.char.ptr,ctypes.voidptr_t,]);
  this.ContextRaiseCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.char.ptr,ctypes.voidptr_t,]);
  this.ContextReadyCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.voidptr_t,]);
  this.ContextViewNotifyCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.int32_t,ctypes.int32_t,ctypes.voidptr_t,]);
  this.ContextWindowNotifyCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.int32_t,ctypes.uint64_t,ctypes.voidptr_t,]);
  this.IndicatorCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.voidptr_t,]);
  this.LauncherCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.voidptr_t,]);
  this.MusicPlayerCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.voidptr_t,]);
  this.MusicPlayerPlaylistCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsContext */,ctypes.char.ptr,ctypes.voidptr_t,]);
  this.ServiceContextNotifyCallbackType = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t,[ctypes.voidptr_t /* UnityWebappsService */,ctypes.char.ptr,ctypes.voidptr_t,]);
  this.ApplicationActionDesc = ctypes.StructType('ApplicationActionDesc', [  { 'path' : ctypes.char.ptr, },   { 'callback' : this.ContextActionCallbackType.ptr, },   { 'user_data' : ctypes.voidptr_t, }, ]);
  this.StrWrapperDesc = ctypes.StructType('StrWrapperDesc', [  { 'str' : ctypes.char.ptr, }, ]);
  this.permissions_allow_domain = 
    this.lib.declare("unity_webapps_permissions_allow_domain",
                     ctypes.default_abi,
                     ctypes.void_t,ctypes.char.ptr);
  this.permissions_dontask_domain = 
    this.lib.declare("unity_webapps_permissions_dontask_domain",
                     ctypes.default_abi,
                     ctypes.void_t,ctypes.char.ptr);
  this.permissions_get_all_domains = 
    this.lib.declare("unity_webapps_permissions_get_all_domains",
                     ctypes.default_abi,
                     ctypes.char.ptr);
  this.permissions_get_domain_allowed = 
    this.lib.declare("unity_webapps_permissions_get_domain_allowed",
                     ctypes.default_abi,
                     ctypes.int32_t,ctypes.char.ptr);
  this.permissions_get_domain_dontask = 
    this.lib.declare("unity_webapps_permissions_get_domain_dontask",
                     ctypes.default_abi,
                     ctypes.int32_t,ctypes.char.ptr);
  this.permissions_get_domain_preauthorized = 
    this.lib.declare("unity_webapps_permissions_get_domain_preauthorized",
                     ctypes.default_abi,
                     ctypes.int32_t,ctypes.char.ptr);
  this.permissions_is_integration_allowed = 
    this.lib.declare("unity_webapps_permissions_is_integration_allowed",
                     ctypes.default_abi,
                     ctypes.int32_t);
  this.permissions_remove_domain_from_permissions = 
    this.lib.declare("unity_webapps_permissions_remove_domain_from_permissions",
                     ctypes.default_abi,
                     ctypes.void_t,ctypes.char.ptr);
  this.permissions_set_integration_allowed = 
    this.lib.declare("unity_webapps_permissions_set_integration_allowed",
                     ctypes.default_abi,
                     ctypes.void_t,ctypes.int32_t);
  this.permissions_tests_use_memory_backend = 
    this.lib.declare("unity_webapps_permissions_tests_use_memory_backend",
                     ctypes.default_abi,
                     ctypes.void_t,ctypes.char.ptr);
  this.rate_check_indicator_rate_limit = 
    this.lib.declare("unity_webapps_rate_check_indicator_rate_limit",
                     ctypes.default_abi,
                     ctypes.int32_t,ctypes.voidptr_t /* UnityWebappsContext */);
  this.rate_check_launcher_rate_limit = 
    this.lib.declare("unity_webapps_rate_check_launcher_rate_limit",
                     ctypes.default_abi,
                     ctypes.int32_t,ctypes.voidptr_t /* UnityWebappsContext */);
  this.rate_check_music_player_rate_limit = 
    this.lib.declare("unity_webapps_rate_check_music_player_rate_limit",
                     ctypes.default_abi,
                     ctypes.int32_t,ctypes.voidptr_t /* UnityWebappsContext */);
  this.rate_check_notification_rate_limit = 
    this.lib.declare("unity_webapps_rate_check_notification_rate_limit",
                     ctypes.default_abi,
                     ctypes.int32_t,ctypes.voidptr_t /* UnityWebappsContext */);
  this.sanitizer_limit_string_argument = 
    this.lib.declare("unity_webapps_sanitizer_limit_string_argument",
                     ctypes.default_abi,
                     ctypes.char.ptr,ctypes.char.ptr,ctypes.int32_t);
  this.sanitizer_limit_strv_argument = 
    this.lib.declare("unity_webapps_sanitizer_limit_strv_argument",
                     ctypes.default_abi,
                     ctypes.char.ptr,ctypes.int32_t,ctypes.int32_t);

  this.service_new =
    this.lib.declare("unity_webapps_service_new",
                     ctypes.default_abi,
                     ctypes.voidptr_t /* UnityWebappsService */);
}
var EXPORTED_SYMBOLS=["UnityWebapps"];
