2024-03-23 00:08:52 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../../helpers/WLListener.hpp"
|
|
|
|
#include "../../macros.hpp"
|
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"
|
2024-04-26 00:27:25 +02:00
|
|
|
#include <memory>
|
2024-03-23 00:08:52 +01:00
|
|
|
|
|
|
|
struct wl_client;
|
|
|
|
|
2024-07-29 18:14:19 +02:00
|
|
|
class CTextInputV1;
|
2024-04-26 00:27:25 +02:00
|
|
|
class CTextInputV3;
|
2024-05-01 17:41:17 +02:00
|
|
|
class CInputMethodV2;
|
2024-06-08 10:07:59 +02:00
|
|
|
class CWLSurfaceResource;
|
2024-03-23 00:08:52 +01:00
|
|
|
|
|
|
|
class CTextInput {
|
|
|
|
public:
|
2024-05-05 18:16:00 +02:00
|
|
|
CTextInput(WP<CTextInputV3> ti);
|
2024-07-29 18:14:19 +02:00
|
|
|
CTextInput(WP<CTextInputV1> ti);
|
2024-03-23 00:08:52 +01: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-23 00:08:52 +01:00
|
|
|
|
2024-06-08 10:07:59 +02:00
|
|
|
void onEnabled(SP<CWLSurfaceResource> surfV1 = nullptr);
|
|
|
|
void onDisabled();
|
|
|
|
void onCommit();
|
2024-03-23 00:08:52 +01:00
|
|
|
|
2024-06-08 10:07:59 +02:00
|
|
|
bool hasCursorRectangle();
|
|
|
|
CBox cursorBox();
|
2024-03-23 00:08:52 +01:00
|
|
|
|
2024-06-08 10:07:59 +02:00
|
|
|
SP<CWLSurfaceResource> focusedSurface();
|
2024-03-23 00:08:52 +01:00
|
|
|
|
|
|
|
private:
|
2024-06-08 10:07:59 +02:00
|
|
|
void setFocusedSurface(SP<CWLSurfaceResource> pSurface);
|
|
|
|
void initCallbacks();
|
2024-03-23 00:08:52 +01:00
|
|
|
|
2024-06-08 10:07:59 +02:00
|
|
|
WP<CWLSurfaceResource> pFocusedSurface;
|
|
|
|
int enterLocks = 0;
|
|
|
|
WP<CTextInputV3> pV3Input;
|
2024-07-29 18:14:19 +02:00
|
|
|
WP<CTextInputV1> pV1Input;
|
2024-04-26 00:27:25 +02:00
|
|
|
|
|
|
|
struct {
|
|
|
|
CHyprSignalListener enable;
|
|
|
|
CHyprSignalListener disable;
|
|
|
|
CHyprSignalListener commit;
|
|
|
|
CHyprSignalListener destroy;
|
2024-06-08 10:07:59 +02:00
|
|
|
CHyprSignalListener surfaceUnmap;
|
|
|
|
CHyprSignalListener surfaceDestroy;
|
2024-04-26 00:27:25 +02:00
|
|
|
} listeners;
|
2024-07-29 18:14:19 +02:00
|
|
|
};
|