#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_curve.h"
Go to the source code of this file.
|
| #define | ALLEGRO_UNSTABLE 1 |
| #define | AT_X(cx) |
| | the editor sits at 50,50 and is 200 by 100: display position of a curve coordinate
|
| #define | AT_Y(cy) |
| | as AT_X, for y
|
|
| static void | background (float x, float y, float w, float h, void *user_data) |
| | a background
|
| static void | drag (N_GUI_CTX *gui, float fx, float fy, float tx, float ty) |
| | press, drag to, release
|
| static void | expect_true (const char *what, int ok) |
| | record one check
|
| static void | feed (N_GUI_CTX *gui, int type, int x, int y, int button) |
| | feed one mouse event at display coordinates
|
| static float | flat (const float *xs, const float *ys, int count, float x, void *user_data) |
| | a caller's own curve: flat
|
| int | main (int argc, char **argv) |
| static int | near (float a, float b) |
| | is a near b
|
| static void | on_change (int widget_id, int dragging, void *user_data) |
| | change callback
|
| static int | process_args (int argc, char **argv) |
| | read -V LOGLEVEL
|
| static void | right (N_GUI_CTX *gui, float cx, float cy) |
| | right press
|
◆ ALLEGRO_UNSTABLE
| #define ALLEGRO_UNSTABLE 1 |
◆ AT_X
Value:((int)(50.0f + (cx) * 200.0f + 0.5f))
the editor sits at 50,50 and is 200 by 100: display position of a curve coordinate
Definition at line 102 of file ex_gui_curve.c.
◆ AT_Y
Value:((int)(50.0f + (1.0f - (cy)) * 100.0f + 0.5f))
as AT_X, for y
Definition at line 104 of file ex_gui_curve.c.
◆ background()
| void background |
( |
float | x, |
|
|
float | y, |
|
|
float | w, |
|
|
float | h, |
|
|
void * | user_data ) |
|
static |
◆ drag()
| void drag |
( |
N_GUI_CTX * | gui, |
|
|
float | fx, |
|
|
float | fy, |
|
|
float | tx, |
|
|
float | ty ) |
|
static |
◆ expect_true()
| void expect_true |
( |
const char * | what, |
|
|
int | ok ) |
|
static |
◆ feed()
| void feed |
( |
N_GUI_CTX * | gui, |
|
|
int | type, |
|
|
int | x, |
|
|
int | y, |
|
|
int | button ) |
|
static |
◆ flat()
| float flat |
( |
const float * | xs, |
|
|
const float * | ys, |
|
|
int | count, |
|
|
float | x, |
|
|
void * | user_data ) |
|
static |
◆ main()
| int main |
( |
int | argc, |
|
|
char ** | argv ) |
Definition at line 126 of file ex_gui_curve.c.
References AT_X, AT_Y, background(), background_drawn, changes, drag(), drag_changes, expect_true(), failures, feed(), flat(), font, gui, LOG_ERR, log_level, n_gui_add_label(), n_gui_add_window(), N_GUI_ALIGN_LEFT, n_gui_curve_eval(), n_gui_curve_eval_points(), n_gui_curve_get_points(), n_gui_curve_new(), n_gui_curve_set_background(), n_gui_curve_set_eval(), n_gui_curve_set_point_radius(), n_gui_curve_set_points(), n_gui_destroy_ctx(), n_gui_draw(), n_gui_new_ctx(), n_gui_open_window(), n_gui_set_display_size(), N_GUI_WIN_FRAMELESS, n_gui_window_set_flags(), n_log, near(), on_change(), process_args(), right(), and set_log_level().
◆ near()
| int near |
( |
float | a, |
|
|
float | b ) |
|
static |
◆ on_change()
| void on_change |
( |
int | widget_id, |
|
|
int | dragging, |
|
|
void * | user_data ) |
|
static |
◆ process_args()
| int process_args |
( |
int | argc, |
|
|
char ** | argv ) |
|
static |
◆ right()
| void right |
( |
N_GUI_CTX * | gui, |
|
|
float | cx, |
|
|
float | cy ) |
|
static |
right press
- Examples
- ex_gui_curve.c, and ex_gui_label_lines.c.
Definition at line 115 of file ex_gui_curve.c.
References AT_X, AT_Y, feed(), and gui.
Referenced by _datagrid_header_hit(), _set_clipping_rect_transformed(), heap_pop(), main(), n_gui_tree_draw_overlay(), parse_and(), parse_or(), and rule_align().
◆ background_drawn
◆ changes
changes seen: all of them, and those that were drag steps
Definition at line 34 of file ex_gui_curve.c.
◆ drag_changes
◆ failures
◆ log_level