fix pixmap leak

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@82 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-09-30 17:47:03 +00:00
parent e74b80da50
commit 8ea2d4a50a
15 changed files with 9359 additions and 1256 deletions

View File

@@ -106,6 +106,14 @@ MWDECL void MwSetInteger(MwWidget handle, const char* key, int n);
*/
MWDECL void MwSetText(MwWidget handle, const char* key, const char* value);
/*!
* %brief Sets a void pointer property
* %param handle Widget
* %param key Key
* %param value Value
*/
MWDECL void MwSetVoid(MwWidget handle, const char* key, void* value);
/*!
* %brief Gets the integer property
* %param handle Widget
@@ -122,6 +130,14 @@ MWDECL int MwGetInteger(MwWidget handle, const char* key);
*/
MWDECL const char* MwGetText(MwWidget handle, const char* key);
/*!
* %brief Gets the void pointer property
* %param handle Widget
* %param key Key
* %return Value
*/
MWDECL void* MwGetVoid(MwWidget handle, const char* key);
/*!
* %brief Sets the default property
* %param handle Widget

View File

@@ -60,6 +60,14 @@ MWDECL void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int in
*/
MWDECL void MwDrawText(MwWidget handle, MwPoint* point, const char* text, MwLLColor color);
/*!
* %brief Creates a pixmap from image
* %param handle Widget
* %param path Path
* %return Pixmap
*/
MWDECL MwLLPixmap MwLoadImage(MwWidget handle, const char* path);
#ifdef __cplusplus
}
#endif

View File

@@ -16,6 +16,8 @@
#define MwNbackground "Sbackground"
#define MwNforeground "Sforeground"
#define MwNpixmap "Vpixmap"
#define MwNactivateHandler "Cactivate"
#define MwNresizeHandler "Cresize"
#define MwNtickHandler "Ctick"

View File

@@ -14,6 +14,7 @@ typedef struct _MwRect MwRect;
typedef struct _MwIntegerKeyValue MwIntegerKeyValue;
typedef struct _MwTextKeyValue MwTextKeyValue;
typedef struct _MwUserHandlerKeyValue MwUserHandlerKeyValue;
typedef struct _MwVoidKeyValue MwVoidKeyValue;
typedef struct _MwFont MwFont;
#ifdef _MILSKO
typedef struct _MwWidget *MwWidget, MwWidgetRec;
@@ -56,6 +57,11 @@ struct _MwUserHandlerKeyValue {
MwUserHandler value;
};
struct _MwVoidKeyValue {
char* key;
void* value;
};
#ifdef _MILSKO
struct _MwWidget {
char* name;
@@ -74,6 +80,7 @@ struct _MwWidget {
MwIntegerKeyValue* integer;
MwTextKeyValue* text;
MwUserHandlerKeyValue* handler;
MwVoidKeyValue* data;
};
#endif

View File

@@ -19,11 +19,15 @@
struct _MwLL {
Display* display;
Window window;
Pixmap pixmap;
GC gc;
Colormap colormap;
void* user;
Atom wm_delete;
unsigned int width;
unsigned int height;
MwLLHandler handler;
};