2024-03-22 23:08:52 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
2024-06-19 16:20:06 +02:00
|
|
|
#include "../../helpers/math/Math.hpp"
|
2024-06-11 17:17:45 +02:00
|
|
|
#include "../../helpers/signal/Signal.hpp"
|
2025-01-17 15:21:35 +00:00
|
|
|
#include "../../helpers/memory/Memory.hpp"
|
2024-03-22 23:08:52 +00:00
|
|
|
|
|
|
|
|
struct wl_client;
|
|
|
|
|
|
2024-07-29 11:14:19 -05:00
|
|
|
class CTextInputV1;
|
2024-04-25 23:27:25 +01:00
|
|
|
class CTextInputV3;
|
2024-05-01 16:41:17 +01:00
|
|
|
class CInputMethodV2;
|
2024-06-08 10:07:59 +02:00
|
|
|
class CWLSurfaceResource;
|
2024-03-22 23:08:52 +00:00
|
|
|
|
|
|
|
|
class CTextInput {
|
|
|
|
|
public:
|
2024-05-05 17:16:00 +01:00
|
|
|
CTextInput(WP<CTextInputV3> ti);
|
2024-07-29 11:14:19 -05:00
|
|
|
CTextInput(WP<CTextInputV1> ti);
|
2024-03-22 23:08:52 +00:00
|
|
|
|
2024-06-08 10:07:59 +02:00
|
|
|
bool isV3();
|
|
|
|
|
void enter(SP<CWLSurfaceResource> pSurface);
|
|
|
|
|
void leave();
|
|
|
|
|
void tiV1Destroyed();
|
|
|
|
|
wl_client* client();
|
|
|
|
|
void commitStateToIME(SP<CInputMethodV2> ime);
|
|
|
|
|
void updateIMEState(SP<CInputMethodV2> ime);
|
2024-03-22 23:08:52 +00:00
|
|
|
|
2024-06-08 10:07:59 +02:00
|
|
|
void onEnabled(SP<CWLSurfaceResource> surfV1 = nullptr);
|
|
|
|
|
void onDisabled();
|
|
|
|
|
void onCommit();
|
2024-09-10 22:49:10 +09:00
|
|
|
void onReset();
|
2024-03-22 23:08:52 +00:00
|
|
|
|
2024-06-08 10:07:59 +02:00
|
|
|
bool hasCursorRectangle();
|
|
|
|
|
CBox cursorBox();
|
2024-03-22 23:08:52 +00:00
|
|
|
|
2024-06-08 10:07:59 +02:00
|
|
|
SP<CWLSurfaceResource> focusedSurface();
|
2024-03-22 23:08:52 +00:00
|
|
|
|
|
|
|
|
private:
|
2024-06-08 10:07:59 +02:00
|
|
|
void setFocusedSurface(SP<CWLSurfaceResource> pSurface);
|
|
|
|
|
void initCallbacks();
|
2024-03-22 23:08:52 +00:00
|
|
|
|
2025-05-01 23:57:11 +02:00
|
|
|
WP<CWLSurfaceResource> m_focusedSurface;
|
|
|
|
|
int m_enterLocks = 0;
|
|
|
|
|
WP<CTextInputV3> m_v3Input;
|
|
|
|
|
WP<CTextInputV1> m_v1Input;
|
2024-04-25 23:27:25 +01:00
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
CHyprSignalListener enable;
|
|
|
|
|
CHyprSignalListener disable;
|
2024-09-10 22:49:10 +09:00
|
|
|
CHyprSignalListener reset;
|
2024-04-25 23:27:25 +01:00
|
|
|
CHyprSignalListener commit;
|
|
|
|
|
CHyprSignalListener destroy;
|
2024-06-08 10:07:59 +02:00
|
|
|
CHyprSignalListener surfaceUnmap;
|
|
|
|
|
CHyprSignalListener surfaceDestroy;
|
2025-05-01 23:57:11 +02:00
|
|
|
} m_listeners;
|
2024-07-29 11:14:19 -05:00
|
|
|
};
|