Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bindings/csharp/src/CNativeAPI/generated/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,9 @@ public static partial class Interop
[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern ulong native_window_get_parent_window(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern ulong native_window_get_taskbar(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_window_blur(ulong self);

Expand Down
201 changes: 201 additions & 0 deletions bindings/csharp/src/CNativeAPI/generated/WindowTaskbar.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
// AUTO-GENERATED. DO NOT EDIT.
// Any manual changes WILL BE LOST when this file is regenerated.
#nullable enable

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;

namespace CNativeAPI;

[StructLayout(LayoutKind.Sequential)]
public struct native_taskbar_flash_options_t
{
public int target;
public int count;
public int timeout_ms;
public byte stop_on_foreground;
}

[StructLayout(LayoutKind.Sequential)]
public struct native_taskbar_event_t
{
public int type;
public DataUnion data;

[StructLayout(LayoutKind.Explicit)]
public struct DataUnion
{
[FieldOffset(0)] public ThumbnailButtonClickedData thumbnail_button_clicked;
}

[StructLayout(LayoutKind.Sequential)]
public struct ThumbnailButtonClickedData
{
public uint button_id;
}
}

[StructLayout(LayoutKind.Sequential)]
public struct native_taskbar_thumbnail_button_list_t
{
public IntPtr taskbar_thumbnail_buttons;
public CLong count;
}

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void TaskbarEventNativeCallback(IntPtr evt, IntPtr userData);

public static partial class Interop
{
[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_taskbar_thumbnail_button_has_background(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_taskbar_thumbnail_button_is_dismiss_on_click(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_taskbar_thumbnail_button_is_enabled(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_taskbar_thumbnail_button_is_interactive(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_taskbar_thumbnail_button_is_visible(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_taskbar_thumbnail_button_remove_listener(ulong self, ulong listenerId);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_add_thumbnail_button(ulong self, ulong button);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_insert_thumbnail_button(ulong self, CULong index, ulong button);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_is_supported();

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_remove_listener(ulong self, ulong listenerId);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_remove_thumbnail_button(ulong self, ulong button);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_remove_thumbnail_button_at(ulong self, CULong index);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_remove_thumbnail_button_by_id(ulong self, uint buttonId);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_set_overlay_icon(ulong self, ulong icon, [MarshalAs(UnmanagedType.LPUTF8Str)] string? description);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_set_progress_state(ulong self, int state);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_set_progress_value(ulong self, double progress);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_start_flashing(ulong self, native_taskbar_flash_options_t options);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool native_window_taskbar_stop_flashing(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern CULong native_window_taskbar_get_max_thumbnail_button_count();

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern CULong native_window_taskbar_get_thumbnail_button_count(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr native_taskbar_thumbnail_button_get_tooltip(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr native_window_taskbar_get_overlay_icon_description(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern double native_window_taskbar_get_progress_value(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern int native_window_taskbar_get_progress_state(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern native_taskbar_thumbnail_button_list_t native_window_taskbar_get_all_thumbnail_buttons(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern uint native_taskbar_thumbnail_button_get_id(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern ulong native_taskbar_thumbnail_button_add_listener(ulong self, TaskbarEventNativeCallback callback, IntPtr userData, ReleaseUserDataNativeCallback releaseUserData);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern ulong native_taskbar_thumbnail_button_create(ulong icon, [MarshalAs(UnmanagedType.LPUTF8Str)] string? tooltip);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern ulong native_taskbar_thumbnail_button_get_icon(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern ulong native_window_taskbar_add_listener(ulong self, TaskbarEventNativeCallback callback, IntPtr userData, ReleaseUserDataNativeCallback releaseUserData);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern ulong native_window_taskbar_get_overlay_icon(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern ulong native_window_taskbar_get_thumbnail_button_at(ulong self, CULong index);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern ulong native_window_taskbar_get_thumbnail_button_by_id(ulong self, uint buttonId);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_taskbar_thumbnail_button_free(ulong handle);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_taskbar_thumbnail_button_list_release(ref native_taskbar_thumbnail_button_list_t list);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_taskbar_thumbnail_button_set_dismiss_on_click(ulong self, [MarshalAs(UnmanagedType.I1)] bool isDismissOnClick);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_taskbar_thumbnail_button_set_enabled(ulong self, [MarshalAs(UnmanagedType.I1)] bool isEnabled);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_taskbar_thumbnail_button_set_has_background(ulong self, [MarshalAs(UnmanagedType.I1)] bool hasBackground);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_taskbar_thumbnail_button_set_icon(ulong self, ulong icon);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_taskbar_thumbnail_button_set_interactive(ulong self, [MarshalAs(UnmanagedType.I1)] bool isInteractive);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_taskbar_thumbnail_button_set_tooltip(ulong self, [MarshalAs(UnmanagedType.LPUTF8Str)] string? tooltip);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_taskbar_thumbnail_button_set_visible(ulong self, [MarshalAs(UnmanagedType.I1)] bool isVisible);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_window_taskbar_clear_thumbnail_buttons(ulong self);

[DllImport(Libraries.NativeApi, CallingConvention = CallingConvention.Cdecl)]
public static extern void native_window_taskbar_free(ulong handle);
}

9 changes: 9 additions & 0 deletions bindings/csharp/src/NativeAPI/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,15 @@ public bool IsVisibleInTaskbar
}
}

public WindowTaskbar? Taskbar
{
get
{
var rawResult = Interop.native_window_get_taskbar(NativeHandle);
return rawResult == 0 ? null : new WindowTaskbar(rawResult);
}
}

public bool SetIgnoreMouseEvents(bool isIgnoreMouseEvents, bool forward)
{
var rawResult = Interop.native_window_set_ignore_mouse_events(NativeHandle, isIgnoreMouseEvents, forward);
Expand Down
Loading
Loading