From 6a997b1b79dee3009dcb857f9942814d1cb12fd7 Mon Sep 17 00:00:00 2001 From: JosephMcc Date: Fri, 13 Jan 2017 03:49:38 -0800 Subject: [PATCH] xed-searchbar.c/h: Clean up styling a bit --- xed/xed-searchbar.c | 225 +++++++++++++++++++++++--------------------- xed/xed-searchbar.h | 19 +--- 2 files changed, 119 insertions(+), 125 deletions(-) diff --git a/xed/xed-searchbar.c b/xed/xed-searchbar.c index 0fae5de..1dbb842 100755 --- a/xed/xed-searchbar.c +++ b/xed/xed-searchbar.c @@ -21,12 +21,14 @@ /* Signals */ enum { - SHOW_REPLACE, LAST_SIGNAL + SHOW_REPLACE, + LAST_SIGNAL }; struct _XedSearchbarPrivate { gboolean show_replace; + GtkWidget *revealer; GtkWidget *grid; GtkWidget *search_label; @@ -50,7 +52,7 @@ G_DEFINE_TYPE(XedSearchbar, xed_searchbar, GTK_TYPE_BOX) static void xed_searchbar_class_init (XedSearchbarClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS(klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (object_class, sizeof(XedSearchbarPrivate)); } @@ -61,46 +63,51 @@ xed_searchbar_class_init (XedSearchbarClass *klass) /* Use occurrences only for Replace All */ static void text_found (XedWindow *window, - gint occurrences) + gint occurrences) { if (occurrences > 1) { - xed_statusbar_flash_message (XED_STATUSBAR(window->priv->statusbar), window->priv->generic_message_cid, - ngettext ("Found and replaced %d occurrence", "Found and replaced %d occurrences", occurrences), - occurrences); + xed_statusbar_flash_message (XED_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, + ngettext ("Found and replaced %d occurrence", "Found and replaced %d occurrences", + occurrences), + occurrences); } else { if (occurrences == 1) { - xed_statusbar_flash_message (XED_STATUSBAR(window->priv->statusbar), window->priv->generic_message_cid, + xed_statusbar_flash_message (XED_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, _("Found and replaced one occurrence")); } else { - xed_statusbar_flash_message (XED_STATUSBAR(window->priv->statusbar), window->priv->generic_message_cid, + xed_statusbar_flash_message (XED_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, " "); } } } static void -text_not_found (XedWindow *window, +text_not_found (XedWindow *window, const gchar *text) { gchar *searched; searched = xed_utils_str_end_truncate (text, MAX_MSG_LENGTH); - xed_statusbar_flash_message (XED_STATUSBAR(window->priv->statusbar), window->priv->generic_message_cid, + xed_statusbar_flash_message (XED_STATUSBAR (window->priv->statusbar), + window->priv->generic_message_cid, _("\"%s\" not found"), searched); g_free (searched); } static gboolean -run_search (XedView *view, - gboolean wrap_around, - gboolean search_backwards, - gboolean jump_to_next_result) +run_search (XedView *view, + gboolean wrap_around, + gboolean search_backwards, + gboolean jump_to_next_result) { XedDocument *doc; GtkTextIter start_iter; @@ -110,14 +117,16 @@ run_search (XedView *view, gboolean found = FALSE; doc = XED_DOCUMENT(gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))); - gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER(doc), &start_iter, &end_iter); + gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), &start_iter, &end_iter); if (!search_backwards) { - if (jump_to_next_result) { + if (jump_to_next_result) + { found = xed_document_search_forward (doc, &end_iter, NULL, &match_start, &match_end); } - else { + else + { found = xed_document_search_forward (doc, &start_iter, NULL, &match_start, &match_end); } } @@ -142,13 +151,13 @@ run_search (XedView *view, if (found) { - gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER(doc), &match_start); - gtk_text_buffer_move_mark_by_name (GTK_TEXT_BUFFER(doc), "selection_bound", &match_end); + gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), &match_start); + gtk_text_buffer_move_mark_by_name (GTK_TEXT_BUFFER (doc), "selection_bound", &match_end); xed_view_scroll_to_cursor (view); } else { - gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER(doc), &start_iter); + gtk_text_buffer_place_cursor (GTK_TEXT_BUFFER (doc), &start_iter); } return found; @@ -156,8 +165,8 @@ run_search (XedView *view, static void do_find (XedSearchbar *searchbar, - gboolean search_backwards, - gboolean jump_to_next_result) + gboolean search_backwards, + gboolean jump_to_next_result) { XedView *active_view; XedDocument *doc; @@ -178,15 +187,15 @@ do_find (XedSearchbar *searchbar, return; } - doc = XED_DOCUMENT(gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view))); + doc = XED_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view))); match_case = xed_searchbar_get_match_case (searchbar); entire_word = xed_searchbar_get_entire_word (searchbar); wrap_around = xed_searchbar_get_wrap_around (searchbar); entry_text = xed_searchbar_get_search_text (searchbar); - XED_SEARCH_SET_CASE_SENSITIVE(flags, match_case); - XED_SEARCH_SET_ENTIRE_WORD(flags, entire_word); + XED_SEARCH_SET_CASE_SENSITIVE (flags, match_case); + XED_SEARCH_SET_ENTIRE_WORD (flags, entire_word); search_text = xed_document_get_search_text (doc, &old_flags); @@ -211,20 +220,20 @@ do_find (XedSearchbar *searchbar, void xed_searchbar_find_again (XedSearchbar *searchbar, - gboolean backward) + gboolean backward) { XedView *active_view; gboolean wrap_around = TRUE; gpointer data; active_view = xed_window_get_active_view (searchbar->window); - g_return_if_fail(active_view != NULL); + g_return_if_fail (active_view != NULL); - data = g_object_get_data (G_OBJECT(searchbar->window), XED_SEARCHBAR_KEY); + data = g_object_get_data (G_OBJECT (searchbar->window), XED_SEARCHBAR_KEY); if (data != NULL) { - wrap_around = xed_searchbar_get_wrap_around (XED_SEARCHBAR(data)); + wrap_around = xed_searchbar_get_wrap_around (XED_SEARCHBAR (data)); } run_search (active_view, wrap_around, backward, TRUE); @@ -232,7 +241,7 @@ xed_searchbar_find_again (XedSearchbar *searchbar, static void search_buttons_set_sensitive (XedSearchbar *searchbar, - gboolean sensitive) + gboolean sensitive) { gtk_widget_set_sensitive (searchbar->priv->find_button, sensitive); gtk_widget_set_sensitive (searchbar->priv->find_prev_button, sensitive); @@ -242,14 +251,14 @@ search_buttons_set_sensitive (XedSearchbar *searchbar, /* FIXME: move in xed-document.c and share it with xed-view */ static gboolean -get_selected_text (GtkTextBuffer *doc, - gchar **selected_text, - gint *len) +get_selected_text (GtkTextBuffer *doc, + gchar **selected_text, + gint *len) { GtkTextIter start, end; - g_return_val_if_fail(selected_text != NULL, FALSE); - g_return_val_if_fail(*selected_text == NULL, FALSE); + g_return_val_if_fail (selected_text != NULL, FALSE); + g_return_val_if_fail (*selected_text == NULL, FALSE); if (!gtk_text_buffer_get_selection_bounds (doc, &start, &end)) { @@ -272,10 +281,10 @@ get_selected_text (GtkTextBuffer *doc, static void replace_selected_text (GtkTextBuffer *buffer, - const gchar *replace) + const gchar *replace) { - g_return_if_fail(gtk_text_buffer_get_selection_bounds (buffer, NULL, NULL)); - g_return_if_fail(replace != NULL); + g_return_if_fail (gtk_text_buffer_get_selection_bounds (buffer, NULL, NULL)); + g_return_if_fail (replace != NULL); gtk_text_buffer_begin_user_action (buffer); gtk_text_buffer_delete_selection (buffer, FALSE, TRUE); @@ -301,25 +310,25 @@ do_replace (XedSearchbar *searchbar) } search_entry_text = xed_searchbar_get_search_text (searchbar); - g_return_if_fail((search_entry_text) != NULL); - g_return_if_fail((*search_entry_text) != '\0'); + g_return_if_fail ((search_entry_text) != NULL); + g_return_if_fail ((*search_entry_text) != '\0'); /* replace text may be "", we just delete */ replace_entry_text = xed_searchbar_get_replace_text (searchbar); - g_return_if_fail((replace_entry_text) != NULL); + g_return_if_fail ((replace_entry_text) != NULL); unescaped_search_text = xed_utils_unescape_search_text (search_entry_text); - get_selected_text (GTK_TEXT_BUFFER(doc), &selected_text, NULL); + get_selected_text (GTK_TEXT_BUFFER (doc), &selected_text, NULL); match_case = xed_searchbar_get_match_case (searchbar); - if ((selected_text == NULL) - || (match_case && (strcmp (selected_text, unescaped_search_text) != 0)) - || (!match_case && !g_utf8_caselessnmatch (selected_text, - unescaped_search_text, - strlen (selected_text), - strlen (unescaped_search_text)) != 0)) + if ((selected_text == NULL) || + (match_case && (strcmp (selected_text, unescaped_search_text) != 0)) || + (!match_case && !g_utf8_caselessnmatch (selected_text, + unescaped_search_text, + strlen (selected_text), + strlen (unescaped_search_text)) != 0)) { do_find (searchbar, FALSE, TRUE ); g_free (unescaped_search_text); @@ -329,7 +338,7 @@ do_replace (XedSearchbar *searchbar) } unescaped_replace_text = xed_utils_unescape_search_text (replace_entry_text); - replace_selected_text (GTK_TEXT_BUFFER(doc), unescaped_replace_text); + replace_selected_text (GTK_TEXT_BUFFER (doc), unescaped_replace_text); g_free (unescaped_search_text); g_free (selected_text); @@ -356,21 +365,21 @@ do_replace_all (XedSearchbar *searchbar) return; } - doc = XED_DOCUMENT(gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view))); + doc = XED_DOCUMENT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view))); search_entry_text = xed_searchbar_get_search_text (searchbar); - g_return_if_fail((search_entry_text) != NULL); - g_return_if_fail((*search_entry_text) != '\0'); + g_return_if_fail ((search_entry_text) != NULL); + g_return_if_fail ((*search_entry_text) != '\0'); /* replace text may be "", we just delete all occurrences */ replace_entry_text = xed_searchbar_get_replace_text (searchbar); - g_return_if_fail((replace_entry_text) != NULL); + g_return_if_fail ((replace_entry_text) != NULL); match_case = xed_searchbar_get_match_case (searchbar); entire_word = xed_searchbar_get_entire_word (searchbar); - XED_SEARCH_SET_CASE_SENSITIVE(flags, match_case); - XED_SEARCH_SET_ENTIRE_WORD(flags, entire_word); + XED_SEARCH_SET_CASE_SENSITIVE (flags, match_case); + XED_SEARCH_SET_ENTIRE_WORD (flags, entire_word); count = xed_document_replace_all (doc, search_entry_text, replace_entry_text, flags); @@ -388,9 +397,9 @@ do_replace_all (XedSearchbar *searchbar) static void insert_text_handler (GtkEditable *editable, const gchar *text, - gint length, - gint *position, - gpointer data) + gint length, + gint *position, + gpointer data) { static gboolean insert_text = FALSE; gchar *escaped_text; @@ -473,7 +482,7 @@ remember_replace_entry (XedSearchbar *searchbar) } static void -find_button_clicked_callback (GtkWidget *button, +find_button_clicked_callback (GtkWidget *button, XedSearchbar *searchbar) { remember_search_entry (searchbar); @@ -481,15 +490,15 @@ find_button_clicked_callback (GtkWidget *button, } static void -toggle_button_clicked_callback (GtkWidget *button, - XedSearchbar *searchbar) +toggle_button_clicked_callback (GtkWidget *button, + XedSearchbar *searchbar) { remember_search_entry (searchbar); do_find (searchbar, FALSE, FALSE); } static void -find_prev_button_clicked_callback (GtkWidget *button, +find_prev_button_clicked_callback (GtkWidget *button, XedSearchbar *searchbar) { remember_search_entry (searchbar); @@ -497,7 +506,7 @@ find_prev_button_clicked_callback (GtkWidget *button, } static void -replace_button_clicked_callback (GtkWidget *button, +replace_button_clicked_callback (GtkWidget *button, XedSearchbar *searchbar) { remember_search_entry (searchbar); @@ -506,7 +515,7 @@ replace_button_clicked_callback (GtkWidget *button, } static void -replace_all_button_clicked_callback (GtkWidget *button, +replace_all_button_clicked_callback (GtkWidget *button, XedSearchbar *searchbar) { remember_search_entry (searchbar); @@ -515,7 +524,7 @@ replace_all_button_clicked_callback (GtkWidget *button, } static void -on_search_text_entry_activated (GtkEntry *widget, +on_search_text_entry_activated (GtkEntry *widget, XedSearchbar *searchbar) { remember_search_entry (searchbar); @@ -523,7 +532,7 @@ on_search_text_entry_activated (GtkEntry *widget, } static void -close_button_clicked_callback (GtkWidget *button, +close_button_clicked_callback (GtkWidget *button, XedSearchbar *searchbar) { xed_searchbar_hide (searchbar); @@ -577,7 +586,7 @@ xed_searchbar_init (XedSearchbar *searchbar) gtk_grid_attach (GTK_GRID (searchbar->priv->grid), searchbar->priv->search_entry, 2, 0, 1, 1); searchbar->priv->replace_entry = xed_history_entry_new ("history-replace-with", TRUE); - xed_history_entry_set_escape_func (XED_HISTORY_ENTRY(searchbar->priv->replace_entry), + xed_history_entry_set_escape_func (XED_HISTORY_ENTRY (searchbar->priv->replace_entry), (XedHistoryEntryEscapeFunc) xed_utils_escape_search_text); searchbar->priv->replace_text_entry = xed_history_entry_get_entry ( @@ -648,17 +657,17 @@ xed_searchbar_init (XedSearchbar *searchbar) GtkWidget * xed_searchbar_new (GtkWindow *parent, - gboolean show_replace) + gboolean show_replace) { XedSearchbar *searchbar; searchbar = g_object_new (XED_TYPE_SEARCHBAR, NULL); searchbar->window = XED_WINDOW (parent); - return GTK_WIDGET(searchbar); + return GTK_WIDGET (searchbar); } void xed_searchbar_show (XedSearchbar *searchbar, - gboolean show_replace) + gboolean show_replace) { XedDocument *doc; gboolean selection_exists; @@ -667,9 +676,9 @@ xed_searchbar_show (XedSearchbar *searchbar, gint sel_len; doc = xed_window_get_active_document (searchbar->window); - g_return_if_fail(doc != NULL); + g_return_if_fail (doc != NULL); - selection_exists = get_selected_text (GTK_TEXT_BUFFER(doc), &find_text, &sel_len); + selection_exists = get_selected_text (GTK_TEXT_BUFFER (doc), &find_text, &sel_len); if (selection_exists && find_text != NULL && sel_len < 80) { @@ -680,11 +689,11 @@ xed_searchbar_show (XedSearchbar *searchbar, * search for '\n' and then open the search searchbar again, * you'll get an unprintable single-character literal '\n' in the "search for" box). */ - search_text = xed_searchbar_get_search_text (XED_SEARCHBAR(searchbar)); + search_text = xed_searchbar_get_search_text (XED_SEARCHBAR (searchbar)); if (!(search_text != NULL && !strcmp (xed_utils_unescape_search_text (search_text), find_text))) { /* General case */ - xed_searchbar_set_search_text (XED_SEARCHBAR(searchbar), find_text); + xed_searchbar_set_search_text (XED_SEARCHBAR (searchbar), find_text); } g_free (find_text); } @@ -692,15 +701,15 @@ xed_searchbar_show (XedSearchbar *searchbar, { g_free (find_text); } - gtk_revealer_set_transition_type (GTK_REVEALER(searchbar->priv->revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP); - gtk_revealer_set_reveal_child (GTK_REVEALER(searchbar->priv->revealer), TRUE); + gtk_revealer_set_transition_type (GTK_REVEALER (searchbar->priv->revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP); + gtk_revealer_set_reveal_child (GTK_REVEALER (searchbar->priv->revealer), TRUE); if (show_replace) { gtk_widget_show (searchbar->priv->replace_label); gtk_widget_show (searchbar->priv->replace_entry); gtk_widget_show (searchbar->priv->replace_all_button); gtk_widget_show (searchbar->priv->replace_button); - gtk_grid_set_row_spacing (GTK_GRID(searchbar->priv->grid), 10); + gtk_grid_set_row_spacing (GTK_GRID (searchbar->priv->grid), 10); } else { @@ -708,7 +717,7 @@ xed_searchbar_show (XedSearchbar *searchbar, gtk_widget_hide (searchbar->priv->replace_entry); gtk_widget_hide (searchbar->priv->replace_all_button); gtk_widget_hide (searchbar->priv->replace_button); - gtk_grid_set_row_spacing (GTK_GRID(searchbar->priv->grid), 0); + gtk_grid_set_row_spacing (GTK_GRID (searchbar->priv->grid), 0); } gtk_widget_show (searchbar->priv->find_button); @@ -718,14 +727,14 @@ xed_searchbar_show (XedSearchbar *searchbar, void xed_searchbar_hide (XedSearchbar *searchbar) { - gtk_revealer_set_transition_type (GTK_REVEALER(searchbar->priv->revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN); - gtk_revealer_set_reveal_child (GTK_REVEALER(searchbar->priv->revealer), FALSE); + gtk_revealer_set_transition_type (GTK_REVEALER (searchbar->priv->revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN); + gtk_revealer_set_reveal_child (GTK_REVEALER (searchbar->priv->revealer), FALSE); // focus document XedView *active_view = xed_window_get_active_view (searchbar->window); if (active_view != NULL) { - gtk_widget_grab_focus (GTK_WIDGET(active_view)); + gtk_widget_grab_focus (GTK_WIDGET (active_view)); } // remove highlighting @@ -734,11 +743,11 @@ xed_searchbar_hide (XedSearchbar *searchbar) void xed_searchbar_set_search_text (XedSearchbar *searchbar, - const gchar *text) + const gchar *text) { - g_return_if_fail(XED_IS_SEARCHBAR (searchbar)); - g_return_if_fail(text != NULL); - gtk_entry_set_text (GTK_ENTRY(searchbar->priv->search_text_entry), text); + g_return_if_fail (XED_IS_SEARCHBAR (searchbar)); + g_return_if_fail (text != NULL); + gtk_entry_set_text (GTK_ENTRY (searchbar->priv->search_text_entry), text); search_buttons_set_sensitive (searchbar, (text != '\0')); } @@ -748,68 +757,68 @@ xed_searchbar_set_search_text (XedSearchbar *searchbar, const gchar * xed_searchbar_get_search_text (XedSearchbar *searchbar) { - g_return_val_if_fail(XED_IS_SEARCHBAR (searchbar), NULL); - return gtk_entry_get_text (GTK_ENTRY(searchbar->priv->search_text_entry)); + g_return_val_if_fail (XED_IS_SEARCHBAR (searchbar), NULL); + return gtk_entry_get_text (GTK_ENTRY (searchbar->priv->search_text_entry)); } void xed_searchbar_set_replace_text (XedSearchbar *searchbar, - const gchar *text) + const gchar *text) { - g_return_if_fail(XED_IS_SEARCHBAR (searchbar)); - g_return_if_fail(text != NULL); + g_return_if_fail (XED_IS_SEARCHBAR (searchbar)); + g_return_if_fail (text != NULL); - gtk_entry_set_text (GTK_ENTRY(searchbar->priv->replace_text_entry), text); + gtk_entry_set_text (GTK_ENTRY (searchbar->priv->replace_text_entry), text); } const gchar * xed_searchbar_get_replace_text (XedSearchbar *searchbar) { - g_return_val_if_fail(XED_IS_SEARCHBAR (searchbar), NULL); - return gtk_entry_get_text (GTK_ENTRY(searchbar->priv->replace_text_entry)); + g_return_val_if_fail (XED_IS_SEARCHBAR (searchbar), NULL); + return gtk_entry_get_text (GTK_ENTRY (searchbar->priv->replace_text_entry)); } void xed_searchbar_set_match_case (XedSearchbar *searchbar, - gboolean match_case) + gboolean match_case) { - g_return_if_fail(XED_IS_SEARCHBAR (searchbar)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(searchbar->priv->match_case_checkbutton), match_case); + g_return_if_fail (XED_IS_SEARCHBAR (searchbar)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (searchbar->priv->match_case_checkbutton), match_case); } gboolean xed_searchbar_get_match_case (XedSearchbar *searchbar) { - g_return_val_if_fail(XED_IS_SEARCHBAR (searchbar), FALSE); - return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(searchbar->priv->match_case_checkbutton)); + g_return_val_if_fail (XED_IS_SEARCHBAR (searchbar), FALSE); + return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (searchbar->priv->match_case_checkbutton)); } void xed_searchbar_set_entire_word (XedSearchbar *searchbar, - gboolean entire_word) + gboolean entire_word) { - g_return_if_fail(XED_IS_SEARCHBAR (searchbar)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(searchbar->priv->entire_word_checkbutton), entire_word); + g_return_if_fail (XED_IS_SEARCHBAR (searchbar)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (searchbar->priv->entire_word_checkbutton), entire_word); } gboolean xed_searchbar_get_entire_word (XedSearchbar *searchbar) { - g_return_val_if_fail(XED_IS_SEARCHBAR (searchbar), FALSE); - return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(searchbar->priv->entire_word_checkbutton)); + g_return_val_if_fail (XED_IS_SEARCHBAR (searchbar), FALSE); + return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (searchbar->priv->entire_word_checkbutton)); } void xed_searchbar_set_wrap_around (XedSearchbar *searchbar, - gboolean wrap_around) + gboolean wrap_around) { - g_return_if_fail(XED_IS_SEARCHBAR (searchbar)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(searchbar->priv->wrap_around_checkbutton), wrap_around); + g_return_if_fail (XED_IS_SEARCHBAR (searchbar)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (searchbar->priv->wrap_around_checkbutton), wrap_around); } gboolean xed_searchbar_get_wrap_around (XedSearchbar *searchbar) { - g_return_val_if_fail(XED_IS_SEARCHBAR (searchbar), FALSE); - return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(searchbar->priv->wrap_around_checkbutton)); + g_return_val_if_fail (XED_IS_SEARCHBAR (searchbar), FALSE); + return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (searchbar->priv->wrap_around_checkbutton)); } diff --git a/xed/xed-searchbar.h b/xed/xed-searchbar.h index d3b1af5..13b125d 100755 --- a/xed/xed-searchbar.h +++ b/xed/xed-searchbar.h @@ -7,9 +7,6 @@ G_BEGIN_DECLS -/* - * Type checking and casting macros - */ #define XED_TYPE_SEARCHBAR (xed_searchbar_get_type()) #define XED_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XED_TYPE_SEARCHBAR, XedSearchbar)) #define XED_SEARCHBAR_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), XED_TYPE_SEARCHBAR, XedSearchbar const)) @@ -18,13 +15,9 @@ G_BEGIN_DECLS #define XED_IS_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_SEARCHBAR)) #define XED_SEARCHBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), XED_TYPE_SEARCHBAR, XedSearchbarClass)) -/* Private structure type */ +typedef struct _XedSearchbar XedSearchbar; typedef struct _XedSearchbarPrivate XedSearchbarPrivate; - -/* - * Main object structure - */ -typedef struct _XedSearchbar XedSearchbar; +typedef struct _XedSearchbarClass XedSearchbarClass; struct _XedSearchbar { @@ -35,11 +28,6 @@ struct _XedSearchbar XedSearchbarPrivate *priv; }; -/* - * Class definition - */ -typedef struct _XedSearchbarClass XedSearchbarClass; - struct _XedSearchbarClass { GtkBoxClass parent_class; @@ -55,9 +43,6 @@ enum XED_SEARCHBAR_REPLACE_ALL_RESPONSE }; -/* - * Public methods - */ GType xed_searchbar_get_type (void) G_GNUC_CONST; GtkWidget *xed_searchbar_new (GtkWindow *parent, gboolean show_replace);