139 references to LinuxPanelNative
Aspire.Tray.Tests (139)
src\Aspire.Tray\Linux\LinuxDesktopEnvironment.cs (3)
45
var display =
LinuxPanelNative
.gdk_display_get_default();
67
gdk_display_get_default_screen(
LinuxPanelNative
.gdk_display_get_default())) != 0;
70
g_type_name_from_instance(
LinuxPanelNative
.gdk_display_get_default())) == "GdkWaylandDisplay";
src\Aspire.Tray\Linux\LinuxPanelAccessibility.cs (7)
56
gtk_style_context_add_provider(
LinuxPanelNative
.gtk_widget_get_style_context(widget), provider, 600);
58
LinuxPanelNative
.gtk_fixed_put(container, widget, 0, 0);
82
LinuxPanelNative
.gtk_fixed_move(container, control.Widget, (int)Math.Round(bounds.X), (int)Math.Round(bounds.Y));
83
LinuxPanelNative
.gtk_widget_set_size_request(control.Widget, Math.Max(1, (int)Math.Ceiling(bounds.Width)),
87
LinuxPanelNative
.gtk_widget_hide(control.Widget);
104
LinuxPanelNative
.gtk_fixed_put(container, widget, (int)Math.Round(bounds.X), (int)Math.Round(bounds.Y));
121
LinuxPanelNative
.gtk_widget_grab_focus(control.Widget);
src\Aspire.Tray\Linux\LinuxPlasmaAnchor.cs (6)
21
var display =
LinuxPanelNative
.gdk_display_get_default();
22
var primary =
LinuxPanelNative
.gdk_display_get_primary_monitor(display);
23
var monitors = Enumerable.Range(0,
LinuxPanelNative
.gdk_display_get_n_monitors(display)).Select(index =>
25
var monitor =
LinuxPanelNative
.gdk_display_get_monitor(display, index);
26
LinuxPanelNative
.gdk_monitor_get_geometry(monitor, out var geometry);
30
var pointer = gdk_seat_get_pointer(
LinuxPanelNative
.gdk_display_get_default_seat(display));
src\Aspire.Tray\Linux\LinuxTrayPanel.cs (123)
95
var display =
LinuxPanelNative
.gdk_display_get_default();
96
if (
LinuxPanelNative
.gdk_display_get_n_monitors(display) != _surfaces.Count
99
LinuxPanelNative
.gdk_monitor_get_geometry(surface.Monitor, out var geometry);
101
|| surface.DeviceScale !=
LinuxPanelNative
.gdk_monitor_get_scale_factor(surface.Monitor);
181
LinuxPanelNative
.XGetInputFocus(
LinuxPanelNative
.gdk_x11_display_get_xdisplay(
182
LinuxPanelNative
.gdk_display_get_default()), out _previousFocus, out _);
194
var nativeWindow =
LinuxPanelNative
.gtk_widget_get_window(_window);
195
var display =
LinuxPanelNative
.gdk_display_get_default();
196
LinuxPanelNative
.XSetInputFocus(
LinuxPanelNative
.gdk_x11_display_get_xdisplay(display),
197
LinuxPanelNative
.gdk_x11_window_get_xid(nativeWindow), 2,
LinuxPanelNative
.gdk_x11_get_server_time(nativeWindow));
198
_seat =
LinuxPanelNative
.gdk_display_get_default_seat(
LinuxPanelNative
.gdk_display_get_default());
199
var result =
LinuxPanelNative
.gdk_seat_grab(_seat, nativeWindow, 8, 0, 0, 0, 0, 0);
222
LinuxPanelNative
.gdk_seat_ungrab(_seat);
226
LinuxPanelNative
.gtk_widget_hide(surface.Window);
230
var display =
LinuxPanelNative
.gdk_display_get_default();
233
LinuxPanelNative
.gdk_x11_display_error_trap_push(display);
234
LinuxPanelNative
.XSetInputFocus(
LinuxPanelNative
.gdk_x11_display_get_xdisplay(display), _previousFocus, 2, 0);
235
LinuxPanelNative
.gdk_x11_display_error_trap_pop_ignored(display);
267
var display =
LinuxPanelNative
.gdk_display_get_default();
268
var monitors = Enumerable.Range(0,
LinuxPanelNative
.gdk_display_get_n_monitors(display))
271
var monitor =
LinuxPanelNative
.gdk_display_get_monitor(display, index);
272
LinuxPanelNative
.gdk_monitor_get_geometry(monitor, out var geometry);
274
DeviceScale:
LinuxPanelNative
.gdk_monitor_get_scale_factor(monitor));
314
var window =
LinuxPanelNative
.gtk_window_new(0);
323
var area =
LinuxPanelNative
.gtk_drawing_area_new();
324
var container =
LinuxPanelNative
.gtk_fixed_new();
328
LinuxPanelNative
.gtk_window_set_decorated(window, 0);
329
LinuxPanelNative
.gtk_window_set_resizable(window, 0);
330
LinuxPanelNative
.gtk_window_set_accept_focus(window, main ? 1 : 0);
331
LinuxPanelNative
.gtk_window_set_skip_taskbar_hint(window, 1);
332
LinuxPanelNative
.gtk_window_set_skip_pager_hint(window, 1);
333
var visual =
LinuxPanelNative
.gdk_screen_get_rgba_visual(
LinuxPanelNative
.gtk_widget_get_screen(window));
338
LinuxPanelNative
.gtk_widget_set_visual(window, visual);
339
LinuxPanelNative
.gtk_widget_set_app_paintable(window, 1);
340
LinuxPanelNative
.gtk_widget_set_can_focus(area, main ? 1 : 0);
342
LinuxPanelNative
.gtk_fixed_put(container, area, 0, 0);
343
LinuxPanelNative
.gtk_widget_set_size_request(area, (int)geometry.Width, (int)geometry.Height);
355
LinuxPanelNative
.gtk_widget_realize(window);
356
LinuxPanelNative
.gdk_window_set_override_redirect(
LinuxPanelNative
.gtk_widget_get_window(window), 1);
357
LinuxPanelNative
.gtk_window_move(window, (int)geometry.X, (int)geometry.Y);
358
LinuxPanelNative
.gtk_window_resize(window, (int)geometry.Width, (int)geometry.Height);
391
LinuxPanelNative
.gtk_widget_add_events(widget, (1 << 2) | (1 << 8) | (1 << 9) | (1 << 10) | (1 << 12) | (1 << 21) | (1 << 23));
401
var context =
LinuxPanelNative
.gtk_widget_get_style_context(_area);
402
return
LinuxPanelNative
.gtk_style_context_lookup_color(context, "theme_bg_color", out var color) != 0
410
var display =
LinuxPanelNative
.gdk_display_get_default();
411
if (
LinuxPanelNative
.gdk_display_get_n_monitors(display) == 0)
417
var primary =
LinuxPanelNative
.gdk_display_get_primary_monitor(display);
420
primary =
LinuxPanelNative
.gdk_display_get_monitor(display, 0);
422
LinuxPanelNative
.gdk_monitor_get_workarea(primary, out var initial);
427
_monitor =
LinuxPanelNative
.gdk_display_get_monitor_at_point(display, _anchorX, _anchorY);
428
LinuxPanelNative
.gdk_monitor_get_workarea(_monitor, out var workarea);
445
return GetScale(
LinuxPanelNative
.gdk_screen_get_resolution(
446
LinuxPanelNative
.gdk_display_get_default_screen(
LinuxPanelNative
.gdk_display_get_default())));
490
LinuxPanelNative
.gtk_widget_queue_draw(_area);
499
LinuxPanelNative
.gdk_event_get_coords(nativeEvent, out var x, out var y);
500
var eventWidget =
LinuxPanelNative
.gtk_get_event_widget(nativeEvent);
501
if (eventWidget != 0 &&
LinuxPanelNative
.gtk_widget_translate_coordinates(eventWidget, surface.Area,
508
switch (
LinuxPanelNative
.gdk_event_get_event_type(nativeEvent))
524
LinuxPanelNative
.XGetInputFocus(
LinuxPanelNative
.gdk_x11_display_get_xdisplay(
525
LinuxPanelNative
.gdk_display_get_default()), out var focus, out _);
526
if (!_grabbed || focus ==
LinuxPanelNative
.gdk_x11_window_get_xid(
527
LinuxPanelNative
.gtk_widget_get_window(_window)))
545
LinuxPanelNative
.gtk_widget_set_tooltip_text(_area, _panel.HitTest(x, y)?.Tooltip);
551
if (
LinuxPanelNative
.gdk_event_get_event_type(nativeEvent) == 4
557
LinuxPanelNative
.gdk_event_get_button(nativeEvent, out var button);
562
Apply(
LinuxPanelNative
.gdk_event_get_event_type(nativeEvent) == 4 ? _panel.PointerDown(x, y) : _panel.PointerUp(x, y));
569
if (
LinuxPanelNative
.gdk_event_get_scroll_deltas(nativeEvent, out _, out var delta) == 0)
571
LinuxPanelNative
.gdk_event_get_scroll_direction(nativeEvent, out var direction);
577
LinuxPanelNative
.gdk_event_get_keyval(nativeEvent, out var key);
578
LinuxPanelNative
.gdk_event_get_state(nativeEvent, out var modifiers);
613
LinuxPanelNative
.cairo_paint(context);
619
LinuxPanelNative
.cairo_save(context);
620
LinuxPanelNative
.cairo_translate(context, _bounds.X - surface.Geometry.X, _bounds.Y - surface.Geometry.Y);
621
LinuxPanelNative
.cairo_scale(context, _scale, _scale);
626
LinuxPanelNative
.cairo_restore(context);
645
LinuxPanelNative
.cairo_set_line_width(context, stroke.Width);
646
LinuxPanelNative
.cairo_set_line_cap(context, 1);
647
LinuxPanelNative
.cairo_set_line_join(context, 1);
648
LinuxPanelNative
.cairo_stroke(context);
654
LinuxPanelNative
.cairo_save(context);
655
LinuxPanelNative
.cairo_translate(context, logo.Bounds.X, logo.Bounds.Y);
656
LinuxPanelNative
.cairo_scale(context, logo.Bounds.Width / Gtk.cairo_image_surface_get_width(_logo),
659
LinuxPanelNative
.cairo_paint(context);
660
LinuxPanelNative
.cairo_restore(context);
669
LinuxPanelNative
.cairo_save(context);
671
LinuxPanelNative
.cairo_clip(context);
674
LinuxPanelNative
.cairo_restore(context);
681
var layout =
LinuxPanelNative
.pango_cairo_create_layout(context);
682
var font =
LinuxPanelNative
.pango_font_description_copy(
LinuxPanelNative
.pango_context_get_font_description(
683
LinuxPanelNative
.gtk_widget_get_pango_context(_area)));
686
LinuxPanelNative
.pango_font_description_set_absolute_size(font, PanelFonts.Size(text.Font) * 1024);
687
LinuxPanelNative
.pango_font_description_set_weight(font, PanelFonts.IsSemibold(text.Font) ? 600 : 400);
688
LinuxPanelNative
.pango_layout_set_font_description(layout, font);
689
LinuxPanelNative
.pango_layout_set_text(layout, text.Text, -1);
690
LinuxPanelNative
.pango_layout_set_width(layout, (int)Math.Round(text.Bounds.Width * 1024));
691
LinuxPanelNative
.pango_layout_set_height(layout, -text.MaxLines);
692
LinuxPanelNative
.pango_layout_set_wrap(layout, 2); // PANGO_WRAP_WORD_CHAR
693
LinuxPanelNative
.pango_layout_set_ellipsize(layout, text.Truncation == PanelTruncation.Middle ? 2 : 3);
694
LinuxPanelNative
.pango_layout_set_alignment(layout, text.Alignment switch
700
var scale = _scale *
LinuxPanelNative
.gtk_widget_get_scale_factor(_area);
702
: Math.Round(text.Baseline * scale) / scale -
LinuxPanelNative
.pango_layout_get_baseline(layout) / 1024d;
703
LinuxPanelNative
.cairo_save(context);
705
LinuxPanelNative
.cairo_clip(context);
707
LinuxPanelNative
.cairo_move_to(context, text.Bounds.X, y);
708
LinuxPanelNative
.pango_cairo_show_layout(context, layout);
709
LinuxPanelNative
.cairo_restore(context);
713
LinuxPanelNative
.pango_font_description_free(font);
719
=>
LinuxPanelNative
.cairo_set_source_rgba(context, color.R / 255d, color.G / 255d, color.B / 255d, color.Alpha);
723
LinuxPanelNative
.cairo_new_path(context);
729
LinuxPanelNative
.cairo_move_to(context, segment.X3, segment.Y3);
732
LinuxPanelNative
.cairo_line_to(context, segment.X3, segment.Y3);
735
LinuxPanelNative
.cairo_curve_to(context, segment.X1, segment.Y1, segment.X2, segment.Y2, segment.X3, segment.Y3);
738
LinuxPanelNative
.cairo_close_path(context);