Estimados
1.-
Tengo es siguiento código, el cual nos da la informacion del display.
Me gustaria saber como puedo integarlo en un prg y compilarlo desde harbour
(La idea con esto es aprender hacer una función que me regrese la resolucion de la pantalla, para poder cubrirla completa con un window, lógico este ejemplo es diferente )
/*
DisplayID.m
Author: Robert Harder, rob@iHarder.net
with help from http://stackoverflow.com/questions/1236 ... n-mac-os-x
Returns a list of display names and display IDs.
Add the flag -v for more information on the screens.
Compile from the command line:
cc DisplayID.m -o DisplayID \
-framework AppKit -framework Foundation -framework IOKit \
-arch x86_64 -arch i386 -arch ppc7400
Examples:
$ DisplayID
Color LCD : 69675202
$ DisplayID -v
Color LCD : 69675202
{
NSDeviceBitsPerSample = 8;
NSDeviceColorSpaceName = NSCalibratedRGBColorSpace;
NSDeviceIsScreen = YES;
NSDeviceResolution = "NSSize: {72, 72}";
NSDeviceSize = "NSSize: {1440, 900}";
NSScreenNumber = 69675202;
}
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import <IOKit/graphics/IOGraphicsLib.h>
#define str_eq(s1,s2) (!strcmp ((s1),(s2)))
NSString* screenNameForDisplay(CGDirectDisplayID displayID )
{
NSString *screenName = nil;
NSDictionary *deviceInfo = (NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID), kIODisplayOnlyPreferredName);
NSDictionary *localizedNames = [deviceInfo objectForKey:[NSString stringWithUTF8String:kDisplayProductName]];
if ([localizedNames count] > 0) {
screenName = [[localizedNames objectForKey:[[localizedNames allKeys] objectAtIndex:0]] retain];
}
[deviceInfo release];
return [screenName autorelease];
}
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
BOOL verbose = NO;
BOOL extraVerbose = NO;
if( argc >= 2 ){
if( str_eq( "-v",argv[1]) ){
verbose = YES;
} else if( str_eq( "-vv", argv[1] ) ){
verbose = YES;
extraVerbose = YES;
} else {
printf("USAGE: %s [-v[v]]\n", argv[0]);
printf("Prints a list of names and numeric IDs for attached displays.\n");
printf(" -v Verbose mode. Prints more information about each display.\n");
printf(" -vv Extra verbose. Prints even more information.\n");
return argc;
}
}
NSArray *screenArray = [NSScreen screens];
for( NSScreen *screen in screenArray ){
NSDictionary *screenDescription = [screen deviceDescription];
NSNumber *displayID = [screenDescription objectForKey:@"NSScreenNumber"];
NSString *displayName =screenNameForDisplay([displayID intValue]);
printf( "%s : %d\n", [displayName UTF8String], [displayID intValue]);
if( verbose ){
printf( "%s\n", [[screenDescription description] UTF8String] );
}
if( extraVerbose ){
NSDictionary *deviceInfo = (NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort([displayID intValue]), kIODisplayOnlyPreferredName);
printf( "%s\n", [[deviceInfo description] UTF8String] );
}
} // end for:
[pool drain];
return 0;
}
2.- Estoy tratando de copiar unos archivos de una computadora a otra, pero, segun yo estan correctos los path
aun asi, segun file() no exiten
Estos son mis path
LOCAL server_dir := "//Xserve/Shared/sucursales/ventas/"
LOCAL local_dir:= "/Users/shared/sucursales/ventas/"
en el server_dir, segurito que existe, tengo varios dbf los cuales voy a copiar, al local_dir,
Pero, la funcion file(), no encuentra los archivos
Existe algo que deba cambiar ?
3.- Cuando uso el commando "close all", el compilador o mas bien dicho gcc, me envia el sig msg
duplicate symbol _HB_FUN_SAVESCREEN in:
./../lib/libfivec.a(funcs.o)
./../../harbour/lib/libhbrtl.a(saverest.o)
ld: 1 duplicate symbol for architecture x86_64
collect2: ld returned 1 exit status
done!
./build.sh: line 71: ./copia.app/Contents/MacOS/copia: No such file or directory
macmini:samples server$
Pero si pongo solo "close", no tengo ningún problema, es correcto ?
Gracias de antemano
Saludos
Osvaldo Ramirez
Compilando con gcc y otros
-
- Posts: 49
- Joined: Mon Jan 19, 2009 4:40 pm
Return to “FiveMac / FivePhone (iPhone, iPad)”
Jump to
- English Forums
- ↳ FiveWin for CA-Clipper
- ↳ FiveWin for Harbour/xHarbour
- ↳ FiveTouch
- ↳ EasyReport, EasyDialog and EasyPreview
- ↳ FiveMac / FivePhone (iPhone, iPad)
- ↳ FiveLinux / FiveDroid (Android)
- ↳ FiveWin for Pocket PC
- ↳ mod_harbour
- Foros en Español
- ↳ FiveWin para CA-Clipper
- ↳ FiveWin para Harbour/xHarbour
- ↳ FiveTouch
- ↳ EasyReport, EasyDialog y EasyPreview
- ↳ FiveMac / FivePhone (iPhone, iPad)
- ↳ FiveLinux / FiveDroid (Android)
- ↳ FiveWin para Pocket PC
- ↳ mod_harbour
- Forum italiani
- ↳ All products support
- Forum Portuguese
- ↳ All products support
- Forum German
- ↳ All products support
- General
- ↳ WhatsNew / Novedades
- ↳ Bugs report & fixes / Informe de errores y arreglos
- ↳ To do - WishList / Por hacer - Peticiones
- ↳ Utilities / Utilidades
- ↳ Off Topic / Otros temas
- Artificial Intelligence
- ↳ TensorFlow and Python examples
- ↳ TensorFlow.dll for Harbour and FWH
- ↳ latest AI news
- ↳ Building TensorFlow.dll
- ↳ AI Introduction (Harbour code and samples)