| 830 void ui_linkbutton_value_set_visited(UiString *str, UiBool visited) { |
830 void ui_linkbutton_value_set_visited(UiString *str, UiBool visited) { |
| 831 char *value = create_linkbutton_jsonvalue(NULL, NULL, FALSE, visited, TRUE); |
831 char *value = create_linkbutton_jsonvalue(NULL, NULL, FALSE, visited, TRUE); |
| 832 ui_set(str, value); |
832 ui_set(str, value); |
| 833 free(value); |
833 free(value); |
| 834 } |
834 } |
| |
835 |
| |
836 |
| |
837 void ui_linkbutton_set_label(UIWIDGET button, const char *label) { |
| |
838 gtk_button_set_label(GTK_BUTTON(button), label); |
| |
839 } |
| |
840 |
| |
841 void ui_linkbutton_set_uri(UIWIDGET button, const char *label) { |
| |
842 UiLinkButton *link = g_object_get_data(G_OBJECT(button), "ui_linkbutton"); |
| |
843 if(link) { |
| |
844 linkbutton_set_uri(link, label); |
| |
845 } else { |
| |
846 fprintf(stderr, "Error: ui_linkbutton_set_label: widget is not a linkbutton\n"); |
| |
847 } |
| |
848 } |
| |
849 |
| |
850 void ui_linkbutton_set_visited(UIWIDGET button, UiBool visited) { |
| |
851 UiLinkButton *link = g_object_get_data(G_OBJECT(button), "ui_linkbutton"); |
| |
852 if(link) { |
| |
853 linkbutton_set_visited(link, visited); |
| |
854 } else { |
| |
855 fprintf(stderr, "Error: ui_linkbutton_set_label: widget is not a linkbutton\n"); |
| |
856 } |
| |
857 } |
| |
858 |
| |
859 char* ui_linkbutton_get_label(UIWIDGET button) { |
| |
860 const char *label = gtk_button_get_label(GTK_BUTTON(button)); |
| |
861 return label ? strdup(label) : NULL; |
| |
862 } |
| |
863 |
| |
864 char* ui_linkbutton_get_uri(UIWIDGET button) { |
| |
865 UiLinkButton *link = g_object_get_data(G_OBJECT(button), "ui_linkbutton"); |
| |
866 if(link) { |
| |
867 const char *uri = linkbutton_get_uri(link); |
| |
868 return uri ? strdup(uri) : NULL; |
| |
869 } else { |
| |
870 fprintf(stderr, "Error: ui_linkbutton_set_label: widget is not a linkbutton\n"); |
| |
871 } |
| |
872 return NULL; |
| |
873 } |
| |
874 |
| |
875 UiBool ui_linkbutton_get_visited(UIWIDGET button) { |
| |
876 UiLinkButton *link = g_object_get_data(G_OBJECT(button), "ui_linkbutton"); |
| |
877 if(link) { |
| |
878 return linkbutton_get_visited(link); |
| |
879 } else { |
| |
880 fprintf(stderr, "Error: ui_linkbutton_set_label: widget is not a linkbutton\n"); |
| |
881 } |
| |
882 return FALSE; |
| |
883 } |