![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include "nilorea/n_common.h"#include "nilorea/n_list.h"#include "nilorea/n_hash.h"#include "nilorea/n_pcre.h"#include "nilorea/n_str.h"#include "nilorea/n_gui.h"#include <allegro5/allegro_ttf.h>
Include dependency graph for ex_gui_dictionary.c:Go to the source code of this file.
Data Structures | |
| struct | DICTIONARY_DEFINITION |
| dictionary definition for DICTIONARY_ENTRY More... | |
| struct | DICTIONARY_ENTRY |
| dictionary entry More... | |
Macros | |
| #define | ALLEGRO_UNSTABLE 1 |
| #define | HEIGHT 800 |
| #define | WIDTH 800 |
Functions | |
| void | free_entry (void *entry_ptr) |
| void | free_entry_def (void *entry_def) |
| int | main (int argc, char *argv[]) |
| void | on_clear_click (int widget_id, void *user_data) |
| void | on_completion_select (int widget_id, int index, int selected, void *user_data) |
| void | on_search_change (int widget_id, const char *text, void *user_data) |
| static void | update_completion (N_GUI_CTX *gui, const char *text) |
| static void | update_definitions (N_GUI_CTX *gui, const char *word) |
Variables | |
| static LIST * | completion = NULL |
| static int | completion_listbox_id = -1 |
| static int | definition_label_id = -1 |
| static int | definition_win_id = -1 |
| static HASH_TABLE * | dictionary = NULL |
| ALLEGRO_DISPLAY * | display = NULL |
| int | DONE = 0 |
| ALLEGRO_TIMER * | fps_timer = NULL |
| int | getoptret = 0 |
| static char | last_search [4096] = "" |
| int | log_level = 6 |
| ALLEGRO_TIMER * | logic_timer = NULL |
| static size_t | max_results = 100 |
| static int | search_textarea_id = -1 |
| static int | status_label_id = -1 |
| static int | status_win_id = -1 |
| struct DICTIONARY_DEFINITION |
dictionary definition for DICTIONARY_ENTRY
Definition at line 52 of file ex_gui_dictionary.c.
Collaboration diagram for DICTIONARY_DEFINITION:| Data Fields | ||
|---|---|---|
| char * | definition | content of definition |
| char * | type | type of definition (verb, noun,...) |
| struct DICTIONARY_ENTRY |
Collaboration diagram for DICTIONARY_ENTRY:| Data Fields | ||
|---|---|---|
| LIST * | definitions | list of DICTIONARY_DEFINITION for that entry |
| char * | key | key of the entry |
| #define ALLEGRO_UNSTABLE 1 |
Definition at line 30 of file ex_gui_dictionary.c.
| #define HEIGHT 800 |
Definition at line 28 of file ex_gui_dictionary.c.
| #define WIDTH 800 |
Definition at line 27 of file ex_gui_dictionary.c.
| void free_entry | ( | void * | entry_ptr | ) |
Definition at line 91 of file ex_gui_dictionary.c.
References DICTIONARY_ENTRY::definitions, FreeNoLog, DICTIONARY_ENTRY::key, and list_destroy().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| void free_entry_def | ( | void * | entry_def | ) |
Definition at line 85 of file ex_gui_dictionary.c.
References DICTIONARY_DEFINITION::definition, FreeNoLog, and DICTIONARY_DEFINITION::type.
Referenced by main().
Here is the caller graph for this function:| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 165 of file ex_gui_dictionary.c.
References __attribute__(), _str, completion, completion_listbox_id, DICTIONARY_DEFINITION::definition, definition_label_id, definition_win_id, DICTIONARY_ENTRY::definitions, destroy_ht(), dictionary, display, DONE, fps_timer, free_entry(), free_entry_def(), FreeNoLog, getoptret, gui, HEIGHT, ht_get_ptr(), ht_put_ptr(), DICTIONARY_ENTRY::key, key, last_search, list_destroy(), list_push(), LOG_DEBUG, LOG_ERR, LOG_INFO, log_level, LOG_NOTICE, Malloc, N_PCRE::match_list, MAX_LIST_ITEMS, n_abort(), n_gui_add_button(), n_gui_add_label(), n_gui_add_listbox(), n_gui_add_textarea(), n_gui_add_window(), N_GUI_ALIGN_JUSTIFIED, N_GUI_ALIGN_LEFT, n_gui_destroy_ctx(), n_gui_draw(), n_gui_new_ctx(), n_gui_process_event(), N_GUI_SELECT_SINGLE, n_gui_set_display_size(), n_gui_set_virtual_size(), N_GUI_SHAPE_ROUNDED, N_GUI_WIN_FIXED_POSITION, n_gui_window_set_flags(), n_log, new_generic_list(), new_ht_trie(), npcre_clean_match(), npcre_delete(), npcre_match_capture(), npcre_new(), on_clear_click(), on_completion_select(), on_search_change(), search_textarea_id, set_log_file(), set_log_level(), status_label_id, status_win_id, DICTIONARY_DEFINITION::type, update_completion(), and WIDTH.
Here is the call graph for this function:| void on_clear_click | ( | int | widget_id, |
| void * | user_data | ||
| ) |
Definition at line 121 of file ex_gui_dictionary.c.
References gui, n_gui_textarea_set_text(), search_textarea_id, update_completion(), and update_definitions().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| void on_completion_select | ( | int | widget_id, |
| int | index, | ||
| int | selected, | ||
| void * | user_data | ||
| ) |
Definition at line 107 of file ex_gui_dictionary.c.
References completion_listbox_id, gui, n_gui_listbox_get_item_text(), n_gui_textarea_set_text(), search_textarea_id, update_completion(), and update_definitions().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| void on_search_change | ( | int | widget_id, |
| const char * | text, | ||
| void * | user_data | ||
| ) |
Definition at line 99 of file ex_gui_dictionary.c.
References gui, update_completion(), and update_definitions().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 129 of file ex_gui_dictionary.c.
References completion, completion_listbox_id, dictionary, gui, ht_get_completion_list(), last_search, list_destroy(), list_foreach, max_results, n_gui_listbox_add_item(), and n_gui_listbox_clear().
Referenced by main(), on_clear_click(), on_completion_select(), and on_search_change().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 148 of file ex_gui_dictionary.c.
References DICTIONARY_DEFINITION::definition, definition_label_id, DICTIONARY_ENTRY::definitions, dictionary, gui, ht_get_ptr(), list_foreach, n_gui_label_set_text(), and DICTIONARY_DEFINITION::type.
Referenced by on_clear_click(), on_completion_select(), and on_search_change().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 69 of file ex_gui_dictionary.c.
Referenced by main(), and update_completion().
|
static |
Definition at line 75 of file ex_gui_dictionary.c.
Referenced by main(), on_completion_select(), and update_completion().
|
static |
Definition at line 76 of file ex_gui_dictionary.c.
Referenced by main(), and update_definitions().
|
static |
Definition at line 77 of file ex_gui_dictionary.c.
Referenced by main().
|
static |
Definition at line 68 of file ex_gui_dictionary.c.
Referenced by main(), update_completion(), and update_definitions().
| ALLEGRO_DISPLAY* display = NULL |
Definition at line 42 of file ex_gui_dictionary.c.
| int DONE = 0 |
Definition at line 44 of file ex_gui_dictionary.c.
| ALLEGRO_TIMER* fps_timer = NULL |
Definition at line 48 of file ex_gui_dictionary.c.
| int getoptret = 0 |
Definition at line 45 of file ex_gui_dictionary.c.
|
static |
Definition at line 71 of file ex_gui_dictionary.c.
Referenced by main(), and update_completion().
| int log_level = 6 |
Definition at line 46 of file ex_gui_dictionary.c.
| ALLEGRO_TIMER* logic_timer = NULL |
Definition at line 49 of file ex_gui_dictionary.c.
|
static |
Definition at line 70 of file ex_gui_dictionary.c.
Referenced by ht_get_completion_list(), and update_completion().
|
static |
Definition at line 74 of file ex_gui_dictionary.c.
Referenced by main(), on_clear_click(), and on_completion_select().
|
static |
Definition at line 79 of file ex_gui_dictionary.c.
Referenced by main().
|
static |
Definition at line 78 of file ex_gui_dictionary.c.
Referenced by main().