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> 2003-10-21 Dom Lachowicz <cinamod@hotmail.com>
* src/wimp_style.c: Use theme colors * src/wimp_style.c: Use theme colors, use theme metrics
Use theme metrics (disabled), use theme fonts, theme menu items, menu separators,
(disabled) Use theme fonts draw status bar resize grips.
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> 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 static int
get_system_metric(XpThemeClass klazz, int id) get_system_metric(XpThemeClass klazz, int id)
{ {
int rval; int rval;
if (!xp_theme_get_system_metric(klazz, id, &rval)) if (!xp_theme_get_system_metric(klazz, id, &rval))
rval = GetSystemMetrics (id); rval = GetSystemMetrics (id);
return rval; return rval;
} }
static void static void
@ -1044,7 +1044,7 @@ draw_arrow (GtkStyle *style,
/* draw the toolbar chevrons - waiting for GTK 2.4 */ /* draw the toolbar chevrons - waiting for GTK 2.4 */
if (name && !strcmp (name, "gtk-toolbar-arrow")) 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; return;
} }
@ -1164,8 +1164,8 @@ draw_box (GtkStyle *style,
{ {
xp_theme_draw(window, xp_theme_draw(window,
is_v is_v
? XP_THEME_ELEMENT_GRIP_V ? XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_V
: XP_THEME_ELEMENT_GRIP_H, : XP_THEME_ELEMENT_SCROLLBAR_GRIPPER_H,
style, x, y, width, height, state_type, area); style, x, y, width, height, state_type, area);
return; return;
} }
@ -1569,9 +1569,9 @@ draw_handle (GtkStyle *style,
sanitize_size (window, &width, &height); sanitize_size (window, &width, &height);
if (orientation == GTK_ORIENTATION_VERTICAL) if (orientation == GTK_ORIENTATION_VERTICAL)
hndl = XP_THEME_ELEMENT_GRIPPER_V; hndl = XP_THEME_ELEMENT_REBAR_GRIPPER_V;
else 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, if (xp_theme_draw (window, hndl, style, x, y, width, height,
state_type, area)) state_type, area))

View File

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

View File

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