~ubuntu-branches/ubuntu/maverick/vlc/maverick

« back to all changes in this revision

Viewing changes to modules/gui/wince/preferences.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-09-17 21:56:14 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20080917215614-tj0vx8xzd57e52t8
Tags: 0.9.2-1ubuntu1
* New Upstream Release, exception granted by
    - dktrkranz, norsetto, Hobbsee (via irc). LP: #270404

Changes done in ubuntu:

* add libxul-dev to build-depends
* make sure that vlc is build against libxul in configure. This doesn't
  change anything in the package, but makes it more robust if building
  in an 'unclean' chroot or when modifying the package.
* debian/control: make Vcs-* fields point to the motumedia branch
* add libx264-dev and libass-dev to build-depends
  LP: #210354, #199870
* actually enable libass support by passing --enable-libass to configure
* enable libdca: add libdca-dev to build depends and --enable-libdca
* install the x264 plugin.

Changes already in the pkg-multimedia branch in debian:

* don't install usr/share/vlc/mozilla in debian/mozilla-plugin-vlc.install  
* new upstream .desktop file now registers flash video mimetype LP: #261567
* add Xb-Npp-Applications to mozilla-plugin-vlc
* remove duplicate entries in debian/vlc-nox.install

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * preferences.cpp : WinCE gui plugin for VLC
3
3
 *****************************************************************************
4
4
 * Copyright (C) 2000-2004 the VideoLAN team
5
 
 * $Id: 31c478aea6352890a6e89bfbc9f72e5ec3c4904c $
 
5
 * $Id: 3905575d03455451516d9b1bb66fb96d4fe9c8b3 $
6
6
 *
7
7
 * Authors: Marodon Cedric <cedric_marodon@yahoo.fr>
8
8
 *          Gildas Bazin <gbazin@videolan.org>
25
25
/*****************************************************************************
26
26
 * Preamble
27
27
 *****************************************************************************/
28
 
#include <stdlib.h>                                      /* malloc(), free() */
29
 
#include <string.h>                                            /* strerror() */
30
 
#include <stdio.h>
31
 
#include <vlc/vlc.h>
32
 
#include <vlc/intf.h>
 
28
#ifdef HAVE_CONFIG_H
 
29
# include "config.h"
 
30
#endif
 
31
 
 
32
#include <vlc_common.h>
 
33
#include <vlc_interface.h>
33
34
 
34
35
#include "wince.h"
35
36
 
77
78
    /*void CleanChanges();*/
78
79
 
79
80
    void OnSelectTreeItem( LPNM_TREEVIEW pnmtv, HWND parent, HINSTANCE hInst );
80
 
        
 
81
 
81
82
    ConfigTreeData *FindModuleConfig( ConfigTreeData *config_data );
82
83
 
83
84
    HWND hwndTV;
85
86
private:
86
87
    intf_thread_t *p_intf;
87
88
    PrefsDialog *p_prefs_dialog;
88
 
    vlc_bool_t b_advanced;
 
89
    bool b_advanced;
89
90
 
90
91
    HTREEITEM general_item;
91
92
    HTREEITEM plugins_item;
114
115
    intf_thread_t *p_intf;
115
116
    PrefsDialog *p_prefs_dialog;
116
117
 
117
 
    vlc_bool_t b_advanced;
 
118
    bool b_advanced;
118
119
 
119
120
    HWND label;
120
121
 
127
128
 
128
129
    ConfigTreeData() { b_submodule = 0; panel = NULL; psz_section = NULL;
129
130
                       psz_help = NULL; }
130
 
    virtual ~ConfigTreeData() { if( panel ) delete panel;
131
 
                                if( psz_section) free(psz_section);
132
 
                                if( psz_help) free(psz_help); }
 
131
    virtual ~ConfigTreeData() { delete panel;
 
132
                                free( psz_section );
 
133
                                free( psz_help ); }
133
134
 
134
 
    vlc_bool_t b_submodule;
 
135
    bool b_submodule;
135
136
 
136
137
    PrefsPanel *panel;
137
138
    int i_object_id;
152
153
 
153
154
/***********************************************************************
154
155
 
155
 
FUNCTION: 
 
156
FUNCTION:
156
157
  WndProc
157
158
 
158
 
PURPOSE: 
 
159
PURPOSE:
159
160
  Processes messages sent to the main window.
160
161
 
161
162
***********************************************************************/
192
193
        // Get the client area rect to put the panels in
193
194
        GetClientRect(hwnd, &rcClient);
194
195
 
195
 
        /* Create the buttons */            
 
196
        /* Create the buttons */
196
197
        advanced_checkbox =
197
198
            CreateWindow( _T("BUTTON"), _T("Advanced options"),
198
199
                        WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
254
255
        TVITEM tvi = {0};
255
256
        tvi.mask = TVIF_PARAM;
256
257
        tvi.hItem = TreeView_GetSelection( prefs_tree->hwndTV );
257
 
        if( !tvi.hItem ) break;
 
258
    if( !tvi.hItem ) break;
258
259
 
259
260
        if( !TreeView_GetItem( prefs_tree->hwndTV, &tvi ) ) break;
260
261
 
261
262
        ConfigTreeData *config_data =
262
263
            prefs_tree->FindModuleConfig( (ConfigTreeData *)tvi.lParam );
263
 
        if( config_data && hwnd == config_data->panel->config_window ) 
 
264
        if( config_data && hwnd == config_data->panel->config_window )
264
265
        {
265
266
            int dy;
266
267
            RECT rc;
267
268
            GetWindowRect( hwnd, &rc);
268
269
            int newvalue = config_data->panel->oldvalue;
269
 
            switch ( GET_WM_VSCROLL_CODE(wp,lp) ) 
 
270
            switch ( GET_WM_VSCROLL_CODE(wp,lp) )
270
271
            {
271
272
            case SB_BOTTOM       : newvalue = 0; break;
272
273
            case SB_TOP          : newvalue = config_data->panel->maxvalue; break;
284
285
            ScrollWindowEx( hwnd, 0, dy, NULL, NULL, NULL, NULL, SW_SCROLLCHILDREN );
285
286
            UpdateWindow ( hwnd);
286
287
 
287
 
            config_data->panel->oldvalue = newvalue;                                
 
288
            config_data->panel->oldvalue = newvalue;
288
289
        }
289
290
        break;
290
291
    }
323
324
 
324
325
    INITCOMMONCONTROLSEX iccex;
325
326
    RECT rcClient;
326
 
    TVITEM tvi = {0}; 
327
 
    TVINSERTSTRUCT tvins = {0}; 
 
327
    TVITEM tvi = {0};
 
328
    TVINSERTSTRUCT tvins = {0};
328
329
    HTREEITEM hPrev;
329
330
 
330
331
    size_t i_capability_count = 0;
335
336
    /* Initializations */
336
337
    p_intf = _p_intf;
337
338
    p_prefs_dialog = _p_prefs_dialog;
338
 
    b_advanced = VLC_FALSE;
 
339
    b_advanced = false;
339
340
 
340
341
    /* Create a tree view */
341
342
    // Initialize the INITCOMMONCONTROLSEX structure.
412
413
                config_data->i_object_id = p_module->i_object_id;
413
414
 
414
415
                /* Add the category to the tree */
415
 
                // Set the text of the item. 
416
 
                tvi.pszText = _FROMMB(p_item->psz_text); 
 
416
                // Set the text of the item.
 
417
                tvi.pszText = _FROMMB(p_item->psz_text);
417
418
                tvi.cchTextMax = _tcslen(tvi.pszText);
418
419
                tvi.lParam = (long)config_data;
419
420
                tvins.item = tvi;
420
 
                tvins.hInsertAfter = hPrev; 
 
421
                tvins.hInsertAfter = hPrev;
421
422
                tvins.hParent = general_item; //level 3
422
 
    
423
 
                // Add the item to the tree-view control. 
 
423
 
 
424
                // Add the item to the tree-view control.
424
425
                hPrev = (HTREEITEM)TreeView_InsertItem( hwndTV, &tvins );
425
426
 
426
427
                break;
430
431
 
431
432
        TreeView_SortChildren( hwndTV, general_item, 0 );
432
433
    }
433
 
        
 
434
 
434
435
    /*
435
436
     * Build a tree of all the plugins
436
437
     */
511
512
            tvi.cchTextMax = _tcslen(tvi.pszText);
512
513
            tvi.lParam = (long)config_data;
513
514
            tvins.item = tvi;
514
 
            tvins.hInsertAfter = plugins_item; 
 
515
            tvins.hInsertAfter = plugins_item;
515
516
            tvins.hParent = plugins_item;// level 3
516
517
 
517
 
            // Add the item to the tree-view control. 
 
518
            // Add the item to the tree-view control.
518
519
            capability_item = (HTREEITEM) TreeView_InsertItem( hwndTV, &tvins);
519
520
 
520
521
            i_capability_count++;
531
532
        tvi.cchTextMax = _tcslen(tvi.pszText);
532
533
        tvi.lParam = (long)config_data;
533
534
        tvins.item = tvi;
534
 
        tvins.hInsertAfter = capability_item; 
 
535
        tvins.hInsertAfter = capability_item;
535
536
        tvins.hParent = capability_item;// level 4
536
537
 
537
 
        // Add the item to the tree-view control. 
 
538
        // Add the item to the tree-view control.
538
539
        TreeView_InsertItem( hwndTV, &tvins );
539
540
    }
540
541
 
586
587
    {
587
588
        HTREEITEM item2 = TreeView_GetChild( hwndTV, item );
588
589
        while( item2 != 0 )
589
 
        {       
 
590
        {
590
591
            TVITEM tvi = {0};
591
592
            tvi.mask = TVIF_PARAM;
592
593
            tvi.hItem = item2;
619
620
    {
620
621
        HTREEITEM item2 = TreeView_GetChild( hwndTV, item );
621
622
        while( item2 != 0 )
622
 
        {       
 
623
        {
623
624
            TVITEM tvi = {0};
624
625
            tvi.mask = TVIF_PARAM;
625
626
            tvi.hItem = item2;
690
691
    p_intf = _p_intf;
691
692
    p_prefs_dialog = _p_prefs_dialog;
692
693
 
693
 
    b_advanced = VLC_TRUE;
 
694
    b_advanced = true;
694
695
 
695
696
    if( i_object_id == PLUGIN_ID || i_object_id == GENERAL_ID ||
696
697
        i_object_id == CAPABILITY_ID )
704
705
    else
705
706
    {
706
707
        /* Get a pointer to the module */
707
 
        p_module = (module_t *)vlc_object_get( p_intf,  i_object_id );
708
 
        if( p_module->i_object_type != VLC_OBJECT_MODULE )
709
 
        {
710
 
            /* 0OOoo something went really bad */
711
 
            return;
712
 
        }
 
708
        p_module = (module_t *)vlc_object_get( i_object_id );
713
709
 
714
710
        /* Enumerate config options and add corresponding config boxes
715
711
         * (submodules don't have config options, they are stored in the
779
775
            config_array.push_back( control );
780
776
        }
781
777
        while( p_item->i_type != CONFIG_HINT_END && p_item++ );
782
 
                
 
778
 
783
779
        GetWindowRect( config_window, &rc);
784
780
        maxvalue = y_pos - (rc.bottom - rc.top) + 5;
785
781
        oldvalue = 0;
819
815
        case CONFIG_ITEM_KEY:
820
816
            /* So you don't need to restart to have the changes take effect */
821
817
            val.i_int = control->GetIntValue();
822
 
            var_Set( p_intf->p_vlc, control->GetName(), val );
 
818
            var_Set( p_intf->p_libvlc, control->GetName(), val );
823
819
        case CONFIG_ITEM_INTEGER:
824
820
        case CONFIG_ITEM_BOOL:
825
821
            config_PutInt( p_intf, control->GetName(),