From 069296d6f7d846c0c30bc76bfcb0c79661bf64ef Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Mon, 24 Feb 2025 21:22:27 +0100 Subject: [PATCH] Replace remaining strings --- .github/ISSUE_TEMPLATE/bug_report.md | 4 +- Doxyfile | 12 +- .../java-sources/tech/kore/KoreActivity.kt | 4 +- backends/system/android/sources/display.c | 6 +- backends/system/android/sources/system.c | 18 +-- backends/system/android/sources/video.c | 10 +- .../system/linux/sources/system-wayland.c | 6 +- backends/system/linux/sources/system-x11.c | 2 +- backends/system/linux/sources/system.c | 6 +- .../system/linux/sources/window-wayland.c | 8 +- backends/system/linux/sources/window-x11.c | 2 +- backends/system/macos/sources/system.c | 2 +- backends/system/macos/sources/system.m | 14 +-- backends/system/windows/sources/system.c | 6 +- create_single_header_libs.js | 6 +- format.js | 2 +- includes/kore3/error.h | 2 +- includes/kore3/math/matrix.h | 2 +- includes/kore3/system.h | 12 +- includes/kore3/video.h | 2 +- kfile.js | 104 +++++++++--------- license.txt | 2 +- sources/2d/2d_kore.cpp | 2 +- sources/root/log.c | 6 +- sources/root/system.c | 2 +- 25 files changed, 119 insertions(+), 123 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 96c2121d1..5d8b575b7 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -27,8 +27,8 @@ If applicable, add screenshots to help explain your problem. - Host system (where you compile your code): - Target system (where you run your code): - IDE and/or compiler used: -- Kinc revision: -- Kinc build output: +- Kore revision: +- Kore build output: - Application output (if it runs): **Additional context** diff --git a/Doxyfile b/Doxyfile index 7c6b14056..30a35d141 100644 --- a/Doxyfile +++ b/Doxyfile @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "Kinc" +PROJECT_NAME = "Kore" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -864,7 +864,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = Sources/kinc +INPUT = sources/kore # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -908,7 +908,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = Sources/kinc/libs Sources/kinc/io/lz4 +EXCLUDE = sources/kore/libs # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -935,7 +935,7 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = kinc_internal_* +EXCLUDE_SYMBOLS = kore_internal_* # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include @@ -1160,7 +1160,7 @@ ALPHABETICAL_INDEX = YES # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = kinc_ KINC_ +IGNORE_PREFIX = kore_ KORE_ #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -2210,7 +2210,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = KINC_DOCS +PREDEFINED = KORE_DOCS # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/backends/system/android/java-sources/tech/kore/KoreActivity.kt b/backends/system/android/java-sources/tech/kore/KoreActivity.kt index 9786b5358..f4a62f1d6 100644 --- a/backends/system/android/java-sources/tech/kore/KoreActivity.kt +++ b/backends/system/android/java-sources/tech/kore/KoreActivity.kt @@ -107,9 +107,9 @@ class KoreActivity: NativeActivity(), KeyEvent.Callback { } } - class MyHandler(private val kincActivity: KoreActivity) : Handler() { + class MyHandler(private val koreActivity: KoreActivity) : Handler() { override fun handleMessage(msg: Message) { - kincActivity.hideSystemUI() + koreActivity.hideSystemUI() } } } diff --git a/backends/system/android/sources/display.c b/backends/system/android/sources/display.c index 7cb408a51..28e1cdbb0 100644 --- a/backends/system/android/sources/display.c +++ b/backends/system/android/sources/display.c @@ -38,7 +38,7 @@ static int height() { JNIEnv *env; JavaVM *vm = kore_android_get_activity()->vm; (*vm)->AttachCurrentThread(vm, &env, NULL); - jclass koreActivityClass = kore_android_find_class(env, "tech.kinc.KincActivity"); + jclass koreActivityClass = kore_android_find_class(env, "tech.kore.KoreActivity"); jmethodID koreActivityGetScreenDpi = (*env)->GetStaticMethodID(env, koreActivityClass, "getDisplayHeight", "()I"); int height = (*env)->CallStaticIntMethod(env, koreActivityClass, koreActivityGetScreenDpi); (*vm)->DetachCurrentThread(vm); @@ -49,7 +49,7 @@ static int pixelsPerInch() { JNIEnv *env; JavaVM *vm = kore_android_get_activity()->vm; (*vm)->AttachCurrentThread(vm, &env, NULL); - jclass koreActivityClass = kore_android_find_class(env, "tech.kinc.KincActivity"); + jclass koreActivityClass = kore_android_find_class(env, "tech.kore.KoreActivity"); jmethodID koreActivityGetScreenDpi = (*env)->GetStaticMethodID(env, koreActivityClass, "getScreenDpi", "()I"); int dpi = (*env)->CallStaticIntMethod(env, koreActivityClass, koreActivityGetScreenDpi); (*vm)->DetachCurrentThread(vm); @@ -60,7 +60,7 @@ static int refreshRate() { JNIEnv *env; JavaVM *vm = kore_android_get_activity()->vm; (*vm)->AttachCurrentThread(vm, &env, NULL); - jclass koreActivityClass = kore_android_find_class(env, "tech.kinc.KincActivity"); + jclass koreActivityClass = kore_android_find_class(env, "tech.kore.KoreActivity"); jmethodID koreActivityGetScreenDpi = (*env)->GetStaticMethodID(env, koreActivityClass, "getRefreshRate", "()I"); int dpi = (*env)->CallStaticIntMethod(env, koreActivityClass, koreActivityGetScreenDpi); (*vm)->DetachCurrentThread(vm); diff --git a/backends/system/android/sources/system.c b/backends/system/android/sources/system.c index cac610ae5..b44dbd388 100644 --- a/backends/system/android/sources/system.c +++ b/backends/system/android/sources/system.c @@ -888,7 +888,7 @@ JNIEXPORT void JNICALL Java_tech_kore_KoreActivity_nativeKoreKeyPress(JNIEnv *en (*env)->ReleaseStringChars(env, chars, text); } -void KincAndroidKeyboardInit() { +void KoreAndroidKeyboardInit() { JNIEnv *env; (*activity->vm)->AttachCurrentThread(activity->vm, &env, NULL); @@ -913,7 +913,7 @@ void kore_keyboard_show() { keyboard_active = true; JNIEnv *env; (*activity->vm)->AttachCurrentThread(activity->vm, &env, NULL); - jclass koreActivityClass = kore_android_find_class(env, "tech.kinc.KincActivity"); + jclass koreActivityClass = kore_android_find_class(env, "tech.kore.KoreActivity"); (*env)->CallStaticVoidMethod(env, koreActivityClass, (*env)->GetStaticMethodID(env, koreActivityClass, "showKeyboard", "()V")); (*activity->vm)->DetachCurrentThread(activity->vm); } @@ -922,7 +922,7 @@ void kore_keyboard_hide() { keyboard_active = false; JNIEnv *env; (*activity->vm)->AttachCurrentThread(activity->vm, &env, NULL); - jclass koreActivityClass = kore_android_find_class(env, "tech.kinc.KincActivity"); + jclass koreActivityClass = kore_android_find_class(env, "tech.kore.KoreActivity"); (*env)->CallStaticVoidMethod(env, koreActivityClass, (*env)->GetStaticMethodID(env, koreActivityClass, "hideKeyboard", "()V")); (*activity->vm)->DetachCurrentThread(activity->vm); } @@ -934,7 +934,7 @@ bool kore_keyboard_active() { void kore_load_url(const char *url) { JNIEnv *env; (*activity->vm)->AttachCurrentThread(activity->vm, &env, NULL); - jclass koreActivityClass = kore_android_find_class(env, "tech.kinc.KincActivity"); + jclass koreActivityClass = kore_android_find_class(env, "tech.kore.KoreActivity"); jstring jurl = (*env)->NewStringUTF(env, url); (*env)->CallStaticVoidMethod(env, koreActivityClass, (*env)->GetStaticMethodID(env, koreActivityClass, "loadURL", "(Ljava/lang/String;)V"), jurl); (*activity->vm)->DetachCurrentThread(activity->vm); @@ -943,7 +943,7 @@ void kore_load_url(const char *url) { void kore_vibrate(int ms) { JNIEnv *env; (*activity->vm)->AttachCurrentThread(activity->vm, &env, NULL); - jclass koreActivityClass = kore_android_find_class(env, "tech.kinc.KincActivity"); + jclass koreActivityClass = kore_android_find_class(env, "tech.kore.KoreActivity"); (*env)->CallStaticVoidMethod(env, koreActivityClass, (*env)->GetStaticMethodID(env, koreActivityClass, "vibrate", "(I)V"), ms); (*activity->vm)->DetachCurrentThread(activity->vm); } @@ -951,7 +951,7 @@ void kore_vibrate(int ms) { const char *kore_language() { JNIEnv *env; (*activity->vm)->AttachCurrentThread(activity->vm, &env, NULL); - jclass koreActivityClass = kore_android_find_class(env, "tech.kinc.KincActivity"); + jclass koreActivityClass = kore_android_find_class(env, "tech.kore.KoreActivity"); jstring s = (jstring)(*env)->CallStaticObjectMethod(env, koreActivityClass, (*env)->GetStaticMethodID(env, koreActivityClass, "getLanguage", "()Ljava/lang/String;")); const char *str = (*env)->GetStringUTFChars(env, s, 0); @@ -1153,7 +1153,7 @@ void android_main(struct android_app *application) { activity = application->activity; initAndroidFileReader(); KoreAndroidVideoInit(); - KincAndroidKeyboardInit(); + KoreAndroidKeyboardInit(); application->onAppCmd = cmd; application->onInputEvent = input; activity->callbacks->onNativeWindowResized = resize; @@ -1168,7 +1168,7 @@ void android_main(struct android_app *application) { JNIEnv *env = NULL; (*kore_android_get_activity()->vm)->AttachCurrentThread(kore_android_get_activity()->vm, &env, NULL); - jclass koreMoviePlayerClass = kore_android_find_class(env, "tech.kinc.KincMoviePlayer"); + jclass koreMoviePlayerClass = kore_android_find_class(env, "tech.kore.KoreMoviePlayer"); jmethodID updateAll = (*env)->GetStaticMethodID(env, koreMoviePlayerClass, "updateAll", "()V"); while (!started) { @@ -1179,7 +1179,7 @@ void android_main(struct android_app *application) { kickstart(0, NULL); (*activity->vm)->AttachCurrentThread(activity->vm, &env, NULL); - jclass koreActivityClass = kore_android_find_class(env, "tech.kinc.KincActivity"); + jclass koreActivityClass = kore_android_find_class(env, "tech.kore.KoreActivity"); jmethodID FinishHim = (*env)->GetStaticMethodID(env, koreActivityClass, "stop", "()V"); (*env)->CallStaticVoidMethod(env, koreActivityClass, FinishHim); (*activity->vm)->DetachCurrentThread(activity->vm); diff --git a/backends/system/android/sources/video.c b/backends/system/android/sources/video.c index 4c4c0ad8a..2cdb58eff 100644 --- a/backends/system/android/sources/video.c +++ b/backends/system/android/sources/video.c @@ -430,7 +430,7 @@ void kore_android_video_shutdown(kore_android_video_t *video) { #endif -JNIEXPORT void JNICALL Java_tech_kore_KincMoviePlayer_nativeCreate(JNIEnv *env, jobject jobj, jstring jpath, jobject surface, jint id) { +JNIEXPORT void JNICALL Java_tech_kore_KoreMoviePlayer_nativeCreate(JNIEnv *env, jobject jobj, jstring jpath, jobject surface, jint id) { #if KORE_ANDROID_API >= 15 && !defined(KORE_VULKAN) const char *path = (*env)->GetStringUTFChars(env, jpath, NULL); kore_android_video_t *av = malloc(sizeof *av); @@ -451,16 +451,16 @@ void KoreAndroidVideoInit() { JNIEnv *env; (*kore_android_get_activity()->vm)->AttachCurrentThread(kore_android_get_activity()->vm, &env, NULL); - jclass clazz = kore_android_find_class(env, "tech.kinc.KincMoviePlayer"); + jclass clazz = kore_android_find_class(env, "tech.kore.KoreMoviePlayer"); // String path, Surface surface, int id - JNINativeMethod methodTable[] = {{"nativeCreate", "(Ljava/lang/String;Landroid/view/Surface;I)V", (void *)Java_tech_kore_KincMoviePlayer_nativeCreate}}; + JNINativeMethod methodTable[] = {{"nativeCreate", "(Ljava/lang/String;Landroid/view/Surface;I)V", (void *)Java_tech_kore_KoreMoviePlayer_nativeCreate}}; int methodTableSize = sizeof(methodTable) / sizeof(methodTable[0]); int failure = (*env)->RegisterNatives(env, clazz, methodTable, methodTableSize); if (failure != 0) { - kore_log(KORE_LOG_LEVEL_WARNING, "Failed to register KincMoviePlayer.nativeCreate"); + kore_log(KORE_LOG_LEVEL_WARNING, "Failed to register KoreMoviePlayer.nativeCreate"); } (*kore_android_get_activity()->vm)->DetachCurrentThread(kore_android_get_activity()->vm); @@ -479,7 +479,7 @@ void kore_video_init(kore_video *video, const char *filename) { JNIEnv *env = NULL; (*kore_android_get_activity()->vm)->AttachCurrentThread(kore_android_get_activity()->vm, &env, NULL); - jclass koreMoviePlayerClass = kore_android_find_class(env, "tech.kinc.KincMoviePlayer"); + jclass koreMoviePlayerClass = kore_android_find_class(env, "tech.kore.KoreMoviePlayer"); jmethodID constructor = (*env)->GetMethodID(env, koreMoviePlayerClass, "", "(Ljava/lang/String;)V"); jobject object = (*env)->NewObject(env, koreMoviePlayerClass, constructor, (*env)->NewStringUTF(env, filename)); diff --git a/backends/system/linux/sources/system-wayland.c b/backends/system/linux/sources/system-wayland.c index c05467855..48c93b607 100644 --- a/backends/system/linux/sources/system-wayland.c +++ b/backends/system/linux/sources/system-wayland.c @@ -308,7 +308,7 @@ void wl_pointer_handle_motion(void *data, struct wl_pointer *wl_pointer, uint32_ void wl_pointer_handle_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) { struct kore_wl_mouse *mouse = data; struct kore_wl_window *window = &wl_ctx.windows[mouse->current_window]; - int kore_button = button - BTN_MOUSE; // evdev codes should have the same order as Kinc buttons + int kore_button = button - BTN_MOUSE; // evdev codes should have the same order as Kore buttons if (!window->decorations.server_side) { if (kore_button == 0) { enum xdg_toplevel_resize_edge edges = XDG_TOPLEVEL_RESIZE_EDGE_NONE; @@ -465,7 +465,7 @@ void wl_keyboard_handle_leave(void *data, struct wl_keyboard *wl_keyboard, uint3 // struct kore_wl_keyboard *keyboard = wl_keyboard_get_user_data(wl_keyboard); } -int xkb_to_kinc(xkb_keysym_t symbol); +int xkb_to_kore(xkb_keysym_t symbol); void handle_paste(void *data, size_t data_size, void *user_data) { kore_internal_paste_callback(data); @@ -478,7 +478,7 @@ void wl_keyboard_handle_key(void *data, struct wl_keyboard *wl_keyboard, uint32_ if (keyboard->keymap && keyboard->state) { xkb_keysym_t symbol = wl_xkb.xkb_state_key_get_one_sym(keyboard->state, key + 8); uint32_t character = wl_xkb.xkb_state_key_get_utf32(keyboard->state, key + 8); - int kore_key = xkb_to_kinc(symbol); + int kore_key = xkb_to_kore(symbol); if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { if (keyboard->ctrlDown && (symbol == XKB_KEY_c || symbol == XKB_KEY_C)) { char *text = kore_internal_copy_callback(); diff --git a/backends/system/linux/sources/system-x11.c b/backends/system/linux/sources/system-x11.c index 32a9b983f..6d09ca099 100644 --- a/backends/system/linux/sources/system-x11.c +++ b/backends/system/linux/sources/system-x11.c @@ -707,7 +707,7 @@ bool kore_x11_handle_messages() { case Button5: kore_internal_mouse_trigger_scroll(window_index, 1); break; - // button 6 and 7 seem to be horizontal scrolling, which is not exposed in Kinc's api at the moment + // button 6 and 7 seem to be horizontal scrolling, which is not exposed in Kore's api at the moment case Button6: case Button7: break; diff --git a/backends/system/linux/sources/system.c b/backends/system/linux/sources/system.c index 1db94d409..db31c1c90 100644 --- a/backends/system/linux/sources/system.c +++ b/backends/system/linux/sources/system.c @@ -285,10 +285,10 @@ int kore_hardware_threads(void) { #include -int xkb_to_kinc(xkb_keysym_t symbol) { -#define KEY(xkb, kinc) \ +int xkb_to_kore(xkb_keysym_t symbol) { +#define KEY(xkb, kore) \ case xkb: \ - return kinc; + return kore; switch (symbol) { KEY(XKB_KEY_Right, KORE_KEY_RIGHT) KEY(XKB_KEY_Left, KORE_KEY_LEFT) diff --git a/backends/system/linux/sources/window-wayland.c b/backends/system/linux/sources/window-wayland.c index 6f7dda850..6c4186896 100644 --- a/backends/system/linux/sources/window-wayland.c +++ b/backends/system/linux/sources/window-wayland.c @@ -119,7 +119,7 @@ static int create_shm_fd(off_t size) { // Alpine 3.12 // Fedora 34 - fd = memfd_create("kinc-wayland-shm", MFD_CLOEXEC | MFD_ALLOW_SEALING); + fd = memfd_create("kore-wayland-shm", MFD_CLOEXEC | MFD_ALLOW_SEALING); if (fd >= 0) { fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL); int ret = posix_fallocate(fd, 0, size); @@ -134,7 +134,7 @@ static int create_shm_fd(off_t size) { #endif { - static const char template[] = "/kinc-shared-XXXXXX"; + static const char template[] = "/kore-shared-XXXXXX"; const char *path = getenv("XDG_RUNTIME_DIR"); if (!path) { @@ -206,7 +206,7 @@ static int close_data[] = { 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, }; -// image format is argb32, but kinc does not have that, so let's lie to it +// image format is argb32, but Kore does not have that, so let's lie to it static kore_image grey_image = { 1, 1, 0, KORE_IMAGE_FORMAT_RGBA32, 0, KORE_IMAGE_COMPRESSION_NONE, grey_data, sizeof(grey_data), @@ -359,7 +359,7 @@ void kore_wayland_window_set_title(int window_index, const char *title); void kore_wayland_window_change_mode(int window_index, kore_window_mode mode); #ifndef KORE_WAYLAND_APP_ID -#define KORE_WAYLAND_APP_ID "_KincApplication" +#define KORE_WAYLAND_APP_ID "_KoreApplication" #endif int kore_wayland_window_create(kore_window_parameters *win, kore_framebuffer_parameters *frame) { diff --git a/backends/system/linux/sources/window-x11.c b/backends/system/linux/sources/window-x11.c index 8b62fdf4b..89a22bb2b 100644 --- a/backends/system/linux/sources/window-x11.c +++ b/backends/system/linux/sources/window-x11.c @@ -48,7 +48,7 @@ int kore_x11_window_create(kore_window_parameters *win, kore_framebuffer_paramet InputOutput, visual, CWBorderPixel | CWColormap | CWEventMask, &set_window_attribs); static char nameClass[256]; - static const char *nameClassAddendum = "_KincApplication"; + static const char *nameClassAddendum = "_KoreApplication"; strncpy(nameClass, kore_application_name(), sizeof(nameClass) - strlen(nameClassAddendum) - 1); strcat(nameClass, nameClassAddendum); char resNameBuffer[256]; diff --git a/backends/system/macos/sources/system.c b/backends/system/macos/sources/system.c index 026b2a57e..42e906475 100644 --- a/backends/system/macos/sources/system.c +++ b/backends/system/macos/sources/system.c @@ -7,7 +7,7 @@ static int mouseX, mouseY; static bool keyboardShown = false; -void Kinc_Mouse_GetPosition(int window, int *x, int *y) { +void Kore_Mouse_GetPosition(int window, int *x, int *y) { *x = mouseX; *y = mouseY; } diff --git a/backends/system/macos/sources/system.m b/backends/system/macos/sources/system.m index 880e9bb5c..68120fe17 100644 --- a/backends/system/macos/sources/system.m +++ b/backends/system/macos/sources/system.m @@ -24,12 +24,12 @@ bool withAutoreleasepool(bool (*f)(void)) { return [[[NSBundle mainBundle] resourcePath] cStringUsingEncoding:NSUTF8StringEncoding]; } -@interface KincApplication : NSApplication { +@interface KoreApplication : NSApplication { } - (void)terminate:(id)sender; @end -@interface KincAppDelegate : NSObject { +@interface KoreAppDelegate : NSObject { } - (void)windowWillClose:(NSNotification *)notification; - (void)windowDidResize:(NSNotification *)notification; @@ -42,7 +42,7 @@ - (void)windowDidBecomeMain:(NSNotification *)notification; static NSApplication *myapp; static NSWindow *window; static BasicOpenGLView *view; -static KincAppDelegate *delegate; +static KoreAppDelegate *delegate; static struct HIDManager *hidManager; /*struct KoreWindow : public KoreWindowBase { @@ -110,7 +110,7 @@ static int createWindow(kore_window_parameters *parameters) { view = [[BasicOpenGLView alloc] initWithFrame:NSMakeRect(0, 0, width, height)]; [view registerForDraggedTypes:[NSArray arrayWithObjects:NSURLPboardType, nil]]; window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, width, height) styleMask:styleMask backing:NSBackingStoreBuffered defer:TRUE]; - delegate = [KincAppDelegate alloc]; + delegate = [KoreAppDelegate alloc]; [window setDelegate:delegate]; [window setTitle:[NSString stringWithCString:parameters->title encoding:NSUTF8StringEncoding]]; [window setAcceptsMouseMovedEvents:YES]; @@ -175,7 +175,7 @@ static void addMenubar(void) { int kore_init(const char *name, int width, int height, kore_window_parameters *win, kore_framebuffer_parameters *frame) { @autoreleasepool { - myapp = [KincApplication sharedApplication]; + myapp = [KoreApplication sharedApplication]; [myapp finishLaunching]; [[NSRunningApplication currentApplication] activateWithOptions:(NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)]; NSApp.activationPolicy = NSApplicationActivationPolicyRegular; @@ -269,7 +269,7 @@ int main(int argc, char **argv) { } #endif -@implementation KincApplication +@implementation KoreApplication - (void)terminate:(id)sender { kore_stop(); @@ -277,7 +277,7 @@ - (void)terminate:(id)sender { @end -@implementation KincAppDelegate +@implementation KoreAppDelegate - (BOOL)windowShouldClose:(NSWindow *)sender { if (windows[0].closeCallback != NULL) { if (windows[0].closeCallback(windows[0].closeCallbackData)) { diff --git a/backends/system/windows/sources/system.c b/backends/system/windows/sources/system.c index ea85c22e4..3aac21cca 100644 --- a/backends/system/windows/sources/system.c +++ b/backends/system/windows/sources/system.c @@ -1342,7 +1342,7 @@ typedef BOOL(__stdcall *MiniDumpWriteDumpType)(IN HANDLE hProcess, IN DWORD Proc static MiniDumpWriteDumpType MyMiniDumpWriteDump; static LONG __stdcall MyCrashHandlerExceptionFilter(EXCEPTION_POINTERS *pEx) { - HANDLE file = CreateFileA("kinc.dmp", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE file = CreateFileA("kore.dmp", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (file != INVALID_HANDLE_VALUE) { MINIDUMP_EXCEPTION_INFORMATION stMDEI; stMDEI.ThreadId = GetCurrentThreadId(); @@ -1362,10 +1362,6 @@ static void init_crash_handler() { } } -#ifdef KORE_KONG -void kong_init(void); -#endif - int kore_init(const char *name, int width, int height, kore_window_parameters *win, kore_framebuffer_parameters *frame) { init_crash_handler(); diff --git a/create_single_header_libs.js b/create_single_header_libs.js index c43890d6d..6483b41f9 100644 --- a/create_single_header_libs.js +++ b/create_single_header_libs.js @@ -48,7 +48,7 @@ function miniPreprocessor(source) { if (start >= 0 && end >= 0 && currentPragma.length > start + 1) { const headerPath = currentPragma.substring(start + 1, end); - if (currentPragma.substring(start + 1).startsWith('kinc')) { + if (currentPragma.substring(start + 1).startsWith('kore')) { let filePath = null; if (headerPath.includes('FileReaderImpl') || headerPath.includes('Android')) { if (!headers[headerPath]) { @@ -129,10 +129,10 @@ function insertHeaders(file, headerPaths) { return file; } -const audio2_header = fs.readFileSync(path.resolve('Sources', 'kinc', 'audio2', 'audio.h'), {encoding: 'utf8'}); +const audio2_header = fs.readFileSync(path.resolve('Sources', 'kore', 'audio', 'audio.h'), {encoding: 'utf8'}); let lib = '#pragma once\n' + miniPreprocessor(audio2_header); -let windows_backend = fs.readFileSync(path.resolve('Backends', 'Audio2', 'WASAPI', 'Sources', 'kinc', 'backend', 'wasapi.c'), {encoding: 'utf8'}); +let windows_backend = fs.readFileSync(path.resolve('backends', 'audio', 'wasapi', 'sources', 'wasapi.c'), {encoding: 'utf8'}); windows_backend = windows_backend.replace('#include ', ''); windows_backend = miniPreprocessor(windows_backend); diff --git a/format.js b/format.js index ace8f42e8..8d25a3138 100644 --- a/format.js +++ b/format.js @@ -7,7 +7,7 @@ const excludes = [ 'backends/gpu/direct3d12/sources/d3dx12.h', 'backends/gpu/direct3d12/pix', 'backends/system/android/sources/Android', - 'backends/system/linux/sources/kinc/backend/wayland', + 'backends/system/linux/sources/kore/backend/wayland', 'includes/kore3/util/offalloc', 'sources/util/offalloc', 'tests/shader/sources/stb_image_write.h' diff --git a/includes/kore3/error.h b/includes/kore3/error.h index 912cf483c..a34518a14 100644 --- a/includes/kore3/error.h +++ b/includes/kore3/error.h @@ -24,7 +24,7 @@ extern "C" { /// This is an alternative to assert which also persists in release /// builds. Use this instead of assert in situations where you want /// your users to see what's going wrong. -/// This uses Kinc's log and error functionality to make errors +/// This uses Kore's log and error functionality to make errors /// visible. /// /// diff --git a/includes/kore3/math/matrix.h b/includes/kore3/math/matrix.h index df398b4f8..288421c59 100644 --- a/includes/kore3/math/matrix.h +++ b/includes/kore3/math/matrix.h @@ -5,7 +5,7 @@ /*! \file matrix.h \brief Provides basic matrix types and a few functions which create transformation-matrices. This only provides functionality which is needed elsewhere in - Kinc - if you need more, look up how transformation-matrices work and add some functions to your own project. Alternatively the Kore/C++-API also provides a + Kore - if you need more, look up how transformation-matrices work and add some functions to your own project. Alternatively the Kore/C++-API also provides a more complete matrix-API. */ diff --git a/includes/kore3/system.h b/includes/kore3/system.h index d7031abbb..8591dba03 100644 --- a/includes/kore3/system.h +++ b/includes/kore3/system.h @@ -21,8 +21,8 @@ struct kore_window_parameters; struct kore_framebuffer_parameters; /// -/// Initializes a Kinc application and creates an initial window for systems which support windows (systems which do not support windows are treated as if the -/// would provide a single window which cannot change). This has to be called before any other Kinc-function with the exception of the Display-API which can +/// Initializes a Kore application and creates an initial window for systems which support windows (systems which do not support windows are treated as if the +/// would provide a single window which cannot change). This has to be called before any other Kore-function with the exception of the Display-API which can /// optionally be initialized beforehand using kore_display_init. /// /// The id of the initial window @@ -127,12 +127,12 @@ KORE_FUNC int kore_hardware_threads(void); KORE_FUNC double kore_time(void); /// -/// Starts Kinc's main-loop. kore_set_update_callback should be called before kore_start so the main-loop actually has something to do. +/// Starts Kore's main-loop. kore_set_update_callback should be called before kore_start so the main-loop actually has something to do. /// KORE_FUNC void kore_start(void); /// -/// Stops Kinc's main loop and thereby returns to the function which called kore_start. +/// Stops Kore's main loop and thereby returns to the function which called kore_start. /// KORE_FUNC void kore_stop(void); @@ -253,7 +253,7 @@ KORE_FUNC void kore_set_drop_files_callback(void (*callback)(wchar_t *, void *), /// /// Sets a callback which is called when the application is instructed to cut, typically via ctrl+x or cmd+x. -/// Kinc does not take ownership of the provided string. +/// Kore does not take ownership of the provided string. /// /// The cut-callback /// Arbitrary data-pointer that's passed to the callback @@ -261,7 +261,7 @@ KORE_FUNC void kore_set_cut_callback(char *(*callback)(void *), void *data); /// /// Sets a callback which is called when the application is instructed to copy, typically via ctrl+c or cmd+c. -/// Kinc does not take ownership of the provided string. +/// Kore does not take ownership of the provided string. /// /// The copy-callback /// Arbitrary data-pointer that's passed to the callback diff --git a/includes/kore3/video.h b/includes/kore3/video.h index 70ecc4c4c..2b87fbe73 100644 --- a/includes/kore3/video.h +++ b/includes/kore3/video.h @@ -63,7 +63,7 @@ KORE_FUNC int kore_video_width(kore_video *video); KORE_FUNC int kore_video_height(kore_video *video); /// -/// Gets the current image of a playing video which can be rendered using any of Kinc's graphics APIs. +/// Gets the current image of a playing video which can be rendered using Kore's GPU API. /// /// The current image of a playing video KORE_FUNC kore_gpu_texture *kore_video_current_image(kore_video *video); diff --git a/kfile.js b/kfile.js index a87480d3d..a2df0a1f3 100644 --- a/kfile.js +++ b/kfile.js @@ -3,33 +3,33 @@ const path = require('path'); const project = new Project('Kore'); -function addKincDefine(name) { +function addKoreDefine(name) { project.addDefine('KORE_' + name); } const g1 = true; -addKincDefine('G1'); +addKoreDefine('G1'); const g2 = true; -addKincDefine('G2'); +addKoreDefine('G2'); const g3 = true; -addKincDefine('G3'); +addKoreDefine('G3'); let g4 = false; let g5 = false; const a1 = true; -addKincDefine('A1'); +addKoreDefine('A1'); const a2 = true; -addKincDefine('A2'); +addKoreDefine('A2'); let a3 = false; // Setting lz4x to false adds a BSD 2-Clause licensed component, -// which is a little more restrictive than Kinc's zlib license. +// which is a little more restrictive than Kore's zlib license. const lz4x = true; project.addFile('includes/**'); @@ -57,7 +57,7 @@ addUnit('root'); addUnit('util'); if (lz4x) { - addKincDefine('LZ4X'); + addKoreDefine('LZ4X'); } else { project.addFile('sources/libs/lz4/*'); @@ -107,22 +107,22 @@ if (platform === Platform.Windows) { if (graphics === GraphicsApi.OpenGL) { g4 = true; addBackend('gpu/opengl'); - addKincDefine('OPENGL'); + addKoreDefine('OPENGL'); project.addDefine('GLEW_STATIC'); } else if (graphics === GraphicsApi.Direct3D11) { g4 = true; addBackend('gpu/direct3d11'); - addKincDefine('DIRECT3D'); - addKincDefine('DIRECT3D11'); + addKoreDefine('DIRECT3D'); + addKoreDefine('DIRECT3D11'); project.addLib('d3d11'); } else if (graphics === GraphicsApi.Direct3D12 || graphics === GraphicsApi.Default) { g4 = true; g5 = true; addBackend('gpu/direct3d12'); - addKincDefine('DIRECT3D'); - addKincDefine('DIRECT3D12'); + addKoreDefine('DIRECT3D'); + addKoreDefine('DIRECT3D12'); project.addLib('dxgi'); project.addLib('d3d12'); } @@ -130,7 +130,7 @@ if (platform === Platform.Windows) { g4 = true; g5 = true; addBackend('gpu/vulkan'); - addKincDefine('VULKAN'); + addKoreDefine('VULKAN'); project.addDefine('VK_USE_PLATFORM_WIN32_KHR'); if (!process.env.VULKAN_SDK) { throw 'Could not find a Vulkan SDK'; @@ -159,8 +159,8 @@ if (platform === Platform.Windows) { } if (vr === VrApi.Oculus) { - addKincDefine('VR'); - addKincDefine('OCULUS'); + addKoreDefine('VR'); + addKoreDefine('OCULUS'); project.addLibFor('x64', 'backends/system/windows/libraries/oculus/LibOVR/Lib/Windows/x64/Release/VS2017/LibOVR'); project.addLibFor('Win32', 'backends/system/windows/libraries/oculus/LibOVR/Lib/Windows/Win32/Release/VS2017/LibOVR'); project.addFile('backends/system/windows/libraries/oculus/LibOVRKernel/Src/GL/**'); @@ -168,8 +168,8 @@ if (platform === Platform.Windows) { project.addIncludeDir('backends/system/windows/libraries/oculus/LibOVRKernel/Src/'); } else if (vr === VrApi.SteamVR) { - addKincDefine('VR'); - addKincDefine('STEAMVR'); + addKoreDefine('VR'); + addKoreDefine('STEAMVR'); project.addDefine('VR_API_PUBLIC'); project.addFile('backends/system/windows/libraries/steamvr/src/**'); project.addIncludeDir('backends/system/windows/libraries/steamvr/src'); @@ -191,7 +191,7 @@ if (platform === Platform.Windows) { } else if (platform === Platform.WindowsApp) { g4 = true; - addKincDefine('WINDOWSAPP'); + addKoreDefine('WINDOWSAPP'); addBackend('system/windowsapp'); addBackend('system/microsoft'); addBackend('gpu/direct3d11'); @@ -200,8 +200,8 @@ else if (platform === Platform.WindowsApp) { project.vsdeploy = true; if (vr === VrApi.HoloLens) { - addKincDefine('VR'); - addKincDefine('HOLOLENS'); + addKoreDefine('VR'); + addKoreDefine('HOLOLENS'); } else if (vr === VrApi.None) { @@ -218,14 +218,14 @@ else if (platform === Platform.OSX) { g4 = true; g5 = true; addBackend('gpu/metal'); - addKincDefine('METAL'); + addKoreDefine('METAL'); project.addLib('Metal'); project.addLib('MetalKit'); } else if (graphics === GraphicsApi.OpenGL) { g4 = true; addBackend('gpu/opengl'); - addKincDefine('OPENGL'); + addKoreDefine('OPENGL'); project.addLib('OpenGL'); } else { @@ -243,7 +243,7 @@ else if (platform === Platform.OSX) { } else if (platform === Platform.iOS || platform === Platform.tvOS) { if (platform === Platform.tvOS) { - addKincDefine('TVOS'); + addKoreDefine('TVOS'); } addBackend('system/apple'); addBackend('system/ios'); @@ -252,14 +252,14 @@ else if (platform === Platform.iOS || platform === Platform.tvOS) { g4 = true; g5 = true; addBackend('gpu/metal'); - addKincDefine('METAL'); + addKoreDefine('METAL'); project.addLib('Metal'); } else if (graphics === GraphicsApi.OpenGL) { g4 = true; addBackend('gpu/opengl'); - addKincDefine('OPENGL'); - addKincDefine('OPENGL_ES'); + addKoreDefine('OPENGL'); + addKoreDefine('OPENGL_ES'); project.addLib('OpenGLES'); } else { @@ -278,24 +278,24 @@ else if (platform === Platform.iOS || platform === Platform.tvOS) { project.addLib('CoreMedia'); } else if (platform === Platform.Android) { - addKincDefine('ANDROID'); + addKoreDefine('ANDROID'); addBackend('system/android'); addBackend('system/posix'); if (graphics === GraphicsApi.Vulkan || graphics === GraphicsApi.Default) { g4 = true; g5 = true; addBackend('gpu/vulkan'); - addKincDefine('VULKAN'); + addKoreDefine('VULKAN'); project.addDefine('VK_USE_PLATFORM_ANDROID_KHR'); project.addLib('vulkan'); - addKincDefine('ANDROID_API=24'); + addKoreDefine('ANDROID_API=24'); } else if (graphics === GraphicsApi.OpenGL) { g4 = true; addBackend('gpu/opengl'); - addKincDefine('OPENGL'); - addKincDefine('OPENGL_ES'); - addKincDefine('ANDROID_API=19'); + addKoreDefine('OPENGL'); + addKoreDefine('OPENGL_ES'); + addKoreDefine('ANDROID_API=19'); project.addDefine('KORE_EGL'); } else { @@ -309,7 +309,7 @@ else if (platform === Platform.Android) { project.addLib('OpenMAXAL'); } else if (platform === Platform.Emscripten) { - addKincDefine('EMSCRIPTEN'); + addKoreDefine('EMSCRIPTEN'); //project.addLib('websocket.js -sPROXY_POSIX_SOCKETS -sUSE_PTHREADS -sPROXY_TO_PTHREAD'); addBackend('system/emscripten'); project.addLib('USE_GLFW=2'); @@ -317,14 +317,14 @@ else if (platform === Platform.Emscripten) { g4 = true; g5 = true; addBackend('gpu/webgpu'); - addKincDefine('WEBGPU'); + addKoreDefine('WEBGPU'); } else if (graphics === GraphicsApi.OpenGL || graphics === GraphicsApi.Default) { g4 = true; addBackend('gpu/opengl'); project.addExclude('backends/Graphics4/opengl/sources/GL/**'); - addKincDefine('OPENGL'); - addKincDefine('OPENGL_ES'); + addKoreDefine('OPENGL'); + addKoreDefine('OPENGL_ES'); project.addLib('USE_WEBGL2=1'); } else { @@ -332,7 +332,7 @@ else if (platform === Platform.Emscripten) { } } else if (platform === Platform.Wasm) { - addKincDefine('WASM'); + addKoreDefine('WASM'); addBackend('system/wasm'); project.addIncludeDir('miniclib'); project.addFile('miniclib/**'); @@ -340,14 +340,14 @@ else if (platform === Platform.Wasm) { g4 = true; g5 = true; addBackend('gpu/webgpu'); - addKincDefine('WEBGPU'); + addKoreDefine('WEBGPU'); } else if (graphics === GraphicsApi.OpenGL || graphics === GraphicsApi.Default) { g4 = true; addBackend('gpu/opengl'); project.addExclude('backends/Graphics4/opengl/sources/GL/**'); - addKincDefine('OPENGL'); - addKincDefine('OPENGL_ES'); + addKoreDefine('OPENGL'); + addKoreDefine('OPENGL_ES'); } else { throw new Error('Graphics API ' + graphics + ' is not available for Wasm.'); @@ -355,7 +355,7 @@ else if (platform === Platform.Wasm) { } else if (platform === Platform.Linux || platform === Platform.FreeBSD) { if (platform === Platform.FreeBSD) { // TODO - addKincDefine('LINUX'); + addKoreDefine('LINUX'); } addBackend('system/linux'); addBackend('system/posix'); @@ -473,14 +473,14 @@ else if (platform === Platform.Linux || platform === Platform.FreeBSD) { g5 = true; addBackend('gpu/vulkan'); project.addLib('vulkan'); - addKincDefine('VULKAN'); + addKoreDefine('VULKAN'); } else if (graphics === GraphicsApi.OpenGL || (platform === Platform.FreeBSD && graphics === GraphicsApi.Default)) { g4 = true; addBackend('gpu/opengl'); project.addExclude('backends/Graphics4/opengl/sources/GL/glew.c'); project.addLib('GL'); - addKincDefine('OPENGL'); + addKoreDefine('OPENGL'); project.addLib('EGL'); project.addDefine('KORE_EGL'); } @@ -488,21 +488,21 @@ else if (platform === Platform.Linux || platform === Platform.FreeBSD) { throw new Error('Graphics API ' + graphics + ' is not available for Linux.'); } if (platform === Platform.FreeBSD) { // TODO - addKincDefine('POSIX'); + addKoreDefine('POSIX'); } project.addDefine('_POSIX_C_SOURCE=200112L'); project.addDefine('_XOPEN_SOURCE=600'); } else if (platform === Platform.Pi) { g4 = true; - addKincDefine('RASPBERRY_PI'); + addKoreDefine('RASPBERRY_PI'); addBackend('system/pi'); addBackend('system/posix'); addBackend('gpu/opengl'); project.addExclude('backends/Graphics4/opengl/sources/GL/**'); - addKincDefine('OPENGL'); - addKincDefine('OPENGL_ES'); - addKincDefine('POSIX'); + addKoreDefine('OPENGL'); + addKoreDefine('OPENGL_ES'); + addKoreDefine('POSIX'); project.addDefine('_POSIX_C_SOURCE=200112L'); project.addDefine('_XOPEN_SOURCE=600'); project.addIncludeDir('/opt/vc/include'); @@ -522,16 +522,16 @@ else { } if (g4) { - addKincDefine('G4'); + addKoreDefine('G4'); } else { project.addExclude('sources/Kore/Graphics4/**'); project.addExclude('sources/kore3/graphics4/**'); } -addKincDefine('G5'); +addKoreDefine('G5'); -project.kincProcessed = true; +project.koreProcessed = true; if (plugin) { let backend = 'Unknown'; diff --git a/license.txt b/license.txt index 4d2ae2a58..ae08eec8d 100644 --- a/license.txt +++ b/license.txt @@ -1,4 +1,4 @@ -Copyright (c) 2024 the Kinc Development Team +Copyright (c) 2025 the Kore Development Team This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/sources/2d/2d_kore.cpp b/sources/2d/2d_kore.cpp index 47ff165dd..592af7b38 100644 --- a/sources/2d/2d_kore.cpp +++ b/sources/2d/2d_kore.cpp @@ -30,7 +30,7 @@ void kore_g2_end(void) { } void kore_g2_draw_image(kore_g4_texture_t *img, float x, float y) { - tex->kincTexture = *img; + tex->koreTexture = *img; tex->width = img->tex_width; tex->height = img->tex_height; tex->texWidth = img->tex_width; diff --git a/sources/root/log.c b/sources/root/log.c index 305ef107a..38fea10e6 100644 --- a/sources/root/log.c +++ b/sources/root/log.c @@ -27,13 +27,13 @@ void kore_log_args(kore_log_level level, const char *format, va_list args) { va_copy(args_android_copy, args); switch (level) { case KORE_LOG_LEVEL_INFO: - __android_log_vprint(ANDROID_LOG_INFO, "Kinc", format, args_android_copy); + __android_log_vprint(ANDROID_LOG_INFO, "Kore", format, args_android_copy); break; case KORE_LOG_LEVEL_WARNING: - __android_log_vprint(ANDROID_LOG_WARN, "Kinc", format, args_android_copy); + __android_log_vprint(ANDROID_LOG_WARN, "Kore", format, args_android_copy); break; case KORE_LOG_LEVEL_ERROR: - __android_log_vprint(ANDROID_LOG_ERROR, "Kinc", format, args_android_copy); + __android_log_vprint(ANDROID_LOG_ERROR, "Kore", format, args_android_copy); break; } va_end(args_android_copy); diff --git a/sources/root/system.c b/sources/root/system.c index d2f0ab4bd..7731c50e9 100644 --- a/sources/root/system.c +++ b/sources/root/system.c @@ -179,7 +179,7 @@ void kore_internal_logout_callback(void) { static bool running = false; // static bool showWindowFlag = true; -static char application_name[1024] = {"Kinc Application"}; +static char application_name[1024] = {"Kore Application"}; const char *kore_application_name(void) { return application_name;