summaryrefslogtreecommitdiff
path: root/src/entry.h
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2021-10-31 16:47:03 +0000
committerPhil Jones <philj56@gmail.com>2021-10-31 16:54:20 +0000
commit74adfe0cbca300e73774c6e0aa9b3c53a5e5b57b (patch)
tree88d0efbdd9755849eb22ee3478595df5c8e69a34 /src/entry.h
parentc691b8e48c572e2d5f1c7c16c8f42babd7d706d5 (diff)
Add HiDPI support and lots of cleanup.
Diffstat (limited to 'src/entry.h')
-rw-r--r--src/entry.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/entry.h b/src/entry.h
index 18276a1..b1b9670 100644
--- a/src/entry.h
+++ b/src/entry.h
@@ -2,7 +2,8 @@
#define ENTRY_H
#include <pango/pangocairo.h>
-#include "util.h"
+#include "color.h"
+#include "image.h"
#include "surface.h"
#define MAX_PASSWORD_LENGTH 256
@@ -16,18 +17,32 @@ struct entry {
cairo_surface_t *surface;
cairo_t *cr;
} pangocairo;
+ PangoRectangle text_bounds;
+
+ wchar_t password[MAX_PASSWORD_LENGTH];
+ /* Assume maximum of 4 bytes per wchar_t (for UTF-8) */
+ char password_mb[4*MAX_PASSWORD_LENGTH];
+ uint32_t password_length;
+
+ /* Options */
+ uint32_t font_size;
+ const char *font_name;
+ uint32_t padding;
+ bool tight_layout;
+ wchar_t password_character;
+ uint32_t num_characters;
+ struct color foreground_color;
+ struct color background_color;
struct {
struct color color;
struct color outline_color;
int32_t width;
int32_t outline_width;
} border;
- wchar_t password[MAX_PASSWORD_LENGTH];
- char password_mb[4*MAX_PASSWORD_LENGTH];
- uint32_t password_length;
};
-void entry_init(struct entry *entry);
+void entry_init(struct entry *entry, uint32_t scale);
void entry_update(struct entry *entry);
+void entry_set_scale(struct entry *entry, uint32_t scale);
#endif /* ENTRY_H */