mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 21:10:48 +00:00
Added Files:
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3427 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d1b08f9835
commit
f07575bb5f
1 changed files with 52 additions and 5 deletions
|
@ -1,12 +1,14 @@
|
||||||
/*
|
/*
|
||||||
libgnustep.m
|
Functions.m
|
||||||
|
|
||||||
Main initialization routine for the GNUstep GUI Library
|
Generic Functions for the GNUstep GUI Library.
|
||||||
|
|
||||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Author: Scott Christley <scottc@net-community.com>
|
Author: Scott Christley <scottc@net-community.com>
|
||||||
Date: 1996
|
Date: 1996
|
||||||
|
Author: Felipe A. Rodriguez <far@ix.netcom.com>
|
||||||
|
Date: December 1998
|
||||||
|
|
||||||
This file is part of the GNUstep GUI Library.
|
This file is part of the GNUstep GUI Library.
|
||||||
|
|
||||||
|
@ -27,20 +29,23 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Foundation/NSAutoreleasePool.h>
|
#include <Foundation/NSAutoreleasePool.h>
|
||||||
|
|
||||||
#include <AppKit/NSApplication.h>
|
#include <AppKit/NSApplication.h>
|
||||||
|
#include <AppKit/NSEvent.h>
|
||||||
|
|
||||||
|
|
||||||
char **NSArgv = NULL;
|
char **NSArgv = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// The main entry point for X Windows
|
// Main initialization routine for the GNUstep GUI Library Apps
|
||||||
//
|
//
|
||||||
int NSApplicationMain(int argc, const char **argv)
|
int NSApplicationMain(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
extern char** environ;
|
extern char** environ;
|
||||||
|
|
||||||
#if LIB_FOUNDATION_LIBRARY
|
#if LIB_FOUNDATION_LIBRARY
|
||||||
[NSProcessInfo initializeWithArguments:(char**)argv
|
[NSProcessInfo initializeWithArguments:(char**)argv
|
||||||
count:argc
|
count:argc
|
||||||
environment:environ];
|
environment:environ];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -54,3 +59,45 @@ int NSApplicationMain(int argc, const char **argv)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Convert an NSEvent Type to it's respective Event Mask
|
||||||
|
//
|
||||||
|
unsigned int NSEventMaskFromType(NSEventType type)
|
||||||
|
{
|
||||||
|
switch(type)
|
||||||
|
{
|
||||||
|
case NSLeftMouseDown:
|
||||||
|
return NSLeftMouseDownMask;
|
||||||
|
case NSLeftMouseUp:
|
||||||
|
return NSLeftMouseUpMask;
|
||||||
|
case NSRightMouseDown:
|
||||||
|
return NSRightMouseDownMask;
|
||||||
|
case NSRightMouseUp:
|
||||||
|
return NSRightMouseUpMask;
|
||||||
|
case NSMouseMoved:
|
||||||
|
return NSMouseMovedMask;
|
||||||
|
case NSMouseEntered:
|
||||||
|
return NSMouseEnteredMask;
|
||||||
|
case NSMouseExited:
|
||||||
|
return NSMouseExitedMask;
|
||||||
|
case NSLeftMouseDragged:
|
||||||
|
return NSLeftMouseDraggedMask;
|
||||||
|
case NSRightMouseDragged:
|
||||||
|
return NSRightMouseDraggedMask;
|
||||||
|
case NSKeyDown:
|
||||||
|
return NSKeyDownMask;
|
||||||
|
case NSKeyUp:
|
||||||
|
return NSKeyUpMask;
|
||||||
|
case NSFlagsChanged:
|
||||||
|
return NSFlagsChangedMask;
|
||||||
|
case NSPeriodic:
|
||||||
|
return NSPeriodicMask;
|
||||||
|
case NSCursorUpdate:
|
||||||
|
return NSCursorUpdateMask;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue