libcef.string_list.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // This file manually written from cef/include/internal/cef_string_list.h.
  3. //
  4. namespace Xilium.CefGlue.Interop
  5. {
  6. using System;
  7. using System.Runtime.InteropServices;
  8. using System.Security;
  9. internal static unsafe partial class libcef
  10. {
  11. // Allocate a new string list.
  12. [DllImport(DllName, EntryPoint = "cef_string_list_alloc", CallingConvention = CEF_CALL)]
  13. public static extern cef_string_list* string_list_alloc();
  14. // Return the number of elements in the string list.
  15. [DllImport(DllName, EntryPoint = "cef_string_list_size", CallingConvention = CEF_CALL)]
  16. private static extern UIntPtr string_list_size_core(cef_string_list* list);
  17. public static int string_list_size(cef_string_list* list)
  18. {
  19. return checked((int)string_list_size_core(list));
  20. }
  21. // Retrieve the value at the specified zero-based string list index. Returns
  22. // true (1) if the value was successfully retrieved.
  23. [DllImport(DllName, EntryPoint = "cef_string_list_value", CallingConvention = CEF_CALL)]
  24. private static extern int string_list_value_core(cef_string_list* list, UIntPtr index, cef_string_t* value);
  25. public static int string_list_value(cef_string_list* list, int index, cef_string_t* value)
  26. {
  27. return string_list_value_core(list, checked((UIntPtr)index), value);
  28. }
  29. // Append a new value at the end of the string list.
  30. [DllImport(DllName, EntryPoint = "cef_string_list_append", CallingConvention = CEF_CALL)]
  31. public static extern void string_list_append(cef_string_list* list, cef_string_t* value);
  32. // Clear the string list.
  33. [DllImport(DllName, EntryPoint = "cef_string_list_clear", CallingConvention = CEF_CALL)]
  34. public static extern void string_list_clear(cef_string_list* list);
  35. // Free the string list.
  36. [DllImport(DllName, EntryPoint = "cef_string_list_free", CallingConvention = CEF_CALL)]
  37. public static extern void string_list_free(cef_string_list* list);
  38. // Creates a copy of an existing string list.
  39. [DllImport(DllName, EntryPoint = "cef_string_list_copy", CallingConvention = CEF_CALL)]
  40. public static extern cef_string_list* string_list_copy(cef_string_list* list);
  41. }
  42. }