modules/engines/ms-windows/xp_theme.[ch] Add support for drawing
2007-06-26 Cody Russell <bratsche@gnome.org> * modules/engines/ms-windows/xp_theme.[ch] * modules/engines/ms-windows/msw_style.c: Add support for drawing checkboxes with inconsistent states. (Tor, #164809) svn path=/trunk/; revision=18246
This commit is contained in:

committed by
Cody Russell

parent
927c852aa9
commit
0aa5be0dec
@ -1,3 +1,9 @@
|
|||||||
|
2007-06-26 Cody Russell <bratsche@gnome.org>
|
||||||
|
|
||||||
|
* modules/engines/ms-windows/xp_theme.[ch]
|
||||||
|
* modules/engines/ms-windows/msw_style.c: Add support for
|
||||||
|
drawing checkboxes with inconsistent states. (Tor, #164809)
|
||||||
|
|
||||||
2007-06-26 Johan Dahlin <jdahlin@async.com.br>
|
2007-06-26 Johan Dahlin <jdahlin@async.com.br>
|
||||||
|
|
||||||
* gtk/gtk-builder-convert (GtkBuilderConverter.to_xml): Encode
|
* gtk/gtk-builder-convert (GtkBuilderConverter.to_xml): Encode
|
||||||
|
@ -68,6 +68,7 @@ typedef enum
|
|||||||
CHECK_LIGHT,
|
CHECK_LIGHT,
|
||||||
CHECK_MID,
|
CHECK_MID,
|
||||||
CHECK_TEXT,
|
CHECK_TEXT,
|
||||||
|
CHECK_INCONSISTENT,
|
||||||
RADIO_BASE,
|
RADIO_BASE,
|
||||||
RADIO_BLACK,
|
RADIO_BLACK,
|
||||||
RADIO_DARK,
|
RADIO_DARK,
|
||||||
@ -113,6 +114,10 @@ static const guint8 check_text_bits[] = {
|
|||||||
0xd8, 0x01, 0xf8,
|
0xd8, 0x01, 0xf8,
|
||||||
0x00, 0x70, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
0x00, 0x70, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||||
};
|
};
|
||||||
|
static const char check_inconsistent_bits[] = {
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x03, 0xf0,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||||
|
};
|
||||||
static const guint8 radio_base_bits[] = {
|
static const guint8 radio_base_bits[] = {
|
||||||
0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0xf8, 0x03, 0xfc, 0x07, 0xfc, 0x07,
|
0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0xf8, 0x03, 0xfc, 0x07, 0xfc, 0x07,
|
||||||
0xfc, 0x07, 0xfc,
|
0xfc, 0x07, 0xfc,
|
||||||
@ -157,6 +162,7 @@ static struct
|
|||||||
{check_light_bits, NULL},
|
{check_light_bits, NULL},
|
||||||
{check_mid_bits, NULL},
|
{check_mid_bits, NULL},
|
||||||
{check_text_bits, NULL},
|
{check_text_bits, NULL},
|
||||||
|
{check_inconsistent_bits, NULL},
|
||||||
{radio_base_bits, NULL},
|
{radio_base_bits, NULL},
|
||||||
{radio_black_bits, NULL},
|
{radio_black_bits, NULL},
|
||||||
{radio_dark_bits, NULL},
|
{radio_dark_bits, NULL},
|
||||||
@ -1118,10 +1124,23 @@ draw_check (GtkStyle * style,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!xp_theme_draw (window, shadow == GTK_SHADOW_IN
|
XpThemeElement theme_elt = XP_THEME_ELEMENT_CHECKBOX;
|
||||||
? XP_THEME_ELEMENT_PRESSED_CHECKBOX
|
switch (shadow)
|
||||||
: XP_THEME_ELEMENT_CHECKBOX,
|
{
|
||||||
style, x, y, width, height, state, area))
|
case GTK_SHADOW_ETCHED_IN:
|
||||||
|
theme_elt = XP_THEME_ELEMENT_INCONSISTENT_CHECKBOX;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GTK_SHADOW_IN:
|
||||||
|
theme_elt = XP_THEME_ELEMENT_PRESSED_CHECKBOX;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!xp_theme_draw (window, theme_elt,
|
||||||
|
style, x, y, width, height, state, area))
|
||||||
{
|
{
|
||||||
if( detail && !strcmp(detail, "cellcheck") )
|
if( detail && !strcmp(detail, "cellcheck") )
|
||||||
state = GTK_STATE_NORMAL;
|
state = GTK_STATE_NORMAL;
|
||||||
@ -1144,6 +1163,11 @@ draw_check (GtkStyle * style,
|
|||||||
draw_part (window, style->text_aa_gc[state], area,
|
draw_part (window, style->text_aa_gc[state], area,
|
||||||
x, y, CHECK_AA);
|
x, y, CHECK_AA);
|
||||||
}
|
}
|
||||||
|
else if (shadow == GTK_SHADOW_ETCHED_IN)
|
||||||
|
{
|
||||||
|
draw_part (window, style->text_gc[state], area, x, y, CHECK_INCONSISTENT);
|
||||||
|
draw_part (window, style->text_aa_gc[state], area, x, y, CHECK_AA);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,6 +97,7 @@ static const LPCWSTR class_descriptors[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const short element_part_map[XP_THEME_ELEMENT__SIZEOF] = {
|
static const short element_part_map[XP_THEME_ELEMENT__SIZEOF] = {
|
||||||
|
BP_CHECKBOX,
|
||||||
BP_CHECKBOX,
|
BP_CHECKBOX,
|
||||||
BP_CHECKBOX,
|
BP_CHECKBOX,
|
||||||
BP_PUSHBUTTON,
|
BP_PUSHBUTTON,
|
||||||
@ -358,6 +359,7 @@ xp_theme_get_handle_by_element (XpThemeElement element)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case XP_THEME_ELEMENT_PRESSED_CHECKBOX:
|
case XP_THEME_ELEMENT_PRESSED_CHECKBOX:
|
||||||
|
case XP_THEME_ELEMENT_INCONSISTENT_CHECKBOX:
|
||||||
case XP_THEME_ELEMENT_CHECKBOX:
|
case XP_THEME_ELEMENT_CHECKBOX:
|
||||||
case XP_THEME_ELEMENT_BUTTON:
|
case XP_THEME_ELEMENT_BUTTON:
|
||||||
case XP_THEME_ELEMENT_DEFAULT_BUTTON:
|
case XP_THEME_ELEMENT_DEFAULT_BUTTON:
|
||||||
@ -644,6 +646,23 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case XP_THEME_ELEMENT_INCONSISTENT_CHECKBOX:
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case GTK_STATE_SELECTED:
|
||||||
|
ret = CBS_MIXEDPRESSED;
|
||||||
|
break;
|
||||||
|
case GTK_STATE_PRELIGHT:
|
||||||
|
ret = CBS_MIXEDHOT;
|
||||||
|
break;
|
||||||
|
case GTK_STATE_INSENSITIVE:
|
||||||
|
ret = CBS_MIXEDDISABLED;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ret = CBS_MIXEDNORMAL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case XP_THEME_ELEMENT_PRESSED_CHECKBOX:
|
case XP_THEME_ELEMENT_PRESSED_CHECKBOX:
|
||||||
case XP_THEME_ELEMENT_PRESSED_RADIO_BUTTON:
|
case XP_THEME_ELEMENT_PRESSED_RADIO_BUTTON:
|
||||||
switch (state)
|
switch (state)
|
||||||
|
@ -1,129 +1,130 @@
|
|||||||
/* MS-Windows Engine (aka GTK-Wimp)
|
/* MS-Windows Engine (aka GTK-Wimp)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003, 2004 Raymond Penners <raymond@dotsphinx.com>
|
* Copyright (C) 2003, 2004 Raymond Penners <raymond@dotsphinx.com>
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Library General Public
|
* modify it under the terms of the GNU Library General Public
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 2 of the License, or (at your option) any later version.
|
* version 2 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Library General Public License for more details.
|
* Library General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Library General Public
|
* You should have received a copy of the GNU Library General Public
|
||||||
* License along with this library; if not, write to the
|
* License along with this library; if not, write to the
|
||||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef XP_THEME_H
|
#ifndef XP_THEME_H
|
||||||
#define XP_THEME_H
|
#define XP_THEME_H
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include "gtk/gtk.h"
|
#include "gtk/gtk.h"
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
XP_THEME_CLASS_SCROLLBAR = 0,
|
XP_THEME_CLASS_SCROLLBAR = 0,
|
||||||
XP_THEME_CLASS_BUTTON,
|
XP_THEME_CLASS_BUTTON,
|
||||||
XP_THEME_CLASS_HEADER,
|
XP_THEME_CLASS_HEADER,
|
||||||
XP_THEME_CLASS_COMBOBOX,
|
XP_THEME_CLASS_COMBOBOX,
|
||||||
XP_THEME_CLASS_TAB,
|
XP_THEME_CLASS_TAB,
|
||||||
XP_THEME_CLASS_EDIT,
|
XP_THEME_CLASS_EDIT,
|
||||||
XP_THEME_CLASS_TREEVIEW,
|
XP_THEME_CLASS_TREEVIEW,
|
||||||
XP_THEME_CLASS_SPIN,
|
XP_THEME_CLASS_SPIN,
|
||||||
XP_THEME_CLASS_PROGRESS,
|
XP_THEME_CLASS_PROGRESS,
|
||||||
XP_THEME_CLASS_TOOLTIP,
|
XP_THEME_CLASS_TOOLTIP,
|
||||||
XP_THEME_CLASS_REBAR,
|
XP_THEME_CLASS_REBAR,
|
||||||
XP_THEME_CLASS_TOOLBAR,
|
XP_THEME_CLASS_TOOLBAR,
|
||||||
XP_THEME_CLASS_GLOBALS,
|
XP_THEME_CLASS_GLOBALS,
|
||||||
XP_THEME_CLASS_MENU,
|
XP_THEME_CLASS_MENU,
|
||||||
XP_THEME_CLASS_WINDOW,
|
XP_THEME_CLASS_WINDOW,
|
||||||
XP_THEME_CLASS_STATUS,
|
XP_THEME_CLASS_STATUS,
|
||||||
XP_THEME_CLASS_TRACKBAR,
|
XP_THEME_CLASS_TRACKBAR,
|
||||||
XP_THEME_CLASS__SIZEOF
|
XP_THEME_CLASS__SIZEOF
|
||||||
} XpThemeClass;
|
} XpThemeClass;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
XP_THEME_ELEMENT_PRESSED_CHECKBOX = 0,
|
XP_THEME_ELEMENT_PRESSED_CHECKBOX = 0,
|
||||||
XP_THEME_ELEMENT_CHECKBOX,
|
XP_THEME_ELEMENT_CHECKBOX,
|
||||||
XP_THEME_ELEMENT_BUTTON,
|
XP_THEME_ELEMENT_INCONSISTENT_CHECKBOX,
|
||||||
XP_THEME_ELEMENT_LIST_HEADER,
|
XP_THEME_ELEMENT_BUTTON,
|
||||||
XP_THEME_ELEMENT_COMBOBUTTON,
|
XP_THEME_ELEMENT_LIST_HEADER,
|
||||||
XP_THEME_ELEMENT_BODY,
|
XP_THEME_ELEMENT_COMBOBUTTON,
|
||||||
XP_THEME_ELEMENT_TAB_ITEM,
|
XP_THEME_ELEMENT_BODY,
|
||||||
XP_THEME_ELEMENT_TAB_ITEM_LEFT_EDGE,
|
XP_THEME_ELEMENT_TAB_ITEM,
|
||||||
XP_THEME_ELEMENT_TAB_ITEM_RIGHT_EDGE,
|
XP_THEME_ELEMENT_TAB_ITEM_LEFT_EDGE,
|
||||||
XP_THEME_ELEMENT_TAB_PANE,
|
XP_THEME_ELEMENT_TAB_ITEM_RIGHT_EDGE,
|
||||||
XP_THEME_ELEMENT_SCROLLBAR_H,
|
XP_THEME_ELEMENT_TAB_PANE,
|
||||||
XP_THEME_ELEMENT_SCROLLBAR_V,
|
XP_THEME_ELEMENT_SCROLLBAR_H,
|
||||||
XP_THEME_ELEMENT_ARROW_UP,
|
XP_THEME_ELEMENT_SCROLLBAR_V,
|
||||||
XP_THEME_ELEMENT_ARROW_DOWN,
|
XP_THEME_ELEMENT_ARROW_UP,
|
||||||
XP_THEME_ELEMENT_ARROW_LEFT,
|
XP_THEME_ELEMENT_ARROW_DOWN,
|
||||||
XP_THEME_ELEMENT_ARROW_RIGHT,
|
XP_THEME_ELEMENT_ARROW_LEFT,
|
||||||
XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_H,
|
XP_THEME_ELEMENT_ARROW_RIGHT,
|
||||||
XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_V,
|
XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_H,
|
||||||
XP_THEME_ELEMENT_TROUGH_H,
|
XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_V,
|
||||||
XP_THEME_ELEMENT_TROUGH_V,
|
XP_THEME_ELEMENT_TROUGH_H,
|
||||||
XP_THEME_ELEMENT_EDIT_TEXT,
|
XP_THEME_ELEMENT_TROUGH_V,
|
||||||
XP_THEME_ELEMENT_DEFAULT_BUTTON,
|
XP_THEME_ELEMENT_EDIT_TEXT,
|
||||||
XP_THEME_ELEMENT_SPIN_BUTTON_UP,
|
XP_THEME_ELEMENT_DEFAULT_BUTTON,
|
||||||
XP_THEME_ELEMENT_SPIN_BUTTON_DOWN,
|
XP_THEME_ELEMENT_SPIN_BUTTON_UP,
|
||||||
XP_THEME_ELEMENT_PRESSED_RADIO_BUTTON,
|
XP_THEME_ELEMENT_SPIN_BUTTON_DOWN,
|
||||||
XP_THEME_ELEMENT_RADIO_BUTTON,
|
XP_THEME_ELEMENT_PRESSED_RADIO_BUTTON,
|
||||||
XP_THEME_ELEMENT_TREEVIEW_EXPANDER_OPENED,
|
XP_THEME_ELEMENT_RADIO_BUTTON,
|
||||||
XP_THEME_ELEMENT_TREEVIEW_EXPANDER_CLOSED,
|
XP_THEME_ELEMENT_TREEVIEW_EXPANDER_OPENED,
|
||||||
XP_THEME_ELEMENT_PROGRESS_BAR_H,
|
XP_THEME_ELEMENT_TREEVIEW_EXPANDER_CLOSED,
|
||||||
XP_THEME_ELEMENT_PROGRESS_BAR_V,
|
XP_THEME_ELEMENT_PROGRESS_BAR_H,
|
||||||
XP_THEME_ELEMENT_PROGRESS_TROUGH_H,
|
XP_THEME_ELEMENT_PROGRESS_BAR_V,
|
||||||
XP_THEME_ELEMENT_PROGRESS_TROUGH_V,
|
XP_THEME_ELEMENT_PROGRESS_TROUGH_H,
|
||||||
XP_THEME_ELEMENT_TOOLTIP,
|
XP_THEME_ELEMENT_PROGRESS_TROUGH_V,
|
||||||
XP_THEME_ELEMENT_REBAR,
|
XP_THEME_ELEMENT_TOOLTIP,
|
||||||
XP_THEME_ELEMENT_REBAR_GRIPPER_H,
|
XP_THEME_ELEMENT_REBAR,
|
||||||
XP_THEME_ELEMENT_REBAR_GRIPPER_V,
|
XP_THEME_ELEMENT_REBAR_GRIPPER_H,
|
||||||
XP_THEME_ELEMENT_REBAR_CHEVRON,
|
XP_THEME_ELEMENT_REBAR_GRIPPER_V,
|
||||||
XP_THEME_ELEMENT_TOOLBAR_BUTTON,
|
XP_THEME_ELEMENT_REBAR_CHEVRON,
|
||||||
XP_THEME_ELEMENT_MENU_ITEM,
|
XP_THEME_ELEMENT_TOOLBAR_BUTTON,
|
||||||
XP_THEME_ELEMENT_MENU_SEPARATOR,
|
XP_THEME_ELEMENT_MENU_ITEM,
|
||||||
XP_THEME_ELEMENT_STATUS_GRIPPER,
|
XP_THEME_ELEMENT_MENU_SEPARATOR,
|
||||||
XP_THEME_ELEMENT_STATUS_PANE,
|
XP_THEME_ELEMENT_STATUS_GRIPPER,
|
||||||
XP_THEME_ELEMENT_LINE_H,
|
XP_THEME_ELEMENT_STATUS_PANE,
|
||||||
XP_THEME_ELEMENT_LINE_V,
|
XP_THEME_ELEMENT_LINE_H,
|
||||||
XP_THEME_ELEMENT_TOOLBAR_SEPARATOR_H,
|
XP_THEME_ELEMENT_LINE_V,
|
||||||
XP_THEME_ELEMENT_TOOLBAR_SEPARATOR_V,
|
XP_THEME_ELEMENT_TOOLBAR_SEPARATOR_H,
|
||||||
XP_THEME_ELEMENT_SCALE_TROUGH_H,
|
XP_THEME_ELEMENT_TOOLBAR_SEPARATOR_V,
|
||||||
XP_THEME_ELEMENT_SCALE_TROUGH_V,
|
XP_THEME_ELEMENT_SCALE_TROUGH_H,
|
||||||
XP_THEME_ELEMENT_SCALE_SLIDER_H,
|
XP_THEME_ELEMENT_SCALE_TROUGH_V,
|
||||||
XP_THEME_ELEMENT_SCALE_SLIDER_V,
|
XP_THEME_ELEMENT_SCALE_SLIDER_H,
|
||||||
XP_THEME_ELEMENT_SCALE_TICS_H,
|
XP_THEME_ELEMENT_SCALE_SLIDER_V,
|
||||||
XP_THEME_ELEMENT_SCALE_TICS_V,
|
XP_THEME_ELEMENT_SCALE_TICS_H,
|
||||||
XP_THEME_ELEMENT__SIZEOF
|
XP_THEME_ELEMENT_SCALE_TICS_V,
|
||||||
} XpThemeElement;
|
XP_THEME_ELEMENT__SIZEOF
|
||||||
|
} XpThemeElement;
|
||||||
typedef enum
|
|
||||||
{
|
typedef enum
|
||||||
XP_THEME_FONT_CAPTION,
|
{
|
||||||
XP_THEME_FONT_MENU,
|
XP_THEME_FONT_CAPTION,
|
||||||
XP_THEME_FONT_STATUS,
|
XP_THEME_FONT_MENU,
|
||||||
XP_THEME_FONT_MESSAGE
|
XP_THEME_FONT_STATUS,
|
||||||
} XpThemeFont;
|
XP_THEME_FONT_MESSAGE
|
||||||
|
} XpThemeFont;
|
||||||
void xp_theme_init (void);
|
|
||||||
void xp_theme_reset (void);
|
void xp_theme_init (void);
|
||||||
void xp_theme_exit (void);
|
void xp_theme_reset (void);
|
||||||
gboolean xp_theme_draw (GdkWindow *win, XpThemeElement element,
|
void xp_theme_exit (void);
|
||||||
GtkStyle *style, int x, int y, int width,
|
gboolean xp_theme_draw (GdkWindow *win, XpThemeElement element,
|
||||||
int height, GtkStateType state_type,
|
GtkStyle *style, int x, int y, int width,
|
||||||
GdkRectangle *area);
|
int height, GtkStateType state_type,
|
||||||
gboolean xp_theme_is_drawable (XpThemeElement element);
|
GdkRectangle *area);
|
||||||
gboolean xp_theme_get_system_font (XpThemeClass klazz, XpThemeFont fontId, OUT LOGFONT *lf);
|
gboolean xp_theme_is_drawable (XpThemeElement element);
|
||||||
gboolean xp_theme_get_system_color (XpThemeClass klazz, int colorId, OUT DWORD * pColor);
|
gboolean xp_theme_get_system_font (XpThemeClass klazz, XpThemeFont fontId, OUT LOGFONT *lf);
|
||||||
gboolean xp_theme_get_system_metric (XpThemeClass klazz, int metricId, OUT int * pVal);
|
gboolean xp_theme_get_system_color (XpThemeClass klazz, int colorId, OUT DWORD * pColor);
|
||||||
|
gboolean xp_theme_get_system_metric (XpThemeClass klazz, int metricId, OUT int * pVal);
|
||||||
gboolean xp_theme_is_active (void);
|
|
||||||
|
gboolean xp_theme_is_active (void);
|
||||||
#endif /* XP_THEME_H */
|
|
||||||
|
#endif /* XP_THEME_H */
|
||||||
|
Reference in New Issue
Block a user