* preferences_widgets.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: preferences_widgets.cpp,v 1.6 2003/10/28 21:59:13 gbazin Exp $
+ * $Id: preferences_widgets.cpp,v 1.7 2003/10/29 12:23:50 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
shift = new wxCheckBox( this, -1, wxU(_("Shift")) );
shift->SetValue( p_item->i_value & KEY_MODIFIER_SHIFT );
combo = new wxComboBox( this, -1, wxU("f"), wxDefaultPosition,
- wxDefaultSize, 0, NULL,
- wxCB_READONLY | wxCB_SORT );
+ wxDefaultSize, 0, NULL, wxCB_READONLY );
for( unsigned int i = 0; i < sizeof(keys)/sizeof(key_descriptor_s); i++ )
{
/* HPReg says casting the int to void * is fine */
sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
combo = new wxComboBox( this, -1, wxU(p_item->psz_value),
wxDefaultPosition, wxDefaultSize,
- 0, NULL, wxCB_READONLY|wxCB_SORT );
+ 0, NULL, wxCB_READONLY );
/* build a list of available options */
for( int i_index = 0; p_item->ppsz_list[i_index];
* subtitles.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: subtitles.cpp,v 1.6 2003/08/27 11:53:26 gbazin Exp $
+ * $Id: subtitles.cpp,v 1.7 2003/10/29 12:23:50 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
new wxStaticText(panel, -1, wxU(p_item->psz_text));
encoding_combo = new wxComboBox( panel, -1, wxU(p_item->psz_value),
wxDefaultPosition, wxDefaultSize,
- 0, NULL, wxCB_READONLY | wxCB_SORT );
+ 0, NULL, wxCB_READONLY );
/* build a list of available options */
for( int i_index = 0; p_item->ppsz_list && p_item->ppsz_list[i_index];
* freetype.c : Put text on the video, using freetype2
*****************************************************************************
* Copyright (C) 2002, 2003 VideoLAN
- * $Id: freetype.c,v 1.29 2003/10/29 00:04:56 sigmunau Exp $
+ * $Id: freetype.c,v 1.30 2003/10/29 12:23:50 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
{
uint8_t *p_in;
- int i_pitch = p_pic->p[ i_plane ].i_pitch;
+ int i_pic_pitch = p_pic->p[ i_plane ].i_pitch;
+ int i_pic_width = p_pic->p[ i_plane ].i_visible_pitch;
p_in = p_pic->p[ i_plane ].p_pixels;
pen_y += p_vout->p_text_renderer_data->p_face->size->metrics.ascender >> 6;
if ( p_string->i_flags & OSD_ALIGN_RIGHT )
{
- pen_x = i_pitch - p_line->i_width
+ pen_x = i_pic_width - p_line->i_width
- p_string->i_x_margin;
}
else if ( p_string->i_flags & OSD_ALIGN_LEFT )
}
else
{
- pen_x = i_pitch / 2 - p_line->i_width / 2
+ pen_x = i_pic_width / 2 - p_line->i_width / 2
+ p_string->i_x_margin;
}
{
FT_BitmapGlyph p_glyph = p_line->pp_glyphs[ i ];
#define alpha p_vout->p_text_renderer_data->pi_gamma[ p_glyph->bitmap.buffer[ x + y * p_glyph->bitmap.width ] ]
-#define pixel p_in[ ( p_line->p_glyph_pos[ i ].y + pen_y + y - p_glyph->top ) * i_pitch + x + pen_x + p_line->p_glyph_pos[ i ].x + p_glyph->left ]
+#define pixel p_in[ ( p_line->p_glyph_pos[ i ].y + pen_y + y - p_glyph->top ) * i_pic_pitch + x + pen_x + p_line->p_glyph_pos[ i ].x + p_glyph->left ]
for(y = 0; y < p_glyph->bitmap.rows; y++ )
{
for( x = 0; x < p_glyph->bitmap.width; x++ )
pen_y += p_vout->p_text_renderer_data->p_face->size->metrics.ascender >> 7;
if ( p_string->i_flags & OSD_ALIGN_RIGHT )
{
- pen_x = i_pitch - ( p_line->i_width >> 1 )
+ pen_x = i_pic_width - ( p_line->i_width >> 1 )
- ( p_string->i_x_margin >> 1 );
}
else if ( p_string->i_flags & OSD_ALIGN_LEFT )
}
else
{
- pen_x = i_pitch / 2 - p_line->i_width / 4
+ pen_x = i_pic_width / 2 - p_line->i_width / 4
+ p_string->i_x_margin / 2;
}
{
FT_BitmapGlyph p_glyph = p_line->pp_glyphs[ i ];
#define alpha p_vout->p_text_renderer_data->pi_gamma[ p_glyph->bitmap.buffer[ ( x + y * p_glyph->bitmap.width ) ] ]
-#define pixel p_in[ ( ( p_line->p_glyph_pos[ i ].y >> 1 ) + pen_y + ( y >> 1 ) - ( p_glyph->top >> 1 ) ) * i_pitch + ( x >> 1 ) + pen_x + ( p_line->p_glyph_pos[ i ].x >> 1 ) + ( p_glyph->left >>1) ]
+#define pixel p_in[ ( ( p_line->p_glyph_pos[ i ].y >> 1 ) + pen_y + ( y >> 1 ) - ( p_glyph->top >> 1 ) ) * i_pic_pitch + ( x >> 1 ) + pen_x + ( p_line->p_glyph_pos[ i ].x >> 1 ) + ( p_glyph->left >>1) ]
for( y = 0; y < p_glyph->bitmap.rows; y+=2 )
{
for( x = 0; x < p_glyph->bitmap.width; x+=2 )
p_line = p_line->p_next )
{
uint8_t *p_in;
- int i_pitch = p_pic->p[0].i_pitch;
-
+ int i_pic_pitch = p_pic->p[0].i_pitch;
+ int i_pic_width = p_pic->p[0].i_visible_pitch;
+
p_in = p_pic->p[0].p_pixels;
if ( p_string->i_flags & OSD_ALIGN_BOTTOM )
pen_y += p_vout->p_text_renderer_data->p_face->size->metrics.ascender >> 6;
if ( p_string->i_flags & OSD_ALIGN_RIGHT )
{
- pen_x = i_pitch - p_line->i_width
+ pen_x = i_pic_width - p_line->i_width
- p_string->i_x_margin;
}
else if ( p_string->i_flags & OSD_ALIGN_LEFT )
}
else
{
- pen_x = i_pitch / 2 /2 - p_line->i_width / 2 + p_string->i_x_margin;
+ pen_x = i_pic_width / 2 /2 - p_line->i_width / 2 + p_string->i_x_margin;
}
for( i = 0; p_line->pp_glyphs[i] != NULL; i++ )
{
FT_BitmapGlyph p_glyph = p_line->pp_glyphs[ i ];
#define alpha p_vout->p_text_renderer_data->pi_gamma[ p_glyph->bitmap.buffer[ x + y * p_glyph->bitmap.width ] ]
-#define pixel p_in[ ( p_line->p_glyph_pos[ i ].y + pen_y + y - p_glyph->top ) * i_pitch + 2 * ( x + pen_x + p_line->p_glyph_pos[ i ].x + p_glyph->left ) ]
+#define pixel p_in[ ( p_line->p_glyph_pos[ i ].y + pen_y + y - p_glyph->top ) * i_pic_pitch + 2 * ( x + pen_x + p_line->p_glyph_pos[ i ].x + p_glyph->left ) ]
for(y = 0; y < p_glyph->bitmap.rows; y++ )
{
for( x = 0; x < p_glyph->bitmap.width; x++ )
for( p_line = p_subpic->p_sys->p_lines; p_line != NULL; p_line = p_line->p_next )
{
uint8_t *p_in;
- int i_pitch = p_pic->p[ i_plane ].i_pitch;
-
+ int i_pic_pitch = p_pic->p[ i_plane ].i_pitch;
+ int i_pic_width = p_pic->p[ i_plane ].i_visible_pitch;
+
p_in = p_pic->p[ i_plane ].p_pixels;
if ( p_string->i_flags & OSD_ALIGN_BOTTOM )
pen_y += p_vout->p_text_renderer_data->p_face->size->metrics.ascender >> 6;
if ( p_string->i_flags & OSD_ALIGN_RIGHT )
{
- pen_x = i_pitch - p_line->i_width
+ pen_x = i_pic_width - p_line->i_width
- p_string->i_x_margin;
}
else if ( p_string->i_flags & OSD_ALIGN_LEFT )
}
else
{
- pen_x = i_pitch / 2 / 4 - p_line->i_width / 2
+ pen_x = i_pic_width / 2 / 4 - p_line->i_width / 2
+ p_string->i_x_margin;
}
{
FT_BitmapGlyph p_glyph = p_line->pp_glyphs[ i ];
#define alpha p_vout->p_text_renderer_data->pi_gamma[ p_glyph->bitmap.buffer[ x + y * p_glyph->bitmap.width ] ]
-#define pixel( c ) p_in[ ( p_line->p_glyph_pos[ i ].y + pen_y + y - p_glyph->top ) * i_pitch + ( x + pen_x + p_line->p_glyph_pos[ i ].x + p_glyph->left ) * 4 + c ]
+#define pixel( c ) p_in[ ( p_line->p_glyph_pos[ i ].y + pen_y + y - p_glyph->top ) * i_pic_pitch + ( x + pen_x + p_line->p_glyph_pos[ i ].x + p_glyph->left ) * 4 + c ]
for(y = 0; y < p_glyph->bitmap.rows; y++ )
{
for( x = 0; x < p_glyph->bitmap.width; x++ )
* events.c: Windows DirectX video output events handler
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: events.c,v 1.26 2003/10/29 01:33:27 gbazin Exp $
+ * $Id: events.c,v 1.27 2003/10/29 12:23:51 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
*****************************************************************************/
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
+#include <ctype.h> /* tolower() */
#include <string.h> /* strerror() */
#include <vlc/vlc.h>
break;
case WM_KEYDOWN:
- /* the key events are first processed here. The next
- * message processed by this main message loop will be the
- * char translation of the key event */
- case WM_CHAR:
- if( msg.message == WM_KEYDOWN )
+ /* The key events are first processed here and not translated
+ * into WM_CHAR events because we need to know the status of the
+ * modifier keys. */
+ val.i_int = DirectXConvertKey( msg.wParam );
+ if( !val.i_int )
{
- val.i_int = DirectXConvertKey( msg.wParam );
- TranslateMessage(&msg);
+ /* This appears to be a "normal" (ascii) key */
+ val.i_int = tolower( MapVirtualKey( msg.wParam, 2 ) );
}
- else val.i_int = msg.wParam;
if( val.i_int )
{