aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/apprt/gtk/ui/1.5/imgui-widget.blp
blob: d5b973a70beef25f0c2cbf34cd573c1156731cea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using Gtk 4.0;
using Adw 1;

template $GhosttyImguiWidget: Adw.Bin {
  styles [
    "imgui",
  ]

  Adw.Bin {
    Gtk.GLArea gl_area {
      auto-render: true;
      // needs to be focusable so that we can receive events
      focusable: true;
      focus-on-click: true;
      allowed-apis: gl;
      realize => $realize();
      unrealize => $unrealize();
      resize => $resize();
      render => $render();

      EventControllerFocus {
        enter => $focus_enter();
        leave => $focus_leave();
      }

      EventControllerKey {
        key-pressed => $key_pressed();
        key-released => $key_released();
      }

      GestureClick {
        pressed => $mouse_pressed();
        released => $mouse_released();
        button: 0;
      }

      EventControllerMotion {
        motion => $mouse_motion();
      }

      EventControllerScroll {
        scroll => $scroll();
        flags: both_axes;
      }
    }
  }
}

IMMulticontext im_context {
  commit => $im_commit();
}