![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "nilorea/n_common.h"#include "nilorea/n_gui.h"#include "nilorea/n_log.h"Go to the source code of this file.
Macros | |
| #define | ALLEGRO_UNSTABLE 1 |
Functions | |
| static ALLEGRO_EVENT | char_event (char c) |
Build a key event that types c. | |
| static void | expect_text (const char *label, const char *got, const char *want) |
| Assert two strings are equal. | |
| static void | expect_true (const char *label, int cond) |
| Assert a condition, logging which check failed. | |
| static ALLEGRO_EVENT | key_event (int keycode) |
Build a key event for keycode. | |
| int | main (void) |
| static void | nothing (const char *prefix, N_GUI_SUGGEST_SINK *sink, void *user_data) |
| A provider that answers nothing, whatever it is asked. | |
| static void | type (N_GUI_CTX *gui, const char *s) |
| Type a whole string into whatever has focus. | |
| static void | vocabulary (const char *prefix, N_GUI_SUGGEST_SINK *sink, void *user_data) |
| A vocabulary to complete against, the way a catalog would answer. | |
Variables | |
| static int | asks = 0 |
| How many times the provider was asked. | |
| static int | failures = 0 |
| Count of failed assertions. | |
| static char | last_prefix [64] = "" |
| The last prefix the provider was given. | |
| #define ALLEGRO_UNSTABLE 1 |
Definition at line 39 of file ex_gui_suggest.c.
|
static |
Build a key event that types c.
| c | The character. |
Definition at line 142 of file ex_gui_suggest.c.
References key_event().
Referenced by type().
|
static |
Assert two strings are equal.
| label | What is being checked. |
| got | The value under test. |
| want | The expected value. |
Definition at line 78 of file ex_gui_suggest.c.
References failures, LOG_ERR, LOG_INFO, and n_log.
Referenced by main(), and test_to_text().
|
static |
|
static |
Build a key event for keycode.
| keycode | An ALLEGRO_KEY_* code. |
Definition at line 129 of file ex_gui_suggest.c.
| int main | ( | void | ) |
Definition at line 160 of file ex_gui_suggest.c.
References asks, expect_text(), expect_true(), failures, font, gui, key_event(), last_prefix, LOG_ERR, LOG_NOTICE, n_gui_add_label(), n_gui_add_textarea(), n_gui_add_window(), N_GUI_ALIGN_LEFT, n_gui_destroy_ctx(), n_gui_new_ctx(), n_gui_open_window(), n_gui_process_event(), n_gui_set_display_size(), n_gui_set_focus(), n_gui_textarea_get_text(), n_gui_textarea_get_text_length(), n_gui_textarea_set_suggest(), n_gui_textarea_set_text(), n_gui_textarea_suggest_is_open(), N_GUI_WIN_FRAMELESS, n_gui_window_set_flags(), n_log, nothing(), set_log_level(), type(), and vocabulary().
|
static |
A provider that answers nothing, whatever it is asked.
| prefix | Unused. |
| sink | Unused. |
| user_data | Unused. |
Definition at line 118 of file ex_gui_suggest.c.
Referenced by main().
|
static |
Type a whole string into whatever has focus.
| gui | The context. |
| s | The text. |
Definition at line 153 of file ex_gui_suggest.c.
References char_event(), gui, and n_gui_process_event().
Referenced by __attribute__(), _custom_mouse(), _from_png(), _is_focusable_type(), _is_tab_focusable_type(), _n_tiff_type_size(), _new_widget(), _tiff_file(), avro_type_to_string(), create_octree(), decode_chat_msg(), determine_octant(), feed(), feed(), feed(), feed(), feed(), feed_key(), get_net_datas(), insert_octree_node(), main(), main(), manage_client(), mouse(), mouse_event(), mouse_event(), mouse_event(), mouse_event(), mouse_event(), mouse_event(), mouse_event(), mouse_event(), mouse_event(), n_git_list_branches(), n_http2_frame_build_header(), netmsg_make_ident(), netmsg_make_ping(), netw_get_ident(), netw_get_ping(), netw_get_position(), netw_get_quit(), netw_get_string(), netw_send_ident(), netw_send_ping(), netw_wait_close_timed(), out_count(), out_find(), peer_frame(), pk_from_mark(), pk_new(), pk_run(), pk_string(), png_chunk(), put_entry(), set_uformat(), srv_send(), thread_pool_processing_function(), and was().
|
static |
A vocabulary to complete against, the way a catalog would answer.
Case folded for the match and not for the answer, which is the rule a store of tags has to follow: offering a spelling that cannot be added is worse than offering nothing.
| prefix | What has been typed of the word under the cursor. |
| sink | Where the answers go. |
| user_data | Unused. |
Definition at line 98 of file ex_gui_suggest.c.
References asks, last_prefix, and n_gui_suggest_add().
Referenced by main().
|
static |
How many times the provider was asked.
Definition at line 53 of file ex_gui_suggest.c.
Referenced by main(), and vocabulary().
|
static |
Count of failed assertions.
Definition at line 50 of file ex_gui_suggest.c.
|
static |
The last prefix the provider was given.
Definition at line 56 of file ex_gui_suggest.c.
Referenced by main(), and vocabulary().