mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Added memory leak detection for MSVC.
This commit is contained in:
parent
a948015cf5
commit
5b543a995b
@ -46,6 +46,11 @@ else
|
|||||||
LIBS += Alleg.lib
|
LIBS += Alleg.lib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef MEMLEAK
|
||||||
|
CFLAGS += -DMEMLEAK
|
||||||
|
LIBS += dbghelp.lib
|
||||||
|
endif
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# General rules
|
# General rules
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro/keyboard.h>
|
#include <allegro/keyboard.h>
|
||||||
#include <allegro/unicode.h>
|
#include <allegro/unicode.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -53,6 +53,8 @@
|
|||||||
`-----~---------~-------------~-----------'
|
`-----~---------~-------------~-----------'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <allegro/unicode.h>
|
#include <allegro/unicode.h>
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
/* Based on code from GTK+ 2.1.2 (gtk+/gtk/gtkhbox.c) */
|
/* Based on code from GTK+ 2.1.2 (gtk+/gtk/gtkhbox.c) */
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "jinete/jlist.h"
|
#include "jinete/jlist.h"
|
||||||
#include "jinete/jmessage.h"
|
#include "jinete/jmessage.h"
|
||||||
#include "jinete/jrect.h"
|
#include "jinete/jrect.h"
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro/gfx.h>
|
#include <allegro/gfx.h>
|
||||||
#include <allegro/keyboard.h>
|
#include <allegro/keyboard.h>
|
||||||
#include <allegro/timer.h>
|
#include <allegro/timer.h>
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "jinete/jbase.h"
|
#include "jinete/jbase.h"
|
||||||
|
|
||||||
static char *clipboard_text = NULL;
|
static char *clipboard_text = NULL;
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
|
|
||||||
#include "jinete/jinete.h"
|
#include "jinete/jinete.h"
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#include <allegro/internal/aintern.h>
|
#include <allegro/internal/aintern.h>
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#include <allegro/internal/aintern.h>
|
#include <allegro/internal/aintern.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#include <allegro/internal/aintern.h>
|
#include <allegro/internal/aintern.h>
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
/* Based on code of AllegroFont, Copyright (c) 2001, 2002 Javier Gonzalez */
|
/* Based on code of AllegroFont, Copyright (c) 2001, 2002 Javier Gonzalez */
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#include <allegro/internal/aintern.h>
|
#include <allegro/internal/aintern.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
allegro/tools/plugins/datfont.c
|
allegro/tools/plugins/datfont.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#include <allegro/internal/aintern.h>
|
#include <allegro/internal/aintern.h>
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "jinete/jhook.h"
|
#include "jinete/jhook.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro/draw.h>
|
#include <allegro/draw.h>
|
||||||
#include <allegro/gfx.h>
|
#include <allegro/gfx.h>
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "jinete/jmessage.h"
|
#include "jinete/jmessage.h"
|
||||||
#include "jinete/jtheme.h"
|
#include "jinete/jtheme.h"
|
||||||
#include "jinete/jwidget.h"
|
#include "jinete/jwidget.h"
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
/* #define USE_JUNKLIST */
|
/* #define USE_JUNKLIST */
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "jinete/jlist.h"
|
#include "jinete/jlist.h"
|
||||||
|
|
||||||
#ifdef USE_JUNKLIST /* TODO warning not thread safe */
|
#ifdef USE_JUNKLIST /* TODO warning not thread safe */
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro/keyboard.h>
|
#include <allegro/keyboard.h>
|
||||||
|
|
||||||
#include "jinete/jlist.h"
|
#include "jinete/jlist.h"
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
/* #define REPORT_EVENTS */
|
/* #define REPORT_EVENTS */
|
||||||
/* #define LIMIT_DISPATCH_TIME */
|
/* #define LIMIT_DISPATCH_TIME */
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef REPORT_EVENTS
|
#ifdef REPORT_EVENTS
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -76,44 +78,130 @@ char *jstrdup(const char *string)
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**********************************************************************/
|
//////////////////////////////////////////////////////////////////////
|
||||||
/* with leak detection */
|
// With leak detection
|
||||||
/**********************************************************************/
|
|
||||||
|
#define BACKTRACE_LEVELS 16
|
||||||
|
|
||||||
|
#if defined _MSC_VER
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <dbghelp.h>
|
||||||
|
|
||||||
|
// This is an implementation of the __builtin_return_address GCC
|
||||||
|
// extension for the MSVC compiler.
|
||||||
|
//
|
||||||
|
// Author: Unknown
|
||||||
|
// Modified by David Capello to return NULL when the callstack
|
||||||
|
// is not as high as the specified "level".
|
||||||
|
//
|
||||||
|
__declspec (naked) void* __builtin_return_address(int level)
|
||||||
|
{
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push ebx
|
||||||
|
|
||||||
|
mov eax, ebp
|
||||||
|
mov ebx, DWORD PTR [esp + 8] // level
|
||||||
|
__next:
|
||||||
|
test ebx, ebx
|
||||||
|
je __break
|
||||||
|
dec ebx
|
||||||
|
mov eax, DWORD PTR [eax]
|
||||||
|
test eax, eax
|
||||||
|
je __done
|
||||||
|
jmp __next
|
||||||
|
__break:
|
||||||
|
mov eax, DWORD PTR [eax + 4]
|
||||||
|
__done:
|
||||||
|
pop ebx
|
||||||
|
ret
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct slot_t
|
typedef struct slot_t
|
||||||
{
|
{
|
||||||
void* backtrace[4];
|
void* backtrace[BACKTRACE_LEVELS];
|
||||||
void* ptr;
|
void* ptr;
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
struct slot_t* next;
|
struct slot_t* next;
|
||||||
} slot_t;
|
} slot_t;
|
||||||
|
|
||||||
|
static bool memleak_status = false;
|
||||||
static slot_t* headslot;
|
static slot_t* headslot;
|
||||||
static JMutex mutex;
|
static JMutex mutex;
|
||||||
|
|
||||||
void jmemleak_init()
|
void jmemleak_init()
|
||||||
{
|
{
|
||||||
|
assert(!memleak_status);
|
||||||
|
|
||||||
headslot = NULL;
|
headslot = NULL;
|
||||||
mutex = jmutex_new();
|
mutex = jmutex_new();
|
||||||
|
|
||||||
|
memleak_status = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void jmemleak_exit()
|
void jmemleak_exit()
|
||||||
{
|
{
|
||||||
|
assert(memleak_status);
|
||||||
|
memleak_status = false;
|
||||||
|
|
||||||
FILE* f = fopen("_ase_memlog.txt", "wt");
|
FILE* f = fopen("_ase_memlog.txt", "wt");
|
||||||
slot_t* it;
|
slot_t* it;
|
||||||
|
|
||||||
if (f != NULL) {
|
if (f != NULL) {
|
||||||
/* memory leaks */
|
#ifdef _MSC_VER
|
||||||
|
struct SYMBOL_INFO_EX {
|
||||||
|
SYMBOL_INFO header;
|
||||||
|
char filename[512];
|
||||||
|
} si;
|
||||||
|
si.header.SizeOfStruct = sizeof(SYMBOL_INFO_EX);
|
||||||
|
|
||||||
|
IMAGEHLP_LINE line;
|
||||||
|
line.SizeOfStruct = sizeof(IMAGEHLP_LINE);
|
||||||
|
|
||||||
|
HANDLE hproc = ::GetCurrentProcess();
|
||||||
|
::SymInitialize(hproc, NULL, FALSE);
|
||||||
|
|
||||||
|
char filename[MAX_PATH];
|
||||||
|
::GetModuleFileName(NULL, filename, sizeof filename);
|
||||||
|
::SymLoadModule(hproc, NULL, filename, NULL, 0, 0);
|
||||||
|
|
||||||
|
char path[MAX_PATH];
|
||||||
|
strcpy(path, filename);
|
||||||
|
if (strrchr(path, '\\'))
|
||||||
|
*strrchr(path, '\\') = 0;
|
||||||
|
else
|
||||||
|
*path = 0;
|
||||||
|
::SymSetSearchPath(hproc, path);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Memory leaks
|
||||||
for (it=headslot; it!=NULL; it=it->next) {
|
for (it=headslot; it!=NULL; it=it->next) {
|
||||||
fprintf(f,
|
fprintf(f, "\nLEAK address: %p, size: %lu\n", it->ptr, it->size);
|
||||||
"Leak:\n%p\n%p\n%p\n%p\nptr: %p, size: %lu\n",
|
|
||||||
it->backtrace[0],
|
for (int c=0; c<BACKTRACE_LEVELS; ++c) {
|
||||||
it->backtrace[1],
|
#ifdef _MSC_VER
|
||||||
it->backtrace[2],
|
DWORD displacement;
|
||||||
it->backtrace[3],
|
if (::SymGetLineFromAddr(hproc, (DWORD)it->backtrace[c], &displacement, &line) &&
|
||||||
it->ptr, it->size);
|
::SymFromAddr(hproc, (DWORD)it->backtrace[c], NULL, &si.header)) {
|
||||||
|
fprintf(f, "%p : %s(%lu) [%s]\n",
|
||||||
|
it->backtrace[c],
|
||||||
|
line.FileName, line.LineNumber,
|
||||||
|
si.header.Name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
fprintf(f, "%p\n", it->backtrace[c]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
::SymCleanup(hproc);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
jmutex_free(mutex);
|
jmutex_free(mutex);
|
||||||
@ -121,15 +209,18 @@ void jmemleak_exit()
|
|||||||
|
|
||||||
static void addslot(void *ptr, unsigned long size)
|
static void addslot(void *ptr, unsigned long size)
|
||||||
{
|
{
|
||||||
|
if (!memleak_status)
|
||||||
|
return;
|
||||||
|
|
||||||
slot_t* p = reinterpret_cast<slot_t*>(malloc(sizeof(slot_t)));
|
slot_t* p = reinterpret_cast<slot_t*>(malloc(sizeof(slot_t)));
|
||||||
|
|
||||||
assert(ptr != NULL);
|
assert(ptr != NULL);
|
||||||
assert(size != 0);
|
assert(size != 0);
|
||||||
|
|
||||||
p->backtrace[0] = __builtin_return_address(4); /* a GCC extension */
|
// __builtin_return_address is a GCC extension
|
||||||
p->backtrace[1] = __builtin_return_address(3);
|
for (int c=0; c<BACKTRACE_LEVELS; ++c)
|
||||||
p->backtrace[2] = __builtin_return_address(2);
|
p->backtrace[c] = __builtin_return_address(BACKTRACE_LEVELS-c);
|
||||||
p->backtrace[3] = __builtin_return_address(1);
|
|
||||||
p->ptr = ptr;
|
p->ptr = ptr;
|
||||||
p->size = size;
|
p->size = size;
|
||||||
p->next = headslot;
|
p->next = headslot;
|
||||||
@ -141,6 +232,9 @@ static void addslot(void *ptr, unsigned long size)
|
|||||||
|
|
||||||
static void delslot(void *ptr)
|
static void delslot(void *ptr)
|
||||||
{
|
{
|
||||||
|
if (!memleak_status)
|
||||||
|
return;
|
||||||
|
|
||||||
slot_t *it, *prev = NULL;
|
slot_t *it, *prev = NULL;
|
||||||
|
|
||||||
assert(ptr != NULL);
|
assert(ptr != NULL);
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro/keyboard.h>
|
#include <allegro/keyboard.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "jinete/jlist.h"
|
#include "jinete/jlist.h"
|
||||||
#include "jinete/jmessage.h"
|
#include "jinete/jmessage.h"
|
||||||
#include "jinete/jrect.h"
|
#include "jinete/jrect.h"
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "jinete/jaccel.h"
|
#include "jinete/jaccel.h"
|
||||||
#include "jinete/jlist.h"
|
#include "jinete/jlist.h"
|
||||||
#include "jinete/jmenu.h"
|
#include "jinete/jmenu.h"
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "jinete/jrect.h"
|
#include "jinete/jrect.h"
|
||||||
|
|
||||||
JRect jrect_new(int x1, int y1, int x2, int y2)
|
JRect jrect_new(int x1, int y1, int x2, int y2)
|
||||||
|
@ -1,3 +1,36 @@
|
|||||||
|
/* Jinete - a GUI library
|
||||||
|
* Copyright (C) 2003-2009 David Capello.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are
|
||||||
|
* met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* * Neither the name of the author nor the names of its contributors may
|
||||||
|
* be used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "jinete/jlist.h"
|
#include "jinete/jlist.h"
|
||||||
#include "jinete/jmessage.h"
|
#include "jinete/jmessage.h"
|
||||||
#include "jinete/jrect.h"
|
#include "jinete/jrect.h"
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
|
|
||||||
#include "jinete/jfont.h"
|
#include "jinete/jfont.h"
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
/* jstream_string is based on streams of HTMLEX */
|
/* jstream_string is based on streams of HTMLEX */
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#ifdef ALLEGRO_WINDOWS
|
#ifdef ALLEGRO_WINDOWS
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro/keyboard.h>
|
#include <allegro/keyboard.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#include <allegro/internal/aintern.h>
|
#include <allegro/internal/aintern.h>
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "jinete/jintern.h"
|
#include "jinete/jintern.h"
|
||||||
#include "jinete/jlist.h"
|
#include "jinete/jlist.h"
|
||||||
#include "jinete/jmessage.h"
|
#include "jinete/jmessage.h"
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
/* #define REPORT_SIGNALS */
|
/* #define REPORT_SIGNALS */
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
#define REDRAW_MOVEMENT
|
#define REDRAW_MOVEMENT
|
||||||
#define MOTION_CURSOR JI_CURSOR_NORMAL
|
#define MOTION_CURSOR JI_CURSOR_NORMAL
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
|
|
||||||
#include "jinete/jinete.h"
|
#include "jinete/jinete.h"
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -908,7 +908,7 @@ static bool editor_msg_proc(JWidget widget, JMessage msg)
|
|||||||
case JM_DESTROY:
|
case JM_DESTROY:
|
||||||
jmanager_remove_timer(editor->mask_timer_id);
|
jmanager_remove_timer(editor->mask_timer_id);
|
||||||
remove_editor(widget);
|
remove_editor(widget);
|
||||||
jfree(editor_data(widget));
|
jfree(editor);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JM_REQSIZE:
|
case JM_REQSIZE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user