From ae157fbfeee8da7b5a9b914f106705de7ca7863c Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Sun, 23 May 2004 21:14:34 +0000 Subject: [PATCH 1/1] * Remove the old info window from SVN. * Cosmetic fix to misc.m --- modules/gui/macosx/info.h | 41 ---------- modules/gui/macosx/info.m | 167 -------------------------------------- modules/gui/macosx/intf.m | 1 - modules/gui/macosx/misc.m | 5 +- 4 files changed, 3 insertions(+), 211 deletions(-) delete mode 100644 modules/gui/macosx/info.h delete mode 100644 modules/gui/macosx/info.m diff --git a/modules/gui/macosx/info.h b/modules/gui/macosx/info.h deleted file mode 100644 index 07cb791898..0000000000 --- a/modules/gui/macosx/info.h +++ /dev/null @@ -1,41 +0,0 @@ -/***************************************************************************** - * info.h: MacOS X info panel - ***************************************************************************** - * Copyright (C) 2003 VideoLAN - * $Id$ - * - * Authors: Derk-Jan Hartman - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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. - *****************************************************************************/ - -/***************************************************************************** - * VLCInfo interface - *****************************************************************************/ -@interface VLCInfo : NSObject -{ - IBOutlet id o_window; - IBOutlet id o_view; - IBOutlet id o_selector; - - NSMutableDictionary * o_strings; -} - -- (void)updateInfo; -- (IBAction)toggleInfoPanel:(id)sender; -- (IBAction)showCategory:(id)sender; -- (void)createInfoView:(info_category_t *)p_category; - -@end diff --git a/modules/gui/macosx/info.m b/modules/gui/macosx/info.m deleted file mode 100644 index 9fcb624153..0000000000 --- a/modules/gui/macosx/info.m +++ /dev/null @@ -1,167 +0,0 @@ -/***************************************************************************** - * info.m: MacOS X info panel - ***************************************************************************** - * Copyright (C) 2003 VideoLAN - * $Id$ - * - * Authors: Derk-Jan Hartman - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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. - *****************************************************************************/ - -#include "intf.h" -#include "info.h" - -/***************************************************************************** - * VLCInfo implementation - *****************************************************************************/ -@implementation VLCInfo - -- (void)awakeFromNib -{ - [o_window setExcludedFromWindowsMenu: YES]; -} - -- (id)init -{ - self = [super init]; - - if( self != nil ) - { - o_strings = [[NSMutableDictionary alloc] init]; - } - - return( self ); -} - -- (void)dealloc -{ - [o_strings release]; - [super dealloc]; -} - -- (IBAction)toggleInfoPanel:(id)sender -{ - if( [o_window isVisible] ) - { - [o_window orderOut: sender]; - } - else - { - [o_window orderFront: sender]; - [self updateInfo]; - } -} - -- (IBAction)showCategory:(id)sender -{ - NSString * o_title = [o_selector titleOfSelectedItem]; - [o_view setString: [o_strings objectForKey: o_title]]; - [o_view setNeedsDisplay: YES]; -} - -- (void)updateInfo -{ - NSString *o_selectedPane; - int i, i_select; - - if( ![o_window isVisible] ) - { - return; - } - - o_selectedPane = [[o_selector selectedItem] title]; - - intf_thread_t * p_intf = [NSApp getIntf]; - input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, - FIND_ANYWHERE ); - - if ( p_input == NULL ) - { - return; - } - - [o_strings removeAllObjects]; - [o_selector removeAllItems]; - - vlc_mutex_lock( &p_input->p_item->lock ); - for( i = 0; i < p_input->p_item->i_categories; i++ ) - { - info_category_t *p_cat = p_input->p_item->pp_categories[i]; - - [self createInfoView: p_cat]; - } - vlc_mutex_unlock( &p_input->p_item->lock ); - vlc_object_release( p_input ); - - i_select = [o_selector indexOfItemWithTitle:o_selectedPane]; - if ( i_select < 0 ) - { - i_select = 0; - } - [o_selector selectItemAtIndex: i_select ]; - [self showCategory: o_selector]; -} - -- (void)createInfoView:(info_category_t *)p_cat -{ - NSString * o_title; - NSMutableString * o_content; - info_t * p_info; - int i; - - /* Add a category */ - o_title = [NSString stringWithUTF8String: p_cat->psz_name]; - [o_selector addItemWithTitle: o_title]; - - /* Create empty content string */ - o_content = [NSMutableString string]; - - /* Add the fields */ - for( i= 0; i < p_cat->i_infos; i++ ) - { - p_info = p_cat->pp_infos[i]; - [o_content appendFormat: @"%@: %@\n\n", [NSApp localizedString: p_info->psz_name], - [NSApp localizedString: p_info->psz_value]]; - } - - [o_strings setObject: o_content forKey: o_title]; -} - -@end - -@implementation VLCInfo (NSMenuValidation) - -- (BOOL)validateMenuItem:(NSMenuItem *)o_mi -{ - BOOL bEnabled = TRUE; - - intf_thread_t * p_intf = [NSApp getIntf]; - input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT, - FIND_ANYWHERE ); - - if( [[o_mi title] isEqualToString: _NS("Info")] ) - { - if( p_input == NULL ) - { - bEnabled = FALSE; - } - } - if( p_input ) vlc_object_release( p_input ); - - return( bEnabled ); -} - -@end diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 82ea18ec3d..4a692321ac 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -35,7 +35,6 @@ #include "vout.h" #include "prefs.h" #include "playlist.h" -#include "info.h" #include "controls.h" /***************************************************************************** diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m index 3c265fce07..276370d6fc 100644 --- a/modules/gui/macosx/misc.m +++ b/modules/gui/macosx/misc.m @@ -1,7 +1,7 @@ /***************************************************************************** * misc.m: code not specific to vlc ***************************************************************************** - * Copyright (C) 2003 VideoLAN + * Copyright (C) 2003-2004 VideoLAN * $Id$ * * Authors: Jon Lech Johansen @@ -266,4 +266,5 @@ void _drawFrameInRect(NSRect frameRect) _drawKnobInRect(knobRect); } -@end \ No newline at end of file +@end + -- 2.39.5