Commit 06da9937 authored by Felix Paul Kühne's avatar Felix Paul Kühne

minimal_macosx: modernize coding style and remove useless includes

parent ba45dbbf
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
/***************************************************************************** /*****************************************************************************
* Preamble * Preamble
*****************************************************************************/ *****************************************************************************/
#include "intf.h" #import "intf.h"
#include "VLCMinimalVoutWindow.h" #import "VLCMinimalVoutWindow.h"
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
......
...@@ -25,17 +25,12 @@ ...@@ -25,17 +25,12 @@
*****************************************************************************/ *****************************************************************************/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # import "config.h"
#endif #endif
#include <vlc_common.h> #import <Cocoa/Cocoa.h>
#include <vlc_interface.h> #import <vlc_common.h>
#include <vlc_playlist.h> #import <vlc_interface.h>
#include <vlc_vout.h>
#include <vlc_aout.h>
#include <vlc_input.h>
#include <Cocoa/Cocoa.h>
/***************************************************************************** /*****************************************************************************
* Local prototypes. * Local prototypes.
......
...@@ -27,44 +27,36 @@ ...@@ -27,44 +27,36 @@
/***************************************************************************** /*****************************************************************************
* Preamble * Preamble
*****************************************************************************/ *****************************************************************************/
#include <stdlib.h> /* malloc(), free() */ #import <stdlib.h> /* malloc(), free() */
#include <sys/param.h> /* for MAXPATHLEN */ #import <sys/param.h> /* for MAXPATHLEN */
#include <string.h> #import <string.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # import "config.h"
#endif #endif
#include <vlc_common.h> #import <vlc_playlist.h>
#import <vlc_vout_window.h>
#include <vlc_keys.h> #import "intf.h"
#include <vlc_input.h>
#import <vlc_interface.h>
#include <vlc_vout_window.h>
#import <intf.h>
#import "VLCMinimalVoutWindow.h" #import "VLCMinimalVoutWindow.h"
/***************************************************************************** /*****************************************************************************
* Local prototypes. * Local prototypes.
*****************************************************************************/ *****************************************************************************/
static void Run ( intf_thread_t *p_intf ); static void Run (intf_thread_t *p_intf);
/***************************************************************************** /*****************************************************************************
* OpenIntf: initialize interface * OpenIntf: initialize interface
*****************************************************************************/ *****************************************************************************/
int OpenIntf ( vlc_object_t *p_this ) int OpenIntf (vlc_object_t *p_this)
{ {
intf_thread_t *p_intf = (intf_thread_t*) p_this; intf_thread_t *p_intf = (intf_thread_t*) p_this;
p_intf->p_sys = malloc( sizeof( intf_sys_t ) ); p_intf->p_sys = malloc(sizeof(intf_sys_t));
if( p_intf->p_sys == NULL ) if (p_intf->p_sys == NULL)
{
return VLC_ENOMEM; return VLC_ENOMEM;
}
memset( p_intf->p_sys, 0, sizeof( *p_intf->p_sys ) ); memset(p_intf->p_sys, 0, sizeof(*p_intf->p_sys));
Run(p_intf); Run(p_intf);
...@@ -74,11 +66,11 @@ int OpenIntf ( vlc_object_t *p_this ) ...@@ -74,11 +66,11 @@ int OpenIntf ( vlc_object_t *p_this )
/***************************************************************************** /*****************************************************************************
* CloseIntf: destroy interface * CloseIntf: destroy interface
*****************************************************************************/ *****************************************************************************/
void CloseIntf ( vlc_object_t *p_this ) void CloseIntf (vlc_object_t *p_this)
{ {
intf_thread_t *p_intf = (intf_thread_t*) p_this; intf_thread_t *p_intf = (intf_thread_t*) p_this;
free( p_intf->p_sys ); free(p_intf->p_sys);
} }
/* Dock Connection */ /* Dock Connection */
...@@ -88,29 +80,29 @@ typedef struct CPSProcessSerNum ...@@ -88,29 +80,29 @@ typedef struct CPSProcessSerNum
UInt32 hi; UInt32 hi;
} CPSProcessSerNum; } CPSProcessSerNum;
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); extern OSErr CPSGetCurrentProcess(CPSProcessSerNum *psn);
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); extern OSErr CPSEnableForegroundOperation(CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); extern OSErr CPSSetFrontProcess(CPSProcessSerNum *psn);
/***************************************************************************** /*****************************************************************************
* KillerThread: Thread that kill the application * KillerThread: Thread that kill the application
*****************************************************************************/ *****************************************************************************/
static void * KillerThread( void *user_data ) static void * KillerThread(void *user_data)
{ {
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
intf_thread_t *p_intf = user_data; intf_thread_t *p_intf = user_data;
vlc_mutex_init( &p_intf->p_sys->lock ); vlc_mutex_init(&p_intf->p_sys->lock);
vlc_cond_init( &p_intf->p_sys->wait ); vlc_cond_init(&p_intf->p_sys->wait);
vlc_mutex_lock ( &p_intf->p_sys->lock ); vlc_mutex_lock (&p_intf->p_sys->lock);
while( vlc_object_alive( p_intf ) ) while(vlc_object_alive(p_intf))
vlc_cond_wait( &p_intf->p_sys->wait, &p_intf->p_sys->lock ); vlc_cond_wait(&p_intf->p_sys->wait, &p_intf->p_sys->lock);
vlc_mutex_unlock( &p_intf->p_sys->lock ); vlc_mutex_unlock(&p_intf->p_sys->lock);
vlc_mutex_destroy( &p_intf->p_sys->lock ); vlc_mutex_destroy(&p_intf->p_sys->lock);
vlc_cond_destroy( &p_intf->p_sys->wait ); vlc_cond_destroy(&p_intf->p_sys->wait);
/* We are dead, terminate */ /* We are dead, terminate */
[NSApp terminate: nil]; [NSApp terminate: nil];
...@@ -121,7 +113,7 @@ static void * KillerThread( void *user_data ) ...@@ -121,7 +113,7 @@ static void * KillerThread( void *user_data )
/***************************************************************************** /*****************************************************************************
* Run: main loop * Run: main loop
*****************************************************************************/ *****************************************************************************/
static void Run( intf_thread_t *p_intf ) static void Run(intf_thread_t *p_intf)
{ {
sigset_t set; sigset_t set;
...@@ -129,13 +121,13 @@ static void Run( intf_thread_t *p_intf ) ...@@ -129,13 +121,13 @@ static void Run( intf_thread_t *p_intf )
* VLC overrides SIGTERM which is sent by the "force quit" * VLC overrides SIGTERM which is sent by the "force quit"
* menu item to make sure deamon mode quits gracefully, so * menu item to make sure deamon mode quits gracefully, so
* we un-override SIGTERM here. */ * we un-override SIGTERM here. */
sigemptyset( &set ); sigemptyset(&set);
sigaddset( &set, SIGTERM ); sigaddset(&set, SIGTERM);
pthread_sigmask( SIG_UNBLOCK, &set, NULL ); pthread_sigmask(SIG_UNBLOCK, &set, NULL);
/* Setup a thread that will monitor the module killing */ /* Setup a thread that will monitor the module killing */
pthread_t killer_thread; pthread_t killer_thread;
pthread_create( &killer_thread, NULL, KillerThread, p_intf ); pthread_create(&killer_thread, NULL, KillerThread, p_intf);
CPSProcessSerNum PSN; CPSProcessSerNum PSN;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
...@@ -146,7 +138,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -146,7 +138,7 @@ static void Run( intf_thread_t *p_intf )
[NSApplication sharedApplication]; [NSApplication sharedApplication];
[NSApp run]; [NSApp run];
pthread_join( killer_thread, NULL ); pthread_join(killer_thread, NULL);
[pool release]; [pool release];
} }
...@@ -192,7 +184,7 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args) ...@@ -192,7 +184,7 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
return VLC_EGENERIC; return VLC_EGENERIC;
} }
switch(i_query) { switch (i_query) {
case VOUT_WINDOW_SET_STATE: case VOUT_WINDOW_SET_STATE:
{ {
unsigned i_state = va_arg(args, unsigned); unsigned i_state = va_arg(args, unsigned);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment