![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <allegro5/allegro_primitives.h>#include "nilorea/n_common.h"#include "nilorea/n_log.h"#include "nilorea/n_gui.h"#include "nilorea/n_gui_grid.h"Go to the source code of this file.
Macros | |
| #define | ALLEGRO_UNSTABLE 1 |
Functions | |
| static void | draw (N_GUI_CTX *gui) |
| draw the whole context into a memory bitmap | |
| static void | draw_background (int widget_id, float x, float y, float w, float h, void *user_data) |
| draw behind | |
| static void | draw_cell (int widget_id, size_t index, float x, float y, float w, float h, void *user_data) |
| draw one cell | |
| static void | expect_true (const char *what, int ok) |
| record one check | |
| static void | feed (N_GUI_CTX *gui, int type, float x, float y, int button, int dz) |
| feed one mouse event | |
| static void | feed_key (N_GUI_CTX *gui, int type, int keycode) |
| feed one key event | |
| int | main (int argc, char **argv) |
| static void | press (int widget_id, size_t index, int button, float x, float y, void *user_data) |
| a press on a cell | |
| static int | process_args (int argc, char **argv) |
| read -V LOGLEVEL | |
| static void | visible (int widget_id, size_t first, size_t last, void *user_data) |
| the range to prepare | |
| static int | wheel (int widget_id, int dz, int modifiers, void *user_data) |
| Ctrl+wheel resizes the cells; the plain wheel is left to scroll. | |
Variables | |
| static int | backgrounds = 0 |
| static int | cells_drawn = 0 |
| what the callbacks saw | |
| static int | failures = 0 |
| static size_t | first_seen = 0 |
| static size_t | last_seen = 0 |
| static int | log_level = 3 |
| static int | pressed_button = 0 |
| static size_t | pressed_index = 0 |
| static float | pressed_x = 0.0f |
| static float | pressed_y = 0.0f |
| static int | presses = 0 |
| static int | wheel_mods = 0 |
| static int | wheels = 0 |
| what the wheel callback saw, and the cell size it keeps | |
| static float | zoom_cell = 50.0f |
| static N_GUI_CTX * | zoom_gui = NULL |
| the context the wheel callback resizes the grid in | |
| #define ALLEGRO_UNSTABLE 1 |
Definition at line 17 of file ex_gui_grid.c.
|
static |
draw the whole context into a memory bitmap
Definition at line 140 of file ex_gui_grid.c.
References cells_drawn, gui, and n_gui_draw().
Referenced by iso_map_draw(), main(), n_gui_add_custom(), and n_gui_curve_set_background().
|
static |
draw behind
Definition at line 78 of file ex_gui_grid.c.
References backgrounds.
Referenced by main().
|
static |
draw one cell
Definition at line 69 of file ex_gui_grid.c.
References cells_drawn.
Referenced by main().
|
static |
|
static |
feed one mouse event
Definition at line 126 of file ex_gui_grid.c.
References gui, n_gui_process_event(), and type().
|
static |
feed one key event
Definition at line 116 of file ex_gui_grid.c.
References gui, n_gui_process_event(), and type().
Referenced by main().
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 155 of file ex_gui_grid.c.
References backgrounds, cells_drawn, draw(), draw_background(), N_GUI_GRID_CALLBACKS::draw_background, draw_cell(), N_GUI_GRID_CALLBACKS::draw_cell, expect_true(), failures, feed(), feed_key(), first_seen, font, gui, last_seen, LOG_ERR, log_level, n_gui_add_window(), n_gui_destroy_ctx(), n_gui_get_key_modifiers(), n_gui_grid_cell_rect(), n_gui_grid_columns(), n_gui_grid_get_scroll(), n_gui_grid_index_at(), n_gui_grid_new(), n_gui_grid_scroll_to(), n_gui_grid_scrollbar(), n_gui_grid_scrollbar_showing(), n_gui_grid_set_cell_size(), n_gui_grid_set_count(), n_gui_grid_set_rect(), n_gui_grid_set_scroll(), n_gui_grid_set_visible(), n_gui_new_ctx(), n_gui_open_window(), n_gui_scrollbar_get_pos(), n_gui_set_display_size(), N_GUI_WIN_FRAMELESS, n_gui_window_set_flags(), n_log, N_GUI_GRID_CALLBACKS::press, press(), pressed_button, pressed_index, pressed_x, pressed_y, presses, process_args(), set_log_level(), N_GUI_GRID_CALLBACKS::visible, visible(), N_GUI_GRID_CALLBACKS::wheel, wheel(), wheel_mods, wheels, zoom_cell, and zoom_gui.
|
static |
a press on a cell
Definition at line 94 of file ex_gui_grid.c.
References pressed_button, pressed_index, pressed_x, pressed_y, and presses.
Referenced by main().
|
static |
|
static |
the range to prepare
Definition at line 86 of file ex_gui_grid.c.
References first_seen, last, and last_seen.
Referenced by _datagrid_apply_columns(), _datagrid_hmetrics(), _draw_datagrid(), _draw_hexview(), _draw_rows_scrollbar(), _draw_syntaxview(), _listbox_hmetrics(), _scrollbar_thumb(), _syntaxview_hmetrics(), main(), n_gui_datagrid_set_column_visible(), n_gui_grid_set_visible(), n_gui_process_event(), n_gui_set_widget_visible(), n_gui_slider_set_value_visible(), and n_gui_syntaxview_scroll_to_offset().
|
static |
Ctrl+wheel resizes the cells; the plain wheel is left to scroll.
Definition at line 105 of file ex_gui_grid.c.
References n_gui_grid_set_cell_size(), wheel_mods, wheels, zoom_cell, and zoom_gui.
|
static |
Definition at line 35 of file ex_gui_grid.c.
Referenced by draw_background(), and main().
|
static |
what the callbacks saw
Definition at line 35 of file ex_gui_grid.c.
Referenced by draw(), draw_cell(), and main().
|
static |
Definition at line 32 of file ex_gui_grid.c.
|
static |
Definition at line 36 of file ex_gui_grid.c.
|
static |
Definition at line 36 of file ex_gui_grid.c.
|
static |
Definition at line 31 of file ex_gui_grid.c.
|
static |
Definition at line 35 of file ex_gui_grid.c.
|
static |
Definition at line 36 of file ex_gui_grid.c.
|
static |
Definition at line 37 of file ex_gui_grid.c.
|
static |
Definition at line 37 of file ex_gui_grid.c.
|
static |
Definition at line 35 of file ex_gui_grid.c.
|
static |
Definition at line 39 of file ex_gui_grid.c.
|
static |
what the wheel callback saw, and the cell size it keeps
Definition at line 39 of file ex_gui_grid.c.
|
static |
Definition at line 40 of file ex_gui_grid.c.
|
static |
the context the wheel callback resizes the grid in
Definition at line 42 of file ex_gui_grid.c.