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
1fd91c3b
Commit
1fd91c3b
authored
May 16, 2014
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: clean-up string utility
parent
f690d54a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
modules/gui/macosx/StringUtility.h
modules/gui/macosx/StringUtility.h
+2
-5
modules/gui/macosx/StringUtility.m
modules/gui/macosx/StringUtility.m
+15
-10
No files found.
modules/gui/macosx/StringUtility.h
View file @
1fd91c3b
/*****************************************************************************
* StringUtility.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-201
2
VLC authors and VideoLAN
* Copyright (C) 2002-201
4
VLC authors and VideoLAN
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
...
...
@@ -35,10 +35,7 @@
#define B64DecNSStr(s) [[VLCStringUtility sharedInstance] b64Decode: s]
#define B64EncAndFree(s) [[VLCStringUtility sharedInstance] b64EncodeAndFree: s]
inline
NSString
*
toNSStr
(
const
char
*
str
)
{
return
str
!=
NULL
?
[
NSString
stringWithUTF8String
:
str
]
:
@""
;
}
NSString
*
toNSStr
(
const
char
*
str
);
unsigned
int
CocoaKeyToVLC
(
unichar
i_key
);
@interface
VLCStringUtility
:
NSObject
...
...
modules/gui/macosx/StringUtility.m
View file @
1fd91c3b
/*****************************************************************************
* StringUtility.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2002-201
2
VLC authors and VideoLAN
* Copyright (C) 2002-201
4
VLC authors and VideoLAN
* $Id$
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
...
...
@@ -55,24 +55,23 @@ static VLCStringUtility *_o_sharedInstance = nil;
-
(
NSString
*
)
localizedString
:(
const
char
*
)
psz
{
NSString
*
o_str
=
nil
;
NSString
*
stringObject
=
nil
;
if
(
psz
!=
NULL
)
{
o_str
=
[
NSString
stringWithCString
:
_
(
psz
)
encoding
:
NSUTF8StringEncoding
];
stringObject
=
[
NSString
stringWithCString
:
_
(
psz
)
encoding
:
NSUTF8StringEncoding
];
if
(
o_str
==
NULL
)
{
if
(
stringObject
==
NULL
)
{
msg_Err
(
VLCIntf
,
"could not translate: %s"
,
psz
);
return
(
@""
)
;
return
@""
;
}
}
else
{
return
(
@""
);
}
}
else
return
@""
;
return
(
o_str
)
;
return
stringObject
;
}
/* i_width is in pixels */
-
(
NSString
*
)
wrapString
:
(
NSString
*
)
o_in_string
toWidth
:
(
int
)
i_width
-
(
NSString
*
)
wrapString
:
(
NSString
*
)
o_in_string
toWidth
:(
int
)
i_width
{
NSMutableString
*
o_wrapped
;
NSString
*
o_out_string
;
...
...
@@ -208,6 +207,12 @@ unsigned int CocoaKeyToVLC(unichar i_key)
return
(
unsigned
int
)
i_key
;
}
/* takes a good old const c string and converts it to NSString without UTF8 loss */
NSString
*
toNSStr
(
const
char
*
str
)
{
return
str
!=
NULL
?
[
NSString
stringWithUTF8String
:
str
]
:
@""
;
}
/*
* Converts VLC key string to a prettified version, for hotkey settings.
* The returned string adapts similar how its done within the cocoa framework when setting this
...
...
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