Code formatting

This commit is contained in:
Raymond Penners 2003-10-22 18:25:50 +00:00
parent 5bf43ccbb8
commit bce3094486
4 changed files with 64 additions and 59 deletions

View File

@ -1,12 +1,14 @@
2003-10-22 Raymond Penners <raymond@dotsphinx.com>
* src/*.[ch]: Code formatting & XP constants renaming.
2003-10-21 Dom Lachowicz <cinamod@hotmail.com>
* src/wimp_style.c: Use theme colors
Use theme metrics
(disabled) Use theme fonts
Theme menu items, menu separators
Draw status bar resize grips
* src/wimp_style.c: Use theme colors, use theme metrics
(disabled), use theme fonts, theme menu items, menu separators,
draw status bar resize grips.
* src/xp_theme.c: Ditto
* src/xp_theme.c: Ditto.
2003-10-20 Raymond Penners <raymond@dotsphinx.com>

View File

@ -333,12 +333,12 @@ sys_color_to_gtk_color(XpThemeClass klazz, int id, GdkColor *pcolor)
static int
get_system_metric(XpThemeClass klazz, int id)
{
int rval;
int rval;
if (!xp_theme_get_system_metric(klazz, id, &rval))
rval = GetSystemMetrics (id);
if (!xp_theme_get_system_metric(klazz, id, &rval))
rval = GetSystemMetrics (id);
return rval;
return rval;
}
static void
@ -1044,7 +1044,7 @@ draw_arrow (GtkStyle *style,
/* draw the toolbar chevrons - waiting for GTK 2.4 */
if (name && !strcmp (name, "gtk-toolbar-arrow"))
{
if (xp_theme_draw(window, XP_THEME_ELEMENT_CHEVRON, style, x, y, width, height, state, area))
if (xp_theme_draw(window, XP_THEME_ELEMENT_REBAR_CHEVRON, style, x, y, width, height, state, area))
return;
}
@ -1164,8 +1164,8 @@ draw_box (GtkStyle *style,
{
xp_theme_draw(window,
is_v
? XP_THEME_ELEMENT_GRIP_V
: XP_THEME_ELEMENT_GRIP_H,
? XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_V
: XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_H,
style, x, y, width, height, state_type, area);
return;
}
@ -1569,9 +1569,9 @@ draw_handle (GtkStyle *style,
sanitize_size (window, &width, &height);
if (orientation == GTK_ORIENTATION_VERTICAL)
hndl = XP_THEME_ELEMENT_GRIPPER_V;
hndl = XP_THEME_ELEMENT_REBAR_GRIPPER_V;
else
hndl = XP_THEME_ELEMENT_GRIPPER_H;
hndl = XP_THEME_ELEMENT_REBAR_GRIPPER_H;
if (xp_theme_draw (window, hndl, style, x, y, width, height,
state_type, area))

View File

@ -229,9 +229,9 @@ xp_theme_get_handle_by_element (XpThemeElement element)
break;
case XP_THEME_ELEMENT_REBAR:
case XP_THEME_ELEMENT_GRIPPER_H:
case XP_THEME_ELEMENT_GRIPPER_V:
case XP_THEME_ELEMENT_CHEVRON:
case XP_THEME_ELEMENT_REBAR_GRIPPER_H:
case XP_THEME_ELEMENT_REBAR_GRIPPER_V:
case XP_THEME_ELEMENT_REBAR_CHEVRON:
klazz = XP_THEME_CLASS_REBAR;
break;
@ -284,8 +284,8 @@ xp_theme_get_handle_by_element (XpThemeElement element)
case XP_THEME_ELEMENT_ARROW_DOWN:
case XP_THEME_ELEMENT_ARROW_LEFT:
case XP_THEME_ELEMENT_ARROW_RIGHT:
case XP_THEME_ELEMENT_GRIP_V:
case XP_THEME_ELEMENT_GRIP_H:
case XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_V:
case XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_H:
case XP_THEME_ELEMENT_TROUGH_V:
case XP_THEME_ELEMENT_TROUGH_H:
klazz = XP_THEME_CLASS_SCROLLBAR;
@ -332,8 +332,8 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
break;
case XP_THEME_ELEMENT_REBAR:
case XP_THEME_ELEMENT_GRIPPER_H:
case XP_THEME_ELEMENT_GRIPPER_V:
case XP_THEME_ELEMENT_REBAR_GRIPPER_H:
case XP_THEME_ELEMENT_REBAR_GRIPPER_V:
ret = CHEVS_NORMAL;
break;
@ -342,7 +342,7 @@ xp_theme_map_gtk_state (XpThemeElement element, GtkStateType state)
ret = 1;
break;
case XP_THEME_ELEMENT_CHEVRON:
case XP_THEME_ELEMENT_REBAR_CHEVRON:
switch (state)
{
case GTK_STATE_PRELIGHT:
@ -713,8 +713,8 @@ xp_theme_draw (GdkWindow *win, XpThemeElement element, GtkStyle *style,
part_state = xp_theme_map_gtk_state(element, state_type);
#ifdef GNATS_HACK
if (element == XP_THEME_ELEMENT_GRIPPER_V
|| element == XP_THEME_ELEMENT_GRIPPER_H)
if (element == XP_THEME_ELEMENT_REBAR_GRIPPER_V
|| element == XP_THEME_ELEMENT_REBAR_GRIPPER_H)
{
/* Hack alert: when XP draws a gripper, it does not seem to fill
up the whole rectangle. It only fills the gripper line
@ -764,49 +764,52 @@ xp_theme_get_system_font (XpThemeClass klazz, XpThemeFont fontId, LOGFONT *lf)
if (get_theme_sys_font_func != NULL)
{
HTHEME theme = xp_theme_get_handle_by_class(klazz);
if (!theme)
return FALSE;
HTHEME theme = xp_theme_get_handle_by_class(klazz);
if (!theme)
return FALSE;
switch (fontId){
case XP_THEME_FONT_CAPTION:
themeFont = TMT_CAPTIONFONT; break;
case XP_THEME_FONT_MENU:
themeFont = TMT_MENUFONT; break;
case XP_THEME_FONT_STATUS:
themeFont = TMT_STATUSFONT; break;
case XP_THEME_FONT_MESSAGE:
default:
themeFont = TMT_MSGBOXFONT; break;
}
/* if theme is NULL, it will just return the GetSystemFont() value */
switch (fontId)
{
case XP_THEME_FONT_CAPTION:
themeFont = TMT_CAPTIONFONT; break;
case XP_THEME_FONT_MENU:
themeFont = TMT_MENUFONT; break;
case XP_THEME_FONT_STATUS:
themeFont = TMT_STATUSFONT; break;
case XP_THEME_FONT_MESSAGE:
default:
themeFont = TMT_MSGBOXFONT; break;
}
/* if theme is NULL, it will just return the GetSystemFont() value */
return ((*get_theme_sys_font_func)(theme, themeFont, lf) == S_OK);
}
return FALSE;
}
gboolean xp_theme_get_system_color (XpThemeClass klazz, int colorId, DWORD * pColor)
gboolean
xp_theme_get_system_color (XpThemeClass klazz, int colorId, DWORD * pColor)
{
if (get_theme_sys_color_func != NULL)
{
HTHEME theme = xp_theme_get_handle_by_class(klazz);
HTHEME theme = xp_theme_get_handle_by_class(klazz);
/* if theme is NULL, it will just return the GetSystemColor() value */
*pColor = (*get_theme_sys_color_func)(theme, colorId);
return TRUE;
/* if theme is NULL, it will just return the GetSystemColor() value */
*pColor = (*get_theme_sys_color_func)(theme, colorId);
return TRUE;
}
return FALSE;
}
gboolean xp_theme_get_system_metric (XpThemeClass klazz, int metricId, int * pVal)
gboolean
xp_theme_get_system_metric (XpThemeClass klazz, int metricId, int * pVal)
{
if (get_theme_sys_metric_func != NULL)
{
HTHEME theme = xp_theme_get_handle_by_class(klazz);
HTHEME theme = xp_theme_get_handle_by_class(klazz);
/* if theme is NULL, it will just return the GetSystemMetrics() value */
*pVal = (*get_theme_sys_metric_func)(theme, metricId);
return TRUE;
/* if theme is NULL, it will just return the GetSystemMetrics() value */
*pVal = (*get_theme_sys_metric_func)(theme, metricId);
return TRUE;
}
return FALSE;
}

View File

@ -62,8 +62,8 @@ typedef enum
XP_THEME_ELEMENT_ARROW_DOWN,
XP_THEME_ELEMENT_ARROW_LEFT,
XP_THEME_ELEMENT_ARROW_RIGHT,
XP_THEME_ELEMENT_GRIP_H,
XP_THEME_ELEMENT_GRIP_V,
XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_H,
XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_V,
XP_THEME_ELEMENT_TROUGH_H,
XP_THEME_ELEMENT_TROUGH_V,
XP_THEME_ELEMENT_EDIT_TEXT,
@ -80,9 +80,9 @@ typedef enum
XP_THEME_ELEMENT_PROGRESS_TROUGH_V,
XP_THEME_ELEMENT_TOOLTIP,
XP_THEME_ELEMENT_REBAR,
XP_THEME_ELEMENT_GRIPPER_H,
XP_THEME_ELEMENT_GRIPPER_V,
XP_THEME_ELEMENT_CHEVRON,
XP_THEME_ELEMENT_REBAR_GRIPPER_H,
XP_THEME_ELEMENT_REBAR_GRIPPER_V,
XP_THEME_ELEMENT_REBAR_CHEVRON,
XP_THEME_ELEMENT_TOOLBAR,
XP_THEME_ELEMENT_MENUITEM,
XP_THEME_ELEMENT_MENU_SEPARATOR,
@ -95,10 +95,10 @@ typedef enum
typedef enum
{
XP_THEME_FONT_CAPTION,
XP_THEME_FONT_MENU,
XP_THEME_FONT_STATUS,
XP_THEME_FONT_MESSAGE
XP_THEME_FONT_CAPTION,
XP_THEME_FONT_MENU,
XP_THEME_FONT_STATUS,
XP_THEME_FONT_MESSAGE
} XpThemeFont;
void xp_theme_init (void);