a
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@5 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
parent
6f3439fc39
commit
a14d3e9f58
2 changed files with 13 additions and 4 deletions
|
|
@ -10,6 +10,10 @@ typedef struct __Milsko {
|
||||||
Window window;
|
Window window;
|
||||||
GC gc;
|
GC gc;
|
||||||
Colormap colormap;
|
Colormap colormap;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
unsigned int width;
|
||||||
|
unsigned int height;
|
||||||
}* HMILSKO;
|
}* HMILSKO;
|
||||||
|
|
||||||
typedef struct __MilskoColor {
|
typedef struct __MilskoColor {
|
||||||
|
|
|
||||||
13
src/x11.c
13
src/x11.c
|
|
@ -10,6 +10,11 @@ HMILSKO MilskoLLCreate(HMILSKO parent, int x, int y, int width, int height){
|
||||||
Window p;
|
Window p;
|
||||||
|
|
||||||
r = malloc(sizeof(*r));
|
r = malloc(sizeof(*r));
|
||||||
|
r->x = x;
|
||||||
|
r->y = y;
|
||||||
|
r->width = width;
|
||||||
|
r->height = height;
|
||||||
|
|
||||||
if(parent == NULL){
|
if(parent == NULL){
|
||||||
r->display = XOpenDisplay(NULL);
|
r->display = XOpenDisplay(NULL);
|
||||||
p = XRootWindow(r->display, XDefaultScreen(r->display));
|
p = XRootWindow(r->display, XDefaultScreen(r->display));
|
||||||
|
|
@ -61,10 +66,10 @@ HMILSKOCOLOR MilskoLLAllocColor(HMILSKO handle, int r, int g, int b){
|
||||||
}
|
}
|
||||||
|
|
||||||
void MilskoLLGetXYWH(HMILSKO handle, int* x, int* y, unsigned int* w, unsigned int* h){
|
void MilskoLLGetXYWH(HMILSKO handle, int* x, int* y, unsigned int* w, unsigned int* h){
|
||||||
Window root;
|
*x = handle->x;
|
||||||
unsigned int depth, border;
|
*y = handle->y;
|
||||||
|
*w = handle->width;
|
||||||
XGetGeometry(handle->display, handle->window, &root, x, y, w, h, &border, &depth);
|
*h = handle->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MilskoLLFreeColor(HMILSKOCOLOR color){
|
void MilskoLLFreeColor(HMILSKOCOLOR color){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue