You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
2.8 KiB
95 lines
2.8 KiB
#include "libublsettings-gtk3.h"
|
|
|
|
#ifdef __GTK_H__
|
|
|
|
// GtkEntry section
|
|
// struct entry_pattern_data {
|
|
// GtkEntry *entry;
|
|
// char *pattern; // %d %s
|
|
// };
|
|
|
|
// char *yon_gtk_entry_pattern_format(GtkWidget *target, struct entry_pattern_data *data){
|
|
// if (target){
|
|
// const char *entry_data = gtk_entry_get_text(target);
|
|
// int next_track=0;
|
|
// for (int i=0; i<strlen(data->pattern);i++){
|
|
// char target_letter=-1;
|
|
// target_letter = ;
|
|
// switch (data->pattern[i]){
|
|
// case '%':next_track=1;
|
|
// break;
|
|
// case 'd':if (next_track){
|
|
|
|
// }
|
|
// break;
|
|
// case 's':
|
|
// break;
|
|
// default:
|
|
|
|
// }
|
|
// }
|
|
|
|
// };
|
|
// }
|
|
|
|
// void yon_gtk_entry_set_pattern(GtkEntry *entry, char *pattern){
|
|
// struct entry_pattern_data *data = malloc(sizeof(struct entry_pattern_data));
|
|
// data->entry=entry;
|
|
// data->pattern=pattern;
|
|
// char *current_text = gtk_entry_get_text(entry);
|
|
|
|
// }
|
|
|
|
|
|
config_str yon_resource_open_file(const char *path, int *size){
|
|
config_str parsed = NULL;
|
|
char *modules;
|
|
gsize sz;
|
|
GFile *file = g_file_new_for_uri(path);
|
|
g_file_load_contents(file,NULL,&modules,&sz,NULL,NULL);
|
|
g_object_unref(G_OBJECT(file));
|
|
parsed = yon_char_parse(modules,size,"\n");
|
|
return parsed;
|
|
}
|
|
|
|
// dictionary *__yon_config_listeners = NULL;
|
|
// typedef struct {
|
|
// GtkWidget *target;
|
|
// char *widget_parameter;
|
|
// void *check_function;
|
|
// char *parameter;
|
|
// char *save_command;
|
|
// } config_listener;
|
|
|
|
// void __yon_gtk_config_activated(GtkWidget *, config_listener *current){
|
|
// char *parameter;
|
|
|
|
// if (((int (*)(char*, GtkWidget*, char*))(current->check_function))(parameter,current->target, current->parameter)) {
|
|
// }
|
|
|
|
// }
|
|
|
|
// int yon_gtk_config_add_listener (GtkWidget *target, char *parameter, char *save_command,int(check_function)(char*,GtkWidget*,char*)){
|
|
// if (__yon_config_listeners){
|
|
// dictionary *dict;
|
|
// for_dictionaries(dict,__yon_config_listeners){
|
|
// if (target==((config_listener*)dict->data)->target){
|
|
// return 0;
|
|
// }
|
|
// }
|
|
// }
|
|
// config_listener *current = malloc(sizeof(config_listener));
|
|
// current->target=target;
|
|
// current->parameter = parameter;
|
|
// current->save_command = save_command;
|
|
// current->check_function = (void*)check_function;
|
|
// if (GTK_IS_TOGGLE_BUTTON(target)){
|
|
// g_signal_connect(G_OBJECT(target),"toggled",C_CALLBACK(__yon_gtk_config_activated),current);
|
|
|
|
// }
|
|
|
|
// yon_dictionary_add_or_create_if_exists_with_data(__yon_config_listeners,NULL,current);
|
|
// return 0;
|
|
// }
|
|
|
|
#endif |