comparison src/cellrenderericon.c @ 1810:c416d099a3dc

GTK marks several functions as deprecated The following functions has been replaced and deprecated by version 2.20: - GTK_WIDGET_CAN_FOCUS - GTK_WIDGET_DRAWABLE - GTK_WIDGET_HAS_FOCUS - GTK_WIDGET_HAS_GRAB - GTK_WIDGET_IS_SENSITIVE - GTK_WIDGET_NO_WINDOW - GTK_WIDGET_REALIZED - GTK_WIDGET_SENSITIVE - GTK_WIDGET_STATE - GTK_WIDGET_TOPLEVEL - GTK_WIDGET_VISIBLE
author mow
date Mon, 10 May 2010 11:32:56 +0000
parents a025fa56fa26
children
comparison
equal deleted inserted replaced
1809:e1c18f81e637 1810:c416d099a3dc
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA. 19 * Boston, MA 02111-1307, USA.
20 */ 20 */
21 21
22 #include <stdlib.h> 22 #include <stdlib.h>
23 #include <gtk/gtk.h> /* To define GTK_CHECK_VERSION */
23 #include "cellrenderericon.h" 24 #include "cellrenderericon.h"
24 #include "intl.h" 25 #include "intl.h"
25 26
26 27
27 #define FIXED_ICON_SIZE_MAX 512 28 #define FIXED_ICON_SIZE_MAX 512
644 cell_rect.width -= cell->xpad * 2; 645 cell_rect.width -= cell->xpad * 2;
645 cell_rect.height -= cell->ypad * 2; 646 cell_rect.height -= cell->ypad * 2;
646 647
647 if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED) 648 if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED)
648 { 649 {
650 #if GTK_CHECK_VERSION(2,20,0)
651 if (gtk_widget_has_focus(widget))
652 #else
649 if (GTK_WIDGET_HAS_FOCUS(widget)) 653 if (GTK_WIDGET_HAS_FOCUS(widget))
654 #endif
650 state = GTK_STATE_SELECTED; 655 state = GTK_STATE_SELECTED;
651 else 656 else
652 state = GTK_STATE_ACTIVE; 657 state = GTK_STATE_ACTIVE;
653 } 658 }
654 else 659 else
655 { 660 {
661 #if GTK_CHECK_VERSION(2,20,0)
662 if (gtk_widget_get_state(widget) == GTK_STATE_INSENSITIVE)
663 #else
656 if (GTK_WIDGET_STATE(widget) == GTK_STATE_INSENSITIVE) 664 if (GTK_WIDGET_STATE(widget) == GTK_STATE_INSENSITIVE)
665 #endif
657 state = GTK_STATE_INSENSITIVE; 666 state = GTK_STATE_INSENSITIVE;
658 else 667 else
659 state = GTK_STATE_NORMAL; 668 state = GTK_STATE_NORMAL;
660 } 669 }
661 670
754 TOGGLE_WIDTH, TOGGLE_WIDTH); 763 TOGGLE_WIDTH, TOGGLE_WIDTH);
755 } 764 }
756 } 765 }
757 } 766 }
758 767
768 #if GTK_CHECK_VERSION(2,20,0)
769 if (cellicon->focused && gtk_widget_has_focus(widget))
770 #else
759 if (cellicon->focused && GTK_WIDGET_HAS_FOCUS(widget)) 771 if (cellicon->focused && GTK_WIDGET_HAS_FOCUS(widget))
772 #endif
760 { 773 {
761 gtk_paint_focus(widget->style, window, 774 gtk_paint_focus(widget->style, window,
762 state, 775 state,
763 cell_area, widget, 776 cell_area, widget,
764 "cellrendererfocus", 777 "cellrendererfocus",