mhm
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@8 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
parent
19eec89b60
commit
bf857097e5
11 changed files with 2020 additions and 29 deletions
10
src/core.c
Normal file
10
src/core.c
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/* $Id$ */
|
||||
#include <Milsko/Milsko.h>
|
||||
|
||||
HMILSKO MilskoCreateWidget(HMILSKO parent, int x, int y, unsigned int width, unsigned int height) {
|
||||
HMILSKO h = malloc(sizeof(*h));
|
||||
}
|
||||
|
||||
void MilskoDestroyWidget(HMILSKO handle) {
|
||||
free(handle);
|
||||
}
|
||||
3
src/ds.c
Normal file
3
src/ds.c
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
/* $Id$ */
|
||||
#define STB_DS_IMPLEMENTATION
|
||||
#include "stb_ds.h"
|
||||
1934
src/stb_ds.h
Normal file
1934
src/stb_ds.h
Normal file
File diff suppressed because it is too large
Load diff
20
src/x11.c
20
src/x11.c
|
|
@ -1,13 +1,11 @@
|
|||
/* $Id$ */
|
||||
#include <Milsko/Milsko.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static unsigned long mask = ExposureMask | StructureNotifyMask | ButtonPressMask | ButtonReleaseMask;
|
||||
|
||||
HMILSKO MilskoLLCreate(HMILSKO parent, int x, int y, int width, int height) {
|
||||
HMILSKO r;
|
||||
Window p;
|
||||
HMILSKOLL MilskoLLCreate(HMILSKOLL parent, int x, int y, int width, int height) {
|
||||
HMILSKOLL r;
|
||||
Window p;
|
||||
|
||||
r = malloc(sizeof(*r));
|
||||
r->x = x;
|
||||
|
|
@ -32,13 +30,13 @@ HMILSKO MilskoLLCreate(HMILSKO parent, int x, int y, int width, int height) {
|
|||
return r;
|
||||
}
|
||||
|
||||
void MilskoLLDestroy(HMILSKO handle) {
|
||||
void MilskoLLDestroy(HMILSKOLL handle) {
|
||||
XFreeGC(handle->display, handle->gc);
|
||||
XDestroyWindow(handle->display, handle->window);
|
||||
free(handle);
|
||||
}
|
||||
|
||||
void MilskoLLPolygon(HMILSKO handle, MilskoPoint* points, int points_count, HMILSKOCOLOR color) {
|
||||
void MilskoLLPolygon(HMILSKOLL handle, MilskoPoint* points, int points_count, HMILSKOCOLOR color) {
|
||||
int i;
|
||||
XPoint* p = malloc(sizeof(*p) * points_count);
|
||||
|
||||
|
|
@ -53,7 +51,7 @@ void MilskoLLPolygon(HMILSKO handle, MilskoPoint* points, int points_count, HMIL
|
|||
free(p);
|
||||
}
|
||||
|
||||
HMILSKOCOLOR MilskoLLAllocColor(HMILSKO handle, int r, int g, int b) {
|
||||
HMILSKOCOLOR MilskoLLAllocColor(HMILSKOLL handle, int r, int g, int b) {
|
||||
HMILSKOCOLOR c = malloc(sizeof(*c));
|
||||
XColor xc;
|
||||
xc.red = 256 * r;
|
||||
|
|
@ -65,7 +63,7 @@ HMILSKOCOLOR MilskoLLAllocColor(HMILSKO handle, int r, int g, int b) {
|
|||
return c;
|
||||
}
|
||||
|
||||
void MilskoLLGetXYWH(HMILSKO handle, int* x, int* y, unsigned int* w, unsigned int* h) {
|
||||
void MilskoLLGetXYWH(HMILSKOLL handle, int* x, int* y, unsigned int* w, unsigned int* h) {
|
||||
*x = handle->x;
|
||||
*y = handle->y;
|
||||
*w = handle->width;
|
||||
|
|
@ -76,7 +74,7 @@ void MilskoLLFreeColor(HMILSKOCOLOR color) {
|
|||
free(color);
|
||||
}
|
||||
|
||||
int MilskoLLPending(HMILSKO handle) {
|
||||
int MilskoLLPending(HMILSKOLL handle) {
|
||||
XEvent ev;
|
||||
if(XCheckWindowEvent(handle->display, handle->window, mask, &ev)) {
|
||||
XPutBackEvent(handle->display, &ev);
|
||||
|
|
@ -85,7 +83,7 @@ int MilskoLLPending(HMILSKO handle) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void MilskoLLNextEvent(HMILSKO handle) {
|
||||
void MilskoLLNextEvent(HMILSKOLL handle) {
|
||||
XEvent ev;
|
||||
if(XCheckWindowEvent(handle->display, handle->window, mask, &ev)) {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue