-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathicc_helfer_osx.cpp
96 lines (86 loc) · 2.83 KB
/
icc_helfer_osx.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* ICC Examin ist eine ICC Profil Betrachter
*
* Copyright (C) 2005 Kai-Uwe Behrmann
*
* Autor: Kai-Uwe Behrmann <[email protected]>
*
* 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-1307, USA.
*
* -----------------------------------------------------------------------------
*
* preparation of osX internal informations - toolkitdependent
*
*/
// Date: 14. 01. 2005
#include "icc_utils.h"
#include "icc_icc.h"
#include "icc_helfer.h"
//#include "icc_examin.h"
#include "icc_helfer_x.h"
#if defined(__APPLE__)
# include <Carbon/Carbon.h>
# ifdef HAVE_FLTK
//#include <FL/osx.H>
# endif
#endif
ICClist<ICClist<double> >
leseGrafikKartenGamma (std::string display_name,
ICClist<std::string> &texte,
int x, int y )
{ DBG_PROG_START
ICClist<ICClist<double> > kurven;
# if defined(__APPLE__)
# endif
DBG_PROG_ENDE
return kurven;
}
namespace icc_examin_ns {
std::string
holeBundleResource(const char* dateiname, const char* ende)
{
std::string adresse, suchen = "%20", ersetzen = " ";
// osX Resourcen
CFBundleRef mainBundle;
// Get the main bundle for the app
mainBundle = CFBundleGetMainBundle();
CFURLRef fontURL;
// Look for a resource in the main bundle by name and type.
if(mainBundle) {
CFStringRef d, e;
d = CFStringCreateWithCString(NULL, dateiname,kCFStringEncodingISOLatin1);
e = CFStringCreateWithCString(NULL, ende,kCFStringEncodingISOLatin1);
fontURL = CFBundleCopyResourceURL( mainBundle, d, e, NULL );
CFRelease(d); CFRelease(e);
CFStringRef cfstring;
if(fontURL) {
cfstring = CFURLCopyPath(fontURL);
// copy to a C buffer
CFIndex gr = 1024;
char *text = (char*)malloc (CFStringGetLength(cfstring));
text[0] = 0;
CFStringGetCString( cfstring, text, gr, kCFStringEncodingISOLatin1 );
adresse = text;
if(adresse.size()) {
icc_parser::suchenErsetzen(adresse, suchen, ersetzen, 0);
}
DBG_PROG_S( adresse )
CFRelease(cfstring);
if(text) free (text);
} else { WARN_S( "For "<<dateiname<<"|"<<ende<<" no adress found" ) }
}
return adresse;
}
}