1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00
wine/misc/lstr.c
Alexandre Julliard cdd0923710 Release 0.6
Tue Jan  4 13:01:33 1994  David Metcalfe <david@prism.demon.co.uk>

        * [window/caret.c]
        Modified code to use system timer.

Jan 9, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)

	* [windows/win.c]
	Windows create if required new XLIB MenuBar & CaptionBar.

	* [windows/defwnd.c]
	WM_CALCSIZE Move & Resize caption, menubar & scrollbars.
	(I'm not sure it's the good place for it, but it work...)

	* [loader/resource.c]
	optimize in FindResourceByNumber, make lseek() if next type ...

	* [controls/scroll.c]
	scrollbar buttons are now using system resources bitmaps.

	* [controls/caption.c] - new file ...
	captionbar showing title, close button with SysMenu,
	and other buttons using system resources bitmaps.

	* [controls/menu.c]
	New functions: SetMenuItemBitmaps() with 'glues',
	Make new version of LoadMenu() & ParseMenu(),
	( put #define USE_POPUPMENU ).
	Implementation of MenuBar functions.
	
	* [sysres.dll]
	New bitmaps for system such OBM_CLOSE, OBM_MINIMIZE, OBM_UPARROWI.
	New SYSMENU menu, it don't work yet ! :-((

Tue Jan 11 05:27:45 1994  julliard@di.epfl.ch (Alexandre Julliard

	* [memory/atom.c]
	Fixed a bug that could cause atoms to be case-sensitive.

	* [misc/rect.c]
	Bug fix in SubtractRect().

	* [objects/clipping.c]
	Bug fix when setting the clip mask to an empty region.

	* [windows/dce.c]
	Bug fix in ReleaseDC().

	* [windows/dialog.c]
	Call AdjustWindowRectEx() before creating the dialog window.
	Added support for DS_MODALFRAME style.

	* [windows/event.c]
	Cleaned up event handling and removed old Xt stuff.
	Moved double-click handling to windows/message.c

	* [windows/focus.c]
	Bug fix: only set the X focus when the window is viewable.

	* [windows/graphics.c]
	Rewritten DrawReliefRect() to use brush instead of pen, and
	to use the system colors.

	* [windows/message.c]
	Implemented WM_NCHITTEST message sending, and non-client
	mouse messages.
	Cleaned up double-click handling, and removed the Xt code.

	* [windows/nonclient.c]  (New file)
	Implemented AdjustWindowRect().
	Implemented WM_NCCALCSIZE, WM_NCHITTEST and WM_NCPAINT handling.

	* [windows/painting.c]
	Added sending of the WM_NCPAINT message in BeginPaint().

	* [windows/sysmetrics.c] [include/sysmetrics.h]  (New files)
	Implemented system metrics.

	* [windows/win.c]
	Bug fix in setting the parent and owner in CreateWindow().
	Removed the Xt code.

	* [windows/winpos.c]
	Added sending of the WM_NCPAINT message in SetWindowPos().
	Removed the Xt code.
1994-01-12 11:12:51 +00:00

210 lines
4.5 KiB
C

static char Copyright[] = "Copyright Yngvi Sigurjonsson (yngvi@hafro.is), 1993";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <fcntl.h>
#include "prototypes.h"
#include "regfunc.h"
#include "windows.h"
/* Funny to divide them between user and kernel. */
/* KERNEL.89 */
LPSTR lstrcat(LPSTR target,LPCSTR source)
{
fprintf(stderr,"lstrcat(%s,%s)\n",target,source);
return strcat(target,source);
}
/* USER.430 */
int lstrcmp(LPCSTR str1,LPCSTR str2)
{
return strcmp(str1,str2);
}
/* USER.471 */
int lstrcmpi(LPCSTR str1,LPCSTR str2)
{
int i;
i=0;
while((toupper(str1[i])==toupper(str2[i]))&&(str1[i]!=0))
i++;
return toupper(str1[i])-toupper(str2[i]);
}
/* KERNEL.88 */
LPSTR lstrcpy(LPSTR target,LPCSTR source)
{
return strcpy(target,source);
}
/* KERNEL.353 */
LPSTR lstrcpyn(LPSTR target,LPCSTR source,int n)
{
return strncpy(target,source,n);
}
/* KERNEL.90 */
int lstrlen(LPCSTR str)
{
return strlen(str);
}
/* AnsiUpper USER.431 */
char FAR* AnsiUpper(char FAR* strOrChar)
{
/* I am not sure if the locale stuff works with toupper, but then again
I am not sure if the Linux libc locale stuffs works at all */
if((int)strOrChar<256)
return (char FAR*) toupper((int)strOrChar);
else {
int i;
for(i=0;(i<65536)&&strOrChar[i];i++)
strOrChar[i]=toupper(strOrChar[i]);
return strOrChar;
}
}
/* AnsiLower USER.432 */
char FAR* AnsiLower(char FAR* strOrChar)
{
/* I am not sure if the locale stuff works with tolower, but then again
I am not sure if the Linux libc locale stuffs works at all */
if((int)strOrChar<256)
return (char FAR*)tolower((int)strOrChar);
else {
int i;
for(i=0;(i<65536)&&strOrChar[i];i++)
strOrChar[i]=tolower(strOrChar[i]);
return strOrChar;
}
}
/* AnsiUpperBuff USER.437 */
UINT AnsiUpperBuff(LPSTR str,UINT len)
{
int i;
len=(len==0)?65536:len;
for(i=0;i<len;i++)
str[i]=toupper(str[i]);
return i;
}
/* AnsiLowerBuff USER.438 */
UINT AnsiLowerBuff(LPSTR str,UINT len)
{
int i;
len=(len==0)?65536:len;
i=0;
for(i=0;i<len;i++)
str[i]=tolower(str[i]);
return i;
}
/* AnsiNext USER.472 */
LPSTR AnsiNext(LPSTR current)
{
return (*current)?current+1:current;
}
/* AnsiPrev USER.473 */
char FAR* AnsiPrev(/*const*/ char FAR* start,char FAR* current)
{
return (current==start)?start:current-1;
}
/* IsCharAlpha USER 433 */
BOOL IsCharAlpha(char ch)
{
return isalpha(ch); /* This is probably not right for NLS */
}
/* IsCharAlphanumeric USER 434 */
BOOL IsCharAlphanumeric(char ch)
{
return (ch<'0')?0:(ch<'9');
}
/* IsCharUpper USER 435 */
BOOL IsCharUpper(char ch)
{
return isupper(ch);
}
/* IsCharUpper USER 436 */
BOOL IsCharLower(char ch)
{
return islower(ch);
}
static char Oem2Ansi[256];
static char Ansi2Oem[256];
void InitOemAnsiTranslations()
{
static int inited=0; /* should called called in some init function*/
int transfile,i;
if(inited) return;
if(transfile=open("oem2ansi.trl",O_RDONLY)){
read(transfile,Oem2Ansi,256);
close(transfile);
}
else { /* sets up passive translations if it does not find the file */
for(i=0;i<256;i++) /* Needs some fixing */
Oem2Ansi[i]=i;
}
if(transfile=open("ansi2oem.trl",O_RDONLY)){
read(transfile,Ansi2Oem,256);
close(transfile);
}
else { /* sets up passive translations if it does not find the file */
for(i=0;i<256;i++) /* Needs some fixing */
Ansi2Oem[i]=i;
}
inited=1;
}
/* AnsiToOem Keyboard.5 */
int AnsiToOem(LPSTR lpAnsiStr, LPSTR lpOemStr) /* why is this int ??? */
{
InitOemAnsiTranslations(); /* should called called in some init function*/
while(*lpAnsiStr){
*lpOemStr++=Ansi2Oem[*lpAnsiStr++];
}
return -1;
}
/* OemToAnsi Keyboard.6 */
BOOL OemToAnsi(LPSTR lpOemStr, LPSTR lpAnsiStr) /* why is this BOOL ???? */
{
InitOemAnsiTranslations(); /* should called called in some init function*/
while(*lpOemStr){
*lpAnsiStr++=Oem2Ansi[*lpOemStr++];
}
return -1;
}
/* AnsiToOemBuff Keyboard.134 */
void AnsiToOemBuff(LPSTR lpAnsiStr, LPSTR lpOemStr, int nLength)
{
int i;
InitOemAnsiTranslations(); /* should called called in some init function*/
for(i=0;i<nLength;i++)
lpOemStr[i]=Ansi2Oem[lpAnsiStr[i]];
}
/* OemToAnsi Keyboard.135 */
void OemToAnsiBuff(LPSTR lpOemStr, LPSTR lpAnsiStr, int nLength)
{
int i;
InitOemAnsiTranslations(); /* should called called in some init function*/
for(i=0;i<nLength;i++)
lpAnsiStr[i]=Oem2Ansi[lpOemStr[i]];
}