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;
|
||||
GC gc;
|
||||
Colormap colormap;
|
||||
int x;
|
||||
int y;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
}* HMILSKO;
|
||||
|
||||
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;
|
||||
|
||||
r = malloc(sizeof(*r));
|
||||
r->x = x;
|
||||
r->y = y;
|
||||
r->width = width;
|
||||
r->height = height;
|
||||
|
||||
if(parent == NULL){
|
||||
r->display = XOpenDisplay(NULL);
|
||||
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){
|
||||
Window root;
|
||||
unsigned int depth, border;
|
||||
|
||||
XGetGeometry(handle->display, handle->window, &root, x, y, w, h, &border, &depth);
|
||||
*x = handle->x;
|
||||
*y = handle->y;
|
||||
*w = handle->width;
|
||||
*h = handle->height;
|
||||
}
|
||||
|
||||
void MilskoLLFreeColor(HMILSKOCOLOR color){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue