1760 case GTK_POS_BOTTOM: 1761 fp_gtk_style_context_add_class(context, "top"); 1762 break; 1763 default: 1764 break; 1765 } 1766 1767 fp_gtk_render_extension(context, cr, x, y, width, height, gap_side); 1768 1769 fp_gtk_style_context_restore (context); 1770 } 1771 1772 static void gtk3_paint_flat_box(WidgetType widget_type, GtkStateType state_type, 1773 GtkShadowType shadow_type, const gchar *detail, 1774 gint x, gint y, gint width, gint height, gboolean has_focus) 1775 { 1776 if (state_type == GTK_STATE_PRELIGHT && 1777 (widget_type == CHECK_BOX || widget_type == RADIO_BUTTON)) { 1778 return; 1779 } 1780 GtkStyleContext* context = get_style(widget_type, detail); 1781 if (widget_type == TOOL_TIP) { 1782 fp_gtk_style_context_add_class(context, "background"); 1783 } 1784 1785 GtkStateFlags flags = get_gtk_flags(state_type); 1786 1787 if (has_focus) { 1788 flags |= GTK_STATE_FLAG_FOCUSED; 1789 } 1790 1791 fp_gtk_style_context_set_state (context, flags); 1792 1793 if (widget_type == COMBO_BOX_TEXT_FIELD) { 1794 width += height /2; 1795 } 1796 1797 fp_gtk_render_background (context, cr, x, y, width, height); 1798 1799 disposeOrRestoreContext(context); 1800 } 1801 1802 static void gtk3_paint_focus(WidgetType widget_type, GtkStateType state_type, 1803 const char *detail, gint x, gint y, gint width, gint height) 1804 { 1805 gtk3_widget = gtk3_get_widget(widget_type); 1806 1807 GtkStyleContext* context = fp_gtk_widget_get_style_context (gtk3_widget); 1808 fp_gtk_style_context_save (context); 1809 1810 transform_detail_string(detail, context); 1811 fp_gtk_render_focus (context, cr, x, y, width, height); 1812 1813 fp_gtk_style_context_restore (context); 1814 1815 } 1816 1817 static void gtk3_paint_handle(WidgetType widget_type, GtkStateType state_type, 1818 GtkShadowType shadow_type, const gchar *detail, 1819 gint x, gint y, gint width, gint height, GtkOrientation orientation) | 1760 case GTK_POS_BOTTOM: 1761 fp_gtk_style_context_add_class(context, "top"); 1762 break; 1763 default: 1764 break; 1765 } 1766 1767 fp_gtk_render_extension(context, cr, x, y, width, height, gap_side); 1768 1769 fp_gtk_style_context_restore (context); 1770 } 1771 1772 static void gtk3_paint_flat_box(WidgetType widget_type, GtkStateType state_type, 1773 GtkShadowType shadow_type, const gchar *detail, 1774 gint x, gint y, gint width, gint height, gboolean has_focus) 1775 { 1776 if (state_type == GTK_STATE_PRELIGHT && 1777 (widget_type == CHECK_BOX || widget_type == RADIO_BUTTON)) { 1778 return; 1779 } 1780 1781 GtkStyleContext* context = NULL; 1782 if (widget_type == TOOL_TIP) { 1783 context = get_style(widget_type, detail); 1784 fp_gtk_style_context_add_class(context, "background"); 1785 } else { 1786 gtk3_widget = gtk3_get_widget(widget_type); 1787 context = fp_gtk_widget_get_style_context (gtk3_widget); 1788 fp_gtk_style_context_save (context); 1789 if (detail != 0) { 1790 transform_detail_string(detail, context); 1791 } 1792 } 1793 1794 GtkStateFlags flags = get_gtk_flags(state_type); 1795 1796 if (has_focus) { 1797 flags |= GTK_STATE_FLAG_FOCUSED; 1798 } 1799 1800 fp_gtk_style_context_set_state (context, flags); 1801 1802 if (widget_type == COMBO_BOX_TEXT_FIELD) { 1803 width += height /2; 1804 } 1805 1806 fp_gtk_render_background (context, cr, x, y, width, height); 1807 if (widget_type == TOOL_TIP) { 1808 disposeOrRestoreContext(context); 1809 } else { 1810 fp_gtk_style_context_restore (context); 1811 } 1812 } 1813 1814 static void gtk3_paint_focus(WidgetType widget_type, GtkStateType state_type, 1815 const char *detail, gint x, gint y, gint width, gint height) 1816 { 1817 gtk3_widget = gtk3_get_widget(widget_type); 1818 1819 GtkStyleContext* context = fp_gtk_widget_get_style_context (gtk3_widget); 1820 fp_gtk_style_context_save (context); 1821 1822 transform_detail_string(detail, context); 1823 fp_gtk_render_focus (context, cr, x, y, width, height); 1824 1825 fp_gtk_style_context_restore (context); 1826 1827 } 1828 1829 static void gtk3_paint_handle(WidgetType widget_type, GtkStateType state_type, 1830 GtkShadowType shadow_type, const gchar *detail, 1831 gint x, gint y, gint width, gint height, GtkOrientation orientation) |