![]() |
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_color.h"Go to the source code of this file.
Macros | |
| #define | ALLEGRO_UNSTABLE 1 |
Functions | |
| static void | click_middle (N_GUI_CTX *gui, int window_id, int widget_id) |
| click the middle of a widget, in display coordinates | |
| static void | expect_true (const char *what, int ok) |
| record one check | |
| int | main (int argc, char **argv) |
| static void | on_change (const float rgba[4], void *user_data) |
| the picker's callback | |
| static int | process_args (int argc, char **argv) |
| read -V LOGLEVEL | |
| static ALLEGRO_COLOR | swatch_centre (const float rgba[4]) |
| draw a swatch into a memory bitmap and read the pixel at its centre | |
Variables | |
| static float | changed [4] = {0.0f, 0.0f, 0.0f, 0.0f} |
| static int | changes = 0 |
| how many times the picker called back, and with what | |
| static int | failures = 0 |
| static int | log_level = 3 |
| #define ALLEGRO_UNSTABLE 1 |
Definition at line 15 of file ex_gui_color_picker.c.
|
static |
click the middle of a widget, in display coordinates
Definition at line 70 of file ex_gui_color_picker.c.
References gui, N_GUI_WIDGET::h, n_gui_get_widget(), n_gui_get_window(), n_gui_process_event(), N_GUI_WINDOW::titlebar_h, N_GUI_WIDGET::w, N_GUI_WIDGET::x, N_GUI_WINDOW::x, N_GUI_WIDGET::y, and N_GUI_WINDOW::y.
Referenced by main().
|
static |
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 107 of file ex_gui_color_picker.c.
References changed, changes, clear(), click_middle(), expect_true(), failures, font, gui, LOG_ERR, log_level, n_gui_color_picker_close(), n_gui_color_picker_free(), n_gui_color_picker_get(), n_gui_color_picker_is_open(), n_gui_color_picker_new(), n_gui_color_picker_open(), n_gui_color_picker_slider(), n_gui_color_picker_window(), n_gui_color_to_hex(), n_gui_destroy_ctx(), n_gui_get_window(), n_gui_new_ctx(), n_gui_set_display_size(), n_gui_slider_get_value(), n_log, on_change(), process_args(), set_log_level(), swatch_centre(), N_GUI_WINDOW::w, and N_GUI_WINDOW::x.
|
static |
the picker's callback
Definition at line 61 of file ex_gui_color_picker.c.
References changed, and changes.
Referenced by main(), main(), n_gui_add_slider(), n_gui_add_splitpane(), n_gui_add_textarea(), n_gui_add_vslider(), n_gui_color_picker_open(), n_gui_colorwheel_new(), n_gui_curve_new(), and n_gui_hexview_set_on_change().
|
static |
|
static |
draw a swatch into a memory bitmap and read the pixel at its centre
Definition at line 89 of file ex_gui_color_picker.c.
References n_gui_draw_color_swatch().
Referenced by main().
|
static |
Definition at line 34 of file ex_gui_color_picker.c.
Referenced by _hexview_handle_key(), main(), n_gui_tree_remove_node(), n_gui_tree_state_apply(), and on_change().
|
static |
how many times the picker called back, and with what
Definition at line 33 of file ex_gui_color_picker.c.
Referenced by main(), main(), on_change(), on_change(), on_change(), and on_change().
|
static |
Definition at line 30 of file ex_gui_color_picker.c.
|
static |
Definition at line 29 of file ex_gui_color_picker.c.