Enhancement: Fixes #431, taskband - Start menu - All Programs should use filesystem-based tree, drop GarconGtkMenu

This commit is contained in:
Rory Fewell
2025-02-23 14:23:24 +00:00
parent acc82fa8d1
commit 7a68cd7f13
10 changed files with 916 additions and 7 deletions

View File

@@ -51,6 +51,8 @@ add_library(
public/delegate.h
src/errors.c
public/errors.h
src/hashtable.c
public/hashtable.h
src/icons.c
public/icons.h
src/list.c

View File

@@ -0,0 +1,25 @@
/** @file */
#ifndef __COMGTK_HASHTABLE_H__
#define __COMGTK_HASHTABLE_H__
#include <glib.h>
//
// PUBLIC FUNCTIONS
//
/**
* Inserts mapping pairs from an array into a hash table.
*
* @param hash_table The hash table.
* @param mappings The array of mappings pairs.
* @param arr_size The total elements in the array (not number of pairs).
*/
void wintc_hash_table_insert_from_array(
GHashTable* hash_table,
void** mappings,
gsize arr_size
);
#endif

View File

@@ -11,6 +11,7 @@
#include "@LIB_HEADER_DIR@/defprocs.h"
#include "@LIB_HEADER_DIR@/delegate.h"
#include "@LIB_HEADER_DIR@/errors.h"
#include "@LIB_HEADER_DIR@/hashtable.h"
#include "@LIB_HEADER_DIR@/icons.h"
#include "@LIB_HEADER_DIR@/list.h"
#include "@LIB_HEADER_DIR@/listbox.h"

View File

@@ -9,6 +9,16 @@
// PUBLIC FUNCTIONS
//
/**
* Gets the last component of a path.
*
* @param path The path.
* @return A pointer to the last component of the path.
*/
const gchar* wintc_basename(
const gchar* path
);
/**
* Copies a string, ensuring it has the specified prefix.
*

View File

@@ -0,0 +1,22 @@
#include <glib.h>
#include "../public/hashtable.h"
//
// PUBLIC FUNCTIONS
//
void wintc_hash_table_insert_from_array(
GHashTable* hash_table,
void** mappings,
gsize arr_size
)
{
for (gsize i = 0; i < arr_size; i += 2)
{
g_hash_table_insert(
hash_table,
mappings[i],
mappings[i + 1]
);
}
}

View File

@@ -6,6 +6,21 @@
//
// PUBLIC FUNCTIONS
//
const gchar* wintc_basename(
const gchar* path
)
{
const gchar* last_sep =
strrchr(path, G_DIR_SEPARATOR);
if (last_sep)
{
return last_sep + 1;
}
return path;
}
gchar* wintc_str_set_prefix(
const gchar* str,
const gchar* prefix