![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include "nilorea/n_common.h"#include "nilorea/n_gui.h"#include "nilorea/n_log.h"
Include dependency graph for ex_gui_detach.c:Go to the source code of this file.
Data Structures | |
| struct | DEMO_PANEL |
| one demo panel: a window plus the button that detaches / attaches it More... | |
Macros | |
| #define | ALLEGRO_UNSTABLE 1 |
| #define | HEIGHT 640 |
| #define | LAYOUT_FILE "ex_gui_detach_layout.json" |
| #define | WIDTH 960 |
Functions | |
| static int | build_panel (const char *title, float x, float y, float w, float h, int detach_flags, const char *name) |
| build one demo panel: a few ordinary widgets plus its detach button | |
| int | main (int argc, char **argv) |
| static void | on_attach_all (int widget_id, void *user_data) |
| static void | on_detach_all (int widget_id, void *user_data) |
| static void | on_load_layout (int widget_id, void *user_data) |
| static void | on_panel_close (int window_id, void *user_data) |
| A native window's close button (the window manager's, or N_GUI's own when the panel keeps its chrome) lands here exactly like a pop-up's would. | |
| static void | on_save_layout (int widget_id, void *user_data) |
| static void | on_show_all (int widget_id, void *user_data) |
| static void | on_slider_change (int widget_id, double value, void *user_data) |
| static void | on_toggle_detach (int widget_id, void *user_data) |
| the per-panel button: toggle this panel between pop-up and native window | |
| static DEMO_PANEL * | panel_of (int window_id) |
| find the panel a window id belongs to, or NULL | |
| static void | process_args (int argc, char **argv) |
| static void | refresh_buttons (void) |
| keep each panel's button label in sync with what it will do next | |
Variables | |
| static int | auto_detach = 0 |
| 1 to detach every panel at startup (-a) | |
| static int | DONE = 0 |
| static N_GUI_CTX * | gui = NULL |
| static int | lbl_hint = -1 |
| static int | lbl_status = -1 |
| static int | log_level = 5 |
| static int | nb_panels = 0 |
| static int | notes_txt = -1 |
| text area of the "Notes" panel, used by the copy/paste hint | |
| static DEMO_PANEL | panels [3] |
| static double | quit_after = 0.0 |
| seconds after which the demo quits on its own (0 = run until ESC) | |
| struct DEMO_PANEL |
one demo panel: a window plus the button that detaches / attaches it
Definition at line 60 of file ex_gui_detach.c.
Collaboration diagram for DEMO_PANEL:| #define ALLEGRO_UNSTABLE 1 |
Definition at line 44 of file ex_gui_detach.c.
| #define HEIGHT 640 |
Definition at line 56 of file ex_gui_detach.c.
| #define LAYOUT_FILE "ex_gui_detach_layout.json" |
Definition at line 57 of file ex_gui_detach.c.
| #define WIDTH 960 |
Definition at line 55 of file ex_gui_detach.c.
|
static |
build one demo panel: a few ordinary widgets plus its detach button
Definition at line 237 of file ex_gui_detach.c.
References DEMO_PANEL::btn, DEMO_PANEL::detach_flags, gui, n_gui_add_button(), n_gui_add_window(), n_gui_set_widget_tooltip(), N_GUI_SHAPE_ROUNDED, N_GUI_WIN_BTN_ALL, N_GUI_WIN_RESIZABLE, n_gui_window_set_close_callback(), n_gui_window_set_flags(), DEMO_PANEL::name, nb_panels, on_panel_close(), on_toggle_detach(), panels, and DEMO_PANEL::win.
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 255 of file ex_gui_detach.c.
References auto_detach, build_panel(), display, DONE, fps_timer, gui, N_GUI_CTX::gui_offset_x, N_GUI_CTX::gui_offset_y, N_GUI_CTX::gui_scale, HEIGHT, lbl_hint, lbl_status, LOG_ERR, log_level, LOG_NOTICE, n_gui_add_button(), n_gui_add_checkbox(), n_gui_add_label(), n_gui_add_listbox(), n_gui_add_progressbar(), n_gui_add_slider(), n_gui_add_textarea(), n_gui_add_window(), N_GUI_ALIGN_LEFT, n_gui_destroy_ctx(), N_GUI_DETACH_OWN_CHROME, N_GUI_DETACH_RESIZABLE, N_GUI_DETACH_SCALE_CONTENT, n_gui_draw(), n_gui_draw_detached(), n_gui_listbox_add_item(), n_gui_new_ctx(), n_gui_process_event(), N_GUI_SELECT_SINGLE, n_gui_set_display(), n_gui_set_display_size(), n_gui_set_event_queue(), n_gui_set_virtual_size(), N_GUI_SHAPE_ROUNDED, N_GUI_SLIDER_PERCENT, n_gui_slider_set_step(), n_gui_textarea_set_text(), N_GUI_WIN_BTN_MINIMIZE, n_gui_window_set_flags(), n_log, notes_txt, on_attach_all(), on_detach_all(), on_load_layout(), on_save_layout(), on_show_all(), on_slider_change(), process_args(), quit_after, refresh_buttons(), set_log_level(), N_GUI_CTX::virtual_w, and WIDTH.
Here is the call graph for this function:
|
static |
Definition at line 180 of file ex_gui_detach.c.
References gui, n_gui_window_attach(), nb_panels, panels, and refresh_buttons().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 170 of file ex_gui_detach.c.
References gui, n_gui_window_detach(), n_gui_window_is_detached(), nb_panels, panels, and refresh_buttons().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 220 of file ex_gui_detach.c.
References gui, LAYOUT_FILE, LOG_ERR, LOG_NOTICE, n_gui_load_layout_json(), n_log, and refresh_buttons().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
A native window's close button (the window manager's, or N_GUI's own when the panel keeps its chrome) lands here exactly like a pop-up's would.
The display itself is released at the next n_gui_draw_detached, never from inside this callback.
Definition at line 193 of file ex_gui_detach.c.
References gui, LOG_NOTICE, n_gui_close_window(), n_log, DEMO_PANEL::name, and panel_of().
Referenced by build_panel().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 211 of file ex_gui_detach.c.
References gui, LAYOUT_FILE, LOG_ERR, LOG_NOTICE, n_gui_save_layout_json(), and n_log.
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 200 of file ex_gui_detach.c.
References gui, n_gui_open_window(), nb_panels, panels, and refresh_buttons().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 230 of file ex_gui_detach.c.
|
static |
the per-panel button: toggle this panel between pop-up and native window
Definition at line 155 of file ex_gui_detach.c.
References DEMO_PANEL::detach_flags, gui, LOG_ERR, LOG_NOTICE, n_gui_window_attach(), n_gui_window_detach(), n_gui_window_is_detached(), n_log, DEMO_PANEL::name, refresh_buttons(), and DEMO_PANEL::win.
Referenced by build_panel().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
find the panel a window id belongs to, or NULL
Definition at line 126 of file ex_gui_detach.c.
References nb_panels, and panels.
Referenced by on_panel_close().
Here is the caller graph for this function:
|
static |
Definition at line 86 of file ex_gui_detach.c.
References auto_detach, LOG_DEBUG, LOG_ERR, LOG_INFO, log_level, LOG_NOTICE, LOG_NULL, n_log, quit_after, and set_log_level().
Here is the call graph for this function:
|
static |
keep each panel's button label in sync with what it will do next
Definition at line 134 of file ex_gui_detach.c.
References gui, lbl_status, n_gui_button_set_label(), n_gui_count_detached(), n_gui_label_set_text(), n_gui_window_is_detached(), DEMO_PANEL::name, nb_panels, and panels.
Referenced by main(), on_attach_all(), on_detach_all(), on_load_layout(), on_show_all(), and on_toggle_detach().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
1 to detach every panel at startup (-a)
Definition at line 76 of file ex_gui_detach.c.
Referenced by main(), and process_args().
|
static |
Definition at line 72 of file ex_gui_detach.c.
|
static |
Definition at line 78 of file ex_gui_detach.c.
Referenced by build_datagrid_window(), build_panel(), build_syntaxview_window(), build_textarea_window(), build_widgets_window(), build_window(), chat_log_add(), click_at(), click_on(), ctrl_key(), dropmenu_label(), main(), main(), on_attach_all(), on_clear_click(), on_completion_select(), on_detach_all(), on_ghost_toggle(), on_grid_toggle(), on_height_toggle(), on_load_layout(), on_load_layout_click(), on_panel_close(), on_player_toggle(), on_proj_select(), on_save_layout(), on_save_layout_click(), on_search_change(), on_send_click(), on_show_all(), on_smooth_toggle(), on_toggle_detach(), on_window_toggle_click(), on_windows_menu_open(), placeholder_of(), refresh_buttons(), refresh_clients_list(), update_completion(), and update_definitions().
|
static |
|
static |
Definition at line 81 of file ex_gui_detach.c.
|
static |
Definition at line 71 of file ex_gui_detach.c.
|
static |
Definition at line 80 of file ex_gui_detach.c.
Referenced by build_panel(), on_attach_all(), on_detach_all(), on_show_all(), panel_of(), and refresh_buttons().
|
static |
text area of the "Notes" panel, used by the copy/paste hint
Definition at line 84 of file ex_gui_detach.c.
Referenced by main().
|
static |
Definition at line 79 of file ex_gui_detach.c.
Referenced by build_panel(), on_attach_all(), on_detach_all(), on_show_all(), panel_of(), and refresh_buttons().
|
static |
seconds after which the demo quits on its own (0 = run until ESC)
Definition at line 74 of file ex_gui_detach.c.
Referenced by main(), and process_args().