The function wCoreCreate in wFrameWindowUpdateBorders is replaced by the wcore creation and the wcore mapping. In this step, the function do the same code but now, in functions that are screen independent.
Signed-off-by: Rodolfo García Peñas (kix) <[email protected]> --- src/framewin.c | 93 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 72 insertions(+), 21 deletions(-) diff --git a/src/framewin.c b/src/framewin.c index db7d5e9..4d5357e 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -239,12 +239,24 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags) fwin->top_width = theight; fwin->flags.titlebar = 1; - fwin->titlebar = wCoreCreate(fwin->core, 0, 0, width + 1, theight); + fwin->titlebar = wcore_create(width + 1, theight); + wcore_map(fwin->titlebar, fwin->core, + fwin->core->screen_ptr, + 0, 0, 0, + fwin->core->screen_ptr->w_depth, + fwin->core->screen_ptr->w_visual, + fwin->core->screen_ptr->w_colormap); if (flags & WFF_LEFT_BUTTON) { fwin->flags.left_button = 1; if (wPreferences.new_style == TS_NEW) { - fwin->left_button = wCoreCreate(fwin->core, 0, 0, bsize, bsize); + fwin->left_button = wcore_create(bsize, bsize); + wcore_map(fwin->left_button, fwin->core, + fwin->core->screen_ptr, + 0, 0, 0, + fwin->core->screen_ptr->w_depth, + fwin->core->screen_ptr->w_visual, + fwin->core->screen_ptr->w_colormap); if (width < theight * 4) fwin->flags.lbutton_dont_fit = 1; @@ -252,8 +264,13 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags) XMapRaised(dpy, fwin->left_button->window); } else if (wPreferences.new_style == TS_OLD) { - fwin->left_button = - wCoreCreate(fwin->titlebar, 3, (theight - bsize) / 2, bsize, bsize); + fwin->left_button = wcore_create(bsize, bsize); + wcore_map(fwin->left_button, fwin->titlebar, + fwin->titlebar->screen_ptr, + 3, (theight - bsize) / 2, 0, + fwin->titlebar->screen_ptr->w_depth, + fwin->titlebar->screen_ptr->w_visual, + fwin->titlebar->screen_ptr->w_colormap); XSetWindowBackground(dpy, fwin->left_button->window, scr->widget_texture->normal.pixel); @@ -264,9 +281,13 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags) XMapRaised(dpy, fwin->left_button->window); } else { - fwin->left_button = - wCoreCreate(fwin->titlebar, 3, (theight-bsize)/2, - bsize, bsize); + fwin->left_button = wcore_create(bsize, bsize); + wcore_map(fwin->left_button, fwin->titlebar, + fwin->titlebar->screen_ptr, + 3, (theight-bsize) / 2, 0, + fwin->titlebar->screen_ptr->w_depth, + fwin->titlebar->screen_ptr->w_visual, + fwin->titlebar->screen_ptr->w_colormap); XSetWindowBackground(dpy, fwin->left_button->window, scr->widget_texture->dark.pixel); @@ -282,16 +303,26 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags) if (flags & WFF_LANGUAGE_BUTTON) { fwin->flags.language_button = 1; if (wPreferences.new_style == TS_NEW) { - fwin->language_button = wCoreCreate(fwin->core, bsize, 0, bsize, bsize); + fwin->language_button = wcore_create(bsize, bsize); + wcore_map(fwin->language_button, fwin->core, + fwin->core->screen_ptr, + bsize, 0, 0, + fwin->core->screen_ptr->w_depth, + fwin->core->screen_ptr->w_visual, + fwin->core->screen_ptr->w_colormap); if (width < theight * 4) fwin->flags.languagebutton_dont_fit = 1; else XMapRaised(dpy, fwin->language_button->window); } else { - fwin->language_button = - wCoreCreate(fwin->titlebar, bsize + 6, (theight - bsize) / 2, - bsize, bsize); + fwin->language_button = wcore_create(bsize, bsize); + wcore_map(fwin->language_button, fwin->titlebar, + fwin->titlebar->screen_ptr, + bsize + 6, (theight - bsize) / 2, 0, + fwin->titlebar->screen_ptr->w_depth, + fwin->titlebar->screen_ptr->w_visual, + fwin->titlebar->screen_ptr->w_colormap); XSetWindowBackground(dpy, fwin->language_button->window, scr->widget_texture->normal.pixel); @@ -307,18 +338,33 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags) if (flags & WFF_RIGHT_BUTTON) { fwin->flags.right_button = 1; if (wPreferences.new_style == TS_NEW) { - fwin->right_button = - wCoreCreate(fwin->core, width - bsize + 1, 0, bsize, bsize); + fwin->right_button = wcore_create(bsize, bsize); + wcore_map(fwin->right_button, fwin->core, + fwin->core->screen_ptr, + width - bsize + 1, 0, 0, + fwin->core->screen_ptr->w_depth, + fwin->core->screen_ptr->w_visual, + fwin->core->screen_ptr->w_colormap); } else if (wPreferences.new_style == TS_OLD) { - fwin->right_button = - wCoreCreate(fwin->titlebar, width - bsize - 3, - (theight - bsize) / 2, bsize, bsize); + fwin->right_button = wcore_create(bsize, bsize); + wcore_map(fwin->right_button, fwin->titlebar, + fwin->titlebar->screen_ptr, + width - bsize - 3, (theight - bsize) / 2, 0, + fwin->titlebar->screen_ptr->w_depth, + fwin->titlebar->screen_ptr->w_visual, + fwin->titlebar->screen_ptr->w_colormap); + XSetWindowBackground(dpy, fwin->right_button->window, scr->widget_texture->normal.pixel); } else { - fwin->right_button = - wCoreCreate(fwin->titlebar, width-bsize-3, - (theight-bsize)/2, bsize, bsize); + fwin->right_button = wcore_create(bsize, bsize); + wcore_map(fwin->right_button, fwin->titlebar, + fwin->titlebar->screen_ptr, + width - bsize - 3, (theight - bsize) / 2, 0, + fwin->titlebar->screen_ptr->w_depth, + fwin->titlebar->screen_ptr->w_visual, + fwin->titlebar->screen_ptr->w_colormap); + XSetWindowBackground(dpy, fwin->right_button->window, scr->widget_texture->dark.pixel); } @@ -344,8 +390,13 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags) if (!fwin->resizebar) { fwin->flags.resizebar = 1; - fwin->resizebar = wCoreCreate(fwin->core, 0, - height + fwin->top_width, width, RESIZEBAR_HEIGHT); + fwin->resizebar = wcore_create(width, RESIZEBAR_HEIGHT); + wcore_map(fwin->resizebar, fwin->core, fwin->core->screen_ptr, + 0, height + fwin->top_width, 0, + fwin->core->screen_ptr->w_depth, + fwin->core->screen_ptr->w_visual, + fwin->core->screen_ptr->w_colormap); + fwin->resizebar_corner_width = RESIZEBAR_CORNER_WIDTH; if (width < RESIZEBAR_CORNER_WIDTH * 2 + RESIZEBAR_MIN_WIDTH) { fwin->resizebar_corner_width = (width - RESIZEBAR_MIN_WIDTH) / 2; -- 1.8.4.rc3 -- To unsubscribe, send mail to [email protected].
