|
|
|
|
@ -277,6 +277,7 @@ void yon_on_text_insert_only_digits(GtkEditable *editable, const gchar *text, gi
|
|
|
|
|
|
|
|
|
|
void yon_on_insert_restricted_check(GtkEditable *editable, const gchar *text, gint length, gint *position, gpointer){
|
|
|
|
|
gchar *new_text = g_new(gchar, length + 1);
|
|
|
|
|
memset(new_text,0,length+1);
|
|
|
|
|
gint i, j = 0;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < length; i++) {
|
|
|
|
|
@ -303,6 +304,7 @@ void yon_gtk_entry_block_restricted_symbols(GtkEntry *target){
|
|
|
|
|
|
|
|
|
|
void yon_on_insert_languages(GtkEditable *editable, const gchar *text, gint length, gint *position, gpointer){
|
|
|
|
|
gchar *new_text = g_new(gchar, length + 1);
|
|
|
|
|
memset(new_text,0,length+1);
|
|
|
|
|
gint i, j = 0;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < length; i++) {
|
|
|
|
|
@ -329,6 +331,7 @@ void yon_gtk_entry_block_languages(GtkEntry *target){
|
|
|
|
|
|
|
|
|
|
void yon_on_insert_custom_restricted_check(GtkEditable *editable, const gchar *text, gint length, gint *position, char *symbols){
|
|
|
|
|
gchar *new_text = g_new(gchar, length + 1);
|
|
|
|
|
memset(new_text,0,length+1);
|
|
|
|
|
gint i, j = 0;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < length; i++) {
|
|
|
|
|
@ -353,6 +356,30 @@ void yon_gtk_entry_block_symbols(GtkEntry *target, char *symbols){
|
|
|
|
|
g_signal_connect(G_OBJECT(target),"insert-text",G_CALLBACK(yon_on_insert_custom_restricted_check),yon_char_new(symbols));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_on_insert_lowercase_check(GtkEditable *editable, const gchar *text, gint length, gint *position, char *symbols){
|
|
|
|
|
gchar *new_text = g_new(gchar, length + 1);
|
|
|
|
|
memset(new_text,0,length+1);
|
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < length; i++) {
|
|
|
|
|
if (text[i]>=97&&text[i]<=122) {
|
|
|
|
|
new_text[i]=text[i]-32;
|
|
|
|
|
} else {
|
|
|
|
|
new_text[i] = text[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
g_signal_handlers_block_by_func(editable, G_CALLBACK(yon_on_insert_lowercase_check), NULL);
|
|
|
|
|
gtk_editable_insert_text(editable, new_text, strlen(text), position);
|
|
|
|
|
g_signal_handlers_unblock_by_func(editable, G_CALLBACK(yon_on_insert_lowercase_check), NULL);
|
|
|
|
|
g_signal_stop_emission_by_name(editable, "insert-text");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_gtk_entry_block_lowercase(GtkEntry *target){
|
|
|
|
|
g_return_if_fail(GTK_IS_ENTRY(target));
|
|
|
|
|
g_signal_connect(G_OBJECT(target),"insert-text",G_CALLBACK(yon_on_insert_lowercase_check),NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _yon_on_gtk_revealer_set_from_switch(GtkSwitch *target, int status, GtkRevealer *revealer){
|
|
|
|
|
gtk_revealer_set_reveal_child(revealer,status);
|
|
|
|
|
gtk_revealer_set_transition_type(revealer,status?GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN:GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP);
|
|
|
|
|
|