Skip to content

Commit

Permalink
Replace remaining strings
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Feb 24, 2025
1 parent 058c81c commit 069296d
Show file tree
Hide file tree
Showing 25 changed files with 119 additions and 123 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
12 changes: 6 additions & 6 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions backends/system/android/sources/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
18 changes: 9 additions & 9 deletions backends/system/android/sources/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
Expand All @@ -943,15 +943,15 @@ 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);
}

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);
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand All @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions backends/system/android/sources/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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, "<init>", "(Ljava/lang/String;)V");
jobject object = (*env)->NewObject(env, koreMoviePlayerClass, constructor, (*env)->NewStringUTF(env, filename));

Expand Down
6 changes: 3 additions & 3 deletions backends/system/linux/sources/system-wayland.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion backends/system/linux/sources/system-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions backends/system/linux/sources/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ int kore_hardware_threads(void) {

#include <xkbcommon/xkbcommon.h>

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)
Expand Down
8 changes: 4 additions & 4 deletions backends/system/linux/sources/window-wayland.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion backends/system/linux/sources/window-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion backends/system/macos/sources/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
14 changes: 7 additions & 7 deletions backends/system/macos/sources/system.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 <NSWindowDelegate> {
@interface KoreAppDelegate : NSObject <NSWindowDelegate> {
}
- (void)windowWillClose:(NSNotification *)notification;
- (void)windowDidResize:(NSNotification *)notification;
Expand All @@ -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 {
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -269,15 +269,15 @@ int main(int argc, char **argv) {
}
#endif

@implementation KincApplication
@implementation KoreApplication

- (void)terminate:(id)sender {
kore_stop();
}

@end

@implementation KincAppDelegate
@implementation KoreAppDelegate
- (BOOL)windowShouldClose:(NSWindow *)sender {
if (windows[0].closeCallback != NULL) {
if (windows[0].closeCallback(windows[0].closeCallbackData)) {
Expand Down
Loading

0 comments on commit 069296d

Please sign in to comment.