summaryrefslogtreecommitdiff
path: root/platform/gl/gl-app.h
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-09-03 10:51:35 +0200
committerTor Andersson <tor.andersson@artifex.com>2015-10-06 11:21:23 +0200
commitcaa075f47cadd4182d9005edea1019e9419908de (patch)
tree4533cbfbb8d51fc3cdb2971d049cc81fa99c254f /platform/gl/gl-app.h
parent838d256ab4d11adc6d320e0c437d435e3bac5dec (diff)
downloadmupdf-caa075f47cadd4182d9005edea1019e9419908de.tar.xz
gl: Split text field handling into separate file and add keyboard focus.
Diffstat (limited to 'platform/gl/gl-app.h')
-rw-r--r--platform/gl/gl-app.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/platform/gl/gl-app.h b/platform/gl/gl-app.h
index 2a00bec4..1cf5b91b 100644
--- a/platform/gl/gl-app.h
+++ b/platform/gl/gl-app.h
@@ -1,13 +1,15 @@
#include "mupdf/fitz.h"
#include <GLFW/glfw3.h>
+extern fz_context *ctx;
+
struct ui
{
int x, y;
int down, middle, right;
int key, special, mod;
- void *hot, *active;
+ void *hot, *active, *focus;
int fontsize;
int baseline;
@@ -24,3 +26,11 @@ float ui_draw_character(fz_context *ctx, int ucs, float x, float y);
void ui_end_text(fz_context *ctx);
float ui_draw_string(fz_context *ctx, float x, float y, const char *str);
float ui_measure_string(fz_context *ctx, char *str);
+
+struct input
+{
+ int text[256];
+ int *end, *p, *q;
+};
+
+int ui_input(int x0, int y0, int x1, int y1, struct input *input);