Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
22495438
Commit
22495438
authored
May 30, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: prepare drag & drop support for the Convert and Save panel
parent
823af4bc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
0 deletions
+73
-0
modules/gui/macosx/ConvertAndSave.h
modules/gui/macosx/ConvertAndSave.h
+10
-0
modules/gui/macosx/ConvertAndSave.m
modules/gui/macosx/ConvertAndSave.m
+63
-0
No files found.
modules/gui/macosx/ConvertAndSave.h
View file @
22495438
...
@@ -46,7 +46,11 @@
...
@@ -46,7 +46,11 @@
IBOutlet
id
o_dropin_view
;
IBOutlet
id
o_dropin_view
;
IBOutlet
id
o_dropin_icon_view
;
IBOutlet
id
o_dropin_icon_view
;
IBOutlet
id
o_dropin_media_lbl
;
IBOutlet
id
o_dropin_media_lbl
;
NSString
*
MRL
;
}
}
@property
(
readwrite
,
nonatomic
,
retain
)
NSString
*
MRL
;
+
(
VLCConvertAndSave
*
)
sharedInstance
;
+
(
VLCConvertAndSave
*
)
sharedInstance
;
-
(
IBAction
)
toggleWindow
;
-
(
IBAction
)
toggleWindow
;
...
@@ -57,4 +61,10 @@
...
@@ -57,4 +61,10 @@
-
(
IBAction
)
customizeProfile
:(
id
)
sender
;
-
(
IBAction
)
customizeProfile
:(
id
)
sender
;
-
(
IBAction
)
chooseDestination
:(
id
)
sender
;
-
(
IBAction
)
chooseDestination
:(
id
)
sender
;
-
(
void
)
updateDropView
;
@end
@interface
VLCDropEnabledBox
:
NSBox
@end
@end
modules/gui/macosx/ConvertAndSave.m
View file @
22495438
...
@@ -22,8 +22,13 @@
...
@@ -22,8 +22,13 @@
*****************************************************************************/
*****************************************************************************/
#import "ConvertAndSave.h"
#import "ConvertAndSave.h"
#import <vlc_common.h>
#import <vlc_url.h>
@implementation
VLCConvertAndSave
@implementation
VLCConvertAndSave
@synthesize
MRL
;
static
VLCConvertAndSave
*
_o_sharedInstance
=
nil
;
static
VLCConvertAndSave
*
_o_sharedInstance
=
nil
;
+
(
VLCConvertAndSave
*
)
sharedInstance
+
(
VLCConvertAndSave
*
)
sharedInstance
...
@@ -72,4 +77,62 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
...
@@ -72,4 +77,62 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
{
{
}
}
-
(
void
)
updateDropView
{
}
@end
@implementation
VLCDropEnabledBox
-
(
void
)
awakeFromNib
{
[
self
registerForDraggedTypes
:[
NSArray
arrayWithObject
:
NSFilenamesPboardType
]];
}
-
(
NSDragOperation
)
draggingEntered
:(
id
<
NSDraggingInfo
>
)
sender
{
if
((
NSDragOperationGeneric
&
[
sender
draggingSourceOperationMask
])
==
NSDragOperationGeneric
)
return
NSDragOperationGeneric
;
return
NSDragOperationNone
;
}
-
(
BOOL
)
prepareForDragOperation
:(
id
<
NSDraggingInfo
>
)
sender
{
return
YES
;
}
-
(
BOOL
)
performDragOperation
:(
id
<
NSDraggingInfo
>
)
sender
{
NSPasteboard
*
o_paste
=
[
sender
draggingPasteboard
];
NSArray
*
o_types
=
[
NSArray
arrayWithObject
:
NSFilenamesPboardType
];
NSString
*
o_desired_type
=
[
o_paste
availableTypeFromArray
:
o_types
];
NSData
*
o_carried_data
=
[
o_paste
dataForType
:
o_desired_type
];
if
(
o_carried_data
)
{
if
(
[
o_desired_type
isEqualToString
:
NSFilenamesPboardType
]
)
{
NSArray
*
o_values
=
[[
o_paste
propertyListForType
:
NSFilenamesPboardType
]
sortedArrayUsingSelector
:
@selector
(
caseInsensitiveCompare
:)];
if
([
o_values
count
]
>
0
)
{
id
VLCCAS
=
[
VLCConvertAndSave
sharedInstance
];
[
VLCCAS
setMRL
:
[
NSString
stringWithUTF8String
:
make_URI
([[
o_values
objectAtIndex
:
0
]
UTF8String
],
NULL
)]];
[
VLCCAS
updateDropView
];
return
YES
;
}
}
}
return
NO
;
}
-
(
void
)
concludeDragOperation
:(
id
<
NSDraggingInfo
>
)
sender
{
[
self
setNeedsDisplay
:
YES
];
}
@end
@end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment