JackUtils 0.5
Provides simplified Jack API for clients :)
Loading...
Searching...
No Matches
jackgui.h
Go to the documentation of this file.
1/* GUI Extension for jackutils library.
2 * Copyright (C) UtoECat 2022. All rights Reserved!
3
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
32#define JG_API
33
34#include <ext/gl.h>
35#include <stdarg.h>
36#include <ext/nuklear.h>
37
38typedef struct nk_context jg_ctx_t;
39
49JG_API jg_ctx_t* jg_init(const char* title, int w, int h);
50
56JG_API void jg_uninit(jg_ctx_t* u);
57
69JG_API int jg_begin(jg_ctx_t* u, int fullscreen);
70
80JG_API void jg_end(jg_ctx_t* u, int mul);
81
88JG_API void jg_sync_visibility(jg_ctx_t* gui, ju_ctx_t* ctx);
89
90/*
91 * Shows or hides window.
92 * @param u GUI Context
93 * @param s Show(1) or hide(0) window?
94 * @ingroup jackgui
95 */
96JG_API void jg_set_visibility(jg_ctx_t* u, int s);
97
107JG_API void jg_request_redraw(jg_ctx_t* u);
108
118JG_API void jg_show_message(jg_ctx_t* u, ju_cstr_t msg);
119
126JG_API void jg_show_about(jg_ctx_t*u);
127
140JG_API struct nk_image jg_image_load_from_memory(const unsigned char *ptr, int w, int h, int channels);
141
147JG_API void jg_image_free(struct nk_image img);
148
152JG_API struct nk_image jg_jackutils_icon(void);
153
163float jg_whell_float(jg_ctx_t* ctx, float value, float min, float max);
164
172JG_API void jg_jackutils_topbar(jg_ctx_t* u, ju_ctx_t* j);
173
float jg_whell_float(jg_ctx_t *ctx, float value, float min, float max)
Float whell widget.
Definition: jackwidgets.c:136
JG_API void jg_jackutils_topbar(jg_ctx_t *u, ju_ctx_t *j)
JackUtils Classic GUI topbar.
Definition: jackwidgets.c:267
JG_API void jg_sync_visibility(jg_ctx_t *gui, ju_ctx_t *ctx)
Synchronize window visibility with Session Manager (if has one, else do nothing).
Definition: jackgui.c:276
JG_API jg_ctx_t * jg_init(const char *title, int w, int h)
Initializes GUI context.
Definition: jackgui.c:58
JG_API void jg_show_message(jg_ctx_t *u, ju_cstr_t msg)
Notifies user with message.
Definition: jackgui.c:263
JG_API int jg_begin(jg_ctx_t *u, int fullscreen)
Starts GUI objects enumeration.
Definition: jackgui.c:107
JG_API void jg_request_redraw(jg_ctx_t *u)
Sends redraw event to internal event pool.
Definition: jackgui.c:298
JG_API void jg_end(jg_ctx_t *u, int mul)
Ends GUI objects enumeration.
Definition: jackgui.c:250
JG_API void jg_uninit(jg_ctx_t *u)
Destroys GUI context.
Definition: jackgui.c:98
JG_API void jg_show_about(jg_ctx_t *u)
Shows about subwindow with information about your program.
Definition: jackgui.c:272
const char * ju_cstr_t
Informative type definition.
Definition: jackutils.h:64
JG_API void jg_image_free(struct nk_image img)
Frees nuklear image.
JG_API struct nk_image jg_image_load_from_memory(const unsigned char *ptr, int w, int h, int channels)
Nuklear Image load function.
JG_API struct nk_image jg_jackutils_icon(void)
Definition: jackgui.c:54
Internal JackUtils context structure.
Definition: ju_bits_ctx.h:39