Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Immediate-Mode-UI/Nuklear into fe…
Browse files Browse the repository at this point in the history
…ature/combobox_for_struct
  • Loading branch information
RobLoach committed Dec 7, 2024
2 parents 326584e + 5dd782c commit fa7d7f7
Show file tree
Hide file tree
Showing 84 changed files with 11,125 additions and 9,816 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Documentation on github.io

on:
push:
branches: [ master ]

jobs:
build-documentation:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: apt-update
run: sudo apt-get update -qq
- name: apt-get doxygen
run: sudo apt-get install -y doxygen
- name: build doc
run: make docs
- name: deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/html/
enable_jekyll: false
allow_empty_commit: false
force_orphan: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ docs/xml
docs/build
docs/src
doc/doc*
doc/*
*.tmp
*.swo
*.swp
Expand Down
90 changes: 90 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

######################################################################################
## SETTINGS ##
######################################################################################

## path stuff
DOCS_PATH:=./doc
DEMO_PATH=demo
SRC_PATH=src


## Documents settings
DOXYFILE:=$(DOCS_PATH)/Doxyfile


## HEADER file packing settings
## note: source file paths are prefixed later, no need to add prefix here; just
## give it the name.
MACRO = NK
INTRO = HEADER.md
PUB = nuklear.h
OUTPUT = nuklear.h

PRIV1 = nuklear_internal.h nuklear_math.c nuklear_util.c nuklear_color.c nuklear_utf8.c nuklear_buffer.c nuklear_string.c nuklear_draw.c nuklear_vertex.c

EXTERN = stb_rect_pack.h stb_truetype.h

PRIV2 = nuklear_font.c nuklear_input.c nuklear_style.c nuklear_context.c nuklear_pool.c nuklear_page_element.c nuklear_table.c nuklear_panel.c nuklear_window.c nuklear_popup.c nuklear_contextual.c nuklear_menu.c nuklear_layout.c nuklear_tree.c nuklear_group.c nuklear_list_view.c nuklear_widget.c nuklear_text.c nuklear_image.c nuklear_9slice.c nuklear_button.c nuklear_toggle.c nuklear_selectable.c nuklear_slider.c nuklear_knob.c nuklear_progress.c nuklear_scrollbar.c nuklear_text_editor.c nuklear_edit.c nuklear_property.c nuklear_chart.c nuklear_color_picker.c nuklear_combo.c nuklear_tooltip.c

OUTRO = LICENSE CHANGELOG CREDITS

## Demo settings
DEMO_LIST = $(shell find $(DEMO_PATH) -type f -name Makefile -printf "%h ")

######################################################################################
## RECIPES ##
######################################################################################


.PHONY: usage all demos $(DEMO_LIST)

usage:
echo "make docs to create documentation"
echo "make nuke to rebuild the single header nuklear.h from source"
echo "make demos to build all of the demos
echo "make all to re-pack the header and create documentation"

all: docs nuke demos
demos: $(DEMO_LIST)


########################################################################################
## Nuklear.h

nuke: $(addprefix $(SRC_PATH)/, $(SRC))
python3 $(SRC_PATH)/build.py --macro $(MACRO) --intro $(addprefix $(SRC_PATH)/, $(INTRO)) --pub $(addprefix $(SRC_PATH)/, $(PUB)) --priv1 "$(addprefix $(SRC_PATH)/, $(PRIV1))" --extern "$(addprefix $(SRC_PATH)/, $(EXTERN))" --priv2 "$(addprefix $(SRC_PATH)/, $(PRIV2))" --outro "$(addprefix $(SRC_PATH)/, $(OUTRO))" > $(OUTPUT)





########################################################################################
## Docs

docs: $(DOCS_PATH)/html/index.html

$(DOCS_PATH)/html/index.html: $(DOCS_PATH)/doxygen-awesome-css/doxygen-awesome.css $(DOXYFILE)
doxygen $(DOXYFILE)

$(DOXYFILE):
doxygen -g $@

$(DOCS_PATH)/doxygen-awesome-css/doxygen-awesome.css:
git clone https://github.com/jothepro/doxygen-awesome-css.git $(DOCS_PATH)/doxygen-awesome-css --branch v2.3.4



########################################################################################
## Demos

$(DEMO_LIST):
$(MAKE) -C $@



########################################################################################
## Utility helpers

clean:
rm -rf $(DOCS_PATH)/html $(OUTPUT)
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ render backends, it focuses only on the actual UI.
- No global or hidden state
- Customizable library modules (you can compile and use only what you need)
- Optional font baker and vertex buffer output
- [Documentation](https://Immediate-Mode-UI.github.io/Nuklear/doc/nuklear.html)
- [Documentation](https://Immediate-Mode-UI.github.io/Nuklear/)

## Building

Expand Down
2 changes: 1 addition & 1 deletion clib.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuklear",
"version": "4.12.1",
"version": "4.12.2",
"repo": "Immediate-Mode-UI/Nuklear",
"description": "A small ANSI C gui toolkit",
"keywords": ["gl", "ui", "toolkit"],
Expand Down
2 changes: 1 addition & 1 deletion demo/allegro5/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
BIN = demo

# Flags
CFLAGS += -std=c89 -Wall -Wextra -pedantic -Wno-unused-function -O2
CFLAGS += -std=c89 -Wall -Wextra -pedantic -Wno-unused-function

SRC = main.c
OBJ = $(SRC:.c=.o)
Expand Down
15 changes: 14 additions & 1 deletion demo/allegro5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@
/*#define INCLUDE_STYLE */
/*#define INCLUDE_CALCULATOR */
/*#define INCLUDE_CANVAS */
/*#define INCLUDE_OVERVIEW */
#define INCLUDE_OVERVIEW
/*#define INCLUDE_CONFIGURATOR */
/*#define INCLUDE_NODE_EDITOR */

#ifdef INCLUDE_ALL
#define INCLUDE_STYLE
#define INCLUDE_CALCULATOR
#define INCLUDE_CANVAS
#define INCLUDE_OVERVIEW
#define INCLUDE_CONFIGURATOR
#define INCLUDE_NODE_EDITOR
#endif

Expand All @@ -64,6 +66,9 @@
#ifdef INCLUDE_OVERVIEW
#include "../../demo/common/overview.c"
#endif
#ifdef INCLUDE_CONFIGURATOR
#include "../../demo/common/style_configurator.c"
#endif
#ifdef INCLUDE_NODE_EDITOR
#include "../../demo/common/node_editor.c"
#endif
Expand All @@ -81,6 +86,11 @@ int main(void)
NkAllegro5Font *font;
struct nk_context *ctx;

#ifdef INCLUDE_CONFIGURATOR
static struct nk_color color_table[NK_COLOR_COUNT];
memcpy(color_table, nk_default_color_style, sizeof(color_table));
#endif

if (!al_init()) {
fprintf(stdout, "failed to initialize allegro5!\n");
exit(1);
Expand Down Expand Up @@ -168,6 +178,9 @@ int main(void)
#ifdef INCLUDE_OVERVIEW
overview(ctx);
#endif
#ifdef INCLUDE_CONFIGURATOR
style_configurator(ctx, color_table);
#endif
#ifdef INCLUDE_NODE_EDITOR
node_editor(ctx);
#endif
Expand Down
Loading

0 comments on commit fa7d7f7

Please sign in to comment.