~ubuntu-branches/ubuntu/natty/vlc/natty

« back to all changes in this revision

Viewing changes to modules/gui/skins2/x11/x11_factory.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2010-06-25 01:09:16 UTC
  • mfrom: (1.1.30 upstream)
  • Revision ID: james.westby@ubuntu.com-20100625010916-asxhep2mutg6g6pd
Tags: 1.1.0-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - build and install the libx264 plugin
  - add Xb-Npp header to vlc package
  - Add apport hook to include more vlc dependencies in bug reports
* Drop xulrunner patches.
* Drop 502_xulrunner_191.diff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * x11_factory.cpp
3
3
 *****************************************************************************
4
4
 * Copyright (C) 2003 the VideoLAN team
5
 
 * $Id: 774c3a86b781bf7809e9a3e8b7909f1e0ce9862b $
 
5
 * $Id: 97ab4c92f8091120930b1045e4fd907a3c7cd81b $
6
6
 *
7
7
 * Authors: Cyril Deguet     <asmax@via.ecp.fr>
8
8
 *          Olivier Teulière <ipkiss@via.ecp.fr>
38
38
#include "x11_window.hpp"
39
39
#include "x11_tooltip.hpp"
40
40
 
 
41
#include "../src/generic_window.hpp"
 
42
 
 
43
#include <vlc_common.h>
 
44
#include <vlc_xlib.h>
41
45
 
42
46
X11Factory::X11Factory( intf_thread_t *pIntf ): OSFactory( pIntf ),
43
47
    m_pDisplay( NULL ), m_pTimerLoop( NULL ), m_dirSep( "/" )
56
60
bool X11Factory::init()
57
61
{
58
62
    // make sure xlib is safe-thread
59
 
    if( !XInitThreads() )
 
63
    if( !vlc_xlib_init( VLC_OBJECT(getIntf()) ) )
 
64
    {
60
65
        msg_Err( getIntf(), "initializing xlib for multi-threading failed" );
 
66
        return false;
 
67
    }
61
68
 
62
69
    // Create the X11 display
63
70
    m_pDisplay = new X11Display( getIntf() );
75
82
                                     ConnectionNumber( pDisplay ) );
76
83
 
77
84
    // Initialize the resource path
78
 
    char *datadir = config_GetUserDataDir();
 
85
    char *datadir = config_GetUserDir( VLC_DATA_DIR );
79
86
    m_resourcePath.push_back( (string)datadir + "/skins2" );
80
87
    free( datadir );
81
88
    m_resourcePath.push_back( (string)"share/skins2" );
82
 
    m_resourcePath.push_back( (string)config_GetDataDir () + "/skins2" );
 
89
    datadir = config_GetDataDir( getIntf() );
 
90
    m_resourcePath.push_back( (string)datadir + "/skins2" );
 
91
    free( datadir );
83
92
 
84
93
    return true;
85
94
}
140
149
 
141
150
 
142
151
OSWindow *X11Factory::createOSWindow( GenericWindow &rWindow, bool dragDrop,
143
 
                                      bool playOnDrop, OSWindow *pParent )
 
152
                                      bool playOnDrop, OSWindow *pParent,
 
153
                                      GenericWindow::WindowType_t type )
144
154
{
145
155
    return new X11Window( getIntf(), rWindow, *m_pDisplay, dragDrop,
146
 
                          playOnDrop, (X11Window*)pParent );
 
156
                          playOnDrop, (X11Window*)pParent, type );
147
157
}
148
158
 
149
159