mirror of
https://github.com/rozniak/xfce-winxp-tc.git
synced 2026-05-01 03:31:33 +00:00
Enhancement: Fixes #431, taskband - Start menu - All Programs should use filesystem-based tree, drop GarconGtkMenu
This commit is contained in:
@@ -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
|
||||
|
||||
25
shared/comgtk/public/hashtable.h
Normal file
25
shared/comgtk/public/hashtable.h
Normal 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
|
||||
@@ -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"
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
22
shared/comgtk/src/hashtable.c
Normal file
22
shared/comgtk/src/hashtable.c
Normal 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]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user