]> git.sesse.net Git - vlc/blobdiff - modules/gui/wince/menus.cpp
Implement Lua objects in the C code directly. Fix most type checks. Move every thing...
[vlc] / modules / gui / wince / menus.cpp
index ce27d952402e1b2d640412e417fc4439e0cb099b..5616fdb97dd95d09e7fa47f4c6b8f9b8db4f692a 100644 (file)
@@ -29,7 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_interface.h>
 
 #include "wince.h"
@@ -443,8 +443,6 @@ void RefreshSettingsMenu( intf_thread_t *p_intf, HMENU hMenu )
         vlc_object_find( p_intf, VLC_OBJECT_INTF, FIND_PARENT );
     if( p_object != NULL )
     {
-        ppsz_varnames[i] = "intf-switch";
-        pi_objects[i++] = p_object->i_object_id;
         ppsz_varnames[i] = "intf-add";
         pi_objects[i++] = p_object->i_object_id;
         vlc_object_release( p_object );
@@ -463,7 +461,7 @@ void RefreshMenu( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
                   int *pi_objects, int i_start_id )
 {
     vlc_object_t *p_object;
-    vlc_bool_t b_section_empty = VLC_FALSE;
+    bool b_section_empty = false;
     int i;
 
     /* Initializations */
@@ -480,7 +478,7 @@ void RefreshMenu( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
             }
 
             AppendMenu( hMenu, MF_SEPARATOR, 0, _T("") );
-            b_section_empty = VLC_TRUE;
+            b_section_empty = true;
             continue;
         }
 
@@ -489,14 +487,14 @@ void RefreshMenu( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
             AppendMenu( hMenu, MF_GRAYED | MF_STRING,
                         MenuDummy_Event, _FROMMB(ppsz_varnames[i]) );
 
-            b_section_empty = VLC_FALSE;
+            b_section_empty = false;
             continue;
         }
 
-        p_object = (vlc_object_t *)vlc_object_get( p_intf, pi_objects[i] );
+        p_object = (vlc_object_t *)vlc_object_get( pi_objects[i] );
         if( p_object == NULL ) continue;
 
-        b_section_empty = VLC_FALSE;
+        b_section_empty = false;
         CreateMenuItem( p_intf, p_menu_list, hMenu, ppsz_varnames[i],
                         p_object, &i_item_id );
         vlc_object_release( p_object );
@@ -560,7 +558,7 @@ void CreateMenuItem( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
         AppendMenu( hMenu, MF_STRING | MF_POPUP, (UINT)hMenuItem,
                     _FROMMB(text.psz_string ? text.psz_string : psz_var) );
         if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
-        if( text.psz_string ) free( text.psz_string );
+        free( text.psz_string );
         return;
     }
 
@@ -587,12 +585,12 @@ void CreateMenuItem( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
         break;
 
     default:
-        if( text.psz_string ) free( text.psz_string );
+        free( text.psz_string );
         return;
     }
 
     if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
-    if( text.psz_string ) free( text.psz_string );
+    free( text.psz_string );
 }
 
 HMENU CreateChoicesMenu( intf_thread_t *p_intf,
@@ -764,7 +762,7 @@ void OnMenuEvent( intf_thread_t *p_intf, int id )
     if( p_menuitemext )
     {
         vlc_object_t *p_object = (vlc_object_t *)
-            vlc_object_get( p_intf, p_menuitemext->i_object_id );
+            vlc_object_get( p_menuitemext->i_object_id );
         if( p_object == NULL ) return;
 
         var_Set( p_object, p_menuitemext->psz_var, p_menuitemext->val );
@@ -804,9 +802,9 @@ MenuItemExt::MenuItemExt( intf_thread_t *p_intf, int _id, char *_psz_var,
 
 MenuItemExt::~MenuItemExt()
 {
-    if( psz_var ) free( psz_var );
-    if( ((i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING)
-        && val.psz_string ) free( val.psz_string );
+    free( psz_var );
+    if( ( i_val_type & VLC_VAR_TYPE ) == VLC_VAR_STRING )
+        free( val.psz_string );
 };
 
 void MenuItemExt::ClearList( vector<MenuItemExt*> *p_menu_list )