Skip to content

Commit

Permalink
refactor(linux): Add more tests for keymanutil.c 🏘️
Browse files Browse the repository at this point in the history
  • Loading branch information
ermshiperete committed Sep 28, 2023
1 parent 08f0b4d commit 20d2ed5
Show file tree
Hide file tree
Showing 9 changed files with 1,340 additions and 457 deletions.
325 changes: 171 additions & 154 deletions linux/ibus-keyman/src/keymanutil.c

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions linux/ibus-keyman/src/keymanutil_internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Internal data structures used in the implementation of keymanutil methods
// and exposed for unit testing.

#ifndef __KEYMANUTIL_INTERNAL_H__
#define __KEYMANUTIL_INTERNAL_H__

#include <gmodule.h>
#include "kmpdetails.h"

typedef struct {
GList *engines_list;
kmp_info *info;
gchar *kmp_dir;
} add_keyboard_data;

IBusEngineDesc *ibus_keyman_engine_desc_new(
gchar *file_name,
gchar *name,
gchar *description,
gchar *copyright,
gchar *lang,
gchar *license,
gchar *author,
gchar *icon,
gchar *layout,
gchar *version);

IBusEngineDesc *get_engine_for_language(
kmp_keyboard *keyboard,
kmp_info *info,
keyboard_details *kbd_details,
gchar *kmp_dir,
gchar *lang_id,
gchar *lang_name);

void keyman_add_keyboard(gpointer data, gpointer user_data);
void keyman_add_keyboards_from_dir(gpointer data, gpointer user_data);

#endif // __KEYMANUTIL_INTERNAL_H__
Loading

0 comments on commit 20d2ed5

Please sign in to comment.