1 /* |
1 /* |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
3 * |
3 * |
4 * Copyright 2014 Olaf Wintermann. All rights reserved. |
4 * Copyright 2017 Olaf Wintermann. All rights reserved. |
5 * |
5 * |
6 * Redistribution and use in source and binary forms, with or without |
6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are met: |
7 * modification, are permitted provided that the following conditions are met: |
8 * |
8 * |
9 * 1. Redistributions of source code must retain the above copyright |
9 * 1. Redistributions of source code must retain the above copyright |
54 int event; |
55 int event; |
55 } UiUndoMgr; |
56 } UiUndoMgr; |
56 |
57 |
57 typedef struct UiTextArea { |
58 typedef struct UiTextArea { |
58 UiContext *ctx; |
59 UiContext *ctx; |
59 int last_selection_state; |
60 UiVar *var; |
|
61 int last_selection_state; |
60 } UiTextArea; |
62 } UiTextArea; |
|
63 |
|
64 typedef struct UiTextField { |
|
65 UiContext *ctx; |
|
66 UiVar *var; |
|
67 // TODO: validatefunc |
|
68 } UiTextField; |
|
69 |
|
70 UIWIDGET ui_textarea_var(UiObject *obj, UiVar *var); |
|
71 void ui_textarea_destroy(GtkWidget *object, UiTextArea *textarea); |
61 |
72 |
62 char* ui_textarea_get(UiText *text); |
73 char* ui_textarea_get(UiText *text); |
63 void ui_textarea_set(UiText *text, char *str); |
74 void ui_textarea_set(UiText *text, char *str); |
64 char* ui_textarea_getsubstr(UiText *text, int begin, int end); |
75 char* ui_textarea_getsubstr(UiText *text, int begin, int end); |
65 void ui_textarea_insert(UiText *text, int pos, char *str); |
76 void ui_textarea_insert(UiText *text, int pos, char *str); |
83 void *data); |
94 void *data); |
84 UiUndoMgr* ui_create_undomgr(); |
95 UiUndoMgr* ui_create_undomgr(); |
85 void ui_free_textbuf_op(UiTextBufOp *op); |
96 void ui_free_textbuf_op(UiTextBufOp *op); |
86 int ui_check_insertstr(char *oldstr, int oldlen, char *newstr, int newlen); |
97 int ui_check_insertstr(char *oldstr, int oldlen, char *newstr, int newlen); |
87 |
98 |
|
99 void ui_textfield_destroy(GtkWidget *object, UiTextField *textfield); |
|
100 |
88 char* ui_textfield_get(UiString *str); |
101 char* ui_textfield_get(UiString *str); |
89 void ui_textfield_set(UiString *str, char *value); |
102 void ui_textfield_set(UiString *str, char *value); |
90 |
103 |
91 #ifdef __cplusplus |
104 #ifdef __cplusplus |
92 } |
105 } |