📄 pixbuf-draw.c
字号:
match_data.function = TOKEN_D_OPTION; match_data.detail = (gchar *)detail; match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE; match_data.shadow = shadow; match_data.state = state; if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE, x, y, width, height)) parent_class->draw_option (style, window, state, shadow, area, widget, detail, x, y, width, height);}static voiddraw_tab (GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height){ ThemeMatchData match_data; g_return_if_fail(style != NULL); g_return_if_fail(window != NULL); match_data.function = TOKEN_D_TAB; match_data.detail = (gchar *)detail; match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE; match_data.shadow = shadow; match_data.state = state; if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE, x, y, width, height)) parent_class->draw_tab (style, window, state, shadow, area, widget, detail, x, y, width, height);}static voiddraw_shadow_gap (GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gap_side, gint gap_x, gint gap_width){ ThemeMatchData match_data; match_data.function = TOKEN_D_SHADOW_GAP; match_data.detail = (gchar *)detail; match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE; match_data.flags = (THEME_MATCH_SHADOW | THEME_MATCH_STATE | THEME_MATCH_ORIENTATION); match_data.shadow = shadow; match_data.state = state; if (!draw_gap_image (style, window, area, widget, &match_data, FALSE, x, y, width, height, gap_side, gap_x, gap_width)) parent_class->draw_shadow_gap (style, window, state, shadow, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width);}static voiddraw_box_gap (GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gap_side, gint gap_x, gint gap_width){ ThemeMatchData match_data; match_data.function = TOKEN_D_BOX_GAP; match_data.detail = (gchar *)detail; match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE; match_data.flags = (THEME_MATCH_SHADOW | THEME_MATCH_STATE | THEME_MATCH_ORIENTATION); match_data.shadow = shadow; match_data.state = state; if (!draw_gap_image (style, window, area, widget, &match_data, TRUE, x, y, width, height, gap_side, gap_x, gap_width)) parent_class->draw_box_gap (style, window, state, shadow, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width);}static voiddraw_extension (GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkPositionType gap_side){ ThemeMatchData match_data; g_return_if_fail (style != NULL); g_return_if_fail (window != NULL); match_data.function = TOKEN_D_EXTENSION; match_data.detail = (gchar *)detail; match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE | THEME_MATCH_GAP_SIDE; match_data.shadow = shadow; match_data.state = state; match_data.gap_side = gap_side; if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE, x, y, width, height)) parent_class->draw_extension (style, window, state, shadow, area, widget, detail, x, y, width, height, gap_side);}static voiddraw_focus (GtkStyle *style, GdkWindow *window, GtkStateType state_type, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height){ ThemeMatchData match_data; g_return_if_fail (style != NULL); g_return_if_fail (window != NULL); match_data.function = TOKEN_D_FOCUS; match_data.detail = (gchar *)detail; match_data.flags = 0; if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, FALSE, x, y, width, height)) parent_class->draw_focus (style, window, state_type, area, widget, detail, x, y, width, height);}static voiddraw_slider (GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkOrientation orientation){ ThemeMatchData match_data; g_return_if_fail(style != NULL); g_return_if_fail(window != NULL); match_data.function = TOKEN_D_SLIDER; match_data.detail = (gchar *)detail; match_data.flags = (THEME_MATCH_SHADOW | THEME_MATCH_STATE | THEME_MATCH_ORIENTATION); match_data.shadow = shadow; match_data.state = state; match_data.orientation = orientation; if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE, x, y, width, height)) parent_class->draw_slider (style, window, state, shadow, area, widget, detail, x, y, width, height, orientation);}static voiddraw_handle (GtkStyle *style, GdkWindow *window, GtkStateType state, GtkShadowType shadow, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, gint width, gint height, GtkOrientation orientation){ ThemeMatchData match_data; g_return_if_fail (style != NULL); g_return_if_fail (window != NULL); match_data.function = TOKEN_D_HANDLE; match_data.detail = (gchar *)detail; match_data.flags = (THEME_MATCH_SHADOW | THEME_MATCH_STATE | THEME_MATCH_ORIENTATION); match_data.shadow = shadow; match_data.state = state; match_data.orientation = orientation; if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE, x, y, width, height)) parent_class->draw_handle (style, window, state, shadow, area, widget, detail, x, y, width, height, orientation);}static voiddraw_expander (GtkStyle *style, GdkWindow *window, GtkStateType state, GdkRectangle *area, GtkWidget *widget, const gchar *detail, gint x, gint y, GtkExpanderStyle expander_style){#define DEFAULT_EXPANDER_SIZE 12 ThemeMatchData match_data; gint expander_size; gint radius; g_return_if_fail (style != NULL); g_return_if_fail (window != NULL); if (widget && gtk_widget_class_find_style_property (GTK_WIDGET_GET_CLASS (widget), "expander-size")) { gtk_widget_style_get (widget, "expander-size", &expander_size, NULL); } else expander_size = DEFAULT_EXPANDER_SIZE; radius = expander_size/2; match_data.function = TOKEN_D_EXPANDER; match_data.detail = (gchar *)detail; match_data.flags = (THEME_MATCH_STATE | THEME_MATCH_EXPANDER_STYLE); match_data.state = state; match_data.expander_style = expander_style; if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE, x - radius, y - radius, expander_size, expander_size)) parent_class->draw_expander (style, window, state, area, widget, detail, x, y, expander_style);}static voiddraw_resize_grip (GtkStyle *style, GdkWindow *window, GtkStateType state, GdkRectangle *area, GtkWidget *widget, const gchar *detail, GdkWindowEdge edge, gint x, gint y, gint width, gint height){ ThemeMatchData match_data; g_return_if_fail (style != NULL); g_return_if_fail (window != NULL); match_data.function = TOKEN_D_RESIZE_GRIP; match_data.detail = (gchar *)detail; match_data.flags = (THEME_MATCH_STATE | THEME_MATCH_WINDOW_EDGE); match_data.state = state; match_data.window_edge = edge; if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE, x, y, width, height)) parent_class->draw_resize_grip (style, window, state, area, widget, detail, edge, x, y, width, height);}GType pixbuf_type_style = 0;void pixbuf_style_register_type (GTypeModule *module) { static const GTypeInfo object_info = { sizeof (PixbufStyleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pixbuf_style_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof (PixbufStyle), 0, /* n_preallocs */ (GInstanceInitFunc) pixbuf_style_init, }; pixbuf_type_style = g_type_module_register_type (module, GTK_TYPE_STYLE, "PixbufStyle", &object_info, 0);}static voidpixbuf_style_init (PixbufStyle *style){}static voidpixbuf_style_class_init (PixbufStyleClass *klass){ GtkStyleClass *style_class = GTK_STYLE_CLASS (klass); parent_class = g_type_class_peek_parent (klass); style_class->draw_hline = draw_hline; style_class->draw_vline = draw_vline; style_class->draw_shadow = draw_shadow; style_class->draw_arrow = draw_arrow; style_class->draw_diamond = draw_diamond; style_class->draw_string = draw_string; style_class->draw_box = draw_box; style_class->draw_flat_box = draw_flat_box; style_class->draw_check = draw_check; style_class->draw_option = draw_option; style_class->draw_tab = draw_tab; style_class->draw_shadow_gap = draw_shadow_gap; style_class->draw_box_gap = draw_box_gap; style_class->draw_extension = draw_extension; style_class->draw_focus = draw_focus; style_class->draw_slider = draw_slider; style_class->draw_handle = draw_handle; style_class->draw_expander = draw_expander; style_class->draw_resize_grip = draw_resize_grip;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -