X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=shell%2Feggfindbar.c;h=f26237217d1eb5c4e8413c2c1a75504af6ae1fc3;hb=924ff63b3a76744b4b0f6c98fc4dd3382f219023;hp=5b196ec1299f56ecad2cf943a530301352c7ee31;hpb=9e1a81fd3638f5a7642a71b78a0403b33501dff2;p=evince.git diff --git a/shell/eggfindbar.c b/shell/eggfindbar.c index 5b196ec1..f2623721 100644 --- a/shell/eggfindbar.c +++ b/shell/eggfindbar.c @@ -1,20 +1,20 @@ /* Copyright (C) 2004 Red Hat, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the Gnome Library; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. -*/ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with the Gnome Library; see the file COPYING.LIB. If not, + * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ #include "config.h" @@ -162,44 +162,29 @@ egg_find_bar_class_init (EggFindBarClass *klass) FALSE, G_PARAM_READWRITE)); - /* Style properties */ - gtk_widget_class_install_style_property (widget_class, - g_param_spec_boxed ("all_matches_color", - "Highlight color", - "Color of highlight for all matches", - GDK_TYPE_COLOR, - G_PARAM_READABLE)); - - gtk_widget_class_install_style_property (widget_class, - g_param_spec_boxed ("current_match_color", - "Current color", - "Color of highlight for the current match", - GDK_TYPE_COLOR, - G_PARAM_READABLE)); - g_type_class_add_private (object_class, sizeof (EggFindBarPrivate)); binding_set = gtk_binding_set_by_class (klass); - gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "close", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Up, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Up, 0, "scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_BACKWARD); - gtk_binding_entry_add_signal (binding_set, GDK_Down, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Down, 0, "scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_FORWARD); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Up, 0, "scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_BACKWARD); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Page_Up, 0, "scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_BACKWARD); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Down, 0, "scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_FORWARD); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, 0, + gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Page_Down, 0, "scroll", 1, GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_FORWARD); } @@ -280,7 +265,7 @@ set_focus_cb (GtkWidget *window, while (widget != NULL && widget != wbar) { - widget = widget->parent; + widget = gtk_widget_get_parent (widget); } /* if widget == bar, the new focus widget is in the bar, so we @@ -659,61 +644,6 @@ egg_find_bar_get_case_sensitive (EggFindBar *find_bar) return priv->case_sensitive; } -static void -get_style_color (EggFindBar *find_bar, - const char *style_prop_name, - GdkColor *color) -{ - GdkColor *style_color; - - gtk_widget_ensure_style (GTK_WIDGET (find_bar)); - gtk_widget_style_get (GTK_WIDGET (find_bar), - "color", &style_color, NULL); - if (style_color) - { - *color = *style_color; - gdk_color_free (style_color); - } -} - -/** - * egg_find_bar_get_all_matches_color: - * - * Gets the color to use to highlight all the - * known matches. - * - * Since: 2.6 - */ -void -egg_find_bar_get_all_matches_color (EggFindBar *find_bar, - GdkColor *color) -{ - GdkColor found_color = { 0, 0, 0, 0x0f0f }; - - get_style_color (find_bar, "all_matches_color", &found_color); - - *color = found_color; -} - -/** - * egg_find_bar_get_current_match_color: - * - * Gets the color to use to highlight the match - * we're currently on. - * - * Since: 2.6 - */ -void -egg_find_bar_get_current_match_color (EggFindBar *find_bar, - GdkColor *color) -{ - GdkColor found_color = { 0, 0, 0, 0xffff }; - - get_style_color (find_bar, "current_match_color", &found_color); - - *color = found_color; -} - /** * egg_find_bar_set_status_text: *