* wxwidgets.hpp: Common headers for the wxwidges interface
*****************************************************************************
* Copyright (C) 1999-2005 the VideoLAN team
- * $Id: wxwidgets.h 12502 2005-09-09 19:38:01Z gbazin $
+ * $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef _WXVLC_WIDGETS_H_
#include <vlc/vlc.h>
#include <vlc/intf.h>
+#include "charset.h"
#include <wx/wx.h>
#define SLIDER_MAX_POS 10000
# define wxLocaleFree(string) LocaleFree(string)
#endif
+/* From Locale functions to use for File Drop targets ... go figure */
+#ifdef wxUSE_UNICODE
+inline const char *wxDnDFromLocale( const wxChar *stupid, char *psz_local )
+{
+ /*
+ * FIXME: this is yet another awful and ugly bug-to-bug work-around
+ * for the painfully broken and brain-dead wxWidgets character
+ * encoding internals. Maybe, one day the wxWidgets team will find out
+ * and we will have to remove (phew) this kludge or autodetect whether
+ * to trigger it (damn).
+ *
+ * In Unicode mode, wxWidgets will encode file names in the locale
+ * encoding with each **bytes** (rather than characters) represented
+ * by a 32 bits unsigned integer. If you are lucky enough to be using
+ * ISO-8859-1 as your local character encoding, that lame encoding
+ * scheme happens to be identical to UTF-32 with your arch native
+ * byte-endianess. If you are using anything else, including not only
+ * UTF-8 but also Windows-1252(!) and ISO-8859-15(!) or any
+ * non-western encoding, it obviously fails.
+ */
+ const wxChar *braindead;
+ for (braindead = stupid; *braindead; braindead++);
+
+ size_t i = (braindead - stupid);
+ psz_local = (char *)malloc( i + 1 );
+ do
+ psz_local[i] = (char)stupid[i];
+ while (i--);
+
+ const char *psz_utf8 = FromLocale( psz_local );
+ return psz_utf8;
+}
+#else
+# define wxDnDFromLocale( string, a ) wxFromLocale( string )
+#endif
+#ifdef wxUSE_UNICODE
+# define wxDnDLocaleFree( string, a ) LocaleFree( string ); free( a )
+#else
+# define wxDnDLocaleFree( string, a ) wxLocaleFree( string )
+#endif
#define WRAPCOUNT 80
/* The input thread */
input_thread_t * p_input;
- /* The slider */
- int i_slider_pos; /* slider position */
- int i_slider_oldpos; /* previous position */
- vlc_bool_t b_slider_free; /* slider status */
-
/* The messages window */
msg_subscription_t* p_sub; /* message bank subscription */