#ifndef UBL_UTILS #define UBL_UTILS #include #include #include #include #include #include #include #include #include #define DesktopPath "/usr/share/applications" typedef enum { DICTIONARY_ACTION_WIDGETS_TYPE, DICTIONARY_IVGRAPHICALS_TYPE, DICTIONARY_OTHER_TYPE } DICT_TYPE; typedef struct { char *command; int *exitcode; } thread_output; typedef struct dictionary { char *key; void *data; struct dictionary *next; struct dictionary *prev; struct dictionary *first; DICT_TYPE data_type; } dictionary; typedef struct apps{ char *Name; int Type; char *Categories; char *Exec; char *Icon; int Pluggable; int DualPluggable; } apps; //dictionary functions dictionary *yon_dictionary_get_last(dictionary *dict); dictionary *yon_dictionary_switch_places(dictionary *dict,int aim); void yon_dictionary_make_first(dictionary *dict); void yon_dictionary_make_nth(dictionary *dict, int nth); dictionary *yon_dictionary_create_with_data(char *key, void *data); dictionary *yon_dictionary_create_with_data_connected(dictionary *dict, char *key, void *data); dictionary *yon_dictionary_connect(dictionary *old, dictionary *toconnect); dictionary *yon_dictionary_find(dictionary **dict, char *key); dictionary *yon_dictionary_rip(dictionary *dict); dictionary *yon_dictionary_get_nth(dictionary *dict, int place); //char functions char *yon_char_get_augumented(char *source, char *append); char *yon_char_new(char *chr); char *yon_cut(char *source, int size, int startpos); char *yon_char_divide(char *source, int dividepos); char *yon_char_divide_search(char *source, char* dividepos, int delete_divider); char *yon_char_from_int(int int_to_convert); //parsing functions apps *yon_apps_scan_and_parse_desktops(int *sizef); void yon_apps_sort(apps *applist,int size); apps *yon_apps_get_by_name(apps *applist,char *name, int size); //terminal-using functions int yon_launch_app(char *name); int yon_launch_app_with_arguments(char *name, char *args); int yon_launch(thread_output *thread); //Gtk functions #ifdef __GTK_H__ #define yon_gtk_builder_get_widget(obj,obj2) GTK_WIDGET(gtk_builder_get_object(obj,obj2)) typedef struct IVGrapgicals{ char *sectionName; char *categories; GtkListStore *LV; GtkWidget *Box; GtkWidget *IV; GtkWidget *label; GtkWidget *sep; GtkCellRendererPixbuf *iconRender; } IVGraphicals; GtkWidget *yon_gtk_socket_create_new_with_connect(GtkWidget *container, gpointer data); int yon_gtk_icon_view_hide_empty(dictionary *icon_view_segment); //uninitialised void yon_on_plug_added(GtkSocket* self, gpointer user_data); void yon_on_plug_removed(GtkSocket* self, gpointer user_data); int yon_dictionary_gtk_pack_start_multiple_widgets(dictionary *dict, GtkWidget *destination, gboolean expand, gboolean fill, int padding); int yon_dictionary_gtk_pack_end_multiple_widgets(dictionary *dict, GtkWidget *destination, gboolean expand, gboolean fill, int padding); #endif #endif