@ -69,7 +69,16 @@ typedef struct apps
typedef char * * config_str ;
typedef char * * config_str ;
// dictionary functions
// dictionary functions
/**yon_dictionary_get_data(dictionary, type)
* [ EN ]
* Gets data from dictionary .
* [ dictionary ] is dictionary , from which data should be extracted ;
* [ type ] is type of data , [ dictionary ] contains .
* [ RU ]
* В о з в р а щ а е т д а н н ы е и з с л о в а р я .
* [ dictionary ] - с л о в а р ь и з к о т о р о г о д о с т а ю т с я д а н н ы е .
* [ type ] - т и п д а н н ы х , х р а н я щ и х с я в с л о в а р е [ dictionary ] .
*/
# define yon_dictionary_get_data(dictionary, type) ((type)dictionary->data)
# define yon_dictionary_get_data(dictionary, type) ((type)dictionary->data)
# define yon_dictionary_add_or_create_if_exists_with_data(dict,key,data) if (!dict) dict=yon_dictionary_create_with_data(key,data); \
# define yon_dictionary_add_or_create_if_exists_with_data(dict,key,data) if (!dict) dict=yon_dictionary_create_with_data(key,data); \
else dict = yon_dictionary_create_with_data_connected ( dict , key , data ) ;
else dict = yon_dictionary_create_with_data_connected ( dict , key , data ) ;
@ -154,10 +163,20 @@ int yon_launch(thread_output *thread);
# ifdef __GTK_H__
# ifdef __GTK_H__
# ifdef VTE_TERMINAL
# ifdef VTE_TERMINAL
/**
*
*/
void yon_terminal_integrated_launch ( GtkWidget * place_to_show , char * command , void * endwork_function , void * endwork_function_argument ) ;
void yon_terminal_integrated_launch ( GtkWidget * place_to_show , char * command , void * endwork_function , void * endwork_function_argument ) ;
# endif
# endif
# define yon_gtk_builder_get_widget(obj, obj2) GTK_WIDGET(gtk_builder_get_object(obj, obj2))
/**yon_gtk_builder_get_widget(builder, widget_name)
* [ EN ]
* Returns GtkWidget from GtkBuilder * [ builder ] .
* [ builder ] is GtkBuilder * ;
* [ widget_name ] is id of widget ;
*/
# define yon_gtk_builder_get_widget(builder, widget_name) GTK_WIDGET(gtk_builder_get_object(builder, widget_name))
typedef struct
typedef struct
{
{
@ -177,17 +196,11 @@ int yon_gtk_combo_box_fill(GtkWidget *combo, char **parameters,int size);
int yon_gtk_combo_box_text_find ( GtkWidget * combo_box , char * text_to_find ) ;
int yon_gtk_combo_box_text_find ( GtkWidget * combo_box , char * text_to_find ) ;
GtkWidget * yon_gtk_socket_create_new_with_connect ( GtkWidget * container , gpointer data ) ;
int yon_gtk_icon_view_hide_empty ( dictionary * icon_view_segment ) ;
int yon_gtk_icon_view_hide_empty ( dictionary * icon_view_segment ) ;
int yon_dictionary_gtk_pack_start_multiple_widgets ( dictionary * dict , GtkWidget * destination , gboolean expand , gboolean fill , int padding ) ;
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 ) ;
int yon_dictionary_gtk_pack_end_multiple_widgets ( dictionary * dict , GtkWidget * destination , gboolean expand , gboolean fill , int padding ) ;
// uninitialised
void yon_on_plug_added ( GtkSocket * self , gpointer user_data ) ;
void yon_on_plug_removed ( GtkSocket * self , gpointer user_data ) ;
typedef enum
typedef enum
@ -202,16 +215,72 @@ typedef struct {
GtkWidget * box ;
GtkWidget * box ;
GtkWidget * label ;
GtkWidget * label ;
char * text_to_render ;
char * text_to_render ;
char * * text_strings_to_render ;
int strings_size ;
} render_data ;
} render_data ;
/**yon_ubl_status_box_setup(render,icon,box,label)
# define yon_ubl_status_box_render(render) {pthread_attr_t attr; pthread_attr_init(&attr); pthread_t tid; pthread_create(&tid,&attr,(void*)_yon_ubl_status_box_render,((void*)render)); }
* [ EN ]
* Sets up [ render ] structure of type render_data .
* [ icon ] is GtkImage widget of status box for showing status icons ;
* [ box ] is GtkBox widget of status box for showing status color ;
* [ label ] is GtkLabel widget of status box for showing status text ;
* [ RU ]
* Н а с т р а и в а е т с т р у к т у р у [ render ] т и п а render_data .
* [ icon ] - в и д ж е т т и п а GtkIcon в к о т о р о м б у д у т о т о б р а ж а т ь с я с т а т у с н ы е и к о н к и ;
* [ box ] - в и д ж е т т и п а GtkBox в к о т о р о м б у д е т о т о б р а ж а т ь с я ц в е т с т а т у с а ;
* [ label ] - в и д ж е т т и п а GtkLabel в к о т о р о м б у д е т о т о б р а ж а т ь с я т е к с т с т а т у с н о г о с о о б щ е н и я ;
*/
# define yon_ubl_status_box_setup(render,icon,box,label) {render.icon=GTK_WIDGET(icon); render.box=GTK_WIDGET(box); render.label=GTK_WIDGET(label);}
/**yon_ubl_status_box_render(render,text,type)
* [ EN ]
* Renders message in status box ;
* [ render ] is render_data structure of status box ;
* [ text ] is text to be shown in status box ;
* [ type ] if type of message . Can be BACKGROUND_IMAGE_FAIL_TYPE or BACKGROUND_IMAGE_SUCCESS_TYPE
* [ RU ]
* О т о б р а ж а е т с о о б щ е н и е в с т а т у с н о м о к н е .
* [ render ] - с т р у к т у р а т и п а render_data д л я н у ж н о г о с т а т у с н о г о о к н а ;
* [ text ] - т е к с т , о т о б р а ж а е м ы й в с т а т у с н о м о к н е ;
* [ type ] - т и п с о о б щ е н и я . М о ж е т б ы т ь :
* BACKGROUND_IMAGE_FAIL_TYPE ( к р а с н ы й ф о н , и к о н к а - в о с к л и ц а т е л ь н ы й з н а к )
* и л и
* BACKGROUND_IMAGE_SUCCESS_TYPE ( Ж ё л т н ы й ф о н , и к о н к а - г а л к а )
*/
# define yon_ubl_status_box_render(render,text,m_type) {render.text_to_render=text; render.type=m_type; pthread_attr_t attr; pthread_attr_init(&attr); pthread_t tid; pthread_create(&tid,&attr,(void*)_yon_ubl_status_box_render,((void*)&render)); }
# ifdef __cplusplus
# ifdef __cplusplus
/**yon_ubl_header_setup(overlay, head, image, imag_path)
* [ EN ]
* Sets up header of app .
* [ overlay ] is overlay for app header ;
* [ head ] is box of header , which connects to [ overlay ]
* [ image ] is header background image ;
* [ imag_path ] is path of image , shown in [ image ]
* [ RU ]
* Н а с т р а и в а е т з а г о л о в о к п р и л о ж е н и я .
* [ overlay ] - о в е р л е й з а г о л о в к а п р и л о ж е н и я ;
* [ head ] - ш а п к а з а г о л о в к а , п р и с о е д и н я е м а я к [ overlay ]
* [ image ] - в и д ж е т к а р т и н к и д л я з а д н е г о ф о н а ;
* [ imag_path ] - п у т ь д о к а р т и н к и , з а г р у ж а е м о й в [ image ]
*/
# define yon_ubl_header_setup(overlay, head, image, imag_path) _yon_ubl_header_setup(GTK_WIDGET(overlay.gobj()), GTK_WIDGET(head.gobj()), GTK_WIDGET(image.gobj()), (char *)imag_path)
# define yon_ubl_header_setup(overlay, head, image, imag_path) _yon_ubl_header_setup(GTK_WIDGET(overlay.gobj()), GTK_WIDGET(head.gobj()), GTK_WIDGET(image.gobj()), (char *)imag_path)
# else
# else
/**yon_ubl_header_setup(overlay, head, image, imag_path)
* [ EN ]
* Sets up header of app .
* [ overlay ] is overlay for app header ;
* [ head ] is box of header , which connects to [ overlay ]
* [ image ] is header background image ;
* [ imag_path ] is path of image , shown in [ image ]
* [ RU ]
* Н а с т р а и в а е т з а г о л о в о к п р и л о ж е н и я .
* [ overlay ] - о в е р л е й з а г о л о в к а п р и л о ж е н и я ;
* [ head ] - ш а п к а з а г о л о в к а , п р и с о е д и н я е м а я к [ overlay ]
* [ image ] - в и д ж е т к а р т и н к и д л я з а д н е г о ф о н а ;
* [ imag_path ] - п у т ь д о к а р т и н к и , з а г р у ж а е м о й в [ image ]
*/
# define yon_ubl_header_setup(overlay, head, image, imag_path) _yon_ubl_header_setup(GTK_WIDGET(overlay), GTK_WIDGET(head), GTK_WIDGET(image), (char *)imag_path)
# define yon_ubl_header_setup(overlay, head, image, imag_path) _yon_ubl_header_setup(GTK_WIDGET(overlay), GTK_WIDGET(head), GTK_WIDGET(image), (char *)imag_path)
# endif
# endif