mirror of
https://github.com/gnustep/libs-back.git
synced 2025-05-30 17:00:52 +00:00
Move window creation to a private theme method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/branches/theme_window_override@35136 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d4c29acec6
commit
4ab65eaadc
1 changed files with 74 additions and 56 deletions
|
@ -43,6 +43,7 @@
|
||||||
#include <AppKit/NSWindow.h>
|
#include <AppKit/NSWindow.h>
|
||||||
#include <AppKit/NSImage.h>
|
#include <AppKit/NSImage.h>
|
||||||
#include <AppKit/NSBitmapImageRep.h>
|
#include <AppKit/NSBitmapImageRep.h>
|
||||||
|
#include <GNUstepGUI/GSTheme.h>
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -94,6 +95,54 @@ static NSMapTable *windowtags = NULL;
|
||||||
static int last_win_num = 0;
|
static int last_win_num = 0;
|
||||||
|
|
||||||
|
|
||||||
|
@interface GSTheme (Backend)
|
||||||
|
- (Window) createWindowWithDisplay: (Display *)disp
|
||||||
|
parent: (Window)parent
|
||||||
|
X: (int)x
|
||||||
|
Y: (int)y
|
||||||
|
width: (unsigned int)width
|
||||||
|
height: (unsigned int)height
|
||||||
|
borderWidth: (unsigned int)borderWidth
|
||||||
|
depth: (int)depth
|
||||||
|
class: (unsigned int)cls
|
||||||
|
visual: (Visual *)visual
|
||||||
|
valuemask: (unsigned long)valuemask
|
||||||
|
attributes: (XSetWindowAttributes *)attrs;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation GSTheme (Backend)
|
||||||
|
// Create Window method...
|
||||||
|
- (Window) createWindowWithDisplay: (Display *)disp
|
||||||
|
parent: (Window)parent
|
||||||
|
X: (int)x
|
||||||
|
Y: (int)y
|
||||||
|
width: (unsigned int)width
|
||||||
|
height: (unsigned int)height
|
||||||
|
borderWidth: (unsigned int)borderWidth
|
||||||
|
depth: (int)depth
|
||||||
|
class: (unsigned int)cls
|
||||||
|
visual: (Visual *)visual
|
||||||
|
valuemask: (unsigned long)valuemask
|
||||||
|
attributes: (XSetWindowAttributes *)attrs
|
||||||
|
{
|
||||||
|
Window ident;
|
||||||
|
ident = XCreateWindow(disp,
|
||||||
|
parent,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
borderWidth,
|
||||||
|
depth,
|
||||||
|
cls,
|
||||||
|
visual,
|
||||||
|
valuemask,
|
||||||
|
attrs);
|
||||||
|
return ident;
|
||||||
|
}
|
||||||
|
// End create window method...
|
||||||
|
@end
|
||||||
|
|
||||||
@interface NSCursor (BackendPrivate)
|
@interface NSCursor (BackendPrivate)
|
||||||
- (void *)_cid;
|
- (void *)_cid;
|
||||||
@end
|
@end
|
||||||
|
@ -791,19 +840,19 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
||||||
window->xwn_attrs.save_under = False;
|
window->xwn_attrs.save_under = False;
|
||||||
window->xwn_attrs.override_redirect = False;
|
window->xwn_attrs.override_redirect = False;
|
||||||
|
|
||||||
window->ident = [self createWindowWithDisplay: dpy
|
window->ident = [[GSTheme theme] createWindowWithDisplay: dpy
|
||||||
parent: window->root
|
parent: window->root
|
||||||
X: NSMinX(frame)
|
X: NSMinX(frame)
|
||||||
Y: NSMinY(frame)
|
Y: NSMinY(frame)
|
||||||
width: NSWidth(frame)
|
width: NSWidth(frame)
|
||||||
height: NSHeight(frame)
|
height: NSHeight(frame)
|
||||||
borderWidth: 0
|
borderWidth: 0
|
||||||
depth: context->depth
|
depth: context->depth
|
||||||
class: CopyFromParent
|
class: CopyFromParent
|
||||||
visual: context->visual
|
visual: context->visual
|
||||||
valuemask: (CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect)
|
valuemask: (CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect)
|
||||||
attributes: &window->xwn_attrs];
|
attributes: &window->xwn_attrs];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
window->ident = XCreateWindow(dpy, window->root,
|
window->ident = XCreateWindow(dpy, window->root,
|
||||||
NSMinX(frame), NSMinY(frame),
|
NSMinX(frame), NSMinY(frame),
|
||||||
|
@ -1965,37 +2014,6 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create Window method...
|
|
||||||
- (Window) createWindowWithDisplay: (Display *)disp
|
|
||||||
parent: (Window)parent
|
|
||||||
X: (int)x
|
|
||||||
Y: (int)y
|
|
||||||
width: (unsigned int)width
|
|
||||||
height: (unsigned int)height
|
|
||||||
borderWidth: (unsigned int)borderWidth
|
|
||||||
depth: (int)depth
|
|
||||||
class: (unsigned int)cls
|
|
||||||
visual: (Visual *)visual
|
|
||||||
valuemask: (unsigned long)valuemask
|
|
||||||
attributes: (XSetWindowAttributes *)attrs
|
|
||||||
{
|
|
||||||
Window ident;
|
|
||||||
ident = XCreateWindow(disp,
|
|
||||||
parent,
|
|
||||||
x,
|
|
||||||
y,
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
borderWidth,
|
|
||||||
depth,
|
|
||||||
cls,
|
|
||||||
visual,
|
|
||||||
valuemask,
|
|
||||||
attrs);
|
|
||||||
return ident;
|
|
||||||
}
|
|
||||||
// End create window method...
|
|
||||||
|
|
||||||
- (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style
|
- (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style
|
||||||
: (int)screen
|
: (int)screen
|
||||||
{
|
{
|
||||||
|
@ -2052,18 +2070,18 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
||||||
*/
|
*/
|
||||||
window->xwn_attrs.override_redirect = False;
|
window->xwn_attrs.override_redirect = False;
|
||||||
|
|
||||||
window->ident = [self createWindowWithDisplay: dpy
|
window->ident = [[GSTheme theme] createWindowWithDisplay: dpy
|
||||||
parent: window->root
|
parent: window->root
|
||||||
X: NSMinX(frame)
|
X: NSMinX(frame)
|
||||||
Y: NSMinY(frame)
|
Y: NSMinY(frame)
|
||||||
width: NSWidth(frame)
|
width: NSWidth(frame)
|
||||||
height: NSHeight(frame)
|
height: NSHeight(frame)
|
||||||
borderWidth: 0
|
borderWidth: 0
|
||||||
depth: context->depth
|
depth: context->depth
|
||||||
class: CopyFromParent
|
class: CopyFromParent
|
||||||
visual: context->visual
|
visual: context->visual
|
||||||
valuemask: (CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect)
|
valuemask: (CWColormap | CWBackPixel | CWBorderPixel | CWOverrideRedirect)
|
||||||
attributes: &window->xwn_attrs];
|
attributes: &window->xwn_attrs];
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue