forked from KolibriOS/kolibrios
Replaced meneger with manager, corrected makefile to work on x86-64
git-svn-id: svn://kolibrios.org@1223 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
f26bbf105c
commit
1560e4ca7a
@ -1,6 +1,6 @@
|
|||||||
SRC = libGUI.c
|
SRC = libGUI.c
|
||||||
TARGET = libGUI.obj
|
TARGET = libGUI.obj
|
||||||
CFLAGS = -O2 -nostdinc -nostdlib -march=pentium -fomit-frame-pointer -fno-builtin -fno-builtin-printf
|
CFLAGS = -O2 -nostdinc -nostdlib -m32 -march=i686 -fomit-frame-pointer -fno-builtin -fno-builtin-printf
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
font meneger header structure
|
font manager header structure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define FONT_FLAG_DEFAULT_FONT_ON 0x1
|
#define FONT_FLAG_DEFAULT_FONT_ON 0x1
|
||||||
@ -33,7 +33,7 @@ static struct
|
|||||||
DWORD *fnt_bk;
|
DWORD *fnt_bk;
|
||||||
DWORD *default_font;
|
DWORD *default_font;
|
||||||
DWORD number_fonts;
|
DWORD number_fonts;
|
||||||
}FontsMeneger;
|
}FontsManager;
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
#pragma pack(push,1)
|
#pragma pack(push,1)
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
menegement of fonts
|
management of fonts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
@ -14,22 +14,22 @@ void DestroyFont(font_t *font)
|
|||||||
|
|
||||||
if (font==(font_t*)NULL) return;
|
if (font==(font_t*)NULL) return;
|
||||||
|
|
||||||
if (FontsMeneger.fnt_bk==FontsMeneger.fnt_fd)
|
if (FontsManager.fnt_bk==FontsManager.fnt_fd)
|
||||||
{
|
{
|
||||||
//parent have got alone font
|
//parent have got alone font
|
||||||
if (FontsMeneger.fnt_bk==(DWORD*)font)
|
if (FontsManager.fnt_bk==(DWORD*)font)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("\ndestroyed font %d font name=%s",(int)font,(char*)font->fnt_name);
|
printf("\ndestroyed font %d font name=%s",(int)font,(char*)font->fnt_name);
|
||||||
#endif
|
#endif
|
||||||
free(font);
|
free(font);
|
||||||
FontsMeneger.fnt_bk=(DWORD*)NULL;
|
FontsManager.fnt_bk=(DWORD*)NULL;
|
||||||
FontsMeneger.fnt_fd=(DWORD*)NULL;
|
FontsManager.fnt_fd=(DWORD*)NULL;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
seek_font=(font_t*)FontsMeneger.fnt_bk;
|
seek_font=(font_t*)FontsManager.fnt_bk;
|
||||||
while(seek_font!=(font_t*)NULL)
|
while(seek_font!=(font_t*)NULL)
|
||||||
{
|
{
|
||||||
if (seek_font==font)
|
if (seek_font==font)
|
||||||
@ -47,12 +47,12 @@ void DestroyFont(font_t *font)
|
|||||||
{
|
{
|
||||||
if (last_font==(font_t*)NULL)
|
if (last_font==(font_t*)NULL)
|
||||||
{//deliting font is first font of Parend
|
{//deliting font is first font of Parend
|
||||||
FontsMeneger.fnt_bk=(DWORD*)next_font;
|
FontsManager.fnt_bk=(DWORD*)next_font;
|
||||||
next_font->fnt_bk=(DWORD*)NULL;
|
next_font->fnt_bk=(DWORD*)NULL;
|
||||||
if (next_font->fnt_fd==(DWORD*)NULL)
|
if (next_font->fnt_fd==(DWORD*)NULL)
|
||||||
{
|
{
|
||||||
FontsMeneger.fnt_fd=(DWORD*)next_font;
|
FontsManager.fnt_fd=(DWORD*)next_font;
|
||||||
FontsMeneger.fnt_bk=(DWORD*)next_font;
|
FontsManager.fnt_bk=(DWORD*)next_font;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ void DestroyFont(font_t *font)
|
|||||||
{
|
{
|
||||||
//there isn't next fonts
|
//there isn't next fonts
|
||||||
last_font->fnt_fd=(DWORD*)NULL;
|
last_font->fnt_fd=(DWORD*)NULL;
|
||||||
FontsMeneger.fnt_fd=(DWORD*)last_font;
|
FontsManager.fnt_fd=(DWORD*)last_font;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -81,17 +81,17 @@ void *CreateFont(void)
|
|||||||
|
|
||||||
font=malloc(sizeof(struct FONT));
|
font=malloc(sizeof(struct FONT));
|
||||||
|
|
||||||
if (FontsMeneger.fnt_bk==(DWORD*)NULL)
|
if (FontsManager.fnt_bk==(DWORD*)NULL)
|
||||||
{//not yet fonts
|
{//not yet fonts
|
||||||
FontsMeneger.fnt_bk=(DWORD*)font;
|
FontsManager.fnt_bk=(DWORD*)font;
|
||||||
FontsMeneger.fnt_fd=(DWORD*)font;
|
FontsManager.fnt_fd=(DWORD*)font;
|
||||||
font->fnt_bk=(DWORD*)NULL;
|
font->fnt_bk=(DWORD*)NULL;
|
||||||
font->fnt_fd=(DWORD*)NULL;
|
font->fnt_fd=(DWORD*)NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
backward_font=(font_t*)FontsMeneger.fnt_fd;
|
backward_font=(font_t*)FontsManager.fnt_fd;
|
||||||
FontsMeneger.fnt_fd=(DWORD*)font;
|
FontsManager.fnt_fd=(DWORD*)font;
|
||||||
backward_font->fnt_fd=(DWORD*)font;
|
backward_font->fnt_fd=(DWORD*)font;
|
||||||
font->fnt_bk=(DWORD*)backward_font;
|
font->fnt_bk=(DWORD*)backward_font;
|
||||||
font->fnt_fd=(DWORD*)NULL;
|
font->fnt_fd=(DWORD*)NULL;
|
||||||
@ -360,13 +360,13 @@ font_t *LoadFont(char *fullfontname)
|
|||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
FontsMeneger.number_fonts++;
|
FontsManager.number_fonts++;
|
||||||
return(font);
|
return(font);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FreeFont(font_t *font)
|
void FreeFont(font_t *font)
|
||||||
{
|
{
|
||||||
if (font==(font_t*)FontsMeneger.default_font) return;
|
if (font==(font_t*)FontsManager.default_font) return;
|
||||||
|
|
||||||
free(font->font);
|
free(font->font);
|
||||||
DestroyFont(font);
|
DestroyFont(font);
|
@ -1574,14 +1574,14 @@ char InitLibGUI()
|
|||||||
//set scan codes input mode for keyboard
|
//set scan codes input mode for keyboard
|
||||||
gui_ksys_set_keyboard_input_mode(1);
|
gui_ksys_set_keyboard_input_mode(1);
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
FontsMeneger.fnt_fd=(DWORD*)NULL;
|
FontsManager.fnt_fd=(DWORD*)NULL;
|
||||||
FontsMeneger.fnt_bk=(DWORD*)NULL;
|
FontsManager.fnt_bk=(DWORD*)NULL;
|
||||||
FontsMeneger.number_fonts=0;
|
FontsManager.number_fonts=0;
|
||||||
//load default fonts
|
//load default fonts
|
||||||
font=LoadFont("CHAR.MT");
|
font=LoadFont("CHAR.MT");
|
||||||
|
|
||||||
if (font==NULL) return (TRUE);
|
if (font==NULL) return (TRUE);
|
||||||
else FontsMeneger.default_font=(DWORD*)font;
|
else FontsManager.default_font=(DWORD*)font;
|
||||||
|
|
||||||
font->flags=font->flags | FONT_FLAG_DEFAULT_FONT_ON;
|
font->flags=font->flags | FONT_FLAG_DEFAULT_FONT_ON;
|
||||||
|
|
||||||
@ -1634,7 +1634,7 @@ void QuitLibGUI(parent_t *window)
|
|||||||
#endif
|
#endif
|
||||||
//destroy fonts cash
|
//destroy fonts cash
|
||||||
|
|
||||||
seek_font=(font_t*)FontsMeneger.fnt_bk;
|
seek_font=(font_t*)FontsManager.fnt_bk;
|
||||||
while(seek_font!=(font_t*)NULL)
|
while(seek_font!=(font_t*)NULL)
|
||||||
{
|
{
|
||||||
exchange_font=(font_t*)seek_font->fnt_fd;
|
exchange_font=(font_t*)seek_font->fnt_fd;
|
Loading…
Reference in New Issue
Block a user