<commit_before>;;; webkit2.web-context.lisp --- bindings for WebKitWebContext

;; Copyright (c) 2014 <NAME>
;;
;; This file is part of cl-webkit.
;;
;; cl-webkit is free software; you can redistribute it and/or modify
;; it under the terms of the MIT license.
;; See `COPYING' in the source distribution for details.

;;; Code:

(in-package :webkit2)

(define-webkit-class "WebKitWebContext" () ())

(define-g-enum "WebKitCacheModel" webkit-cache-model ()
  :webkit-cache-model-document-viewer
  :webkit-cache-model-web-browser
  :webkit-cache-model-document-browser)

(defcfun "webkit_web_context_get_default" (g-object webkit-web-context))
(export 'webkit-web-context-get-default)

(defcfun "webkit_web_context_set_cache_model" :void
  (webkit-web-context (g-object webkit-web-context))
  (webkit-cache-model webkit-cache-model))
(export 'webkit-web-context-set-cache-model)

(defcfun "webkit_web_context_get_cache_model" webkit-cache-model
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-cache-model)

(defcfun "webkit_web_context_clear_cache" :void
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-clear-cache)

(defcfun "webkit_web_context_download_uri" (g-object webkit-download)
  (webkit-web-context (g-object webkit-web-context))
  (uri :string))
(export 'webkit-web-context-download-uri)

(defcfun "webkit_web_context_get_cookie_manager" (g-object webkit-cookie-manager)
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-cookie-manager)

(defcfun "webkit_web_context_get_favicon_database" (g-object webkit-favicon-database)
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-favicon-database)

(defcfun "webkit_web_context_set_favicon_database_directory" :void
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-set-favicon-database-directory)

(defcfun "webkit_web_context_get_favicon_database_directory" :string
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-favicon-database-directory)

(defcfun "webkit_web_context_get_security_manager" (g-object webkit-security-manager)
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-security-manager)

(defcfun "webkit_web_context_set_additional_plugins_directory" :void
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-set-additional-plugins-directory)

(defcfun "webkit_web_context_get_plugins" :void
  (webkit-web-context (g-object webkit-web-context))
  (cancellable :pointer)
  (callback    :pointer)
  (user_data   :pointer))
(export 'webkit-web-context-get-plugins)

(defcfun "webkit_web_context_get_plugins_finish" (glib:g-list webkit-plugin)
  (webkit-web-context (g-object webkit-web-context))
  (gasync-result :pointer)
  (gerror :pointer))
(export 'webkit-web-context-get-plugins-finish)

(defcfun "webkit_web_context_register_uri_scheme" :void
  (webkit-web-context (g-object webkit-web-context))
  (scheme :string)
  (webkit-uri-scheme-request-callback :pointer)
  (user_data :pointer)
  (gdestroynotify :pointer))
(export 'webkit-web-context-register-uri-scheme)

(defcfun "webkit_web_context_get_spell_checking_enabled" :boolean
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-spell-checking-enabled)

(defcfun "webkit_web_context_set_spell_checking_enabled" :void
  (webkit-web-context (g-object webkit-web-context))
  (enabled :boolean))
(export 'webkit-web-context-set-spell-checking-enabled)

(defcfun "webkit_web_context_get_spell_checking_languages" :pointer
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-spell-checking-languages)

(defcfun "webkit_web_context_set_spell_checking_languages" :void
  (webkit-web-context (g-object webkit-web-context))
  (languages :string))
(export 'webkit-web-context-set-spell-checking-languages)

(defcfun "webkit_web_context_set_preferred_languages" :void
  (webkit-web-context (g-object webkit-web-context))
  (languages :string))
(export 'webkit-web-context-set-preferred-languages)

(define-g-enum "WebKitTLSErrorsPolicy" webkit-tls-errors-policy ()
  :webkit-tls-errors-policy-ignore
  :webkit-tls-errors-policy-fail)

(defcfun "webkit_web_context_set_tls_errors_policy" :void
  (webkit-web-context (g-object webkit-web-context))
  (policy webkit-tls-errors-policy))
(export 'webkit-web-context-set-tls-errors-policy)

(defcfun "webkit_web_context_get_tls_errors_policy" webkit-tls-errors-policy
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-tls-errors-policy)

(defcfun "webkit_web_context_set_web_extensions_directory" :void
  (webkit-web-context (g-object webkit-web-context))
  (directory :string))
(export 'webkit-web-context-set-web-extensions-directory)

(defcfun "webkit_web_context_set_web_extensions_initialization_user_data" :void
  (webkit-web-context (g-object webkit-web-context))
  (user_data :pointer))
(export 'webkit-web-context-set-web-extensions-initialization-user-data)

(defcfun "webkit_web_context_prefetch_dns" :void
  (webkit-web-context (g-object webkit-web-context))
  (hostname :string))
(export 'webkit-web-context-prefetch-dns)

(defcfun "webkit_web_context_set_disk_cache_directory" :void
  (webkit-web-context (g-object webkit-web-context))
  (hostname :string))
(export 'webkit-web-context-set-disk-cache-directory)

(defcfun "webkit_web_context_allow_tls_certificate_for_host" :void
  (webkit-web-context (g-object webkit-web-context))
  (webkit-certificate-info :pointer)
  (host :string))
(export 'webkit-web-context-allow-tls-certificate-for-host)

(define-g-enum "WebKitProcessModel" webkit-process-model ()
  :webkit-process-model-shared-secondary-process
  :webkit-process-model-multiple-secondary-processes)

(defcfun "webkit_web_context_set_process_model" :void
  (webkit-web-context (g-object webkit-web-context))
  (webkit-process-model webkit-process-model))
(export 'webkit-web-context-set-process-model)

(defcfun "webkit_web_context_get_process_model" webkit-process-model
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-process-model)
<commit_msg>web-context: internal re-organisation<commit_after>;;; webkit2.web-context.lisp --- bindings for WebKitWebContext

;; Copyright (c) 2014 <NAME>
;;
;; This file is part of cl-webkit.
;;
;; cl-webkit is free software; you can redistribute it and/or modify
;; it under the terms of the MIT license.
;; See `COPYING' in the source distribution for details.

;;; Code:

(in-package :webkit2)

(define-webkit-class "WebKitWebContext" () ())

(define-g-enum "WebKitCacheModel" webkit-cache-model ()
  :webkit-cache-model-document-viewer
  :webkit-cache-model-web-browser
  :webkit-cache-model-document-browser)

(define-g-enum "WebKitTLSErrorsPolicy" webkit-tls-errors-policy ()
  :webkit-tls-errors-policy-ignore
  :webkit-tls-errors-policy-fail)

(define-g-enum "WebKitProcessModel" webkit-process-model ()
  :webkit-process-model-shared-secondary-process
  :webkit-process-model-multiple-secondary-processes)

(defcfun "webkit_web_context_get_default" (g-object webkit-web-context))
(export 'webkit-web-context-get-default)

(defcfun "webkit_web_context_set_cache_model" :void
  (webkit-web-context (g-object webkit-web-context))
  (webkit-cache-model webkit-cache-model))
(export 'webkit-web-context-set-cache-model)

(defcfun "webkit_web_context_get_cache_model" webkit-cache-model
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-cache-model)

(defcfun "webkit_web_context_clear_cache" :void
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-clear-cache)

(defcfun "webkit_web_context_download_uri" (g-object webkit-download)
  (webkit-web-context (g-object webkit-web-context))
  (uri :string))
(export 'webkit-web-context-download-uri)

(defcfun "webkit_web_context_get_cookie_manager" (g-object webkit-cookie-manager)
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-cookie-manager)

(defcfun "webkit_web_context_get_favicon_database" (g-object webkit-favicon-database)
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-favicon-database)

(defcfun "webkit_web_context_set_favicon_database_directory" :void
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-set-favicon-database-directory)

(defcfun "webkit_web_context_get_favicon_database_directory" :string
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-favicon-database-directory)

(defcfun "webkit_web_context_get_security_manager" (g-object webkit-security-manager)
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-security-manager)

(defcfun "webkit_web_context_set_additional_plugins_directory" :void
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-set-additional-plugins-directory)

(defcfun "webkit_web_context_get_plugins" :void
  (webkit-web-context (g-object webkit-web-context))
  (cancellable :pointer)
  (callback    :pointer)
  (user_data   :pointer))
(export 'webkit-web-context-get-plugins)

(defcfun "webkit_web_context_get_plugins_finish" (glib:g-list webkit-plugin)
  (webkit-web-context (g-object webkit-web-context))
  (gasync-result :pointer)
  (gerror :pointer))
(export 'webkit-web-context-get-plugins-finish)

(defcfun "webkit_web_context_get_spell_checking_enabled" :boolean
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-spell-checking-enabled)

(defcfun "webkit_web_context_set_spell_checking_enabled" :void
  (webkit-web-context (g-object webkit-web-context))
  (enabled :boolean))
(export 'webkit-web-context-set-spell-checking-enabled)

(defcfun "webkit_web_context_get_spell_checking_languages" :pointer ;; XXX: const gchar * const *
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-spell-checking-languages)

(defcfun "webkit_web_context_set_spell_checking_languages" :void
  (webkit-web-context (g-object webkit-web-context))
  (languages :string))
(export 'webkit-web-context-set-spell-checking-languages)

(defcfun "webkit_web_context_set_preferred_languages" :void
  (webkit-web-context (g-object webkit-web-context))
  (languages :string))
(export 'webkit-web-context-set-preferred-languages)

(defcfun "webkit_web_context_set_tls_errors_policy" :void
  (webkit-web-context (g-object webkit-web-context))
  (policy webkit-tls-errors-policy))
(export 'webkit-web-context-set-tls-errors-policy)

(defcfun "webkit_web_context_get_tls_errors_policy" webkit-tls-errors-policy
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-tls-errors-policy)

(defcfun "webkit_web_context_set_web_extensions_directory" :void
  (webkit-web-context (g-object webkit-web-context))
  (directory :string))
(export 'webkit-web-context-set-web-extensions-directory)

(defcfun "webkit_web_context_set_web_extensions_initialization_user_data" :void
  (webkit-web-context (g-object webkit-web-context))
  (user_data :pointer))
(export 'webkit-web-context-set-web-extensions-initialization-user-data)

(defcfun "webkit_web_context_prefetch_dns" :void
  (webkit-web-context (g-object webkit-web-context))
  (hostname :string))
(export 'webkit-web-context-prefetch-dns)

(defcfun "webkit_web_context_set_disk_cache_directory" :void
  (webkit-web-context (g-object webkit-web-context))
  (hostname :string))
(export 'webkit-web-context-set-disk-cache-directory)

(defcfun "webkit_web_context_allow_tls_certificate_for_host" :void
  (webkit-web-context (g-object webkit-web-context))
  (webkit-certificate-info :pointer)
  (host :string))
(export 'webkit-web-context-allow-tls-certificate-for-host)

(defcfun "webkit_web_context_set_process_model" :void
  (webkit-web-context (g-object webkit-web-context))
  (webkit-process-model webkit-process-model))
(export 'webkit-web-context-set-process-model)

(defcfun "webkit_web_context_get_process_model" webkit-process-model
  (webkit-web-context (g-object webkit-web-context)))
(export 'webkit-web-context-get-process-model)

(defcfun "webkit_web_context_register_uri_scheme" :void
  (webkit-web-context (g-object webkit-web-context))
  (scheme :string)
  (webkit-uri-scheme-request-callback :pointer)
  (user_data :pointer)
  (gdestroynotify :pointer))
(export 'webkit-web-context-register-uri-scheme)

{'fraction_non_alphanumeric': 0.13623326959847037, 'fraction_numerical': 0.0009560229445506692, 'mean_word_length': 6.052247191011236, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '342915', 'n_tokens_mistral': 4625, 'n_tokens_neox': 4403, 'n_words': 672}