Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed tab spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 24, 2012
1 parent 642cdee commit 367d325
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/video/x11/SDL_x11messagebox.c
Expand Up @@ -36,11 +36,11 @@ static const char g_MessageBoxFont[] = "-*-*-medium-r-normal--0-120-*-*-p-0-iso8

static const SDL_MessageBoxColor g_default_colors[ SDL_MESSAGEBOX_COLOR_MAX ] =
{
{ 56, 54, 53 }, // SDL_MESSAGEBOX_COLOR_BACKGROUND,
{ 209, 207, 205 }, // SDL_MESSAGEBOX_COLOR_TEXT,
{ 140, 135, 129 }, // SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
{ 105, 102, 99 }, // SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
{ 205, 202, 53 }, // SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
{ 56, 54, 53 }, // SDL_MESSAGEBOX_COLOR_BACKGROUND,
{ 209, 207, 205 }, // SDL_MESSAGEBOX_COLOR_TEXT,
{ 140, 135, 129 }, // SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
{ 105, 102, 99 }, // SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
{ 205, 202, 53 }, // SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
};

#define SDL_MAKE_RGB( _r, _g, _b ) ( ( ( Uint32 )( _r ) << 16 ) | \
Expand Down Expand Up @@ -70,7 +70,7 @@ typedef struct SDL_MessageBoxDataX11
Font hfont;
Window window;
Display *display;
long event_mask;
long event_mask;
Atom wm_protocols;
Atom wm_delete_message;

Expand All @@ -91,7 +91,7 @@ typedef struct SDL_MessageBoxDataX11
const SDL_MessageBoxButtonData *buttondata;
SDL_MessageBoxButtonDataX11 buttonpos[ MAX_BUTTONS ];

Uint32 color[ SDL_MESSAGEBOX_COLOR_MAX ];
Uint32 color[ SDL_MESSAGEBOX_COLOR_MAX ];

const SDL_MessageBoxData *messageboxdata;
} SDL_MessageBoxDataX11;
Expand Down Expand Up @@ -146,10 +146,10 @@ GetHitButtonIndex( SDL_MessageBoxDataX11 *data, int x, int y )
static int
X11_MessageBoxInit( SDL_MessageBoxDataX11 *data, const SDL_MessageBoxData * messageboxdata, int * pbuttonid )
{
int i;
int i;
int numbuttons = messageboxdata->numbuttons;
const SDL_MessageBoxButtonData *buttondata = messageboxdata->buttons;
const SDL_MessageBoxColor *colorhints;
const SDL_MessageBoxColor *colorhints;

if ( numbuttons > MAX_BUTTONS ) {
SDL_SetError("Too many buttons (%d max allowed)", MAX_BUTTONS);
Expand All @@ -175,16 +175,16 @@ X11_MessageBoxInit( SDL_MessageBoxDataX11 *data, const SDL_MessageBoxData * mess
return -1;
}

if ( messageboxdata->colorScheme ) {
colorhints = messageboxdata->colorScheme->colors;
} else {
colorhints = g_default_colors;
}
if ( messageboxdata->colorScheme ) {
colorhints = messageboxdata->colorScheme->colors;
} else {
colorhints = g_default_colors;
}

/* Convert our SDL_MessageBoxColor r,g,b values to packed RGB format. */
for ( i = 0; i < SDL_MESSAGEBOX_COLOR_MAX; i++ ) {
data->color[ i ] = SDL_MAKE_RGB( colorhints[ i ].r, colorhints[ i ].g, colorhints[ i ].b );
}
/* Convert our SDL_MessageBoxColor r,g,b values to packed RGB format. */
for ( i = 0; i < SDL_MESSAGEBOX_COLOR_MAX; i++ ) {
data->color[ i ] = SDL_MAKE_RGB( colorhints[ i ].r, colorhints[ i ].g, colorhints[ i ].b );
}

return 0;
}
Expand Down Expand Up @@ -358,7 +358,7 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data )
data->event_mask = ExposureMask |
ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask |
StructureNotifyMask | FocusChangeMask | PointerMotionMask;
wnd_attr.event_mask = data->event_mask;
wnd_attr.event_mask = data->event_mask;

data->window = XCreateWindow(
display, DefaultRootWindow( display ),
Expand Down Expand Up @@ -458,7 +458,7 @@ X11_MessageBoxDraw( SDL_MessageBoxDataX11 *data, GC ctx )

XSetForeground( display, ctx, ( data->mouse_over_index == i ) ?
data->color[ SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED ] :
data->color[ SDL_MESSAGEBOX_COLOR_TEXT ] );
data->color[ SDL_MESSAGEBOX_COLOR_TEXT ] );
XDrawString( display, window, ctx,
buttondatax11->x + offset, buttondatax11->y + offset,
buttondata->text, buttondatax11->length );
Expand Down Expand Up @@ -492,7 +492,7 @@ X11_MessageBoxLoop( SDL_MessageBoxDataX11 *data )
XEvent e;
SDL_bool draw = SDL_TRUE;

XWindowEvent( data->display, data->window, data->event_mask, &e );
XWindowEvent( data->display, data->window, data->event_mask, &e );

/* If XFilterEvent returns True, then some input method has filtered the
event, and the client should discard the event. */
Expand Down

0 comments on commit 367d325

Please sign in to comment.