-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathIME_dialog.h
More file actions
76 lines (54 loc) · 1.7 KB
/
IME_dialog.h
File metadata and controls
76 lines (54 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* Copyright (C) 2024 John Törnblom
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, see
<http://www.gnu.org/licenses/>. */
#pragma once
/**
* Potential outcomes of the dialog.
**/
typedef enum IME_Dialog_Outcome
{
IME_DIALOG_COMPLETED, // by user
IME_DIALOG_CANCELED, // by user
IME_DIALOG_ABORTED, // by system
} IME_Dialog_Outcome;
/**
* Prototype for the callback function that catches an outcome.
**/
typedef void (IME_Dialog_OnOutcomeCallback)(void*, IME_Dialog_Outcome);
/**
* Set the callback function that is signaled when a dialog status changes.
**/
void IME_Dialog_OnOutcome(IME_Dialog_OnOutcomeCallback *fn, void* ctx);
/**
* Change the title of the dialog.
**/
int IME_Dialog_SetTitle(const char* text);
/**
* Change the text of the dialog.
**/
int IME_Dialog_SetText(const char* text);
/**
* Get the text of the dialog.
**/
int IME_Dialog_GetText(char* text, size_t size);
/**
* Display the dialog.
**/
int IME_Dialog_Display(int posx, int posy);
/**
* Get the state of the dialog, and signal changes to the calbback function.
**/
int IME_Dialog_PullStatus(void);
/* Local Variables: */
/* tab-width: 8 */
/* c-basic-offset: 4 */
/* End: */